WO2017028705A1 - 计算机系统任务备份方法、系统状态恢复方法及其装置 - Google Patents

计算机系统任务备份方法、系统状态恢复方法及其装置 Download PDF

Info

Publication number
WO2017028705A1
WO2017028705A1 PCT/CN2016/094114 CN2016094114W WO2017028705A1 WO 2017028705 A1 WO2017028705 A1 WO 2017028705A1 CN 2016094114 W CN2016094114 W CN 2016094114W WO 2017028705 A1 WO2017028705 A1 WO 2017028705A1
Authority
WO
WIPO (PCT)
Prior art keywords
task
current
incremental
storage device
saved
Prior art date
Application number
PCT/CN2016/094114
Other languages
English (en)
French (fr)
Inventor
吴永军
陶阳宇
陆一峰
李超
张卓
吕志强
李治
Original Assignee
阿里巴巴集团控股有限公司
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 阿里巴巴集团控股有限公司 filed Critical 阿里巴巴集团控股有限公司
Publication of WO2017028705A1 publication Critical patent/WO2017028705A1/zh

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

Definitions

  • the present application relates to a computer backup technology, and in particular, to a computer system task backup method and apparatus.
  • the invention also relates to a computer system state recovery method and apparatus for use with the above computer system task backup method and apparatus.
  • the computer system During the execution of the program, the computer system encounters various errors, and the program needs to be re-executed. In order for the newly started program to resume the unfinished task before the error occurs, all user tasks need to be backed up to non-volatile media. These backed up user tasks are backup tasks. After the new program starts, it will read the backup task from the non-volatile media and restore the state of the last interrupt according to the backup task.
  • the full backup mode is to back up all the user tasks as tasks to the non-volatile media when the user task is updated.
  • the full amount that is, all of the user's tasks, is performed to restore the system to its previous state.
  • Incremental backup mode that is, each time a user task is updated, the user's new task is used to update the task being executed by the system, and then the changed part of the user task is backed up as an incremental task.
  • the initial task, the incremental task one, the incremental task two, and the like are sequentially executed in order, and the system is restored to the previous state.
  • the incremental process cannot be logged. The user process restarts to keep the system running in the same state as the incremental record.
  • Incremental backup mode needs to exit the service restart when the record fails, and neither the existing full backup mode nor the existing incremental backup mode is applicable to complex large systems such as distributed cluster systems.
  • a distributed cluster system consists of a large number of computers. The full or incremental needs to be backed up to a distributed storage system. The path is more complicated and it is easy to generate more errors. Retrying or restarting to correct the error will undoubtedly The reliability of the service provided by the system has a negative impact.
  • the present application provides a computer system task backup method and apparatus to solve the problem that the existing backup method needs to restart the system to maintain synchronization between the system state and the backup tasks.
  • the present application also provides a computer system state recovery method and apparatus for use with the above backup method and apparatus.
  • a computer system task backup method provided by the application includes the following steps:
  • the storage device is a storage device in a distributed storage system.
  • the storage device is a non-volatile storage device.
  • the method for saving the incremental task backup to a storage device as a current incremental task record includes:
  • the identification parameter of the memory task saved in the current system memory is used as the basic identification parameter of the incremental task, and the generated identification parameter identifying the new task of the user is used as the incremental identification parameter of the incremental task, and The incremental task is used as a current incremental task;
  • the incremental identification parameter of the incremental task, the basic identification parameter of the incremental task and the current incremental task form a current incremental task record, and are saved to the storage device; the current incremental task record of multiple backups is performed. It is saved in a manner that can determine the order in which the current incremental task backup is saved.
  • the incremental identification parameter of the incremental task, the basic identification parameter of the incremental task, and the current incremental task form a current incremental task record
  • the method for saving to the storage device includes: The incremental identification parameter of the incremental task, the basic identification parameter of the incremental task and the current incremental task together form a current incremental task record and are saved in a specially set current incremental task record file.
  • the method for updating a memory task saved in a system memory by using the user's new task includes:
  • the generated identification parameter identifying the new task of the user is taken as the identification parameter of the memory task in the current system memory.
  • steps of the basic task backup are included:
  • the method for determining whether the current incremental task record is saved in the storage device includes: determining whether a current incremental task record file is saved in the storage device.
  • the method for saving a memory task backup in the current system memory to the storage device as a current basic task includes:
  • the file in the storage device that saves the current incremental task record and the current basic task is renamed and saved.
  • the method for saving a memory task backup in the current system memory to the storage device as a current basic task includes:
  • the identification parameter and the memory task of the memory task in the current system memory are respectively used as the identification parameters of the current basic task and the current basic task;
  • the identification parameters of the current basic task and the current basic task are combined to form a current basic task record and stored in the storage device.
  • the current basic task record is stored in the storage device by being written into a current basic task record file specifically set in the storage device.
  • the step of backing up the basic task is performed periodically according to the set time interval.
  • the computer system state recovery method provided by the present application is applied to a computer system in a storage device that stores a current basic task record and a current incremental task record, where the current basic task record includes an identification parameter of the current basic task and a current basic task.
  • the current incremental task record includes an incremental identification parameter of the current incremental task, a basic identification parameter, and a current incremental task; and the computer system state recovery method includes the following steps:
  • the final current task is written to the memory as a memory task to achieve recovery of the computer system.
  • the current basic task record and the current incremental task record are respectively saved in a current basic task record file and a current incremental task record file of the storage device;
  • the method for reading a current basic task saved in a storage device includes: reading a current basic task from a current basic task record in a current basic task record file saved in the storage device;
  • the method of reading a valid incremental task in a current incremental task record saved in a storage device includes reading a valid incremental task from a current incremental task record in a current incremental task record file saved in the storage device.
  • the step of combining the valid incremental task in the current incremental task record saved in the storage device with the current basic task to form a final current task includes:
  • the current basic task saved in the storage device is used as the current task, and the current basic task saved in the storage device is used as the current task.
  • the incremental identifier parameter of the valid incremental task is used as the identifier parameter of the current task, and “determine whether a valid incremental task associated with the identifier parameter of the current task is saved in the storage device, and if yes, perform the next step. If not, the step of the method ends.
  • the method for determining whether the valid incremental task associated with the identifier parameter of the current task is saved in the storage device is:
  • Finding whether the basic identification parameter is the same as the identification parameter of the current task, and the time when the backup is saved is the current incremental task that is the time closest to the operation of the computer system state recovery method, and if so, the current increment is The task acts as a valid incremental task associated with the identification parameters of the current task.
  • the current basic task record and the current incremental task record are respectively saved in a current basic task record file and a current incremental task record file of the storage device;
  • the method for searching for the current storage task in the storage device is the same as the identification parameter of the current task, and executing the current incremental task whose time is the closest to the operation of the computer system state recovery method is: searching for the storage device Whether the underlying identification parameter is saved in the current incremental task record in the current incremental log file is the same as the identification parameter of the current task, and the current incremental task whose saving time is closest to the time when the computer system state recovery method operation is performed is executed.
  • the current basic task record and the current incremental task record are respectively saved in a current basic task record file and a current incremental task record file of the storage device;
  • the identification parameter of the current basic task saved in the storage device is used as the identification parameter of the current task, and the current basic task saved in the storage device is used as the current task: the current basic storage in the storage device is The identifier of the current basic task in the current basic task record in the transaction log file is used as the identification parameter of the current task, and the current basic task in the current basic task record in the current basic task record file saved in the storage device is used as the current task;
  • the method for using the incremental identification parameter of the effective incremental task as the identification parameter of the current task is: deleting the current incremental task record in the current incremental task record file saved in the storage device and the identification parameter of the current task The incremental identification parameter of the associated valid incremental task is used as the identification parameter of the current task.
  • a computer system task backup device provided by the application includes:
  • An acquisition unit for acquiring a new task of the user An acquisition unit for acquiring a new task of the user
  • An identifier parameter generating unit configured to generate an identifier parameter that identifies a new task of the user
  • An incremental task generating unit configured to use an difference between the new task of the user and a memory task saved in a current system memory as an incremental task
  • An incremental task saving unit configured to save the incremental task backup to a storage device as a current incremental task
  • the memory task update unit is configured to determine whether the operation of saving the incremental task backup to the storage device as the current incremental task is successful, and if yes, updating the memory task saved in the system memory by using the new task of the user.
  • the method further includes: a basic task backup unit, configured to determine whether the current incremental task record is saved in the storage device, and if yes, save the memory task backup in the current system memory to the storage device as the current basic task.
  • a basic task backup unit configured to determine whether the current incremental task record is saved in the storage device, and if yes, save the memory task backup in the current system memory to the storage device as the current basic task.
  • the computer system state recovery device provided by the present application is applied to a computer system in a storage device that stores a current basic task record and a current incremental task record, where the current basic task record includes an identification parameter of the current basic task and a current basic task.
  • the current incremental task record includes an incremental identification parameter of the current incremental task, a basic identification parameter, and a current incremental task; the device includes:
  • the basic task reading unit is configured to read the current basic task saved in the storage device
  • a merging unit configured to merge a valid incremental task in a current incremental task record saved in the storage device with the current basic task to form a final current task
  • the recovery unit is configured to write the final current task into the memory as a memory task to implement recovery of the computer system.
  • the computer system task backup method provided by the application adopts an incremental task record manner, when the user task changes
  • the incremental task backup is saved to the storage device
  • the incremental task is saved to the storage device.
  • the new user task is used as a new memory task to be executed by the system to update the memory of the computer system. task.
  • the computer system task backup method of the present application only updates the memory task of the computer system with the new memory task required to perform the new memory task as the system provides the service when the part of the user task change is recorded, that is, the incremental task backup is saved successfully. Reducing the existing backup mode When the system memory task is updated first and then the incremental task is saved, the memory task executed by the computer system is inconsistent with the saved task due to the unsuccessful saving of the incremental task. It is time to reduce the number of times the system exits the service restart to synchronize with the saved incremental tasks, which is effective for improving the reliability of the service provided by the system. At the same time, due to the use of incremental backup and storage, the time for system backup to save incremental tasks is reduced, which further improves the reliability of system services.
  • the computer system state recovery method provided by the present application is directed to a computer system in which a current basic task and a current incremental task are stored in the storage device, and the memory task is merged by using the current basic task and the effective incremental task in the current incremental task, and the memory task is used.
  • the formed memory task is capable of restoring the computer system to the state when the most recent valid incremental task backup was saved.
  • the computer system state recovery method only merges the effective incremental task saved in the storage device with the current basic task, which can avoid the problem of recovery error caused by the system's incremental task backup and memory task update being out of synchronization in the prior art. . Achieve error correction.
  • FIG. 1 is a schematic flow chart of a computer system task backup method according to a first embodiment of the present application
  • FIG. 2 is a structural block diagram of a computer system task backup device according to a second embodiment of the present application.
  • FIG. 3 is a schematic flow chart of a computer system state recovery method according to a third embodiment of the present application.
  • FIG. 4 is a block diagram showing the structure of a computer system state recovery device according to a fourth embodiment of the present application.
  • the computer system described in the present application may be a separate computer or a distributed cluster computer system, and the user may be a user or user program of a separate computer, a thread, or a distributed cluster computing. User or user program of the machine system, thread.
  • the first embodiment of the present application provides a computer system task backup method.
  • the schematic flowchart is as shown in FIG. 1 and includes the following steps:
  • Step S101 acquiring a new task of the user.
  • the user task is executed according to the task assigned by the user, and the user may change the user task to be executed in the subsequent step. This step acquires a new task that the user needs to perform the computer system.
  • Step S102 Generate an identification parameter that identifies a new task of the user.
  • the computer system After the computer system obtains the new task of the user, generates an identifier parameter for the task that can uniquely identify the task in the system, that is, the identifier parameter is different from the other tasks in the user identifier parameter in the computer system.
  • the identification parameter can be used to identify the user's current acquisition task.
  • Step S103 the difference between the new task of the user and the memory task saved in the current system memory is used as an incremental task.
  • the computer system performs the user's tasks in memory, and the user tasks saved in the memory are called memory tasks.
  • the memory task can be identified based on the identification parameters of its memory task. After the computer system acquires the user's new task, compares the new task with the user's task saved in the system memory, and finds the new task and the memory task different parts as the user's incremental task.
  • Step S104 Save the incremental task backup to the storage device as the current incremental task record.
  • the computer system uses the identification parameter of the memory task saved in the current system memory as the basic identification parameter of the incremental task, and uses the identification parameter of the new task that identifies the user generated in step S102 as the incremental task.
  • the incremental identification parameter uses the incremental task as the current incremental task.
  • the incremental identification parameter of the incremental task, the basic identification parameter of the incremental task and the current incremental task form a current incremental task record, and the current incremental task record is in accordance with the time sequence of acquiring the new task of the user. Save to storage device.
  • a nonvolatile storage medium can be used as the storage device, an electrically erasable programmable storage device, a device that uses magnetic energy to store information, and an optical storage device. Or a device that uses magneto-optical methods to store information.
  • the electrically erasable programmable storage device includes a solid state hard disk, a flash memory card, and a flash disk; the device for storing information by using a magnetic energy mode includes a hard disk, a floppy disk, a magnetic tape, a magnetic core memory or a magnetic bubble memory; The device for information includes an optical disk; and the device for storing information by magneto-optical means includes a magneto-optical disk.
  • the storage device may be a storage device in a distributed storage system, such as It is a storage device distributed among different computer nodes within a distributed cluster computer system.
  • the currently set task file of the current incremental task is used, that is, the incremental task is increased.
  • the quantity identification parameter, the basic identification parameter of the incremental task and the current incremental task form a current incremental task record, and the current incremental task record is determined according to the order in which the current incremental task backup can be saved.
  • the mode is written to the currently set up incremental task log file.
  • the method for determining the sequence of saving the current incremental task backup may be performed in multiple manners, for example, when generating an identifier parameter for identifying a new task of the user, a method of generating an incremental or decremented digital identification parameter is used; When the task record is recorded, the timestamp parameter is added; or the order in which the current incremental task record is written into the current incremental task record file is set, and the method of sequentially increasing the digital identification parameter, that is, the increment, is used in this embodiment.
  • the current incremental task with a small number of identification parameters is generated earlier than the current incremental task with a larger number of incremental identification parameters.
  • Step S105 Determine whether the operation of saving the incremental task backup to the storage device as the current incremental task record is successful. If yes, the process proceeds to step S106.
  • Step S106 updating the memory task saved in the system memory by using the new task of the user.
  • step S105 performs a corresponding subsequent operation according to the saving of the incremental task to the storage device operation according to step S104.
  • step S105 If the operation of saving the incremental task backup to the storage device as the current incremental task record is not successfully completed for some reason, that is, the determination result of step S105 is NO, the new task of the user is not used. Update memory tasks saved in system memory to keep memory tasks unchanged.
  • the memory task in the system memory is replaced with the new task obtained by the user obtained in step S101, and the identifier parameter of the system memory task is updated to be The identification parameter generated in step S102.
  • the embodiment may further include the step of backing up the basic task, determining whether the current incremental task record is saved in the storage device, and if so, saving the memory task backup in the current system memory to the storage device as the current basic task.
  • this step it is determined whether the current incremental task needs to be saved, and whether the basic task backup needs to be saved again. If there is no current incremental task record, indicating that the memory task has not changed, there is no need to re-backup.
  • the current incremental task is periodically stored according to the set time interval. Record the situation and decide whether to save the memory task backup as the current base task.
  • the specific implementation may determine, according to the manner of the current incremental task record, whether the current incremental task record is saved in the storage device, for example, for saving the incremental task record in the specifically set current incremental task record file.
  • the method may be used to determine whether the corresponding incremental current task record file is saved in the storage device. If not, the operation does not perform any operation to end the backup of the basic task; if yes, the increment saved in the storage device After the task log file is renamed, the backup is saved for reuse when needed. At the same time, if the current basic task is saved in the storage device at this time, the corresponding file of the current basic task is saved and the backup is saved and saved for use when necessary.
  • the identification parameter of the memory task is used as the identification parameter of the new current basic task
  • the memory task is used as the current basic task to form a current basic task record
  • the current basic task record is recorded.
  • the save to the storage device is similar to the save of the current incremental task record, and the current basic task record can be saved to the storage device in various manners, for example, saved to the database, in the embodiment and the first embodiment.
  • the current incremental task is saved in the same way, and is implemented by writing to the current basic task record file specially set in the storage device.
  • the first embodiment of the present application provides a method for backing up a task of a computer system, which not only avoids the situation that the backup task is not synchronized with the system memory task to a certain extent, but also utilizes the incremental identification parameter of the incremental task and The base identification parameter associates the memory task, the current base task, and the current incremental task to achieve fault tolerance.
  • the second embodiment of the present application provides a computer system task backup device. Its structural block diagram is shown in Figure 2. Because the device embodiment is substantially similar to the computer system task backup method in the first embodiment of the present application, the description is relatively simple. For related information, refer to the partial description of the computer system task backup method in the first embodiment of the present application. .
  • One embodiment of a computer system task backup device described below is merely illustrative.
  • the device comprises: an obtaining unit U201, an identification parameter generating unit U202, an incremental task generating unit U203, an incremental task holding unit U204 and a memory task updating unit U205.
  • the obtaining unit U201 is configured to acquire a new task of the user.
  • the identifier parameter generating unit U202 is configured to generate an identifier parameter that identifies a new task of the user.
  • the incremental task generating unit U203 is configured to use the difference between the new task of the user and the memory task saved in the current system memory as an incremental task.
  • the incremental task saving unit U204 is configured to save the incremental task backup to the storage device as a current incremental task.
  • the memory task update unit U205 is configured to determine to save the incremental task backup to a storage device as Whether the operation of the current incremental task is successful, and if so, the memory task saved in the system memory is updated with the new task of the user.
  • the device further includes a basic task backup unit, where the basic task backup unit is configured to determine whether the current incremental task record is saved in the storage device, and if so, save the memory task backup in the current system memory to the storage The device is the current base task.
  • the basic task backup unit is configured to determine whether the current incremental task record is saved in the storage device, and if so, save the memory task backup in the current system memory to the storage The device is the current base task.
  • the third embodiment of the present application provides a method for recovering a state of a computer system, and a schematic flowchart thereof is shown in FIG. 3.
  • the method can be applied to the current basic task record and the current incremental task record stored in the storage device after the task is backed up.
  • the computer system, the current basic task record includes an identification parameter of the current basic task and a current basic task, and the current incremental task record includes an incremental identification parameter of the current incremental task, a basic identification parameter, and a current incremental task;
  • the computer system state recovery method includes the following steps:
  • Step S301 reading the current basic task saved in the storage device.
  • the method of reading the basic task may be different according to the manner in which the backup uses the current basic task.
  • the current basic task saved in the database mode can be read from the corresponding database; in this embodiment, the current basic task is saved by using the current basic task record file backup, and the current basic task record file saved from the storage device is used. Read the current base task in the current base task record.
  • Step S302 Combine the effective incremental task in the current incremental task record saved in the storage device with the current basic task to form a final current task.
  • the storage device may hold more than one current incremental task, and some of the current incremental tasks are saved in the backup, and for various reasons, the users of the current incremental tasks are originated.
  • the new task is not synchronized with the in-memory memory task, which causes the current incremental task of the new task from the user not synchronized to the system memory task to be executed by the system, and should not be performed during system recovery. Consolidate these tasks that are not performed by the system with the current underlying tasks.
  • the current incremental task generated by the new task of the user synchronized to the system memory task is called the effective incremental task. This step combines the effective incremental task with the current basic task to form the final current task.
  • the identifier of the current basic task saved in the storage device is used as the identifier of the current task, and the current basic task saved in the storage device is used as the current task.
  • the storage device searches for a current incremental task that meets the search condition, where the search condition is: the basic identifier parameter of the current incremental task in the current incremental task record file saved in the storage device is the same as the identifier parameter of the current task, and is executed.
  • the backup is saved for the current incremental task that is closest to the current state recovery operation.
  • the corresponding time is used to determine the time sequence in which the current incremental task performs backup storage.
  • the sequence of saving the current incremental task backup is represented by a sequentially increasing number identification parameter, that is, the number of the incremental identification parameter is smaller than the number of the incremental identification parameter.
  • the current incremental task is generated earlier. Therefore, in this step, according to the incremental identification parameter of the current incremental task, it can be determined that the time for performing the backup save is far from the current state recovery operation.
  • the current incremental task is merged with the current task as a valid incremental task.
  • the merged task is used as the current task, and the incremental identifier of the valid incremental task is identified.
  • the parameter is used as the new identification parameter of the current task, and returns to perform the operation of "find the current incremental task that meets the search condition on the storage device" until there is no current incremental task in the storage device that meets the search condition, if the storage device does not There is such a current incremental task, indicating that all valid tasks of the system backup have been merged with the current task.
  • the current task is taken as the final current task, and the current step S302 is ended, and the next step S303 is continued.
  • step S303 the current task is written into the memory as a memory task to implement recovery of the computer system.
  • the final current task obtained in the previous step is saved to the memory as a memory task, and the computer system executes the memory task to realize the recovery of the computer system to the backup save time.
  • the effective time is the latest time to perform the current state recovery operation. The status of the task backup when it was saved.
  • the foregoing third embodiment provides a computer system state recovery method, which is capable of restoring the system to the state when the most recent backup saves the effective incremental task according to the current basic task and the current incremental task.
  • the method can avoid the problem of automatic error correction caused by the existing incremental backup mode due to the problem of recovery error caused by the system's incremental task backup and memory task update being out of sync.
  • the fourth embodiment of the present application provides a computer system state recovery device. Its structural block diagram is shown in Figure 4. Because the device embodiment is substantially similar to the computer system state recovery method in the third embodiment of the present application, the description is relatively simple. For related parts, refer to the partial description of the computer system state recovery method in the third embodiment of the present application. .
  • One embodiment of a computer system state recovery device described below is merely illustrative.
  • the computer system state recovery device is applied to a computer system in a storage device that stores a current basic task record and a current incremental task record, where the current basic task record includes an identification parameter of the current basic task and a current basic task, and the current increase is performed.
  • the quantity task record includes an incremental identification parameter of the current incremental task, a basic identification parameter and a current incremental task; the device comprises: a basic task reading unit U401, a merging unit U402 and a recovery unit U403.
  • the basic task reading unit U401 is configured to read a current basic task saved in the storage device.
  • the merging unit U402 is configured to merge the valid incremental task in the current incremental task record saved in the storage device with the current basic task to form a final current task.
  • the recovery unit U403 is configured to write the final current task into a memory as a memory task to implement recovery of the computer system.
  • a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
  • processors CPUs
  • input/output interfaces network interfaces
  • memory volatile and non-volatile memory
  • the memory may include non-persistent memory, random access memory (RAM), and/or non-volatile memory in a computer readable medium, such as read only memory (ROM) or flash memory.
  • RAM random access memory
  • ROM read only memory
  • Memory is an example of a computer readable medium.
  • Computer readable media including both permanent and non-persistent, removable and non-removable media may be implemented by any method or technology.
  • the information can be computer readable instructions, data structures, modules of programs, or other data.
  • Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory. (ROM), electrically erasable programmable read only memory (EEPROM), flash memory or other memory technology, compact disk read only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, Magnetic tape cartridges, magnetic tape storage or other magnetic storage devices or any other non-transportable media can be used to store information that can be accessed by a computing device.
  • computer readable media does not include non-transitory computer readable media, such as modulated data signals and carrier waves.
  • embodiments of the present application can be provided as a method, system, or computer program product.
  • the present application can take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment in combination of software and hardware.
  • the application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) including computer usable program code.

Abstract

一种计算机系统任务备份方法和装置,以及计算机系统状态恢复方法和装置。所述计算机系统任务备份方法包括以下步骤:获取用户的新的任务(S101);生成标识该用户的新的任务的标识参数(S102);将所述用户的新的任务与当前系统内存中保存的内存任务的差别作为增量任务(S103);将所述增量任务备份保存到存储设备中作为当前增量任务记录(S104);判断将所述增量任务备份保存到存储设备中作为当前增量任务记录的操作是否成功(S105),若是,则采用所述用户的新的任务更新系统内存中保存的内存任务(S106)。采用所述备份方法,能够避免备份的任务和系统内存中的任务不同步。

Description

计算机系统任务备份方法、系统状态恢复方法及其装置
本申请要求2015年08月18日递交的申请号为201510509539.4、发明名称为“计算机系统任务备份方法、系统状态恢复方法及其装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及一种计算机备份技术,尤其是涉及一种计算机系统任务备份方法和装置。本发明同时还涉及一种与上述计算机系统任务备份方法和装置配合使用的计算机系统状态恢复方法和装置。
背景技术
计算机系统在程序执行过程中,会遇到各种错误,进而程序需要被重新执行。为了让新启动的程序能够恢复发生错误前的状态继续未完成的任务,需要把所有用户任务备份到非易失的介质上,这些备份下来的用户任务为备份任务。新程序启动后会从非易失介质中读入备份任务,并根据备份任务恢复上次中断时的状态。
目前现有的常见的备份用户任务的方式有全量备份方式和增量备份方式。
全量备份方式就是用户任务更新时,把用户所有任务作为任务备份到非易失介质中。进行状态恢复时,执行全量即用户的所有任务以将系统恢复到以前的状态。
增量备份方式,即每次用户任务更新时,先用用户新的任务更新系统正在执行的任务,再将用户任务中发生变化的部分作为增量任务备份下来。进行状态恢复时,按顺序依次执行初始任务,增量任务一,增量任务二等等,将系统恢复到以前的状态。当备份增量的过程发生错误无法记录增量任务时,用户进程重启以保持系统运行状态与增量记录的一致。
可见,全量备份方式,系统恢复更新时间比较长,影响到用户调用的响应速度。增量备份的方式在记录发生故障时,需要退出服务重启,并且,无论是现有的全量备份方式还是现有的增量备份方式都不适用于复杂的大型系统如分布式集群系统。分布式的集群系统由大量的计算机组成,全量或增量需要被备份到分布式存储系统,路径更加复杂,容易产生更多的错误,而采用重试或重新启动的方式来纠正错误无疑会对系统提供服务的可靠性造成负面的影响。
发明内容
本申请提供一种计算机系统任务备份方法和装置,以解决现有备份方法需要重启系统以保持系统状态和备份的任务间同步的问题。此外,本申请还提供一种与上述备份方法和装置配合使用的计算机系统状态恢复方法和装置。
本申请提供的一种计算机系统任务备份方法,包括以下步骤:
获取用户的新的任务;
生成标识该用户的新的任务的标识参数;
将所述用户的新的任务与当前系统内存中保存的内存任务的差别作为增量任务;
将所述增量任务备份保存到存储设备中作为当前增量任务记录;
判断将所述增量任务备份保存到存储设备中作为当前增量任务记录的操作是否成功;若是,则采用所述用户的新的任务更新系统内存中保存的内存任务。
可选地,所述存储设备为分布式存储系统内的存储设备。
可选地,所述存储设备为非易失存储设备。
可选地,所述将所述增量任务备份保存到存储设备中作为当前增量任务记录的方法包括:
将当前系统内存中保存的内存任务的标识参数作为该增量任务的基础标识参数,将所述生成的标识该用户的新的任务的标识参数作为所述增量任务的增量标识参数,将所述增量任务作为当前增量任务;
将所述增量任务的增量标识参数,增量任务的基础标识参数和所述当前增量任务一起形成一条当前增量任务记录,保存到存储设备中;多次备份的当前增量任务记录按照能够判断所述当前增量任务备份保存的先后顺序的方式保存。
可选地,所述将所述增量任务的增量标识参数,增量任务的基础标识参数和所述当前增量任务一起形成一条当前增量任务记录,保存到存储设备中的方法包括:将所述增量任务的增量标识参数,增量任务的基础标识参数和所述当前增量任务一起形成一条当前增量任务记录保存在专门设置的当前增量任务记录文件中。
可选地,所述采用所述用户的新的任务更新系统内存中保存的内存任务的方法包括:
将用户的新的任务保存为当前系统内存中的内存任务;
将生成的标识该用户的新的任务的标识参数作为当前系统内存中的内存任务的标识参数。
可选地,包括基础任务备份的步骤:
判断存储设备中是否保存有当前增量任务记录;若是,则将当前系统内存中的内存任务备份保存到存储设备中作为当前基础任务。
可选地,所述判断存储设备中是否保存有当前增量任务记录的方法包括:判断存储设备中是否保存有当前增量任务记录文件。
可选地,所述将当前系统内存中的内存任务备份保存到存储设备中作为当前基础任务的方法包括:
将存储设备中保存当前增量任务记录和当前基础任务的文件重命名后备份保存;
将当前系统内存中的内存任务备份保存到存储设备中作为当前基础任务。
可选地,所述将当前系统内存中的内存任务备份保存到存储设备中作为当前基础任务的方法包括:
将当前系统内存中的内存任务的标识参数与内存任务分别作为当前基础任务的标识参数和当前基础任务;
将当前基础任务的标识参数和当前基础任务一起形成一条当前基础任务记录存储到存储设备中。
可选地,所述当前基础任务记录存储到存储设备中,是通过写入到存储设备中专门设置的当前基础任务记录文件中实现的。
可选地,所述基础任务备份的步骤按照设定的时间间隔周期性执行。
本申请提供的一种计算机系统状态恢复方法,应用于存储设备中保存有当前基础任务记录和当前增量任务记录的计算机系统,所述当前基础任务记录包括当前基础任务的标识参数和当前基础任务,所述当前增量任务记录包括当前增量任务的增量标识参数,基础标识参数和当前增量任务;所述计算机系统状态恢复方法包括以下步骤:
读取存储设备中保存的当前基础任务;
将存储设备中保存的当前增量任务记录中的有效增量任务与所述当前基础任务合并形成最终当前任务;
将所述最终当前任务写入内存作为内存任务,实现对计算机系统的恢复。
可选地,所述当前基础任务记录和当前增量任务记录分别保存在存储设备的当前基础任务记录文件和当前增量任务记录文件中;
所述读取存储设备中保存的当前基础任务的方法包括:从存储设备中保存的当前基础任务记录文件中的当前基础任务记录中读取当前基础任务;
所述读取存储设备中保存的当前增量任务记录中的有效增量任务的方法包括从存储设备中保存的当前增量任务记录文件中的当前增量任务记录中读取有效增量任务。
可选地,所述将存储设备中保存的当前增量任务记录中的有效增量任务与所述当前基础任务合并形成最终当前任务的步骤包括:
将存储设备中保存的当前基础任务的标识参数作为当前任务的标识参数,将存储设备中保存的当前基础任务作为当前任务;
判断存储设备中是否保存有与当前任务的标识参数相关联的有效增量任务,若否,将此时获得的当前任务作为所述最终当前任务,并结束该形成最终当前任务的步骤;若是,将所述有效增量任务与所述当前任务合并,再将合并后的任务作为当前任务;
将所述有效增量任务的增量标识参数作为当前任务的标识参数,执行“判断存储设备中是否保存有与当前任务的标识参数相关联的有效的增量任务,若是,则执行下一步骤,若否,则结束本方法”的步骤。
可选地,所述判断存储设备中是否保存有与当前任务的标识参数相关联的有效增量任务的方法为:
查找存储设备中是否保存有基础标识参数与当前任务的标识参数相同,且执行备份保存的时间距离执行本计算机系统状态恢复方法操作的时间最近的当前增量任务,若是,则将该当前增量任务作为与当前任务的标识参数相关联的有效增量任务。
可选地,
所述当前基础任务记录和当前增量任务记录分别保存在存储设备的当前基础任务记录文件和当前增量任务记录文件中;
所述查找存储设备中是否保存有基础标识参数与当前任务的标识参数相同,且执行保存时间距离执行本计算机系统状态恢复方法操作的时间最近的当前增量任务的方法为:查找存储设备中保存的当前增量记录文件中的当前增量任务记录中是否保存有基础标识参数与当前任务的标识参数相同,且执行保存时间距离执行本计算机系统状态恢复方法操作的时间最近的当前增量任务。
可选地,
所述当前基础任务记录和当前增量任务记录分别保存在存储设备的当前基础任务记录文件和当前增量任务记录文件中;
所述将存储设备中保存的当前基础任务的标识参数作为当前任务的标识参数,将存储设备中保存的当前基础任务作为当前任务的方法为:将存储设备中保存的当前基础任 务记录文件中的当前基础任务记录中的当前基础任务的标识参数作为当前任务的标识参数,将存储设备中保存的当前基础任务记录文件中的当前基础任务记录中的当前基础任务作为当前任务;
所述将所述有效增量任务的增量标识参数作为当前任务的标识参数的方法为:将存储设备中保存的当前增量任务记录文件中的当前增量任务记录中与当前任务的标识参数相关联的有效增量任务的增量标识参数作为当前任务的标识参数。
本申请提供的一种计算机系统任务备份装置,包括:
获取单元,用于获取用户的新的任务;
标识参数生成单元,用于生成标识该用户的新的任务的标识参数;
增量任务生成单元,用于将所述用户的新的任务与当前系统内存中保存的内存任务的差别作为增量任务;
增量任务保存单元,用于将所述增量任务备份保存到存储设备中作为当前增量任务;
内存任务更新单元,用于判断将所述增量任务备份保存到存储设备中作为当前增量任务的操作是否成功,若是,则采用所述用户的新的任务更新系统内存中保存的内存任务。
可选地,还包括:基础任务备份单元,用于判断存储设备中是否保存有当前增量任务记录,若是,则将当前系统内存中的内存任务备份保存到存储设备中作为当前基础任务。
本申请提供的一种计算机系统状态恢复装置,应用于存储设备中保存有当前基础任务记录和当前增量任务记录的计算机系统,所述当前基础任务记录包括当前基础任务的标识参数和当前基础任务,所述当前增量任务记录包括当前增量任务的增量标识参数,基础标识参数和当前增量任务;所述装置包括:
基础任务读取单元,用于读取存储设备中保存的当前基础任务;
合并单元,用于将存储设备中保存的当前增量任务记录中的有效增量任务与所述当前基础任务合并形成最终当前任务;
恢复单元,用于将所述最终当前任务写入内存作为内存任务,实现对计算机系统的恢复。
与现有技术相比,本申请具有以下优点:
本申请提供的计算机系统任务备份方法采用增量任务记录的方式,当用户任务变化 时,先将用户任务变化的部分即增量任务备份保存到存储设备,当增量任务保存成功后,再用新的用户任务作为系统提供服务所需执行的新的内存任务更新计算机系统的内存任务。
本申请的计算机系统任务备份方法仅当记录用户任务变化的部分即增量任务备份保存成功时才用新的用户任务作为系统提供服务所需执行的新的内存任务更新计算机系统的内存任务,有效减少现有备份方式先更新系统的内存任务而后保存增量任务的时候,由于保存增量任务不成功而导致的计算机系统执行的内存任务与保存的任务不一致的情况。减少系统退出服务重启以和保存的增量任务同步的次数是时间,达到提高系统提供服务的可靠性的效果。同时由于采用增量备份保存的方式,减少了系统备份保存增量任务的时间,起到进一步提高系统服务可靠性的作用。
本申请提供的计算机系统状态恢复方法针对存储设备中保存有当前基础任务和当前增量任务的计算机系统,利用所述当前基础任务和当前增量任务中的有效增量任务合并形成内存任务,用形成的内存任务能够将所述计算机系统恢复到最近一个有效增量任务备份保存时的状态。
所述计算机系统状态恢复方法仅将存储设备中保存的有效增量任务与当前基础任务合并,能够避免现有技术中因为系统的增量任务备份与内存任务更新不同步所导致的恢复错误的问题。达到纠错的效果。
附图说明
图1是本申请第一实施例的一种计算机系统任务备份方法的流程示意图;
图2是本申请第二实施例的一种计算机系统任务备份装置的结构框图;
图3是本申请第三实施例的一种计算机系统状态恢复方法的流程示意图;
图4是本申请第四实施例的一种计算机系统状态恢复装置的结构框图。
具体实施方式
在下面的描述中阐述了很多具体细节以便于充分理解本申请。但是本申请能够以很多不同于在此描述的其它方式来实施,本领域技术人员可以在不违背本申请内涵的情况下做类似推广,因此本申请不受下面公开的具体实施的限制。
本申请所述的计算机系统既可以是单独的计算机,也可以是分布式集群计算机系统,所述的用户既可以是单独的计算机的用户或用户程序,线程,也可以是分布式集群计算 机系统的用户或用户程序,线程。
本申请的第一实施例提供一种计算机系统任务备份方法,流程示意图如图1所示,包括以下步骤:
步骤S101,获取用户的新的任务。
计算机系统在运行时,会根据用户下达的任务执行用户任务,而用户在后续有可能会改变其要执行的用户任务,本步骤获取到用户需要计算机系统执行的新的任务。
步骤S102,生成标识该用户的新的任务的标识参数。
计算机系统获取到用户的新的任务后,为该任务生成一个在系统内能够唯一标识该任务的标识参数,也即该标识参数在所述计算机系统内的该用户标识参数中不同于其他的任务的标识参数,能够用于识别该用户的本次获取的任务。
步骤S103,将所述用户的新的任务与当前系统内存中保存的内存任务的差别作为增量任务。
计算机系统在内存中执行用户的任务,内存中保存的用户任务称为内存任务。所述内存任务能够根据其内存任务的标识参数被识别出来。所述计算机系统获取得用户的新的任务后,将新的任务与系统内存中保存的该用户的任务相比较,将新任务与内存任务不相同的部分找出来,作为用户的增量任务。
步骤S104,将所述增量任务备份保存到存储设备中作为当前增量任务记录。
所述计算机系统将当前系统内存中保存的内存任务的标识参数作为该增量任务的基础标识参数,将在步骤S102中生成的标识该用户的新的任务的标识参数作为所述增量任务的增量标识参数,将所述增量任务作为当前增量任务。
将所述增量任务的增量标识参数,增量任务的基础标识参数和所述当前增量任务一起形成一条当前增量任务记录,将当前增量任务记录按照获取用户的新任务的时间顺序保存到存储设备。
为了保证备份的可靠性,从存储介质角度考虑,可以采用非易失存储介质作为存储设备,可以为电可擦除可编程存储设备,利用磁能方式存储信息的设备,利用光学方式存储信息的设备或利用磁光方式存储信息的设备。
所述电可擦除可编程存储设备包括固态硬盘,闪存卡,闪存盘;所述利用磁能方式存储信息的设备包括硬盘,软盘、磁带、磁芯存储器或磁泡存储器;所述利用光学方式存储信息的设备包括光盘;所述利用磁光方式存储信息的设备包括磁光盘。
从存储设备的位置考虑,所述存储设备可以是分布式存储系统内的存储设备,如可 以是分布式集群计算机系统内的分布于不同计算机节点的存储设备。
将当前增量任务记录保存到存储设备的方法可以有多种,如利用数据库存储当前任务记录,本实施例中采用专门设置的当前增量任务记录文件的方式,即将所述增量任务的增量标识参数,增量任务的基础标识参数和所述当前增量任务一起形成一条当前增量任务记录,将这条当前增量任务记录按照能够判断所述当前增量任务备份保存的先后顺序的方式写入专门设置的当前增量任务记录文件中。
所述能够判断所述当前增量任务备份保存的先后顺序的方式可以有多种,例如生成标识该用户的新的任务的标识参数时采用生成递增或递减的数字标识参数的方式;保存当前增量任务记录时,增加时间戳参数;或者设定当前增量任务记录写入当前增量任务记录文件时的顺序等方式,本实施例中采用依次递增的数字标识参数的方式,也即增量标识参数的数字小的当前增量任务比增量标识参数的数字大的当前增量任务更早生成。
步骤S105,判断将所述增量任务备份保存到存储设备中作为当前增量任务记录的操作是否成功。若是,则进入步骤S106。
步骤S106,采用所述用户的新的任务更新系统内存中保存的内存任务。
以上步骤S105根据步骤S104所述的将增量任务保存到存储设备操作成功与否进行相应的后续操作。
若步骤S104所述的将增量任务备份保存到存储设备中作为当前增量任务记录的操作由于某种原因没有成功完成,即步骤S105的判断结果为否,则不用所述用户的新的任务更新系统内存中保存的内存任务,保持内存任务不变。
当计算机系统将增量任务保存到存储设备的相关操作都成功完成后,用步骤S101中获取得到的用户的新的任务替换系统内存中的内存任务,并且将系统内存任务的标识参数更新为在步骤S102中生成的标识参数。
优选地,本实施例还可以包括基础任务备份的步骤,判断存储设备中是否保存有当前增量任务记录,若是,则将当前系统内存中的内存任务备份保存到存储设备中作为当前基础任务。
本步骤中,通过判断是否保存有当前增量任务,确定是否需要重新保存基础任务备份,如果没有当前增量任务记录,说明内存任务没有变化,则无需重新备份。通过定期实施本步骤,本优选方案中除了将用户的增量任务备份保存到存储设备,并更新内存任务外,还按照设定的时间间隔周期性地根据存储设备中是否保存有当前增量任务记录的情况,决定是否将内存任务备份保存为当前基础任务。
具体实施可以根据当前增量任务记录的方式,采用相应的方式判断存储设备中是否保存有当前增量任务记录,例如,对于将增量任务记录保存在专门设置的当前增量任务记录文件中的方式,可以判断存储设备中是否保存有相应的专门设置的当前增量任务记录文件,若否,则不执行任何操作结束本基础任务备份的步骤;若是,则将存储设备中保存的该增量任务记录文件重命名后备份保存以备需要时再用。同时如果存储设备中此时保存有当前基础任务,则将保存当前基础任务的相应文件重命名后备份保存以备需要时再用。
将当前增量任务记录和当前基础任务备份保存后,将内存任务的标识参数作为新的当前基础任务的标识参数,将内存任务作为当前基础任务形成一条当前基础任务记录,将该当前基础任务记录保存到存储设备中,与当前增量任务记录的保存类似,将该当前基础任务记录保存到存储设备中的方式也可以有多种,如,保存到数据库,本实施例中与实施例一中当前增量任务保存的方式一致,通过写入到存储设备中专门设置的当前基础任务记录文件中实现。
本申请的第一实施例提供了一种计算机系统任务备份的方法,该方法不仅能够在一定程度上避免备份的任务与系统内存任务不同步的情况,更利用增量任务的增量标识参数和基础标识参数将内存任务,当前基础任务和当前增量任务关联起来,达到容错的效果。
与之相对应的,本申请第二实施例提供一种计算机系统任务备份装置。其结构框图如图2所示。由于该装置实施例基本相似于本申请第一实施例一种计算机系统任务备份方法,所以描述得比较简单,相关之处参见本申请第一实施例一种计算机系统任务备份方法的部分说明即可。下述描述的一种计算机系统任务备份装置实施例仅仅是示意性的。
该装置包括:获取单元U201,标识参数生成单元U202,增量任务生成单元U203,增量任务保存单元U204和内存任务更新单元U205。
所述获取单元U201,用于获取用户的新的任务。
所述标识参数生成单元U202,用于生成标识该用户的新的任务的标识参数。
所述增量任务生成单元U203,用于将所述用户的新的任务与当前系统内存中保存的内存任务的差别作为增量任务。
所述增量任务保存单元U204,用于将所述增量任务备份保存到存储设备中作为当前增量任务。
所述内存任务更新单元U205,用于判断将所述增量任务备份保存到存储设备中作为 当前增量任务的操作是否成功,若是,则采用所述用户的新的任务更新系统内存中保存的内存任务。
可选地,该装置还包括基础任务备份单元,所述基础任务备份单元,用于判断存储设备中是否保存有当前增量任务记录,若是,则将当前系统内存中的内存任务备份保存到存储设备中作为当前基础任务。
本申请第三实施例提供一种计算机系统状态恢复的方法,其流程示意图如图3所示,该方法能够适用于经过任务备份后,存储设备中保存有当前基础任务记录和当前增量任务记录的计算机系统,所述当前基础任务记录包括当前基础任务的标识参数和当前基础任务,所述当前增量任务记录包括当前增量任务的增量标识参数,基础标识参数和当前增量任务;该计算机系统状态恢复方法包括以下步骤:
步骤S301,读取存储设备中保存的当前基础任务。
当计算机系统需要进行状态恢复时,首先从系统的存储设备读入此前备份保存的当前基础任务,读入基础任务的方法根据备份存储当前基础任务时所采用的方式的不同可以有多种,对于采用数据库方式备份保存的当前基础任务,可以从相应的数据库中读取;本实施例中针对采用当前基础任务记录文件备份保存当前基础任务的情况,从存储设备中保存的当前基础任务记录文件中的当前基础任务记录中读出当前基础任务。
步骤S302,将存储设备中保存的当前增量任务记录中的有效增量任务与所述当前基础任务合并形成最终当前任务。
所述的计算机系统进行增量任务备份后,存储设备中可能保有不止一个的当前增量任务,其中有一些当前增量任务在备份保存时,由于种种原因,这些当前增量任务所来源的用户的新的任务并没有与内存中的内存任务保持同步,这导致来源于未同步到系统内存任务的用户的新的任务的当前增量任务不会被系统所执行,在进行系统恢复时不应该将这些不会被系统执行的任务与当前基础任务合并。那些同步到系统内存任务的用户的新的任务所产生的,应该被系统执行的当前增量任务称为有效增量任务,本步骤将有效增量任务与当前基础任务合并形成最终当前任务。
本步骤中先将存储设备中保存的当前基础任务的标识参数作为当前任务的标识参数,将存储设备中保存的当前基础任务作为当前任务。
在存储设备查找符合查找条件的当前增量任务,所述查找条件为:存储设备中保存的当前增量任务记录文件中的当前增量任务的基础标识参数与当前任务的标识参数相同,并且执行备份保存的时间距离当前进行状态恢复操作的时间最近的当前增量任务。
具体判断执行备份保存的时间距离当前时间远近的方法可以有多种方案。与所述当前增量任务备份保存的先后顺序的具体方式相对应,采取相应的方式判断所述当前增量任务执行备份保存的时间顺序。在被实施例中,当前增量任务备份保存的先后顺序采用依次递增的数字标识参数的方式来表示,也即增量标识参数的数字小的当前增量任务比增量标识参数的数字大的当前增量任务更早生成。所以本步骤中根据当前增量任务的增量标识参数能够判断出执行备份保存的时间距离当前进行状态恢复操作的时间远近。
若找到这样的当前增量任务,则将该当前增量任务作为一个有效增量任务与当前任务进行合并,合并后,将合并后的任务作为当前任务,将该有效增量任务的增量标识参数作为当前任务的新的标识参数,返回执行“在存储设备查找符合查找条件的当前增量任务”的操作,直到在存储设备中不存在符合查找条件的当前增量任务,若存储设备中不存在这样的当前增量任务,表明系统备份的在所有有效任务都已经与当前任务合并完成,此时,将当前任务作为所述最终当前任务,并结束当前步骤S302,继续执行下一步骤S303。
步骤S303,将所述当前任务写入内存作为内存任务,实现对计算机系统的恢复。
将在前一步骤中得到的最终当前任务保存到内存中作为内存任务,计算机系统执行该内存任务能够实现将计算机系统恢复到备份保存的时间距离执行当前状态恢复操作的时间最近的一个有效增量任务备份保存时的状态。
上述第三实施例提供一种计算机系统状态恢复方法,能够根据当前基础任务和当前增量任务将系统恢复到最近一次备份保存有效增量任务时的状态。该方法能够避免现有的增量备份方式因为系统的增量任务备份与内存任务更新不同步所导致的恢复错误的问题,达到自动纠错的效果。
与之相对应的,本申请第四实施例提供一种计算机系统状态恢复装置。其结构框图如图4所示。由于该装置实施例基本相似于本申请第三实施例一种计算机系统状态恢复方法,所以描述得比较简单,相关之处参见本申请第三实施例一种计算机系统状态恢复方法的部分说明即可。下述描述的一种计算机系统状态恢复装置实施例仅仅是示意性的。
所述计算机系统状态恢复装置应用于存储设备中保存有当前基础任务记录和当前增量任务记录的计算机系统,所述当前基础任务记录包括当前基础任务的标识参数和当前基础任务,所述当前增量任务记录包括当前增量任务的增量标识参数,基础标识参数和当前增量任务;所述装置包括:基础任务读取单元U401,合并单元U402和恢复单元U403。
所述基础任务读取单元U401,用于读取存储设备中保存的当前基础任务。
所述合并单元U402,用于将存储设备中保存的当前增量任务记录中的有效增量任务与所述当前基础任务合并形成最终当前任务。
所述恢复单元U403,用于将所述最终当前任务写入内存作为内存任务,实现对计算机系统的恢复。
本申请虽然以较佳实施例公开如上,但其并不是用来限定本申请,任何本领域技术人员在不脱离本申请的精神和范围内,都可以做出可能的变动和修改,因此本申请的保护范围应当以本申请权利要求所界定的范围为准。
在一个典型的配置中,计算设备包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存。
内存可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。内存是计算机可读介质的示例。
1、计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括非暂存电脑可读媒体(transitory media),如调制的数据信号和载波。
2、本领域技术人员应明白,本申请的实施例可提供为方法、系统或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。

Claims (21)

  1. 一种计算机系统任务备份方法,其特征在于,包括以下步骤:
    获取用户的新的任务;
    生成标识该用户的新的任务的标识参数;
    将所述用户的新的任务与当前系统内存中保存的内存任务的差别作为增量任务;
    将所述增量任务备份保存到存储设备中作为当前增量任务记录;
    判断将所述增量任务备份保存到存储设备中作为当前增量任务记录的操作是否成功;若是,则采用所述用户的新的任务更新系统内存中保存的内存任务。
  2. 根据权利要求1所述的计算机系统任务备份方法,其特征在于,所述存储设备为分布式存储系统内的存储设备。
  3. 根据权利要求1所述的计算机系统任务备份方法,其特征在于,所述存储设备为非易失存储设备。
  4. 根据权利要求1所述的计算机系统任务备份方法,其特征在于,所述将所述增量任务备份保存到存储设备中作为当前增量任务记录的方法包括:
    将当前系统内存中保存的内存任务的标识参数作为该增量任务的基础标识参数,将所述生成的标识该用户的新的任务的标识参数作为所述增量任务的增量标识参数,将所述增量任务作为当前增量任务;
    将所述增量任务的增量标识参数,增量任务的基础标识参数和所述当前增量任务一起形成一条当前增量任务记录,保存到存储设备中;多次备份的当前增量任务记录按照能够判断所述当前增量任务备份保存的先后顺序的方式保存。
  5. 根据权利要求4所述的计算机系统任务备份方法,其特征在于,所述将所述增量任务的增量标识参数,增量任务的基础标识参数和所述当前增量任务一起形成一条当前增量任务记录,保存到存储设备中的方法包括:将所述增量任务的增量标识参数,增量任务的基础标识参数和所述当前增量任务一起形成一条当前增量任务记录保存在专门设置的当前增量任务记录文件中。
  6. 根据权利要求1所述的计算机系统任务备份方法,其特征在于,所述采用所述用户的新的任务更新系统内存中保存的内存任务的方法包括:
    将用户的新的任务保存为当前系统内存中的内存任务;
    将生成的标识该用户的新的任务的标识参数作为当前系统内存中的内存任务的标识参数。
  7. 根据权利要求1所述的计算机系统任务备份方法,其特征在于,包括基础任务备份的步骤:
    判断存储设备中是否保存有当前增量任务记录;若是,则将当前系统内存中的内存任务备份保存到存储设备中作为当前基础任务。
  8. 根据权利要求7所述的计算机系统任务备份方法,其特征在于,所述判断存储设备中是否保存有当前增量任务记录的方法包括:判断存储设备中是否保存有当前增量任务记录文件。
  9. 根据权利要求7所述的计算机系统任务备份方法,其特征在于,所述将当前系统内存中的内存任务备份保存到存储设备中作为当前基础任务的方法包括:
    将存储设备中保存当前增量任务记录和当前基础任务的文件重命名后备份保存;
    将当前系统内存中的内存任务备份保存到存储设备中作为当前基础任务。
  10. 根据权利要求9所述的计算机系统任务备份方法,其特征在于,所述将当前系统内存中的内存任务备份保存到存储设备中作为当前基础任务的方法包括:
    将当前系统内存中的内存任务的标识参数与内存任务分别作为当前基础任务的标识参数和当前基础任务;
    将当前基础任务的标识参数和当前基础任务一起形成一条当前基础任务记录存储到存储设备中。
  11. 根据权利要求10所述的计算机系统任务备份方法,其特征在于,所述当前基础任务记录存储到存储设备中,是通过写入到存储设备中专门设置的当前基础任务记录文件中实现的。
  12. 根据权利要求7所述的计算机系统任务备份方法,其特征在于,所述基础任务备份的步骤按照设定的时间间隔周期性执行。
  13. 一种计算机系统状态恢复方法,其特征在于,应用于存储设备中保存有当前基础任务记录和当前增量任务记录的计算机系统,所述当前基础任务记录包括当前基础任务的标识参数和当前基础任务,所述当前增量任务记录包括当前增量任务的增量标识参数,基础标识参数和当前增量任务;所述计算机系统状态恢复方法包括以下步骤:
    读取存储设备中保存的当前基础任务;
    将存储设备中保存的当前增量任务记录中的有效增量任务与所述当前基础任务合并形成最终当前任务;
    将所述最终当前任务写入内存作为内存任务,实现对计算机系统的恢复。
  14. 根据权利要求13所述的计算机系统状态恢复方法,其特征在于,所述当前基础任务记录和当前增量任务记录分别保存在存储设备的当前基础任务记录文件和当前增量任务记录文件中;
    所述读取存储设备中保存的当前基础任务的方法包括:从存储设备中保存的当前基础任务记录文件中的当前基础任务记录中读取当前基础任务;
    所述读取存储设备中保存的当前增量任务记录中的有效增量任务的方法包括从存储设备中保存的当前增量任务记录文件中的当前增量任务记录中读取有效增量任务。
  15. 根据权利要求13所述的计算机系统状态恢复方法,其特征在于,所述将存储设备中保存的当前增量任务记录中的有效增量任务与所述当前基础任务合并形成最终当前任务的步骤包括:
    将存储设备中保存的当前基础任务的标识参数作为当前任务的标识参数,将存储设备中保存的当前基础任务作为当前任务;
    判断存储设备中是否保存有与当前任务的标识参数相关联的有效增量任务,若否,将此时获得的当前任务作为所述最终当前任务,并结束该形成最终当前任务的步骤;若是,将所述有效增量任务与所述当前任务合并,再将合并后的任务作为当前任务;
    将所述有效增量任务的增量标识参数作为当前任务的标识参数,执行“判断存储设备中是否保存有与当前任务的标识参数相关联的有效的增量任务,若是,则执行下一步骤,若否,则结束本方法”的步骤。
  16. 根据权利要求15所述的计算机系统状态恢复方法,其特征在于,所述判断存储设备中是否保存有与当前任务的标识参数相关联的有效增量任务的方法为:
    查找存储设备中是否保存有基础标识参数与当前任务的标识参数相同,且执行备份保存的时间距离执行本计算机系统状态恢复方法操作的时间最近的当前增量任务,若是,则将该当前增量任务作为与当前任务的标识参数相关联的有效增量任务。
  17. 根据权利要求16所述的计算机系统状态恢复方法,其特征在于,
    所述当前基础任务记录和当前增量任务记录分别保存在存储设备的当前基础任务记录文件和当前增量任务记录文件中;
    所述查找存储设备中是否保存有基础标识参数与当前任务的标识参数相同,且执行保存时间距离执行本计算机系统状态恢复方法操作的时间最近的当前增量任务的方法为:查找存储设备中保存的当前增量记录文件中的当前增量任务记录中是否保存有基础标识参数与当前任务的标识参数相同,且执行保存时间距离执行本计算机系统状态恢复 方法操作的时间最近的当前增量任务。
  18. 根据权利要求15所述的计算机系统状态恢复方法,其特征在于,
    所述当前基础任务记录和当前增量任务记录分别保存在存储设备的当前基础任务记录文件和当前增量任务记录文件中;
    所述将存储设备中保存的当前基础任务的标识参数作为当前任务的标识参数,将存储设备中保存的当前基础任务作为当前任务的方法为:将存储设备中保存的当前基础任务记录文件中的当前基础任务记录中的当前基础任务的标识参数作为当前任务的标识参数,将存储设备中保存的当前基础任务记录文件中的当前基础任务记录中的当前基础任务作为当前任务;
    所述将所述有效增量任务的增量标识参数作为当前任务的标识参数的方法为:将存储设备中保存的当前增量任务记录文件中的当前增量任务记录中与当前任务的标识参数相关联的有效增量任务的增量标识参数作为当前任务的标识参数。
  19. 一种计算机系统任务备份装置,其特征在于,包括:
    获取单元,用于获取用户的新的任务;
    标识参数生成单元,用于生成标识该用户的新的任务的标识参数;
    增量任务生成单元,用于将所述用户的新的任务与当前系统内存中保存的内存任务的差别作为增量任务;
    增量任务保存单元,用于将所述增量任务备份保存到存储设备中作为当前增量任务;
    内存任务更新单元,用于判断将所述增量任务备份保存到存储设备中作为当前增量任务的操作是否成功,若是,则采用所述用户的新的任务更新系统内存中保存的内存任务。
  20. 根据权利要求19所述的计算机系统任务备份装置,其特征在于,还包括:基础任务备份单元,用于判断存储设备中是否保存有当前增量任务记录,若是,则将当前系统内存中的内存任务备份保存到存储设备中作为当前基础任务。
  21. 一种计算机系统状态恢复装置,其特征在于,应用于存储设备中保存有当前基础任务记录和当前增量任务记录的计算机系统,所述当前基础任务记录包括当前基础任务的标识参数和当前基础任务,所述当前增量任务记录包括当前增量任务的增量标识参数,基础标识参数和当前增量任务;所述装置包括:
    基础任务读取单元,用于读取存储设备中保存的当前基础任务;
    合并单元,用于将存储设备中保存的当前增量任务记录中的有效增量任务与所述当前基础任务合并形成最终当前任务;
    恢复单元,用于将所述最终当前任务写入内存作为内存任务,实现对计算机系统的恢复。
PCT/CN2016/094114 2015-08-18 2016-08-09 计算机系统任务备份方法、系统状态恢复方法及其装置 WO2017028705A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510509539.4 2015-08-18
CN201510509539.4A CN106469101B (zh) 2015-08-18 2015-08-18 计算机系统任务备份方法、系统状态恢复方法及其装置

Publications (1)

Publication Number Publication Date
WO2017028705A1 true WO2017028705A1 (zh) 2017-02-23

Family

ID=58050417

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/094114 WO2017028705A1 (zh) 2015-08-18 2016-08-09 计算机系统任务备份方法、系统状态恢复方法及其装置

Country Status (2)

Country Link
CN (1) CN106469101B (zh)
WO (1) WO2017028705A1 (zh)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110059135A (zh) * 2019-04-12 2019-07-26 阿里巴巴集团控股有限公司 一种数据同步方法和装置
CN110741616A (zh) * 2017-06-14 2020-01-31 北京嘀嘀无限科技发展有限公司 用于数据上线的系统和方法
CN111290882A (zh) * 2020-02-11 2020-06-16 北京松果电子有限公司 数据文件备份方法、数据文件备份装置及电子设备
CN112114999A (zh) * 2020-09-01 2020-12-22 阿里云计算有限公司 一种数据备份方法、数据恢复方法、装置及电子设备
CN114661736A (zh) * 2022-03-10 2022-06-24 北京百度网讯科技有限公司 电子地图更新方法、装置、电子设备、存储介质及产品

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20010056425A1 (en) * 2000-06-19 2001-12-27 Hewlett-Packard Company Automatic backup/recovery process
CN101064730A (zh) * 2006-09-21 2007-10-31 上海交通大学 计算机网络数据文件本地和远程的备份方法
CN101441582A (zh) * 2007-11-20 2009-05-27 北京和力记易科技有限公司 计算机数据对象的备份和恢复方法及实现该方法的系统和程序产品
CN102999400A (zh) * 2012-11-22 2013-03-27 中国电信股份有限公司云计算分公司 一种云存储系统数据备份方法及装置
CN103176867A (zh) * 2013-04-02 2013-06-26 浪潮电子信息产业股份有限公司 一种快速文件差异备份方法
WO2015016914A1 (en) * 2013-07-31 2015-02-05 Longsand Limited Storing difference information in a backup system

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070124187A1 (en) * 2005-11-29 2007-05-31 Rajput Manjit S Cross system workflow manager
CN103246551A (zh) * 2012-02-07 2013-08-14 北京糯米网科技发展有限公司 用于管理后台定时任务的设备和方法

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20010056425A1 (en) * 2000-06-19 2001-12-27 Hewlett-Packard Company Automatic backup/recovery process
CN101064730A (zh) * 2006-09-21 2007-10-31 上海交通大学 计算机网络数据文件本地和远程的备份方法
CN101441582A (zh) * 2007-11-20 2009-05-27 北京和力记易科技有限公司 计算机数据对象的备份和恢复方法及实现该方法的系统和程序产品
CN102999400A (zh) * 2012-11-22 2013-03-27 中国电信股份有限公司云计算分公司 一种云存储系统数据备份方法及装置
CN103176867A (zh) * 2013-04-02 2013-06-26 浪潮电子信息产业股份有限公司 一种快速文件差异备份方法
WO2015016914A1 (en) * 2013-07-31 2015-02-05 Longsand Limited Storing difference information in a backup system

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110741616A (zh) * 2017-06-14 2020-01-31 北京嘀嘀无限科技发展有限公司 用于数据上线的系统和方法
CN110059135A (zh) * 2019-04-12 2019-07-26 阿里巴巴集团控股有限公司 一种数据同步方法和装置
CN111290882A (zh) * 2020-02-11 2020-06-16 北京松果电子有限公司 数据文件备份方法、数据文件备份装置及电子设备
CN111290882B (zh) * 2020-02-11 2024-02-09 北京小米松果电子有限公司 数据文件备份方法、数据文件备份装置及电子设备
CN112114999A (zh) * 2020-09-01 2020-12-22 阿里云计算有限公司 一种数据备份方法、数据恢复方法、装置及电子设备
CN114661736A (zh) * 2022-03-10 2022-06-24 北京百度网讯科技有限公司 电子地图更新方法、装置、电子设备、存储介质及产品
CN114661736B (zh) * 2022-03-10 2024-04-16 北京百度网讯科技有限公司 电子地图更新方法、装置、电子设备、存储介质及产品

Also Published As

Publication number Publication date
CN106469101A (zh) 2017-03-01
CN106469101B (zh) 2019-06-25

Similar Documents

Publication Publication Date Title
WO2017028705A1 (zh) 计算机系统任务备份方法、系统状态恢复方法及其装置
US8949190B2 (en) Point-in-time database recovery using log holes
US9779128B2 (en) System and method for massively parallel processing database
US9575849B2 (en) Synchronized backup and recovery of database systems
US8768891B2 (en) Ensuring database log recovery consistency
CN107515874B (zh) 一种分布式非关系型数据库中同步增量数据的方法与设备
US10430298B2 (en) Versatile in-memory database recovery using logical log records
CN106970921B (zh) 一种数据迁移方法及装置
US20150213100A1 (en) Data synchronization method and system
KR102077898B1 (ko) 데이터베이스 고장 시의 데이터 저장
US9229970B2 (en) Methods to minimize communication in a cluster database system
US9542279B2 (en) Shadow paging based log segment directory
CN104937556A (zh) 恢复数据库的页面
US10031814B2 (en) Collection record location as log tail beginning
CN105573859A (zh) 一种数据库的数据恢复方法和设备
WO2019020081A1 (zh) 分布式系统及其故障恢复方法、装置、产品和存储介质
US6944635B2 (en) Method for file deletion and recovery against system failures in database management system
CN108614876B (zh) 一种基于Redis数据库的系统和数据处理方法
WO2018107792A1 (zh) 数据的增量恢复方法和装置
US20170185493A1 (en) Database transaction replay
US11500812B2 (en) Intermediate file processing method, client, server, and system
CN112000522A (zh) 一种分布式数据库系统的还原方法、装置及计算机可读存储介质
CN115617571A (zh) 一种数据备份方法、装置、系统、设备及存储介质
US20230315713A1 (en) Operation request processing method, apparatus, device, readable storage medium, and system
US20140149697A1 (en) Memory Pre-Allocation For Cleanup and Rollback Operations

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16836569

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 16836569

Country of ref document: EP

Kind code of ref document: A1