A backup and restoration method, apparatus, device, and computer-readable storage medium

By quickly restarting when the operating system kernel crashes and using process snapshots to restore business applications, the inefficiency problem in traditional backup and restore solutions is solved, and rapid recovery of business applications and data consistency is achieved.

CN114064348BActive Publication Date: 2025-07-29CHINA MOBILE (SUZHOU) SOFTWARE TECH CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202010746100.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-07-29
Publication Date
2025-07-29
Estimated Expiration
2040-07-29

AI Technical Summary

Technical Problem

When the existing operating system crashes, traditional backup and restore solutions cannot avoid data loss and inefficient recovery of critical business applications, which can easily cause data inconsistency.

Method used

When the operating system kernel crashes, reload the kernel and quickly restart the system, obtain a pre-backed snapshot of the business application process, and restore the business application to the running state before the kernel crash through the process snapshot.

Benefits of technology

It realizes rapid recovery of business applications, avoids data loss, improves recovery efficiency, and ensures data consistency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114064348B_ABST
    Figure CN114064348B_ABST
Patent Text Reader

Abstract

An embodiment of the present application provides a backup and restoration method, device, equipment, and computer-readable storage medium. Among them, the method includes: in the case of a kernel crash of the operating system, reloading the kernel to restart the operating system; after the operating system restarts successfully, obtaining a process snapshot of a pre-backup business application; and restoring the business application to the running state before the kernel crash according to the process snapshot.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present application relate to the technical field of data processing, including but not limited to a backup and restoration method, apparatus, device, and computer-readable storage medium. Background Art

[0002] Currently, most mainstream operating systems have backup and restoration functions. Traditional operating system backup and restoration solutions mainly include: hard disk snapshots at the file system level, creating a full backup of the restore point to support one-key recovery, and regularly incrementally backing up system hard disk data. However, when the system encounters anomalies or even crashes, such as when the system freezes due to kernel crashes, hacker attacks, etc., only partial data or data of a certain restore point can be restored through these backup and restoration solutions. It is impossible to avoid the loss of critical business application data due to its residence in memory. Moreover, even if the business application is successfully restored, the restoration period is generally long, the efficiency is low, and data inconsistency problems are likely to occur. Summary of the Invention

[0003] Based on the problem of low efficiency in restoring business applications during backup and restoration in related technologies, embodiments of the present application provide a backup and restoration method, apparatus, device, and computer-readable storage medium to improve the restoration efficiency of business applications.

[0004] The technical solution of the embodiments of the present application is implemented as follows:

[0005] Embodiments of the present application provide a backup and restoration method, the method including:

[0006] In the case of a kernel crash of the operating system, reloading the kernel to restart the operating system;

[0007] After the operating system restarts successfully, obtaining a process snapshot of a pre-backup business application;

[0008] Restoring the business application to the running state before the kernel crash according to the process snapshot.

[0009] Embodiments of the present application provide a backup and restoration apparatus, the apparatus including:

[0010] A loading module, configured to reload the kernel to restart the operating system in the case of a kernel crash of the operating system;

[0011] A first obtaining module, configured to obtain a process snapshot of a pre-backup business application after the operating system restarts successfully;

[0012] A restoring module, configured to restore the business application to the running state before the kernel crash according to the process snapshot.

[0013] An embodiment of the present application provides a backup and restoration device, which at least includes:

[0014] a processor; and

[0015] a memory for storing a computer program that can run on the processor;

[0016] wherein, when the computer program is executed by the processor, the steps of the backup and restoration method are implemented.

[0017] An embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored, and the computer-executable instructions are configured to execute the steps of the backup and restoration method.

[0018] An embodiment of the present application provides a backup and restoration method, device, equipment and computer-readable storage medium. When the kernel of the operating system crashes, the kernel is reloaded, and the operating system is restarted through the loaded kernel, avoiding too long restart time of the operating system; after the operating system restarts, a process snapshot of a pre-backup business application is obtained, and the business application is restored to the running state before the kernel crash through the process snapshot of the business application, realizing the rapid recovery of the business application and improving the efficiency of business recovery. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In the drawings (which are not necessarily drawn to scale), similar reference numerals may describe similar components in different views. The drawings generally illustrate, by way of example and not limitation, the various embodiments discussed herein.

[0020] Figure 1 It is a schematic flowchart of a backup and restoration method provided by an embodiment of the present application;

[0021] Figure 2 It is a schematic flowchart of a system for rapid restart of kernel crash provided by an embodiment of the present application;

[0022] Figure 3 It is a schematic diagram of obtaining a process snapshot provided by an embodiment of the present application;

[0023] Figure 4 It is a schematic diagram of process snapshot backup provided by an embodiment of the present application;

[0024] Figure 5 It is a schematic implementation flowchart of another backup and restoration method provided by an embodiment of the present application;

[0025] Figure 6 It is a schematic diagram of process snapshot backup and restoration provided by an embodiment of the present application;

[0026] Figure 7Schematic diagram of the implementation process of another backup and restoration method provided by an embodiment of the present application;

[0027] Figure 8 Schematic diagram of the structure of the backup and restoration device provided by an embodiment of the present application;

[0028] Figure 9 Schematic diagram of the composition structure of the backup and restoration device provided by an embodiment of the present application. Detailed implementation manners

[0029] In order to make the objectives, technical solutions, and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be construed as limiting the present application. All other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the scope of protection of the present application.

[0030] In the following description, reference is made to "some embodiments", which describe a subset of all possible embodiments. However, it can be understood that "some embodiments" can be the same subset or different subsets of all possible embodiments, and can be combined with each other without conflict.

[0031] If descriptions such as "first / second / third" appear in the application documents, the following explanation is added. In the following description, the terms "first / second / third" are only used to distinguish similar objects and do not represent a specific order for the objects. It can be understood that "first / second / third" can be interchanged with a specific order or sequence when permitted, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.

[0032] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those of ordinary skill in the technical field to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.

[0033] Based on the problems existing in the related art, an embodiment of the present application provides a backup and restoration method, and the method is applied to a backup and restoration device. The backup and restoration device can be a personal computer, a tablet computer, etc. The method provided in this embodiment can be implemented by a computer program, and when the computer program is executed, each step in the method provided in this embodiment is completed. In some embodiments, the computer program can be executed by a processor in the backup and restoration device. Figure 1 Schematic diagram of the process of a backup and restoration method provided by an embodiment of the present application, as Figure 1 shown, the method includes:

[0034] Step S101, in the case of a kernel crash of the operating system, the backup and restore device reloads the kernel to restart the operating system.

[0035] In the embodiments of the present application, the operating system is a Linux operating system, which is a multi-user, multi-tasking operating system that supports multi-threading and multi-processors (CPUs, Central Processing Units). In the embodiments of the present application, when the kernel crashes, it usually causes the system to crash. In the embodiments of the present application, the kernel is mounted with a root file system, and when the kernel is loaded, the operating system can be quickly restarted. Figure 2 It is a schematic flowchart of the kernel crash fast restart system provided by the embodiments of the present application. As Figure 2 shown, the method of the kernel crash fast restart system includes:

[0036] Step S201, when the system crashes, the kernel crashes.

[0037] In the embodiments of the present application, when the kernel crashes, the processes of all business applications are stopped.

[0038] Step S202, directly execute kexec - e to reload the kernel to make it support exporting kernel page tables.

[0039] In the embodiments of the present application, directly executing kexec - e to reload the kernel does not require executing the kdump program.

[0040] Step S203, after the kernel is reloaded, execute kexec - e to immediately restart the system.

[0041] In the embodiments of the present application, the system is immediately restarted according to the root file system mounted by the kernel, which can skip the hardware initialization stage during the system restart process and achieve a fast restart of the system.

[0042] Step S102, after the operating system restarts, the backup and restore device obtains the process snapshots of the business applications backed up in advance.

[0043] In the embodiments of the present application, a process snapshot is a state record of the data of the process at the storage moment, which is used for online data backup and recovery of the business process. When an application failure or file corruption occurs in the storage device, fast data recovery can be performed to restore the data to an available running state at a certain storage moment.

[0044] In the embodiments of the present application, the service application is an application that provides service for business processing for a specific application. For example, an application that provides business processing service for a database in an operating system. After the operating system restarts, it is necessary to restore the service application before the kernel crashes. Therefore, it is necessary to obtain a process snapshot of the service application pre-stored in the server. Figure 3 It is a schematic diagram for obtaining a process snapshot provided by an embodiment of the present application, as Figure 3 shown, the backup and restore device downloads an application snapshot (process snapshot) 302 from the storage server 301, and executes a restore service according to the application snapshot 302 to restore each business process 303.

[0045] In the embodiments of the present application, the process snapshot pre-backup to the server is that the backup and restore device obtains the process snapshot of the service application every preset time interval during the operation of the operating system. Figure 4 It is a schematic diagram for backing up a process snapshot provided by an embodiment of the present application, as Figure 4 shown, when the backup and restore device obtains a normally running business process 401, after enabling the backup service to obtain a process snapshot 402, it uploads the process snapshot 402 to the storage server 403 so that the storage server backs up the process snapshot.

[0046] In the embodiments of the present application, when the server receives a process snapshot, it is necessary to delete the process snapshot of the received service application before receiving this process snapshot. That is to say, in the embodiments of the present application, the process snapshot of the service application saved in the server is the latest.

[0047] Step S103, the backup and restore device restores the service application to the running state before the kernel crashes according to the process snapshot.

[0048] In the embodiments of the present application, when the backup and restore device obtains a process snapshot, it can process and restore the service application. The service application is started by the service application information in the process snapshot, and then the service application is restored according to the subprocess information and thread information in the process snapshot.

[0049] The method provided by the embodiment of the present application is to reload the kernel when the operating system crashes, without executing the crash dump (kdump) program. The loaded kernel is used to restart the operating system, skipping the time-consuming hardware initialization phase and avoiding an excessively long operating system restart time. After the operating system restart is complete, a process snapshot of the business application pre-backed up on the server is obtained, and the business application is restored to its running state before the kernel crash using the process snapshot of the business application. The method provided by the embodiment of the present application not only avoids an excessively long operating system restart time, but also avoids the problem of business application data being lost because it resides in its own memory, thereby achieving rapid recovery of business applications and improving the efficiency of business recovery.

[0050] The embodiment of the present application provides a backup and restoration method. Figure 5 A schematic diagram of a backup and restore method according to an embodiment of the present invention is shown in FIG. Figure 5 As shown, the method includes:

[0051] Step S501 : During the operation of the operating system, the backup and restoration device obtains a process snapshot of the business application at a preset time interval.

[0052] In the embodiment of the present application, the process snapshot includes business application information, which may include a logical address of the business application and state information of the business application, etc. The backup and restore device may enable the business application according to the business application information.

[0053] In the embodiment of the present application, the business application corresponding to the process snapshot is a business application that runs normally.

[0054] In the embodiment of the present application, the preset duration can be set by the user as needed. For example, the preset duration is set to 30 seconds (s, second), and the backup and restore device obtains a process snapshot of the business application every 30 seconds.

[0055] Step S502: The backup and restore device sends the process snapshot to the server, so that the server backs up the process snapshot.

[0056] In the embodiment of the present application, the process snapshot backed up by the server is the latest one, and when the current process snapshot is received, the previous process snapshot is deleted.

[0057] Step S503: When the kernel of the operating system crashes, the backup and restoration device reloads the kernel to restart the operating system.

[0058] In the embodiment of the present application, the kernel is mounted with a root file system. After the kernel is loaded, there is no need to execute a crash dump program. Instead, the operating system is restarted through the loaded kernel, skipping the time-consuming hardware initialization stage and avoiding excessive operating system restart time.

[0059] Step S504, after the operating system restarts, the backup and restore device obtains the process snapshot of the business application pre-backuped to the server.

[0060] In the embodiment of the present application, the backup and restore device obtains the process snapshot of the business application pre-backuped to the server, which can be achieved in the following way: the backup and restore device sends a request message to the server, and the request message is used to request the server to send the process snapshot to the backup and restore device. When the server receives the request message, it sends the process snapshot to the backup and restore device.

[0061] Step S505, the backup and restore device restores the business application to the running state before the kernel crash according to the process snapshot.

[0062] The method provided by the embodiment of the present application obtains the process snapshot of the business application at preset time intervals and sends the process snapshot to the server, so that the process snapshots stored in the server are all the latest ones, avoiding the problem of data loss caused by business data staying in memory. During the process of the operating system restarting, there is no need to execute a crash dump program. Instead, the operating system is restarted through the loaded kernel, skipping the time-consuming hardware initialization stage and avoiding excessive operating system restart time. According to the process snapshot of the business application pre-backuped to the server, the business application is restored to the running state before the kernel crash, thereby improving the business recovery efficiency.

[0063] Based on the foregoing embodiments, in some embodiments, in step S501, "obtaining the process snapshot of the business application at preset time intervals" can be achieved through the following steps:

[0064] Step S501A, the backup and restore device traverses the process tree directory where the process of the business application is located at the preset time interval, and obtains the subprocess information and thread information in the process tree directory.

[0065] In the embodiment of the present application, after the backup and restore device traverses the process tree directory, it can obtain the subprocess information and thread information in the process tree directory. The states of the subprocesses and threads can be running state, ready state, blocked state, etc.

[0066] Step S501B, the backup and restore device freezes the business application and reads the business application information of the business application.

[0067] In the embodiment of the present application, in order to back up the running status of the business application, it is necessary to freeze the business application during the backup so that the data of the business application does not change during the backup.

[0068] In step S501C, the backup and restoration device obtains a process snapshot of the business application according to the sub-process information, the thread information, and the business application information.

[0069] After the backup and restore device obtains the sub-process information, the thread information, and the business application information, it can generate a process snapshot based on the sub-process information, the thread information, and the business application information. In some embodiments, generating the process snapshot based on the sub-process information, the thread information, and the business application information can include generating an initial process snapshot based on the business application information, and writing the sub-process information and the thread information into the initial process snapshot to obtain the process snapshot of the business application.

[0070] In an embodiment of the present application, by traversing the process tree directory where the process of the business application is located, obtaining sub-process information and thread information, and freezing the business application, obtaining business application information, and obtaining a process snapshot of the business application based on the sub-process information, the thread information and the business application information, when the backup and restore device obtains the process snapshot, it can restore the state of the business process in the process tree of the business application based on the sub-process information and thread information to restore the business application to the running state before the kernel crash.

[0071] In some embodiments, after step S501C "the backup and restoration device obtains a process snapshot of the business application based on the sub-process information, the thread information, and the business application information", the method further includes:

[0072] Step S501D: Unfreeze the business application to resume the operation of the business application.

[0073] In the embodiment of the present application, the process of the business application can be restored to unfreeze the business application. After the business application is unfrozen, the business application can run normally.

[0074] In an embodiment of the present application, after obtaining the process snapshot, the business application is unfrozen to enable normal operation of the business application so that the user can use the business application normally. When backed up again after a preset period of time, the latest process snapshot can be obtained. When the system crashes, the business application can be restored to the latest state before the system crash through the latest process snapshot.

[0075] In some embodiments, the step S505 "the backup and restore device restores the business application to the running state before the kernel crash according to the process snapshot" can be implemented through the following steps:

[0076] Step S5051, the backup and restore device parses the process snapshot to obtain the subprocess information, the thread information, and the business application information.

[0077] In the embodiments of the present application, after the backup and restore device obtains the process snapshot, parsing the process snapshot can obtain the following included in the process snapshot: subprocess information, thread information, and business application information. After the parsing is completed, a process tree can be created through the fork function to reconstruct the process group to be restored. Figure 6 It is a schematic diagram of the backup and restore of the process snapshot provided by the embodiments of the present application. As Figure 6 shown, the backup and restore device implements the backup and restore of the business process 602 according to the information carried in the process snapshot 601. A process tree can be created through the fork function to reconstruct the business process 602 to be restored, and the subprocess information, the thread information, and the business application information are mapped in its own memory area.

[0078] Step S5052, the backup and restore device starts the business application according to the business application information.

[0079] After the business application is started, it is necessary to restore the states of the threads and subprocesses related to the business application so that the business application can be used normally.

[0080] Step S5053, the backup and restore device restores the state of the business process in the process tree where the process of the business application is located according to the subprocess information and the thread information, so as to restore the business application to the running state before the kernel crash.

[0081] In the embodiments of the present application, when the backup and restore device parses the process snapshot, it starts the business application according to the business application information, and restores the process tree according to the subprocess information and the thread information, so that the business application is restored to the running state before the kernel crash. Since the subprocess information, the thread information, and the business application information are the latest data before the kernel crash, the business application is restored to the latest state before the system crash.

[0082] In some embodiments, before the step S501 "obtain a process snapshot of the business application at every preset time interval", the method further includes:

[0083] Step S1, during the operation of the operating system, determine whether there is an abnormality in the process of the business application; when determining whether the process of the business application is abnormal, the output stream generated by the thread in the process can be intercepted, and then according to the content of the output stream, it is judged whether the process of the executed business application has an abnormality. In some embodiments, the abnormal process can be viewed through the system process manager. Process abnormalities include: process interruption, process failure, process termination, etc.

[0084] In the embodiment of the present application, in the case where it is determined that the process of the business application is abnormal, step S2 is executed; in the case where it is determined that the process of the business application is not abnormal, step S501 is executed.

[0085] Step S2, in the case where the process of the business application is abnormal, stop obtaining the process snapshot of the business application.

[0086] Step S3, restart the business application.

[0087] In the embodiment of the present application, after the business application is restarted, step S1 is continued to be executed.

[0088] The method provided by the embodiment of the present application, during the operation of the operating system, by determining whether the business application is abnormal, if there is an abnormality, the process snapshot of the business application is not obtained, and the business application is restarted. Only when the business application is not abnormal, the process snapshot of the business application is obtained. In this way, the business application obtained after recovery is a normally running business application. Since it is a normally running business application, the risk of causing system crashes can be reduced.

[0089] In some embodiments, after step S505, the method further includes:

[0090] Step S506, in the running state of the application program before the kernel crashes, the backup and restore device deletes the process snapshot.

[0091] In the embodiment of the present application, when the application program is in the running state before the kernel crashes, that is to say, the process snapshot is no longer useful. In order to save its own storage space, the backup and restore device deletes the process snapshot.

[0092] The backup and restore method provided by the embodiment of the present application deletes the process snapshot in the running state of the application program before the kernel crashes to save its own storage space.

[0093] A backup and restoration method provided by an embodiment of the present application is to solve the problems of low efficiency, long recovery time, and easy data loss in the manual backup and restoration technology when the existing Linux operating system crashes. In order to achieve the rapid and automated backup and restoration of system business data and improve the user experience, an embodiment of the present application provides a backup and restoration method. Figure 7 It is a schematic flowchart of the implementation process of another backup and restoration method provided by an embodiment of the present application, and the method includes:

[0094] Step S701, the backup and restoration device checks and confirms whether the config_kexec is enabled in the running Linux system kernel.

[0095] In an embodiment of the present application, if the answer is no, the kernel needs to be recompiled, this option is set to yes, and then the system kernel is upgraded and installed to support the kexec system call.

[0096] Step S702, the backup and restoration device's system default starts the backup service, monitors the status of the system's key services (business applications), and periodically backs up the process snapshots of the business applications.

[0097] During the backup process, the normal operation of the business application cannot be affected. The process snapshots are default saved in the remote data storage directory, and some expired process snapshots are periodically cleaned up.

[0098] In an embodiment of the present application, step S702 can be implemented through the following steps:

[0099] Step S7021, the backup and restoration device adds a timed scheduled task to start the backup service.

[0100] For example, monitor the status of the business application every 30 seconds. When the application becomes unavailable or the process status is abnormal, stop the backup service and restart the business application.

[0101] Step S7022, the backup and restoration device traverses all key business applications in the normal running state, periodically backs up the application process snapshots, and ensures the normal operation of the business during the backup process.

[0102] Step S7023, the backup and restoration device backs up the process snapshots of each key business application to the remote data storage directory (server), and periodically cleans up some expired process snapshots.

[0103] Step S703, when the system crashes and causes the kernel to crash, the backup and restoration device reloads the default kernel through kexec, mounts the root file system, and quickly restarts the system.

[0104] In an embodiment of the present application, the default kernel is reloaded through kexec.

[0105] The time-consuming hardware device initialization phase can be skipped directly to avoid a long system restart time that affects the rapid recovery of services. When the system crashes and the kernel sends a crash, it is necessary to quickly restart the system to restore services. In this embodiment of the application, step S703 can be implemented by the following steps:

[0106] Step S7031: When a kernel crash is detected, the backup and restore device stops all application processes and then directly executes kexec -e to reload the kernel.

[0107] In the embodiment of the present application, there is no need to execute the downtime dump (kdump) program.

[0108] Step S7032: After the kernel is reloaded, the backup and restore device executes kexec -e to immediately restart the system.

[0109] In the embodiment of the present application, this can bypass the most time-consuming stage in the system restart process and achieve a quick restart of the system.

[0110] Step S7033: After the system quickly restarts, the backup and restore device starts the restore process service.

[0111] In step S704, after the system is quickly restarted, the backup and restore device starts the restore service to read the process snapshot that has been backed up remotely before, and reads the latest process snapshot to automatically restore all key business applications to the state before the system crash.

[0112] In this embodiment of the application, the latest saved process snapshot is obtained from the remote data backup directory. If the critical business application does not have a process snapshot, the business application is directly restarted and initialized. If a process snapshot exists, the business application is attempted to be restored using a restore command. This allows the business application to be restored to its latest healthy state, ensuring the consistency of business data.

[0113] The steps for backing up a process snapshot are as follows:

[0114] Step S1A: The backup and restore device traverses the process tree directory to iteratively collect sub-process and thread information.

[0115] Step S2A, backing up and restoring the device freeze process.

[0116] In step S3A, the backup and restore device reads all the information related to the collected tasks through the backup service and writes them to the backup file.

[0117] Step S4A: After all file information is backed up, the backup and restore device releases the process freeze state.

[0118] It is to release the binding with the task and resume the operation of the business application.

[0119] The steps to restore the process snapshot are as follows:

[0120] Step S1B, the backup and restore device's restore service reads the snapshot file, parses it, and restores the shared resources.

[0121] Step S2B, the backup and restore device creates a process tree through fork to reconstruct the process group to be restored.

[0122] Step S3B, the backup and restore device remaps the memory area.

[0123] Step S4B, the backup and restore device enters the context environment of the application process and further restores basic task resources such as thread information, Socket connection information, and file descriptor information.

[0124] After confirming that all business applications have been restored, stop the restore service, clean up all expired process snapshots, restart the backup service, and regularly generate process snapshots of critical business applications.

[0125] After confirming that all critical business applications are running, the restore service exits, and the backup service is restarted to regularly back up the process snapshots of critical business applications.

[0126] The method provided by the embodiment of the present application first starts the backup service to back up the process snapshots of critical business applications. When the system crashes due to a kernel panic, the system is quickly restarted through kexec. After the system starts up, the restore service is immediately started to read the process snapshots of critical business applications and quickly restore the business applications to the healthy state before the system restart, realizing the quick backup and restore of the system.

[0127] The method provided by the embodiment of the present application effectively solves the disadvantages of the existing technology, such as long time-consuming for manual system backup and restore, easy data loss, and low efficiency, and improves the high availability of business applications.

[0128] Based on the foregoing embodiments, the embodiment of the present application provides a backup and restore device. Each module included in the device, as well as each unit included in each module, can be implemented by a processor in a computer device; of course, it can also be implemented by specific logic circuits; during implementation, the processor can be a central processing unit (CPU, Central Processing Unit), a microprocessor (MPU, Microprocessor Unit), a digital signal processor (DSP, Digital Signal Processing), or a field programmable gate array (FPGA, Field Programmable Gate Array), etc.

[0129] Another backup and restore device is provided in an embodiment of the present application. Figure 8 It is a schematic structural diagram of the backup and restore device provided in an embodiment of the present application. As Figure 8 shown, the backup and restore device 800 includes:

[0130] A loading module 801, configured to reload the kernel to restart the operating system when the kernel of the operating system crashes;

[0131] A first acquisition module 802, configured to acquire a process snapshot of a pre-backup business application after the restart of the operating system is completed;

[0132] A restoration module 803, configured to restore the business application to the running state before the kernel crash according to the process snapshot.

[0133] In some embodiments, the backup and restore device 800 further includes:

[0134] A second acquisition module, configured to acquire a process snapshot of the business application at preset time intervals during the operation of the operating system;

[0135] A sending module, configured to send the process snapshot to the server so that the server backs up the process snapshot. Wherein, when the server receives the process snapshot, the previously received process snapshot of the business application is deleted.

[0136] In some embodiments, the second acquisition module includes:

[0137] An acquisition unit, configured to traverse the process tree directory where the process of the business application is located at preset time intervals to acquire subprocess information and thread information in the process tree directory;

[0138] A freezing unit, configured to freeze the business application and read the business application information of the business application;

[0139] A obtaining unit, configured to obtain a process snapshot of the business application according to the subprocess information, the thread information, and the business application information.

[0140] In some embodiments, the second acquisition module further includes:

[0141] A thawing unit, configured to unfreeze the business application to resume the operation of the business application.

[0142] In some embodiments, the restoration module 803 includes:

[0143] A parsing module, configured to parse the process snapshot to obtain the subprocess information, the thread information, and the business application information;

[0144] A first starting module, configured to start the service application according to the service application information;

[0145] A recovery module is used to restore the process tree where the process of the business application is located according to the sub-process information and the thread information, so as to restore the business application to the running state before the kernel crashes.

[0146] In some embodiments, the backup and restoration device 800 further includes:

[0147] A determination module, configured to determine whether there is an abnormality in the process of the business application during operation of the operating system;

[0148] A stopping module, configured to stop obtaining a process snapshot of the business application when an abnormality occurs in the process of the business application;

[0149] The second startup module is configured to restart the business application, wherein when the business application is restarted and there is no abnormality in the process of the business application, a process snapshot of the business application is obtained once every preset time interval.

[0150] In some embodiments, the backup and restoration device 800 further includes:

[0151] The deletion module is used to delete the process snapshot when the application program reaches the running state before the kernel crashes.

[0152] The description of the above device embodiment is similar to the description of the above method embodiment, and has similar beneficial effects as the method embodiment. For technical details not disclosed in the device embodiment of the present application, please refer to the description of the method embodiment of the present application for understanding.

[0153] The embodiment of the present application provides a backup and restore device, Figure 9 A schematic diagram of the structure of the backup and restore device provided in the embodiment of the present application is shown as follows: Figure 9 As shown, the backup and restore device 900 includes: a processor 901, at least one communication bus 902, a user interface 903, at least one external communication interface 904, and a memory 905. The communication bus 902 is configured to achieve connection and communication between these components. The user interface 903 may include a display screen, and the external communication interface 904 may include a standard wired interface and a wireless interface. The processor 901 is configured to execute the backup and restore method program stored in the memory to implement the steps of the backup and restore method provided in the above embodiment.

[0154] The descriptions of the above embodiments of the backup and restoration device and storage medium are similar to those of the above method embodiments, and have beneficial effects similar to those of the method embodiments. For the technical details not disclosed in the embodiments of the backup and restoration device and storage medium of this application, please refer to the descriptions of the method embodiments of this application for understanding.

[0155] It should be noted that in the embodiments of this application, if the above-mentioned symmetric storage cluster directory quota management method is implemented in the form of software function modules and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the embodiments of this application, in essence, or the part that makes contributions to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods described in the embodiments of this application. The foregoing storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROMs), magnetic disks, or optical discs that can store program codes. In this way, the embodiments of this application are not limited to any specific combination of hardware and software.

[0156] Correspondingly, the embodiments of this application provide a computer-readable storage medium, on which a computer program is stored, and characterized in that when the computer program is executed by a processor, it implements the steps in the backup and restoration method provided in the above embodiments.

[0157] The descriptions of the above storage medium embodiments are similar to those of the above method embodiments, and have beneficial effects similar to those of the method embodiments. For the technical details not disclosed in the embodiments of the backup and restoration device and storage medium of this application, please refer to the descriptions of the method embodiments of this application for understanding.

[0158] It should be pointed out here that: the descriptions of the above storage medium and device embodiments are similar to those of the above method embodiments, and have beneficial effects similar to those of the method embodiments. For the technical details not disclosed in the embodiments of the storage medium and device of this application, please refer to the descriptions of the method embodiments of this application for understanding.

[0159] It should be understood that the "one embodiment" or "an embodiment" mentioned throughout the specification means that the specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present application. Therefore, the "in one embodiment" or "in an embodiment" that appears throughout the specification does not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics may be combined in one or more embodiments in any suitable manner. It should be understood that in various embodiments of the present application, the magnitude of the serial numbers of the above processes does not mean the order of execution. The order of execution of each process should be determined by its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present application. The serial numbers of the embodiments of the present application above are only for description and do not represent the advantages or disadvantages of the embodiments.

[0160] It should be noted that in this article, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or also includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "including a..." does not exclude the existence of additional identical elements in the process, method, article or device including the element.

[0161] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only illustrative. For example, the division of the units is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling or communication connection between the components shown or discussed with each other can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.

[0162] The units described as separate components above may or may not be physically separated, and the components shown as units may or may not be physical units; they can be located in one place or distributed to multiple network units; some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0163] In addition, each functional unit in the embodiments of the present application can be all integrated in a processing unit, or each unit can be separately used as a unit, or two or more units can be integrated in a unit; the above integrated units can be implemented in the form of hardware, or in the form of a combination of hardware and software functional units.

[0164] Those of ordinary skill in the art will understand that all or part of the steps of implementing the above method embodiments can be completed by hardware related to program instructions. The foregoing program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps including those of the above method embodiments. The foregoing storage medium includes various media that can store program codes, such as removable storage devices, read-only memories (ROMs), magnetic disks, or optical discs.

[0165] Alternatively, if the above integrated units of the present application are implemented in the form of software function modules and sold or used as independent products, they can also be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the embodiments of the present application, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing an AC to perform all or part of the methods described in the various embodiments of the present application. The foregoing storage medium includes various media that can store program codes, such as removable storage devices, ROMs, magnetic disks, or optical discs.

[0166] As described above, the above are only the implementation manners of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present application can easily think of changes or substitutions, which should all be covered by the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims

1. A backup and restoration method, characterized in that, The method includes: In the case of a kernel crash of the operating system, reloading the kernel through kexec, mounting the root file system to restart the operating system; After the operating system restarts, obtaining a process snapshot of a business application that was pre-backed up; Parsing the process snapshot to obtain child process information, thread information, and business application information, and creating a process tree through the fork function to reconstruct the process group that needs to be restored; wherein, the child process information, the thread information, and the business application information are the latest data before the kernel crash; Starting the business application according to the business application information; Restoring the process tree where the process of the business application is located according to the child process information and the thread information to restore the business application to the latest running state before the kernel crash.

2. The method according to claim 1, characterized in that The method further includes: During the operation of the operating system, obtaining a process snapshot of the business application once every preset duration; Sending the process snapshot to a server so that the server backs up the process snapshot, wherein when the server receives the process snapshot, deleting the previously received process snapshot of the business application.

3. The method according to claim 2, wherein The obtaining a process snapshot of the business application once every preset duration includes: Traversing the process tree directory where the process of the business application is located every preset duration to obtain the child process information and thread information in the process tree directory; Freezing the business application and reading the business application information of the business application; Obtaining a process snapshot of the business application according to the child process information, the thread information, and the business application information.

4. The method according to claim 3, wherein After obtaining a process snapshot of the business application according to the child process information, the thread information, and the business application information, the method further includes: Unfreezing the business application to resume the operation of the business application.

5. The method according to claim 2, wherein The method further includes: During the operation of the operating system, determining whether there is an abnormality in the process of the business application; In the case of an abnormality in the process of the business application, stopping obtaining the process snapshot of the business application; Restarting the business application, wherein when the business application restarts and there is no abnormality in the process of the business application, obtaining a process snapshot of the business application once every preset duration.

6. The method according to claim 1, wherein The method further includes: Deleting the process snapshot in the case of restoring the business application to the running state before the kernel crash.

7. A backup and restore device, characterized in that The backup and restoration device includes: A loading module, configured to, in the case of a kernel crash of the operating system, reload the kernel through kexec, mount the root file system to restart the operating system; A first obtaining module, configured to, after the operating system restarts, obtain a process snapshot of a business application that was pre-backed up; A parsing module, configured to parse the process snapshot to obtain child process information, thread information, and business application information, and create a process tree through the fork function to reconstruct the process group that needs to be restored; wherein, the child process information, the thread information, and the business application information are the latest data before the kernel crash; A first startup module, configured to start the business application according to the business application information; A recovery module, configured to recover the process tree where the process of the business application is located according to the subprocess information and the thread information, so as to restore the business application to the latest running state before the kernel crashes.

8. A backup and restoration device, characterized in that, The device at least includes: A processor; and A memory, configured to store a computer program that can run on the processor; Wherein, when the computer program is executed by the processor, the steps of the backup and recovery method according to any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium, wherein computer-executable instructions are stored in the computer storage medium, and the computer-executable instructions are configured to execute the steps of the backup and recovery method according to any one of claims 1 to 6 above.

Citation Information

Patent Citations

  • Application program processing method and device

    CN111435302A

  • Restoring an application from a system dump file

    US20150324256A1