CN108268346B - Data backup method, device, equipment and storage medium - Google Patents

Data backup method, device, equipment and storage medium Download PDF

Info

Publication number
CN108268346B
CN108268346B CN201810149357.4A CN201810149357A CN108268346B CN 108268346 B CN108268346 B CN 108268346B CN 201810149357 A CN201810149357 A CN 201810149357A CN 108268346 B CN108268346 B CN 108268346B
Authority
CN
China
Prior art keywords
backup
target
path
backup device
file
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.)
Active
Application number
CN201810149357.4A
Other languages
Chinese (zh)
Other versions
CN108268346A (en
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.)
Longxintec Co ltd
Original Assignee
Longxintec 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 Longxintec Co ltd filed Critical Longxintec Co ltd
Priority to CN201810149357.4A priority Critical patent/CN108268346B/en
Publication of CN108268346A publication Critical patent/CN108268346A/en
Application granted granted Critical
Publication of CN108268346B publication Critical patent/CN108268346B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1458Management of the backup or restore process
    • G06F11/1464Management of the backup or restore process for networked environments
    • 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/1458Management of the backup or restore process
    • G06F11/1469Backup restoration techniques

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a data backup method, a data backup device, data backup equipment and a storage medium. The method comprises the following steps: after the target backup device successfully establishes backup connection with the source backup device, acquiring an application identifier of a backup application program provided by the source backup device, and acquiring a backup path corresponding to the backup application program, wherein the source backup device is an iOS operating system; the target backup device receives download description information of a target download file sent by the source backup device, wherein the download description information comprises: an absolute path in a source backup device and a local storage path in a target backup device; and if the target backup equipment determines that the target download file belongs to the backup application program according to the backup check information, downloading the target download file to a local storage path, wherein the backup check information comprises download description information and an application identifier, or the download description information and a backup path corresponding to the backup application program. The method avoids the waste of backup system resources and improves the data backup efficiency.

Description

Data backup method, device, equipment and storage medium
Technical Field
The embodiment of the invention relates to the technical field of computers, in particular to a data backup method, a data backup device, data backup equipment and a storage medium.
Background
iOS is a mobile operating system developed by apple inc, and is applied to devices such as iPhone, iPad, and iPod produced by apple inc. The iOS system can be compatible with a large amount of application software, so that the individual requirements of different users are met.
With the continuous development of information science and technology, more and more application software is installed on the iOS device by a user, so that the data volume on the iOS device is increased rapidly. However, since the iOS os is a closed os, an application developer can only use a development interface provided by apple inc to open the outside to develop application software, so that functions that can be implemented by the developed application software for the iOS os are limited by the provided development interface. Due to different development interfaces, the method for data backup in a non-iOS operating system cannot be applied to an iOS operating system, and the data backup of the iOS device by a user can only use the self-contained iCloud backup function of the iOS device or iTunes of apple inc.
When the method is used for carrying out data backup on the iOS equipment, a db file or an mbdb file for recording the basic information of a backup file can be generated when the backup is finished, and once the backup fails in the midway, the db file or the mbdb file cannot be generated, namely the file which is successfully backed up before the failure cannot be used when the backup data is recovered, so that system resources are seriously wasted. Meanwhile, as the capacity of the iOS device is gradually increased, the amount of data that a user needs to backup data is also significantly increased, and an application that needs to be backed up can be selected by using the iCloud, but the free storage space of the iCloud is limited, and there is no limitation of the storage space when the iTunes is used for backup, but the backup efficiency is undoubtedly reduced when the data backup is performed on the whole device.
Disclosure of Invention
The embodiment of the invention provides a data backup method, a data backup device, data backup equipment and a storage medium, which are used for optimizing a data backup scheme based on an iOS system in the prior art.
In a first aspect, an embodiment of the present invention provides a data backup method, including:
after the target backup device successfully establishes backup connection with the source backup device, acquiring an application identifier of at least one backup application program provided by the source backup device, and acquiring a backup path corresponding to the at least one backup application program, wherein the source backup device is an iOS operating system;
the target backup device receives download description information of at least one target download file sent by the source backup device, wherein the download description information includes: the device absolute path of the target download file in the source backup device and the local storage path of the target download file in the target backup device;
if the target backup device determines that the target download file belongs to the at least one backup application program according to backup check information, the target backup device downloads the target download file into the local storage path, wherein the backup check information includes: the download description information and the application identifier of the at least one backup application program, or the download description information and the backup path corresponding to the at least one backup application program.
In a second aspect, an embodiment of the present invention further provides a data backup apparatus, including:
the system comprises an acquisition module, a backup module and a backup module, wherein the acquisition module is used for acquiring an application identifier of at least one backup application program provided by a source backup device and acquiring a backup path corresponding to the at least one backup application program after the target backup device successfully establishes backup connection with the source backup device, and the source backup device is an iOS operating system;
a receiving module, configured to receive, by a target backup device, download description information of at least one target download file sent by a source backup device, where the download description information includes: the device absolute path of the target download file in the source backup device and the local storage path of the target download file in the target backup device;
a downloading module, configured to download, by the target backup device, the target download file to the local storage path if it is determined that the target download file belongs to the at least one backup application program according to backup checking information, where the backup checking information includes: the download description information and the application identifier of the at least one backup application program, or the download description information and the backup path corresponding to the at least one backup application program.
In a third aspect, an embodiment of the present invention further provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor executes the computer program to implement the data backup method according to any embodiment of the present invention.
In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements a data backup method according to any embodiment of the present invention.
The embodiment of the invention provides a data backup method, a device, equipment and a storage medium, wherein in the method, after a target backup device successfully establishes backup connection with a source iOS backup device, a target device receives a download description message of each target download file sent by the source iOS target device, the backup application program of each target download file is determined according to an application identifier of a backup application program and the download description information or according to a backup path of the backup application program and the download description information, and the target download files are read and stored according to the target download description information. Each target file backed up by the method can be used when the source iOS target equipment performs data recovery, waste of backup system resources is avoided, meanwhile, the method can only perform data backup on the backup application program selected by a user, data backup of the whole source iOS target equipment is not needed, and data backup efficiency of the source iOS target equipment is improved.
Drawings
Fig. 1 is a flowchart of a data backup method according to a first embodiment of the present invention;
FIG. 2 is a flowchart of a data backup method according to a second embodiment of the present invention;
fig. 3 is a schematic structural diagram of a data backup device according to a third embodiment of the present invention;
fig. 4 is a schematic structural diagram of a computer device according to a fourth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
It should be further noted that, for the convenience of description, only some but not all of the relevant aspects of the present invention are shown in the drawings. Before discussing exemplary embodiments in more detail, it should be noted that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although a flowchart may describe the operations (or steps) as a sequential process, many of the operations can be performed in parallel, concurrently or simultaneously. In addition, the order of the operations may be re-arranged. The process may be terminated when its operations are completed, but may have additional steps not included in the figure. The processes may correspond to methods, functions, procedures, subroutines, and the like.
Example one
The embodiment provides a data backup method, which is applicable to the situation of performing data backup on an iOS device based on personalized backup requirements of a user, and the method can be executed by the data backup device provided by the embodiment of the invention, and the device can be realized in a software and/or hardware manner and can be generally integrated in a processor.
As shown in fig. 1, the method of this embodiment specifically includes:
s110, after the target backup device successfully establishes backup connection with the source backup device, obtaining an application identifier of at least one backup application program provided by the source backup device, and obtaining a backup path corresponding to the at least one backup application program, wherein the source backup device is an iOS operating system.
The source backup device refers to an iOS device, such as an iPhone, an iPad, or an iPod, for which a user needs to backup data, and the target backup device refers to a device, such as a personal computer, for which the user stores backup data.
Firstly, connecting a source backup device and a target backup device through a data line, and establishing a backup connection successfully to perform data backup operation, wherein the target backup device can establish the backup connection with the source backup device successfully, and the method specifically comprises the following steps: the method comprises the steps that a target backup device establishes trust communication with a source backup device and determines that a backup function request of a backup service in the source backup device is successful, wherein a protocol version of the backup service of the source backup device meets a set version requirement.
The source backup device needs to establish trust connection with the target backup device after being confirmed by a user, the target backup device can start backup service of the source backup device through a calling interface, specifically com.applet.mobilebackup 2 service in the iOS device, the service mainly provides iTunes backup, encryption, recovery and other functions, and after the service is successfully started, related handle resources can be saved so as to realize corresponding functions. The version of the com.applet.mobilebackup 2 service protocol in the source backup device needs to be checked to determine whether the set version requirement is met, and specifically, the current protocol version only supports the 2.0 version and the 2.1 version. After a user selects a backup application program according to personal requirements, a source backup device requests a backup function through a com.applet.mobilebackup 2 service, and if the request is determined to be successful, a target backup device can receive a backup message and perform subsequent circular processing operation according to the type of the backup message. If the start of the com.applet.mobilebackup 2 service fails due to problems such as insufficient system resources, setting errors and the like, or the request of the backup function by the com.applet.mobilebackup 2 service fails, or the protocol version of the com.applet.mobilebackup 2 service does not meet the set version requirement, the operation of the backup message circulation processing is directly quitted and can not be continuously executed.
The target backup device obtains an application identifier of a backup application program corresponding to the backup application program selected by the user, wherein the backup application program comprises an iOS system application program and a third-party application program, the application identifier of the backup application program is a fixed application identifier of the iOS system application program and a unique application identifier of the third-party application program, the fixed application identifier of the iOS system application program is directly obtained by the source backup device, and the unique application identifier of the third-party application program is obtained by the source backup device through setting an installation proxy service.
For the iOS system application programs, for example, iOS system applications such as short messages, contacts, call records, memos, and the like, since storage paths of the application programs in the iOS device are fixed, the bunddleid of the application programs is empty, and corresponding domain values are generally HomeDomain, WirelessDomain, cameraraldomain, and the like, but fixed storage paths of the application programs in the source backup device may be acquired by the target backup device in advance, that is, the source backup device directly acquires the fixed storage paths of the application programs as fixed application identifiers, and sends device storage paths matched with the backup application program selected by the user to the target backup device.
For third-party applications, such as QQ, wechat, and the like, the iOS device needs to obtain through setting an installation proxy service, specifically, a com.applet.mobile.installation _ proxy service in the iOS device is started, and through the service, icons, names, unique application identifiers, bunddleid, and the like of all the third-party applications can be obtained.
And then, the target backup device receives the backup messages and circularly processes the backup messages, wherein one backup message can correspond to a plurality of files. Specifically, the target backup device performs corresponding processing operations on the message type (denoted as ctype) according to each backup message:
if the ctype is equal to the DLMessageDownloadfiles, uploading the file to the source backup device and then continuing circulation; if the ctype is equal to the DLMessageUploadfiles, the file is downloaded to the target backup device and then circulation continues; if the ctype is equal to the DLMessageGetFreeDiskSpace, the residual space of the backup disc of the target backup device is obtained and then circulation is continued; if the ctype is equal to the DLContentsOfDirectory, continuing to circulate after acquiring the file information in the directory; if ctype is equal to "DLMessageCreateDirectory", continue to circulate after creating the directory; if the ctype is equal to the DLMessageMoveFiles or the DLMessageMoveItems, the circulation is continued after the file is moved; if the ctype is equal to "DLMessageRemovFiles" or "DLMessageRemovItems", continuing the loop after deleting the file; if ctype is equal to "DLMessageCopyItem", then the loop continues after copying the file; if ctype equals "DLMessageDisconnect", then the loop exits; if ctype equals "DLMessageProcessMessage", the message is responded to and the loop is exited. Wherein if the number of cycles exceeds a predetermined number of cycles, the cycle is exited.
In this embodiment, a detailed explanation will be given of an operation of downloading a file to a target backup device when ctype is equal to "DLMessageUploadFiles".
The target backup device obtains a backup path corresponding to at least one backup application program, where the backup path may be stored by the target backup device in a previous backup process, or may be newly created in the current backup process, that is, the backup path of each backup application program selected by a user is recorded at the target backup device, where the backup path may be specifically root directory information of the backup application program at the source backup device, and the target backup device may read the source backup device according to the backup path to obtain a file to be downloaded.
Specifically, if the backup application selected by the user is an iOS system application, such as iOS system applications such as SMS, contact, call record, and memo, the backup path of the backup application in the target backup device may be a fixed application identifier of the iOS system applications, that is, a fixed storage path of the iOS system applications in the source backup device, such as "SMS" stored in the source backup device is "/var/mobile/Library/SMS", "contact" stored in the source backup device is "/var/mobile/Library/address book", "call record" stored in the source backup device is "/var/mobile/Library/call history db" or "/var/wireless/Library/call history db", "memo" stored in the source backup device is "/var/mobile/Library/notebook" and the like, accordingly, the backup paths of the backup applications stored or newly created at the target backup device end may correspond to the above paths.
For example, the user selects three backup applications, and records the backup path of the first backup application as root1, the backup path of the second backup application as root2, and the backup path of the third backup application as root 3. The target backup device acquires backup paths root1, root2 and root3 corresponding to the three backup applications, and reads the source backup device according to root1, root2 and root3 to acquire files needing downloading in the three backup applications. If the first backup application program is backed up in the previous backup process, the root1 is assigned in the previous backup process, and the root1 is the result after being assigned; if the second backup application has never been backed up during a previous backup process, root2 may be the backup path created during this backup process that may not correspond to the actual backup path of the second backup application.
S120, the target backup device receives download description information of at least one target download file sent by the source backup device, where the download description information includes: the device absolute path of the target download file in the source backup device and the local storage path of the target download file in the target backup device.
One ctype is equal to the backup message of "DLMessageUploadFiles", and corresponding to a plurality of download files, the target backup device needs to process each download file in a cycle, so as to complete the processing of the whole backup message.
The source backup device sends the download description information of a target download file to the target backup device, specifically to send a device absolute path of the target download file in the source backup device and a local storage path in the target backup device, where the local storage path is formed according to part of information in a storage path and a device absolute path in the target backup device selected by a user before.
For example, the device absolute path of a target download file in the backup application QQ in the source backup device is:
“/var/mobile/Containers/Data/Application/8628D00A-CCE6-4B8A-89F6-BE23EA81FA06/Documents/contents/771084591/QQ.db”,
where the device absolute path may be truncated into a root directory portion and a relative path portion, specifically,
"/var/mobile/contacts/Data/Application/8628D 00A-CCE6-4B8A-89F6-BE23EA81FA 06" is a root directory part, and the specific form of the root directory part is
"/var/mobile/contacts/Data/Application/XXXXXXXXX-XXXXX-XXXXXXXXXXXXXXX" or
“/var/mobile/Application/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX”,
And "Documents/contents/771084591/QQ.db" is a relative path portion, in plain text form in the absolute path of the device.
If the storage path in the target backup device selected by the user before is "D: v ", then the local memory path is
“D:/1267a8cafa75c7a7de2cd81d1973d75cabe457c0/Snapshot/8a/8a92063f70049deeb175cb053ba9240885264354”,
Wherein the content of the first and second substances,
"1267 a8cafa75c7a7de2cd81d1973d75cab 457c0/Snapshot/8a/8a92063f70049deeb175cb053ba 9240885264354" is in the form of ciphertext of the relative path segment, here specifically a hash.
S130, if the target download file is determined to belong to the at least one backup application program according to backup check information by the target backup device, downloading the target download file to the local storage path, wherein the backup check information comprises: the download description information and the application identifier of the at least one backup application program, or the download description information and the backup path corresponding to the at least one backup application program.
The target backup device determines the backup application program to which the target download file belongs according to the download description information and each application identifier corresponding to the backup application program selected by the user, or according to the download description information and the backup path (root 1, root2, and root3 in the foregoing example) corresponding to the backup application program selected by the user, and reads the source backup device according to the backup path of the backup application program to which the target download file belongs to obtain the target download file, and stores the target download file into the local storage path of the target download file. And then, according to the downloading method, other downloading files corresponding to the backup message are processed in a circulating mode until all the backup files corresponding to the backup message are processed, and then the next backup message is processed.
As a specific implementation manner of this embodiment, the determining, by the target backup device according to the backup verification information, that the target download file belongs to the at least one backup application program may specifically be:
the target backup device intercepts a root directory part and a relative path part corresponding to the device absolute path of the target download file; if the target backup device determines that the file results obtained by reading the source backup device according to the backup path corresponding to the at least one backup application program are not all non-null and the backup path corresponding to the non-null file results is not matched with the intercepted root directory part, a domain value is constructed according to the application identifier of the at least one backup application program; the target backup device calculates at least one file name corresponding to the target download file according to the constructed at least one domain value and the intercepted relative path part; if the target backup device determines that the calculated target file name is matched with the local storage path of the target download file, determining that the target download file belongs to a first target backup application program corresponding to the target file name; the target backup device replaces the backup path of the first target backup application with the intercepted root directory portion.
Downloading the target download file to a local storage path by the target backup device, specifically:
and the target backup device reads the source backup device according to the intercepted root directory part and stores the obtained target download file into a local storage path.
And the target backup device intercepts a root directory part and a relative path part corresponding to the device absolute path of the target download file according to the intercepting method, the root directory part is prefix, and the relative path part is recorded as rPath. Continuing the previous example, the user selects three backup applications, the corresponding backup paths are root1, root2 and root3, the file results obtained by the target backup device reading the source backup device according to root1, root2 and root3 are not all non-empty, and the backup path corresponding to the non-empty file result is not matched with the intercepted root directory part, for example, the file results obtained by reading the source backup device according to root1, root2 and root3 are all empty, or the file results obtained by reading the source backup device according to root1 and root2 are non-empty, the file results obtained by reading the source backup device according to root3 are empty, and neither root1 nor root2 can be successfully matched with prefix, that is, the target backup device cannot read the source backup device to obtain the target download file according to root1, root2 and root3 to determine whether the target download file is required by the user.
In this case, the domain values are directly constructed according to the application identifiers of all the backup application programs selected by the user, that is, three domain values are constructed according to the application identifiers of all the backup application programs selected by the user, and three file names are calculated by combining rPath.
Specifically, the calculating, by the target backup device, at least one filename corresponding to the target download file according to the constructed at least one domain value and the intercepted relative path portion includes:
FileName=SHA1("Domain-rPath");
wherein, FileName is the file name of the target download file, Domain is the Domain value, rPath is the relative path part, and SHA1 (") is the secure hash algorithm.
If the user needs to backup data of a third-party application, the bunddleid of the corresponding application can be obtained through the com.applet.mobile. instruction _ proxy service, for example, the bunddleid of the "railway 12306" is "cn.12306. railss 12306", the Domain value Domain thereof is "app Domain-cn.12306. railss 12306", the bunddleid of the QQ is "com.intent.mqq", and the Domain thereof is "app Domain-com.intent.mqq". Briefly, the Domain value Domain may be constructed according to the bunddleid.
According to the Domain value Domain of the backup application program, the file name of the downloaded file can be calculated by utilizing a hash algorithm in combination with a relative path part rPath in the absolute path of the device of the target downloaded file.
The target backup device performs matching search on the file name obtained by calculation and a local storage path of the target download file, if the local storage path comprises one of the file names obtained by calculation, the target download file is determined to belong to a backup application program corresponding to the file name, a root directory part prefix is assigned to the backup path (for example, root3) of the corresponding backup application program, the root3 is updated and saved, the source backup device is read according to the intercepted root directory part (namely, root3), and the obtained target download file is saved in the local storage path.
According to the foregoing example, the device absolute path of a target download file in the backup application QQ in the source backup device is:
“/var/mobile/Containers/Data/Application/8628D00A-CCE6-4B8A-89F6-BE23EA81FA06/Documents/contents/771084591/QQ.db”,
the local storage path is:
“D:/1267a8cafa75c7a7de2cd81d1973d75cabe457c0/Snapshot/8a/8a92063f70049deeb175cb053ba9240885264354”,
according to the method, the Domain is constructed according to the bunddleid "com.intent.mqq" of QQ, "AppDomain-com.intent.mqq",
the file name calculated in connection with the relative path portion "Documents/contents/771084591/QQ.db" is:
"8 a92063f70049deeb175cb053ba 9240885264354", the file name may be found in the local storage path.
Specifically, after the target backup device intercepts a root directory portion and a relative path portion corresponding to a device absolute path of the target download file, the method further includes:
and if the intercepted root directory part is determined to be matched with the backup path of a second target backup application program by the target backup equipment and the file result obtained by reading the source backup equipment according to the backup path of the second target backup application program is non-empty, determining that the target download file belongs to the second target backup application program.
If the target backup device determines that the result of reading the file obtained by the source backup device according to the root2 is not empty and the root2 and the root directory part prefix can be successfully matched, the target download file is determined to belong to the backup application program corresponding to the root2, the source backup device is read according to the intercepted root directory part (namely, the root2), and the obtained target download file is stored in the local storage path.
Specifically, the method further includes: if the target backup device determines that the file results obtained by reading the source backup device according to the backup path corresponding to the at least one backup application program are all non-empty and the backup path corresponding to the non-empty file results is not matched with the intercepted root directory part, determining that the target download file does not belong to the backup application program; the target backup device abandons the download of the target download file.
If the file results obtained by the target backup device by reading the source backup device according to the root1, the root2 and the root3 are all non-empty, and the root1, the root2 and the root3 cannot be successfully matched with the root directory part prefix, it is determined that the target download file does not belong to any backup application program selected by the user, and then the target download file is not downloaded, and the next download file corresponding to the backup message is continuously processed in a circulating manner.
According to the data backup method provided by the embodiment, only the backup application program selected by the user can be backed up, the backup of the whole iOS device is not needed, and the increase of backup time caused by the backup of some unnecessary data is avoided. The technical means that the file name of the target download file is calculated by combining the relative path part in the device absolute path of the target download file and the application identifier of the backup application program selected by a user, if the local storage path of the target download file comprises the file name, the source backup device is read according to the root directory part in the device absolute path to acquire and store the target download file is optimized, the data backup scheme based on the iOS system in the prior art is optimized, even if the backup process is interrupted accidentally, the file which is backed up successfully can still be used during data recovery, and the waste of backup system resources is avoided.
On the basis of the backup method, under the condition that the local storage path of the target download file comprises the file name obtained through calculation, the root directory part in the absolute path of the device is assigned to the backup path of the backup application program corresponding to the target download file and stored, so that the backup path of the backup application program can be directly used for matching with the root directory part in the absolute path of the device of the target download file in the next backup process, if the matching is successful, the target download file in the source backup device can be read according to the backup path, namely the target download file is directly downloaded and stored, the process of calculating the file name of each target download file is simplified, and the efficiency of data backup is improved.
Example two
In a specific implementation manner provided by this embodiment, it is assumed that the number of backup applications selected by the user is N, the backup path of the backup application 1 recorded by the target backup device is root1, the backup path of the backup application 2 is root2 and … …, and the backup path of the backup application N is root N.
As shown in fig. 2, the data backup method includes, for a certain target download file:
s210, the target backup device receives the download description information of the target download file sent by the source backup device, wherein the download description information comprises: the device absolute path of the target download file in the source backup device and the local storage path of the target download file in the target backup device are respectively formed, wherein the device absolute path is composed of a root directory part and a relative path part, and the local storage path is composed of a storage address and a relative path part in the target backup device selected by a user.
S220, the target backup device reads the source backup device according to backup paths root 1-rootN, and if the file result obtained by reading the source backup device according to rootX is determined to be non-empty and the rootX is matched with a root directory part in the absolute path of the device, S230 is executed; if it is determined that the file results obtained by reading the source backup device according to root 1-rootN are not all non-null, and the rootX corresponding to the non-null result cannot be partially matched with the root directory in the absolute path of the device, executing S240; if it is determined that the file results obtained from reading the source backup device from root 1-rootN are all non-empty and none of root 1-rootN can be partially matched with the root directory in the absolute path of the device, then S260 is performed.
And S230, the target backup device reads the source backup device according to the intercepted root directory part and stores the obtained target download file into a local storage path.
S240, the target backup device constructs N domain values according to the application identifiers bunddleid of the N backup application programs, and obtains N file names by computing through a secure hash algorithm by combining a relative path part in an absolute path of the device.
And S250, if the target backup device determines that the local storage path comprises one of the file names, assigning the root directory part in the absolute path of the device to be rootX corresponding to the file name, reading the source backup device according to the intercepted root directory part, and storing the obtained target download file into the local storage path.
And S260, the target backup device does not download the target download file, and the target backup device receives the download description information of the next target download file sent by the source backup device.
EXAMPLE III
The embodiment provides a data backup device, which is applicable to the situation of performing data backup on an iOS device based on the personalized backup requirement of a user, and the device can be realized in a software and/or hardware manner and can be generally integrated in a processor. As shown in fig. 3, the apparatus includes: an obtaining module 310, a receiving module 320, and a downloading module 330, wherein:
an obtaining module 310, configured to obtain, by a target backup device, an application identifier of at least one backup application provided by a source backup device after a backup connection is successfully established with the source backup device, and obtain a backup path corresponding to the at least one backup application, where the source backup device is an iOS operating system;
a receiving module 320, configured to receive, by a target backup device, download description information of at least one target download file sent by a source backup device, where the download description information includes: the device absolute path of the target download file in the source backup device and the local storage path of the target download file in the target backup device;
a downloading module 330, configured to download, by the target backup device, the target download file to the local storage path if it is determined that the target download file belongs to the at least one backup application program according to backup checking information, where the backup checking information includes: the download description information and the application identifier of the at least one backup application program, or the download description information and the backup path corresponding to the at least one backup application program.
The data backup device provided by the embodiment can only backup the backup application program selected by the user, does not need to backup the whole iOS device, and avoids the increase of backup time caused by the backup of some unnecessary data. The technical means that the file name of the target download file is calculated by combining the relative path part in the device absolute path of the target download file and the application identifier of the backup application program selected by a user, if the local storage path of the target download file comprises the file name, the source backup device is read according to the root directory part in the device absolute path to acquire and store the target download file is optimized, the data backup scheme based on the iOS system in the prior art is optimized, even if the backup process is interrupted accidentally, the file which is backed up successfully can still be used during data recovery, and the waste of backup system resources is avoided.
On the basis of the backup method, under the condition that the local storage path of the target download file comprises the file name obtained through calculation, the root directory part in the absolute path of the device is assigned to the backup path of the backup application program corresponding to the target download file and stored, so that the backup path of the backup application program can be directly used for matching with the root directory part in the absolute path of the device of the target download file in the next backup process, if the matching is successful, the target download file in the source backup device can be read according to the backup path, namely the target download file is directly downloaded and stored, the process of calculating the file name of each target download file is simplified, and the efficiency of data backup is improved.
On the basis of the above technical solution, the downloading module 330 specifically includes: a path intercepting unit, a domain value constructing unit, a file name calculating unit, a file name matching unit, a path updating unit and a downloading unit, wherein,
a path intercepting unit, configured to intercept, by a target backup device, a root directory portion and a relative path portion corresponding to the device absolute path of the target download file;
a domain value construction unit, configured to, if it is determined that file results obtained by reading the source backup device according to the backup path corresponding to the at least one backup application program are not all non-null and the backup path corresponding to the non-null file result does not match the intercepted root directory portion, construct a domain value according to an application identifier of the at least one backup application program;
the file name calculation unit is used for calculating at least one file name corresponding to the target download file by the target backup equipment according to the constructed at least one domain value and the intercepted relative path part;
the file name matching unit is used for determining that the target download file belongs to a first target backup application program corresponding to the target file name if the target backup device determines that the calculated target file name is matched with the local storage path of the target download file;
a path updating unit, configured to replace, by a target backup device, a backup path of the first target backup application with the intercepted root directory portion;
and the downloading unit is used for reading the source backup equipment by the target backup equipment according to the intercepted root directory part and storing the obtained target downloading file into the local storage path.
Specifically, the downloading module 330 further includes: a first path matching unit, configured to, after a target backup device intercepts a root directory portion and a relative path portion corresponding to the device absolute path of the target download file, determine, by the target backup device, that the intercepted root directory portion matches a backup path of a second target backup application program, and determine, according to the backup path of the second target backup application program, that the file result obtained by reading the source backup device is non-empty, that the target download file belongs to the second target backup application program.
Specifically, the downloading module 330 further includes: a path second matching unit and a discarding unit, wherein,
the second path matching unit is used for determining that the target download file does not belong to the backup application program if the target backup device determines that the file results obtained by reading the source backup device according to the backup path corresponding to the at least one backup application program are all non-null and the backup path corresponding to the non-null file results is not matched with the intercepted root directory part;
and the discarding unit is used for the target backup equipment to abandon the downloading of the target download file.
Specifically, the file name calculation unit is configured to calculate at least one file name corresponding to the target download file according to the following formula:
FileName=SHA1("Domain-rPath");
wherein, FileName is the file name of the target download file, Domain is the Domain value, rPath is the relative path part, and SHA1 (") is the secure hash algorithm.
On the basis of the foregoing embodiment, the obtaining module 310 is specifically configured to establish, by a target backup device, trust communication with a source backup device, and after it is determined that a backup function request of a backup service in the source backup device is successful, obtain an application identifier of at least one backup application program provided by the source backup device, and obtain a backup path corresponding to the at least one backup application program, where the source backup device is an iOS operating system, and a protocol version of the backup service of the source backup device meets a set version requirement.
Specifically, the backup application program includes an iOS system application program and a third-party application program, and the application identifier of the backup application program includes a fixed application identifier of the iOS system application program and a unique application identifier of the third-party application program, where the fixed application identifier of the iOS system application program is directly obtained by the source backup device, and the unique application identifier of the third-party application program is obtained by setting an installation proxy service for the source backup device.
The data backup device can execute the data backup method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the executed data backup method.
Example four
Fig. 4 is a schematic structural diagram of a computer apparatus according to a fourth embodiment of the present invention, as shown in fig. 4, the computer apparatus includes a processor 410, a memory 420, an input device 430, and an output device 440; the number of the processors 410 in the computer device may be one or more, and one processor 410 is taken as an example in fig. 4; the processor 410, the memory 420, the input device 430 and the output device 440 in the computer apparatus may be connected by a bus or other means, and the connection by the bus is exemplified in fig. 4.
The memory 420 serves as a computer-readable storage medium for storing software programs, computer-executable programs, and modules, such as program instructions/modules corresponding to the data backup method in any embodiment of the present invention (e.g., the obtaining module 310, the receiving module 320, and the downloading module 330 in the data backup apparatus). The processor 410 executes various functional applications and data processing of the computer device by executing software programs, instructions and modules stored in the memory 420, that is, implements the operations for the computer device described above.
The memory 420 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required for at least one function; the storage data area may store data created according to use of the device, and the like. Further, the memory 420 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some examples, memory 420 may further include memory located remotely from processor 410, which may be connected to a computer device through a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The input means 430 may be used to receive input touch information and generate key signal inputs related to user settings and function control of the computer apparatus. The output device 440 may include a display device such as a display screen.
EXAMPLE five
The fifth embodiment of the present invention further provides a storage medium containing computer-executable instructions, where a computer program is stored on the storage medium, and when the computer program is executed by a processor, the method for backing up data provided in any embodiment of the present invention is implemented, where the method includes:
after the target backup device successfully establishes backup connection with the source backup device, acquiring an application identifier of at least one backup application program provided by the source backup device, and acquiring a backup path corresponding to the at least one backup application program, wherein the source backup device is an iOS operating system;
the target backup device receives download description information of at least one target download file sent by the source backup device, wherein the download description information includes: the device absolute path of the target download file in the source backup device and the local storage path of the target download file in the target backup device;
if the target backup device determines that the target download file belongs to the at least one backup application program according to backup check information, the target backup device downloads the target download file into the local storage path, wherein the backup check information includes: the download description information and the application identifier of the at least one backup application program, or the download description information and the backup path corresponding to the at least one backup application program.
From the above description of the embodiments, it is obvious for those skilled in the art that the present invention can be implemented by software and necessary general hardware, and certainly, can also be implemented by hardware, but the former is a better embodiment in many cases. Based on this understanding, the technical solutions of the present invention may be embodied in the form of a software product, which can be stored in a computer-readable storage medium, such as a floppy disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a FLASH Memory (FLASH), a hard disk or an optical disk of a computer, and includes instructions for causing a computer device to execute the method according to the embodiments of the present invention.
It should be noted that, in the embodiment of the data backup apparatus, each included unit and module are only divided according to functional logic, but are not limited to the above division as long as the corresponding functions can be implemented; in addition, specific names of the functional units are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present invention.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (8)

1. A method for data backup, comprising:
after the target backup device successfully establishes backup connection with the source backup device, acquiring an application identifier of at least one backup application program provided by the source backup device, and acquiring a backup path corresponding to the at least one backup application program, wherein the source backup device is an iOS operating system;
the target backup device receives download description information of at least one target download file sent by the source backup device, wherein the download description information includes: the device absolute path of the target download file in the source backup device and the local storage path of the target download file in the target backup device;
if the target backup device determines that the target download file belongs to the at least one backup application program according to backup check information, the target backup device downloads the target download file into the local storage path, wherein the backup check information includes: the download description information and the application identifier of the at least one backup application program, or the download description information and the backup path corresponding to the at least one backup application program;
wherein, the target backup device determines that the target download file belongs to the at least one backup application program according to the backup verification information, and the method comprises the following steps:
the target backup device intercepts a root directory part and a relative path part corresponding to the device absolute path of the target download file;
if the target backup device determines that the intercepted root directory part is matched with a backup path of a second target backup application program and a file result obtained by reading the source backup device according to the backup path of the second target backup application program is non-empty, determining that the target download file belongs to the second target backup application program;
if the target backup device determines that the file results obtained by reading the source backup device according to the backup path corresponding to the at least one backup application program are not all non-null and the backup path corresponding to the non-null file results is not matched with the intercepted root directory part, constructing a domain value according to the application identifier of the at least one backup application program;
the target backup device calculates at least one file name corresponding to the target download file according to the constructed at least one domain value and the intercepted relative path part;
if the target backup device determines that the calculated target file name is matched with the local storage path of the target download file, determining that the target download file belongs to a first target backup application program corresponding to the target file name;
the target backup device replaces the backup path of the first target backup application with the intercepted root directory portion;
the target backup device downloads the target download file to the local storage path, and the downloading includes:
and the target backup device reads the source backup device according to the intercepted root directory part and stores the obtained target download file into the local storage path.
2. The method of claim 1, further comprising:
if the target backup device determines that the file results obtained by reading the source backup device according to the backup path corresponding to the at least one backup application program are all non-empty and the backup path corresponding to the non-empty file results is not matched with the intercepted root directory part, determining that the target download file does not belong to the backup application program;
and the target backup equipment abandons the downloading of the target download file.
3. The method of claim 1, wherein said target backup device calculates at least one file name corresponding to said target download file according to said constructed at least one said domain value and said intercepted said relative path portion, comprising:
FileName=SHA1("Domain-rPath");
wherein, FileName is the file name of the target download file, Domain is the Domain value, rPath is the relative path part, and SHA1 (") is the secure hash algorithm.
4. The method of claim 1, wherein the target backup device successfully establishing the backup connection with the source backup device comprises:
the target backup device establishes trust communication with the source backup device and determines that a backup function request of a backup service in the source backup device is successful, wherein a protocol version of the backup service of the source backup device meets a set version requirement.
5. The method according to claim 1, wherein the backup application comprises an iOS system application and a third party application, and the application identifier of the backup application comprises a fixed application identifier of the iOS system application and a unique application identifier of the third party application, wherein the fixed application identifier of the iOS system application is directly obtained by the source backup device, and the unique application identifier of the third party application is obtained by setting an installation proxy service for the source backup device.
6. A data backup apparatus, comprising:
the system comprises an acquisition module, a backup module and a backup module, wherein the acquisition module is used for acquiring an application identifier of at least one backup application program provided by a source backup device and acquiring a backup path corresponding to the at least one backup application program after the target backup device successfully establishes backup connection with the source backup device, and the source backup device is an iOS operating system;
a receiving module, configured to receive, by a target backup device, download description information of at least one target download file sent by a source backup device, where the download description information includes: the device absolute path of the target download file in the source backup device and the local storage path of the target download file in the target backup device;
a downloading module, configured to download, by the target backup device, the target download file to the local storage path if it is determined that the target download file belongs to the at least one backup application program according to backup checking information, where the backup checking information includes: the download description information and the application identifier of the at least one backup application program, or the download description information and the backup path corresponding to the at least one backup application program;
wherein the determining, by the target backup device according to the backup verification information, that the target download file belongs to the at least one backup application includes:
the target backup device intercepts a root directory part and a relative path part corresponding to the device absolute path of the target download file;
if the target backup device determines that the intercepted root directory part is matched with a backup path of a second target backup application program and a file result obtained by reading the source backup device according to the backup path of the second target backup application program is non-empty, determining that the target download file belongs to the second target backup application program;
if the target backup device determines that the file results obtained by reading the source backup device according to the backup path corresponding to the at least one backup application program are not all non-null and the backup path corresponding to the non-null file results is not matched with the intercepted root directory part, constructing a domain value according to the application identifier of the at least one backup application program;
the target backup device calculates at least one file name corresponding to the target download file according to the constructed at least one domain value and the intercepted relative path part;
if the target backup device determines that the calculated target file name is matched with the local storage path of the target download file, determining that the target download file belongs to a first target backup application program corresponding to the target file name;
the target backup device replaces the backup path of the first target backup application with the intercepted root directory portion;
the target backup device downloads the target download file to the local storage path, and the downloading includes:
and the target backup device reads the source backup device according to the intercepted root directory part and stores the obtained target download file into the local storage path.
7. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the method according to any of claims 1-5 when executing the program.
8. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1-5.
CN201810149357.4A 2018-02-13 2018-02-13 Data backup method, device, equipment and storage medium Active CN108268346B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810149357.4A CN108268346B (en) 2018-02-13 2018-02-13 Data backup method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810149357.4A CN108268346B (en) 2018-02-13 2018-02-13 Data backup method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN108268346A CN108268346A (en) 2018-07-10
CN108268346B true CN108268346B (en) 2021-03-30

Family

ID=62774207

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810149357.4A Active CN108268346B (en) 2018-02-13 2018-02-13 Data backup method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN108268346B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109669813A (en) * 2018-12-05 2019-04-23 深圳软牛科技有限公司 A kind of the incremental backup restoring method and device of iOS data
CN111611209A (en) * 2020-03-30 2020-09-01 北京瑞风协同科技股份有限公司 Method and system for storing virtual test data in task-divided manner
CN112328328B (en) * 2020-11-24 2023-07-25 北京百度网讯科技有限公司 Method, device, equipment and storage medium for equipment driving reload
CN112769801B (en) * 2020-12-31 2023-05-02 深圳软牛科技有限公司 Method, device, equipment and storage medium for extracting backup from cloud server
CN113505153B (en) * 2021-05-11 2024-06-04 深圳软牛科技有限公司 Memorandum backup method based on iOS system and related equipment
CN114328030B (en) * 2022-03-03 2022-05-20 成都云祺科技有限公司 File data backup method, system and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013134571A1 (en) * 2012-03-07 2013-09-12 Backup That, Inc. Online backup system
CN104123197A (en) * 2013-04-25 2014-10-29 南京邮电大学 Method for offline evidence-collecting without holding iOS device
CN104182294A (en) * 2013-05-23 2014-12-03 华为技术有限公司 Method and device for backing up and recovering file
CN104301382A (en) * 2014-09-03 2015-01-21 惠州Tcl移动通信有限公司 Cloud data backup and recovery method
CN104899116A (en) * 2015-06-11 2015-09-09 北京京东尚科信息技术有限公司 Data backup method, source server, target server and system
CN106201789A (en) * 2016-07-27 2016-12-07 北京金山安全软件有限公司 Data backup method and device and terminal
CN106445951A (en) * 2015-08-07 2017-02-22 中兴通讯股份有限公司 File transmission method and apparatus

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013134571A1 (en) * 2012-03-07 2013-09-12 Backup That, Inc. Online backup system
CN104123197A (en) * 2013-04-25 2014-10-29 南京邮电大学 Method for offline evidence-collecting without holding iOS device
CN104182294A (en) * 2013-05-23 2014-12-03 华为技术有限公司 Method and device for backing up and recovering file
CN104301382A (en) * 2014-09-03 2015-01-21 惠州Tcl移动通信有限公司 Cloud data backup and recovery method
CN104899116A (en) * 2015-06-11 2015-09-09 北京京东尚科信息技术有限公司 Data backup method, source server, target server and system
CN106445951A (en) * 2015-08-07 2017-02-22 中兴通讯股份有限公司 File transmission method and apparatus
CN106201789A (en) * 2016-07-27 2016-12-07 北京金山安全软件有限公司 Data backup method and device and terminal

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
iOS终端数字取证研究;苏芊;《中国优秀硕士学位论文全文数据库 信息科技辑》;20130715(第7期);第I138-87页 *

Also Published As

Publication number Publication date
CN108268346A (en) 2018-07-10

Similar Documents

Publication Publication Date Title
CN108268346B (en) Data backup method, device, equipment and storage medium
US20220109974A1 (en) Esim card change method and related device
CN107832100B (en) APK plug-in loading method and terminal thereof
US9210162B2 (en) Certificate based connection to cloud virtual machine
US20190190968A1 (en) Method for Migrating Data and Terminal
CN109413043B (en) Method and device for realizing dynamic configuration of database, electronic equipment and storage medium
EP3044936B1 (en) Method and apparatus of downloading and installing a client
CN105468362A (en) Application deployment method and cloud computing system
TW201606648A (en) Processing method and device of application
US20130060890A1 (en) Apparatus and method for providing application execution using a cloud system
CN109542862B (en) Method, device and system for controlling mounting of file system
CN108966159B (en) Short message withdrawing method, system, computer equipment and storage medium
CN107168765A (en) A kind of method and system of remote compilation software
CN111666745A (en) File downloading method, device, server and medium
CN111143031A (en) Method and device for changing capacity of virtual machine
CN113785293B (en) File storage service initiation for anti-virus software locally installed on user device
US9462459B2 (en) Mobile device configuration system and method
CN114281263A (en) Storage resource processing method, system and equipment of container cluster management system
JP2022501733A (en) Data management methods and devices and servers
CN106293814B (en) Upgrading method and device
CN109639629B (en) Data access processing method and device, computer equipment and storage medium
CN110659309A (en) Memory database communication method, device, server and storage medium
CN111124445A (en) Home gateway upgrading method and home gateway
CN104469704A (en) Method, apparatus and system for updating communication information
CN114237988B (en) Memory snapshot processing method and device, storage medium and electronic device

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
CB03 Change of inventor or designer information

Inventor after: Xie Qingquan

Inventor after: Wang Haixiao

Inventor after: Duan Chengge

Inventor after: Du Fushun

Inventor before: Xie Qingquan

Inventor before: Du Fushun

Inventor before: Wang Haixiao

CB03 Change of inventor or designer information
GR01 Patent grant
GR01 Patent grant