CN114064348A - Backup restoration method, device and equipment and computer readable storage medium - Google Patents

Backup restoration method, device and equipment and computer readable storage medium Download PDF

Info

Publication number
CN114064348A
CN114064348A CN202010746100.4A CN202010746100A CN114064348A CN 114064348 A CN114064348 A CN 114064348A CN 202010746100 A CN202010746100 A CN 202010746100A CN 114064348 A CN114064348 A CN 114064348A
Authority
CN
China
Prior art keywords
application
service application
snapshot
backup
information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010746100.4A
Other languages
Chinese (zh)
Inventor
严海双
顾志峰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Mobile Communications Group Co Ltd
China Mobile Suzhou Software Technology Co Ltd
Original Assignee
China Mobile Communications Group Co Ltd
China Mobile Suzhou Software Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Mobile Communications Group Co Ltd, China Mobile Suzhou Software Technology Co Ltd filed Critical China Mobile Communications Group Co Ltd
Priority to CN202010746100.4A priority Critical patent/CN114064348A/en
Publication of CN114064348A publication Critical patent/CN114064348A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1415Saving, restoring, recovering or retrying at system level
    • G06F11/1438Restarting or rejuvenating
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1448Management of the data involved in backup or backup restore
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/11File system administration, e.g. details of archiving or snapshots
    • G06F16/128Details of file system snapshots on the file-level, e.g. snapshot creation, administration, deletion

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Quality & Reliability (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Retry When Errors Occur (AREA)

Abstract

The embodiment of the application provides a backup restoration method, a backup restoration device, equipment and a computer-readable storage medium, wherein the method comprises the following steps: in the case of a kernel crash of an operating system, reloading the kernel to restart the operating system; after the operating system is restarted, acquiring a process snapshot of a pre-backed-up business application; and restoring the running state of the service application before the kernel crash according to the process snapshot.

Description

Backup restoration method, device and equipment and computer readable storage medium
Technical Field
The embodiment of the application relates to the technical field of data processing, and relates to but is not limited to a backup restoration method, a backup restoration device, backup restoration equipment and a computer-readable storage medium.
Background
At present, most of the mainstream operating systems have a backup and restore function, and the traditional operating system backup and restore scheme mainly includes: based on the hard disk snapshot at the file system level, a complete backup of a restore point is created, then one-key restoration is supported, and the system hard disk data is periodically and incrementally backed up. However, when the system is abnormal or even crashed, for example, when the system is down due to an abnormality such as kernel crash, hacking, etc., only part of data or data of a certain restoration point can be restored by using the backup restoration schemes, so that loss of critical service application data due to resident memory cannot be avoided, and even if the service application is successfully restored, the restoration period is generally long, the efficiency is low, and the problem of data inconsistency is easily caused.
Disclosure of Invention
Based on the problem of low efficiency of restoring service applications during backup restoration in the related art, embodiments of the present application provide a backup restoration method, apparatus, device, and computer-readable storage medium to improve the restoration efficiency of service applications.
The technical scheme of the embodiment of the application is realized as follows:
the embodiment of the application provides a backup restoration method, which comprises the following steps:
in the event of a kernel crash of an operating system, reloading the kernel to restart the operating system;
after the operating system is restarted, acquiring a process snapshot of a pre-backed-up business application;
and restoring the running state of the service application before the kernel crash according to the process snapshot.
An embodiment of the present application provides a backup and restore apparatus, the apparatus includes:
the loading module is used for reloading the kernel of the operating system under the condition that the kernel of the operating system crashes so as to restart the operating system;
the first acquisition module is used for acquiring a process snapshot of a pre-backed-up business application after the restart of the operating system is completed;
and the restoring module is used for restoring the running state of the service application before the kernel crash according to the process snapshot.
An embodiment of the present application provides a backup and restore device, where the device at least includes:
a processor; and
a memory for storing a computer program operable on the processor;
wherein the computer program, when executed by a processor, implements the steps of the backup-restore method.
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 restore method.
The embodiment of the application provides a backup restoration method, a backup restoration device, a backup restoration apparatus and a computer-readable storage medium, wherein when a kernel of an operating system crashes, the kernel is reloaded, and the operating system is restarted by the loaded kernel, so that the restarting time of the operating system is prevented from being too long; and after the operating system is restarted, acquiring a process snapshot of the pre-backed-up service application, and restoring the service application to the running state before kernel crash through the process snapshot of the service application, so that the quick recovery of the service application is realized, and the efficiency of service recovery is improved.
Drawings
In the drawings, which are not necessarily drawn to scale, like reference numerals may describe similar components in different views. The drawings illustrate generally, by way of example, but not by way of limitation, various embodiments discussed herein.
Fig. 1 is a schematic flowchart of a backup restoration method according to an embodiment of the present disclosure;
FIG. 2 is a flowchart illustrating a kernel crash fast restart system according to an embodiment of the present disclosure;
fig. 3 is a schematic diagram illustrating acquisition of a process snapshot according to an embodiment of the present application;
fig. 4 is a schematic view of a process snapshot backup provided in an embodiment of the present application;
fig. 5 is a schematic flowchart illustrating an implementation process of another backup restoration method according to an embodiment of the present application;
fig. 6 is a schematic diagram of a process snapshot backup restoration provided in an embodiment of the present application;
fig. 7 is a schematic flowchart illustrating an implementation process of another backup restoration method according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of a backup and restore apparatus according to an embodiment of the present application;
fig. 9 is a schematic structural diagram of a backup and restore device according to an embodiment of the present application.
Detailed Description
In order to make the objectives, technical solutions and advantages of the present application clearer, the present application will be described in further detail with reference to the attached drawings, the described embodiments should not be considered as limiting the present application, and all other embodiments obtained by a person of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.
In the following description, reference is made to "some embodiments" which describe a subset of all possible embodiments, but it is understood that "some embodiments" may be the same subset or different subsets of all possible embodiments, and may be combined with each other without conflict.
The following description will be added if a similar description of "first \ second \ third" appears in the application file, and in the following description, the terms "first \ second \ third" merely distinguish similar objects and do not represent a specific ordering for the objects, and it should be understood that "first \ second \ third" may be interchanged under certain circumstances in a specific order or sequence, so that the embodiments of the application described herein can be implemented in an order other than that shown or described herein.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of the present application only and is not intended to be limiting of the application.
Based on the problems in the related art, the embodiments of the present application provide a backup and restore method, which is applied to a backup and restore device. The backup and restore device may be a personal computer, a tablet computer, or the like, and the method provided in this embodiment may be implemented by a computer program, where the computer program completes each step in the method provided in this embodiment when executed. In some embodiments, the computer program may be executed by a processor in the backup restore device. Fig. 1 is a schematic flowchart of a backup restoration method provided in an embodiment of the present application, and as shown in fig. 1, the method includes:
step S101, when the kernel of the operating system crashes, the backup restoring device reloads the kernel to restart the operating system.
In the embodiment of the present application, the operating system is a Linux operating system, and the Linux operating system is a multi-user, multi-task, multi-thread and multiprocessor (CPU) supporting operating system. In the embodiment of the application, when the kernel crashes, the system is down. In the embodiment of the application, the kernel is hung with the root file system, and the operating system can be quickly restarted after the kernel is loaded. Fig. 2 is a schematic flowchart of a kernel crash fast restart system according to an embodiment of the present application, and as shown in fig. 2, the method for kernel crash fast restart system includes:
in step S201, when the system is down, the kernel (kernel) is broken down.
In the embodiment of the application, when the kernel crashes, all the processes of the business application are stopped.
Step S202, directly executing kexec-e to reload the kernel, so that the kernel supports exporting of kernel pages (pages).
In the embodiment of the application, the kexec-e is directly executed to reload the kernel without executing a downtime dump (kdump) program.
Step S203, after the kernel reloads, executing kexec-e to restart the system immediately.
In the embodiment of the application, the system is immediately restarted according to the root file system mounted by the kernel, so that a hardware initialization stage in the restarting process of the system can be skipped, and the quick restarting of the system is realized.
Step S102, after the restart of the operating system is completed, the backup and restore device obtains a process snapshot of the business application backed up in advance.
In the embodiment of the application, the process snapshot is a state record of the data of the process at the storage time, and is used for online data backup and recovery of the business process. When the storage device has application failure or file damage, the data can be quickly recovered, and the data can be recovered to an available running state at a certain storage moment.
In this embodiment of the present application, the service application is an application that provides a service for service processing for a specific application, for example: and providing the application of the business processing service for the database in the operating system. After the operating system is restarted, the service application before kernel crash needs to be restored, so that a process snapshot of the service application stored in the server in advance needs to be acquired. Fig. 3 is a schematic diagram illustrating obtaining of a process snapshot according to an embodiment of the present application, and as shown in fig. 3, a backup and restore device downloads an application snapshot (process snapshot) 302 from a storage server 301, and executes a restore service according to the application snapshot 302 to restore each business process 303.
In this embodiment of the present application, the process snapshot pre-backed up in the server is a process snapshot obtained by the backup/restore device at every preset time interval during the operation of the operating system by the service application, and fig. 4 is a process snapshot backup schematic diagram provided in this embodiment of the present application, as shown in fig. 4, when the backup/restore device obtains a service process 401 that normally operates, and starts the backup service to obtain a process snapshot 402, the process snapshot 402 is uploaded to the storage server 403, so that the storage server backs up the process snapshot.
In the embodiment of the present application, when the server receives the process snapshot, the received process snapshot of the service application needs to be deleted before the process snapshot is received. That is, in the embodiment of the present application, the process snapshot of the business application stored in the server is the latest.
Step S103, the backup restoration device restores the operation state of the service application before the kernel crash according to the process snapshot.
In the embodiment of the application, after the backup and restore device obtains the process snapshot, the service application can be processed and restored. And starting the service application through the service application information in the process snapshot, and recovering the service application according to the sub-process information and the thread information in the process snapshot.
According to the method provided by the embodiment of the application, when the kernel of the operating system crashes, the kernel is reloaded without executing a downtime dump (kdump) program, the loaded kernel is used for restarting the operating system, a hardware initialization stage which is time-consuming is skipped, and the situation that the restarting time of the operating system is too long is avoided; and after the operating system is restarted, restoring the service application to the running state before kernel crash through the process snapshot of the service application by acquiring the process snapshot of the service application which is backed up in the server in advance. The method provided by the embodiment of the application can avoid overlong restart time of the operating system, can also avoid the problem that the data of the service application is lost due to the fact that the data resides in the memory of the operating system, achieves quick recovery of the service application, and improves the efficiency of service recovery.
An embodiment of the present application provides a backup restoration method, and fig. 5 is a schematic diagram illustrating an implementation flow of another backup restoration method provided in the embodiment of the present application, where as shown in fig. 5, the method includes:
step S501, in the operating process of the operating system, the backup and restore device obtains a process snapshot of the service application at every preset time interval.
In this embodiment of the present application, the process snapshot includes service application information, where the service application information may include a logical address of a service application, state information of the service application, and the like. The backup restoration device may enable the service application according to the service application information.
In the embodiment of the application, the service application corresponding to the process snapshot is a normally running service application.
In the embodiment of the present application, the preset duration may be set by a user as needed, for example, the preset duration is set to be 30 seconds (s, second), and the backup and restore device obtains a process snapshot of the service application every 30 s.
Step S502, the backup and restore device sends the process snapshot to the server, so that the server backs up the process snapshot.
In the embodiment of the application, the process snapshot backed up by the server is up to date, and when the current process snapshot is received, the previous process snapshot is deleted.
Step S503, when the kernel of the operating system crashes, the backup and restore device reloads the kernel to restart the operating system.
In the embodiment of the application, the kernel is hung with the root file system, after the kernel is loaded, the down dump program does not need to be executed, the kernel which is loaded and completed restarts the operating system is used for skipping the time-consuming hardware initialization stage, and the operating system is prevented from being restarted for too long time.
Step S504, after the operating system is restarted, the backup and restore device obtains a process snapshot of the service application that is backed up in advance to the server.
In the embodiment of the present application, the backup and restore device obtains the process snapshot of the service application that is backed up in advance to the server, and may be implemented in the following manner: the backup and restoration device sends request information to the server, wherein the request information is used for requesting the server to send the process snapshot to the backup and restoration device, and when the server receives the request information, the process snapshot is sent to the backup and restoration device.
And step S505, the backup restoration device restores the operation state of the service application before the kernel crash according to the process snapshot.
According to the method provided by the embodiment of the application, the process snapshot of the service application is acquired at preset time intervals and sent to the server, so that the process snapshots stored in the server are all the latest process snapshots, the problem of data loss caused by the fact that service data reside in a memory is solved, in the process of completing the restarting of the operating system, a downtime dump program is not required to be executed, the operating system is restarted through the loaded kernel, a time-consuming hardware initialization stage is skipped, the condition that the restarting time of the operating system is too long is avoided, the service application is restored to the running state before the kernel is broken down through the process snapshot of the service application which is backed up in the server in advance, and therefore the service recovery efficiency can be improved.
Based on the foregoing embodiments, in some embodiments, in step S501, "obtaining a process snapshot of the service application once every preset time interval" may be implemented by:
step S501A, the backup and restore device traverses the process tree directory where the process of the service application is located at intervals of the preset duration, and obtains the sub-process information and the thread information in the process tree directory.
In the embodiment of the application, the backup restoration device can obtain the sub-process information and the thread information in the process tree directory after traversing the process tree directory. The state of the sub-processes and threads may be run, ready, blocked, etc.
Step S501B, the backup and restore device freezes the service application, and reads the service application information of the service application.
In the embodiment of the present application, in order to backup the running state of the service application, the service application needs to be frozen during backup, so that data of the service application is not changed during backup.
Step S501C, the backup and restore device obtains a process snapshot of the service application according to the sub-process information, the thread information, and the service application information.
After the backup restoration device obtains the sub-process information, the thread information and the service application information, a process snapshot can be generated based on the sub-process information, the thread information and the service application information. In some embodiments, the generating of the process snapshot based on the sub-process information, the thread information, and the service application information may be generating an initial process snapshot based on the service application information, and writing the sub-process information and the thread information into the initial process snapshot at the same time to obtain the process snapshot of the service application.
In the embodiment of the application, the sub-process information and the thread information are obtained by traversing a process tree directory where a process of the service application is located, the service application is frozen, and the service application information is obtained to obtain the process snapshot of the service application according to the sub-process information, the thread information and the service application information, so that when the backup restoration device obtains the process snapshot, the state of the service process in the process tree of the service application can be restored according to the sub-process information and the thread information to restore the service application to the running state before kernel crash.
In some embodiments, after step S501C, "the backup restoring apparatus obtains a process snapshot of the business application according to the sub-process information, the thread information, and the business application information," the method further includes:
step S501D, releasing the freezing of the service application to resume the running of the service application.
In the embodiment of the application, the process of the business application can be recovered to release the freezing of the business application, and the business application can normally run after the freezing of the business application is released.
In the embodiment of the application, after the process snapshot is obtained, the service application is enabled to normally run by releasing the freezing of the service application, so that a user can normally use the service application, when backup is performed again after a preset time, the latest process snapshot can be obtained, and when a system crashes, the service application can be restored to the latest state before the system crashes through the latest process snapshot.
In some embodiments, the step S505 that the backup restoring device restores the service application to the running state before the kernel crash according to the process snapshot may be implemented by:
step S5051, the backup restoration device parses the process snapshot to obtain the sub-process information, the thread information, and the service application information.
In the embodiment of the present application, after obtaining the process snapshot, the backup/restore device analyzes the process snapshot, and the obtaining of the process snapshot may include: subprocess information, thread information, and business application information. After the analysis is completed, a process tree can be created through the fork function to rebuild the process group needing to be restored. Fig. 6 is a schematic diagram of process snapshot backup and restore provided in an embodiment of the present application, and as shown in fig. 6, a backup and restore device implements a backup and restore service process 602 according to information carried in a process snapshot 601. A process tree can be created through the fork function to reconstruct the business process 602 that needs to be recovered, and the sub-process information, the thread information, and the business application information are mapped in the memory area of the process tree.
Step S5052, the backup restoring device starts the service application according to the service application information.
After the business application is started, the state of the thread and the sub-process related to the business application needs to be restored, so that the business application can be normally used.
Step S5053, the backup restoration device restores the state of the service process in the process tree in which the process of the service application is located according to the child process information and the thread information, so as to restore the service application to the running state before the kernel crashes.
In the embodiment of the application, when the backup and restore device analyzes the process snapshot, the service application is started according to the service application information, and the process tree is replied according to the sub-process information and the thread information, so that the service application is restored to the running state before the kernel crash.
In some embodiments, before the step S501, "acquiring a process snapshot of the service application once every preset time interval", the method further includes:
step S1, determining whether the process of the business application is abnormal or not in the operation of the operating system; when determining whether the process of the salesman application is abnormal, the output stream generated by the process in the process can be intercepted, and then whether the process of the executed service application is abnormal or not is judged according to the content of the output stream. In some embodiments, the exception process may be viewed through a system process manager. The process exception includes: process interruption, process failure, process termination, etc.
In the embodiment of the present application, step S2 is executed when it is determined that the process of the business application is abnormal, and step S501 is executed when it is determined that the process of the business application is not abnormal.
Step S2, stopping acquiring the process snapshot of the business application when the process of the business application is abnormal.
And step S3, restarting the service application.
In this embodiment of the application, after the service application is restarted, the step S1 is continuously executed.
According to the method provided by the embodiment of the application, in the operation of the operating system, whether the service application is abnormal or not is determined, if the abnormal application exists, the process snapshot of the service application is not obtained, the service application is restarted, and the snapshot of the service application is obtained only when the abnormal application does not exist, so that the service application obtained after recovery is the service application which normally operates.
In some embodiments, after step S505, the method further comprises:
step S506, in the case that the application program reaches the running state before the kernel crashes, the backup and restore device deletes the process snapshot.
In this embodiment of the application, when the application program reaches the running state before the kernel crashes, that is, the process snapshot is not used, in order to save the storage space of the backup/restore device, the backup/restore device deletes the process snapshot.
According to the backup restoration method provided by the embodiment of the application, under the condition that the application program is in the running state before the kernel crash, the process snapshot is deleted, so that the storage space of the process snapshot is saved.
In order to solve the problems that the efficiency of a manual backup restoration technology is low, the restoration time is long, and data loss is easy to occur when the existing Linux operating system is down, and to achieve rapid automatic backup restoration of system service data and improve user experience, the backup restoration method provided in the embodiment of the present application provides a method for backup restoration, and fig. 7 is a schematic diagram of an implementation flow of another backup restoration method provided in the embodiment of the present application, where the method includes:
in step S701, the backup restoring apparatus checks to determine whether the operating Linux system kernel turns on config _ kexec.
In the embodiment of the application, if the result is no, the kernel needs to be recompiled, the option is set to yes (yes), and then the kernel of the installation system is upgraded to support kexec system call.
Step S702, the system of the backup/restore device starts a backup service by default, monitors the state of the system key service (service application) application, and periodically backs up a process snapshot of the service application.
And in the backup process, the normal operation of the business application cannot be influenced, the process snapshots are stored in a remote data storage directory by default, and some expired process snapshots are cleaned regularly.
In this embodiment of the application, step S702 may be implemented by the following steps:
step S7021, the backup/restore device adds a timing plan task to start the backup service.
For example, the service application state is monitored every 30 seconds, and when the application is unavailable or the process state is abnormal, the backup service is stopped and the service application is restarted.
Step S7022, the backup and restore device traverses all the key service applications in the normal operating state, periodically backs up the snapshot of the application process, and ensures the normal operation of the service in the backup process.
Step S7023, the backup and restore device backs up the process snapshot of each key service application to a remote data storage directory (server), and periodically clears some expired process snapshots.
And step S703, when the kernel crashes due to the system crash, the backup and restore device reloads the default kernel through the kexec, mounts the root file system and rapidly restarts the system.
In the embodiment of the application, the default kernel is reloaded through the kexec.
The method can directly skip the time-consuming hardware equipment initialization stage, and avoid the influence on the quick recovery of the service caused by overlong system restart time. When the system crashes in the sending of the core, the system needs to be restarted quickly to recover the service, in this embodiment of the application, step S703 may be implemented by the following steps:
step S7031, when detecting that the kernel crashes, the backup and restore device stops all application processes, and then directly executes kexec-e to reload the kernel.
In the embodiment of the application, a downtime dump (kdump) program does not need to be executed.
Step S7032, after the kernel reloads, the backup restoring device executes kexec-e to immediately restart the system.
In the embodiment of the application, the most time-consuming stage in the system restarting process can be adjusted, and the system can be restarted quickly.
Step S7033, after the system is restarted quickly, the backup/restore device starts a restore process service.
Step S704, after the system is quickly restarted, the backup/restore device starts the restore service to read the process snapshot that has been backed up by the remote end before the read, and reads the latest process snapshot to automatically restore all the key service applications to the pre-system crash state.
In the embodiment of the application, the latest saved process snapshot is obtained from the remote data backup catalog, and if the key business application has no process snapshot, the business application is directly restarted and initialized. If the process snapshot exists, the business application is tried to be recovered through the recovery command, so that the business application can be recovered to the latest health state, and the consistency of business data is guaranteed.
The snapshot step of the backup process is as follows:
step S1A, the backup/restore device traverses the process tree directory to iteratively collect information of child processes and threads.
Step S2A, the backup restoration device freezes the process.
At step S3A, the backup restore device reads all information related to the collected tasks through the backup service and writes them to the backup file.
And step S4A, after all the file information is backed up, the backup restoration device releases the process frozen state.
Namely, the binding with the task is released, and the operation of the business application is recovered.
The process snapshot is restored by the following steps:
step S1B, the backup and restore device restore service reads the snapshot file to parse and restore the shared resource.
Step S2B, the backup and restore device rebuilds the process group to be restored by creating a process tree through fork.
In step S3B, the backup/restore device remaps the memory area.
And S4B, the backup restoration device enters the context environment of the application process, and further restores basic task resources such as thread information, Socket connection information, file descriptor information and the like.
And after the restoration of all the business applications is confirmed to be completed, stopping the restoration service, cleaning all expired process snapshots, restarting the backup service, and periodically generating the process snapshots of the key business applications.
And after confirming that all the key business applications are recovered to operate, the restoring service quits, and the backup service is started again to periodically backup the process snapshots of the key business applications.
The method provided by the embodiment of the application comprises the steps of starting the backup service, backing up the process snapshot of the key business application, restarting the system quickly through kexec when a kernel is crashed due to system downtime, starting the restoration service immediately after the system is started, reading the process snapshot of the key business application and quickly restoring the business application to the health state before the system is restarted, and realizing the quick backup restoration of the system.
The method provided by the embodiment of the application effectively overcomes the defects that in the prior art, the manual backup and restoration of the system takes a long time, data are easy to lose, and the efficiency is low, and improves the high availability of service application.
Based on the foregoing embodiments, an embodiment of the present application provides a backup and restore apparatus, where each module included in the apparatus and each unit included in each module may be implemented by a processor in a computer device; of course, the implementation can also be realized through a specific logic circuit; in the implementation process, the processor may be a Central Processing Unit (CPU), a Microprocessor Unit (MPU), a Digital Signal Processor (DSP), a Field Programmable Gate Array (FPGA), or the like.
Fig. 8 is a schematic structural diagram of a backup restoring apparatus provided in an embodiment of the present application, and as shown in fig. 8, the backup restoring apparatus 800 includes:
a loading module 801, configured to, in a case that a kernel of an operating system crashes, reload the kernel to restart the operating system;
a first obtaining module 802, configured to obtain a process snapshot of a pre-backed up service application after the operating system is restarted;
and a restoring module 803, configured to restore, according to the process snapshot, an operating state of the service application before the kernel crash.
In some embodiments, the backup restoring apparatus 800 further includes:
the second obtaining module is used for obtaining the process snapshot of the service application at intervals of preset duration in the operating process of the operating system;
and the sending module is used for sending the process snapshot to the server so as to enable the server to backup the process snapshot, wherein the process snapshot of the service application received before is deleted under the condition that the server receives the process snapshot.
In some embodiments, the second obtaining module comprises:
the acquiring unit is used for traversing the process tree directory where the process of the service application is located every interval of the preset duration, and acquiring sub-process information and thread information in the process tree directory;
the freezing unit is used for freezing the service application and reading the service application information of the service application;
and the obtaining unit is used for obtaining the process snapshot of the service application according to the sub-process information, the thread information and the service application information.
In some embodiments, the second obtaining module further comprises:
and the unfreezing unit is used for unfreezing the business application so as to recover the operation of the business application.
In some embodiments, the reduction module 803 comprises:
the analysis module is used for analyzing the process snapshot to obtain the sub-process information, the thread information and the service application information;
the first starting module is used for starting the service application according to the service application information;
and the recovery module is used for recovering the process tree where the process of the service application is located according to the child process information and the thread information so as to restore the running state of the service application before the kernel crashes.
In some embodiments, the backup restoring apparatus 800 further includes:
the determining module is used for determining whether the process of the business application is abnormal or not in the running of the operating system;
the stopping module is used for stopping acquiring the process snapshot of the business application under the condition that the process of the business application is abnormal;
and the second starting module is used for restarting the business application, wherein under the condition that the business application is restarted and the process of the business application is not abnormal, the process snapshot of the business application is obtained every other preset time length.
In some embodiments, the backup restoring apparatus 800 further includes:
and the deleting module is used for deleting the process snapshot under the condition that the application program is in the running state before the kernel crash.
The above description of the apparatus embodiments, similar to the above description of the method embodiments, has similar beneficial effects as the method embodiments. For technical details not disclosed in the embodiments of the apparatus of the present application, reference is made to the description of the embodiments of the method of the present application for understanding.
Fig. 9 is a schematic structural diagram of a backup and restore device provided in an embodiment of the present application, and as shown in fig. 9, 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 memory 905. Wherein the communication bus 902 is configured to enable connective 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, among others. Wherein the processor 901 is configured to execute the program of the backup restoring method stored in the memory to implement the steps in the backup restoring method provided in the above embodiments
The above description of the embodiments of the backup-restore device and the storage medium is similar to the description of the above embodiments of the method, and has similar advantageous effects to the embodiments of the method. For technical details that are not disclosed in the embodiments of the backup and restore device and the storage medium of the present application, please refer to the description of the embodiments of the method of the present application for understanding.
It should be noted that, in this embodiment of the present application, if the symmetric storage cluster catalog quota management method is implemented in the form of a software function module and is sold or used as an independent product, the method may also be stored in a computer-readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present application may be essentially implemented or portions thereof contributing to the prior art may be embodied in the form of a software product stored in a storage medium, and including several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read Only Memory (ROM), a magnetic disk, or an optical disk. Thus, embodiments of the present application are not limited to any specific combination of hardware and software.
Accordingly, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored, where the computer program is executed by a processor to implement the steps in the backup restoration method provided in the foregoing embodiment.
The above description of the storage medium embodiment is similar to the description of the method embodiment described above, with similar beneficial effects as the method embodiment. For technical details that are not disclosed in the embodiments of the backup and restore device and the storage medium of the present application, please refer to the description of the embodiments of the method of the present application for understanding.
Here, it should be noted that: the above description of the storage medium and device embodiments is similar to the description of the method embodiments above, with similar advantageous effects as the method embodiments. For technical details not disclosed in the embodiments of the storage medium and apparatus of the present application, reference is made to the description of the embodiments of the method of the present application for understanding.
It should be appreciated that reference throughout this specification to "one embodiment" or "an embodiment" means that a particular feature, structure or characteristic described in connection with the embodiment is included in at least one embodiment of the present application. Thus, the appearances of the phrases "in one embodiment" or "in an embodiment" in various places throughout this specification are not necessarily all referring to the same embodiment. Furthermore, the particular features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. It should be understood that, in the various embodiments of the present application, the sequence numbers of the above-mentioned processes do not mean the execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application. The above-mentioned serial numbers of the embodiments of the present application are merely for description and do not represent the merits of the embodiments.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The above-described device embodiments are merely illustrative, for example, the division of the unit is only a logical functional division, and there may be other division ways in actual implementation, such as: multiple units or components may be combined, or may be integrated into another system, or some features may be omitted, or not implemented. In addition, the coupling, direct coupling or communication connection between the components shown or discussed may be through some interfaces, and the indirect coupling or communication connection between the devices or units may be electrical, mechanical or other forms.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units; can be located in one place or distributed on a plurality of network units; some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, all functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may be separately regarded as one unit, or two or more units may be integrated into one unit; the integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit.
Those of ordinary skill in the art will understand that: all or part of the steps for realizing the method embodiments can be completed by hardware related to program instructions, the program can be stored in a computer readable storage medium, and the program executes the steps comprising the method embodiments when executed; and the aforementioned storage medium includes: various media that can store program codes, such as a removable Memory device, a Read Only Memory (ROM), a magnetic disk, or an optical disk.
Alternatively, the integrated units described above in the present application may be stored in a computer-readable storage medium if they are implemented in the form of software functional modules and sold or used as independent products. Based on such understanding, the technical solutions of the embodiments of the present application may be embodied in the form of a software product, which 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 embodiments of the present application. And the aforementioned storage medium includes: a removable storage device, a ROM, a magnetic or optical disk, or other various media that can store program code.
The above description is only for the embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (10)

1. A method of backup restore, the method comprising:
in the case of a kernel crash of an operating system, reloading the kernel to restart the operating system;
after the operating system is restarted, acquiring a process snapshot of a pre-backed-up business application;
and restoring the running state of the service application before the kernel crash according to the process snapshot.
2. The method of claim 1, further comprising:
in the operating process of the operating system, acquiring a process snapshot of the service application at intervals of preset duration;
and sending the process snapshot to a server so that the server backs up the process snapshot, wherein the process snapshot of the service application received before is deleted under the condition that the server receives the process snapshot.
3. The method according to claim 2, wherein the obtaining the process snapshot of the service application once every preset time interval comprises:
traversing the process tree directory where the process of the service application is located every interval of the preset duration to acquire sub-process information and thread information in the process tree directory;
freezing the service application, and reading service application information of the service application;
and obtaining the process snapshot of the service application according to the sub-process information, the thread information and the service application information.
4. The method of claim 3, wherein after obtaining the process snapshot of the business application according to the sub-process information, the thread information, and the business application information, the method further comprises:
and releasing the freezing of the business application to restore the running of the business application.
5. The method of claim 3, wherein the restoring the service application to the running state before the kernel crash according to the process snapshot comprises:
analyzing the process snapshot to obtain the sub-process information, the thread information and the service application information;
starting the service application according to the service application information;
and recovering the process tree of the process of the service application according to the sub-process information and the thread information so as to restore the running state of the service application before the kernel crashes.
6. The method of claim 2, further comprising:
determining whether the process of the business application is abnormal or not in the operation of the operating system;
under the condition that the process of the business application is abnormal, stopping acquiring the process snapshot of the business application;
and restarting the business application, wherein under the condition that the business application is restarted and the process of the business application is not abnormal, the process snapshot of the business application is obtained every other preset time.
7. The method of claim 1, further comprising:
and deleting the process snapshot under the condition of restoring the service application to the running state before the kernel crash.
8. A backup restoration apparatus, comprising:
the loading module is used for reloading the kernel of the operating system under the condition that the kernel of the operating system crashes so as to restart the operating system;
the first acquisition module is used for acquiring a process snapshot of a pre-backed-up business application after the restart of the operating system is completed;
and the restoring module is used for restoring the running state of the service application before the kernel crash according to the process snapshot.
9. A backup restoring apparatus, characterized in that the apparatus comprises at least:
a processor; and
a memory for storing a computer program operable on the processor;
wherein the computer program when executed by a processor implements the steps of the backup restoration method of any of claims 1 to 7.
10. A computer-readable storage medium having stored thereon computer-executable instructions configured to perform the steps of the backup-restore method of any of the preceding claims 1 to 7.
CN202010746100.4A 2020-07-29 2020-07-29 Backup restoration method, device and equipment and computer readable storage medium Pending CN114064348A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010746100.4A CN114064348A (en) 2020-07-29 2020-07-29 Backup restoration method, device and equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010746100.4A CN114064348A (en) 2020-07-29 2020-07-29 Backup restoration method, device and equipment and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN114064348A true CN114064348A (en) 2022-02-18

Family

ID=80226848

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010746100.4A Pending CN114064348A (en) 2020-07-29 2020-07-29 Backup restoration method, device and equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN114064348A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116991637A (en) * 2023-09-26 2023-11-03 苏州元脑智能科技有限公司 Operation control method and device of embedded system, electronic equipment and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116991637A (en) * 2023-09-26 2023-11-03 苏州元脑智能科技有限公司 Operation control method and device of embedded system, electronic equipment and storage medium
CN116991637B (en) * 2023-09-26 2024-02-02 苏州元脑智能科技有限公司 Operation control method and device of embedded system, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN109766701B (en) Processing method and device for abnormal process ending operation and electronic device
CN106959866B (en) Log collection client and upgrading method thereof
US20170116084A1 (en) Method and System for Monitoring Virtual Machine Cluster
CN107315656B (en) Multi-kernel embedded PLC software recovery method and PLC
US20080306977A1 (en) System, method and program product for backing up data
CN111324423B (en) Method and device for monitoring processes in container, storage medium and computer equipment
CN110895488B (en) Task scheduling method and device
CN110895487B (en) Distributed task scheduling system
CN110895483A (en) Task recovery method and device
CN110196749B (en) Virtual machine recovery method and device, storage medium and electronic device
US20140140135A1 (en) Storage device, recovery method, and recording medium for recovery program
US10114847B2 (en) Change capture prior to shutdown for later backup
CN114116280A (en) Interactive BMC self-recovery method, system, terminal and storage medium
US7315959B2 (en) Real-time remote backup system and related method
CN115658113A (en) Server self-starting method and device, readable storage medium and electronic equipment
CN110895486A (en) Distributed task scheduling system
US9513983B2 (en) Method for maintaining file system of computer system
CN114064348A (en) Backup restoration method, device and equipment and computer readable storage medium
TWI764454B (en) Firmware corruption recovery
CN117992283A (en) Cloud host backup method and device, computer equipment and storage medium
CN113946471A (en) Distributed file-level backup method and system based on object storage
CN110895485A (en) Task scheduling system
WO2024119787A1 (en) Method and apparatus for amd server system installation power-off processing, device and medium
CN109189487B (en) Restarting method, system and related components of Ceph distributed storage system
JP2005222366A (en) Automatic recovery method, program, program recording medium, processor

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination