CN105468472B - Data backup and recovery method and device based on iOS operating system - Google Patents

Data backup and recovery method and device based on iOS operating system Download PDF

Info

Publication number
CN105468472B
CN105468472B CN201410333889.5A CN201410333889A CN105468472B CN 105468472 B CN105468472 B CN 105468472B CN 201410333889 A CN201410333889 A CN 201410333889A CN 105468472 B CN105468472 B CN 105468472B
Authority
CN
China
Prior art keywords
data
database
short message
reading
backup
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.)
Expired - Fee Related
Application number
CN201410333889.5A
Other languages
Chinese (zh)
Other versions
CN105468472A (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.)
Beijing Qihoo Technology Co Ltd
Qizhi Software Beijing Co Ltd
Original Assignee
Beijing Qihoo Technology Co Ltd
Qizhi Software Beijing 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 Beijing Qihoo Technology Co Ltd, Qizhi Software Beijing Co Ltd filed Critical Beijing Qihoo Technology Co Ltd
Priority to CN201410333889.5A priority Critical patent/CN105468472B/en
Publication of CN105468472A publication Critical patent/CN105468472A/en
Application granted granted Critical
Publication of CN105468472B publication Critical patent/CN105468472B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention discloses a data backup and recovery method and device based on an iOS operating system. The method comprises the following steps: calling a C language interface provided with a database reading right SQLite and provided by an iOS operating system through an application program, reading data to be backed up in a database, converting the read data to be backed up into machine language data in a data stream mode, and backing up the machine language data obtained through sequential conversion to preset backup equipment through a wireless communication interface connected with the C language interface of the SQLite. By applying the invention, the access security of the user can be improved. The data backup and recovery transmission data volume can be reduced, and the diversified requirements of users on data backup and recovery are met.

Description

Data backup and recovery method and device based on iOS operating system
Technical Field
The invention relates to an information backup technology, in particular to a data backup and recovery method and device based on an apple mobile (iOS) operating system.
Background
An apple mobile (iOS, iPhone OS) operating system is used as a mobile operating system developed by iOS devices such as iPhone, iPad, iPod and the like of apple company, and can be compatible with a large amount of application software, so that the individual requirements of different users are met, and more users are applied. Meanwhile, 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 rapidly increased. 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. For example, after a short message program in the iOS operating system receives and sends a short message, because the apple company does not provide a relevant interface for importing and exporting the short message at present, the short message received and sent in the iOS device can only be stored in the iOS device, so that the security of the data stored in the iOS device is low in a scene that data such as the short message needs to be backed up to improve the security of the data; meanwhile, external device data cannot be imported into the iOS device for backup, and user service experience is affected.
Currently, for a non-iOS device, for example, a fixed terminal device, some software, for example, a short message assistant, is developed to implement backup and recovery of a short message in the non-iOS device. Specifically, a short message assistant in a windows operating system or an OS X operating system is used for copying a short message database for storing short messages in the operating system by adopting a private Universal Serial Bus (USB) protocol, and the copied short message database is output to a preset non-iOS operating system server through a USB interface, so that the backup of the short messages is realized, and the short message recovery process is the reverse process of the short message backup process. The OS X operating system is a proprietary operating system developed by apple for Mac series products and is based on a UNIX system. Due to the difference in interfaces, data backup in non-iOS operating systems cannot be applied to iOS operating systems. Therefore, no technical solution capable of backing up data from the iOS operating system and restoring external data to the iOS operating system exists in the prior art.
Disclosure of Invention
In view of the above, the present invention is proposed to provide a data backup and recovery method and apparatus based on iOS operating system that overcomes or at least partially solves the above problems.
According to an aspect of the present invention, there is provided a data backup method based on an iOS operating system, the method comprising:
calling an SQLite C language interface provided with database reading rights and provided by an iOS operating system through an application program, and reading data to be backed up in a database;
and converting the read data to be backed up into machine language data in a data stream mode, and backing up the machine language data obtained by sequential conversion to preset backup equipment through a wireless communication interface connected with the SQLite C language interface.
Preferably, the reading of the data to be backed up in the database includes:
setting an iOS operating system to store newly generated data after the last data backup by adopting an incremental database;
and reading the data in the incremental database in the database.
Preferably, the method further comprises:
and after determining that the data backup is completed, the iOS operating system writes the data in the incremental database into the historical database and empties the incremental database.
Preferably, after storing the newly generated data after the last data backup and before reading the data in the incremental database, the method further includes:
and acquiring the updating date information of the data in the iOS operating system stored in the preset backup device, and executing the process of reading the incremental database if the updating date information is matched with the updating date information of the historical database.
Preferably, the incremental databases are multiple and are used for sequentially storing data newly generated after last data backup of the iOS operating system, and after the last incremental database stores data, writing data in the first incremental database storing the newly generated data into the database for storing data in the iOS operating system, emptying the first incremental database storing the newly generated data, and after the last incremental database stores the newly generated data after last data backup, before reading the data in the incremental database, the method further includes:
acquiring first updating date information of data in the iOS operating system stored by backup equipment;
acquiring second update date information of the plurality of incremental databases and third update date information of the historical database;
reading all incremental databases if the first update date information matches the third update date information; if the first update date information is matched with any update date information in the second update date information, reading all incremental databases behind the incremental database corresponding to the matched update date information; reading the plurality of incremental databases and the historical database if the first update date information precedes the third update date information.
Preferably, after converting the read data to be backed up into machine language data, the method further comprises:
and encrypting the computer data according to a preset encryption algorithm.
Preferably, the encryption algorithm comprises: enhanced data security protocols, data encryption algorithms, data encryption standards, and triple-layer data encryption standards.
Preferably, the method further comprises:
and deleting the data to be backed up in the database after the data to be backed up is determined to be completely backed up.
Preferably, the database is a short message database, and the short message database includes: short message table entries, session table entries, handle table entries, session-short message table entries, and session-handle table entries, wherein,
the short message list item is used for storing the short message identification;
the conversation table item is used for storing the short message conversation mark;
the handle table entry is used for storing a handle identifier;
the session-handle table entry is used for storing handle identification information corresponding to each short message session identification, wherein the handle information is short message contact person information corresponding to the short message;
and the session-short message list item is used for storing the short message corresponding to each short message session identifier.
Preferably, the converting the read data to be backed up into machine language data includes:
acquiring a data file corresponding to data to be backed up;
calling an InputStream attribute of the HttpPostedFile class to access the data file;
and calling a read method of the Stream class, and writing the accessed data file into an array of the Byte type in binary form.
Preferably, the backing up the converted machine language data to a preset backup device includes:
and acquiring the database structure information in the backup equipment, converting the converted machine language data into data conforming to the acquired database structure, and writing the data into the database in the backup equipment.
Preferably, the machine language data comprises: binary data, octal data, and hexadecimal data.
Preferably, the C language interface of the SQLite for setting the database reading authority includes:
acquiring a root authority of the iOS operating system;
searching a memory variable of a database reading authority in a C language interface process of the SQLite;
and adding the memory variable of the data database reading right in the memory variable of the database reading right.
According to another aspect of the present invention, there is provided a data recovery method based on an iOS operating system, the method including:
calling a wireless communication interface through an application program to receive machine language data, wherein the machine language data is data in a backup database read by backup equipment after receiving a data recovery request, and the read data is converted into the machine language data in a data stream mode;
and writing the received machine language data into a database in the iOS operating system through an SQLite C language interface which is connected with the wireless communication interface and is provided with database reading rights.
Preferably, the method further comprises:
decrypting the received machine language data.
Preferably, the machine language data is binary data, the binary data including: the short message content data, the short message session information corresponding to the short message content data, and one or more short message contact person information corresponding to the short message session information.
Preferably, the data recovery request carries time period information of data to be recovered, and the reading of the data in the backup database includes:
analyzing the data recovery request to acquire time period information;
and reading data contained in the time period information in the backup database.
Preferably, the C language interface of the SQLite for setting the database reading authority includes:
acquiring a root authority of the iOS operating system;
searching a memory variable of a database reading authority in a C language interface process of the SQLite;
and adding the memory variable of the data database reading right in the memory variable of the database reading right.
According to still another aspect of the present invention, there is provided an iOS operating system-based data backup apparatus, the apparatus including: a data reading module and a data conversion module, wherein,
the data reading module is used for calling an SQLite C language interface provided with database reading rights and provided by the iOS operating system through an application program and reading data to be backed up in the database;
and the data conversion module is used for converting the read data to be backed up into machine language data in a data stream mode, and backing up the converted machine language data to preset backup equipment through a wireless communication interface connected with the C language interface of the SQLite.
Preferably, the database is a short message database, and the data to be backed up includes: the short message content data, the short message session information corresponding to the short message content data, and one or more short message contact person information corresponding to the short message session information.
Preferably, the data reading module includes: an incremental database storage unit and a reading unit, wherein,
the incremental database storage unit is used for storing newly generated data after the previous data backup of the iOS operating system;
and the reading unit is used for reading the data stored in the increment database storage unit.
Preferably, the data reading module further comprises:
and the historical database storage unit is used for writing and storing the data in the incremental database after the iOS operating system determines that the data backup is finished, and emptying the incremental database storage unit.
Preferably, the data reading module further comprises:
and the first matching unit is used for acquiring the updating date information of the data in the iOS operating system stored in the preset backup device, and notifying the reading unit if the updating date information is matched with the updating date information of the historical database storage unit.
Preferably, the plurality of incremental database storage units are arranged and used for sequentially storing newly generated data after last data backup of the iOS operating system, writing data in a first incremental database storage unit for storing the newly generated data into the historical database storage unit after a last incremental database storage unit stores the data, and emptying the first incremental database storage unit for storing the newly generated data; the data reading module further comprises:
the second matching unit is used for acquiring first updating date information of data in the iOS operating system stored by the backup equipment; acquiring second update date information of the plurality of incremental databases and third update date information of the historical database; reading all incremental databases if the first update date information matches the third update date information; if the first update date information is matched with any update date information in the second update date information, reading all incremental databases behind the incremental database corresponding to the matched update date information; reading the plurality of incremental databases and the historical database if the first update date information precedes the third update date information.
Preferably, the data conversion module includes: a conversion unit and an output unit, wherein,
the conversion unit is used for converting the read data to be backed up into machine language data in a data stream mode;
and the output unit is used for backing up the converted machine language data to preset backup equipment through a wireless communication interface connected with the C language interface of the SQLite.
Preferably, the data conversion module further comprises:
and the encryption unit is used for encrypting the machine language data according to a preset encryption algorithm.
Preferably, the apparatus further comprises:
and the data deleting module is used for deleting the data to be backed up in the database after the data to be backed up is determined to be completely backed up.
According to still another aspect of the present invention, there is provided an iOS operating system-based data recovery apparatus, the apparatus including: a data receiving module and a data writing module, wherein,
the data receiving module is used for calling the wireless communication interface through an application program to receive machine language data, reading the data in the backup database after the backup device receives the data recovery request, and converting the read data into the machine language data in a data stream mode;
and the data writing module is used for writing the received machine language data into a database in the iOS operating system through an SQLite C language interface which is connected with the wireless communication interface and is provided with database reading rights.
Preferably, the apparatus further comprises:
and the decryption module is used for decrypting the received machine language data and outputting the decrypted machine language data to the data writing module.
Preferably, the machine language data is binary data, the binary data including: the short message content data, the short message session information corresponding to the short message content data, and one or more short message contact person information corresponding to the short message session information.
Preferably, the apparatus further comprises:
and the data request module is used for carrying time period information of the data to be recovered when the data recovery request is sent so that the backup equipment can analyze the data recovery request, acquire the time period information and read the data contained in the time period information in the backup database.
According to the data backup and recovery method and device based on the iOS operating system, the C language interface of the SQLite provided by the iOS operating system and provided with the database reading right can be called through an application program, the data to be backed up in the database is read, the read data to be backed up are converted into the machine language data in a data stream mode, and the machine language data obtained through sequential conversion are backed up to the preset backup device through the wireless communication interface connected with the C language interface of the SQLite. Therefore, the technical problems that data can be backed up from the iOS operating system and external data can be restored to the iOS operating system are solved, the transmission data volume for effectively reducing data backup and restoration is obtained, the data backup and restoration method is wide in adaptability, and the diversified requirements of users on data backup and restoration are met.
The foregoing description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
FIG. 1 shows a data backup method flow based on an iOS operating system according to an embodiment of the present invention;
FIG. 2 shows a flow of a data recovery method based on an iOS operating system according to an embodiment of the present invention;
FIG. 3 illustrates a data backup device structure based on an iOS operating system according to an embodiment of the present invention; and the number of the first and second groups,
fig. 4 shows a structure of a data recovery apparatus based on the iOS operating system according to an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
In the prior art, because the current apple company does not provide interfaces related to data backup and recovery for the iOS operating system, interaction between data in the iOS device and external devices cannot be realized, so that the security of the data is low, and the experience of user services is affected.
Furthermore, the existing non-iOS operating system (device) adopts a private USB protocol to copy the short message database in the operating system for backup and recovery, and because the private USB protocol is adopted and the transmission medium is a USB interface, the method cannot realize the recovery of the short message in the backed-up short message database to the short message database with structural change or the backup of the short message in the short message database with structural change to the short message database without structural change if the structure of the short message database changes, for example, the format or type of the stored short message changes after the iOS operating system is upgraded; moreover, for the short message backup and recovery across the operating systems, the short message backup and recovery cannot be realized by a method of directly copying the short message database due to incompatibility among the operating systems. For example, a short message backed up by a windows operating system cannot be restored to a short message database based on an android operating system or a saiban operating system. The existing non-iOS operating system can not realize the short message backup and recovery by directly copying the short message backup and recovery method of the short message database in the operating system by utilizing the private USB protocol when the structure of the short message database is changed or the short message backup and recovery of the cross-operating system are realized.
In the iOS operating system architecture, the method comprises the following steps: a Core OS layer, a Core Services layer, a Media layer, and a CocoaTouch layer, wherein,
the Core (Core) OS layer is an open-source Unix Core conforming to the POSIX standard and is used for providing basic functions of the iOS operating system, wherein the basic functions can be provided through C language APIs, and the Core (Core) OS layer comprises: hardware drive, memory management, program management, thread management (POSIX), file system, standard input and output, and the like. Wherein the hardware driver functionality of the core OS layer is used to provide an interface between the hardware and the system framework. Due to security-based considerations, only a limited class of system frameworks can access the hardware drivers in an iOS operating system.
The Core Services layer is on the Core OS layer, based on the foundation of the Core OS layer, provides richer functions, namely provides basic system Services for all application programs, is the foundation for basic system service construction, and comprises: framework function, wherein the framework (framework) is an API belonging to Objective-C, and the Core function is an API belonging to C language, and is used for providing basic functions of processing strings, arrangement, combination, calendar, time and the like.
The Media layer is used to provide multimedia functions such as pictures, music, movies, and the like.
The Cocoa Touch layer is located at the uppermost layer and is an API of Objective-C, wherein the most core part is UIKit. As one of the functions, the Cocoa Touch layer may provide various component presentations on an application program interface.
The C language APIs of the Core OS layer and the Core Services layer are implemented by using a C/C + + conventional interface function, and control the SQLite database to connect an object and a preset object, where the C/C + + conventional interface function includes: sqlite3_ open (), sqlite3_ prepare (), sqlite3_ step (), sqlite3_ column (), sqlite3_ finish (), sqlite3_ close (). Wherein, the SQLite database is a light relational database, can support the mainstream operating systems such as Windows/Linux/Unix and the like, the system realizes the association between a user and a database by utilizing a Client/Server (C/S, Client/Server) two-layer architecture, the Client calls a uniform C language API function (C/C + + conventional interface function), the connection is established with a remote server through the Internet, the bottom layer of the server is associated with the SQLITE database, the client side proposes a data access method, firstly the server takes over the data access method, the server submits the access methods to the SQLITE database one by one for processing, the results of the processing are then sent by the server to the client, since the server is accessible to all of the multiple user interfaces, yet supports network connectivity, therefore, all client connections and accesses are managed through the server, and the SQLITE database has a multi-user network access function.
In the embodiment of the invention, the data is read by using the SQLite C language interface provided by the iOS operating system, so that the data can be backed up based on the SQLite C language interface, and a specific implementation scheme for data backup and recovery based on the iOS operating system is provided, so that the data in the iOS operating system can be shared with external equipment, and the storage safety of the recorded data is improved.
Further, binary data is widely used in the field of computer communication, since each operating system can support binary data and can perform binary data conversion. In this way, in the embodiment of the present invention, the file is converted into the binary data, and the binary data is stored in the database, so that the data can be effectively backed up between the communication bodies based on any operating system, for example, the structure of the short message database changes, or a cross-operating system. Therefore, when the amount of data stored in the operating system is large, the excessive file system space of the operating system is occupied, the performance of the operating system is influenced, but a user expects to reserve the amount of data in the operating system, and the backup function of the embodiment of the invention can be used, so that the data can be recovered from the backed-up server at any time when the data needs to be checked later.
Fig. 1 shows a flow of a data backup method based on an iOS operating system according to an embodiment of the present invention. Referring to fig. 1, the process includes:
step 101, calling an SQLite C language interface provided with database reading rights and provided by an iOS operating system through an application program, and reading data to be backed up in a database;
in this step, different iOS operating systems have different database structures, and the data storage formats may be different in the different database structures.
As an alternative embodiment, the database may be a short message database. Wherein, the storage path of the short message database in the iOS operating system (device) is as follows: db/var/mobile/Library/SMS. The short message format of the short message with different short message database structures can be different. Of course, in practical application, the database may be an address book database, and the storage path of the address book database is as follows: var/mobile/library/Address book. As an alternative embodiment, the address book data is stored in the address book database in the format of addressbook.
Preferably, the database adopts the SQLite database format, wherein the suffix of the database conforming to the SQLite database format may be db or SQLite db.
In the embodiment of the invention, the short message database comprises: a short message (message) entry, a session (chat) entry, a handle (handle) entry, a session-short message (chat) chat _ message _ join entry, and a session-handle _ chat _ join entry, wherein,
the message list item is used for storing the short message identification; as an alternative embodiment, the short message identification value may be obtained by calculating the MD5 value in combination with the contact information and the sending time information. For example, when the operating system of the mobile terminal is an android operating system, there is a short message distributed to 10086 at 11 o' clock 07 on 28 th 12 th 2012, and since the time of the android system is measured by milliseconds beginning on 1 st 1 th 1970, the transmission time information date is 1356675643123, the contact information Address is 10086, and the short message identification value is obtained by calculating the MD5 value of the character string 135667564312310086.
The chat list item is used for storing the short message session identification;
handle list item for storing handle mark;
the chat _ handle _ join table entry is used for storing handle identification information corresponding to each short message session identification, wherein the handle information can be recipient information corresponding to the short message, namely short message contact information, and the handle information corresponding to each short message session is represented by the handle identification information.
In the embodiment of the present invention, the chat _ handle _ join entry includes: a short message session identification (chat _ id) field and a handle identification (handle _ id) field. The chat _ id field and the handle _ id field form a mapping relation, one chat _ id field can map a plurality of handle _ id fields, and a plurality of chat _ id fields can map one handle _ id field. When one chat _ id field maps a plurality of handle _ ids, the short message session corresponding to the chat _ id is a group sending session, that is, one group sending session corresponds to a plurality of short message contact information. In the iOS operating system, a plurality of short message contact information corresponding to the group sending session corresponds to one short message session. Through the chat _ handle _ join table entry, whether the short message is a single-sending short message or a group-sending short message can be determined.
And the chat _ message _ join table entry is used for storing the short message corresponding to each short message session identifier. Wherein each short message conversation corresponds to a short message.
As an alternative embodiment, the data stored in the iOS operating system may be stored entirely in the database. In this way, the database for storing data in the iOS operating system can be backed up to any backup device.
As another alternative embodiment, in the case that the backup device has backed up the database in the iOS operating system, and the data in the iOS operating system is backed up only by the backup device, since the backed up server may store the same data as the iOS operating system, if the database for storing data is directly backed up, the same data will be repeatedly transmitted between the iOS device and the backup device, so that the amount of transmission data for data backup and recovery is large, the time required for data backup and recovery is long, and the efficiency is low. Therefore, in order to effectively reduce the transmission amount of data, reading the data to be backed up in the database may include:
a11, setting an iOS operating system to store the newly generated data after the last data backup by adopting an incremental database;
in this step, the newly generated data includes the newly received short message (the content of the short message and the information of the contact person who sent the short message) and the newly sent short message after the last data backup. The group sending short message comprises short message content and contact person information corresponding to the group sending. For data such as non-short messages, the newly generated data includes new data and editing information of the original data. Wherein the editing of the data comprises: modified, deleted, replaced, etc. In this way, in the subsequent data backup, a corresponding processing policy may be executed according to the operation on the data, for example, if the data in the incremental database is new data, the new data may be directly written into the backup database in the subsequent backup, and if the data in the incremental database is deletion information on the original data, the data corresponding to the deletion information may be deleted from the backup database in the subsequent backup.
And A12, reading the data in the incremental database in the database.
In the embodiment of the invention, the data in the incremental database can be processed at regular time. Thus, the method may further comprise:
and after determining that the data backup is completed, the iOS operating system writes the data in the incremental database into the historical database and empties the incremental database.
In this step, after the data in the incremental database is backed up in the backup database, the data in the incremental database is emptied to store new incremental data.
As an alternative embodiment, after storing the newly generated data after the last data backup and before reading the data in the incremental database, the method further includes:
and acquiring the updating date information of the data in the iOS operating system stored in the preset backup device, and executing the process of reading the incremental database if the updating date information is matched with the updating date information of the historical database.
In this step, the update date information of the data in the iOS operating system stored by the backup device is the date information that the iOS operating system determines that the data backup is completed. After the data in the incremental database is written into the historical database, the update date information of the historical database is the date information of the last piece of data in the incremental database written into the historical database. And if the update date information of the data in the iOS operating system is the same as the update date information of the historical database, or the time difference between the update date information and the update date information of the data in the iOS operating system is smaller than a preset time difference threshold value, indicating that the update date information and the update date information of the data in the iOS operating system are matched.
Of course, in practical applications, a plurality of incremental databases may also be provided, and are used to sequentially store the data newly generated after the last data backup of the iOS operating system, and after the last incremental database stores the data, write the data in the first incremental database storing the newly generated data into the database for storing data in the iOS operating system, and empty the first incremental database storing the newly generated data. Thus, as another optional embodiment, after storing the newly generated data after the last data backup, before reading the incremental database as the database to be backed up, the method further includes:
b11, acquiring first update date information of the data in the iOS operating system stored by the backup device;
b12, acquiring second updating date information of the plurality of incremental databases and third updating date information of the historical database;
b13, reading all incremental databases if the first update date information matches the third update date information; if the first update date information is matched with any update date information in the second update date information, reading all incremental databases behind the incremental database corresponding to the matched update date information; reading the plurality of incremental databases and the historical database if the first update date information precedes the third update date information.
In this step, determining the data to be backed up according to the first update date information of the data in the iOS operating system stored in the backup device: if the first update date information is matched with the third update date information, the backup device is indicated to backup data which is backed up last time in the iOS operating system; if the first update date information is matched with any update date information in the second update date information, the backup device is indicated to backup data which are backed up last times in the iOS operating system, but the data in the iOS operating system are not backed up every time; if the first update date information is before the third update date information, it indicates that the backup device has not backed up data in the iOS operating system.
In the embodiment of the present invention, the C language interface of the SQLite for setting the database read permission includes:
acquiring a root authority of the iOS operating system;
searching a memory variable of a database reading authority in a C language interface process of the SQLite;
and adding the memory variable of the data database reading right in the memory variable of the database reading right.
And 102, converting the read data to be backed up into machine language data in a data stream mode, and backing up the machine language data obtained through sequential conversion to preset backup equipment through a wireless communication interface connected with the SQLite C language interface.
In this step, the protocols for converting data in different database structures are also different according to different database structures in the iOS operating system. Thus, through corresponding protocol conversion, data in different database structures can be converted into corresponding binary data in a data stream mode, namely, the backup data is continuously converted, and the converted backup data is transmitted.
As an optional embodiment, for the short message database, short messages (including group sending short messages) stored in the short message database, that is, chat _ message _ join entries, are converted into a string of Binary Data (Binary Data Stream) according to a preset Data Stream conversion protocol, and the converted Binary Data is stored (backed up) into the short message server through the wireless communication interface connected with the C language interface of the SQLite. The encoding mode of the binary data comprises the following steps: Binary-Coded decoder (BCD), extended BCD, American Standard Code for Information Interchange (ASCII), and Unicode (Unicode).
Further, for the group-sending short message, in the embodiment of the present invention, in addition to backing up the content of the short message, that is, the table entry of chat _ message _ join, the contact information corresponding to the short message session is backed up, that is, the table entry of chat _ handle _ join is backed up.
As an alternative embodiment, converting the read data to be backed up into binary data includes:
acquiring a data file corresponding to data to be backed up;
calling an InputStream attribute of the HttpPostedFile class to access the data file;
and calling a read method of the Stream class, and writing the accessed data file into an array of the Byte type in binary form.
As an alternative embodiment, the backup databases in different backup devices have different database structures, and store data in corresponding data formats. Therefore, in the embodiment of the present invention, the backing up to the preset backup device through the C language interface of the SQLite may include:
and obtaining the database structure information in the backup equipment, converting the received binary data stream into data conforming to the obtained database structure, and writing the data into the database in the backup equipment.
Further, in order to ensure the security of the data during the transmission process, after converting the read data to be backed up into a binary data stream, the method may further include:
and encrypting the binary data according to a preset encryption algorithm.
In this step, the encryption algorithm includes: enhanced Data Encryption protocol (AES), Data Encryption Algorithm (DEA), Data Encryption Standard (DES), and Triple Data Encryption Standard (3 DES).
As an alternative embodiment, for a situation that the amount of data stored in the operating system is large and occupies too much file system space of the operating system, the method may further include:
and 103, deleting the data to be backed up in the database after the data to be backed up is determined to be backed up.
In this step, after the data in the iOS operating system is backed up, the data in the database is deleted to save the file system space of the operating system.
FIG. 2 shows a flow of a data recovery method based on an iOS operating system according to an embodiment of the present invention. Referring to fig. 2, the process includes:
step 201, calling a wireless communication interface through an application program to receive machine language data, wherein the machine language data is data in a backup database read by backup equipment after receiving a data recovery request, and converting the read data into machine language data in a data stream manner;
in this step, when the iOS device needs to perform data recovery, a data recovery request is sent to the backup device, after receiving the data recovery request, the backup device reads data in the backup database, converts the read data into binary data in a data stream manner, and transmits the binary data to the iOS device, and the iOS device receives the binary data transmitted by the backup device by calling an SQLite C language interface provided by the iOS operating system.
As an alternative embodiment, the binary data may be transmitted by AirDrop (AirDrop), sms, and mail.
As an alternative embodiment, the method further comprises:
the received binary data is decrypted.
In this step, if the binary data is encrypted, the binary data to be restored is decrypted, and the decryption algorithm includes: enhanced data security protocols, data encryption algorithms, data encryption standards, and triple-layer data encryption standards, among others.
In the embodiment of the present invention, for the short message, the binary data includes: the short message content data, the short message session information corresponding to the short message content data, the one or more short message contact information corresponding to the short message session information, and the like. Therefore, when the short message is recovered, the short message is read from the short message server (backup device), and the read short message is converted into binary data according to a preset conversion protocol. Further, for the group sending short message, in the embodiment of the present invention, according to the relationship between the short message session and the short message contact information, and the relationship between the short message session and the short message, that is, the short message contact information corresponding to the short message session and the short message data corresponding to the short message session, when performing subsequent short message recovery, the group sending short message is classified into one short message session, so that when a user reads the recovered short message, the group sending short message can be effectively prevented from being recovered into a plurality of short message sessions, and the same short message data as before can be obtained.
As an optional embodiment, when the user sends the data recovery request, the user may also carry time period information of the data to be recovered. Thus, reading data in the backup database may include:
analyzing the data recovery request to acquire time period information;
and reading data contained in the time period information in the backup database.
Step 202, writing the received machine language data into a database in the iOS operating system through a C language interface of an SQLite connected to the wireless communication interface and having a database reading right.
In this step, based on the iOS operating system, database recovery paths corresponding to the corresponding data types are respectively set according to the data types to be recovered. The recovery path refers to a storage location of different types of data in a disk of the iOS device, and the storage location stores a database file of the type of data. For example, the recovery path of the data of the short message type may be set as follows: var/mobile/library/SMS, and storing the data of the short message type in the form of sms.db database file under the recovery path. For another example, the recovery path of the address book type data is set as follows: var/mobile/library/Address book.
It should be noted that, although only data of the short message type and the address book type are described in the present embodiment, the method of the present embodiment is also applicable to data of text types such as a call record type, a memo type, or a text for web browsing.
As can be seen from the above description, in the data backup method and the data recovery method based on the iOS operating system according to the embodiments of the present invention, after the intelligent mobile terminal device is replaced, for example, the intelligent mobile terminal device is replaced from the iPhone4 to the iPhone5s, or the intelligent mobile terminal device of the iOS operating system is replaced with the intelligent mobile terminal device of the android operating system, when short message data (including group-sending short message data) in the original intelligent mobile terminal device needs to be migrated to a new intelligent mobile terminal device, the backup and recovery functions according to the embodiments of the present invention may be used. And after the iOS operating system version is upgraded, for example, from the iOS5 operating system to the iOS6 operating system, the backup function of the embodiment of the present invention may be used to migrate the short message data (including the mass texting data) before the operating system is updated to the intelligent mobile terminal device after the operating system is updated. In addition, after the intelligent mobile terminal equipment is lost, new intelligent mobile terminal equipment is bought, and short message data (including group sending short message data) can be recovered by using the recovery function of the embodiment of the invention. In this way, the specific technical scheme that data can be backed up from the iOS operating system and external data can be restored to the iOS operating system is provided by calling the SQLite C language interface provided by the iOS operating system to read the data and converting the read data into a binary data stream. Meanwhile, after the iOS operating system is upgraded, if the structure of the short message database changes, for example, the format or the type of the stored short message changes, under the condition that the structure of the backed-up short message database does not change the same, the short message in the backed-up short message database can be restored to the short message database with the changed structure, and the short message in the short message database with the changed structure can be backed up to the short message database without the changed structure; further, for the short message backup and recovery of the cross-operating system, the short message data is converted into the binary data stream, so that the short message backup and recovery are realized. For example, the short message based on the iOS operating system can be backed up or restored to the short message database based on the android operating system and the saiban operating system, so that data loss can be effectively prevented, and the security of the data is improved. Moreover, incremental backup and recovery of the short messages are adopted, so that the transmission data volume of the short message backup and recovery is small, the time required by the short message backup and recovery is short, and the efficiency is high; in addition, the data backup and recovery method provided by the embodiment of the invention can be applied to operating systems of different versions, has wide adaptability, can meet the diversified requirements of users on short message (data) backup and recovery, and improves the service experience of the users.
Fig. 3 shows a data backup apparatus structure based on the iOS operating system according to an embodiment of the present invention. Referring to fig. 3, the apparatus is an iOS device comprising: a data reading module and a data conversion module, wherein,
the data reading module is used for calling an SQLite C language interface provided with database reading rights and provided by the iOS operating system through an application program and reading data to be backed up in the database;
in the embodiment of the invention, the database can be a short message database. The storage path of the short message database in the iOS device is as follows: db/var/mobile/Library/SMS. Correspondingly, the data to be backed up includes: the short message content data, the short message session information corresponding to the short message content data, and one or more short message contact person information corresponding to the short message session information.
As an alternative embodiment, the data reading module comprises: a delta database storage unit, and a reading unit (not shown), wherein,
the incremental database storage unit is used for storing newly generated data after the previous data backup of the iOS operating system;
and the reading unit is used for reading the data stored in the increment database storage unit.
Preferably, the data reading module may further include:
and the historical database storage unit is used for writing and storing the data in the incremental database after the iOS operating system determines that the data backup is finished, and emptying the incremental database storage unit.
As another alternative embodiment, the data reading module may further include:
and the first matching unit is used for acquiring the updating date information of the data in the iOS operating system stored in the preset backup device, and notifying the reading unit if the updating date information is matched with the updating date information of the historical database storage unit.
In practical application, the plurality of incremental database storage units may be arranged, and are used for sequentially storing newly generated data after last data backup of the iOS operating system, writing data in a first incremental database storage unit storing the newly generated data into the historical database storage unit after a last incremental database storage unit stores the data, and emptying the first incremental database storage unit storing the newly generated data; the data reading module may further include:
the second matching unit is used for acquiring first updating date information of data in the iOS operating system stored by the backup equipment; acquiring second update date information of the plurality of incremental databases and third update date information of the historical database; reading all incremental databases if the first update date information matches the third update date information; if the first update date information is matched with any update date information in the second update date information, reading all incremental databases behind the incremental database corresponding to the matched update date information; reading the plurality of incremental databases and the historical database if the first update date information precedes the third update date information.
And the data conversion module is used for converting the read data to be backed up into machine language data in a data stream mode, and backing up the converted machine language data to preset backup equipment through a wireless communication interface connected with the C language interface of the SQLite.
In an embodiment of the present invention, the data conversion module includes: a conversion unit, and an output unit (not shown in the figure), wherein,
the conversion unit is used for converting the read data to be backed up into machine language data in a data stream mode;
and the output unit is used for backing up the converted machine language data to preset backup equipment through a wireless communication interface connected with the C language interface of the SQLite.
In order to ensure the security of the data during the transmission process, as an optional embodiment, the data conversion module may further include:
and the encryption unit is used for encrypting the binary data stream according to a preset encryption algorithm.
In the embodiment of the invention, the encryption algorithm comprises the following steps: enhanced data security protocols, data encryption algorithms, data encryption standards, and Triple data encryption standards (3DES, Triple DES), among others.
As an alternative embodiment, the apparatus may further comprise:
and the data deleting module is used for deleting the data to be backed up in the database after the data to be backed up is determined to be completely backed up.
Fig. 4 shows a structure of a data recovery apparatus based on the iOS operating system according to an embodiment of the present invention. Referring to fig. 4, the apparatus is an iOS device, comprising: a data receiving module and a data writing module, wherein,
the data receiving module is used for calling the wireless communication interface through an application program to receive machine language data, reading the data in the backup database after the backup device receives the data recovery request, and converting the read data into the machine language data in a data stream mode;
and the data writing module is used for writing the received machine language data into a database in the iOS operating system through an SQLite C language interface which is connected with the wireless communication interface and is provided with database reading rights.
In an embodiment of the present invention, the apparatus may further include:
and the decryption module is used for decrypting the received machine language data and outputting the decrypted machine language data to the data writing module.
In the embodiment of the present invention, for the short message, the binary data includes: the short message content data, the short message session information corresponding to the short message content data, the one or more short message contact information corresponding to the short message session information, and the like.
As an alternative embodiment, the apparatus may further comprise:
and the data request module is used for carrying time period information of the data to be recovered when the data recovery request is sent so that the backup equipment can analyze the data recovery request, acquire the time period information and read the data contained in the time period information in the backup database.
The algorithms and displays presented herein are not inherently related to any particular computer, virtual machine, or other apparatus. Various general purpose systems may also be used with the teachings herein. The required structure for constructing such a system will be apparent from the description above. Moreover, the present invention is not directed to any particular programming language. It is appreciated that a variety of programming languages may be used to implement the teachings of the present invention as described herein, and any descriptions of specific languages are provided above to disclose the best mode of the invention.
In the description provided herein, numerous specific details are set forth. It is understood, however, that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the disclosure and aiding in the understanding of one or more of the various inventive aspects. However, the disclosed method should not be interpreted as reflecting an intention that: that the invention as claimed requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the detailed description are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate embodiment of this invention.
Those skilled in the art will appreciate that the modules in the device in an embodiment may be adaptively changed and disposed in one or more devices different from the embodiment. The modules or units or components of the embodiments may be combined into one module or unit or component, and furthermore they may be divided into a plurality of sub-modules or sub-units or sub-components. All of the features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or elements of any method or apparatus so disclosed, may be combined in any combination, except combinations where at least some of such features and/or processes or elements are mutually exclusive. Each feature disclosed in this specification (including any accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
Furthermore, those skilled in the art will appreciate that while some embodiments described herein include some features included in other embodiments, rather than other features, combinations of features of different embodiments are meant to be within the scope of the invention and form different embodiments. For example, in the following claims, any of the claimed embodiments may be used in any combination.
The various component embodiments of the invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. It will be appreciated by those skilled in the art that a microprocessor or Digital Signal Processor (DSP) may be used in practice to implement some or all of the functions of some or all of the components of the iOS operating system based data backup apparatus and the iOS operating system based data recovery apparatus according to embodiments of the present invention. The present invention may also be embodied as apparatus or device programs (e.g., computer programs and computer program products) for performing a portion or all of the methods described herein. Such programs implementing the present invention may be stored on computer-readable media or may be in the form of one or more signals. Such a signal may be downloaded from an internet web server or provided on a carrier signal or in any other form.
It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The usage of the words first, second and third, etcetera do not indicate any ordering. These words may be interpreted as names.
The invention discloses A1. a data backup method based on an iOS operating system, which comprises the following steps:
calling an SQLite C language interface provided with database reading rights and provided by an iOS operating system through an application program, and reading data to be backed up in a database;
and converting the read data to be backed up into machine language data in a data stream mode, and backing up the machine language data obtained by sequential conversion to preset backup equipment through a wireless communication interface connected with the SQLite C language interface.
A2. The method according to a1, wherein the reading data to be backed up in the database includes:
setting an iOS operating system to store newly generated data after the last data backup by adopting an incremental database;
and reading the data in the incremental database in the database.
A3. The method of a2, the method further comprising:
and after determining that the data backup is completed, the iOS operating system writes the data in the incremental database into the historical database and empties the incremental database.
A4. The method according to a2, after storing the newly generated data after the last data backup and before reading the data in the incremental database, the method further includes:
and acquiring the updating date information of the data in the iOS operating system stored in the preset backup device, and executing the process of reading the incremental database if the updating date information is matched with the updating date information of the historical database.
A5. The method according to a2, where the incremental databases are multiple and configured to sequentially store data newly generated after last data backup by the iOS operating system, and after the last incremental database stores data, write data in a first incremental database storing the newly generated data into a database for storing data in the iOS operating system, and empty the first incremental database storing the newly generated data, and after the last incremental database stores the newly generated data after last data backup, before reading data in the incremental database, the method further includes:
acquiring first updating date information of data in the iOS operating system stored by backup equipment;
acquiring second update date information of the plurality of incremental databases and third update date information of the historical database;
reading all incremental databases if the first update date information matches the third update date information; if the first update date information is matched with any update date information in the second update date information, reading all incremental databases behind the incremental database corresponding to the matched update date information; reading the plurality of incremental databases and the historical database if the first update date information precedes the third update date information.
A6. The method according to a1, after converting the read data to be backed up into machine language data, the method further comprising:
and encrypting the computer data according to a preset encryption algorithm.
A7. The method of a6, the encryption algorithm comprising: enhanced data security protocols, data encryption algorithms, data encryption standards, and triple-layer data encryption standards.
A8. The method of a1, the method further comprising:
and deleting the data to be backed up in the database after the data to be backed up is determined to be completely backed up.
A9. According to the method of a1, the database is a short message database, and the short message database includes: short message table entries, session table entries, handle table entries, session-short message table entries, and session-handle table entries, wherein,
the short message list item is used for storing the short message identification;
the conversation table item is used for storing the short message conversation mark;
the handle table entry is used for storing a handle identifier;
the session-handle table entry is used for storing handle identification information corresponding to each short message session identification, wherein the handle information is short message contact person information corresponding to the short message;
and the session-short message list item is used for storing the short message corresponding to each short message session identifier.
A10. The method according to a1, wherein the converting the read data to be backed up into machine language data includes:
acquiring a data file corresponding to data to be backed up;
calling an InputStream attribute of the HttpPostedFile class to access the data file;
and calling a read method of the Stream class, and writing the accessed data file into an array of the Byte type in binary form.
A11. The method according to a1, wherein the backing up the converted machine language data to a preset backup device comprises:
and acquiring the database structure information in the backup equipment, converting the converted machine language data into data conforming to the acquired database structure, and writing the data into the database in the backup equipment.
A12. The method of a1, the machine language data comprising: binary data, octal data, and hexadecimal data.
A13. According to the method A1, the C language interface of the SQLite for setting the database reading authority comprises the following steps:
acquiring a root authority of the iOS operating system;
searching a memory variable of a database reading authority in a C language interface process of the SQLite;
and adding the memory variable of the data database reading right in the memory variable of the database reading right.
A14. A data recovery method based on an iOS operating system comprises the following steps:
calling a wireless communication interface through an application program to receive machine language data, wherein the machine language data is data in a backup database read by backup equipment after receiving a data recovery request, and the read data is converted into the machine language data in a data stream mode;
and writing the received machine language data into a database in the iOS operating system through an SQLite C language interface which is connected with the wireless communication interface and is provided with database reading rights.
A15. The method of a14, the method further comprising:
decrypting the received machine language data.
A16. The method of a14, the machine language data being binary data comprising: the short message content data, the short message session information corresponding to the short message content data, and one or more short message contact person information corresponding to the short message session information.
A17. According to the method of a14, the data recovery request carries time period information of data to be recovered, and the reading of the data in the backup database includes:
analyzing the data recovery request to acquire time period information;
and reading data contained in the time period information in the backup database.
A18. According to the method A14, the C language interface of the SQLite for setting the database reading authority comprises the following steps:
acquiring a root authority of the iOS operating system;
searching a memory variable of a database reading authority in a C language interface process of the SQLite;
and adding the memory variable of the data database reading right in the memory variable of the database reading right.
A19. An iOS operating system-based data backup apparatus, the apparatus comprising: a data reading module and a data conversion module, wherein,
the data reading module is used for calling an SQLite C language interface provided with database reading rights and provided by the iOS operating system through an application program and reading data to be backed up in the database;
and the data conversion module is used for converting the read data to be backed up into machine language data in a data stream mode, and backing up the converted machine language data to preset backup equipment through a wireless communication interface connected with the C language interface of the SQLite.
A20. According to the apparatus of a19, the database is a short message database, and the data to be backed up includes: the short message content data, the short message session information corresponding to the short message content data, and one or more short message contact person information corresponding to the short message session information.
A21. The apparatus of a19, the data reading module comprising: an incremental database storage unit and a reading unit, wherein,
the incremental database storage unit is used for storing newly generated data after the previous data backup of the iOS operating system;
and the reading unit is used for reading the data stored in the increment database storage unit.
A22. The apparatus of a21, the data reading module further comprising:
and the historical database storage unit is used for writing and storing the data in the incremental database after the iOS operating system determines that the data backup is finished, and emptying the incremental database storage unit.
A23. The apparatus of a21, the data reading module further comprising:
and the first matching unit is used for acquiring the updating date information of the data in the iOS operating system stored in the preset backup device, and notifying the reading unit if the updating date information is matched with the updating date information of the historical database storage unit.
A24. According to the apparatus described in a22, the incremental database storage units are provided in plural, and are configured to sequentially store data newly generated after the last data backup of the iOS operating system, and after the last incremental database storage unit stores data, write data in the first incremental database storage unit storing the newly generated data into the historical database storage unit, and empty the first incremental database storage unit storing the newly generated data; the data reading module further comprises:
the second matching unit is used for acquiring first updating date information of data in the iOS operating system stored by the backup equipment; acquiring second update date information of the plurality of incremental databases and third update date information of the historical database; reading all incremental databases if the first update date information matches the third update date information; if the first update date information is matched with any update date information in the second update date information, reading all incremental databases behind the incremental database corresponding to the matched update date information; reading the plurality of incremental databases and the historical database if the first update date information precedes the third update date information.
A25. The apparatus of a19, the data conversion module comprising: a conversion unit and an output unit, wherein,
the conversion unit is used for converting the read data to be backed up into machine language data in a data stream mode;
and the output unit is used for backing up the converted machine language data to preset backup equipment through a wireless communication interface connected with the C language interface of the SQLite.
A26. The apparatus of a25, the data conversion module further comprising:
and the encryption unit is used for encrypting the machine language data according to a preset encryption algorithm.
A27. The apparatus of a19, the apparatus further comprising:
and the data deleting module is used for deleting the data to be backed up in the database after the data to be backed up is determined to be completely backed up.
A28. An iOS operating system based data recovery apparatus, the apparatus comprising: a data receiving module and a data writing module, wherein,
the data receiving module is used for calling the wireless communication interface through an application program to receive machine language data, reading the data in the backup database after the backup device receives the data recovery request, and converting the read data into the machine language data in a data stream mode;
and the data writing module is used for writing the received machine language data into a database in the iOS operating system through an SQLite C language interface which is connected with the wireless communication interface and is provided with database reading rights.
A29. The apparatus of a28, the apparatus further comprising:
and the decryption module is used for decrypting the received machine language data and outputting the decrypted machine language data to the data writing module.
A30. The apparatus of a28, the machine language data being binary data comprising: the short message content data, the short message session information corresponding to the short message content data, and one or more short message contact person information corresponding to the short message session information.
A31. The apparatus of a28, the apparatus further comprising:
and the data request module is used for carrying time period information of the data to be recovered when the data recovery request is sent so that the backup equipment can analyze the data recovery request, acquire the time period information and read the data contained in the time period information in the backup database.

Claims (23)

1. A data backup method based on an iOS operating system comprises the following steps:
calling an SQLite C language interface provided with database reading rights and provided by an iOS operating system through an application program, and reading data to be backed up in a database; the reading of the data to be backed up in the database comprises: setting an iOS operating system to store newly generated data after the last data backup by adopting an incremental database; reading data in an incremental database in the database;
converting the read data to be backed up into machine language data in a data stream mode, and backing up the machine language data obtained by sequential conversion to preset backup equipment through a wireless communication interface connected with a C language interface of the SQLite;
the backing up of the converted machine language data to a preset backup device includes:
obtaining database structure information in the backup equipment, converting the converted machine language data into data conforming to the obtained database structure, and writing the data into a database in the backup equipment;
after determining that the data backup is completed, the iOS operating system writes the data in the incremental database into the historical database and empties the incremental database;
after storing the newly generated data after the last data backup and before reading the data in the incremental database, the method further includes: and acquiring the updating date information of the data in the iOS operating system stored in the preset backup device, and executing the process of reading the incremental database if the updating date information is matched with the updating date information of the historical database.
2. The method as claimed in claim 1, wherein the incremental database is a plurality of incremental databases, and is used for sequentially storing the newly generated data after the last data backup of the iOS operating system, and after the last incremental database stores the data, writing the data in the first incremental database storing the newly generated data into the database for storing data in the iOS operating system, emptying the first incremental database storing the newly generated data, and after the storing the newly generated data after the last data backup, before reading the data in the incremental database, the method further comprises:
acquiring first updating date information of data in the iOS operating system stored by backup equipment;
acquiring second update date information of the plurality of incremental databases and third update date information of the historical database;
reading all incremental databases if the first update date information matches the third update date information; if the first update date information is matched with any update date information in the second update date information, reading all incremental databases behind the incremental database corresponding to the matched update date information; reading a plurality of incremental databases and the historical database if the first update date information precedes the third update date information.
3. The method of claim 1, after converting the read data to be backed up into machine language data, the method further comprising:
and encrypting the machine language data according to a preset encryption algorithm.
4. The method of claim 3, the encryption algorithm comprising: enhanced data security protocols, data encryption algorithms, data encryption standards, and triple-layer data encryption standards.
5. The method of claim 1, the method further comprising:
and deleting the data to be backed up in the database after the data to be backed up is determined to be completely backed up.
6. The method of claim 1, wherein the database is a short message database, and the short message database comprises: short message table entries, session table entries, handle table entries, session-short message table entries, and session-handle table entries, wherein,
the short message list item is used for storing the short message identification;
the conversation table item is used for storing the short message conversation mark;
the handle table entry is used for storing a handle identifier;
the session-handle table entry is used for storing handle identification information corresponding to each short message session identification, wherein the handle information is short message contact person information corresponding to the short message;
and the session-short message list item is used for storing the short message corresponding to each short message session identifier.
7. The method of claim 1, wherein converting the read data to be backed up into machine language data comprises:
acquiring a data file corresponding to data to be backed up;
calling an InputStream attribute of the HttpPostedFile class to access the data file;
and calling a read method of the Stream class, and writing the accessed data file into an array of the Byte type in binary form.
8. The method of claim 1, the machine language data comprising: binary data, octal data, and hexadecimal data.
9. The method of claim 1, wherein the C language interface of the SQLite for setting the database read authority comprises:
acquiring a root authority of the iOS operating system;
searching a memory variable of a database reading authority in a C language interface process of the SQLite;
and adding the memory variable of the data database reading right in the memory variable of the database reading right.
10. A data recovery method based on an iOS operating system comprises the following steps:
calling a wireless communication interface through an application program to receive machine language data, wherein the machine language data is data in a backup database read by backup equipment after receiving a data recovery request, and the read data is converted into the machine language data in a data stream mode;
writing the received machine language data into a database in the iOS operating system through an SQLite C language interface which is connected with the wireless communication interface and is provided with database reading rights;
the database is a short message database, and the short message database comprises: short message table entries, session table entries, handle table entries, session-short message table entries, and session-handle table entries, wherein,
the short message list item is used for storing the short message identification;
the conversation table item is used for storing the short message conversation mark;
the handle table entry is used for storing a handle identifier;
the session-handle table entry is used for storing handle identification information corresponding to each short message session identification, wherein the handle information is short message contact person information corresponding to the short message;
and the session-short message list item is used for storing the short message corresponding to each short message session identifier.
11. The method of claim 10, the method further comprising:
decrypting the received machine language data.
12. The method of claim 10, the machine language data being binary data, the binary data comprising: the short message content data, the short message session information corresponding to the short message content data, and one or more short message contact person information corresponding to the short message session information.
13. The method according to claim 10, wherein the data recovery request carries time period information of data to be recovered, and the reading data in the backup database includes:
analyzing the data recovery request to acquire time period information;
and reading data contained in the time period information in the backup database.
14. The method of claim 10, wherein the C language interface of the SQLite for setting the database read authority comprises:
acquiring a root authority of the iOS operating system;
searching a memory variable of a database reading authority in a C language interface process of the SQLite;
and adding the memory variable of the data database reading right in the memory variable of the database reading right.
15. An iOS operating system-based data backup apparatus, the apparatus comprising: a data reading module and a data conversion module, wherein,
the data reading module is used for calling an SQLite C language interface provided with database reading rights and provided by the iOS operating system through an application program and reading data to be backed up in the database;
the data reading module includes: the device comprises an incremental database storage unit, a historical database storage unit, a first matching unit and a reading unit, wherein the incremental database storage unit is used for storing data newly generated by the iOS after the last data backup; the reading unit is used for reading the data stored in the incremental database storage unit; the historical database storage unit is used for writing and storing the data in the incremental database after the iOS operating system determines that the data backup is finished, and emptying the incremental database storage unit; a first matching unit, configured to acquire update date information of data in the iOS operating system stored in a preset backup device, and notify a reading unit if the update date information matches with the update date information of the history database storage unit;
the data conversion module is used for converting the read data to be backed up into machine language data in a data stream mode and backing up the converted machine language data to preset backup equipment through a wireless communication interface connected with the C language interface of the SQLite;
the data conversion module includes: a conversion unit and an output unit, wherein,
the conversion unit is used for converting the read data to be backed up into machine language data in a data stream mode;
and the output unit is used for backing up the converted machine language data to preset backup equipment through a wireless communication interface connected with the C language interface of the SQLite.
16. The apparatus of claim 15, wherein the database is a short message database, and the data to be backed up comprises: the short message content data, the short message session information corresponding to the short message content data, and one or more short message contact person information corresponding to the short message session information.
17. The apparatus as claimed in claim 15, wherein the plurality of incremental database storage units are arranged to sequentially store the newly generated data after the last data backup of the iOS operating system, and after the last incremental database storage unit stores the data, write the data in the first incremental database storage unit storing the newly generated data into the historical database storage unit, and empty the first incremental database storage unit storing the newly generated data; the data reading module further comprises:
the second matching unit is used for acquiring first updating date information of data in the iOS operating system stored by the backup equipment; acquiring second update date information of the plurality of incremental databases and third update date information of the historical database; reading all incremental databases if the first update date information matches the third update date information; if the first update date information is matched with any update date information in the second update date information, reading all incremental databases behind the incremental database corresponding to the matched update date information; reading a plurality of incremental databases and the historical database if the first update date information precedes the third update date information.
18. The apparatus of claim 15, the data conversion module further comprising:
and the encryption unit is used for encrypting the machine language data according to a preset encryption algorithm.
19. The apparatus of claim 15, the apparatus further comprising:
and the data deleting module is used for deleting the data to be backed up in the database after the data to be backed up is determined to be completely backed up.
20. An iOS operating system based data recovery apparatus, the apparatus comprising: a data receiving module and a data writing module, wherein,
the data receiving module is used for calling the wireless communication interface through an application program to receive machine language data, reading the data in the backup database after the backup device receives the data recovery request, and converting the read data into the machine language data in a data stream mode;
the data writing module is used for writing the received machine language data into a database in the iOS through an SQLite C language interface which is connected with the wireless communication interface and provided with database reading rights;
the database is a short message database, and the short message database comprises: short message table entries, session table entries, handle table entries, session-short message table entries, and session-handle table entries, wherein,
the short message list item is used for storing the short message identification;
the conversation table item is used for storing the short message conversation mark;
the handle table entry is used for storing a handle identifier;
the session-handle table entry is used for storing handle identification information corresponding to each short message session identification, wherein the handle information is short message contact person information corresponding to the short message;
and the session-short message list item is used for storing the short message corresponding to each short message session identifier.
21. The apparatus of claim 20, the apparatus further comprising:
and the decryption module is used for decrypting the received machine language data and outputting the decrypted machine language data to the data writing module.
22. The apparatus of claim 20, the machine language data being binary data comprising: the short message content data, the short message session information corresponding to the short message content data, and one or more short message contact person information corresponding to the short message session information.
23. The apparatus of claim 20, the apparatus further comprising:
and the data request module is used for carrying time period information of the data to be recovered when the data recovery request is sent so that the backup equipment can analyze the data recovery request, acquire the time period information and read the data contained in the time period information in the backup database.
CN201410333889.5A 2014-07-14 2014-07-14 Data backup and recovery method and device based on iOS operating system Expired - Fee Related CN105468472B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410333889.5A CN105468472B (en) 2014-07-14 2014-07-14 Data backup and recovery method and device based on iOS operating system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410333889.5A CN105468472B (en) 2014-07-14 2014-07-14 Data backup and recovery method and device based on iOS operating system

Publications (2)

Publication Number Publication Date
CN105468472A CN105468472A (en) 2016-04-06
CN105468472B true CN105468472B (en) 2020-01-17

Family

ID=55606206

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410333889.5A Expired - Fee Related CN105468472B (en) 2014-07-14 2014-07-14 Data backup and recovery method and device based on iOS operating system

Country Status (1)

Country Link
CN (1) CN105468472B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106021021A (en) * 2016-05-13 2016-10-12 上海互盾信息科技有限公司 IPHONE short message false deletion recovery method
CN105975606A (en) * 2016-05-13 2016-09-28 上海互盾信息科技有限公司 IOS device contact mal-deletion recovery method
CN106407826A (en) * 2016-11-07 2017-02-15 珠海市魅族科技有限公司 Data preserving method and device
CN106649176A (en) * 2016-12-19 2017-05-10 深圳泰克威云储科技股份有限公司 Signal transmission method of intelligent storage device
CN107172165B (en) * 2017-05-25 2020-09-11 万兴科技股份有限公司 Data synchronization method and device
CN110399416B (en) * 2019-07-24 2023-08-22 成都甄识科技有限公司 Distributed database operation optimization access processing method and system

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101404792A (en) * 2008-10-24 2009-04-08 北京亿企通信息技术有限公司 Mobile phone message backup method and system
CN103200233A (en) * 2013-03-05 2013-07-10 广东欧珀移动通信有限公司 Message back-up method based on increment and system thereof

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140075583A1 (en) * 2012-09-10 2014-03-13 Apple Inc. Management of media items

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101404792A (en) * 2008-10-24 2009-04-08 北京亿企通信息技术有限公司 Mobile phone message backup method and system
CN103200233A (en) * 2013-03-05 2013-07-10 广东欧珀移动通信有限公司 Message back-up method based on increment and system thereof

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
HttpPostedFile 二进制文件上传;cherish;《URL:http://blog.163.com/wyp_xh2009/blog/static/19950810720136101285532/》;20130710;全文 *
iPhone怎么备份电话本和短信;苹果园;《URL:http://m.pc841.com/shouji/iPhone/9450.html》;20121124;全文 *
SQLite学习手册(内存数据库);Stephen_Liu;《URL:https://www.cnblogs.com/stephen-liu74/archive/2012/02/29/2328348.html》;20120229;全文 *
使用iTunes WIFI备份功能;APP111小编;《URL:http://www.app111.com/doc/100026302_1.html》;20130905;全文 *

Also Published As

Publication number Publication date
CN105468472A (en) 2016-04-06

Similar Documents

Publication Publication Date Title
CN105468472B (en) Data backup and recovery method and device based on iOS operating system
AU2012347883B2 (en) System and method for restoring application data
US9483357B2 (en) Selective restore from incremental block level backup
WO2019201039A1 (en) Method and system for updating application and application server
US9244960B2 (en) Metadata-driven version management service in pervasive environment
CN106843978B (en) SDK access method and system
CN107577420B (en) File processing method and device and server
US11308223B2 (en) Blockchain-based file handling
US11477179B2 (en) Searching content associated with multiple applications
US9716666B2 (en) Process cage providing attraction to distributed storage
US20120158657A1 (en) Role-specific access control to sections of artifact content within a configuration management (cm) system
US11157456B2 (en) Replication of data in a distributed file system using an arbiter
CN109729121B (en) Cloud storage system and method for realizing custom data processing in cloud storage system
CN112036125A (en) Document management method and device and computer equipment
CN107566499B (en) Data synchronization method, device and system
EP2686791B1 (en) Variants of files in a file system
US20150350315A1 (en) Zero copy volume reconstruction
CN110046510B (en) Cross-cloud data migration method, device and system
US9621424B2 (en) Providing a common interface for accessing and presenting component configuration settings
US20220382637A1 (en) Snapshotting hardware security modules and disk metadata stores
CN104281503A (en) Data backup method and related system
WO2018028321A1 (en) Method and apparatus for managing virtual external storage device, and terminal
US20220138220A1 (en) Dedicated replication channels for replicating records between regions
US8990265B1 (en) Context-aware durability of file variants
CN111310175A (en) iOS application safety monitoring and protecting method and device based on plug-in

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20200117