Factory backup method and device of operating system, equipment and medium

By automatically setting up the backup during the installation of the operating system, using one-click backup tools to perform factory backup of the operating system, and transmitting the backup data to remote storage devices, the problem of complex and inefficient backup methods in the existing technology is solved, and efficient and automated backup management is achieved.

CN119512821APending Publication Date: 2025-02-25INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411631245.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-15
Publication Date
2025-02-25

AI Technical Summary

Technical Problem

The existing operating system backup and restore methods have problems such as poor user-friendliness, slow speed, high network dependency, complex configuration and complex operations, which are difficult to meet the user's flexibility and customization needs.

Method used

The factory backup settings are automatically completed during the installation of the operating system. The target image file is generated by obtaining a one-click backup tool and adding its software installation package to the installation image of the operating system. After the installation is completed, modify the boot boot item to automatically boot the backup operation using the one-click backup tool, and transfer the backup data to the remote storage device for management.

Benefits of technology

It realizes automatic backup during the installation of the operating system, reduces manual intervention, improves backup efficiency, and automatically sends backup data to the server side to facilitate backup management, and realizes centralized monitoring and maintenance of a large number of servers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119512821A_ABST
    Figure CN119512821A_ABST
Patent Text Reader

Abstract

The invention discloses a factory backup method and device of an operating system, equipment and a medium, and relates to the technical field of computers. The method comprises the following steps: acquiring a one-key backup tool, and adding a software installation package of the one-key backup tool into an installation mirror image of an operating system to obtain a target mirror image file; installing the operating system through the target mirror image file, and when the operating system is started for the first time, taking a target starting item used for representing that the operating system is started by using the one-key backup tool as a startup guide item of the operating system; and when the operating system is restarted, performing a backup operation of the operating system based on the boot entry, and transmitting backup data corresponding to the backup operation to a remote storage device after the backup is completed, so as to perform backup management on the backup data. By means of the technical scheme, factory backup can be automatically completed in the installation process of the operating system, and system safety and data integrity are ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a factory backup method, device, equipment and medium for an operating system. Background Art

[0002] In current computer systems, in order to prevent the operating system from failing to work properly and user data from being lost after the operating system crashes, it is necessary to back up and restore the operating system to recover the operating system and user data. Currently, the main methods for backing up and restoring the operating system include: backing up and restoring through domestic operating systems, backing up and restoring through the network of PXE (Preboot Execution Environment), and backing up and restoring through the built-in backup function of Windows 10.

[0003] However, all of the above methods have corresponding technical defects. The backup and restore functions of domestic operating systems are not user-friendly, the backup and restore speed is slow and the compatibility with other software is poor; the disadvantage of PXE network backup and restore is that it relies on the stability and security of the network environment, the backup and recovery process may be interrupted or failed due to the network status, the limited data transmission speed causes the operation to take a long time, and the PXE network configuration is complex, which has a certain threshold for some users; although the backup function that comes with Windows 10 is convenient, it lacks flexibility and customized backup options for specific file types. For users who are not familiar with system settings, the operation may be slightly complicated. Summary of the invention

[0004] In view of this, the purpose of the present invention is to provide a factory backup method, device, equipment and medium for an operating system, which can automatically complete the factory backup settings during the installation of the operating system, reduce manual intervention, and improve backup efficiency. The specific scheme is as follows:

[0005] In a first aspect, the present application discloses a factory backup method for an operating system, comprising:

[0006] Obtain a one-key backup tool, and add the software installation package of the one-key backup tool to the installation image of the operating system to obtain a target image file;

[0007] Installing the operating system through the target image file, and using the target startup item used to indicate the use of the one-key backup tool to start the operating system as the boot item of the operating system when the operating system is started for the first time;

[0008] When the operating system is restarted, a backup operation of the operating system is performed based on the boot item, and after the backup is completed, the backup data corresponding to the backup operation is transmitted to a remote storage device to perform backup management on the backup data.

[0009] Optionally, adding the software installation package of the one-key backup tool to the installation image of the operating system includes:

[0010] Decompress the installation image of the operating system, and add the software installation package of the one-key backup tool to the directory of the third-party package of the operating system;

[0011] Configuring the installation configuration file of the operating system to divide the partition into installation partitions for separately installing the one-key backup tool;

[0012] The one-key backup tool is installed in the installation partition using the software installation package in the directory of the third-party package, and after the one-key backup tool is installed, the system boot of the one-key backup tool is added to the boot loader configuration file of the operating system.

[0013] Optionally, installing the operating system through the target image file, and using the target startup item used to represent the use of the one-key backup tool to start the operating system as the boot item of the operating system when the operating system is started for the first time, includes:

[0014] Installing the operating system through the target image file, and generating a target startup item for representing the use of the one-key backup tool to start the operating system according to the system boot of the one-key backup tool in the boot loader configuration file when the operating system is started for the first time;

[0015] The target startup item is set as the startup boot item of the operating system.

[0016] Optionally, when the operating system is restarted, performing a backup operation of the operating system based on the boot item includes:

[0017] When the operating system is restarted, a self-check program is triggered based on the boot item to determine the operating environment of the one-key backup tool;

[0018] Detecting whether the operating system has been factory backed up based on the operating environment;

[0019] If the operating system has been factory backed up, directly restoring the boot item to the system default boot item corresponding to the operating system;

[0020] If the operating system has not been factory backed up, a system snapshot is created for the operating system using the one-key backup tool to generate the backup data, and then the boot item is restored to the system default boot item corresponding to the operating system.

[0021] Optionally, the transmitting the backup data corresponding to the backup operation to a remote storage device after the backup is completed includes:

[0022] After the backup is completed, the backup data corresponding to the backup operation is obtained, and the backup data is divided into blocks to obtain a plurality of backup data blocks;

[0023] Generate a source data file set using the backup data block, and encrypt each backup data block in the source data file set using a preset encryption protocol to obtain an encrypted data block;

[0024] Transmitting the encrypted data blocks to a remote storage device according to a preset data transmission instruction to obtain a target data file set containing each of the encrypted data blocks;

[0025] Correspondingly, after the backup operation is completed and the backup data corresponding to the backup operation is transmitted to the remote storage device, the method further includes:

[0026] Acquire the target data file set of the operating system stored in the remote storage device;

[0027] Determine respectively by a preset hash function a first hash value corresponding to each of the encrypted data blocks in the target data file set and a second hash value corresponding to each of the backup data blocks in the source data file set;

[0028] If the first hash value is equal to the second hash value, it is determined that the backup data is successfully backed up and the backup data is not damaged;

[0029] If the first hash value is not equal to the second hash value, it is determined that the backup data fails to be backed up, and the backup data is damaged during the backup process.

[0030] Optionally, after the backup is completed, the backup data corresponding to the backup operation is transmitted to a remote storage device to perform backup management on the backup data, the method further includes:

[0031] A backup result report is generated using the one-key backup tool, and the backup result report is displayed through a graphical user interface, and / or the backup result report is sent to a user terminal.

[0032] Optionally, the transferring the backup data corresponding to the backup operation to a remote storage device after the backup is completed so as to perform backup management on the backup data includes:

[0033] Creating a device basic information table and a device backup information table, and constructing a corresponding basic information data model library and a backup information data model library in the remote storage device according to the device basic information table and the device backup information table;

[0034] After the backup is completed, the backup data corresponding to the backup operation is transmitted to the remote storage device, so that the backup data can be backed up and managed by using the basic information data model library and the backup information data model library.

[0035] In a second aspect, the present application discloses a factory backup device for an operating system, comprising:

[0036] A tool integration module, used to obtain a one-key backup tool and add the software installation package of the one-key backup tool to the installation image of the operating system to obtain a target image file;

[0037] a boot item configuration module, used to install the operating system through the target image file, and use the target startup item used to indicate that the operating system is started using the one-key backup tool as the boot item of the operating system when the operating system is started for the first time;

[0038] A system backup module, used for performing a backup operation of the operating system based on the boot item when the operating system is restarted;

[0039] The backup transmission module is used to transmit the backup data corresponding to the backup operation to the remote storage device after the backup is completed, so as to perform backup management on the backup data.

[0040] In a third aspect, the present application discloses an electronic device, comprising a processor and a memory; wherein the memory is used to store a computer program, and the computer program is loaded and executed by the processor to implement the factory backup method of the operating system as described above.

[0041] In a fourth aspect, the present application discloses a computer-readable storage medium for storing a computer program; wherein the computer program, when executed by a processor, implements the factory backup method of the operating system as described above.

[0042] The present application provides a factory backup method for an operating system, comprising: obtaining a one-key backup tool, and adding a software installation package of the one-key backup tool to an installation image of the operating system to obtain a target image file; installing the operating system through the target image file, and using a target startup item used to characterize the use of the one-key backup tool to start the operating system as a boot item for the operating system when the operating system is started for the first time; when the operating system is started again, performing a backup operation of the operating system based on the boot item, and after the backup is completed, transmitting the backup data corresponding to the backup operation to a remote storage device to perform backup management on the backup data.

[0043] The beneficial technical effects of the present application are as follows: by building a one-key backup tool into the installation image of the operating system, after the installation is completed and before restarting, the boot item of the operating system is modified to use the one-key backup tool to start the target startup item of the operating system; in this way, after the operating system restarts, it can automatically boot the one-key backup tool based on the target startup item to complete the factory backup and detection of the operating system; after the backup is completed, the generated backup data is transmitted to the remote storage device for backup management to complete the overall backup process. It can be seen that through the technical solution of the present application, the backup process can be automated, so that each server has a factory backup when it leaves the factory, reducing manual intervention and improving backup efficiency. In addition, by automatically sending backup data to the server side, backup management can be conveniently performed, and centralized monitoring and maintenance of a large number of servers can be achieved.

[0044] In addition, the factory backup device, equipment and storage medium of an operating system provided in the present application correspond to the factory backup method of the above-mentioned operating system, and the effect is the same as above. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] In order to more clearly illustrate the embodiments of the present invention 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 only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0046] Figure 1 A flow chart of a factory backup method for an operating system disclosed in this application;

[0047] Figure 2 A schematic diagram of a PC factory backup process disclosed in this application;

[0048] Figure 3 A schematic diagram of the structure of a factory backup device for an operating system disclosed in this application;

[0049] Figure 4 This is a structural diagram of an electronic device disclosed in this application. DETAILED DESCRIPTION

[0050] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0051] Currently, the main methods for backing up and restoring the operating system include:

[0052] 1) Backup and restore of domestic operating systems: Domestic operating systems (such as UOS (Unity Operating System) and Kylin) support backup and restore functions, allowing users to perform full disk backup and system backup through the system's built-in tools. The backup data will be packaged into a file in a specific format (such as system.dim), and users can enter the backup and restore interface through the control panel to operate.

[0053] 2) PXE network backup and restore: PXE is a network boot technology that allows computers to start operating systems through a network interface. Combined with network backup and restore tools, PXE can be used for remote automated system backup and recovery. For example, boot into a temporary operating system environment through PXE, and then use the network connection to back up or restore data on the local hard disk.

[0054] 3) Windows 10 comes with a backup function: Windows 10 provides a built-in backup and recovery function. Users can go to Settings, enter Update and Security, and then select Backup to perform a system backup. System backup can create a system image, including the operating system, applications, files, settings, etc. In addition, you can use the File History function to automatically save multiple versions of files so that you can restore files to the desired version or time point.

[0055] However, the above methods for backing up and restoring the operating system all have corresponding disadvantages:

[0056] 1) The backup and restore functions of domestic operating systems may not be user-friendly, especially when manual intervention is required. The restore process requires manual selection of backup files for recovery, which increases the complexity of the operation. In addition, the backup and restore speed may be slow and the compatibility with other software is poor, affecting the user experience.

[0057] 2) The disadvantage of PXE network backup and restore is that it relies on the stability and security of the network environment. If the network connection is unstable, the backup and restore process may be interrupted or fail. In addition, data transmission through the network may be subject to speed restrictions, resulting in longer backup and restore operations. In addition, PXE booting may require more complex network configuration, which may be a certain threshold for some users.

[0058] 3) Although the built-in backup function of Windows 10 is convenient, it may lack the flexibility of advanced features (such as backup encryption, backup schedules) and customized backup options for specific file types; in addition, the operation may be slightly complicated for users who are not familiar with system settings.

[0059] To this end, the present application provides a factory backup solution for an operating system, which can automatically complete the factory backup settings during the operating system installation process, reduce manual intervention, and improve backup efficiency.

[0060] The embodiment of the present invention discloses a factory backup method for an operating system. Figure 1 As shown, the method includes:

[0061] Step S11: Obtain a one-key backup tool, and add the software installation package of the one-key backup tool to the installation image of the operating system to obtain a target image file.

[0062] In current computer systems, data security and integrity are becoming increasingly important. In order to protect the operating system and user data, many server manufacturers provide a one-click backup tool that can restore the operating system and user data after the operating system crashes. However, current servers are assembled and produced in batches on the production line, and operators are required to use the one-click backup tool on the assembly line to manually perform factory backups for each server in turn, which is complicated and reduces the backup efficiency of the server operating system.

[0063] In the embodiment of the present application, by integrating the one-click backup tool into the installation image of the operating system, the backup settings can be automatically completed during the system installation process, so that each PC device has a factory backup when it leaves the factory, ensuring the security of the system and the integrity of the data.

[0064] After obtaining the one-click backup tool for backing up and restoring the operating system, the one-click backup tool installation process is performed. Specifically, the software installation package of the one-click backup tool is added to the installation image of the operating system, including the following steps:

[0065] Decompress the installation image of the operating system, and add the software installation package of the one-key backup tool to the directory of the third-party package of the operating system;

[0066] Configuring the installation configuration file of the operating system to divide the partition into installation partitions for separately installing the one-key backup tool;

[0067] The one-key backup tool is installed in the installation partition using the software installation package in the directory of the third-party package, and after the one-key backup tool is installed, the system boot of the one-key backup tool is added to the boot loader configuration file of the operating system.

[0068] In a specific implementation, the one-click backup tool is illustrated using ISOKR as an example; the operating system is illustrated using the domestic operating system UOS or Kylin system as an example. First, unzip the ISO image of the UOS or Kylin system, and according to the rules of the operating system, place the ISOKR deb package in the directory of the third-party package of the UOS or Kylin system, so that ISOKR is integrated into the operating system installation image so that the backup tool can be installed together when the system is installed. Secondly, configure corresponding installation configuration files for different operating systems, such as configuring the setting.xml or kylin-installer.cfg of the operating system, and divide a separate system installation partition for deploying the ISOKR software so that it can be booted and run separately when the system starts. During the operating system installation process, the installation automatically starts after the backup tool installation package is detected. Make sure that after isokr.deb is installed, and finally add the ISOKR system boot to the system boot loader configuration file grub.cfg.

[0069] The ISOKR boot item example is as follows:

[0070] menuentry 'ISOKR OS Backup & Restore 1.3' --class gnu-linux --classgnu --class os $menuentry_id_option 'gnulinux-simple-recovery' {search --no-floppy --fs-uuid --set=root $_midpick linux / isokr / vmlinuz-4.19.0-arm64-desktop roboot =live toram=filesystem.squashfs locales=zh_CN.UTF-8 acpi_backlight=vendor splash quiet console=tty live-media-path=isokr root=UUID=$_midpick initrd / isokr / initrd.img-4.19.0-arm64-desktop.

[0071] Step S12: installing the operating system through the target image file, and using the target startup item used to represent the use of the one-key backup tool to start the operating system as the boot item of the operating system when the operating system is started for the first time.

[0072] In the embodiment of the present application, after the software installation package of the one-click backup tool is installed in the installation image of the operating system, the backup tool installation package is detected during the operating system installation process and the installation is automatically started. After the installation is completed, it is independently booted and run when the operating system is started, and the secondary startup part is modified. Specifically, the system's startup boot configuration is modified so that the backup tool is automatically entered at the second startup.

[0073] Specifically, the operating system is installed through the target image file, and when the operating system is started for the first time, a target startup item representing the use of the one-key backup tool to start the operating system is generated according to the system boot of the one-key backup tool in the boot loader configuration file; and the target startup item is set as the boot item of the operating system.

[0074] In this embodiment, after the system is started and runs for the first time, the grub.cfg default boot item is modified in the post stage, and the backup tool automatically modifies the GRUB configuration file to add a new target boot item. The target boot item points to the boot program of the one-key backup tool, and the grub boot item of ISOKR under the system is set as the default option at the next startup as the boot item, and the system prompts the user to restart the computer to start the backup process. In this way, after the system is restarted again, the ISOKR kernel system will be started according to the current boot item and enter the Livecd environment of ISOKR.

[0075] Step S13: When the operating system is restarted, a backup operation of the operating system is performed based on the boot item, and after the backup is completed, the backup data corresponding to the backup operation is transmitted to a remote storage device to perform backup management on the backup data.

[0076] In the embodiment of the present application, when the system is restarted, the backup tool is entered to automatically perform a backup operation of the system data. Specifically, when the operating system is restarted, the backup operation of the operating system is performed based on the boot item, including the following steps:

[0077] When the operating system is restarted, a self-check program is triggered based on the boot item to determine the operating environment of the one-key backup tool;

[0078] Detecting whether the operating system has been factory backed up based on the operating environment;

[0079] If the operating system has been factory backed up, directly restoring the boot item to the system default boot item corresponding to the operating system;

[0080] If the operating system has not been factory backed up, a system snapshot is created for the operating system using the one-key backup tool to generate the backup data, and then the boot item is restored to the system default boot item corresponding to the operating system.

[0081] In this embodiment, after the one-key backup tool is started, it first performs a self-check to confirm the operating environment of the backup tool. Then it checks whether the current system has been factory backed up; if it has been factory backed up, it directly restores the OS boot item as the default boot item, and then sends the factory backup data to the remote storage device in the cloud and shuts down; if it has not been factory backed up, it starts the system backup program through the backup tool after completing the self-check to perform a factory backup of the system. The tool starts to create a system snapshot, including the operating system, installed applications, and user data. After the backup is complete, the OS boot item is restored as the default boot item.

[0082] It should be noted that after the backup is completed, the backup data can be automatically transferred to a remote storage device in the cloud through network commands, or the backup data can be stored in a designated local or network location. In this way, backup management can be easily performed, and centralized monitoring and maintenance of a large number of PC devices can be achieved.

[0083] The present application provides a factory backup method for an operating system, comprising: obtaining a one-key backup tool, and adding a software installation package of the one-key backup tool to an installation image of the operating system to obtain a target image file; installing the operating system through the target image file, and using a target startup item used to characterize the use of the one-key backup tool to start the operating system as a boot item for the operating system when the operating system is started for the first time; when the operating system is started again, performing a backup operation of the operating system based on the boot item, and after the backup is completed, transmitting the backup data corresponding to the backup operation to a remote storage device to perform backup management on the backup data.

[0084] The beneficial technical effects of the present application are as follows: by building a one-key backup tool into the installation image of the operating system, after the installation is completed and before restarting, the boot item of the operating system is modified to use the one-key backup tool to start the target startup item of the operating system; in this way, after the operating system restarts, it can automatically boot the one-key backup tool based on the target startup item to complete the factory backup and detection of the operating system; after the backup is completed, the generated backup data is transmitted to the remote storage device for backup management to complete the overall backup process. It can be seen that through the technical solution of the present application, the backup process can be automated, so that each server has a factory backup when it leaves the factory, reducing manual intervention and improving backup efficiency. In addition, by automatically sending backup data to the server side, backup management can be conveniently performed, and centralized monitoring and maintenance of a large number of servers can be achieved.

[0085] Based on the above embodiment, in order to implement backup management of backup data using a remote storage device, the process of transmitting the backup data corresponding to the backup operation to the remote storage device after the backup is completed so as to perform backup management on the backup data may include the following steps:

[0086] Creating a device basic information table and a device backup information table, and constructing a corresponding basic information data model library and a backup information data model library in the remote storage device according to the device basic information table and the device backup information table;

[0087] After the backup is completed, the backup data corresponding to the backup operation is transmitted to the remote storage device, so that the backup data can be backed up and managed by using the basic information data model library and the backup information data model library.

[0088] In this embodiment, a device basic information table and a device backup information table are created separately. When creating the basic information table, a PC basic information data model library is established to store the factory backup information and operation data information of the PC device, including PC model, PC serial number, operating system version, IP address and other information. Table 1 shows the main table structure of an exemplary device basic information table:

[0089] Table 1

[0090]

[0091] When creating a device backup information table, a backup information data model library is established for file storage and data display analysis, including PC serial number, whether to back up, whether to back up the system partition, whether to back up the data partition, backup size, backup time, number of files, etc. Table 2 shows the main table structure of an exemplary device backup information table:

[0092] Table 2

[0093]

[0094] In this way, by backing up and managing the backup data in the remote storage device, centralized monitoring and maintenance of a large number of devices can be achieved. In addition, during the transmission of the backup data, the reliability of data transmission can be ensured by real-time monitoring of the network status and transmission errors.

[0095] Based on the above embodiment, this embodiment will specifically explain S13 in the above embodiment. In the process of backup transmission, in order to safely transmit the backup data to the remote storage device, the backup tool connects to the remote storage device and performs identity authentication. Further, the process of transmitting the backup data corresponding to the backup operation to the remote storage device after the backup is completed includes the following steps:

[0096] After the backup is completed, the backup data corresponding to the backup operation is obtained, and the backup data is divided into blocks to obtain a plurality of backup data blocks;

[0097] Generate a source data file set using the backup data block, and encrypt each backup data block in the source data file set using a preset encryption protocol to obtain an encrypted data block;

[0098] Transmitting the encrypted data blocks to a remote storage device according to a preset data transmission instruction to obtain a target data file set containing each of the encrypted data blocks;

[0099] Furthermore, a data backup integrity check algorithm is used to verify the integrity of the backup data on the remote storage device and confirm that the backup is successful. Specifically, after the backup operation is completed and the backup data corresponding to the backup operation is transferred to the remote storage device, the following steps are also included:

[0100] Acquire the target data file set of the operating system stored in the remote storage device;

[0101] Determine respectively by a preset hash function a first hash value corresponding to each of the encrypted data blocks in the target data file set and a second hash value corresponding to each of the backup data blocks in the source data file set;

[0102] If the first hash value is equal to the second hash value, it is determined that the backup data is successfully backed up and the backup data is not damaged;

[0103] If the first hash value is not equal to the second hash value, it is determined that the backup data fails to be backed up, and the backup data is damaged during the backup process.

[0104] In this embodiment, after the backup is completed, the backup data is transmitted to the server in blocks, and each block is securely transmitted using an encryption protocol. After the transmission is completed, the data backup integrity verification algorithm is used to verify the data. The overall verification steps are as follows:

[0105] (1) Initialization:

[0106] Input: source data file set S={f1,f2,...,fn}S={f1,f2,...,fn}, the size of each file is size(fi)size(fi). Each file corresponds to a backup data block.

[0107] Output: Integrity check result of backup data.

[0108] (2) Calculate the hash value of the source data:

[0109] For each file fifi in SS, calculate its hash value H(fi)H(fi).

[0110] The hash function you can choose is: SHA-256.

[0111] (3) Data transmission:

[0112] Transfer each file fifi to the remote storage device.

[0113] During the transmission process, a checksum is used to monitor the integrity of the data transmission.

[0114] (4) Backup data verification:

[0115] For each file fi'fi' on the remote storage device, calculate its hash value H(fi')H(fi').

[0116] Compare H(fi)H(fi) and H(fi')H(fi'):

[0117] If H(fi)==H(fi')H(fi)==H(fi'), the file fifi is backed up successfully without damage.

[0118] If H(fi)!=H(fi')H(fi)!=H(fi'), then the file fifi is damaged during the backup process.

[0119] (5) Generate verification report:

[0120] For each file fifi, a verification result is generated, indicating whether the file was successfully backed up.

[0121] The verification results include: file name, source hash value, backup hash value, and verification status.

[0122] (6) Error handling:

[0123] If any file fails verification, the error is logged and the system administrator is notified.

[0124] Provides options for re-backup or restoration.

[0125] (7) Algorithm ends:

[0126] Returns a verification report for all files.

[0127] (8) Pseudo code for algorithm implementation:

[0128] function backupDataIntegrityVerification(sourceFiles):

[0129] hashFunction = SHA256()

[0130] verificationReport = []

[0131] for each file in sourceFiles:

[0132] sourceHash = hashFunction.calculateHash(file)

[0133] send file to backup storage

[0134] backupHash = hashFunction.calculateHash(receivedFile)

[0135] if sourceHash == backupHash:

[0136] verificationReport.append({"filename": file.name, "sourceHash":sourceHash, "backupHash": backupHash, "status": "Success"})

[0137] else:

[0138] verificationReport.append({"filename": file.name, "sourceHash":sourceHash, "backupHash": backupHash, "status": "Failure"})

[0139] notifyAdmin(file.name)

[0140] return verificationReport.

[0141] It should be noted that, in the present embodiment, the result of the backup operation is provided to the user, including detailed information of success or failure. After the backup is completed, the backup tool generates a backup result report, including information such as a list of backed up files, backup size, and backup time. The backup result report is displayed to the user through a graphical user interface, or sent to the mailbox of the system administrator. If the backup fails, the report will contain an error message and recommended troubleshooting steps. The user can view the report, confirm whether the backup is successful, and perform operations as needed. Specifically, the one-click backup tool is used to generate a backup result report, and the backup result report is displayed through a graphical user interface, and / or the backup result report is sent to the user terminal.

[0142] like Figure 2The figure shows the overall process of factory backup of PC equipment provided based on the content in the above embodiment. After obtaining the one-key backup tool, the one-key backup tool is built into the ISO image of the operating system. After the installation is complete, the Grub configuration file of the system is modified before restarting, so that the boot item of the one-key backup tool is used as the default system boot item. After the second restart, enter the one-key backup tool boot, start the kernel system of the one-key backup tool, and complete the detection and backup of the factory backup. After the backup is completed, it is transmitted to the cloud via the network to complete the overall backup process. The advantage of this method is that it automates the backup process, reduces manual intervention, and improves backup efficiency.

[0143] Correspondingly, the present application also discloses a factory backup device for an operating system, see Figure 3 As shown, the device comprises:

[0144] The tool integration module 11 is used to obtain a one-key backup tool and add the software installation package of the one-key backup tool to the installation image of the operating system to obtain a target image file;

[0145] A boot item configuration module 12, used to install the operating system through the target image file, and when the operating system is started for the first time, use the target startup item used to indicate that the operating system is started using the one-key backup tool as the boot item of the operating system;

[0146] A system backup module 13, configured to perform a backup operation of the operating system based on the boot item when the operating system is restarted;

[0147] The backup transmission module 14 is used to transmit the backup data corresponding to the backup operation to the remote storage device after the backup is completed, so as to perform backup management on the backup data.

[0148] Among them, for more specific working processes of the above-mentioned modules, please refer to the corresponding contents disclosed in the aforementioned embodiments, which will not be repeated here.

[0149] It can be seen that the above scheme of this embodiment includes: obtaining a one-click backup tool, and adding the software installation package of the one-click backup tool to the installation image of the operating system to obtain a target image file; installing the operating system through the target image file, and using the target startup item used to characterize the use of the one-click backup tool to start the operating system as the boot item of the operating system when the operating system is started for the first time; when the operating system is started again, performing a backup operation of the operating system based on the boot item, and after the backup is completed, transmitting the backup data corresponding to the backup operation to a remote storage device to perform backup management on the backup data.

[0150] The beneficial technical effects of the present application are as follows: by building a one-key backup tool into the installation image of the operating system, after the installation is completed and before restarting, the boot item of the operating system is modified to use the one-key backup tool to start the target startup item of the operating system; in this way, after the operating system restarts, it can automatically boot the one-key backup tool based on the target startup item to complete the factory backup and detection of the operating system; after the backup is completed, the generated backup data is transmitted to the remote storage device for backup management to complete the overall backup process. It can be seen that through the technical solution of the present application, the backup process can be automated, so that each server has a factory backup when it leaves the factory, reducing manual intervention and improving backup efficiency. In addition, by automatically sending backup data to the server side, backup management can be conveniently performed, and centralized monitoring and maintenance of a large number of servers can be achieved.

[0151] Furthermore, the present application also discloses an electronic device. Figure 4 This is a structural diagram of an electronic device 20 according to an exemplary embodiment, and the content in the diagram cannot be considered as any limitation on the scope of use of the present application.

[0152] Figure 4 A schematic diagram of the structure of an electronic device 20 provided in an embodiment of the present application. The electronic device 20 may specifically 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 used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the factory backup method of the operating system disclosed in any of the aforementioned embodiments. In addition, the electronic device 20 in this embodiment may specifically be a server.

[0153] In this embodiment, the power supply 23 is used 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 used 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.

[0154] In addition, the memory 22 as a carrier for resource storage 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. The data 223 may include various data. The storage method may be temporary storage or permanent storage.

[0155] The operating system 221 is used to manage and control the hardware devices on the electronic device 20 and the computer program 222, which can be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program that can be used to complete the factory backup method of the operating system executed 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.

[0156] Furthermore, the embodiment of the present application also discloses a computer-readable storage medium, wherein the computer-readable storage medium mentioned here includes a random access memory (Random Access Memory, RAM), a memory, a read-only memory (Read-Only Memory, ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a magnetic disk or an optical disk, or any other form of storage medium known in the technical field. Wherein, when the computer program is executed by the processor, the factory backup method of the aforementioned operating system is implemented. For the specific steps of the method, reference can be made to the corresponding contents disclosed in the aforementioned embodiment, and no further description will be given here.

[0157] Furthermore, an embodiment of the present application also provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements any one of the factory backup methods of the above-mentioned operating system.

[0158] 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.

[0159] The steps of the factory backup method or algorithm of the operating system described in the embodiments disclosed herein can be directly implemented by hardware, a software module executed by a processor, or a combination of the two. The software module can be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the technical field.

[0160] 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 sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0161] The factory backup method, device, equipment and medium of an operating system provided by the present invention are introduced in detail above. Specific examples are used in this article to illustrate the principle and implementation mode of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation mode and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. A factory backup method for an operating system, characterized in that: include: Obtain a one-key backup tool, and add the software installation package of the one-key backup tool to the installation image of the operating system to obtain a target image file; Installing the operating system through the target image file, and using the target startup item used to indicate the use of the one-key backup tool to start the operating system as the boot item of the operating system when the operating system is started for the first time; When the operating system is restarted, a backup operation of the operating system is performed based on the boot item, and after the backup is completed, the backup data corresponding to the backup operation is transmitted to a remote storage device to perform backup management on the backup data.

2. The factory backup method of the operating system according to claim 1, characterized in that: The step of adding the software installation package of the one-key backup tool to the installation image of the operating system includes: Decompress the installation image of the operating system, and add the software installation package of the one-key backup tool to the directory of the third-party package of the operating system; Configuring the installation configuration file of the operating system to divide the partition into installation partitions for separately installing the one-key backup tool; The one-key backup tool is installed in the installation partition using the software installation package in the directory of the third-party package, and after the one-key backup tool is installed, the system boot of the one-key backup tool is added to the boot loader configuration file of the operating system.

3. The factory backup method of the operating system according to claim 2, characterized in that: The operating system is installed by using the target image file, and when the operating system is started for the first time, a target startup item used to indicate that the operating system is started using the one-key backup tool is used as a boot item of the operating system, including: Installing the operating system through the target image file, and generating a target startup item for representing the use of the one-key backup tool to start the operating system according to the system boot of the one-key backup tool in the boot loader configuration file when the operating system is started for the first time; The target startup item is set as the startup boot item of the operating system.

4. The factory backup method of the operating system according to claim 1, characterized in that: When the operating system is restarted, performing a backup operation of the operating system based on the boot item includes: When the operating system is restarted, a self-check program is triggered based on the boot item to determine the operating environment of the one-key backup tool; Detecting whether the operating system has been factory backed up based on the operating environment; If the operating system has been factory backed up, directly restoring the boot item to the system default boot item corresponding to the operating system; If the operating system has not been factory backed up, a system snapshot is created for the operating system using the one-key backup tool to generate the backup data, and then the boot item is restored to the system default boot item corresponding to the operating system.

5. The factory backup method of the operating system according to claim 1, characterized in that: The step of transmitting the backup data corresponding to the backup operation to a remote storage device after the backup is completed includes: After the backup is completed, the backup data corresponding to the backup operation is obtained, and the backup data is divided into blocks to obtain a plurality of backup data blocks; Generate a source data file set using the backup data block, and encrypt each backup data block in the source data file set using a preset encryption protocol to obtain an encrypted data block; Transmitting the encrypted data blocks to a remote storage device according to a preset data transmission instruction to obtain a target data file set containing each of the encrypted data blocks; Correspondingly, after the backup operation is completed and the backup data corresponding to the backup operation is transmitted to the remote storage device, the method further includes: Acquire the target data file set of the operating system stored in the remote storage device; Determine respectively by a preset hash function a first hash value corresponding to each of the encrypted data blocks in the target data file set and a second hash value corresponding to each of the backup data blocks in the source data file set; If the first hash value is equal to the second hash value, it is determined that the backup data is successfully backed up and the backup data is not damaged; If the first hash value is not equal to the second hash value, it is determined that the backup data fails to be backed up, and the backup data is damaged during the backup process.

6. The factory backup method of the operating system according to claim 1, characterized in that: After the backup is completed, the backup data corresponding to the backup operation is transmitted to a remote storage device to perform backup management on the backup data, the method further includes: A backup result report is generated using the one-key backup tool, and the backup result report is displayed through a graphical user interface, and / or the backup result report is sent to a user terminal.

7. The factory backup method of the operating system according to any one of claims 1 to 6, characterized in that: The step of transmitting the backup data corresponding to the backup operation to a remote storage device after the backup is completed, so as to perform backup management on the backup data, includes: Creating a device basic information table and a device backup information table, and constructing a corresponding basic information data model library and a backup information data model library in the remote storage device according to the device basic information table and the device backup information table; After the backup is completed, the backup data corresponding to the backup operation is transmitted to the remote storage device, so as to perform backup management on the backup data by using the basic information data model library and the backup information data model library.

8. A factory backup device for an operating system, characterized in that: include: A tool integration module, used to obtain a one-key backup tool and add the software installation package of the one-key backup tool to the installation image of the operating system to obtain a target image file; a boot item configuration module, used to install the operating system through the target image file, and to use the target startup item used to indicate that the operating system is started using the one-key backup tool as the boot item of the operating system when the operating system is started for the first time; A system backup module, used for performing a backup operation of the operating system based on the boot item when the operating system is restarted; The backup transmission module is used to transmit the backup data corresponding to the backup operation to the remote storage device after the backup is completed, so as to perform backup management on the backup data.

9. An electronic device, characterized in that: The electronic device comprises a processor and a memory; wherein the memory is used to store a computer program, and the computer program is loaded and executed by the processor to implement the factory backup method of the operating system as claimed in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: Used to store computer programs; wherein the computer program, when executed by a processor, implements the factory backup method of the operating system as claimed in any one of claims 1 to 7.