A method and apparatus for data protection in a server
By setting up a backup system disk and non-volatile memory in the server, the problem of data loss when the server system disk is damaged is solved, enabling secure data backup and rapid recovery, and improving server reliability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-29
- Publication Date
- 2026-03-31
Smart Images

Figure CN115509815B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of server technology, and in particular to a method and apparatus for data protection in a server. Background Technology
[0002] With the development of science and technology, users have higher and higher requirements for servers. Servers run various data through deployed systems. System failure is the most common unexpected situation that occurs on servers. If a server experiences a system failure, it may lead to data loss.
[0003] In existing technologies, server system disks are protected to ensure timely data saving. If the system or system disk malfunctions, a restart allows for automatic repair. However, if the system disk or system itself is severely damaged and cannot be repaired, the lost data will be unrecoverable. Summary of the Invention
[0004] In view of the above problems, a method and apparatus for data protection in a server are proposed to overcome or at least partially solve the above problems, comprising:
[0005] A method for data protection in a server, the method comprising:
[0006] If the server has a backup system disk, verify whether the data in the primary system disk and the backup system disk of the server are consistent.
[0007] In the event of data inconsistency between the primary system disk and the backup system disk, the data in the primary system disk will be backed up to non-volatile memory.
[0008] Back up the data in the non-volatile memory to the backup system disk;
[0009] When the main system disk fails, stop backing up the data in the main system disk to the non-volatile memory, and determine whether all the data in the non-volatile memory has been backed up to the backup system disk;
[0010] If all data in the non-volatile memory is backed up to the backup system disk, the backup system disk is used to replace the primary system disk in order to enter the operating system on the backup system disk;
[0011] In the case where the backup system disk replaces the primary system disk, the data in the backup system disk is backed up to the non-volatile memory, and the data in the non-volatile memory is backed up to the primary system disk.
[0012] Optionally, it also includes:
[0013] When data is updated on the main system disk, the updated data is backed up to the non-volatile memory, and the updated data in the non-volatile memory is backed up to the backup system disk.
[0014] Optionally, before backing up the data in the backup system disk to the non-volatile memory and backing up the data in the non-volatile memory to the primary system disk, the method further includes:
[0015] When the backup system disk replaces the primary system disk, the operation information and log information prior to the failure of the primary system disk are obtained and stored.
[0016] Optionally, the log information includes any one or more of the following:
[0017] System log information, baseboard management controller log information, and black box log information.
[0018] Optionally, it also includes:
[0019] If not all data in the non-volatile memory is backed up to the backup system disk, the remaining data in the non-volatile memory is backed up to the backup system disk.
[0020] Optionally, verifying whether the data in the primary system disk and the backup system disk of the server are consistent includes:
[0021] Verify that the used capacity and data content of the primary system disk and the backup system disk in the server are consistent.
[0022] If the used capacity or data content is inconsistent, it is determined that the data in the primary system disk and the backup system disk are inconsistent.
[0023] Optionally, the non-volatile memory includes any one or more of the following:
[0024] NVDIMM memory, PMEM memory.
[0025] A data protection device for a server, the device comprising:
[0026] The consistency verification module is used to verify whether the data in the primary system disk and the backup system disk of the server are consistent when the server is equipped with a backup system disk.
[0027] The backup to standby system disk module is used to back up the data in the main system disk to non-volatile memory and back up the data in the non-volatile memory to the standby system disk when the data in the main system disk and the standby system disk are inconsistent.
[0028] The module for determining whether all data has been backed up is used to stop backing up data from the main system disk to the non-volatile memory when the main system disk fails, and to determine whether all data in the non-volatile memory has been backed up to the backup system disk.
[0029] The backup system disk replacement module is used to replace the main system disk with the backup system disk when all data in the non-volatile memory is backed up to the backup system disk, so as to enter the operating system in the backup system disk;
[0030] The backup disk data backup to main system disk module is used to back up the data in the backup system disk to the non-volatile memory and back up the data in the non-volatile memory to the main system disk when the backup system disk replaces the main system disk.
[0031] An electronic device includes a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein the computer program, when executed by the processor, implements the data protection method in the server described above.
[0032] A computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described method for data protection in a server.
[0033] The embodiments of the present invention have the following advantages:
[0034] In this embodiment of the invention, when the server is equipped with a backup system disk, the data in the primary system disk and the backup system disk are verified to be consistent. If the data in the primary system disk and the backup system disk are inconsistent, the data in the primary system disk is backed up to non-volatile memory, and the data in the non-volatile memory is backed up to the backup system disk. This realizes the use of non-volatile memory to back up the data in the server's system disk. When the system disk or system cannot be automatically repaired, the data can be restored through the backup system disk. Furthermore, since the data is backed up through non-volatile memory, it can be ensured that no data loss occurs during the backup or recovery process, thereby improving the reliability of the server and ensuring data security.
[0035] Furthermore, by stopping the backup of data from the main system disk to the non-volatile memory when the main system disk fails, and determining whether all data in the non-volatile memory has been backed up to the backup system disk, and if all data in the non-volatile memory has been backed up to the backup system disk, the backup system disk is used to replace the main system disk to enter the operating system on the backup system disk. Then, the data in the backup system disk is backed up to the non-volatile memory, and the data in the non-volatile memory is backed up to the main system disk. This achieves the replacement of the faulty main system disk with the backup system disk and the repair of the main system disk, saving the resource consumption of manual repair. Attached Figure Description
[0036] To more clearly illustrate the technical solution of the present invention, the accompanying drawings used in the description of the present invention will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0037] Figure 1 This is a flowchart illustrating the steps of a data protection method in a server according to an embodiment of the present invention;
[0038] Figure 2 This is a flowchart of another method for data protection in a server provided by an embodiment of the present invention;
[0039] Figure 3 This is a flowchart of another method for data protection in a server provided by an embodiment of the present invention;
[0040] Figure 4 This is a flowchart of another method for data protection in a server provided by an embodiment of the present invention;
[0041] Figure 5 This is a flowchart illustrating the steps of a data protection example in a server according to an embodiment of the present invention;
[0042] Figure 6 This is a flowchart illustrating the steps of another data protection example in a server provided by an embodiment of the present invention;
[0043] Figure 7 This is a structural block diagram of a data protection device in a server provided in an embodiment of the present invention. Detailed Implementation
[0044] To make the above-mentioned objects, features, and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.
[0045] In practical applications, a server can be equipped with a signal switching chip, a platform controller (PCH), and a baseboard management controller (BMC). The platform controller receives the current system disk failure command from the signal switching chip and sends a system disk redundancy switching command to the baseboard management controller based on the current system disk failure command. The baseboard management controller sends a system disk switching command to the signal switching chip based on the system disk redundancy switching command. When a failure is detected in the current system disk, the signal switching chip sends the current system disk failure command back to the platform controller and performs system disk redundancy switching based on the target system disk information, thereby realizing redundancy switching in the event of a system disk failure and ensuring the stable and secure operation of the server.
[0046] However, the above method has the following disadvantages:
[0047] 1. It is highly dependent on the switching chip, platform controller and baseboard management controller. Each component is responsible for a part of the operation. If one component fails, the entire operation process will be affected or the entire process will not be able to run at all.
[0048] 2. The platform controller restricts the connection method of the system disk and cannot be used on servers where the system disk is not connected via PCH.
[0049] Based on this, the embodiments of the present invention propose:
[0050] 1. Using NVIDMM memory and PMEM memory as backup relay devices, the primary system copies data to the backup system, and the backup system copies data to the primary system, all relying on NVIDMM memory and PMEM memory, thus maximizing the utilization of this type of memory.
[0051] By using NVIDMM and PMEM memory as backup relay devices, and recognizing that NVIDMM and PMEM memory are non-volatile, data is retained even when power is off. Therefore, data transmission and preservation can continue even during power outages, system crashes, and normal shutdowns. Furthermore, by using NVIDMM and PMEM memory as backup relay devices, the storage capacity of these types of memory is fully utilized, eliminating the need for additional backup devices and saving costs.
[0052] 2. The CPU will determine whether the main hard drive is faulty. When the main system disk fails, the CPU will send a command to stop the main system disk from continuing to back up to the backup system disk, and send a command to start the backup system disk. The backup system disk will be enabled and can normally collect the operations before the failure, as well as OS logs, BMC logs, and black box logs.
[0053] 3. When the main system fails, the backup system will also copy the data to the main system. This not only repairs the main system disk but also saves the data, saving time and manpower for manual repair.
[0054] Further explanation follows;
[0055] Reference Figure 1 The diagram illustrates a flowchart of a data protection method in a server according to an embodiment of the present invention, which may specifically include the following steps:
[0056] Step 101: If the server has a backup system disk, verify whether the data in the primary system disk and the backup system disk of the server are consistent.
[0057] In practical applications, after the main system disk enters the OS, the main system will send instructions to the CPU. After receiving the instructions from the main system, the CPU will automatically detect whether there is a hard drive inserted in the location of the backup system disk. The backup system disk needs to be installed in the designated slot of the backup system disk. When the CPU detects that there is a hard drive in the location of the backup system disk, it can determine that the server has a backup system disk.
[0058] If the server has a backup system disk, it is possible to verify whether the data on the primary system disk and the backup system disk are consistent.
[0059] In one embodiment of the present invention, the step of verifying whether the data in the primary system disk and the backup system disk of the server are consistent includes:
[0060] Verify whether the used capacity and data content of the primary system disk and the backup system disk in the server are consistent; if the used capacity or data content is inconsistent, determine that the data in the primary system disk and the backup system disk are inconsistent.
[0061] Each time the server boots up, it first compares the used capacity and data content of the main system disk with the backup system disk to determine if they are consistent. If any of these two values are inconsistent, the main system disk is considered to have inconsistent data with the backup system disk. Only when both the used capacity and data content of the main system and the backup system are consistent is the data on the main system disk considered to be consistent with the backup system disk.
[0062] Step 102: If the data in the primary system disk and the backup system disk are inconsistent, back up the data in the primary system disk to non-volatile memory, and back up the data in the non-volatile memory to the backup system disk.
[0063] If the capacity of the primary system and the used capacity and data content of the backup system are the same, then no backup operation is required. If the data in the primary system disk and the backup system disk are inconsistent, the data in the primary system disk will be backed up to non-volatile memory.
[0064] The backup data includes OS data and other data, which means that the backup operation of the main OS will be automatically performed, including OS backup and data backup.
[0065] In one embodiment of the present invention, the non-volatile memory includes any one or more of the following:
[0066] NVDIMM memory, PMEM memory.
[0067] After backing up the data to non-volatile memory, back up the data from non-volatile memory to a backup system disk. This utilizes non-volatile memory because it has both memory and hard disk functions, meaning it can store data even during power outages or system failures.
[0068] However, while NVDIMM and PMEM memory have the ability to store data, their storage capacity is limited, making them unsuitable for long-term or large-scale data storage. Therefore, these types of memory can be used as a relay device, and data still needs to be backed up to a backup system disk.
[0069] In one embodiment of the present invention, it further includes:
[0070] When data is updated on the main system disk, the updated data is backed up to the non-volatile memory, and the updated data in the non-volatile memory is backed up to the backup system disk.
[0071] During the boot process or use of the main system, if new data is deleted, saved, or modified, this operation will be transmitted to the CPU. After receiving the instruction, the CPU will first copy the corresponding data to non-volatile memory, and then copy it from non-volatile memory to the backup system disk, thus ensuring that the backup system disk is always consistent with the main system disk.
[0072] Step 103: When the main system disk fails, stop backing up the data in the main system disk to the non-volatile memory, and determine whether all the data in the non-volatile memory has been backed up to the backup system disk.
[0073] In practical applications, the CPU continuously checks whether the primary system disk has failed. When the primary system disk fails, the CPU stops backing up the primary system disk to the backup system disk and sends a command to boot the backup system disk. At this point, it checks whether the last data in the non-volatile memory has been transferred completely.
[0074] Step 104: If all data in the non-volatile memory is backed up to the backup system disk, the primary system disk is replaced by the backup system disk to enter the operating system on the backup system disk.
[0075] In one embodiment of the present invention, it further includes:
[0076] If not all data in the non-volatile memory is backed up to the backup system disk, the remaining data in the non-volatile memory is backed up to the backup system disk.
[0077] If the transfer is not complete, it will continue. Once the transfer is complete, the backup system disk will establish a new connection in place of the primary system disk and enter the system on the backup system disk.
[0078] Step 105: If the backup system disk replaces the primary system disk, back up the data in the backup system disk to the non-volatile memory, and back up the data in the non-volatile memory to the primary system disk.
[0079] When the backup system disk is enabled, after entering the OS, the CPU will perform a backup operation again. At this time, the data of the backup system disk is backed up to non-volatile memory, and then backed up from non-volatile memory to the main system disk. In this way, the system disk is repaired and the data is saved.
[0080] In one embodiment of the present invention, before backing up the data in the backup system disk to the non-volatile memory and backing up the data in the non-volatile memory to the primary system disk, the method further includes:
[0081] When the backup system disk replaces the primary system disk, the operation information and log information prior to the failure of the primary system disk are obtained and stored.
[0082] As an example, the log information includes one or more of the following:
[0083] System log information, baseboard management controller log information, and black box log information.
[0084] When the backup system disk is activated and boots into the OS, it sends instructions to the CPU. Upon receiving these instructions, the CPU relays any issues encountered with the primary system disk to the backup system disk and captures and saves OS logs, BMC logs, and black-box logs. After the logs are saved, the backup system disk sends instructions to the CPU again, and the CPU performs another backup operation.
[0085] In this embodiment of the invention, when the server is equipped with a backup system disk, the data in the primary system disk and the backup system disk are verified to be consistent. If the data in the primary system disk and the backup system disk are inconsistent, the data in the primary system disk is backed up to non-volatile memory, and the data in the non-volatile memory is backed up to the backup system disk. This realizes the use of non-volatile memory to back up the data in the server's system disk. When the system disk or system cannot be automatically repaired, the data can be restored through the backup system disk. Furthermore, since the data is backed up through non-volatile memory, it can be ensured that no data loss occurs during the backup or recovery process, thereby improving the reliability of the server and ensuring data security.
[0086] Furthermore, by stopping the backup of data from the main system disk to the non-volatile memory when the main system disk fails, and determining whether all data in the non-volatile memory has been backed up to the backup system disk, and if all data in the non-volatile memory has been backed up to the backup system disk, the backup system disk is used to replace the main system disk to enter the operating system on the backup system disk. Then, the data in the backup system disk is backed up to the non-volatile memory, and the data in the non-volatile memory is backed up to the main system disk. This achieves the replacement of the faulty main system disk with the backup system disk and the repair of the main system disk, saving the resource consumption of manual repair.
[0087] Reference Figure 2 The diagram illustrates a flowchart of another data protection method in a server according to an embodiment of the present invention, which may specifically include the following steps:
[0088] Step 201: If the server has a backup system disk, verify whether the used capacity and data content of the primary system disk and the backup system disk in the server are consistent.
[0089] In practical applications, after the main system disk enters the OS, the main system will send instructions to the CPU. After receiving the instructions from the main system, the CPU will automatically detect whether there is a hard drive inserted in the location of the backup system disk. The backup system disk needs to be installed in the designated slot of the backup system disk. When the CPU detects that there is a hard drive in the location of the backup system disk, it can determine that the server has a backup system disk.
[0090] Each time the server boots up, it first compares with the main system disk to determine whether the used capacity and data content of the main system and the backup system are consistent.
[0091] Step 202: If the used capacity or data content is inconsistent, determine that the data in the main system disk and the backup system disk are inconsistent.
[0092] If either the used capacity or the data content of the primary system and the backup system are inconsistent, it can be determined that the data on the primary system disk and the backup system disk are inconsistent. Only if both the used capacity and the data content of the primary system and the backup system are consistent can it be determined that the data on the primary system disk and the backup system disk are consistent.
[0093] Step 203: If the data in the primary system disk and the backup system disk are inconsistent, back up the data in the primary system disk to non-volatile memory, and back up the data in the non-volatile memory to the backup system disk.
[0094] If the capacity of the primary system and the used capacity and data content of the backup system are the same, then no backup operation is required. If the data in the primary system disk and the backup system disk are inconsistent, the data in the primary system disk will be backed up to non-volatile memory.
[0095] The backup data includes OS data and other data, which means that the backup operation of the main OS will be automatically performed, including OS backup and data backup.
[0096] In one embodiment of the present invention, the non-volatile memory includes any one or more of the following:
[0097] NVDIMM memory, PMEM memory.
[0098] After backing up the data to non-volatile memory, back up the data from non-volatile memory to a backup system disk. This utilizes non-volatile memory because it has both memory and hard disk functions, meaning it can store data even during power outages or system failures.
[0099] However, while NVDIMM and PMEM memory have the ability to store data, their storage capacity is limited, making them unsuitable for long-term or large-scale data storage. Therefore, these types of memory can be used as a relay device, and data still needs to be backed up to a backup system disk.
[0100] Step 204: When the main system disk fails, stop backing up the data in the main system disk to the non-volatile memory, and determine whether all the data in the non-volatile memory has been backed up to the backup system disk.
[0101] In practical applications, the CPU continuously checks whether the primary system disk has failed. When the primary system disk fails, the CPU stops backing up the primary system disk to the backup system disk and sends a command to boot the backup system disk. At this point, it checks whether the last data in the non-volatile memory has been transferred completely.
[0102] Step 205: If all data in the non-volatile memory is backed up to the backup system disk, the primary system disk is replaced by the backup system disk to enter the operating system on the backup system disk.
[0103] In one embodiment of the present invention, it further includes:
[0104] If not all data in the non-volatile memory is backed up to the backup system disk, the remaining data in the non-volatile memory is backed up to the backup system disk.
[0105] If the transfer is not complete, it will continue. Once the transfer is complete, the backup system disk will establish a new connection in place of the primary system disk and enter the system on the backup system disk.
[0106] Step 206: If the backup system disk replaces the primary system disk, back up the data in the backup system disk to the non-volatile memory, and back up the data in the non-volatile memory to the primary system disk.
[0107] When the backup system disk is enabled, after entering the OS, the CPU will perform a backup operation again. At this time, the data of the backup system disk is backed up to non-volatile memory, and then backed up from non-volatile memory to the main system disk. In this way, the system disk is repaired and the data is saved.
[0108] Reference Figure 3 The diagram illustrates a flowchart of another data protection method in a server according to an embodiment of the present invention, which may specifically include the following steps:
[0109] Step 301: If the server has a backup system disk, verify whether the data in the primary system disk and the backup system disk of the server are consistent.
[0110] In practical applications, after the main system disk enters the OS, the main system will send instructions to the CPU. After receiving the instructions from the main system, the CPU will automatically detect whether there is a hard drive inserted in the location of the backup system disk. The backup system disk needs to be installed in the designated slot of the backup system disk. When the CPU detects that there is a hard drive in the location of the backup system disk, it can determine that the server has a backup system disk.
[0111] If the server has a backup system disk, it is possible to verify whether the data on the primary system disk and the backup system disk are consistent.
[0112] Step 302: If the data in the primary system disk and the backup system disk are inconsistent, back up the data in the primary system disk to non-volatile memory, and back up the data in the non-volatile memory to the backup system disk.
[0113] If the capacity of the primary system and the used capacity and data content of the backup system are the same, then no backup operation is required. If the data in the primary system disk and the backup system disk are inconsistent, the data in the primary system disk will be backed up to non-volatile memory.
[0114] The backup data includes OS data and other data, which means that the backup operation of the main OS will be automatically performed, including OS backup and data backup.
[0115] In one embodiment of the present invention, the non-volatile memory includes any one or more of the following:
[0116] NVDIMM memory, PMEM memory.
[0117] After backing up the data to non-volatile memory, back up the data from non-volatile memory to a backup system disk. This utilizes non-volatile memory because it has both memory and hard disk functions, meaning it can store data even during power outages or system failures.
[0118] However, while NVDIMM and PMEM memory have the ability to store data, their storage capacity is limited, making them unsuitable for long-term or large-scale data storage. Therefore, these types of memory can be used as a relay device, and data still needs to be backed up to a backup system disk.
[0119] Step 303: When the main system disk fails, stop backing up the data in the main system disk to the non-volatile memory, and determine whether all the data in the non-volatile memory has been backed up to the backup system disk.
[0120] In practical applications, the CPU continuously checks whether the primary system disk has failed. When the primary system disk fails, the CPU stops backing up the primary system disk to the backup system disk and sends a command to boot the backup system disk. At this point, it checks whether the last data in the non-volatile memory has been transferred completely.
[0121] Step 304: If all data in the non-volatile memory is backed up to the backup system disk, the primary system disk is replaced by the backup system disk to enter the operating system on the backup system disk.
[0122] If the transfer is not complete, it will continue. Once the transfer is complete, the backup system disk will establish a new connection in place of the primary system disk and enter the system on the backup system disk.
[0123] Step 305: If the backup system disk replaces the primary system disk, obtain and store the operation information and log information prior to the failure of the primary system disk.
[0124] As an example, the log information includes one or more of the following:
[0125] System log information, baseboard management controller log information, and black box log information.
[0126] When the backup system disk is activated and boots into the OS, it sends instructions to the CPU. Upon receiving these instructions, the CPU relays any issues encountered with the primary system disk to the backup system disk and captures and saves OS logs, BMC logs, and black-box logs. After the logs are saved, the backup system disk sends instructions to the CPU again, and the CPU performs another backup operation.
[0127] Step 306: If the backup system disk replaces the primary system disk, back up the data in the backup system disk to the non-volatile memory, and back up the data in the non-volatile memory to the primary system disk.
[0128] When the backup system disk is enabled, after entering the OS, the CPU will perform a backup operation again. At this time, the data of the backup system disk is backed up to non-volatile memory, and then backed up from non-volatile memory to the main system disk. In this way, the system disk is repaired and the data is saved.
[0129] Reference Figure 4 The diagram illustrates a flowchart of another data protection method in a server according to an embodiment of the present invention, which may specifically include the following steps:
[0130] Step 401: If the server has a backup system disk, verify whether the data in the primary system disk and the backup system disk of the server are consistent.
[0131] In practical applications, after the main system disk enters the OS, the main system will send instructions to the CPU. After receiving the instructions from the main system, the CPU will automatically detect whether there is a hard drive inserted in the location of the backup system disk. The backup system disk needs to be installed in the designated slot of the backup system disk. When the CPU detects that there is a hard drive in the location of the backup system disk, it can determine that the server has a backup system disk.
[0132] If the server has a backup system disk, it is possible to verify whether the data on the primary system disk and the backup system disk are consistent.
[0133] Step 402: If the data in the primary system disk and the backup system disk are inconsistent, back up the data in the primary system disk to non-volatile memory, and back up the data in the non-volatile memory to the backup system disk.
[0134] If the capacity of the primary system and the used capacity and data content of the backup system are the same, then no backup operation is required. If the data in the primary system disk and the backup system disk are inconsistent, the data in the primary system disk will be backed up to non-volatile memory.
[0135] The backup data includes OS data and other data, which means that the backup operation of the main OS will be automatically performed, including OS backup and data backup.
[0136] In one embodiment of the present invention, the non-volatile memory includes any one or more of the following:
[0137] NVDIMM memory, PMEM memory.
[0138] After backing up the data to non-volatile memory, back up the data from non-volatile memory to a backup system disk. This utilizes non-volatile memory because it has both memory and hard disk functions, meaning it can store data even during power outages or system failures.
[0139] However, while NVDIMM and PMEM memory have the ability to store data, their storage capacity is limited, making them unsuitable for long-term or large-scale data storage. Therefore, these types of memory can be used as a relay device, and data still needs to be backed up to a backup system disk.
[0140] Step 403: When there is a data update on the main system disk, back up the updated data to the non-volatile memory, and back up the updated data in the non-volatile memory to the backup system disk.
[0141] During the boot process or use of the main system, if new data is deleted, saved, or modified, this operation will be simultaneously transmitted to the CPU. After receiving the instruction, the CPU will first copy the corresponding data to non-volatile memory, and then copy it from non-volatile memory to the backup system disk. This ensures that the backup system disk always maintains consistency with the main system disk.
[0142] Step 404: When the main system disk fails, stop backing up the data in the main system disk to the non-volatile memory, and determine whether all the data in the non-volatile memory has been backed up to the backup system disk.
[0143] In practical applications, the CPU continuously checks whether the primary system disk has failed. When the primary system disk fails, the CPU stops backing up the primary system disk to the backup system disk and sends a command to boot the backup system disk. At this point, it checks whether the last data in the non-volatile memory has been transferred completely.
[0144] Step 405: If all data in the non-volatile memory is backed up to the backup system disk, the primary system disk is replaced by the backup system disk to enter the operating system on the backup system disk.
[0145] In one embodiment of the present invention, it further includes:
[0146] If not all data in the non-volatile memory is backed up to the backup system disk, the remaining data in the non-volatile memory is backed up to the backup system disk.
[0147] If the transfer is not complete, it will continue. Once the transfer is complete, the backup system disk will establish a new connection in place of the primary system disk and enter the system on the backup system disk.
[0148] Step 406: If the backup system disk replaces the primary system disk, back up the data in the backup system disk to the non-volatile memory, and back up the data in the non-volatile memory to the primary system disk.
[0149] When the backup system disk is enabled, after entering the OS, the CPU will perform a backup operation again. At this time, the data of the backup system disk is backed up to non-volatile memory, and then backed up from non-volatile memory to the main system disk. In this way, the system disk is repaired and the data is saved.
[0150] The following combination Figure 5 and Figure 6 The embodiments of the present invention are described by way of example:
[0151] exist Figure 5 The process is as follows:
[0152] 1. After the main system disk enters the OS, the main system will send instructions to the CPU. After receiving the instructions from the main system, the CPU will automatically detect whether a hard drive is inserted in the location of the backup system disk.
[0153] 2. When the CPU detects a hard drive in the location of the backup system disk, it will automatically initiate a backup operation for the primary OS, including OS backup and data backup. Each time the system boots up, it will first compare the backup system disk with the primary system disk to determine the size and data of the backup system. If the size and data are inconsistent, the data from the primary system disk will be copied to NVDIMM memory or PMEM memory first, and then copied from NVDIMM memory or PMEM memory to the backup system disk.
[0154] 3. If the capacity and data of the primary system are consistent with those of the backup system, any deletion, saving, or modification of new data will be simultaneously transmitted to the CPU. Upon receiving the instruction, the CPU will first copy the corresponding data to NVDIMM memory or PMEM memory, and then copy it from NVDIMM memory or PMEM memory to the backup system disk. This ensures that the backup system disk always maintains consistency with the primary system disk.
[0155] exist Figure 6 The process is as follows:
[0156] 1. The CPU will continuously check whether the main system disk has failed. When the main system disk fails, the CPU will stop the main system disk from continuing to back up to the backup system disk and send a command to start the backup system disk.
[0157] 2. Determine whether the last data transfer of NVDIMM memory or PMEM memory is complete. If the transfer is not complete, it will continue. Once the transfer is complete, the backup system disk will establish a new connection in place of the primary system disk and enter the system on the backup system disk.
[0158] 3. When the backup system disk is enabled, after entering the OS, it will also send instructions to the CPU. After receiving the instructions from the backup system disk, the CPU will feed back the operation of the main system disk that caused the problem to the backup system disk, and capture and save the OS log, BMC log, and black box log.
[0159] 4. After the log is saved, the standby system disk will send instructions to the CPU again, and the CPU will perform the backup operation again. At this point, the data of the standby system disk is backed up to NVDIMM memory or PMEM memory, and then backed up from NVDIMM memory or PMEM memory to the primary system disk. This way, the system disk is repaired and the data is preserved.
[0160] It should be noted that, for the sake of simplicity, the method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments of the present invention are not limited to the described order of actions, because according to the embodiments of the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions involved are not necessarily essential to the embodiments of the present invention.
[0161] Reference Figure 7 The diagram illustrates a structural schematic of a data protection device in a server according to an embodiment of the present invention, which may specifically include the following modules:
[0162] The consistency verification module 701 is used to verify whether the data in the primary system disk and the backup system disk of the server are consistent when the server is equipped with a backup system disk.
[0163] The backup to standby system disk module 702 is used to back up the data in the main system disk to non-volatile memory when the data in the main system disk and the standby system disk are inconsistent, and to back up the data in the non-volatile memory to the standby system disk.
[0164] The module 703 for determining whether all data has been backed up is used to stop backing up data from the main system disk to the non-volatile memory when the main system disk fails, and to determine whether all data in the non-volatile memory has been backed up to the backup system disk.
[0165] The backup system disk replacement module 704 is used to replace the main system disk with the backup system disk when all data in the non-volatile memory is backed up to the backup system disk, so as to enter the operating system in the backup system disk;
[0166] The backup disk data backup to main system disk module 705 is used to back up the data in the backup system disk to the non-volatile memory and back up the data in the non-volatile memory to the main system disk when the backup system disk replaces the main system disk.
[0167] In one embodiment of the present invention, it further includes:
[0168] The update data backup module is used to back up the updated data to the non-volatile memory when there is a data update on the main system disk, and to back up the updated data in the non-volatile memory to the backup system disk.
[0169] In one embodiment of the present invention, it further includes:
[0170] The information acquisition module is used to acquire and store the operation information and log information prior to the failure of the main system disk when the backup system disk replaces the main system disk.
[0171] In one embodiment of the present invention, the log information includes any one or more of the following:
[0172] System log information, baseboard management controller log information, and black box log information.
[0173] In one embodiment of the present invention, it further includes:
[0174] The backup module is used to back up the remaining data in the non-volatile memory to the backup system disk if not all the data in the non-volatile memory has been backed up to the backup system disk.
[0175] In one embodiment of the present invention, the consistency verification module 701 includes:
[0176] The capacity and content verification module is used to verify whether the used capacity and data content of the main system disk and the backup system disk in the server are consistent.
[0177] The capacity or content inconsistency module is used to determine that the data in the primary system disk and the backup system disk is inconsistent when the used capacity or data content is inconsistent.
[0178] In one embodiment of the present invention, the non-volatile memory includes any one or more of the following:
[0179] NVDIMM memory, PMEM memory.
[0180] In this embodiment of the invention, when the server is equipped with a backup system disk, the data in the primary system disk and the backup system disk are verified to be consistent. If the data in the primary system disk and the backup system disk are inconsistent, the data in the primary system disk is backed up to non-volatile memory, and the data in the non-volatile memory is backed up to the backup system disk. This realizes the use of non-volatile memory to back up the data in the server's system disk. When the system disk or system cannot be automatically repaired, the data can be restored through the backup system disk. Furthermore, since the data is backed up through non-volatile memory, it can be ensured that no data loss occurs during the backup or recovery process, thereby improving the reliability of the server and ensuring data security.
[0181] Furthermore, by stopping the backup of data from the main system disk to the non-volatile memory when the main system disk fails, and determining whether all data in the non-volatile memory has been backed up to the backup system disk, and if all data in the non-volatile memory has been backed up to the backup system disk, the backup system disk is used to replace the main system disk to enter the operating system on the backup system disk. Then, the data in the backup system disk is backed up to the non-volatile memory, and the data in the non-volatile memory is backed up to the main system disk. This achieves the replacement of the faulty main system disk with the backup system disk and the repair of the main system disk, saving the resource consumption of manual repair.
[0182] An embodiment of the present invention also provides an electronic device, which may include a processor, a memory, and a computer program stored in the memory and capable of running on the processor. When the computer program is executed by the processor, it implements the data protection method in the server described above.
[0183] An embodiment of the present invention also provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, it implements the data protection method in the server described above.
[0184] As the device embodiment is basically similar to the method embodiment, the description is relatively simple, and relevant parts can be found in the description of the method embodiment.
[0185] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.
[0186] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, apparatus, or computer program products. Therefore, embodiments of the present invention can take the form of entirely hardware embodiments, entirely software embodiments, or embodiments combining software and hardware aspects. Furthermore, embodiments of the present invention can take the form of computer program products implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0187] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0188] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing terminal device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0189] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal equipment, causing a series of operational steps to be performed on the computer or other programmable terminal equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable terminal equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0190] Although preferred embodiments of the present invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the embodiments of the present invention.
[0191] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal device. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal device that includes said element.
[0192] The above provides a detailed description of a method and apparatus for data protection in a server. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, those skilled in the art will recognize that there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.
Claims
1. A method of data protection in a server, characterized by, The method comprises: In the case that the server is provided with a backup system disk, checking whether the data in the main system disk of the server and the backup system disk are consistent; In the case that the data in the main system disk and the backup system disk are inconsistent, backing up the data in the main system disk to a non-volatile memory and backing up the data in the non-volatile memory to the backup system disk; In the case that the data in the non-volatile memory is completely backed up to the backup system disk, replacing the main system disk with the backup system disk to enter the operating system in the backup system disk; In the case that the backup system disk replaces the main system disk, backing up the data in the backup system disk to the non-volatile memory and backing up the data in the non-volatile memory to the main system disk. Further comprising:
2. The method of claim 1, wherein, In the case that the main system disk has data updates, backing up the updated data to the non-volatile memory and backing up the updated data in the non-volatile memory to the backup system disk. Before the data in the backup system disk is backed up to the non-volatile memory and the data in the non-volatile memory is backed up to the main system disk, further comprising:
3. The method according to claim 1 or 2, characterized in that, In the case that the backup system disk replaces the main system disk, obtaining operating information and log information before the main system disk fails and storing the same. The log information comprises any one or more of:
4. The method of claim 3, wherein, System log information, baseboard management controller log information, black box log information. Further comprising:
5. The method of claim 1, wherein, In the case that the data in the non-volatile memory is not completely backed up to the backup system disk, backing up the remaining data in the non-volatile memory to the backup system disk. The checking whether the data in the main system disk of the server and the backup system disk are consistent comprises:
6. The method of claim 1, wherein, Checking whether the used capacity and data content in the main system disk of the server and the backup system disk are consistent; In the case that the used capacity or data content is inconsistent, determining that the data in the main system disk and the backup system disk are inconsistent. The non-volatile memory comprises any one or more of:
7. The method of claim 1, wherein, NVDIMM memory, PMEM memory. The device comprises:
8. An apparatus for data protection in a server, the apparatus comprising: A consistency checking module configured to check whether the data in the main system disk of the server and the backup system disk are consistent in the case that the server is provided with a backup system disk; A backup to backup system disk module configured to back up the data in the main system disk to a non-volatile memory and back up the data in the non-volatile memory to the backup system disk in the case that the data in the main system disk and the backup system disk are inconsistent; A determination of whether to completely back up module configured to stop backing up the data in the main system disk to the non-volatile memory and determine whether the data in the non-volatile memory is completely backed up to the backup system disk in the case that the main system disk fails; The standby system disk replaces the main system disk module, which is used to replace the main system disk with the standby system disk to enter the operating system in the standby system disk when all data in the non-volatile memory is backed up to the standby system disk. The standby disk data backup to the main system disk module is used to backup the data in the standby system disk to the non-volatile memory and backup the data in the non-volatile memory to the main system disk when the standby system disk replaces the main system disk.
9. An electronic device, comprising: The computer readable storage medium stores the computer program, and the computer program is executed by the processor to realize the method for protecting data in the server according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer readable storage medium stores the computer program, and the computer program is executed by the processor to realize the method for protecting data in the server according to any one of claims 1 to 7.
Citation Information
Patent Citations
Linux system backup data recovery method and device
CN105718330A
Power failure safeguard method and device for nonvolatile memory
CN106933706A