WO2024148865A1 - Secure storage method, apparatus and device, and non-volatile readable storage medium - Google Patents
Secure storage method, apparatus and device, and non-volatile readable storage medium Download PDFInfo
- Publication number
- WO2024148865A1 WO2024148865A1 PCT/CN2023/121828 CN2023121828W WO2024148865A1 WO 2024148865 A1 WO2024148865 A1 WO 2024148865A1 CN 2023121828 W CN2023121828 W CN 2023121828W WO 2024148865 A1 WO2024148865 A1 WO 2024148865A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- old
- data
- target data
- target
- disk
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Ceased
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/14—Error detection or correction of the data by redundancy in operation
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Definitions
- the present application relates to the field of storage technology, and in particular to a secure storage method, device, equipment and non-volatile readable storage medium.
- the "write hole” problem is a difficult problem of RAID (Redundant Array of Independent Disks), especially for soft RAID solutions. If you want to pursue the ultimate data security, then the IO (Input/Output) performance will be greatly reduced, for example, the PPL (Partial Parity LockLog) method of Linux's MDRAID. Generally speaking, only the hard RAID solution can solve the "write hole” problem while maintaining high system IO performance. Generally speaking, when a storage anomaly occurs while writing to a storage device managed by RAID (RAID1/5/6), there is a certain probability that the "write hole” problem will occur.
- the "write hole” problem scenario can be divided into: hard disk failure occurs after the anomaly, hard disk failure occurs during the anomaly and recovery process, and hard disk failure occurs before the anomaly. Before, during, or after the anomaly, if the "write hole" cannot be properly handled, it will cause permanent data loss.
- NVRAM Non-Volatile Random Access Memory
- the first method requires increasing the hardware resources of NVRAM, and the storage resources of NVRAM are limited.
- the second log method seems perfect, but multiple reading and writing of the underlying file system will seriously affect performance.
- the purpose of this application is to provide a secure storage method, device, equipment and non-volatile readable storage medium, which can solve the "write hole" problem while maintaining high system IO performance, and improve the data security and user experience of the disk array card without increasing hardware costs.
- the optional solutions are as follows:
- a first aspect of the present application provides a secure storage method, which is applied to a disk array card, comprising:
- the array controller is controlled to read the first address parameter in the target log according to the input/output request, and obtain the old target data and the old verification data from the disk array card according to the first address parameter; wherein, The target log is used to record the verification and update status of the array controller;
- An XOR operation is performed on the old target data and the old verification data to obtain a first XOR result and the first XOR result is stored in a corresponding hard disk of the disk array card, so that the complete old target data and the old verification data can be restored according to the first XOR result when a storage abnormality occurs.
- the method further includes:
- the new target data and the new verification data are stored in the corresponding hard disk of the disk array card to ensure the consistency of data and verification when the storage is normal.
- the method further includes:
- obtaining new target data corresponding to old target data from the host side according to the input/output write request includes:
- the array controller is controlled to read the second address parameter in the target log according to the input/output request, and obtain new target data from the memory on the host side according to the second address parameter.
- the method further includes:
- new verification data is obtained according to the new target data, the old target data and the old verification data, including:
- an XOR operation is performed on the old target data and the new target data to obtain a second XOR result, and an XOR operation is performed on the second XOR result and the old verification data to obtain a third XOR result;
- the third XOR result is used as new verification data.
- obtaining old target data and old verification data from a disk array card according to the first address parameter includes:
- performing an XOR operation on the old target data and the old verification data to obtain a first XOR result includes:
- An XOR operation is performed on the old target data and the old verification data in the memory of the disk array card to obtain a first XOR result.
- storing the first XOR result to a corresponding hard disk of the disk array card includes:
- the first XOR result is stored in the atomic parity update area of the check disk of the disk array card storing the old check data, so that when a storage abnormality occurs, the first XOR result is read from the atomic parity update area and the complete old target data and old check data are restored according to the first XOR result.
- obtaining old target data and old verification data from a disk array card according to the first address parameter includes:
- disk array card includes multiple check disks, old target data and multiple old check data are obtained from the disk array card according to the first address parameter; wherein one check disk stores one check data;
- performing an XOR operation on the old target data and the old verification data to obtain a first XOR result and storing the first XOR result in a corresponding hard disk of the disk array card includes:
- each first XOR result is stored in the atomic parity update area of the corresponding verification disk, so that when a storage abnormality occurs, each first XOR result is read from each atomic parity update area and the corresponding old target data and old verification data are restored according to each first XOR result.
- restoring the complete old target data and old verification data according to the first XOR result includes:
- a target recovery algorithm is determined according to the state parameters, so as to execute the recovery process using the target recovery algorithm.
- a target recovery algorithm is determined according to the state parameters, including:
- the target recovery algorithm is determined according to the corresponding relationship between the state parameters and the recovery algorithm.
- the recovery algorithm includes a block segmentation recovery algorithm and a Galois field algorithm.
- a target recovery algorithm is used to perform the recovery process, including:
- the slot parameters and control block parameters in the target log are read; the slot parameters represent the location of the atomic parity update area of the check disk, and the control block parameters determine the current data page chain where the data block is located and locate the data cache area of the current data page chain.
- the target recovery algorithm is used to read the first XOR result from the atomic parity update area according to the slot parameter, and the recovery process is executed through the control block parameter function pointer.
- the array controller is controlled to initialize and assign values to the parameters in the target log according to the array creation instruction.
- the array creation instruction is a command line parameter for creating an array sent by a user through a host side.
- the driver that controls the disk array card firmware layer parses the command line parameters and transparently transmits the parsed parameters to the array controller, so that the array controller initializes and assigns values to the parameters in the target log according to the parsed parameters.
- the method before restoring the complete old target data and the old verification data according to the first XOR result, the method further includes:
- Whether the disk array card has abnormal power failure is detected by timer polling. If abnormal power failure is detected, the storage is determined to be abnormal.
- the target log is stored in a non-volatile random access memory or a memory protected from power failure.
- a second aspect of the present application provides a secure storage device, applied to a disk array card, comprising:
- a request acquisition module is configured to acquire an input/output write request sent by a host side
- the first reading module is configured to control the array controller to read the target log according to the input and output request.
- the target log is used to read the first address parameter of the array controller, and obtain the old target data and the old verification data from the disk array card according to the first address parameter; wherein the target log is used to record the verification update of the array controller;
- the first operation and recovery module is configured to perform an XOR operation on the old target data and the old verification data to obtain a first XOR result and store the first XOR result in a corresponding hard disk of the disk array card, so as to restore the complete old target data and the old verification data according to the first XOR result when a storage abnormality occurs.
- a third aspect of the present application provides an electronic device, comprising a processor and a memory; wherein the memory is configured to store a computer program, and the computer program is loaded and executed by the processor to implement the aforementioned secure storage method.
- the fourth aspect of the present application provides a computer non-volatile readable storage medium, in which computer executable instructions are stored.
- the computer executable instructions are loaded and executed by a processor, the aforementioned secure storage method is implemented.
- the input/output write request sent by the host side is first obtained; then the array controller is controlled to read the first address parameter in the target log according to the input/output request, and the old target data and the old verification data are obtained from the disk array card according to the first address parameter; wherein the target log is used to record the verification and update of the array controller; finally, the old target data and the old verification data are XORed to obtain the first XOR result and the first XOR result is stored in the corresponding hard disk of the disk array card, so that the complete old target data and the old verification data can be restored according to the first XOR result when the storage is abnormal.
- the present application introduces the concept of the target log, which is used to record the verification and update of the array controller.
- the old target data and the old verification data are obtained according to the parameters in the target log, so as to generate an XOR result, which is used to restore the data when the storage is abnormal, thereby solving the "write hole" problem while continuing to maintain a high system IO performance, and improving the data security and user experience of the disk array card without increasing the hardware cost.
- FIG1 is a flow chart of a secure storage method provided by the present application.
- FIG2 is an example diagram of an optional PUFP format definition provided by the present application.
- FIG3 is a schematic diagram of an optional secure storage method provided by the present application.
- FIG4 is a flow chart of an optional secure storage method provided by the present application.
- FIG5 is a scenario analysis diagram of a write process "write hole" problem in RAID5 provided by the present application.
- FIG6 is a detailed example diagram of a RAID5 write hole protection provided by the present application.
- FIG. 7 is an example diagram of the “inlineXoR” operation in FIG. 6 provided by the present application.
- FIG8 is a detailed example diagram of write hole protection of RAID6 provided by the present application.
- FIG9 is a schematic diagram of the structure of a secure storage device provided by the present application.
- FIG10 is a structural diagram of a secure storage electronic device provided in the present application.
- Non-volatile memory NVRAM as a write cache to achieve the purpose of atomic write operations
- the other is to use the design concept of the file system's Journal (log) to achieve atomic processing of write requests.
- the first method requires increasing the hardware resources of NVRAM, and the storage resources of NVRAM are limited.
- the second log method seems perfect, multiple reads and writes to the underlying file system will seriously affect performance.
- the present application provides a secure storage solution, introducing the concept of a target log, which is used to record the verification and update of the array controller.
- the old target data and the old verification data are obtained according to the parameters in the target log, so as to generate an XOR result, which is used to restore data when storage is abnormal, thereby solving the "write hole" problem while continuing to maintain a high system IO performance, and improving the data security and user experience of the disk array card without increasing hardware costs.
- FIG1 is a flow chart of a secure storage method provided in an embodiment of the present application.
- the secure storage method is applied to a disk array card, and includes:
- the disk array card first obtains the input and output write request sent by the host side.
- the disk array card is a RAID card, which is composed of multiple storage arrays (RAID arrays), array controllers (RAID card controllers), CPUs, memory and other components.
- the storage array is composed of multiple SSD disks.
- the RAID card composed of SSD disks has the advantage of faster read and write performance than the RAID card composed of HDD disks.
- write hole protection The most basic requirement for write hole protection is that "data covered by the RAID protection capability will never be lost". Specifically, in a stripe affected by a "write hole", the data can be simply divided into two categories. One category is the data units that are directly overwritten by this IO, while other data units are not directly overwritten, but during the update process of other data and check data in the same stripe, the stripe potentially loses the protection of these data. Based on this, this embodiment defines two write hole protection levels, namely DPC and WRA.
- DPC Data-Parity Consistency
- WRA Write Atomic
- S12 Control the array controller to read the first address parameter in the target log according to the input/output request, and obtain old target data and old verification data from the disk array card according to the first address parameter; wherein the target log is used to record verification and update status of the array controller.
- the array controller is controlled to read the first address parameter in the target log according to the input and output request, and obtain the old target data and the old verification data from the disk array card according to the first address parameter; wherein the target log is used to record the verification update of the array controller.
- the setting of the target log here is a hardware-based write hole protection method proposed in this embodiment, also known as PUFP (Parity
- PUFP a hardware-based write hole protection method proposed in this embodiment, also known as PUFP (Parity
- PUFP mechanism is a write-hole protection mechanism.
- the content of the target log PUFP is a log that records the verification (stripe) updates performed by the RAID card controller chip.
- PUFP Whenever a write update of a stripe is successfully locked, a PUFP unit is allocated at the same time to track and record the update of the verification. The initialization is performed by the RAID card engine at the beginning of the allocation (16B write).
- the size of a PUFP is 16 bytes or 32 bytes (PUFP+), and the format content is shown in Figure 2.
- PUFP is generally stored in non-volatile random access memory (non-volatile NVRAM) or in memory protected by storage anomalies. During normal operation, only overwrite write operations will be performed on PUFP.
- the old target data and old verification data are moved to the memory of the disk array card.
- the first address parameter is the startLBA parameter, which indicates the starting LBA (38 bits, covering 1PB data storage space) in the current namespace and is written once when the RAID card is initialized.
- the physical address of the corresponding hard disk in the RAID card is located by the startLBA parameter.
- the old target data D is read to the local DDR of the RAID card.
- the old verification data P is read from the corresponding hard disk to the local DDR of the RAID card.
- an XOR operation is performed on the old target data and the old verification data to obtain a first XOR result and the first XOR result is stored in the corresponding hard disk of the disk array card, so that the complete old target data and the old verification data can be restored according to the first XOR result when a storage abnormality occurs.
- an XOR operation is performed on the old target data and the old verification data in the memory of the disk array card to obtain the first XOR result. That is, pplP is obtained by XORing the old verification data P and the old target data D, and pplP is the basis for data recovery.
- the new data needs to be written to the disk.
- the data can be written to the disk normally. That is, it is also necessary to obtain new target data corresponding to the old target data from the host side according to the input and output write request, and obtain new verification data according to the new target data, the old target data and the old verification data.
- the control array controller reads the second address parameter in the target log according to the input and output request, and obtains the new target data from the memory on the host side according to the second address parameter.
- the second address parameters here are the two parameters logicDeviceID and nsID, where the logicDeviceID parameter represents the logical disk location ID within the RAID group, which is used to identify the hard disk processed by the current write operation, and the nsID parameter is the Namespace ID, which is written once when the RAID card is initialized.
- the new target data is moved to the memory of the disk array card, and the old target data and the new target data are XORed in the memory of the disk array card to obtain the second XOR result, and the second XOR result and the old verification data are XORed to obtain the third XOR result, and finally the third XOR result is used as the new verification data. That is, the new target data D' and the old target data D are XORed to obtain ⁇ D, and then the new verification data P' is XORed by ⁇ D and P.
- the new target data and the new verification data are stored in the corresponding hard disk of the disk array card to ensure data and verification consistency when the storage is normal. D', P', and pplP are all written to the corresponding hard disk. After that, the new parameter value is obtained and the new parameter value is used to overwrite the parameter in the target log.
- the embodiment of the present application first obtains the input/output write request sent by the host side; then controls the array controller to read the first address parameter in the target log according to the input/output request, and The address parameters are used to obtain the old target data and the old verification data from the disk array card; wherein the target log is used to record the verification update of the array controller; finally, the old target data and the old verification data are XORed to obtain the first XOR result and the first XOR result is stored in the corresponding hard disk of the disk array card, so that the complete old target data and the old verification data can be restored according to the first XOR result when the storage is abnormal.
- the embodiment of the present application introduces the concept of a target log, which is used to record the verification update of the array controller.
- the old target data and the old verification data are obtained according to the parameters in the target log, so as to generate an XOR result.
- This XOR result is used to restore data when the storage is abnormal, thereby solving the "write hole" problem while continuing to maintain a high system IO performance, and improving the data security and user experience of the disk array card without increasing the hardware cost.
- FIG3 is a flow chart of an optional secure storage method provided in an embodiment of the present application.
- the secure storage method is applied to a disk array card, including:
- S22 Control the array controller to read the first address parameter in the target log according to the input/output request.
- S24 Perform XOR operations on the old target data and each old verification data to obtain multiple first XOR results, and store each first XOR result in the atomic parity update area of the corresponding verification disk, so that when a storage abnormality occurs, each first XOR result is read from each atomic parity update area and the corresponding old target data and old verification data are restored according to each first XOR result.
- the disk array card includes multiple check disks
- old target data and multiple old check data are obtained from the disk array card according to the first address parameter; wherein one check disk stores one check data.
- RAID6 includes a P check disk and a Q check disk.
- the old target data and each old check data are XORed to obtain multiple first XOR results and each first XOR result is stored in the atomic parity update area of the corresponding check disk, so that when a storage abnormality occurs, each first XOR result is read from each atomic parity update area and the corresponding old target data and old check data are restored according to each first XOR result.
- two first XOR results, pplP and pplQ will be obtained. pplP and pplQ need to be written to the P check disk and Q check disk respectively. When the data is restored, pplP and pplQ are read from the P check disk and Q check disk.
- the first XOR result is mainly stored in the atomic parity update area of the check disk, also known as the APU (atomic parity update) area, which is a protection measure taken by the RAID array for the check data generated by the write request.
- the purpose is to ensure that the consistency of the stripe is restored after a storage system abnormality occurs.
- Its content includes the RAID stripe address, data, and check. It can be seen that this embodiment proposes to use the PUFP mechanism and integrate the APU mechanism into the PUFP mechanism.
- the data recovery process when performing data recovery, is mainly started based on the pplP data.
- the state parameters in the target log are read first; wherein the state parameters are the state definition of the check update.
- the target recovery algorithm is determined based on the state parameters to execute the recovery process using the target recovery algorithm.
- the state parameter here is the pufpState parameter, which is mainly the state definition of PUFP and is the main basis for selecting the recovery algorithm during abnormal recovery.
- the target recovery algorithm is mainly determined based on the corresponding relationship between the state parameter and the recovery algorithm.
- the recovery algorithms here include block segmentation recovery algorithm and Galois field algorithm.
- the slot parameters and control block parameters in the target log are read; wherein the slot parameter is the apuCode parameter, which characterizes the position of the atomic parity update area of the check disk, and the control block parameter is the pslCbHandle parameter, which is used to determine the current data page chain where the data block is located and locate the data cache area of the current data page chain.
- the slot parameter is the apuCode parameter, which characterizes the position of the atomic parity update area of the check disk
- the control block parameter is the pslCbHandle parameter, which is used to determine the current data page chain where the data block is located and locate the data cache area of the current data page chain.
- the CB handle of the CB corresponding to the PUFP is recorded in the pslCbHandle parameter, and through this CB handle, the CP chain to which it belongs can be found, the data cache area of the current CP chain can be located, and it can be used for write hole protection recovery and problem tracking and debugging after power failure.
- CP control page
- CB control block
- CB is the data structure that controls the IO or background task.
- the target recovery algorithm is used to read the first XOR result from the atomic parity update area according to the slot parameters, and the recovery process is executed through the control block parameter function pointer.
- S31 Obtaining an array creation instruction sent by the host side; wherein the array creation instruction is a command line parameter for creating an array sent by the user through the host side.
- S32 The driver program of the firmware layer of the disk array card is controlled to parse the command line parameters, and transparently transmit the parsed parameters to the array controller, so that the array controller initializes and assigns values to the parameters in the target log according to the parsed parameters.
- the array creation instruction sent by the host side is obtained; wherein the array creation instruction is the command line parameters for creating the array sent by the user through the host side.
- the array controller is controlled to initialize and assign values to the parameters in the target log according to the array creation instruction. That is, the pufpState, logicDeviceID, nsID, apuCode, dataLength, startLBA, pslCbHandle, dataStructureEntry and other parameters defined in Figure 2 are initialized and assigned values.
- the driver of the firmware layer of the control disk array card parses the command line parameters and transmits the parsed parameters to the array controller so that the array controller initializes and assigns values to the parameters in the target log according to the parsed parameters.
- S34 Control the array controller to read the first address parameter in the target log according to the input/output request, and obtain old target data and old verification data from the disk array card according to the first address parameter; wherein the target log is used to record verification and update status of the array controller.
- S35 Perform an XOR operation on the old target data and the old verification data to obtain a first XOR result and convert the result into the second XOR result.
- the XOR result is stored in the corresponding hard disk of the disk array card.
- S36 Detecting whether the disk array card has abnormal power failure by means of timer rotation training. If it is detected that the disk array card has abnormal power failure, it is determined that the storage is abnormal.
- the disk array card is tested for abnormal power failure by means of timer rotation. If abnormal power failure is detected, the storage is determined to be abnormal. At this time, the complete old target data and old verification data are restored according to the first XOR result. That is, the storage abnormality is power failure, and the "write hole" at this time can be defined as: abnormal shutdown (accidental power failure) + unfinished write operation + storage device failure.
- the "write hole” problem scenarios are divided into the following three types: (1) The hard disk failure occurs after the power is off. At this time, the system is in the "write-through” WT mode (for write IO events, when the write IO data is written to the storage medium of the RAID card, it responds to the HOST). The host sends a 4KB write IO to disk 1. Then, according to the RAID5 "RMW” process, when the system executes step 3 "putting new D1 data on disk” or step 5 "putting new verification data P on disk”, if an unexpected power outage occurs, since it cannot be determined whether the write operation is completed, the data and verification on the stripe will not be consistent.
- step 3 when the system executes step 3 "putting new D1 data on disk” or step 5 "putting new verification data P on disk”, if an unexpected power failure occurs and before all affected stripes are resynchronized after power is turned on again, if data disk 2 is damaged, the data on disk 2 on the stripe cannot be recovered and is permanently lost; (3) The hard disk failure occurs before the power failure. At this time, the system is in the "write-through” WT mode, and disk 2 is already in a failed state. The entire RAID group is in an "exposed” state. At this time, the background task may be reconstructing disk 2. At this time, the host sends a 4KB write IO to disk 1. If an unexpected power failure occurs at any time between the time when the system starts executing step 3 "writing the new D1 data to disk” and completing step 5 "writing the new verification data P to disk”, the data on disk 2 in the stripe cannot be recovered and is permanently lost.
- This embodiment introduces the "write hole” protection process in detail for RAID5 and RAID6 respectively.
- Step 1 The RAID card receives the task of creating a RAID5 array issued by the user through the host;
- Step 2 The driver of the RAID card firmware layer parses the command parameters for creating a RAID5 array issued by the user, and passes the parameters to the RAID card controller;
- Step 3 The RAID card controller initializes and assigns the pufpState (PUFP status), logicDeviceID, nsID, apuCode, dataLength, startLBA, and pslCbHandle mentioned above according to the parsed command line parameters and dataStructureEntry and other parameters;
- Step 4 After the RAID card receives the IO write request sent by the host, the RAID card controller retrieves the specific address data of the DDR in the host according to the logicDeviceID and nsID parameters, and moves the retrieved host DDR data D' to the local DDR
- Step 6 XOR the old verification data P and the old data D to obtain pplP, and According to the XOR operation of D' and the old data D, ⁇ D is obtained, and then the new verification data P' is obtained by the XOR operation of ⁇ D and P;
- Step 7 The new data D' is written to the corresponding hard disk, the new verification data P' is written to the corresponding hard disk, and the pplP is written to the APU area of the P disk in the RAID5 array;
- Step 8 During the process of writing to the disk in the seventh step, the timer is regularly rotated to check whether there is an unexpected power outage.
- Step 9 If an unexpected power outage occurs, the data recovery process is started according to the pplP data, and the recovery algorithm is selected according to the pufpState parameter, including the block segmentation element recovery algorithm and the Galois field algorithm. Since the recovery algorithm does not belong to the content of this application, it will not be described here. After selecting the recovery algorithm, read the partial checksum of the old data backup in the APU area (i.e., pplP) according to the apuCode parameter, and then start the recovery process through the pslCbHandle function pointer. Step 10: After data recovery is complete, release resources and end the process.
- FIG8 shows a detailed example diagram of write hole protection for RAID6.
- Step 1 The RAID card receives the task of creating a RAID6 array issued by the user through the host;
- Step 2 The driver of the RAID card firmware layer parses the command parameters for creating a RAID6 array issued by the user, and transmits the parameters to the RAID card controller;
- Step 3 The RAID card controller initializes and assigns the pufpState (PUFP status), logicDeviceID, nsID, apuCode, dataLength, startLBA, pslCbHandle, and dataStructureEntry parameters mentioned above according to the parsed command line parameters;
- Step 4 After the RAID card receives the IO write request sent by the host, the RAID card controller retrieves the specific address data of the DDR in the host according to the logicDeviceID and nsID parameters, and moves the retrieved host DDR data D' to the local DDR of the RAID card, where the amount of data moved is determined by
- the old data D is read to the local DDR of the RAID card.
- the old verification data P is read from the corresponding hard disk to RA
- the local DDR of the ID card reads the old verification data Q from the corresponding hard disk to the local DDR of the RAID card;
- the sixth step the old verification data P and the old data D are XORed to obtain pplP, the old verification data Q and the old data D are XORed to obtain pplQ, the data D' and the old data D are XORed to obtain ⁇ D, and then the new verification data P' is XORed by ⁇ D and P, and then the new verification data Q' is XORed by ⁇ D and Q;
- the seventh step the new data D' is written to the corresponding hard disk, the new verification data P' is written to the corresponding hard disk, and the pplP is written to the APU area of the P disk in the RAID6 array.
- Step 8 During the process of writing to disk in step 7, the timer will periodically check whether there is an unexpected power outage. If there is no unexpected power outage, the resources will be released after all the data in step 7 is written to disk; if there is an unexpected power outage, execute step 9; Step 9: In the event of an unexpected power outage, start the data recovery process based on the pplP and pplQ data, and select the recovery algorithm based on the pufpState parameter. Specifically, there are block segmentation element recovery algorithm and Galois field algorithm, etc. Since the recovery algorithm does not belong to the content of this application, it will not be described here.
- Step 10 After the data recovery is completed, release the resources and end the process.
- the embodiment of the present application further discloses a secure storage device, which is applied to a disk array card and includes:
- the request acquisition module 11 is configured to acquire the input/output write request sent by the host side;
- the first reading module 12 is configured to control the array controller to read the first address parameter in the target log according to the input and output request, and obtain the old target data and the old verification data from the disk array card according to the first address parameter; wherein the target log is used to record the verification update situation of the array controller;
- the first operation and recovery module 13 is configured to perform an XOR operation on the old target data and the old verification data to obtain a first XOR result and store the first XOR result in a corresponding hard disk of the disk array card, so as to recover the complete old target data and the old verification data according to the first XOR result when a storage abnormality occurs.
- the embodiment of the present application first obtains the input and output write request sent by the host side; then controls the array controller to read the first address parameter in the target log according to the input and output request, and obtains the old target data and the old verification data from the disk array card according to the first address parameter; wherein the target log is used to record the verification and update of the array controller; finally, the old target data and the old verification data are XORed to obtain the first XOR result and the first XOR result is stored in the corresponding hard disk of the disk array card, so that the complete old target data and the old verification data can be restored according to the first XOR result when the storage is abnormal.
- the embodiment of the present application introduces the concept of a target log, which is used to record the verification and update of the array controller.
- the old target data and the old verification data are obtained according to the parameters in the target log, so as to generate an XOR result, which is used to restore data when the storage is abnormal, thereby solving the "write hole" problem while continuing to maintain a high system IO performance, and improving the data security and user experience of the disk array card without increasing the hardware cost.
- the secure storage device further includes:
- a second reading module is configured to obtain new target data corresponding to the old target data from the host side according to the input and output write request, and obtain new verification data according to the new target data, the old target data and the old verification data;
- the disk placement module is configured to store the new target data and the new verification data in the corresponding hard disk of the disk array card, so as to ensure the consistency of data and verification when the storage is normal;
- An overwrite module is configured to obtain a new parameter value and overwrite the parameter in the target log with the new parameter value
- a moving module is configured to move new target data to the memory of the disk array card
- An instruction acquisition module is configured to acquire an array creation instruction issued by a host side
- the initialization and assignment module is configured to control the array controller to perform initialization and assignment operations on the parameters in the target log according to the array creation instruction;
- the polling module is configured to detect whether an abnormal power failure occurs to the disk array card by means of a timer polling method. If an abnormal power failure occurs to the disk array card, it is determined that the storage is abnormal.
- the second reading module includes:
- a reading unit configured to control the array controller to read the second address parameter in the target log according to the input/output request, and to obtain new target data from the memory on the host side according to the second address parameter;
- the XOR unit is configured to perform an XOR operation on the old target data and the new target data in the memory of the disk array card to obtain a second XOR result, and perform an XOR operation on the second XOR result and the old verification data to obtain a third XOR result; and use the third XOR result as the new verification data.
- the first reading module 12 is configured to move the old target data and the old verification data to the memory of the disk array card.
- the first operation and recovery module 13 is configured to perform an XOR operation on the old target data and the old verification data in the memory of the disk array card to obtain a first XOR result.
- the first operation and recovery module 13 is further configured to store the first XOR result in the atomic parity update area of the check disk of the disk array card storing the old check data, so that when a storage abnormality occurs, the first XOR result is read from the atomic parity update area and the complete old target data and old check data are recovered according to the first XOR result.
- the first reading module 12 is further configured to obtain old target data and multiple old verification data from the disk array card according to the first address parameter if the disk array card includes multiple verification disks; wherein one verification data is stored on one verification disk.
- the first operation and recovery module 13 is further configured to perform XOR operations on the old target data and each old verification data to obtain multiple first XOR results and store each first XOR result in the atomic parity update area of the corresponding verification disk, so that when a storage abnormality occurs, each first XOR result is read from each atomic parity update area and the corresponding old target data and old verification data are recovered according to each first XOR result.
- FIG. 10 is a structural diagram of an electronic device 20 according to an exemplary embodiment, and the content in the diagram cannot be regarded as any limitation on the scope of use of the present application.
- FIG10 is a schematic diagram of the structure of an electronic device 20 provided in an embodiment of the present application.
- the electronic device 20 may include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input/output interface 25, and a communication bus 26.
- the memory 22 is configured to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the secure storage method disclosed in any of the aforementioned embodiments.
- the power supply 23 is configured to provide working voltage for each hardware device on the electronic device 20;
- the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here;
- the input and output interface 25 is configured to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs, and is not specifically limited here.
- the memory 22 as a carrier for storing resources may be a read-only memory, a random access memory, a disk or an optical disk, etc.
- the resources stored thereon may include an operating system 221, a computer program 222 and Data 223, etc., can be stored in a temporary or permanent manner.
- the operating system 221 is configured to manage and control the hardware devices and computer programs 222 on the electronic device 20 to realize the operation and processing of the massive data 223 in the memory 22 by the processor 21, which can be Windows Server, Netware, Unix, Linux, etc.
- the computer program 222 can further include a computer program that can be used to complete other specific tasks.
- the data 223 can include the request data collected by the electronic device 20.
- an embodiment of the present application further discloses a non-volatile readable storage medium, in which a computer program is stored.
- a computer program is stored.
- the steps of the secure storage method disclosed in any of the aforementioned embodiments are implemented.
- each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments.
- the same or similar parts between the embodiments can be referred to each other.
- the description is relatively simple, and the relevant parts can be referred to the method part.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Quality & Reliability (AREA)
- Human Computer Interaction (AREA)
- Debugging And Monitoring (AREA)
- Techniques For Improving Reliability Of Storages (AREA)
Abstract
Description
相关申请的交叉引用CROSS-REFERENCE TO RELATED APPLICATIONS
本申请要求于2023年01月09日提交中国专利局,申请号为202310025601.7,申请名称为“一种安全存储方法、装置、设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims priority to a Chinese patent application filed with the China Patent Office on January 9, 2023, with application number 202310025601.7 and application name “A secure storage method, device, equipment and storage medium”, all contents of which are incorporated by reference in this application.
本申请涉及存储技术领域,特别涉及一种安全存储方法、装置、设备及非易失性可读存储介质。The present application relates to the field of storage technology, and in particular to a secure storage method, device, equipment and non-volatile readable storage medium.
“写洞”问题作为RAID(Redundant Array of Independent Disks,磁盘阵列)的一个难题,尤其是对软RAID解决方案而言,如果要追求极致的数据安全,那么在IO(Input/Output,输入输出)性能上就会大打折扣,例如,Linux的MDRAID的PPL(Partial Parity LockLog)方式。一般来说,只有硬RAID方案才能在解决了“写洞”问题的同时,继续保持较高的系统IO性能。笼统的说,在对基于RAID(RAID1/5/6)管理的存储设备进行写操作的同时发生了存储异常,就有一定概率会发生“写洞”问题。根据存储设备的失效发生的时候,可以将“写洞”问题场景分为:硬盘失效发生在异常之后、硬盘失效发生在异常及恢复过程中、硬盘失效发生在异常之前。在异常之前、过程中或者是之后,如果不能对“写洞”进行恰当的处理,这都会造成数据的永久丢失。The "write hole" problem is a difficult problem of RAID (Redundant Array of Independent Disks), especially for soft RAID solutions. If you want to pursue the ultimate data security, then the IO (Input/Output) performance will be greatly reduced, for example, the PPL (Partial Parity LockLog) method of Linux's MDRAID. Generally speaking, only the hard RAID solution can solve the "write hole" problem while maintaining high system IO performance. Generally speaking, when a storage anomaly occurs while writing to a storage device managed by RAID (RAID1/5/6), there is a certain probability that the "write hole" problem will occur. According to the time when the storage device fails, the "write hole" problem scenario can be divided into: hard disk failure occurs after the anomaly, hard disk failure occurs during the anomaly and recovery process, and hard disk failure occurs before the anomaly. Before, during, or after the anomaly, if the "write hole" cannot be properly handled, it will cause permanent data loss.
针对以上三种“写洞”问题场景,现有技术中采用两种策略来应对,一种是借助于采用非易失性内存NVRAM(Non-Volatile Random Access Memory)做为写缓存,达到原子写操作的目的,另一种是借助文件系统的Journal(日志)的设计思想,实现写请求的原子处理。第一种需要增加NVRAM的硬件资源,且NVRAM的存储资源有限。而第二种日志的方式看似完美,但是多次读写底层文件系统会严重影响性能。In view of the above three "write hole" problem scenarios, two strategies are adopted in the existing technology. One is to use non-volatile memory NVRAM (Non-Volatile Random Access Memory) as a write cache to achieve the purpose of atomic write operation, and the other is to use the design concept of the file system's Journal to realize the atomic processing of write requests. The first method requires increasing the hardware resources of NVRAM, and the storage resources of NVRAM are limited. The second log method seems perfect, but multiple reading and writing of the underlying file system will seriously affect performance.
因此,上述技术问题亟待本领域技术人员解决。Therefore, the above technical problems need to be solved by those skilled in the art urgently.
发明内容Summary of the invention
有鉴于此,本申请的目的在于提供一种安全存储方法、装置、设备及非易失性可读存储介质,能够解决“写洞”问题的同时继续保持较高的系统IO性能,在不增加硬件成本的基础上,提高磁盘阵列卡的数据安全性以及用户体验。其可选的方案如下:In view of this, the purpose of this application is to provide a secure storage method, device, equipment and non-volatile readable storage medium, which can solve the "write hole" problem while maintaining high system IO performance, and improve the data security and user experience of the disk array card without increasing hardware costs. The optional solutions are as follows:
本申请的第一方面提供了一种安全存储方法,应用于磁盘阵列卡,包括:A first aspect of the present application provides a secure storage method, which is applied to a disk array card, comprising:
获取主机侧发送的输入输出写请求;Get the input and output write request sent by the host side;
控制阵列控制器根据输入输出请求对目标日志中的第一地址参数进行读取,并根据第一地址参数从磁盘阵列卡获取旧目标数据及旧校验数据;其中, 目标日志用于记录阵列控制器进行校验更新的情况;The array controller is controlled to read the first address parameter in the target log according to the input/output request, and obtain the old target data and the old verification data from the disk array card according to the first address parameter; wherein, The target log is used to record the verification and update status of the array controller;
对旧目标数据和旧校验数据进行异或运算得到第一异或结果并将第一异或结果存储至磁盘阵列卡的对应硬盘中,以便在存储异常时根据第一异或结果恢复出完整的旧目标数据及旧校验数据。An XOR operation is performed on the old target data and the old verification data to obtain a first XOR result and the first XOR result is stored in a corresponding hard disk of the disk array card, so that the complete old target data and the old verification data can be restored according to the first XOR result when a storage abnormality occurs.
可选的,将第一异或结果存储至磁盘阵列卡的对应硬盘中之后,还包括:Optionally, after storing the first XOR result in a corresponding hard disk of the disk array card, the method further includes:
根据输入输出写请求从主机侧获取与旧目标数据对应的新目标数据,并根据新目标数据、旧目标数据和旧校验数据得到新校验数据;Acquire new target data corresponding to the old target data from the host side according to the input/output write request, and obtain new verification data according to the new target data, the old target data and the old verification data;
将新目标数据和新校验数据存储至磁盘阵列卡的对应硬盘中,以便在存储正常时保证数据及校验一致性。The new target data and the new verification data are stored in the corresponding hard disk of the disk array card to ensure the consistency of data and verification when the storage is normal.
可选的,将新目标数据和新校验数据存储至磁盘阵列卡的对应硬盘中之后,还包括:Optionally, after storing the new target data and the new verification data in the corresponding hard disk of the disk array card, the method further includes:
获取新的参数值并利用新的参数值对目标日志中的参数进行覆盖写操作。Get new parameter values and use the new parameter values to overwrite the parameters in the target log.
可选的,根据输入输出写请求从主机侧获取与旧目标数据对应的新目标数据,包括:Optionally, obtaining new target data corresponding to old target data from the host side according to the input/output write request includes:
控制阵列控制器根据输入输出请求对目标日志中的第二地址参数进行读取,并根据第二地址参数从主机侧的内存中获取新目标数据。The array controller is controlled to read the second address parameter in the target log according to the input/output request, and obtain new target data from the memory on the host side according to the second address parameter.
可选的,根据第二地址参数从主机侧的内存中获取新目标数据之后,还包括:Optionally, after acquiring new target data from the memory on the host side according to the second address parameter, the method further includes:
将新目标数据搬移至磁盘阵列卡的内存中;Move the new target data to the memory of the disk array card;
相应的,根据新目标数据、旧目标数据和旧校验数据得到新校验数据,包括:Accordingly, new verification data is obtained according to the new target data, the old target data and the old verification data, including:
在磁盘阵列卡的内存中对旧目标数据和新目标数据进行异或运算得到第二异或结果,并对第二异或结果和旧校验数据进行异或运算得到第三异或结果;In the memory of the disk array card, an XOR operation is performed on the old target data and the new target data to obtain a second XOR result, and an XOR operation is performed on the second XOR result and the old verification data to obtain a third XOR result;
将第三异或结果作为新校验数据。The third XOR result is used as new verification data.
可选的,根据第一地址参数从磁盘阵列卡获取旧目标数据及旧校验数据,包括:Optionally, obtaining old target data and old verification data from a disk array card according to the first address parameter includes:
将旧目标数据及旧校验数据搬移至磁盘阵列卡的内存中;Move old target data and old verification data to the memory of the disk array card;
相应的,对旧目标数据和旧校验数据进行异或运算得到第一异或结果,包括:Accordingly, performing an XOR operation on the old target data and the old verification data to obtain a first XOR result includes:
在磁盘阵列卡的内存中对旧目标数据和旧校验数据进行异或运算得到第一异或结果。An XOR operation is performed on the old target data and the old verification data in the memory of the disk array card to obtain a first XOR result.
可选的,将第一异或结果存储至磁盘阵列卡的对应硬盘,包括:Optionally, storing the first XOR result to a corresponding hard disk of the disk array card includes:
将第一异或结果存储至磁盘阵列卡存储旧校验数据的校验盘的原子奇偶校验更新区域中,以便在存储异常时,从原子奇偶校验更新区域中读取第一异或结果并根据第一异或结果恢复出完整的旧目标数据及旧校验数据。The first XOR result is stored in the atomic parity update area of the check disk of the disk array card storing the old check data, so that when a storage abnormality occurs, the first XOR result is read from the atomic parity update area and the complete old target data and old check data are restored according to the first XOR result.
可选的,根据第一地址参数从磁盘阵列卡获取旧目标数据及旧校验数据,包括:Optionally, obtaining old target data and old verification data from a disk array card according to the first address parameter includes:
如果磁盘阵列卡中包含多个校验盘,则根据第一地址参数从磁盘阵列卡获取旧目标数据及多个旧校验数据;其中,一个校验盘上存储一个校验数据; If the disk array card includes multiple check disks, old target data and multiple old check data are obtained from the disk array card according to the first address parameter; wherein one check disk stores one check data;
相应的,对旧目标数据和旧校验数据进行异或运算得到第一异或结果并将第一异或结果存储至磁盘阵列卡的对应硬盘中,包括:Accordingly, performing an XOR operation on the old target data and the old verification data to obtain a first XOR result and storing the first XOR result in a corresponding hard disk of the disk array card includes:
分别对旧目标数据和各个旧校验数据进行异或运算得到多个第一异或结果并将各个第一异或结果分别存储至对应校验盘的原子奇偶校验更新区域中,以便在存储异常时,从各个原子奇偶校验更新区域中读取各个第一异或结果并根据各个第一异或结果恢复出相应的旧目标数据及旧校验数据。XOR operations are performed on the old target data and each old verification data to obtain multiple first XOR results, and each first XOR result is stored in the atomic parity update area of the corresponding verification disk, so that when a storage abnormality occurs, each first XOR result is read from each atomic parity update area and the corresponding old target data and old verification data are restored according to each first XOR result.
可选的,根据第一异或结果恢复出完整的旧目标数据及旧校验数据,包括:Optionally, restoring the complete old target data and old verification data according to the first XOR result includes:
对目标日志中的状态参数进行读取;其中,状态参数为校验更新的状态定义;Read the state parameters in the target log; wherein the state parameters are the state definitions for verification updates;
根据状态参数确定出目标恢复算法,以利用目标恢复算法执行恢复流程。A target recovery algorithm is determined according to the state parameters, so as to execute the recovery process using the target recovery algorithm.
可选的,状态参数与恢复算法之间具有对应关系;Optionally, there is a corresponding relationship between the state parameter and the recovery algorithm;
相应的,根据状态参数确定出目标恢复算法,包括:Accordingly, a target recovery algorithm is determined according to the state parameters, including:
根据状态参数与恢复算法之间的对应关系确定出目标恢复算法。The target recovery algorithm is determined according to the corresponding relationship between the state parameters and the recovery algorithm.
可选的,恢复算法包括分块切分恢复算法和伽罗华域算法。Optionally, the recovery algorithm includes a block segmentation recovery algorithm and a Galois field algorithm.
可选的,利用目标恢复算法执行恢复流程,包括:Optionally, a target recovery algorithm is used to perform the recovery process, including:
对目标日志中的槽位参数和控制块参数进行读取;其中,槽位参数表征校验盘的原子奇偶校验更新区域的位置,控制块参数用户确定数据块所在的当前数据页链条及定位当前数据页链条的数据缓存区域。The slot parameters and control block parameters in the target log are read; the slot parameters represent the location of the atomic parity update area of the check disk, and the control block parameters determine the current data page chain where the data block is located and locate the data cache area of the current data page chain.
利用目标恢复算法根据槽位参数从原子奇偶校验更新区域中读取第一异或结果,并通过控制块参数函数指针执行恢复流程。The target recovery algorithm is used to read the first XOR result from the atomic parity update area according to the slot parameter, and the recovery process is executed through the control block parameter function pointer.
可选的,获取主机侧发送的输入输出写请求之前,还包括:Optionally, before obtaining the input/output write request sent by the host side, the following steps are further included:
获取主机侧下发的阵列创建指令;Get the array creation command sent by the host side;
控制阵列控制器根据阵列创建指令对目标日志中的参数进行初始化及赋值操作。The array controller is controlled to initialize and assign values to the parameters in the target log according to the array creation instruction.
可选的,阵列创建指令为用户通过主机侧下发的创建阵列的命令行参数。Optionally, the array creation instruction is a command line parameter for creating an array sent by a user through a host side.
可选的,获取主机侧下发的阵列创建指令之后,还包括:Optionally, after obtaining the array creation instruction sent by the host side, the following steps are further included:
控制磁盘阵列卡固件层的驱动程序对命令行参数进行解析,并将解析后参数透传至阵列控制器,以便阵列控制器根据解析后参数对目标日志中的参数进行初始化及赋值操作。The driver that controls the disk array card firmware layer parses the command line parameters and transparently transmits the parsed parameters to the array controller, so that the array controller initializes and assigns values to the parameters in the target log according to the parsed parameters.
可选的,根据第一异或结果恢复出完整的旧目标数据及旧校验数据之前,还包括:Optionally, before restoring the complete old target data and the old verification data according to the first XOR result, the method further includes:
通过定时器轮训的方式对磁盘阵列卡是否发生异常掉电进行检测,如果检测到磁盘阵列卡发生异常掉电,则判定存储异常。Whether the disk array card has abnormal power failure is detected by timer polling. If abnormal power failure is detected, the storage is determined to be abnormal.
可选的,目标日志存储于非易失性随机访问存储器或受掉电保护的内存中。Optionally, the target log is stored in a non-volatile random access memory or a memory protected from power failure.
本申请的第二方面提供了一种安全存储装置,应用于磁盘阵列卡,包括:A second aspect of the present application provides a secure storage device, applied to a disk array card, comprising:
请求获取模块,被配置为获取主机侧发送的输入输出写请求;A request acquisition module is configured to acquire an input/output write request sent by a host side;
第一读取模块,被配置为控制阵列控制器根据输入输出请求对目标日志中 的第一地址参数进行读取,并根据第一地址参数从磁盘阵列卡获取旧目标数据及旧校验数据;其中,目标日志用于记录阵列控制器进行校验更新的情况;The first reading module is configured to control the array controller to read the target log according to the input and output request. The target log is used to read the first address parameter of the array controller, and obtain the old target data and the old verification data from the disk array card according to the first address parameter; wherein the target log is used to record the verification update of the array controller;
第一运算及恢复模块,被配置为对旧目标数据和旧校验数据进行异或运算得到第一异或结果并将第一异或结果存储至磁盘阵列卡的对应硬盘中,以便在存储异常时根据第一异或结果恢复出完整的旧目标数据及旧校验数据。The first operation and recovery module is configured to perform an XOR operation on the old target data and the old verification data to obtain a first XOR result and store the first XOR result in a corresponding hard disk of the disk array card, so as to restore the complete old target data and the old verification data according to the first XOR result when a storage abnormality occurs.
本申请的第三方面提供了一种电子设备,电子设备包括处理器和存储器;其中存储器被配置为存储计算机程序,计算机程序由处理器加载并执行以实现前述安全存储方法。A third aspect of the present application provides an electronic device, comprising a processor and a memory; wherein the memory is configured to store a computer program, and the computer program is loaded and executed by the processor to implement the aforementioned secure storage method.
本申请的第四方面提供了一种计算机非易失性可读存储介质,计算机非易失性可读存储介质中存储有计算机可执行指令,计算机可执行指令被处理器加载并执行时,实现前述安全存储方法。The fourth aspect of the present application provides a computer non-volatile readable storage medium, in which computer executable instructions are stored. When the computer executable instructions are loaded and executed by a processor, the aforementioned secure storage method is implemented.
本申请中,先获取主机侧发送的输入输出写请求;然后控制阵列控制器根据输入输出请求对目标日志中的第一地址参数进行读取,并根据第一地址参数从磁盘阵列卡获取旧目标数据及旧校验数据;其中,目标日志用于记录阵列控制器进行校验更新的情况;最后对旧目标数据和旧校验数据进行异或运算得到第一异或结果并将第一异或结果存储至磁盘阵列卡的对应硬盘中,以便在存储异常时根据第一异或结果恢复出完整的旧目标数据及旧校验数据。可见,本申请引入目标日志的概念,其用于记录阵列控制器进行校验更新的情况,在进行存储更新时,根据该目标日志中的参数获取旧目标数据及旧校验数据,以此生成一个异或结果,这个异或结果用于在存储异常时恢复数据,从而解决“写洞”问题的同时继续保持较高的系统IO性能,在不增加硬件成本的基础上,提高磁盘阵列卡的数据安全性以及用户体验。In the present application, the input/output write request sent by the host side is first obtained; then the array controller is controlled to read the first address parameter in the target log according to the input/output request, and the old target data and the old verification data are obtained from the disk array card according to the first address parameter; wherein the target log is used to record the verification and update of the array controller; finally, the old target data and the old verification data are XORed to obtain the first XOR result and the first XOR result is stored in the corresponding hard disk of the disk array card, so that the complete old target data and the old verification data can be restored according to the first XOR result when the storage is abnormal. It can be seen that the present application introduces the concept of the target log, which is used to record the verification and update of the array controller. When performing storage update, the old target data and the old verification data are obtained according to the parameters in the target log, so as to generate an XOR result, which is used to restore the data when the storage is abnormal, thereby solving the "write hole" problem while continuing to maintain a high system IO performance, and improving the data security and user experience of the disk array card without increasing the hardware cost.
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据提供的附图获得其他的附图。In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are merely embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
图1为本申请提供的一种安全存储方法流程图;FIG1 is a flow chart of a secure storage method provided by the present application;
图2为本申请提供的一种可选的PUFP格式定义示例图;FIG2 is an example diagram of an optional PUFP format definition provided by the present application;
图3为本申请提供的一种可选的安全存储方法示意图;FIG3 is a schematic diagram of an optional secure storage method provided by the present application;
图4为本申请提供的一种可选的安全存储方法流程图;FIG4 is a flow chart of an optional secure storage method provided by the present application;
图5为本申请提供的一种RAID5中的写流程“写洞”问题场景分析图;FIG5 is a scenario analysis diagram of a write process "write hole" problem in RAID5 provided by the present application;
图6为本申请提供的一种RAID5的写洞保护详细示例图;FIG6 is a detailed example diagram of a RAID5 write hole protection provided by the present application;
图7为本申请提供的一种图6中的“inlineXoR”操作示例图;FIG. 7 is an example diagram of the “inlineXoR” operation in FIG. 6 provided by the present application;
图8为本申请提供的一种RAID6的写洞保护详细示例图;FIG8 is a detailed example diagram of write hole protection of RAID6 provided by the present application;
图9为本申请提供的一种安全存储装置结构示意图;FIG9 is a schematic diagram of the structure of a secure storage device provided by the present application;
图10为本申请提供的一种安全存储电子设备结构图。FIG10 is a structural diagram of a secure storage electronic device provided in the present application.
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
现有解决“写洞”问题一般采用两种策略,一种是借助于采用非易失性内存NVRAM做为写缓存,达到原子写操作的目的,另一种是借助文件系统的Journal(日志)的设计思想,实现写请求的原子处理。第一种需要增加NVRAM的硬件资源,且NVRAM的存储资源有限。而第二种日志的方式看似完美,但是多次读写底层文件系统会严重影响性能。针对上述技术缺陷,本申请提供一种安全存储方案,引入目标日志的概念,其用于记录阵列控制器进行校验更新的情况,在进行存储更新时,根据该目标日志中的参数获取旧目标数据及旧校验数据,以此生成一个异或结果,这个异或结果用于在存储异常时恢复数据,从而解决“写洞”问题的同时继续保持较高的系统IO性能,在不增加硬件成本的基础上,提高磁盘阵列卡的数据安全性以及用户体验。There are generally two strategies for solving the "write hole" problem. One is to use non-volatile memory NVRAM as a write cache to achieve the purpose of atomic write operations, and the other is to use the design concept of the file system's Journal (log) to achieve atomic processing of write requests. The first method requires increasing the hardware resources of NVRAM, and the storage resources of NVRAM are limited. While the second log method seems perfect, multiple reads and writes to the underlying file system will seriously affect performance. In response to the above technical defects, the present application provides a secure storage solution, introducing the concept of a target log, which is used to record the verification and update of the array controller. When performing storage updates, the old target data and the old verification data are obtained according to the parameters in the target log, so as to generate an XOR result, which is used to restore data when storage is abnormal, thereby solving the "write hole" problem while continuing to maintain a high system IO performance, and improving the data security and user experience of the disk array card without increasing hardware costs.
图1为本申请实施例提供的一种安全存储方法流程图。参见图1所示,该安全存储方法应用于磁盘阵列卡,包括:FIG1 is a flow chart of a secure storage method provided in an embodiment of the present application. Referring to FIG1 , the secure storage method is applied to a disk array card, and includes:
S11:获取主机侧发送的输入输出写请求。S11: Obtain the input/output write request sent by the host side.
本实施例中,磁盘阵列卡先获取主机侧发送的输入输出写请求。磁盘阵列卡即RAID卡,由多个存储阵列(RAID阵列)、阵列控制器(RAID卡控制器)、CPU、内存等组件构成,存储阵列由多个SSD盘构成,SSD盘构成的RAID卡相比HDD盘构成的RAID卡具备更快速读写性能的优势。In this embodiment, the disk array card first obtains the input and output write request sent by the host side. The disk array card is a RAID card, which is composed of multiple storage arrays (RAID arrays), array controllers (RAID card controllers), CPUs, memory and other components. The storage array is composed of multiple SSD disks. The RAID card composed of SSD disks has the advantage of faster read and write performance than the RAID card composed of HDD disks.
写洞保护的最基本要求就是“在RAID保护能力覆盖之下的数据永不丢失”。具体来说,在一个受到“写洞”影响的条带内,可以简单将数据分为两类,一类就是受到此次IO直接写覆盖的数据单元,而另外一些数据单元并未被直接写覆盖,但是在同条带其他数据和校验数据的更新过程中该条带潜在的失去了对这些数据的保护。基于此,本实施例定义了两种写洞保护级别分别是DPC和WRA。其中,数据奇偶校验一致性DPC(Data-Parity Consistency)保证数据和校验的一致性,这是底线,从根本上保证了对上述第二类数据的保护;WRA(Write Atomic)在DPC的基础上,针对上述第一类数据,可以进一步的保证其数据操作的原子性,即存储单元里面要么是写之前的完整的老数据,要么是完整的新数据,不存在中间不确定状态。The most basic requirement for write hole protection is that "data covered by the RAID protection capability will never be lost". Specifically, in a stripe affected by a "write hole", the data can be simply divided into two categories. One category is the data units that are directly overwritten by this IO, while other data units are not directly overwritten, but during the update process of other data and check data in the same stripe, the stripe potentially loses the protection of these data. Based on this, this embodiment defines two write hole protection levels, namely DPC and WRA. Among them, data parity consistency DPC (Data-Parity Consistency) ensures the consistency of data and checksum, which is the bottom line and fundamentally guarantees the protection of the second type of data mentioned above; WRA (Write Atomic), based on DPC, can further ensure the atomicity of data operations for the first type of data mentioned above, that is, the storage unit contains either complete old data before writing or complete new data, and there is no intermediate uncertain state.
S12:控制阵列控制器根据输入输出请求对目标日志中的第一地址参数进行读取,并根据第一地址参数从磁盘阵列卡获取旧目标数据及旧校验数据;其中,目标日志用于记录阵列控制器进行校验更新的情况。S12: Control the array controller to read the first address parameter in the target log according to the input/output request, and obtain old target data and old verification data from the disk array card according to the first address parameter; wherein the target log is used to record verification and update status of the array controller.
本实施例中,控制阵列控制器根据输入输出请求对目标日志中的第一地址参数进行读取,并根据第一地址参数从磁盘阵列卡获取旧目标数据及旧校验数据;其中,目标日志用于记录阵列控制器进行校验更新的情况。这里的目标日志的设置是本实施例提出的基于硬件的写洞保护的手段,又称为PUFP(Parity Update Footprint)机制,本实施例主要是在RAID卡中使用PUFP机制进行写洞保护。顾名思义,目标日志PUFP的内容是记录RAID卡控制器芯片进行校验(条带)更新的日志。PUFP和PSL引擎中激活的“排他锁”(Exclusive Lock)一一对应。每当成功锁定一个条带的写更新就会同时分配一个PUFP单元,用于跟踪记录校验的更新情况,其初始化由RAID卡引擎在分配之初进行(16B的写)。一个PUFP的大小为16字节或者32字节(PUFP+),格式内容如图2所示,PUFP一般存于非易失性随机访问存储器(非易失NVRAM)或者是受存储异常保护的内存中,正常操作过程中对PUFP只会进行覆盖写操作。In this embodiment, the array controller is controlled to read the first address parameter in the target log according to the input and output request, and obtain the old target data and the old verification data from the disk array card according to the first address parameter; wherein the target log is used to record the verification update of the array controller. The setting of the target log here is a hardware-based write hole protection method proposed in this embodiment, also known as PUFP (Parity The PUFP mechanism is a write-hole protection mechanism. As the name implies, the content of the target log PUFP is a log that records the verification (stripe) updates performed by the RAID card controller chip. There is a one-to-one correspondence between PUFP and the "Exclusive Lock" activated in the PSL engine. Whenever a write update of a stripe is successfully locked, a PUFP unit is allocated at the same time to track and record the update of the verification. The initialization is performed by the RAID card engine at the beginning of the allocation (16B write). The size of a PUFP is 16 bytes or 32 bytes (PUFP+), and the format content is shown in Figure 2. PUFP is generally stored in non-volatile random access memory (non-volatile NVRAM) or in memory protected by storage anomalies. During normal operation, only overwrite write operations will be performed on PUFP.
可选的,将旧目标数据及旧校验数据搬移至磁盘阵列卡的内存中。第一地址参数为startLBA参数,表示当前namespace中的起始LBA(38位,覆盖1PB数据存储空间),由RAID卡初始化的时候一次写入。由startLBA参数定位RAID卡中对应硬盘的物理地址,定位完毕后读取旧目标数据D到RAID卡的本地DDR,同理从对应的硬盘上读取旧校验数据P到RAID卡的本地DDR。Optionally, the old target data and old verification data are moved to the memory of the disk array card. The first address parameter is the startLBA parameter, which indicates the starting LBA (38 bits, covering 1PB data storage space) in the current namespace and is written once when the RAID card is initialized. The physical address of the corresponding hard disk in the RAID card is located by the startLBA parameter. After the location is completed, the old target data D is read to the local DDR of the RAID card. Similarly, the old verification data P is read from the corresponding hard disk to the local DDR of the RAID card.
S13:对旧目标数据和旧校验数据进行异或运算得到第一异或结果并将第一异或结果存储至磁盘阵列卡的对应硬盘中,以便在存储异常时根据第一异或结果恢复出完整的旧目标数据及旧校验数据。S13: performing an XOR operation on the old target data and the old verification data to obtain a first XOR result and storing the first XOR result in a corresponding hard disk of the disk array card, so as to restore the complete old target data and the old verification data according to the first XOR result when a storage abnormality occurs.
本实施例中,对旧目标数据和旧校验数据进行异或运算得到第一异或结果并将第一异或结果存储至磁盘阵列卡的对应硬盘中,以便在存储异常时根据第一异或结果恢复出完整的旧目标数据及旧校验数据。可选的,在磁盘阵列卡的内存中对旧目标数据和旧校验数据进行异或运算得到第一异或结果。即由旧校验数据P和旧目标数据D异或运算得到pplP,pplP是数据恢复的基础。In this embodiment, an XOR operation is performed on the old target data and the old verification data to obtain a first XOR result and the first XOR result is stored in the corresponding hard disk of the disk array card, so that the complete old target data and the old verification data can be restored according to the first XOR result when a storage abnormality occurs. Optionally, an XOR operation is performed on the old target data and the old verification data in the memory of the disk array card to obtain the first XOR result. That is, pplP is obtained by XORing the old verification data P and the old target data D, and pplP is the basis for data recovery.
需要说明的是,此时还需要将新数据落盘,再未发生存储异常时,正常落盘即可。也即还需要根据输入输出写请求从主机侧获取与旧目标数据对应的新目标数据,并根据新目标数据、旧目标数据和旧校验数据得到新校验数据。可选的,控制阵列控制器根据输入输出请求对目标日志中的第二地址参数进行读取,并根据第二地址参数从主机侧的内存中获取新目标数据。这里的第二地址参数为logicDeviceID、nsID这两个参数,其中,logicDeviceID参数表示该RAID组内的逻辑盘位置ID,用以标识出当前写操作所处理的硬盘,nsID参数为Namespace ID,由RAID卡初始化的时候一次写入。It should be noted that at this time, the new data needs to be written to the disk. When no storage anomalies occur, the data can be written to the disk normally. That is, it is also necessary to obtain new target data corresponding to the old target data from the host side according to the input and output write request, and obtain new verification data according to the new target data, the old target data and the old verification data. Optionally, the control array controller reads the second address parameter in the target log according to the input and output request, and obtains the new target data from the memory on the host side according to the second address parameter. The second address parameters here are the two parameters logicDeviceID and nsID, where the logicDeviceID parameter represents the logical disk location ID within the RAID group, which is used to identify the hard disk processed by the current write operation, and the nsID parameter is the Namespace ID, which is written once when the RAID card is initialized.
接着将新目标数据搬移至磁盘阵列卡的内存中,在磁盘阵列卡的内存中对旧目标数据和新目标数据进行异或运算得到第二异或结果,并对第二异或结果和旧校验数据进行异或运算得到第三异或结果,最终将第三异或结果作为新校验数据。即由新目标数据D’和旧目标数据D异或运算得到ΔD,再由ΔD和P异或运算得到新校验数据P’。将新目标数据和新校验数据存储至磁盘阵列卡的对应硬盘中,以便在存储正常时保证数据及校验一致性。将D’、P’、pplP均落盘到对应硬盘。在此之后,获取新的参数值并利用新的参数值对目标日志中的参数进行覆盖写操作。Then, the new target data is moved to the memory of the disk array card, and the old target data and the new target data are XORed in the memory of the disk array card to obtain the second XOR result, and the second XOR result and the old verification data are XORed to obtain the third XOR result, and finally the third XOR result is used as the new verification data. That is, the new target data D' and the old target data D are XORed to obtain ΔD, and then the new verification data P' is XORed by ΔD and P. The new target data and the new verification data are stored in the corresponding hard disk of the disk array card to ensure data and verification consistency when the storage is normal. D', P', and pplP are all written to the corresponding hard disk. After that, the new parameter value is obtained and the new parameter value is used to overwrite the parameter in the target log.
可见,本申请实施例先获取主机侧发送的输入输出写请求;然后控制阵列控制器根据输入输出请求对目标日志中的第一地址参数进行读取,并根据第一 地址参数从磁盘阵列卡获取旧目标数据及旧校验数据;其中,目标日志用于记录阵列控制器进行校验更新的情况;最后对旧目标数据和旧校验数据进行异或运算得到第一异或结果并将第一异或结果存储至磁盘阵列卡的对应硬盘中,以便在存储异常时根据第一异或结果恢复出完整的旧目标数据及旧校验数据。本申请实施例引入目标日志的概念,其用于记录阵列控制器进行校验更新的情况,在进行存储更新时,根据该目标日志中的参数获取旧目标数据及旧校验数据,以此生成一个异或结果,这个异或结果用于在存储异常时恢复数据,从而解决“写洞”问题的同时继续保持较高的系统IO性能,在不增加硬件成本的基础上,提高磁盘阵列卡的数据安全性以及用户体验。It can be seen that the embodiment of the present application first obtains the input/output write request sent by the host side; then controls the array controller to read the first address parameter in the target log according to the input/output request, and The address parameters are used to obtain the old target data and the old verification data from the disk array card; wherein the target log is used to record the verification update of the array controller; finally, the old target data and the old verification data are XORed to obtain the first XOR result and the first XOR result is stored in the corresponding hard disk of the disk array card, so that the complete old target data and the old verification data can be restored according to the first XOR result when the storage is abnormal. The embodiment of the present application introduces the concept of a target log, which is used to record the verification update of the array controller. When performing storage updates, the old target data and the old verification data are obtained according to the parameters in the target log, so as to generate an XOR result. This XOR result is used to restore data when the storage is abnormal, thereby solving the "write hole" problem while continuing to maintain a high system IO performance, and improving the data security and user experience of the disk array card without increasing the hardware cost.
图3为本申请实施例提供的一种可选的安全存储方法流程图。参见图3所示,该安全存储方法应用于磁盘阵列卡,包括:FIG3 is a flow chart of an optional secure storage method provided in an embodiment of the present application. Referring to FIG3 , the secure storage method is applied to a disk array card, including:
S21:获取主机侧发送的输入输出写请求。S21: Obtain the input/output write request sent by the host side.
本实施例中,关于上述步骤S21的具体过程,可以参考前述实施例中公开的相应内容,在此不再进行赘述。In this embodiment, regarding the specific process of the above step S21, reference may be made to the corresponding content disclosed in the above embodiments, and no further details will be given here.
S22:控制阵列控制器根据输入输出请求对目标日志中的第一地址参数进行读取。S22: Control the array controller to read the first address parameter in the target log according to the input/output request.
S23:如果磁盘阵列卡中包含多个校验盘,则根据第一地址参数从磁盘阵列卡获取旧目标数据及多个旧校验数据;其中,一个校验盘上存储一个校验数据。S23: If the disk array card includes multiple check disks, obtain old target data and multiple old check data from the disk array card according to the first address parameter; wherein one check disk stores one check data.
S24:分别对旧目标数据和各个旧校验数据进行异或运算得到多个第一异或结果并将各个第一异或结果分别存储至对应校验盘的原子奇偶校验更新区域中,以便在存储异常时,从各个原子奇偶校验更新区域中读取各个第一异或结果并根据各个第一异或结果恢复出相应的旧目标数据及旧校验数据。S24: Perform XOR operations on the old target data and each old verification data to obtain multiple first XOR results, and store each first XOR result in the atomic parity update area of the corresponding verification disk, so that when a storage abnormality occurs, each first XOR result is read from each atomic parity update area and the corresponding old target data and old verification data are restored according to each first XOR result.
本实施例中,如果磁盘阵列卡中包含多个校验盘,则根据第一地址参数从磁盘阵列卡获取旧目标数据及多个旧校验数据;其中,一个校验盘上存储一个校验数据。这种情况主要是针对如RAID6等类似的存在多个校验盘的磁盘阵列来说的,RAID6中包含P校验盘和Q校验盘。In this embodiment, if the disk array card includes multiple check disks, old target data and multiple old check data are obtained from the disk array card according to the first address parameter; wherein one check disk stores one check data. This situation is mainly for disk arrays such as RAID6 and the like that have multiple check disks, and RAID6 includes a P check disk and a Q check disk.
此时分别对旧目标数据和各个旧校验数据进行异或运算得到多个第一异或结果并将各个第一异或结果分别存储至对应校验盘的原子奇偶校验更新区域中,以便在存储异常时,从各个原子奇偶校验更新区域中读取各个第一异或结果并根据各个第一异或结果恢复出相应的旧目标数据及旧校验数据。针对RAID6,会得到pplP和pplQ两个第一异或结果,需要将pplP和pplQ分别落盘至P校验盘和Q校验盘,在数据恢复时,从P校验盘和Q校验盘读取pplP和pplQ。At this time, the old target data and each old check data are XORed to obtain multiple first XOR results and each first XOR result is stored in the atomic parity update area of the corresponding check disk, so that when a storage abnormality occurs, each first XOR result is read from each atomic parity update area and the corresponding old target data and old check data are restored according to each first XOR result. For RAID6, two first XOR results, pplP and pplQ, will be obtained. pplP and pplQ need to be written to the P check disk and Q check disk respectively. When the data is restored, pplP and pplQ are read from the P check disk and Q check disk.
这里需要说明的是,第一异或结果主要存储至校验盘的原子奇偶校验更新区域,也称为APU(atomic parity update)区域,RAID阵列对写请求产生的校验数据做的一个保护措施,目的是保证在发生存储系统异常之后,恢复条带的一致性,其内容含RAID条带地址、数据、校验。由此可见,本实施例提出使用PUFP机制,并且将APU机制结合进入PUFP机制当中。 It should be noted here that the first XOR result is mainly stored in the atomic parity update area of the check disk, also known as the APU (atomic parity update) area, which is a protection measure taken by the RAID array for the check data generated by the write request. The purpose is to ensure that the consistency of the stripe is restored after a storage system abnormality occurs. Its content includes the RAID stripe address, data, and check. It can be seen that this embodiment proposes to use the PUFP mechanism and integrate the APU mechanism into the PUFP mechanism.
本实施例中,在进行数据恢复时,主要根据pplP数据开始执行数据恢复流程。可选的,先对目标日志中的状态参数进行读取;其中,状态参数为校验更新的状态定义。然后根据状态参数确定出目标恢复算法,以利用目标恢复算法执行恢复流程。这里的状态参数为pufpState参数,主要是PUFP的状态定义,是异常恢复时选择恢复算法的主要依据。状态参数与恢复算法之间具有对应关系,主要根据状态参数与恢复算法之间的对应关系确定出目标恢复算法。此处的恢复算法包括分块切分恢复算法和伽罗华域算法。接着对目标日志中的槽位参数和控制块参数进行读取;其中,槽位参数为apuCode参数,表征校验盘的原子奇偶校验更新区域的位置,控制块参数为pslCbHandle参数,用于确定数据块所在的当前数据页链条及定位当前数据页链条的数据缓存区域。可以理解,使用APU区域进行写洞保护,需要指定一个APU槽位,并将其记录在apuCode参数中,由RAID卡初始化的时候一次写入。PUFP对应CB的CB handle记录在pslCbHandle参数中,并通过这个CB handle可以找到其所在的CP链条,定位当前CP链的数据缓存区域,并用于掉电后写洞保护恢复和问题追踪调试。其中,CP(control page)控制一个完整的IO,CB(control block)以条带为单元进行IO或后台任务,CB即是控制该IO或后台任务的数据结构。在此基础上,利用目标恢复算法根据槽位参数从原子奇偶校验更新区域中读取第一异或结果,并通过控制块参数函数指针执行恢复流程。In this embodiment, when performing data recovery, the data recovery process is mainly started based on the pplP data. Optionally, the state parameters in the target log are read first; wherein the state parameters are the state definition of the check update. Then the target recovery algorithm is determined based on the state parameters to execute the recovery process using the target recovery algorithm. The state parameter here is the pufpState parameter, which is mainly the state definition of PUFP and is the main basis for selecting the recovery algorithm during abnormal recovery. There is a corresponding relationship between the state parameter and the recovery algorithm, and the target recovery algorithm is mainly determined based on the corresponding relationship between the state parameter and the recovery algorithm. The recovery algorithms here include block segmentation recovery algorithm and Galois field algorithm. Then the slot parameters and control block parameters in the target log are read; wherein the slot parameter is the apuCode parameter, which characterizes the position of the atomic parity update area of the check disk, and the control block parameter is the pslCbHandle parameter, which is used to determine the current data page chain where the data block is located and locate the data cache area of the current data page chain. It can be understood that to use the APU area for write hole protection, it is necessary to specify an APU slot and record it in the apuCode parameter, which is written once when the RAID card is initialized. The CB handle of the CB corresponding to the PUFP is recorded in the pslCbHandle parameter, and through this CB handle, the CP chain to which it belongs can be found, the data cache area of the current CP chain can be located, and it can be used for write hole protection recovery and problem tracking and debugging after power failure. Among them, CP (control page) controls a complete IO, CB (control block) performs IO or background tasks in stripes, and CB is the data structure that controls the IO or background task. On this basis, the target recovery algorithm is used to read the first XOR result from the atomic parity update area according to the slot parameters, and the recovery process is executed through the control block parameter function pointer.
图4为本申请实施例提供的一种可选的安全存储方法流程图。参见图4所示,该安全存储方法应用于磁盘阵列卡,包括:FIG4 is a flow chart of an optional secure storage method provided in an embodiment of the present application. Referring to FIG4 , the secure storage method is applied to a disk array card, including:
S31:获取主机侧下发的阵列创建指令;其中,阵列创建指令为用户通过主机侧下发的创建阵列的命令行参数。S31: Obtaining an array creation instruction sent by the host side; wherein the array creation instruction is a command line parameter for creating an array sent by the user through the host side.
S32:控制磁盘阵列卡固件层的驱动程序对命令行参数进行解析,并将解析后参数透传至阵列控制器,以便阵列控制器根据解析后参数对目标日志中的参数进行初始化及赋值操作。S32: The driver program of the firmware layer of the disk array card is controlled to parse the command line parameters, and transparently transmit the parsed parameters to the array controller, so that the array controller initializes and assigns values to the parameters in the target log according to the parsed parameters.
本实施例中,获取主机侧下发的阵列创建指令;其中,阵列创建指令为用户通过主机侧下发的创建阵列的命令行参数。然后由控制阵列控制器根据阵列创建指令对目标日志中的参数进行初始化及赋值操作。即对图2中定义的pufpState、logicDeviceID、nsID、apuCode、dataLength、startLBA、pslCbHandle、dataStructureEntry等参数进行初始化及赋值。可选的,控制磁盘阵列卡固件层的驱动程序对命令行参数进行解析,并将解析后参数透传至阵列控制器,以便阵列控制器根据解析后参数对目标日志中的参数进行初始化及赋值操作。In this embodiment, the array creation instruction sent by the host side is obtained; wherein the array creation instruction is the command line parameters for creating the array sent by the user through the host side. Then, the array controller is controlled to initialize and assign values to the parameters in the target log according to the array creation instruction. That is, the pufpState, logicDeviceID, nsID, apuCode, dataLength, startLBA, pslCbHandle, dataStructureEntry and other parameters defined in Figure 2 are initialized and assigned values. Optionally, the driver of the firmware layer of the control disk array card parses the command line parameters and transmits the parsed parameters to the array controller so that the array controller initializes and assigns values to the parameters in the target log according to the parsed parameters.
S33:获取主机侧发送的输入输出写请求。S33: Obtain the input/output write request sent by the host side.
S34:控制阵列控制器根据输入输出请求对目标日志中的第一地址参数进行读取,并根据第一地址参数从磁盘阵列卡获取旧目标数据及旧校验数据;其中,目标日志用于记录阵列控制器进行校验更新的情况。S34: Control the array controller to read the first address parameter in the target log according to the input/output request, and obtain old target data and old verification data from the disk array card according to the first address parameter; wherein the target log is used to record verification and update status of the array controller.
S35:对旧目标数据和旧校验数据进行异或运算得到第一异或结果并将第 一异或结果存储至磁盘阵列卡的对应硬盘中。S35: Perform an XOR operation on the old target data and the old verification data to obtain a first XOR result and convert the result into the second XOR result. The XOR result is stored in the corresponding hard disk of the disk array card.
本实施例中,关于上述步骤S33至步骤S35的具体过程,可以参考前述实施例中公开的相应内容,在此不再进行赘述。In this embodiment, for the specific process of the above steps S33 to S35, reference may be made to the corresponding contents disclosed in the above embodiments, which will not be repeated here.
S36:通过定时器轮训的方式对磁盘阵列卡是否发生异常掉电进行检测,如果检测到磁盘阵列卡发生异常掉电,则判定存储异常。S36: Detecting whether the disk array card has abnormal power failure by means of timer rotation training. If it is detected that the disk array card has abnormal power failure, it is determined that the storage is abnormal.
S37:在存储异常时根据第一异或结果恢复出完整的旧目标数据及旧校验数据。S37: When a storage exception occurs, the complete old target data and the old verification data are restored according to the first XOR result.
本实施例中,通过定时器轮训的方式对磁盘阵列卡是否发生异常掉电进行检测,如果检测到磁盘阵列卡发生异常掉电,则判定存储异常,此时根据第一异或结果恢复出完整的旧目标数据及旧校验数据。也即存储异常的情况是掉电,此时的“写洞”可以定义为:非正常关机(意外掉电)+未完成的写操作+存储设备失效。In this embodiment, the disk array card is tested for abnormal power failure by means of timer rotation. If abnormal power failure is detected, the storage is determined to be abnormal. At this time, the complete old target data and old verification data are restored according to the first XOR result. That is, the storage abnormality is power failure, and the "write hole" at this time can be defined as: abnormal shutdown (accidental power failure) + unfinished write operation + storage device failure.
以图5中的RAID5中的写流程为例,“写洞”问题场景分为以下三种:(1)硬盘失效发生在掉电之后,此时系统处于“写通”WT模式(对于写IO事件,当写IO数据写入RAID卡的存储介质后响应HOST),主机下发了对盘1的4KB写IO,那么按照RAID5“RMW”流程,在系统执行第3步“将新的D1数据落盘”或者第5步“将新的校验数据P落盘”过程中,如果发生意外掉电,由于不能确定写盘操作是否完成,那么会导致该条带上的数据和校验无法保持一致性,如果系统不能识别/记录那些受“意外掉电”所影响的条带并加以处理,那么就会失去对该条带数据的保护能力,后期如果发生意外掉盘,就会造成错误的数据被恢复,而原始数据永久丢失;(2)硬盘失效发生在掉电及恢复过程中,此时系统处于“写通”WT模式,主机下发了对盘1的4KB写IO,那么按照RAID5“RMW”流程,在系统执行第3步“将新的D1数据落盘”或者第5步“将新的校验数据P落盘”过程中,如果发生意外掉电,并在再次上电后所有受到影响的条带重新同步完成之前,如果发生数据盘2的损坏,那么会导致盘2在该条带上的数据无法被恢复,永久丢失;(3)硬盘失效发生在掉电之前,此时系统处于“写通”WT模式,而盘2已经处于失效状态,整个RAID组处于“暴露”状态,此时后台任务也许正在对盘2进行重构。这个时候,主机下发了对盘1的4KB写IO,从系统开始执行第3步“将新的D1数据落盘”到完成第5步“将新的校验数据P落盘”之间任何时间发生系统的意外掉电,都会导致盘2在该条带的上的数据无法恢复,永久丢失。Taking the write process in RAID5 in Figure 5 as an example, the "write hole" problem scenarios are divided into the following three types: (1) The hard disk failure occurs after the power is off. At this time, the system is in the "write-through" WT mode (for write IO events, when the write IO data is written to the storage medium of the RAID card, it responds to the HOST). The host sends a 4KB write IO to disk 1. Then, according to the RAID5 "RMW" process, when the system executes step 3 "putting new D1 data on disk" or step 5 "putting new verification data P on disk", if an unexpected power outage occurs, since it cannot be determined whether the write operation is completed, the data and verification on the stripe will not be consistent. If the system cannot identify/record the stripes affected by the "accidental power outage" and process them, it will lose the ability to protect the data in the stripe. If an unexpected disk drop occurs later , the wrong data will be recovered, but the original data will be permanently lost; (2) The hard disk failure occurs during the power failure and recovery process. At this time, the system is in the "write-through" WT mode. The host sends a 4KB write IO to disk 1. Then, according to the RAID5 "RMW" process, when the system executes step 3 "putting new D1 data on disk" or step 5 "putting new verification data P on disk", if an unexpected power failure occurs and before all affected stripes are resynchronized after power is turned on again, if data disk 2 is damaged, the data on disk 2 on the stripe cannot be recovered and is permanently lost; (3) The hard disk failure occurs before the power failure. At this time, the system is in the "write-through" WT mode, and disk 2 is already in a failed state. The entire RAID group is in an "exposed" state. At this time, the background task may be reconstructing disk 2. At this time, the host sends a 4KB write IO to disk 1. If an unexpected power failure occurs at any time between the time when the system starts executing step 3 "writing the new D1 data to disk" and completing step 5 "writing the new verification data P to disk", the data on disk 2 in the stripe cannot be recovered and is permanently lost.
本实施例分别针对RAID5和RAID6详细介绍一下“写洞”保护流程。This embodiment introduces the "write hole" protection process in detail for RAID5 and RAID6 respectively.
图6所示为RAID5的写洞保护详细示例图,图7为图6中对应的“inlineXoR”操作示例图。第一步:RAID卡接收用户通过主机下发的创建RAID5阵列的任务;第二步:RAID卡固件层的驱动程序解析用户下发的创建RAID5阵列命令参数,并将参数透传至RAID卡控制器;第三步:RAID卡控制器根据解析的命令行参数,并初始化、赋值上文中提到的pufpState(PUFP的状态)、logicDeviceID、nsID、apuCode、dataLength、startLBA、pslCbHandle 和dataStructureEntry等参数;第四步:RAID卡接收到主机发送IO写请求后,RAID卡控制器根据logicDeviceID、nsID参数检索主机中DDR的具体地址数据,并将检索的主机DDR数据D’搬移到RAID卡的本地DDR,其中搬移多少数据由dataLength决定;第五步:由startLBA参数定位RAID卡中对应硬盘的物理地址,定位完毕后读取老数据D到RAID卡的本地DDR,同理从对应的硬盘上读取老校验数据P到RAID卡的本地DDR;第六步:由老校验数据P和老数据D异或运算得到pplP,由数据D’和老数据D异或运算得到ΔD,再由ΔD和P异或运算得到新的校验数据P’;第七步:将新的数据D’落盘到对应硬盘,将新的校验数据P’落盘到对应硬盘,将pplP落盘到RAID5阵列中P盘的APU区域;第八步:在第七步的落盘过程中,定时器定时轮训检查是否有意外掉电情况,如果没有意外掉电则待第七步中数据全部落盘完毕后释放资源后结束;如果有意外掉电,则执行第九步;第九步:如果出现意外掉电,则根据pplP数据开始执行数据恢复流程,根据pufpState参数选择恢复算法,具体有分块切分element恢复算法和伽罗华域算法等。由于该恢复算法不属于本申请的内容,故此处不做赘述。选择好恢复算法后根据apuCode参数,读取APU区域中备份老的数据部分校验和(即pplP),然后通过pslCbHandle函数指针开始执行恢复流程。第十步:数据恢复完毕后,释放资源并结束流程。Figure 6 shows a detailed example diagram of RAID5 write hole protection, and Figure 7 shows the corresponding "inlineXoR" operation example diagram in Figure 6. Step 1: The RAID card receives the task of creating a RAID5 array issued by the user through the host; Step 2: The driver of the RAID card firmware layer parses the command parameters for creating a RAID5 array issued by the user, and passes the parameters to the RAID card controller; Step 3: The RAID card controller initializes and assigns the pufpState (PUFP status), logicDeviceID, nsID, apuCode, dataLength, startLBA, and pslCbHandle mentioned above according to the parsed command line parameters and dataStructureEntry and other parameters; Step 4: After the RAID card receives the IO write request sent by the host, the RAID card controller retrieves the specific address data of the DDR in the host according to the logicDeviceID and nsID parameters, and moves the retrieved host DDR data D' to the local DDR of the RAID card, where the amount of data moved is determined by dataLength; Step 5: Use the startLBA parameter to locate the physical address of the corresponding hard disk in the RAID card. After the location is completed, read the old data D to the local DDR of the RAID card. Similarly, read the old verification data P from the corresponding hard disk to the local DDR of the RAID card; Step 6: XOR the old verification data P and the old data D to obtain pplP, and According to the XOR operation of D' and the old data D, ΔD is obtained, and then the new verification data P' is obtained by the XOR operation of ΔD and P; Step 7: The new data D' is written to the corresponding hard disk, the new verification data P' is written to the corresponding hard disk, and the pplP is written to the APU area of the P disk in the RAID5 array; Step 8: During the process of writing to the disk in the seventh step, the timer is regularly rotated to check whether there is an unexpected power outage. If there is no unexpected power outage, the resources are released after all the data in the seventh step are written to the disk; if there is an unexpected power outage, the ninth step is executed; Step 9: If an unexpected power outage occurs, the data recovery process is started according to the pplP data, and the recovery algorithm is selected according to the pufpState parameter, including the block segmentation element recovery algorithm and the Galois field algorithm. Since the recovery algorithm does not belong to the content of this application, it will not be described here. After selecting the recovery algorithm, read the partial checksum of the old data backup in the APU area (i.e., pplP) according to the apuCode parameter, and then start the recovery process through the pslCbHandle function pointer. Step 10: After data recovery is complete, release resources and end the process.
图8所示为RAID6的写洞保护详细示例图。第一步:RAID卡接收用户通过主机下发的创建RAID6阵列的任务;第二步:RAID卡固件层的驱动程序解析用户下发的创建RAID6阵列命令参数,并将参数透传至RAID卡控制器;第三步:RAID卡控制器根据解析的命令行参数,并初始化、赋值上文中提到的pufpState(PUFP的状态)、logicDeviceID、nsID、apuCode、dataLength、startLBA、pslCbHandle和dataStructureEntry等参数;第四步:RAID卡接收到主机发送IO写请求后,RAID卡控制器根据logicDeviceID、nsID参数检索主机中DDR的具体地址数据,并将检索的主机DDR数据D’搬移到RAID卡的本地DDR,其中搬移多少数据由dataLength决定;第五步:由startLBA参数定位RAID卡中对应硬盘的物理地址,定位完毕后读取老数据D到RAID卡的本地DDR,同理从对应的硬盘上读取老校验数据P到RAID卡的本地DDR,从对应的硬盘上读取老校验数据Q到RAID卡的本地DDR;第六步:由老校验数据P和老数据D异或运算得到pplP,由老校验数据Q和老数据D异或运算得到pplQ,由数据D’和老数据D异或运算得到ΔD,再由ΔD和P异或运算得到新的校验数据P’,再由ΔD和Q异或运算得到新的校验数据Q’;第七步:将新的数据D’落盘到对应硬盘,将新的校验数据P’落盘到对应硬盘,将pplP落盘到RAID6阵列中P盘的APU区域,将pplQ落盘到RAID6阵列中Q盘的APU区域;第八步:在第七步的落盘过程中,定时器定时轮训检查是否有意外掉电情况,如果没有意外掉电则待第七步中数据全部落盘完毕后释放资源结束;如果有意外掉电,则执行第九步;第九步:出现意外掉电,则根据pplP、pplQ数据开始执行数据恢复流程,根据pufpState参数选择恢复算法,具体有分块切分element恢复算法和伽罗华域算法等,由于该恢复算法不属于本申请的内容故此处不做赘述。选择好恢复算法 后根据apuCode参数,读取APU区域中备份老的数据部分校验和(即pplP和pplQ数据),然后通过pslCbHandle函数指针开始执行恢复流程;第十步:数据恢复完毕后,释放资源并结束流程。FIG8 shows a detailed example diagram of write hole protection for RAID6. Step 1: The RAID card receives the task of creating a RAID6 array issued by the user through the host; Step 2: The driver of the RAID card firmware layer parses the command parameters for creating a RAID6 array issued by the user, and transmits the parameters to the RAID card controller; Step 3: The RAID card controller initializes and assigns the pufpState (PUFP status), logicDeviceID, nsID, apuCode, dataLength, startLBA, pslCbHandle, and dataStructureEntry parameters mentioned above according to the parsed command line parameters; Step 4: After the RAID card receives the IO write request sent by the host, the RAID card controller retrieves the specific address data of the DDR in the host according to the logicDeviceID and nsID parameters, and moves the retrieved host DDR data D' to the local DDR of the RAID card, where the amount of data moved is determined by the dataLength; Step 5: The physical address of the corresponding hard disk in the RAID card is located by the startLBA parameter. After the location is completed, the old data D is read to the local DDR of the RAID card. Similarly, the old verification data P is read from the corresponding hard disk to RA The local DDR of the ID card reads the old verification data Q from the corresponding hard disk to the local DDR of the RAID card; the sixth step: the old verification data P and the old data D are XORed to obtain pplP, the old verification data Q and the old data D are XORed to obtain pplQ, the data D' and the old data D are XORed to obtain ΔD, and then the new verification data P' is XORed by ΔD and P, and then the new verification data Q' is XORed by ΔD and Q; the seventh step: the new data D' is written to the corresponding hard disk, the new verification data P' is written to the corresponding hard disk, and the pplP is written to the APU area of the P disk in the RAID6 array. Write pplQ to the APU area of the Q disk in the RAID6 array; Step 8: During the process of writing to disk in step 7, the timer will periodically check whether there is an unexpected power outage. If there is no unexpected power outage, the resources will be released after all the data in step 7 is written to disk; if there is an unexpected power outage, execute step 9; Step 9: In the event of an unexpected power outage, start the data recovery process based on the pplP and pplQ data, and select the recovery algorithm based on the pufpState parameter. Specifically, there are block segmentation element recovery algorithm and Galois field algorithm, etc. Since the recovery algorithm does not belong to the content of this application, it will not be described here. Choose a good recovery algorithm Then, according to the apuCode parameter, read the partial checksum of the old data backed up in the APU area (ie, pplP and pplQ data), and then start the recovery process through the pslCbHandle function pointer; Step 10: After the data recovery is completed, release the resources and end the process.
参见图9所示,本申请实施例还相应公开了一种安全存储装置,应用于磁盘阵列卡,包括:As shown in FIG. 9 , the embodiment of the present application further discloses a secure storage device, which is applied to a disk array card and includes:
请求获取模块11,被配置为获取主机侧发送的输入输出写请求;The request acquisition module 11 is configured to acquire the input/output write request sent by the host side;
第一读取模块12,被配置为控制阵列控制器根据输入输出请求对目标日志中的第一地址参数进行读取,并根据第一地址参数从磁盘阵列卡获取旧目标数据及旧校验数据;其中,目标日志用于记录阵列控制器进行校验更新的情况;The first reading module 12 is configured to control the array controller to read the first address parameter in the target log according to the input and output request, and obtain the old target data and the old verification data from the disk array card according to the first address parameter; wherein the target log is used to record the verification update situation of the array controller;
第一运算及恢复模块13,被配置为对旧目标数据和旧校验数据进行异或运算得到第一异或结果并将第一异或结果存储至磁盘阵列卡的对应硬盘中,以便在存储异常时根据第一异或结果恢复出完整的旧目标数据及旧校验数据。The first operation and recovery module 13 is configured to perform an XOR operation on the old target data and the old verification data to obtain a first XOR result and store the first XOR result in a corresponding hard disk of the disk array card, so as to recover the complete old target data and the old verification data according to the first XOR result when a storage abnormality occurs.
可见,本申请实施例先获取主机侧发送的输入输出写请求;然后控制阵列控制器根据输入输出请求对目标日志中的第一地址参数进行读取,并根据第一地址参数从磁盘阵列卡获取旧目标数据及旧校验数据;其中,目标日志用于记录阵列控制器进行校验更新的情况;最后对旧目标数据和旧校验数据进行异或运算得到第一异或结果并将第一异或结果存储至磁盘阵列卡的对应硬盘中,以便在存储异常时根据第一异或结果恢复出完整的旧目标数据及旧校验数据。本申请实施例引入目标日志的概念,其用于记录阵列控制器进行校验更新的情况,在进行存储更新时,根据该目标日志中的参数获取旧目标数据及旧校验数据,以此生成一个异或结果,这个异或结果用于在存储异常时恢复数据,从而解决“写洞”问题的同时继续保持较高的系统IO性能,在不增加硬件成本的基础上,提高磁盘阵列卡的数据安全性以及用户体验。It can be seen that the embodiment of the present application first obtains the input and output write request sent by the host side; then controls the array controller to read the first address parameter in the target log according to the input and output request, and obtains the old target data and the old verification data from the disk array card according to the first address parameter; wherein the target log is used to record the verification and update of the array controller; finally, the old target data and the old verification data are XORed to obtain the first XOR result and the first XOR result is stored in the corresponding hard disk of the disk array card, so that the complete old target data and the old verification data can be restored according to the first XOR result when the storage is abnormal. The embodiment of the present application introduces the concept of a target log, which is used to record the verification and update of the array controller. When performing storage updates, the old target data and the old verification data are obtained according to the parameters in the target log, so as to generate an XOR result, which is used to restore data when the storage is abnormal, thereby solving the "write hole" problem while continuing to maintain a high system IO performance, and improving the data security and user experience of the disk array card without increasing the hardware cost.
在一些可选实施例中,安全存储装置还包括:In some optional embodiments, the secure storage device further includes:
第二读取模块,被配置为根据输入输出写请求从主机侧获取与旧目标数据对应的新目标数据,并根据新目标数据、旧目标数据和旧校验数据得到新校验数据;A second reading module is configured to obtain new target data corresponding to the old target data from the host side according to the input and output write request, and obtain new verification data according to the new target data, the old target data and the old verification data;
落盘模块,被配置为将新目标数据和新校验数据存储至磁盘阵列卡的对应硬盘中,以便在存储正常时保证数据及校验一致性;The disk placement module is configured to store the new target data and the new verification data in the corresponding hard disk of the disk array card, so as to ensure the consistency of data and verification when the storage is normal;
覆盖写模块,被配置为获取新的参数值并利用新的参数值对目标日志中的参数进行覆盖写操作;An overwrite module is configured to obtain a new parameter value and overwrite the parameter in the target log with the new parameter value;
搬移模块,被配置为将新目标数据搬移至磁盘阵列卡的内存中;A moving module is configured to move new target data to the memory of the disk array card;
指令获取模块,被配置为获取主机侧下发的阵列创建指令;An instruction acquisition module is configured to acquire an array creation instruction issued by a host side;
初始化及赋值模块,被配置为控制阵列控制器根据阵列创建指令对目标日志中的参数进行初始化及赋值操作;The initialization and assignment module is configured to control the array controller to perform initialization and assignment operations on the parameters in the target log according to the array creation instruction;
轮训模块,被配置为通过定时器轮训的方式对磁盘阵列卡是否发生异常掉电进行检测,如果检测到磁盘阵列卡发生异常掉电,则判定存储异常。The polling module is configured to detect whether an abnormal power failure occurs to the disk array card by means of a timer polling method. If an abnormal power failure occurs to the disk array card, it is determined that the storage is abnormal.
在一些可选实施例中,第二读取模块,包括: In some optional embodiments, the second reading module includes:
读取单元,被配置为控制阵列控制器根据输入输出请求对目标日志中的第二地址参数进行读取,并根据第二地址参数从主机侧的内存中获取新目标数据;a reading unit configured to control the array controller to read the second address parameter in the target log according to the input/output request, and to obtain new target data from the memory on the host side according to the second address parameter;
异或单元,被配置为在磁盘阵列卡的内存中对旧目标数据和新目标数据进行异或运算得到第二异或结果,并对第二异或结果和旧校验数据进行异或运算得到第三异或结果;将第三异或结果作为新校验数据。The XOR unit is configured to perform an XOR operation on the old target data and the new target data in the memory of the disk array card to obtain a second XOR result, and perform an XOR operation on the second XOR result and the old verification data to obtain a third XOR result; and use the third XOR result as the new verification data.
在一些可选实施例中,第一读取模块12,被配置为将旧目标数据及旧校验数据搬移至磁盘阵列卡的内存中。In some optional embodiments, the first reading module 12 is configured to move the old target data and the old verification data to the memory of the disk array card.
在一些可选实施例中,第一运算及恢复模块13,被配置为在磁盘阵列卡的内存中对旧目标数据和旧校验数据进行异或运算得到第一异或结果。In some optional embodiments, the first operation and recovery module 13 is configured to perform an XOR operation on the old target data and the old verification data in the memory of the disk array card to obtain a first XOR result.
在一些可选实施例中,第一运算及恢复模块13,还被配置为将第一异或结果存储至磁盘阵列卡存储旧校验数据的校验盘的原子奇偶校验更新区域中,以便在存储异常时,从原子奇偶校验更新区域中读取第一异或结果并根据第一异或结果恢复出完整的旧目标数据及旧校验数据。In some optional embodiments, the first operation and recovery module 13 is further configured to store the first XOR result in the atomic parity update area of the check disk of the disk array card storing the old check data, so that when a storage abnormality occurs, the first XOR result is read from the atomic parity update area and the complete old target data and old check data are recovered according to the first XOR result.
在一些可选实施例中,第一读取模块12,还被配置为如果磁盘阵列卡中包含多个校验盘,则根据第一地址参数从磁盘阵列卡获取旧目标数据及多个旧校验数据;其中,一个校验盘上存储一个校验数据。In some optional embodiments, the first reading module 12 is further configured to obtain old target data and multiple old verification data from the disk array card according to the first address parameter if the disk array card includes multiple verification disks; wherein one verification data is stored on one verification disk.
在一些可选实施例中,第一运算及恢复模块13,还被配置为分别对旧目标数据和各个旧校验数据进行异或运算得到多个第一异或结果并将各个第一异或结果分别存储至对应校验盘的原子奇偶校验更新区域中,以便在存储异常时,从各个原子奇偶校验更新区域中读取各个第一异或结果并根据各个第一异或结果恢复出相应的旧目标数据及旧校验数据。In some optional embodiments, the first operation and recovery module 13 is further configured to perform XOR operations on the old target data and each old verification data to obtain multiple first XOR results and store each first XOR result in the atomic parity update area of the corresponding verification disk, so that when a storage abnormality occurs, each first XOR result is read from each atomic parity update area and the corresponding old target data and old verification data are recovered according to each first XOR result.
可选的,本申请实施例还提供了一种电子设备。图10是根据一示例性实施例示出的电子设备20结构图,图中的内容不能认为是对本申请的使用范围的任何限制。Optionally, an embodiment of the present application further provides an electronic device. Fig. 10 is a structural diagram of an electronic device 20 according to an exemplary embodiment, and the content in the diagram cannot be regarded as any limitation on the scope of use of the present application.
图10为本申请实施例提供的一种电子设备20的结构示意图。该电子设备20,可以包括:至少一个处理器21、至少一个存储器22、电源23、通信接口24、输入输出接口25和通信总线26。其中,存储器22被配置为存储计算机程序,计算机程序由处理器21加载并执行,以实现前述任一实施例公开的安全存储方法中的相关步骤。FIG10 is a schematic diagram of the structure of an electronic device 20 provided in an embodiment of the present application. The electronic device 20 may include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input/output interface 25, and a communication bus 26. The memory 22 is configured to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the secure storage method disclosed in any of the aforementioned embodiments.
本实施例中,电源23被配置为为电子设备20上的各硬件设备提供工作电压;通信接口24能够为电子设备20创建与外界设备之间的数据传输通道,其所遵循的通信协议是能够适用于本申请技术方案的任意通信协议,在此不对其进行具体限定;输入输出接口25,被配置为获取外界输入数据或向外界输出数据,其具体的接口类型可以根据具体应用需要进行选取,在此不进行具体限定。In this embodiment, the power supply 23 is configured to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface 25 is configured to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs, and is not specifically limited here.
另外,存储器22作为资源存储的载体,可以是只读存储器、随机存储器、磁盘或者光盘等,其上所存储的资源可以包括操作系统221、计算机程序222及 数据223等,存储方式可以是短暂存储或者永久存储。In addition, the memory 22 as a carrier for storing resources may be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon may include an operating system 221, a computer program 222 and Data 223, etc., can be stored in a temporary or permanent manner.
其中,操作系统221被配置为管理与控制电子设备20上的各硬件设备以及计算机程序222,以实现处理器21对存储器22中海量数据223的运算与处理,其可以是WindowsServer、Netware、Unix、Linux等。计算机程序222除了包括能够用于完成前述任一实施例公开的由电子设备20执行的安全存储方法的计算机程序之外,还可以进一步包括能够用于完成其他特定工作的计算机程序。数据223可以包括电子设备20收集到的请求数据。The operating system 221 is configured to manage and control the hardware devices and computer programs 222 on the electronic device 20 to realize the operation and processing of the massive data 223 in the memory 22 by the processor 21, which can be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program that can be used to complete the secure storage method performed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 222 can further include a computer program that can be used to complete other specific tasks. The data 223 can include the request data collected by the electronic device 20.
可选的,本申请实施例还公开了一种非易失性可读存储介质,非易失性可读存储介质中存储有计算机程序,计算机程序被处理器加载并执行时,实现前述任一实施例公开的安全存储方法步骤。Optionally, an embodiment of the present application further discloses a non-volatile readable storage medium, in which a computer program is stored. When the computer program is loaded and executed by a processor, the steps of the secure storage method disclosed in any of the aforementioned embodiments are implemented.
本说明书中各个实施例采用递进的方式描述,每个实施例重点说明的都是与其它实施例的不同之处,各个实施例之间相同或相似部分互相参见即可。对于实施例公开的装置而言,由于其与实施例公开的方法相对应,所以描述的比较简单,相关之处参见方法部分说明即可。In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
最后,还需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个…”限定的要素,并不排除在包括要素的过程、方法、物品或者设备中还存在另外的相同要素。Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
以上对本申请所提供的安全存储方法、装置、设备及非易失性可读存储介质进行了详细介绍,本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想;同时,对于本领域的一般技术人员,依据本申请的思想,在具体实施方式及应用范围上均会有改变之处,综上,本说明书内容不应理解为对本申请的限制。 The above is a detailed introduction to the secure storage method, device, equipment and non-volatile readable storage medium provided by the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for general technical personnel in this field, according to the idea of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims (20)
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202310025601.7A CN115793985B (en) | 2023-01-09 | 2023-01-09 | Secure storage method, apparatus, device and storage medium |
| CN202310025601.7 | 2023-01-09 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2024148865A1 true WO2024148865A1 (en) | 2024-07-18 |
Family
ID=85428791
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2023/121828 Ceased WO2024148865A1 (en) | 2023-01-09 | 2023-09-27 | Secure storage method, apparatus and device, and non-volatile readable storage medium |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN115793985B (en) |
| WO (1) | WO2024148865A1 (en) |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN118885131A (en) * | 2024-09-29 | 2024-11-01 | 苏州元脑智能科技有限公司 | Dual-controller data management method, electronic device, storage medium and product |
| CN120687041A (en) * | 2025-08-22 | 2025-09-23 | 山东云海国创云计算装备产业创新中心有限公司 | A data request processing method, device, equipment and storage medium |
Families Citing this family (10)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN115793985B (en) * | 2023-01-09 | 2023-04-21 | 苏州浪潮智能科技有限公司 | Secure storage method, apparatus, device and storage medium |
| CN115993882A (en) * | 2023-03-21 | 2023-04-21 | 苏州浪潮智能科技有限公司 | Disk array card standby electric control method, device, electronic equipment and storage medium |
| CN117112310B (en) * | 2023-10-18 | 2024-02-20 | 苏州元脑智能科技有限公司 | Background task progress saving and restoring method, device, equipment and storage medium |
| CN117574446B (en) * | 2024-01-16 | 2024-04-05 | 苏州元脑智能科技有限公司 | Data protection method, device, equipment and storage medium |
| CN118276785B (en) * | 2024-05-31 | 2024-09-13 | 山东云海国创云计算装备产业创新中心有限公司 | Input/output processing method, system, device, equipment, storage medium and product |
| CN118331512B (en) * | 2024-06-14 | 2024-09-13 | 山东云海国创云计算装备产业创新中心有限公司 | Processing method and device based on memory control card |
| CN118394565B (en) * | 2024-06-28 | 2024-10-22 | 苏州元脑智能科技有限公司 | Exclusive OR calculation method, device and product of storage system |
| CN118779146B (en) * | 2024-09-11 | 2025-01-24 | 山东云海国创云计算装备产业创新中心有限公司 | Data storage method, device, medium and product |
| CN119847816B (en) * | 2025-03-24 | 2025-06-13 | 山东云海国创云计算装备产业创新中心有限公司 | Data writing method and device, electronic equipment and storage medium |
| CN120469849B (en) * | 2025-07-15 | 2025-11-25 | 山东云海国创云计算装备产业创新中心有限公司 | Abnormal data positioning method, device, equipment, program product and storage medium |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US8832395B1 (en) * | 2013-04-12 | 2014-09-09 | Hitachi, Ltd. | Storage system, and method of storage control for storage system |
| CN107391046A (en) * | 2017-08-02 | 2017-11-24 | 郑州云海信息技术有限公司 | The method for writing data and device of a kind of RAID system |
| CN113791731A (en) * | 2021-08-26 | 2021-12-14 | 深圳创云科软件技术有限公司 | Processing method for solving Write Hole of storage disk array |
| CN115562594A (en) * | 2022-12-06 | 2023-01-03 | 苏州浪潮智能科技有限公司 | Method, system and related device for constructing RAID card |
| CN115793985A (en) * | 2023-01-09 | 2023-03-14 | 苏州浪潮智能科技有限公司 | Safe storage method, device, equipment and storage medium |
Family Cites Families (9)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US6523087B2 (en) * | 2001-03-06 | 2003-02-18 | Chaparral Network Storage, Inc. | Utilizing parity caching and parity logging while closing the RAID5 write hole |
| JP5404804B2 (en) * | 2009-05-25 | 2014-02-05 | 株式会社日立製作所 | Storage subsystem |
| CN102270102B (en) * | 2011-04-29 | 2013-07-10 | 华中科技大学 | Method for optimizing writing performance of RAID6 (Redundant Array of Independent Disks) disk array |
| CN103049222B (en) * | 2012-12-28 | 2016-05-25 | 中国船舶重工集团公司第七0九研究所 | A kind of RAID5 writes IO optimized treatment method |
| US9946607B2 (en) * | 2015-03-04 | 2018-04-17 | Sandisk Technologies Llc | Systems and methods for storage error management |
| KR101986579B1 (en) * | 2016-12-14 | 2019-10-01 | 한국과학기술원 | System and method for log-based parity update of SSD array and to defect block and node failures recovery method using the same |
| CN110413205B (en) * | 2018-04-28 | 2023-07-07 | 伊姆西Ip控股有限责任公司 | Method, apparatus and computer readable storage medium for writing to disk array |
| CN111078472B (en) * | 2019-12-23 | 2023-06-02 | 四川效率源信息安全技术股份有限公司 | Data recovery method after raid6 is in absence of disk |
| CN114610525A (en) * | 2022-03-18 | 2022-06-10 | 山东云海国创云计算装备产业创新中心有限公司 | Data updating method, system and storage medium for disk array |
-
2023
- 2023-01-09 CN CN202310025601.7A patent/CN115793985B/en active Active
- 2023-09-27 WO PCT/CN2023/121828 patent/WO2024148865A1/en not_active Ceased
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US8832395B1 (en) * | 2013-04-12 | 2014-09-09 | Hitachi, Ltd. | Storage system, and method of storage control for storage system |
| CN107391046A (en) * | 2017-08-02 | 2017-11-24 | 郑州云海信息技术有限公司 | The method for writing data and device of a kind of RAID system |
| CN113791731A (en) * | 2021-08-26 | 2021-12-14 | 深圳创云科软件技术有限公司 | Processing method for solving Write Hole of storage disk array |
| CN115562594A (en) * | 2022-12-06 | 2023-01-03 | 苏州浪潮智能科技有限公司 | Method, system and related device for constructing RAID card |
| CN115793985A (en) * | 2023-01-09 | 2023-03-14 | 苏州浪潮智能科技有限公司 | Safe storage method, device, equipment and storage medium |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN118885131A (en) * | 2024-09-29 | 2024-11-01 | 苏州元脑智能科技有限公司 | Dual-controller data management method, electronic device, storage medium and product |
| CN120687041A (en) * | 2025-08-22 | 2025-09-23 | 山东云海国创云计算装备产业创新中心有限公司 | A data request processing method, device, equipment and storage medium |
Also Published As
| Publication number | Publication date |
|---|---|
| CN115793985A (en) | 2023-03-14 |
| CN115793985B (en) | 2023-04-21 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| WO2024148865A1 (en) | Secure storage method, apparatus and device, and non-volatile readable storage medium | |
| US6523087B2 (en) | Utilizing parity caching and parity logging while closing the RAID5 write hole | |
| US8904129B2 (en) | Method and apparatus for backup and restore in a dynamic chunk allocation storage system | |
| US6990611B2 (en) | Recovering data from arrays of storage devices after certain failures | |
| US8209595B2 (en) | Storage sub-system and method for controlling the same | |
| US6738863B2 (en) | Method for rebuilding meta-data in a data storage system and a data storage system | |
| US7076606B2 (en) | Accelerated RAID with rewind capability | |
| US7831764B2 (en) | Storage system having plural flash memory drives and method for controlling data storage | |
| JP4435705B2 (en) | Storage device, control method thereof, and program | |
| US7685180B2 (en) | System and article of manufacture for transparent file restore | |
| US7386758B2 (en) | Method and apparatus for reconstructing data in object-based storage arrays | |
| US7185048B2 (en) | Backup processing method | |
| US20070033356A1 (en) | System for Enabling Secure and Automatic Data Backup and Instant Recovery | |
| CN100416508C (en) | A data backup method in storage network | |
| US7774643B2 (en) | Method and apparatus for preventing permanent data loss due to single failure of a fault tolerant array | |
| US20080222214A1 (en) | Storage system and remote copy system restoring data using journal | |
| CN101436151A (en) | Data real time backup method and system based on file system | |
| US20100064103A1 (en) | Storage control device and raid group extension method | |
| JP2006139478A (en) | Disk array system | |
| US5421003A (en) | Disk storage system with fault tolerant media maintenance | |
| US7587630B1 (en) | Method and system for rapidly recovering data from a “dead” disk in a RAID disk group | |
| WO2024113685A1 (en) | Data recovery method for raid array and related apparatus | |
| US7398448B2 (en) | Storage system has the function of preventing drive write error | |
| US20070192557A1 (en) | Disk array system and method for security | |
| US8745343B2 (en) | Data duplication resynchronization with reduced time and processing requirements |
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: 23915623 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |