CN110471793B - Data backup method, data recovery method, first terminal and second terminal - Google Patents

Data backup method, data recovery method, first terminal and second terminal Download PDF

Info

Publication number
CN110471793B
CN110471793B CN201910650977.0A CN201910650977A CN110471793B CN 110471793 B CN110471793 B CN 110471793B CN 201910650977 A CN201910650977 A CN 201910650977A CN 110471793 B CN110471793 B CN 110471793B
Authority
CN
China
Prior art keywords
data
sim card
terminal
backup
backed
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910650977.0A
Other languages
Chinese (zh)
Other versions
CN110471793A (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.)
Vivo Mobile Communication Co Ltd
Original Assignee
Vivo Mobile Communication 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 Vivo Mobile Communication Co Ltd filed Critical Vivo Mobile Communication Co Ltd
Priority to CN201910650977.0A priority Critical patent/CN110471793B/en
Publication of CN110471793A publication Critical patent/CN110471793A/en
Application granted granted Critical
Publication of CN110471793B publication Critical patent/CN110471793B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1448Management of the data involved in backup or backup restore
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1448Management of the data involved in backup or backup restore
    • G06F11/1451Management of the data involved in backup or backup restore by selection of backup contents

Abstract

The invention provides a data backup method, a data recovery method, a first terminal and a second terminal, comprising the following steps: receiving a backup instruction under the condition that the SIM card is arranged in the first terminal; under the condition that the residual capacity value of the SIM card is smaller than the capacity value of the data to be backed up, selecting target backup data with the same data quantity and residual capacity value from the data to be backed up according to a backup instruction, and storing the target backup data to the SIM card; after the SIM card is moved out of the first terminal, if the SIM card is set in the first terminal again, all data in the SIM card are removed; and storing other backup data except the target backup data in the data to be backed up to the SIM card. The invention can use the storage space of the SIM card to backup and restore the data, the whole backup and restore operation only needs the user to insert and pull the card, and does not depend on the network environment, thereby reducing the complexity of the operation and improving the success rate and the efficiency of the data backup and restore.

Description

Data backup method, data recovery method, first terminal and second terminal
Technical Field
The embodiment of the invention relates to the technical field of terminals, in particular to a data backup method, a data recovery method, a first terminal and a second terminal.
Background
As the terminals are updated more and more frequently, the frequency of replacing the terminals by users is higher and higher, and the requirements for backing up and recovering the user information stored in the terminals are also increasing.
In the prior art, information of a user stored in a terminal is backed up and restored, specifically, an account corresponding to a cloud service or a third-party backup tool is logged in the terminal to be backed up, information of the user needing to be backed up is selected, the information of the user needing to be backed up is uploaded to a cloud server or a server of the third-party backup tool in a network environment, and after the uploading is finished, the user can download the information of the user stored in the server of the cloud server or the third-party backup tool in the network environment by logging in the account corresponding to the cloud service or the third-party backup tool in the terminal to be restored, and store the information of the user in a local corresponding position of the terminal to be restored, so that the purpose of transferring data of the user in the terminal to be backed up to the terminal to be restored is achieved.
However, in the current scheme, the account needs to be logged in both the backup operation and the recovery operation of the user's information, which results in tedious operation and poor user experience.
Disclosure of Invention
Embodiments of the present invention provide a data backup method, a data recovery method, a first terminal and a second terminal, so as to solve the problems in the prior art that a backup operation or a recovery operation may cause operations that are cumbersome, user experience is poor, and a backup operation or a recovery operation may fail at a high probability.
In a first aspect, an embodiment of the present invention provides a data backup method, which is applied to a first terminal, and the method includes:
receiving a backup instruction under the condition that the SIM card is arranged in the first terminal;
under the condition that the residual capacity value of the SIM card is smaller than the capacity value of the data to be backed up, selecting target backup data with the same data quantity as the residual capacity value from the data to be backed up according to the backup instruction, and storing the target backup data to the SIM card;
after the SIM card is moved out of the first terminal, if the SIM card is set in the first terminal again, clearing all data in the SIM card;
and after all the data in the SIM card are cleared, storing other backup data except the target backup data in the data to be backed up to the SIM card.
In a second aspect, an embodiment of the present invention provides a data recovery method, which is applied to a second terminal, and the method includes:
under the condition that an SIM card is arranged in the second terminal, receiving a recovery instruction, wherein the SIM card stores data to be recovered, and the data to be recovered comprises historical data and data to be backed up;
and storing the data to be restored in the SIM card to the local of the second terminal according to the restoring instruction.
In a third aspect, an embodiment of the present invention provides a first terminal, where the first terminal includes:
the first receiving module is used for receiving the backup instruction under the condition that the SIM card is arranged;
the first backup module is used for selecting target backup data with the same data volume as the residual capacity value from the data to be backed up according to the backup instruction and storing the target backup data into the SIM card under the condition that the residual capacity value of the SIM card is smaller than the capacity value of the data to be backed up;
a removing module, configured to remove all data in the SIM card if the SIM card is set again after the SIM card is removed from the first terminal;
and the second backup module is used for storing other backup data except the target backup data in the data to be backed up to the SIM card after all data in the SIM card are cleared.
In a fourth aspect, an embodiment of the present invention provides a second terminal, where the second terminal includes:
the second receiving module is used for receiving a recovery instruction under the condition that an SIM card is arranged, wherein the SIM card stores data to be recovered, and the data to be recovered comprises historical data and data to be backed up;
and the recovery module is used for storing the data to be recovered in the SIM card to the local of the second terminal according to the recovery instruction.
In a fifth aspect, an embodiment of the present invention further provides an apparatus, which includes a processor, a memory, and a computer program stored on the memory and executable on the processor, where the computer program, when executed by the processor, implements the steps of the data backup method and the data recovery method according to the present invention.
In a sixth aspect, the embodiments of the present invention further provide a readable storage medium, where instructions of the storage medium, when executed by a processor of an apparatus, enable the apparatus to perform the steps of the data backup method and the data recovery method provided by the present invention.
In the embodiment of the invention, the method comprises the following steps: receiving a backup instruction under the condition that the SIM card is arranged in the first terminal; under the condition that the residual capacity value of the SIM card is smaller than the capacity value of the data to be backed up, selecting target backup data with the same data quantity and residual capacity value from the data to be backed up according to a backup instruction, and storing the target backup data to the SIM card; after the SIM card is moved out of the first terminal, if the SIM card is set in the first terminal again, all data in the SIM card are removed; and after all the data in the SIM card are cleared, storing other backup data except the target backup data in the data to be backed up to the SIM card. The invention can utilize the storage space of the SIM card to store and backup the local data to be backed up of the first terminal in batches; and through the storage space of the SIM card, the backup data stored in the storage space is restored to the local of the second terminal in batches, and the whole backup and restoration operation only requires a user to insert and pull the card without depending on a network environment, so that the complexity of the operation is reduced, and the success rate and the efficiency of the data backup and restoration are improved.
Drawings
FIG. 1 is a flowchart illustrating steps of a data backup method according to an embodiment of the present invention;
fig. 2 is a flowchart illustrating specific steps of a data backup method according to an embodiment of the present invention;
fig. 3 is a flowchart illustrating specific steps of a data recovery method according to an embodiment of the present invention;
fig. 4 is a block diagram of a first terminal according to an embodiment of the present invention;
fig. 5 is a block diagram of a second terminal according to an embodiment of the present invention;
FIG. 6 is a block diagram of an apparatus of another embodiment of the invention;
fig. 7 is a schematic structural diagram of an apparatus according to another embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the invention are shown in the drawings, it should be understood that the invention can 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 invention to those skilled in the art.
Fig. 1 is a flowchart of steps of a data backup method provided in an embodiment of the present invention, where the method is applied to a first terminal, and data to be backed up is stored locally in the first terminal, as shown in fig. 1, the method may include:
step 101, receiving a backup instruction under the condition that the SIM card is arranged in the first terminal.
A Subscriber Identity Module (SIM) card is also called a smart card, and a terminal needs to be equipped with the SIM card to use the SIM card normally. In addition, the SIM card has a certain storage space, and the storage space in the SIM card can store short message information and/or contact information. In the embodiment of the present invention, the SIM card may be inserted into or removed from the first terminal, and when the SIM card is disposed in the first terminal, the first terminal may access the storage space in the SIM card, and the first terminal may obtain the data in the storage space and store the data in the local of the first terminal, or move the data in the local of the first terminal to the storage space.
The first terminal may locally store data to be backed up, where the data to be backed up may be short message information, contact information, and other user information. When the SIM card is set in the first terminal, the history data stored in the SIM card may also be stored in the local temporary storage space of the first terminal, so as to achieve the purpose of backing up the data in the SIM card.
In the embodiment of the invention, under the condition that the SIM card is arranged in the first terminal, the first terminal can receive the backup instruction through the preset quick backup inlet.
The shortcut backup entry can be specifically realized in a shortcut backup entry icon manner, that is, a user can click the shortcut backup entry icon displayed in the first terminal interface to receive a backup instruction, so that the purpose of one-key backup is achieved, and the problem that a backup operation trigger path is too deep in the prior art can be solved.
And 102, under the condition that the residual capacity value of the SIM card is smaller than the capacity value of the data to be backed up, selecting target backup data with the same data capacity as the residual capacity value from the data to be backed up according to the backup instruction, and storing the target backup data into the SIM card.
In the embodiment of the invention, after the SIM card is arranged in the first terminal, the first terminal can acquire the capacity information of the storage space of the SIM card and obtain the remaining capacity value of the SIM card, and under the condition that the remaining capacity value of the SIM card is smaller than the capacity value of the data to be backed up, the target backup data with the same data volume as the remaining capacity value can be selected from the data to be backed up according to the backup instruction, and the target backup data is stored in the SIM card.
Specifically, each data file in the data to be backed up may be sorted according to a preset sequence to form a data sequence, and target backup data having a data volume equal to the remaining capacity value is selected from the data to be backed up.
In addition, after the target backup data is stored in the SIM card, the first terminal may locally delete the target backup data to save a local storage space of the first terminal, and in addition, the first terminal may also locally retain the target backup data, which is not limited in the embodiment of the present invention.
For example, if the data to be backed up includes 10 pieces of short message information, the 10 pieces of short message information may be sorted according to the time stamps of the 10 pieces of short message information, so as to obtain a short message sequence, and a plurality of pieces of short message information having a total capacity that is the same as the remaining capacity value of the SIM card are selected from the earliest or latest end of the short message sequence, and the selected plurality of pieces of short message information are stored in the SIM card.
It should be noted that, when the remaining capacity value of the SIM card is greater than or equal to the capacity value of the data to be backed up, the data to be backed up may be directly stored in the SIM card according to the backup instruction.
Step 103, after the SIM card is moved out of the first terminal, if the SIM card is set in the first terminal again, all data in the SIM card is cleared.
In the embodiment of the present invention, after the target backup data is stored in the SIM card, the storage space of the SIM card is not left, at this time, the SIM card may be moved out of the first terminal, and the SIM card is set in the second terminal to which the data is to be restored to perform the data restoration operation, after the data restoration operation is completed, the SIM card may be set in the first terminal again, and when the SIM card is set in the first terminal again, all the data in the SIM card may be cleared, so that a sufficient space is reserved in the SIM card to store other backup data except the target backup data in the data to be backed up.
In step 101, when the SIM card is first set in the first terminal, since the history data stored in the SIM card is already stored in the local temporary storage space of the first terminal, the history data stored in the local temporary storage space of the first terminal can be recovered to the SIM card when the history data in the SIM card needs to be recovered subsequently, thereby avoiding the loss of the history data in the SIM card.
And step 104, after all the data in the SIM card are cleared, storing other backup data except the target backup data in the data to be backed up to the SIM card.
In the embodiment of the present invention, when the SIM card is set in the first terminal again, it may be considered that the data to be backed up for the first time is backed up to the second terminal, and at this time, other backup data except the target backup data in the data to be backed up may be stored in the SIM card.
Specifically, the storing of the other backup data to the SIM card may include acquiring a capacity value of the other backup data, and if the capacity value of the other backup data is less than or equal to the total capacity value of the SIM card, directly storing the other backup data to the SIM card. If the capacity value of the other backup data is larger than the total capacity value of the SIM card, data with the same capacity value as the total capacity value of the SIM card can be selected from the other backup data, and stored in the SIM card, and when the SIM card is removed and set again, the remaining data in the other backup data is stored in the SIM card until the data to be backed up of the first terminal is all restored to the second terminal.
To sum up, the data backup method provided by the embodiment of the present invention includes receiving a backup instruction when the SIM card is set in the first terminal; under the condition that the residual capacity value of the SIM card is smaller than the capacity value of the data to be backed up, selecting target backup data with the same data quantity and residual capacity value from the data to be backed up according to a backup instruction, and storing the target backup data to the SIM card; after the SIM card is moved out of the first terminal, if the SIM card is set in the first terminal again, all data in the SIM card are removed; and after all the data in the SIM card are cleared, storing other backup data except the target backup data in the data to be backed up to the SIM card. The invention can utilize the storage space of the SIM card to store and backup the local data to be backed up of the first terminal in batches; and through the storage space of the SIM card, the backup data stored in the storage space is restored to the local of the second terminal in batches, and the whole backup and restoration operation only requires a user to insert and pull the card without depending on a network environment, so that the complexity of the operation is reduced, and the success rate and the efficiency of the data backup and restoration are improved.
Fig. 2 is a flowchart of specific steps of a data backup method provided in an embodiment of the present invention, where the method is applied to a first terminal, and data to be backed up is locally stored in the first terminal, as shown in fig. 2, the method may include:
step 201, receiving a backup instruction under the condition that the SIM card is arranged in the first terminal.
This step may specifically refer to step 101, which is not described herein again.
Step 202, determining the repeated data which is the same as the historical data from the data to be backed up.
In the embodiment of the invention, when the SIM card is arranged in the first terminal, the history data stored in the SIM card can be stored in the local temporary storage space of the first terminal, so as to achieve the purpose of backing up the data in the SIM card.
After the history data stored in the SIM is stored in the local temporary storage space of the first terminal, the data with backup locally stored in the first terminal may be matched with the history data, the duplicate data in the data to be backed up, which is the same as the history data, may be determined, and a duplicate tag may be marked on the duplicate data.
Step 203, deleting the repeated data in the data to be backed up.
In this step, if there is duplicate data identical to the data to be backed up in the history data of the SIM, the duplicate data may be deleted from the data to be backed up, so as to avoid duplicating the duplicate data to the SIM card.
For example, for the contact information, if the history data of the SIM card stores the contact information of "zhang san" and the address book application of the first terminal also stores the contact information of "zhang san", if the data in the address book application of the first terminal is taken as the data to be backed up and backed up to the SIM card, the contact information of "zhang san" may be removed from the data to be backed up, so as to avoid duplicate copying of the contact information of "zhang san".
And 204, under the condition that the residual capacity value of the SIM card is smaller than the capacity value of the data to be backed up, selecting target backup data with the same data capacity as the residual capacity value from the data to be backed up according to the backup instruction, and storing the target backup data into the SIM card.
This step may specifically refer to step 102, which is not described herein again.
Optionally, in an implementation manner of the embodiment of the present invention, the data to be backed up includes a plurality of pieces of short message information, and step 204 may specifically include:
and a substep 2041 of sequencing the short message information according to the timestamp corresponding to the short message information to obtain a short message sequence.
In the embodiment of the invention, if the short message information is the received short message information, the timestamp corresponding to the short message information can be the receiving time when the short message information is received; if the short message information is the sent short message information, the timestamp corresponding to the short message information may be the sending time when the short message information is sent.
According to the timestamp corresponding to the short message information, the short message information can be sequenced from morning to evening or from evening to morning according to the time, so as to obtain a corresponding short message sequence.
Substep 2042, starting from one end of the short message sequence, selecting a plurality of continuous first short message messages with the same data volume as the residual capacity value, and storing the plurality of continuous first short message messages to the SIM card.
In the embodiment of the present invention, a plurality of consecutive pieces of first short message information may be selected from an earliest end or a latest end of the short message sequence, a data amount of the plurality of consecutive pieces of first short message information is the same as a remaining capacity value of the SIM card, and the plurality of consecutive pieces of first short message information are stored in the SIM card. After a plurality of continuous first short message information are stored in the SIM card, the storage space in the SIM card is full, at the moment, the first terminal can record the short message information of the last storage operation execution, so that the short message information after the short message information of the last storage operation execution is selected for backup in the short message sequence when the SIM card is arranged at the first terminal again next time.
In addition, after storing the consecutive pieces of first short message information to the SIM card, the first terminal may further generate a card pulling notification, such as: when the current SIM card is full of memory, please pull out the SIM card and set the SIM card in the mobile phone to be restored for data restoration. And informing the user that the storage space of the current SIM card is full, pulling out the SIM card from the first terminal, and setting the SIM card in the second terminal for data recovery.
Optionally, in an implementation manner of the embodiment of the present invention, the data to be backed up includes information of a plurality of contacts, and step 204 may specifically include:
substep 2043, determining the number of fields of the contact information.
In practical application, since in the storage space of the SIM card, there are usually specified upper limits of storage fields and limitations of storage field types for a piece of contact information, there is often no such requirement in the mobile terminal, which makes it impossible to completely backup the contact information in the mobile terminal, which includes more fields or has SIM card unrecognizable fields, into the SIM card, in the embodiment of the invention, the contact information with the number of fields exceeding the preset threshold value can be divided into a plurality of segment information storages, each segment information is regarded as one piece of contact information, and adds an identification corresponding to the contact only to a plurality of segment information under the same contact name, therefore, when the SIM card recovers the contact information at the second terminal, the second terminal can find a plurality of pieces of segment information under one contact name according to the identification and combine the plurality of pieces of segment information into one piece of contact information.
In this step, the contact information of the SIM card supports only saving fields of several types, i.e. name, phone Number, Additional Number (ANR), e-mail, and group, and each field has an upper limit of the Number of words, and the Number of fields of the contact information is determined, which may be the total Number of words for each type of field in the contact information.
And a substep 2044 of adding a corresponding contact identifier to the contact information when the number of fields of the contact information is less than or equal to a preset threshold value.
In this step, for the contact information in which the number of a field in the first terminal is less than or equal to the preset threshold and no unrecognizable field of the SIM card exists, a corresponding contact identifier may be directly added to the contact information, so that when the SIM card is set in the second terminal, the corresponding contact identifier is directly added according to the contact information, the contact information is imported into the address book application, and a corresponding contact is created. The contact person information added with the corresponding contact person identification can be the name of the contact person.
Substep 2045, when the number of fields of the contact information is greater than the preset threshold, splitting the contact information into a plurality of pieces of contact sub information, and adding a contact identifier corresponding to the contact information to each piece of contact sub information, wherein the number of fields of the contact sub information is less than or equal to the preset threshold.
In this step, for the contact information in which one field number is greater than the preset threshold and the SIM card unrecognizable field exists in the first terminal, the contact information may be split into a plurality of pieces of contact sub-information whose field number is less than or equal to the preset threshold, and a contact identifier corresponding to the contact information is added to each piece of contact sub-information.
Specifically, under the condition that the contact information of the SIM card only supports the storage of fields of types such as name, phone number, Additional Number (ANR), email, packet, and the like, for contact information whose field number is greater than a preset threshold and where there is a field that the SIM card cannot identify, different contact sub-information of the same contact may be classified into the same group by using a contact identifier, and further, different contact sub-information in the same group may be marked and distinguished by using an additional number field, so that one piece of contact information may be divided into multiple pieces of contact sub-information for storage, and when the contact information is restored, the contact sub-information may be queried and spliced by using the above rules.
Wherein, for the distribution of the contact person identification, the method comprises the following steps: judging whether a group named by a number exists in the current contact information, if not, splitting the contact information, wherein the contact identification used in the splitting of the contact information starts from the number 1, and if the group named by the number n exists, the contact identification starts from the position behind the existing number group name (namely n + 1).
Assignment of different contact sub-information for the same group: the contact sub-information corresponding to the name field may record current additional information (e.g., birthday, remarks, ring name, company name, home address, nickname, etc.); the contact person sub-information corresponding to the telephone number field can be used for recording the birthday date; the contact sub-information corresponding to the ANR field is used to distinguish the above-mentioned additional information. The ANR field is composed of two parts, the first part is four digits and is used for distinguishing current information, the second part is a real ANR number, and the specific allocation includes: the first digit in the first four digits represents whether the current contact has an additional number (0 represents no, 1 represents present), the second digit represents the number of the additional information (e.g. 0 represents the additional number, 1 represents birthday, 2 represents remark, 3 represents ring, 4 represents company name, 5 represents address, 6 represents nickname, etc., and at most 9 items are supported), the third digit represents how many pieces of the current additional information are, and the fourth digit represents the fourth piece of the current additional information.
For example, for one contact information: "name: and (5) opening the leaf. Telephone number: 123456. additional number: 5678. birthday: 1999.09.09. ringing: the song name. Company name: a company name. The house address: street address specific information. Nickname: a nickname. Remarking: xxxxxxxxxx ".
After the contact information is split into a plurality of contact sub-information, the following contents can be obtained:
contact person sub-information 1: name: zhang three telephone numbers: 123456 additional number: 00005678 contact identification: 1
Contact person sub-information 2: name: birthday telephone number: 1999.09.09 additional numbers: 1111 contact identification: 1
Contact person sub-information 3: name: xxxxxxxxxx telephone number: additional number: 1211 contact identification: 1
Contact person sub-information 4: name: song name phone number: additional number: 1311 contact identification: 1
Contact person sub-information 5: name: company name telephone number: additional number: 1411 contact identification: 1
Contact person sub-information 6: name: street address specific letter telephone number: additional number: 1521 contact identification: 1
Contact person sub-information 7: name: telephone number of message: additional number: 1522 contact identification: 1
Contact person sub-information 8: name: nickname telephone number: additional number: 1611 contact identification: 1.
as can be seen from the above, when the number of words of the additional information exceeds the maximum number of words (7) storable in the name field, the divided information is stored, and how many pieces of information are currently divided and currently belong to the second segment are retained in the additional number information. Thus, when the SIM card is set to the second terminal, the second terminal can perform matching population by reading these fields.
Substep 2046, classify the contact person identification to get multiple categories.
In this step, the contact information corresponding to the contact identifier can be classified according to the frequency of use of the contact information corresponding to the contact identifier by the user and the keyword information acquired when the user makes a call or receives and sends a short message, so as to obtain a plurality of categories.
For example, for a category in which contact information that is used more frequently is labeled as a parent, the category may be processed preferentially when backup or recovery of contact information is performed. For a category of contacts marked as strangers for which infrequent use contact information is made, the category may be processed with hysteresis as backup of contact information is performed.
Substep 2047, according to preset rules, adding weight values to each of the categories.
In the embodiment of the invention, the corresponding weight value can be set for the category according to the use frequency of the contact person information in the category, and the higher the use frequency of the contact person information in the category is, the larger the weight value of the category is; the lower the frequency of use of the contact information in the category, the smaller the weight value of the category.
Substep 2048, selecting a plurality of pieces of first contact information with the same data volume as the residual capacity value from the category with the largest weight value according to the backup instruction, and storing the first contact information in the SIM card.
In the embodiment of the present invention, when performing backup operation, backup of contact information in corresponding categories may be performed in an order from a large weight value to a small weight value, and after the backup of contact information in a category with a large weight value is completed, backup processing may be further performed on contact information in a category with a small weight value, where some first contact information including a plurality of first contact sub-information may exist in all first contact information in the category, that is, a set of first contact sub-information having the same contact identifier may be used as one first contact information.
Substep 2049, among the classes not yet backed up, determines the target class with the largest weight value.
After the storage space in the SIM card is full, if there are other categories for which contact information is not backed up, the target category with the largest weight value may be determined among the categories for which backup is not completed, and a notification is generated to prompt the user which categories are currently backed up, which categories are not backed up, and the category with the highest priority among the categories for which backup is not completed (for example, parent category backup is completed, friend category backup is completed, remaining colleague categories and stranger categories are not completed, and backup is requested to start from the colleague categories for the next backup).
Step 205, after the SIM card is removed from the first terminal, if the SIM card is set in the first terminal again, all data in the SIM card is cleared.
This step may specifically refer to step 103, which is not described herein again.
Step 206, after all data in the SIM card are cleared, storing other backup data in the data to be backed up, except the target backup data, to the SIM card.
This step may specifically refer to step 104, which is not described herein again.
Optionally, in an implementation manner of the embodiment of the present invention, the data to be backed up includes multiple pieces of short message information, and step 206 may specifically include:
substep 2061, removing the continuous first short message messages from the short message sequence.
In this step, after all the short message information in the SIM card is restored to the second terminal and all the data in the SIM card is cleared, consecutive pieces of first short message information restored to the second terminal may be removed from the short message sequence, where the removing operation may be to remove consecutive pieces of first short message information in the short message sequence and delete the data content of consecutive pieces of first short message information; or only moving out continuous first short message information in the short message sequence, and not deleting the data content of the continuous first short message information.
A substep 2062, starting from one end of the short message sequence, selecting a plurality of continuous second short message messages with the data volume same as the total capacity value of the SIM card, and storing the plurality of continuous second short message messages to the SIM card.
In the embodiment of the invention, because continuous pieces of first short message information which are backed up to the second terminal are removed from the short message sequence, and the storage space of the SIM card is empty, in the step, continuous pieces of second short message information with the data volume being the same as the total capacity value of the SIM card can be selected from one end of the short message sequence in the short message sequence, and the continuous pieces of second short message information are stored in the SIM card, so that the aim of further linking the next backup operation from the short message information of which the last backup operation is finished is fulfilled until all the short message information is backed up.
Optionally, in an implementation manner of the embodiment of the present invention, the data to be backed up includes information of a plurality of contacts, and step 206 may specifically include:
substep 2063, starting from the target category, selecting a plurality of pieces of second contact information with the data volume being the same as the total capacity value of the SIM card, and storing the second contact information in the SIM card.
In the embodiment of the present invention, after the storage space in the SIM card is full, if there are contact information in other categories that are not backed up, the target category with the largest weight value may be determined in the category that is not backed up according to the operation of step 2049, in this step, when the SIM card is moved out of the first terminal and is set in the first terminal again, the first terminal may select, starting from the target category, a plurality of pieces of second contact information having the same data volume as the total capacity value of the SIM card, and store the second contact information in the SIM card until after multiple rounds of SIM card removal and insertion operations, all pieces of classified contact information are backed up. In this case, some second contact information including a plurality of second contact sub-information may exist in all the second contact information in the category, that is, a set of second contact sub-information having the same contact identification may be used as one second contact information.
To sum up, the data backup method provided by the embodiment of the present invention includes receiving a backup instruction when the SIM card is set in the first terminal; under the condition that the residual capacity value of the SIM card is smaller than the capacity value of the data to be backed up, selecting target backup data with the same data quantity and residual capacity value from the data to be backed up according to a backup instruction, and storing the target backup data to the SIM card; after the SIM card is moved out of the first terminal, if the SIM card is arranged in the first terminal again, all data in the SIM card are removed; and after all the data in the SIM card are cleared, storing other backup data except the target backup data in the data to be backed up to the SIM card. The invention can utilize the storage space of the SIM card to store and backup the local data to be backed up of the first terminal in batches; and through the storage space of the SIM card, the backup data stored in the storage space is restored to the local of the second terminal in batches, and the whole backup and restoration operation only requires a user to insert and pull the card without depending on a network environment, so that the complexity of the operation is reduced, and the success rate and the efficiency of the data backup and restoration are improved.
Fig. 3 is a flowchart of steps of a data recovery method according to an embodiment of the present invention, where the method is applied to a second terminal, and as shown in fig. 3, the method may include:
and 301, receiving a recovery instruction under the condition that the SIM card is arranged in the second terminal.
In the embodiment of the invention, under the condition that the SIM card is arranged at the second terminal, the second terminal can receive the recovery instruction through the preset quick recovery inlet.
The shortcut recovery entry can be specifically realized in a shortcut recovery entry icon mode, that is, a user can click the shortcut recovery entry icon displayed in the second terminal interface to receive a recovery instruction, so that the purpose of one-key recovery is achieved, and the problem that a recovery operation trigger path is too deep in the prior art can be solved.
Step 302, according to the recovery instruction, storing the data to be recovered in the SIM card to the local of the second terminal.
In the embodiment of the present invention, the SIM card stores data to be restored, where the data to be restored includes historical data stored by the SIM card before data backup, and data to be backed up stored in the data backup process.
And storing all the data to be recovered in the SIM card to a local preset storage position of the second terminal according to the recovery instruction. In addition, according to the recovery instruction, the user can select a part of data to be recovered and store the part of data to be recovered to a local preset storage position of the second terminal.
For example, when the data to be recovered includes short message information, the short message information may be imported into a short message application of the second terminal, and the short message information may be stored in a local storage location of the short message application; when the data to be restored includes the contact information, the contact information may be imported into the address book application of the second terminal, and the contact information may be stored in a local storage location of the address book application.
Optionally, the data to be recovered includes a plurality of pieces of short message information and a plurality of timestamps corresponding to the plurality of pieces of short message information; the step 302 includes:
and a substep 3021, importing a plurality of pieces of short message information corresponding to the plurality of timestamps into the short message application of the second terminal according to the recovery instruction and the sequence of the plurality of timestamps.
In this step, according to the recovery instruction, all the short message information stored in the SIM card is imported into the short message application of the second terminal according to the sequence of the plurality of timestamps, so as to achieve the purpose of backing up the short message information in the first terminal to the second terminal.
Optionally, the data to be recovered includes multiple pieces of contact information, multiple contact identifiers corresponding to the multiple pieces of contact information, and/or multiple pieces of contact sub-information, and contact identifiers corresponding to the multiple pieces of contact sub-information; the step 302 includes:
and a substep 3022, importing a plurality of pieces of contact information corresponding to the contact identifier into the address book application of the second terminal according to the recovery instruction.
In this step, the multiple pieces of contact information corresponding to the contact identifiers one to one are imported into the address book application of the second terminal, and the address book application of the second terminal can establish the multiple pieces of contact information corresponding to the number of the contact identifiers.
And a substep 3023, synthesizing the contact sub-information with the same contact identifier into a new piece of contact information according to the recovery instruction, and importing the new contact information into the address book application of the second terminal.
In this step, according to the recovery instruction, the second terminal may search for the sub-information of the contact having the same contact identifier, and combine the sub-information of the contact with the sub-information of the contact to be a new contact information corresponding to the contact identifier, and then import the new contact information into the address book application of the second terminal. The embodiment of the invention achieves the aim of backing up and recovering the information without complicated operation by simplifying and serializing the operation of backing up and recovering the contact information and the short message information.
In addition, the contact information is divided, so that the problem that the contact information is too much and cannot be completely backed up in the SIM card can be avoided, and the integrity of the contact information transferred through the SIM card is ensured.
To sum up, the data recovery method provided by the embodiment of the present invention includes receiving a recovery instruction when the SIM card is disposed at the second terminal, where the SIM card stores data to be recovered, and the data to be recovered includes historical data and data to be backed up; and storing the data to be recovered in the SIM card to the local of the second terminal according to the recovery instruction. The invention can utilize the storage space of the SIM card to store and backup the local data to be backed up of the first terminal in batches; and through the storage space of the SIM card, the backup data stored in the storage space is restored to the local of the second terminal in batches, and the whole backup and restoration operation only requires a user to insert and pull the card without depending on a network environment, so that the complexity of the operation is reduced, and the success rate and the efficiency of the data backup and restoration are improved.
Fig. 4 is a block diagram of a first terminal according to an embodiment of the present invention, and as shown in fig. 4, the first terminal 40 includes:
a first receiving module 401, configured to receive a backup instruction when the SIM card is installed in the first terminal;
a first backup module 402, configured to, when the remaining capacity value of the SIM card is smaller than the capacity value of the data to be backed up, select, according to the backup instruction, target backup data with a data amount that is the same as the remaining capacity value from the data to be backed up, and store the target backup data in the SIM card;
optionally, the data to be backed up includes a plurality of pieces of short message information, and the first backup module 402 is specifically configured to:
sequencing the short message information according to the timestamp corresponding to the short message information to obtain a short message sequence;
and starting from one end of the short message sequence, selecting continuous multiple pieces of first short message information with the same data volume as the residual capacity value, and storing the continuous multiple pieces of first short message information to the SIM card.
Optionally, the first backup module 402 is specifically configured to:
classifying the contact person identification to obtain a plurality of categories;
adding a weight value to each category according to a preset rule;
selecting a plurality of pieces of first contact information with the same data volume as the residual capacity value from the category with the maximum weight value according to the backup instruction, and storing the first contact information in the SIM card;
and determining a target category with the largest weight value in the categories which are not backed up.
A removing module 403, configured to remove all data in the SIM card if the SIM card is set in the first terminal again after the SIM card is removed from the first terminal;
a second backup module 404, configured to store, after all data in the SIM card is cleared, other backup data in the data to be backed up, except the target backup data, to the SIM card.
Optionally, the second backup module 404 is specifically configured to:
removing the continuous first short message information from the short message sequence;
and starting from one end of the short message sequence, selecting a plurality of continuous second short message messages with the same data volume as the total capacity value of the SIM card, and storing the plurality of continuous second short message messages to the SIM card.
Optionally, the second backup module 404 is specifically configured to:
and selecting a plurality of pieces of second contact information with the same data volume as the total capacity value of the SIM card from the target category, and storing the second contact information to the SIM card.
Optionally, the data to be backed up includes information of a plurality of contacts, and the first terminal further includes:
the field determining module is used for determining the number of the fields of the contact information;
the identification module is used for adding corresponding contact person identification for the contact person information under the condition that the field number of the contact person information is smaller than or equal to a preset threshold value;
the splitting module is used for splitting the contact person information into a plurality of pieces of contact person sub information under the condition that the number of the fields of the contact person information is larger than the preset threshold value, wherein the number of the fields of the contact person sub information is smaller than or equal to the preset threshold value;
and the adding module is used for adding a contact person identifier corresponding to the contact person information for each piece of contact person sub information.
The repeated data determining module is used for determining the repeated data which is the same as the historical data from the data to be backed up;
and the deduplication module is used for deleting the repeated data in the data to be backed up.
In summary, the first terminal provided in the embodiment of the present invention includes receiving a backup instruction when the SIM card is disposed in the first terminal; under the condition that the residual capacity value of the SIM card is smaller than the capacity value of the data to be backed up, selecting target backup data with the same data quantity and residual capacity value from the data to be backed up according to a backup instruction, and storing the target backup data to the SIM card; after the SIM card is moved out of the first terminal, if the SIM card is set in the first terminal again, all data in the SIM card are removed; and after all the data in the SIM card are cleared, storing other backup data except the target backup data in the data to be backed up to the SIM card. The invention can utilize the storage space of the SIM card to store and backup the local data to be backed up of the first terminal in batches; and through the storage space of the SIM card, the backup data stored in the storage space is restored to the local of the second terminal in batches, and the whole backup and restoration operation only requires a user to insert and pull the card without depending on a network environment, so that the complexity of the operation is reduced, and the success rate and the efficiency of the data backup and restoration are improved.
Fig. 5 is a block diagram of a second terminal according to an embodiment of the present invention, and as shown in fig. 5, the second terminal 50 includes:
a second receiving module 501, configured to receive a recovery instruction when an SIM card is installed in a second terminal, where the SIM card stores data to be recovered, and the data to be recovered includes history data and data to be backed up;
a recovery module 502, configured to store the data to be recovered in the SIM card to the local of the second terminal according to the recovery instruction.
To sum up, the second terminal provided in the embodiment of the present invention includes receiving a recovery instruction when the SIM card is disposed in the second terminal, where the SIM card stores data to be recovered, and the data to be recovered includes historical data and data to be backed up; and storing the data to be recovered in the SIM card to the local of the second terminal according to the recovery instruction. The invention can utilize the storage space of the SIM card to store and backup the local data to be backed up of the first terminal in batches; and through the storage space of the SIM card, the backup data stored in the storage space is restored to the local of the second terminal in batches, and the whole backup and restoration operation only requires a user to insert and pull the card without depending on a network environment, so that the complexity of the operation is reduced, and the success rate and the efficiency of the data backup and restoration are improved.
An embodiment of the present invention further provides an apparatus, including a processor, a memory, and a computer program stored in the memory and capable of running on the processor, where the computer program, when executed by the processor, implements each process of the data recovery method embodiment, and can achieve the same technical effect, and details are not repeated here to avoid repetition.
The embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program implements each process of the data recovery method embodiment, and can achieve the same technical effect, and in order to avoid repetition, details are not repeated here. The computer-readable storage medium may be a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk.
Fig. 6 is a block diagram of an apparatus of another embodiment of the present invention. The apparatus 600 shown in fig. 6 comprises: at least one processor 601, memory 602, at least one network interface 604, a user interface 603, and a camera 606. The various components in the device 600 are coupled together by a bus system 605. It is understood that the bus system 605 is used to enable communications among the components. The bus system 605 includes a power bus, a control bus, and a status signal bus in addition to a data bus. For clarity of illustration, however, the various buses are labeled as bus system 605 in fig. 6.
The user interface 603 may include, among other things, a display, a keyboard, or a pointing device (e.g., a mouse, trackball, touch pad, or flexible screen, among others.
It will be appreciated that the memory 602 in embodiments of the invention may be either volatile memory or nonvolatile memory, or may include both volatile and nonvolatile memory. The non-volatile memory may be a Read-only memory (ROM), a programmable Read-only memory (PROM), an erasable programmable Read-only memory (erasabprom, EPROM), an electrically erasable programmable Read-only memory (EEPROM), or a flash memory. The volatile memory may be a Random Access Memory (RAM) which serves as an external cache. By way of example, and not limitation, many forms of RAM are available, such as static random access memory (StaticRAM, SRAM), dynamic random access memory (dynamic RAM, DRAM), synchronous dynamic random access memory (synchronous DRAM, SDRAM), Double Data Rate Synchronous Dynamic Random Access Memory (DDRSDRAM), Enhanced synchronous SDRAM (ESDRAM), synchronous link dynamic random access memory (synchlink DRAM, SLDRAM), and direct memory bus random access memory (DRRAM). The memory 602 of the subject systems and methods is intended to comprise, without being limited to, these and any other suitable types of memory.
In some embodiments, memory 602 stores the following elements, executable modules or data structures, or a subset thereof, or an expanded set thereof: an operating system 6021 and application programs 6022.
The operating system 6021 includes various system programs, such as a framework layer, a core library layer, a driver layer, and the like, and is used for implementing various basic services and processing hardware-based tasks. The application 6022 includes various applications such as a media player (MediaPlayer), a Browser (Browser), and the like, and is used to implement various application services. A program implementing the method of an embodiment of the invention can be included in the application program 6022.
In the embodiment of the present invention, the processor 601 is configured to receive a backup instruction when the SIM card is set in the first terminal by calling a program or an instruction stored in the memory 602, specifically, a program or an instruction stored in the application 6022; under the condition that the residual capacity value of the SIM card is smaller than the capacity value of the data to be backed up, selecting target backup data with the same data quantity as the residual capacity value from the data to be backed up according to a backup instruction, and storing the target backup data into the SIM card; after the SIM card is moved out of the first terminal, if the SIM card is set in the first terminal again, all data in the SIM card are removed; after all data in the SIM card are cleared, storing other backup data in the data to be backed up, except for the target backup data, to the SIM card, where the processor 601 is further configured to receive a recovery instruction when the SIM card is set in the second terminal, where the data to be recovered is stored in the SIM card, and the data to be recovered includes history data and the data to be backed up; and storing the data to be recovered in the SIM card to the local of the second terminal according to the recovery instruction.
The method disclosed by the above-mentioned embodiment of the present invention can be applied to the processor 601, or implemented by the processor 601. The processor 601 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware or instructions in the form of software in the processor 601. The processor 601 may be a general-purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic device, or discrete hardware components. The various methods, steps and logic blocks disclosed in the embodiments of the present invention may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in connection with the embodiments of the present invention may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software module may be located in ram, flash memory, rom, prom, or eprom, registers, etc. storage media as is well known in the art. The storage medium is located in the memory 602, and the processor 601 reads the information in the memory 602 and completes the steps of the method in combination with the hardware thereof.
It is to be understood that the embodiments described herein may be implemented in hardware, software, firmware, middleware, microcode, or any combination thereof. For a hardware implementation, the processing units may be implemented within one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), general purpose processors, controllers, micro-controllers, microprocessors, other electronic units configured to perform the functions described herein, or a combination thereof.
For a software implementation, the techniques described in this disclosure may be implemented with modules (e.g., procedures, functions, and so on) that perform the functions described in this disclosure. The software codes may be stored in a memory and executed by a processor. The memory may be implemented within the processor or external to the processor.
The apparatus 600 is capable of implementing each process implemented by the apparatus in the foregoing embodiments, and is not described here again to avoid repetition.
In the embodiment of the present invention, the apparatus 600 may receive a backup instruction when the SIM card is set in the first terminal; under the condition that the residual capacity value of the SIM card is smaller than the capacity value of the data to be backed up, selecting target backup data with the same data quantity and residual capacity value from the data to be backed up according to a backup instruction, and storing the target backup data to the SIM card; after the SIM card is moved out of the first terminal, if the SIM card is set in the first terminal again, all data in the SIM card are removed; and after all the data in the SIM card are cleared, storing other backup data except the target backup data in the data to be backed up to the SIM card. The invention can utilize the storage space of the SIM card to store and backup the local data to be backed up of the first terminal in batches; and the backup data stored in the storage space is restored to the local part of the second terminal in batches through the storage space of the SIM card, the whole backup and restoration operation only needs a user to insert and pull the card, and the SIM card does not depend on a network environment, so that the complexity of the operation is reduced, and the success rate and the efficiency of data backup and restoration are improved.
Fig. 7 is a schematic structural diagram of an apparatus according to another embodiment of the present invention.
Specifically, the apparatus 700 in fig. 7 may be a mobile phone, a tablet computer, a Personal Digital Assistant (PDA), or a vehicle-mounted computer.
The apparatus 700 of fig. 7 includes a Radio Frequency (RF) circuit 710, a memory 720, an input unit 730, a display unit 740, a processor 760, an audio circuit 760, a wireless local area network (wireless fidelity) module 780, a power supply 790, and a camera 7110.
The input unit 730 may be used, among other things, to receive numeric or character information input by a user and to generate signal inputs related to user settings and function control of the apparatus 700. Specifically, in the embodiment of the present invention, the input unit 730 may include a touch panel 731. The touch panel 731 is capable of collecting touch operations performed by a user (e.g. operations performed by the user on the touch panel 731 by using a finger, a stylus, or any other suitable object or accessory) and driving the corresponding connection device according to a predetermined program. Alternatively, the touch panel 731 may include two parts of a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 760, and can receive and execute commands sent from the processor 760. In addition, the touch panel 731 may be implemented by various types, such as a resistive type, a capacitive type, an infrared ray, and a surface acoustic wave. In addition to the touch panel 731, the input unit 730 may include other input devices 732, and the other input devices 732 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like.
Among them, the display unit 740 may be used to display information input by a user or information provided to a user and various menu interfaces of the apparatus. The display unit 740 may include a display panel 741, and optionally, the display panel 741 may be configured in the form of an LCD or an organic light-emitting diode (OLED).
It should be noted that the touch panel 731 can cover the display panel 741 to form a touch display screen, and when the touch display screen detects a touch operation on or near the touch display screen, the touch display screen is transmitted to the processor 760 to determine the type of the touch event, and then the processor 760 provides a corresponding visual output on the touch display screen according to the type of the touch event.
The touch display screen comprises an application program interface display area and a common control display area. The arrangement modes of the application program interface display area and the common control display area are not limited, and can be an arrangement mode which can distinguish two display areas, such as vertical arrangement, left-right arrangement and the like. The application interface display area may be used to display an interface of an application. Each interface may contain at least one interface element such as an icon and/or widget desktop control for an application. The application interface display area may also be an empty interface that does not contain any content. The common control display area is used for displaying controls with high utilization rate, such as application icons like setting buttons, interface numbers, scroll bars, phone book icons and the like.
Wherein the processor 760 is the control center of the apparatus 700, connects the various parts of the entire handset using various interfaces and routes, performs various functions of the apparatus 700 and processes data by running or executing software programs and/or modules stored in the first memory 721 and calling up data stored in the second memory 722, thereby monitoring the apparatus 700 as a whole. Alternatively, processor 760 may include one or more processing units.
In the embodiment of the present invention, the processor 760 is configured to receive a backup instruction in case that the SIM card is set in the first terminal by calling a software program and/or a module stored in the first memory 721 and/or data stored in the second memory 722; under the condition that the residual capacity value of the SIM card is smaller than the capacity value of the data to be backed up, selecting target backup data with the same data quantity and residual capacity value from the data to be backed up according to a backup instruction, and storing the target backup data to the SIM card; after the SIM card is moved out of the first terminal, if the SIM card is set in the first terminal again, all data in the SIM card are removed; after all data in the SIM card are cleared, storing other backup data in the data to be backed up, except the target backup data, to the SIM card, where the processor 760 is further configured to receive a recovery instruction when the SIM card is set in the second terminal, where the data to be recovered is stored in the SIM card, and the data to be recovered includes history data and the data to be backed up; and storing the data to be recovered in the SIM card to the local of the second terminal according to the recovery instruction.
Therefore, in the embodiment of the present invention, the device may receive the backup instruction when the SIM card is set in the first terminal; under the condition that the residual capacity value of the SIM card is smaller than the capacity value of the data to be backed up, selecting target backup data with the same data quantity and residual capacity value from the data to be backed up according to a backup instruction, and storing the target backup data to the SIM card; after the SIM card is moved out of the first terminal, if the SIM card is set in the first terminal again, all data in the SIM card are removed; and after all the data in the SIM card are cleared, storing other backup data except the target backup data in the data to be backed up to the SIM card. The invention can utilize the storage space of the SIM card to store and backup the local data to be backed up of the first terminal in batches; and through the storage space of the SIM card, the backup data stored in the storage space is restored to the local of the second terminal in batches, and the whole backup and restoration operation only requires a user to insert and pull the card without depending on a network environment, so that the complexity of the operation is reduced, and the success rate and the efficiency of the data backup and restoration are improved.
For the above device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and for the relevant points, refer to the partial description of the method embodiment.
The embodiments in the present specification are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.
As is readily imaginable to the person skilled in the art: any combination of the above embodiments is possible, and thus any combination between the above embodiments is an embodiment of the present invention, but the present disclosure is not necessarily detailed herein for reasons of space.
The data recovery methods provided herein are not inherently related to any particular computer, virtual system, or other apparatus. Various general purpose systems may also be used with the teachings herein. The structure required to construct a system incorporating aspects of the present invention 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 invention 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 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. Those skilled in the art will appreciate that a microprocessor or Digital Signal Processor (DSP) may be used in practice to implement some or all of the functionality of some or all of the components of the method according to embodiments of the 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 website 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.

Claims (14)

1. A data backup method is applied to a first terminal, and the local storage of the first terminal stores data to be backed up, and the method comprises the following steps:
receiving a backup instruction under the condition that the SIM card is arranged in the first terminal;
under the condition that the residual capacity value of the SIM card is smaller than the capacity value of the data to be backed up, selecting target backup data with the same data quantity as the residual capacity value from the data to be backed up according to the backup instruction, and storing the target backup data to the SIM card;
after the SIM card is moved out of the first terminal, if the SIM card is set in the first terminal again, clearing all data in the SIM card;
and after all the data in the SIM card are cleared, storing other backup data except the target backup data in the data to be backed up to the SIM card.
2. The method as claimed in claim 1, wherein the data to be backed up includes a plurality of pieces of short message information, and the selecting target backup data with a data amount equal to the residual capacity value from the data to be backed up according to the backup instruction and storing the target backup data in the SIM card comprises:
sequencing the short message information according to the timestamp corresponding to the short message information to obtain a short message sequence;
and starting from one end of the short message sequence, selecting continuous multiple pieces of first short message information with the same data volume as the residual capacity value, and storing the continuous multiple pieces of first short message information to the SIM card.
3. The method of claim 2, wherein storing other backup data in the data to be backed up, except for the target backup data, to the SIM card comprises:
removing the continuous first short message information from the short message sequence;
and starting from one end of the short message sequence, selecting a plurality of continuous second short message messages with the same data volume as the total capacity value of the SIM card, and storing the plurality of continuous second short message messages to the SIM card.
4. The method according to claim 1, wherein the data to be backed up includes a plurality of pieces of contact information, and before the selecting, according to the backup instruction, target backup data having a data size equal to the size of the remaining capacity value from the data to be backed up and storing the target backup data in the SIM card, the method further comprises:
determining the number of fields of the contact information;
under the condition that the number of the fields of the contact person information is larger than a preset threshold value, splitting the contact person information into a plurality of pieces of contact person sub information, wherein the number of the fields of the contact person sub information is smaller than or equal to the preset threshold value;
and adding a contact person identifier corresponding to the contact person information for each piece of contact person sub information.
5. The method according to claim 1, wherein the SIM card stores therein history data, and further comprising, after receiving a backup instruction in a case where the SIM card is set in the first terminal and in a case where a remaining capacity value of the SIM card is smaller than a capacity value of the data to be backed up, selecting, according to the backup instruction, target backup data having a data volume equal to the remaining capacity value from the data to be backed up and storing the target backup data in front of the SIM card, the method further comprising:
determining repeated data which is the same as the historical data from the data to be backed up;
and deleting the repeated data in the data to be backed up.
6. A data recovery method, applied to a second terminal, the method comprising:
receiving a recovery instruction under the condition that an SIM card is arranged in the second terminal, wherein the SIM card stores data to be recovered, the data to be recovered comprises historical data and target backup data, and the target backup data is data which is selected from the data to be recovered and is locally stored in the first terminal and has the same size as the residual capacity value of the SIM card when the SIM card is arranged in the first terminal;
according to the recovery instruction, storing the data to be recovered in the SIM card to the local of the second terminal;
after the SIM card is moved out of the first terminal, if the SIM card is set in the first terminal again, all data in the SIM card are removed, and after all data in the SIM card are removed, the SIM card continuously stores other backup data, except the target backup data, selected from the data to be backed up by the first terminal.
7. A first terminal, a local storage of which stores data to be backed up, the first terminal comprising:
the first receiving module is used for receiving a backup instruction under the condition that the SIM card is arranged in the first terminal;
the first backup module is used for selecting target backup data with the same data volume as the residual capacity value from the data to be backed up according to the backup instruction and storing the target backup data into the SIM card under the condition that the residual capacity value of the SIM card is smaller than the capacity value of the data to be backed up;
a removing module, configured to remove all data in the SIM card if the SIM card is set in the first terminal again after the SIM card is removed from the first terminal;
and the second backup module is used for storing other backup data except the target backup data in the data to be backed up to the SIM card after all data in the SIM card are cleared.
8. The first terminal of claim 7, wherein the data to be backed up includes a plurality of short message messages, and the first backup module is specifically configured to:
sequencing the short message information according to the timestamp corresponding to the short message information to obtain a short message sequence;
and starting from one end of the short message sequence, selecting a plurality of continuous first short message messages with the same data volume as the residual capacity value, and storing the plurality of continuous first short message messages to the SIM card.
9. The first terminal of claim 8, wherein the second backup module is specifically configured to:
removing the continuous first short message information from the short message sequence;
and starting from one end of the short message sequence, selecting a plurality of continuous second short message messages with the same data volume as the total capacity value of the SIM card, and storing the plurality of continuous second short message messages to the SIM card.
10. The first terminal of claim 7, wherein the data to be backed up includes a plurality of pieces of contact information, and the first terminal further comprises:
the field determining module is used for determining the number of the fields of the contact information;
the splitting module is used for splitting the contact person information into a plurality of pieces of contact person sub information under the condition that the number of the fields of the contact person information is larger than a preset threshold value, wherein the number of the fields of the contact person sub information is smaller than or equal to the preset threshold value;
and the adding module is used for adding a contact person identifier corresponding to the contact person information for each piece of contact person sub information.
11. The first terminal of claim 7, wherein the first terminal further comprises:
the repeated data determining module is used for determining the repeated data which is the same as the historical data from the data to be backed up;
and the deduplication module is used for deleting the repeated data in the data to be backed up.
12. A second terminal, characterized in that the second terminal comprises:
the second receiving module is used for receiving a recovery instruction under the condition that an SIM card is arranged in the second terminal, the SIM card stores data to be recovered, the data to be recovered comprises historical data and target backup data, and the target backup data is backup data which is selected from the data to be backed up and is locally stored in the first terminal and has the same size as the residual capacity value of the SIM card when the SIM card is arranged in the first terminal;
the recovery module is used for storing the data to be recovered in the SIM card to the local of the second terminal according to the recovery instruction;
after the SIM card is moved out of the first terminal, if the SIM card is set in the first terminal again, all data in the SIM card are removed, and after all data in the SIM card are removed, the SIM card continuously stores other backup data, except the target backup data, selected from the data to be backed up by the first terminal.
13. Backup device, comprising a processor, a memory and a computer program stored on the memory and executable on the processor, the computer program, when being executed by the processor, implementing the steps of the data backup method according to any of claims 1 to 5.
14. A recovery device comprising a processor, a memory and a computer program stored on the memory and executable on the processor, the computer program, when executed by the processor, implementing the steps of the data recovery method of claim 6.
CN201910650977.0A 2019-07-18 2019-07-18 Data backup method, data recovery method, first terminal and second terminal Active CN110471793B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910650977.0A CN110471793B (en) 2019-07-18 2019-07-18 Data backup method, data recovery method, first terminal and second terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910650977.0A CN110471793B (en) 2019-07-18 2019-07-18 Data backup method, data recovery method, first terminal and second terminal

Publications (2)

Publication Number Publication Date
CN110471793A CN110471793A (en) 2019-11-19
CN110471793B true CN110471793B (en) 2022-05-06

Family

ID=68509669

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910650977.0A Active CN110471793B (en) 2019-07-18 2019-07-18 Data backup method, data recovery method, first terminal and second terminal

Country Status (1)

Country Link
CN (1) CN110471793B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114281604B (en) * 2022-03-02 2022-07-29 北京金山云网络技术有限公司 Data recovery method and device, electronic equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101674583A (en) * 2009-08-25 2010-03-17 联信摩贝软件(北京)有限公司 Method for hiding or recovering personal information when changing SIM card and system thereof
CN101814045A (en) * 2010-04-22 2010-08-25 华中科技大学 Data organization method for backup services
CN106569910A (en) * 2016-09-29 2017-04-19 广东欧珀移动通信有限公司 Data backup and transmission method, and mobile terminal
CN108170560A (en) * 2017-12-27 2018-06-15 上海传英信息技术有限公司 Data back up method and terminal
CN108206998A (en) * 2016-12-20 2018-06-26 北京小米移动软件有限公司 Obtain the method and device of end message

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106550031B (en) * 2016-10-25 2019-07-23 Oppo广东移动通信有限公司 The method and device of data backup

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101674583A (en) * 2009-08-25 2010-03-17 联信摩贝软件(北京)有限公司 Method for hiding or recovering personal information when changing SIM card and system thereof
CN101814045A (en) * 2010-04-22 2010-08-25 华中科技大学 Data organization method for backup services
CN106569910A (en) * 2016-09-29 2017-04-19 广东欧珀移动通信有限公司 Data backup and transmission method, and mobile terminal
CN108206998A (en) * 2016-12-20 2018-06-26 北京小米移动软件有限公司 Obtain the method and device of end message
CN108170560A (en) * 2017-12-27 2018-06-15 上海传英信息技术有限公司 Data back up method and terminal

Also Published As

Publication number Publication date
CN110471793A (en) 2019-11-19

Similar Documents

Publication Publication Date Title
US20220322054A1 (en) Short Message Processing Method and Apparatus, and Electronic Device
CN109359091B (en) File management method, device, terminal and computer readable storage medium
CN105068726B (en) Information processing method and terminal
KR20140120673A (en) Mobile terminal and method for processing notification information
CN105794155B (en) Method, device and equipment for displaying message
CN104572348A (en) Terminal
CN105893471B (en) Data processing method and electronic equipment
CN106776908B (en) Data cleaning method and device and terminal
CN110471793B (en) Data backup method, data recovery method, first terminal and second terminal
CN112416212B (en) Program access method, apparatus, electronic device and readable storage medium
CN106775711B (en) Information processing method, device and computer-readable storage medium for contact persons
CN106686240B (en) Method for obtaining event information on mobile terminal and mobile terminal
US20070198509A1 (en) Information processing apparatus, information processing method, information processing program, and mobile terminal apparatus
CN104394258A (en) Method and device for processing contact change of communication object
WO2018219141A1 (en) Method for marking unread information and mobile terminal
CN108536512B (en) Interface switching method and device and terminal equipment
CN113595884B (en) Message reminding method and application terminal
CN113301203B (en) Method and device for updating historical information data based on address book
CN104572349A (en) Data backup method
CN112099715B (en) Information processing method and device
CN108763395B (en) Document processing method and related product
CN111049981A (en) Message identification method, device, user equipment and computer readable storage medium
CN106453923A (en) Data processing method and mobile terminal
CN110740074B (en) Network address detection method and device and electronic equipment
CN109445757B (en) New design drawing generation method and device and terminal equipment

Legal Events

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