File backup method, file recovery method, electronic device and storage medium
By encrypting and backing up the file key on the electronic device, the problem of not being able to back up and restore ECE and SECE files under lock screen state is solved, and a more efficient file backup and recovery process is achieved.
Patent Information
- Application Number
- CN202010548257.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-06-16
- Publication Date
- 2024-11-29
- Estimated Expiration
- 2040-06-16
AI Technical Summary
The existing technology cannot backup and restore ECE and SECE files under the lock screen of the mobile phone, resulting in the backup failure and the inability to restore important data.
When creating a file on an electronic device, the file key is encrypted, and the encrypted file key and file are backed up to the target device during backup, ensuring that backup and recovery can also be performed under lock screen state.
It solves the problem that ECE and SECE files cannot be backed up and restored in the lock screen state, and improves the efficiency and reliability of file backup and recovery.
Smart Images

Figure CN113806137B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of security technology, and in particular to a file backup method, a file recovery method, an electronic device, and a storage medium. Background Art
[0002] File backup refers to the process of copying all or part of a file collection from the hard disk or array of an application host to other storage media to prevent file loss due to system operation errors or system failures; and can be restored through other application hosts using backup files.
[0003] At present, mobile phone files may include credential encryption (CE) files, device encryption (DE) files, enhanced credential encryption (ECE) files and sub-enhanced credential encryption (SECE) files; among which, after the user turns on the phone and unlocks the device for the first time, the CE file can maintain access to the file, and the DE file can be used after the phone is turned on; as for ECE and SECE files, when the screen is locked, the file is encrypted by a key and the key is discarded, so the file cannot be read in the locked screen state; however, the time when the mobile phone automatically initiates the backup cannot be guaranteed to be consistent with the non-locked screen state of the mobile phone, that is, it is possible to back up the mobile phone files when the phone is locked, which will result in the ECE and SECE files being unable to be restored after the backup. Summary of the invention
[0004] The embodiment of the present application provides a file backup method, a file recovery method and an electronic device. The embodiment of the present application also provides a computer-readable storage medium to provide a file backup method and a file recovery method, by encrypting the file key when the electronic device creates the file, storing the encrypted file key, and backing up the encrypted file key and the encrypted file to the target electronic device during the backup; when restoring the file, the backup file is obtained according to the encrypted file and the encrypted file key sent by the target electronic device. This can solve the problem that the electronic device cannot back up private data in the locked screen state, and improve the efficiency of file backup and recovery.
[0005] In a first aspect, an embodiment of the present application provides a file backup method, comprising: obtaining one or more files to be backed up and file types corresponding to the files to be backed up on a source electronic device, wherein the file types include a first type and a second type; specifically, the source electronic device may include a mobile terminal, or a smart screen, a speaker, and a vehicle-mounted device; the files to be backed up may include ordinary files such as CE and / or DE, which may be files that can be read in a locked screen state, i.e., files of the first type; the files to be backed up may also include privacy files such as ECE and / or SECE, which may not be readable in a locked screen state, i.e., files of the second type.
[0006] A first file key corresponding to a first type of file to be backed up and a second file key corresponding to a second type of file to be backed up are obtained, the first type of file to be backed up is encrypted using the first file key and the second type of file to be backed up is encrypted using the second file key to obtain a first ciphertext, and the first ciphertext is stored, wherein the first ciphertext at least includes a first type of encrypted file; specifically, the first file key may be a file key corresponding to a first type of file to be backed up (ECE and / or SECE file), and the file key may be used to encrypt the first type of file, for example, after encrypting the ECE and / or SECE file, an encrypted file of ECE and / or SECE, i.e., a first type of encrypted file, may be obtained; the second file key may be a file key corresponding to a second type of file to be backed up (CE and / or DE file), and the file key may be used to encrypt the second type of file, for example, after encrypting the CE and / or DE file, an encrypted file of CE and / or DE, i.e., a second type of encrypted file, may be obtained; wherein, the first ciphertext may include a first type of encrypted file, and the first ciphertext may also include a first type of encrypted file and a second type of encrypted file.
[0007] A first instruction for adding a source electronic device to a first backup group is received, and in response to the first instruction, a first backup key, a second backup key and a target electronic device identifier corresponding to the first backup group are obtained; specifically, the first instruction can be used to add the source electronic device to any backup group, wherein the first instruction can be input by a user, for example, the user can turn on the backup function on the interface of the source electronic device, select a backup group or create a backup group; the backup group can include one or more electronic devices, and each electronic device in the backup group can jointly maintain one or more backup keys; therefore, when any electronic device joins the backup group, it can synchronize keys with the backup group to obtain a backup key and a target electronic device identifier, wherein the backup key can include a first backup key and a second backup key, the first backup key can be used to encrypt a first file key, and the second backup key can be used to encrypt a second file key; the target electronic device identifier is used to identify the target electronic device, and the address of the target electronic device can be obtained through the identifier, and the address can be used to store the file to be backed up this time.
[0008] The first file key is encrypted using the first backup key and the second file key is encrypted using the second backup key to obtain a second ciphertext, and the second ciphertext is stored, wherein the second ciphertext at least includes the first file encryption key. Specifically, the second ciphertext may include a ciphertext obtained by encrypting the first file key using the first backup key, and the second ciphertext may also include a ciphertext obtained by encrypting the first file key using the first backup key and a ciphertext obtained by encrypting the second file key using the second backup key.
[0009] A second instruction for backing up a file is received, and in response to the second instruction, the backup file is backed up to a target electronic device corresponding to the target electronic device identifier, wherein the backup file includes a first ciphertext, a second ciphertext, and a file identifier corresponding to the backup file. Specifically, the second instruction can be used to start a file backup, wherein the second instruction can be input by a user, for example, the user inputs it on the display interface of the source electronic device to start the file backup; the second instruction can also automatically trigger a backup according to a preset condition, for example, triggering an automatic backup function according to a preset time point; the target electronic device can be a server or a cloud, or a local device; the file identifier is used to identify the file backed up this time, so that it can be easily queried when restoring the backup file in the future.
[0010] In one possible implementation, in response to the first instruction, obtaining the first backup key, the second backup key, and the target electronic device identifier corresponding to the first backup group includes:
[0011] In response to the first instruction, a first backup group is created in the source electronic device. Specifically, when no backup group exists in the source electronic device, the source electronic device can create a new backup group, namely the first backup group, by itself.
[0012] An identity identifier corresponding to the first backup group is obtained, and a first backup key and a second backup key corresponding to the first backup group identity identifier are generated in the source electronic device. Specifically, the backup group may include an identity identifier corresponding to the group for distinguishing from other groups. After the new backup group is created, the source electronic device may generate the first backup key and the second backup key corresponding to the new backup group.
[0013] The target electronic device identifier is obtained, and the identity identifier of the first backup group is bound to the target electronic device identifier. Specifically, the source electronic device can select a target electronic device by itself, and can bind the target electronic device to the new backup group.
[0014] In one possible implementation, in response to the first instruction, obtaining the first backup key, the second backup key, and the target electronic device identifier corresponding to the first backup group includes:
[0015] In response to the first instruction, the identity of the first backup group is obtained, and a request is sent to the first electronic device in the first backup group, so that the first electronic device sends the first backup key, the second backup key and the target electronic device identity corresponding to the first backup group identity to the source electronic device. Specifically, if there is an existing backup group in the source electronic device, the user can select any one of the existing backup groups, and the source electronic device can obtain the first backup key, the second backup key and the target electronic device identity by interacting with any electronic device in the selected backup group.
[0016] The first backup key, the second backup key and the target electronic device identifier are received, and the identity identifier of the first backup group is bound to the target electronic device identifier.
[0017] In one possible implementation, in response to the second instruction, backing up the backup file to a target electronic device corresponding to the target electronic device identifier includes:
[0018] In response to the second instruction, the current state of the source electronic device is detected. Specifically, the current state of the source electronic device may include a locked screen and an unlocked screen. Since in the unlocked screen state, the first type of file and the second type of file can be directly backed up after being encrypted by the file secret key, and there is no need to upload the second ciphertext, therefore, the current state of the source electronic device can be identified here, which can improve the efficiency of file backup.
[0019] If it is detected that the source electronic device is currently in a locked screen state, the backup file is backed up to a target electronic device corresponding to the target electronic device identifier.
[0020] In one possible implementation, in response to the second instruction, backing up the backup file to a target electronic device corresponding to the target electronic device identifier includes:
[0021] In response to the second instruction, the state of the first type of files to be backed up is detected. Specifically, the state of the first type of files to be backed up may include opening and closing, and the first type of files to be backed up may include SECE files. When the SECE file is opened, the first type of files can be directly encrypted with a file key and backed up without uploading the second ciphertext. Therefore, the state of the first type of files to be backed up can be identified here, which can improve the efficiency of file backup.
[0022] If it is detected that the first type of files to be backed up are in a closed state, the backup files are backed up to a target electronic device corresponding to the target electronic device identifier.
[0023] The present application also provides a file recovery method, including:
[0024] A first instruction for file recovery is received, and in response to the first instruction, a file identifier of the backup file to be recovered and a first backup group identity identifier corresponding to the file identifier are obtained; specifically, the first instruction can be input by a user, for example, the user can input it on a display interface of a source electronic device, thereby starting file recovery; the first instruction can include the file identifier of the backup file to be recovered, and a first backup group identity identifier corresponding to the file identifier. Exemplarily, the user can first select a backup group, and then can select a backup file from the backup files under the backup group for recovery.
[0025] According to the first backup group identity, a first backup key, a second backup key and a target electronic device identity corresponding to the first backup group identity for decrypting the first ciphertext are obtained, and a file recovery request is initiated to the target electronic device corresponding to the target electronic device identity, so that the target electronic device sends the first ciphertext and the second ciphertext corresponding to the backup file identity according to the file recovery request; specifically, the first ciphertext may include an encrypted file key, the first backup key may decrypt the first file key in the first ciphertext, and the second backup key may decrypt the second file key in the first ciphertext; the second ciphertext may include an encrypted backup file, that is, the backup file to be restored this time; the first ciphertext and the second ciphertext are stored in the target electronic device, and therefore, a request may be initiated to the target electronic device according to the target electronic device identity to obtain the corresponding first ciphertext and the second ciphertext.
[0026] Receive a first ciphertext and a second ciphertext sent by a target electronic device.
[0027] Obtain the file type of the first ciphertext. If the file type of the first ciphertext is the first type, use the first backup key to decrypt the first ciphertext to obtain the first file key; if the file type of the first ciphertext is the second type, use the second backup key to decrypt the first ciphertext to obtain the second file key. Specifically, the file type may include privacy file types (ECE and / or SECE files), i.e., the first type, and common file types (CE and / or DE files), i.e., the second type. Obtain the file type of the second ciphertext. If the file type of the second ciphertext is the first type, use the first file key to decrypt the second ciphertext to obtain the first type backup file; if the file type of the second ciphertext is the second type, use the second file key to decrypt the second ciphertext to obtain the second type backup file. Specifically, the file type may include privacy file types (ECE and / or SECE files), i.e., the first type, and common file types (CE and / or DE files), i.e., the second type. The first type backup file may be a privacy backup file after this recovery, for example, it may be an ECE and / or SECE file, and the second type backup file may be a common backup file after this recovery, for example, it may be a CE and / or DE file.
[0028] In one possible implementation, obtaining the first backup key, the second backup key, and the target electronic device identifier corresponding to the first backup group identifier for decrypting the first ciphertext according to the first backup group identifier includes:
[0029] A request is sent to a first electronic device in a first backup group corresponding to the first backup group identity according to the first backup group identity, so that the first electronic device sends a first backup key, a second backup key and a target electronic device identity corresponding to the first backup group identity. Specifically, the source electronic device can send a request to any electronic device in the backup group according to the backup group identity to obtain the first backup key, the second backup key and the target electronic device identity corresponding to the backup group.
[0030] In a second aspect, an embodiment of the present application provides a file backup device, including:
[0031] An acquisition module, configured to acquire, on a source electronic device, one or more files to be backed up and file types corresponding to the files to be backed up, wherein the file types include a first type and a second type;
[0032] A first encryption module is used to obtain a first file key corresponding to the first type of files to be backed up and a second file key corresponding to the second type of files to be backed up, encrypt the first type of files to be backed up using the first file key and encrypt the second type of files to be backed up using the second file key to obtain a first ciphertext, and store the first ciphertext, wherein the first ciphertext at least includes the first type of encrypted files;
[0033] a receiving module, configured to receive a first instruction for adding the source electronic device to a first backup group, and in response to the first instruction, obtain a first backup key, a second backup key, and a target electronic device identifier corresponding to the first backup group;
[0034] a second encryption module, configured to encrypt the first file key using the first backup key and encrypt the second file key using the second backup key to obtain a second ciphertext, and store the second ciphertext, wherein the second ciphertext at least includes the first file encryption key;
[0035] A backup module is used to receive a second instruction for backing up a file, and in response to the second instruction, back up the backup file to a target electronic device corresponding to the target electronic device identifier, wherein the backup file includes the first ciphertext, the second ciphertext and a file identifier corresponding to the backup file.
[0036] In one possible implementation, the receiving module includes:
[0037] a creating unit, configured to create a first backup group in the source electronic device in response to the first instruction;
[0038] a generating unit, configured to obtain an identity corresponding to the first backup group, and generate a first backup key and a second backup key corresponding to the first backup group identity in the source electronic device;
[0039] The binding unit is used to obtain the target electronic device identifier and bind the identity identifier of the first backup group with the target electronic device identifier.
[0040] In one possible implementation, the receiving module includes:
[0041] a request unit, configured to obtain an identity of a first backup group in response to the first instruction, and send a request to a first electronic device in the first backup group, so that the first electronic device sends a first backup key, a second backup key and a target electronic device identity corresponding to the first backup group identity to the source electronic device;
[0042] The receiving unit is configured to receive the first backup key, the second backup key and the target electronic device identifier, and bind the identity identifier of the first backup group with the target electronic device identifier.
[0043] In one possible implementation, the backup module includes:
[0044] a detection unit, configured to detect a current state of the source electronic device in response to the second instruction;
[0045] The backup unit is used to back up the backup file to a target electronic device corresponding to the target electronic device identifier if it is detected that the source electronic device is currently in a locked screen state.
[0046] In one possible implementation, the backup module includes:
[0047] a detection unit, configured to detect, in response to the second instruction, a status of the first type of files to be backed up;
[0048] The backup unit is configured to back up the backup file to a target electronic device corresponding to the target electronic device identifier if it is detected that the first type of files to be backed up are in a closed state.
[0049] The present application also provides a file recovery device, including:
[0050] A receiving module, configured to receive a first instruction for file recovery, and in response to the first instruction, obtain a file identifier of a backup file to be recovered and a first backup group identity identifier corresponding to the file identifier;
[0051] a request module, configured to obtain, according to the first backup group identity, a first backup key and a second backup key for decrypting the first ciphertext and a target electronic device identity corresponding to the first backup group identity, and initiate a file recovery request to a target electronic device corresponding to the target electronic device identity, so that the target electronic device sends the first ciphertext and the second ciphertext corresponding to the backup file identity according to the file recovery request;
[0052] A recovery module, used to receive the first ciphertext and the second ciphertext sent by the target electronic device; obtain the file type of the first ciphertext, if the file type of the first ciphertext is the first type, use the first backup key to decrypt the first ciphertext to obtain the first file key; if the file type of the first ciphertext is the second type, use the second backup key to decrypt the first ciphertext to obtain the second file key; obtain the file type of the second ciphertext, if the file type of the second ciphertext is the first type, use the first file key to decrypt the second ciphertext to obtain the first type backup file; if the file type of the second ciphertext is the second type, use the second file key to decrypt the second ciphertext to obtain the second type backup file.
[0053] In one possible implementation, the request module is also used to send a request to a first electronic device in a first backup group corresponding to the first backup group identity based on the first backup group identity, so that the first electronic device sends a first backup key, a second backup key and a target electronic device identity corresponding to the first backup group identity.
[0054] In a third aspect, an embodiment of the present application provides an electronic device, including:
[0055] A memory, the memory is used to store computer program code, the computer program code includes instructions, when the device reads the instructions from the memory, the device performs the following steps:
[0056] Acquire one or more files to be backed up and file types corresponding to the files to be backed up on the source electronic device, wherein the file types include a first type and a second type;
[0057] Obtaining a first file key corresponding to the first type of files to be backed up and a second file key corresponding to the second type of files to be backed up, encrypting the first type of files to be backed up using the first file key and encrypting the second type of files to be backed up using the second file key to obtain a first ciphertext, and storing the first ciphertext, wherein the first ciphertext at least includes the first type of encrypted files;
[0058] receiving a first instruction for adding the source electronic device to a first backup group, and acquiring, in response to the first instruction, a first backup key, a second backup key, and a target electronic device identifier corresponding to the first backup group;
[0059] Encrypting the first file key using the first backup key and encrypting the second file key using the second backup key to obtain a second ciphertext, and storing the second ciphertext, wherein the second ciphertext at least includes the first file encryption key;
[0060] A second instruction for backing up a file is received, and in response to the second instruction, a backup file is backed up to a target electronic device corresponding to the target electronic device identifier, wherein the backup file includes the first ciphertext, the second ciphertext and a file identifier corresponding to the backup file.
[0061] In one possible implementation, when the instruction is executed by the device, the device executes the step of obtaining the first backup key, the second backup key and the target electronic device identifier corresponding to the first backup group in response to the first instruction, including:
[0062] In response to the first instruction, creating a first backup group in the source electronic device;
[0063] Acquire an identity corresponding to the first backup group, and generate a first backup key and a second backup key corresponding to the first backup group identity in the source electronic device;
[0064] The target electronic device identifier is obtained, and the identity identifier of the first backup group is bound to the target electronic device identifier.
[0065] In one possible implementation, when the instruction is executed by the device, the device executes the step of obtaining the first backup key, the second backup key and the target electronic device identifier corresponding to the first backup group in response to the first instruction, including:
[0066] In response to the first instruction, obtaining an identity of a first backup group, and sending a request to a first electronic device in the first backup group, so that the first electronic device sends a first backup key, a second backup key and a target electronic device identity corresponding to the first backup group identity to the source electronic device;
[0067] The first backup key, the second backup key, and the target electronic device identifier are received, and the identity identifier of the first backup group is bound to the target electronic device identifier.
[0068] In one possible implementation manner, when the above instruction is executed by the above device, the above device executes the step of backing up the backup file to the target electronic device corresponding to the target electronic device identifier in response to the second instruction, including:
[0069] In response to the second instruction, detecting a current state of the source electronic device;
[0070] If it is detected that the source electronic device is currently in a locked screen state, the backup file is backed up to a target electronic device corresponding to the target electronic device identifier.
[0071] In one possible implementation manner, when the above instruction is executed by the above device, the above device executes the step of backing up the backup file to the target electronic device corresponding to the target electronic device identifier in response to the second instruction, including:
[0072] In response to the second instruction, detecting the status of the first type of files to be backed up;
[0073] If it is detected that the first type of files to be backed up are in a closed state, the backup files are backed up to a target electronic device corresponding to the target electronic device identifier.
[0074] The present application also provides an electronic device, including:
[0075] A memory, the memory is used to store computer program code, the computer program code includes instructions, when the device reads the instructions from the memory, the device performs the following steps:
[0076] receiving a first instruction for file recovery, and obtaining, in response to the first instruction, a file identifier of a backup file to be recovered and a first backup group identity identifier corresponding to the file identifier;
[0077] Acquire a first backup key and a second backup key for decrypting the first ciphertext according to the first backup group identity, and a target electronic device identity corresponding to the first backup group identity, and initiate a file recovery request to a target electronic device corresponding to the target electronic device identity, so that the target electronic device sends the first ciphertext and the second ciphertext corresponding to the backup file identity according to the file recovery request;
[0078] Receiving the first ciphertext and the second ciphertext sent by the target electronic device;
[0079] Obtaining a file type of the first ciphertext, and if the file type of the first ciphertext is the first type, decrypting the first ciphertext using the first backup key to obtain a first file key; if the file type of the first ciphertext is the second type, decrypting the first ciphertext using the second backup key to obtain a second file key;
[0080] Obtain the file type of the second ciphertext. If the file type of the second ciphertext is the first type, use the first file key to decrypt the second ciphertext to obtain a first type backup file. If the file type of the second ciphertext is the second type, use the second file key to decrypt the second ciphertext to obtain a second type backup file.
[0081] In one possible implementation manner, when the above instruction is executed by the above device, the above device executes the step of obtaining, according to the first backup group identity, a first backup key, a second backup key and a target electronic device identifier corresponding to the first backup group identity for decrypting the first ciphertext, including:
[0082] A request is sent to a first electronic device in a first backup group corresponding to the first backup group identity according to the first backup group identity, so that the first electronic device sends a first backup key, a second backup key and a target electronic device identity corresponding to the first backup group identity.
[0083] In a fourth aspect, the present application provides a computer-readable storage medium, in which a computer program is stored. When the computer-readable storage medium is run on a computer, the computer executes the method described in the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0084] Figure 1 A flowchart of a file backup method provided in an embodiment of the present application;
[0085] Figure 2A A schematic diagram of an embodiment of a display interface of a file backup method device provided in the present application;
[0086] Figure 2B A schematic diagram of another embodiment of the display interface of the file backup method device provided by the present application;
[0087] Figure 3 A schematic diagram of the backup file structure provided in an embodiment of the present application;
[0088] Figure 4 A flowchart of a file recovery method provided in an embodiment of the present application;
[0089] Figure 5A A schematic diagram of an embodiment of a display interface of a file recovery method device provided by the present application;
[0090] Figure 5B A schematic diagram of another embodiment of the display interface of the file recovery method device provided by the present application;
[0091] Figure 6A schematic diagram of the structure of a file backup device provided in an embodiment of the present application;
[0092] Figure 7 A schematic diagram of the structure of a file recovery device provided in an embodiment of the present application;
[0093] Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0094] The technical solution in the embodiment of the present application will be described below in conjunction with the drawings in the embodiment of the present application. In the description of the embodiment of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone.
[0095] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of the embodiments of the present application, unless otherwise specified, "plurality" means two or more.
[0096] Currently, both Android and IOS phones have file-based encryption (FBE) capabilities. On Android electronic devices, there are usually four types of protected files, CE, DE, ECE and SECE files, and on IOS electronic devices, there are similar protection type files, but with different names. Taking Android electronic devices as an example, for CE and DE files, the files can be read after the electronic device is started or unlocked for the first time; however, for ECE and SECE files, after the electronic device is locked, the key used to decrypt the file will be discarded, and the key can only be retrieved and the file can be read after the user unlocks it again, so the file cannot be read in the locked screen state.
[0097] Android electronic devices usually perform automatic backup at a specific time. Through this automatic backup, the content, data and settings on the electronic device can be backed up to a pre-specified location, and the backup at this location can be restored to the electronic device. However, in the locked screen state, since the keys of the ECE and SECE files have been discarded, even if the ECE and SECE files are backed up, they cannot be restored through the backup files, which loses the meaning of backup. Therefore, file backup in the locked screen state has become an urgent problem to be solved.
[0098] The technical solution provided in the embodiments of the present application can be applied to an electronic device, which may be a mobile terminal. The mobile terminal may also be referred to as a terminal device, user equipment (UE), access terminal, user unit, user station, mobile station, mobile station, remote station, remote terminal, mobile device, user terminal, terminal, wireless communication device, user agent or user device. The mobile terminal may be a station (STAION, ST) in a WLAN, a cellular phone, a cordless phone, a Session Initiation Protocol (SIP) phone, a Wireless Local Loop (WLL) station, a Personal Digital Assistant (PDA) device, a handheld device with wireless communication function, a computing device or other processing device connected to a wireless modem, a vehicle-mounted device, a vehicle networking terminal, a computer, a laptop computer, a handheld communication device, a handheld computing device, a satellite wireless device, a wireless modem card, a TV set top box (STB), a customer premise equipment (CPE) and / or other devices for communicating on a wireless system and a next generation communication system, for example, a mobile terminal in a 5G network or a mobile terminal in a future evolved Public Land Mobile Network (PLMN) network, etc. The mobile terminal may also be a wearable device. Wearable devices can also be called wearable smart devices. They are a general term for the development of wearable devices that use wearable technology to intelligently design daily wearables, such as glasses, gloves, watches, clothing and shoes. Wearable devices are portable devices that are worn directly on the body or integrated into the user's clothes or accessories. Wearable devices are not just hardware devices, but also achieve powerful functions through software support, data interaction, and cloud interaction. Broadly speaking, wearable smart devices include those that are fully functional, large in size, and can achieve complete or partial functions without relying on smartphones, such as smart watches or smart glasses, as well as those that only focus on a certain type of application function and need to be used in conjunction with other devices such as smartphones, such as various smart bracelets and smart jewelry for vital sign monitoring.
[0099] The embodiments of the present application do not impose any special restrictions on the specific form of the electronic device that implements the technical solution.
[0100] Now combined Figure 1-Figure 3 The file backup method provided in the embodiment of the present application is described as follows: Figure 1 The flowchart of an embodiment of the file backup method of the present application may include:
[0101] Step 101: Obtain one or more files to be backed up and file types corresponding to the files to be backed up on a source electronic device.
[0102] Specifically, the files to be backed up on the source electronic device may include files of protection types such as CE, DE, ECE and SECE; among them, files of CE and DE types may be files that can be read when the source electronic device is in the locked screen state, and files of ECE and SECE types may be files that cannot be read when the source electronic device is in the locked screen state.
[0103] It should be understood that CE, DE, ECE and SECE can identify the protection type of data. For example, sensitive personal data can be encrypted and protected by ECE and SECE protection types, while ordinary data can be encrypted and protected by CE and DE protection types. Among them, the protection type of data can be used to characterize the policy of when the data can be read.
[0104] First, one or more files to be backed up can be obtained, wherein the files to be backed up can be one or more of CE, DE, ECE and SECE files; then the file type corresponding to the file to be backed up can be obtained, wherein the file type can be pre-set, and the file type can be bound to the file; exemplarily, the ECE and SECE files can be set in advance to be an unreadable type in the lock screen state, that is, the first type; and the CE and DE files can be set to a readable type in the lock screen state, that is, the second type.
[0105] Step 102, obtain a first file key corresponding to the first type of files to be backed up and a second file key corresponding to the second type of files to be backed up, and use the first file key to encrypt the first type of files to be backed up and use the second file key to encrypt the second type of files to be backed up to obtain a first ciphertext, and store the first ciphertext, wherein the first ciphertext at least includes the first type of encrypted files.
[0106] Specifically, after obtaining the ECE and / or SECE files on the source electronic device, the corresponding first file key can also be obtained. The first file key can be used to encrypt the ECE and / or SECE files, thereby obtaining the first ciphertext after the ECE file and / or SECE file is encrypted. The first file key can be a symmetric key or an asymmetric key, which is not limited to the embodiments of the present application.
[0107] Optionally, after obtaining the CE and / or DE files on the source electronic device, the corresponding second file key can also be obtained, and the second file key can be used to encrypt the CE and / or DE files, thereby obtaining the first ciphertext after the CE file and / or DE file is encrypted, wherein the second file key can be a symmetric key or an asymmetric key, which is not limited in the embodiments of the present application.
[0108] It should be noted that the first ciphertext may include the first ciphertext after the ECE file and / or SECE file is encrypted using the first file key, and may also include the first ciphertext after the ECE file and / or SECE file is encrypted using the first file key and the first ciphertext after the CE file and / or DE file is encrypted using the second file key.
[0109] Furthermore, after obtaining the first ciphertext, the first ciphertext may be stored in the source electronic device.
[0110] Step 103: receiving a first instruction for adding a source electronic device to a first backup group, and acquiring a backup key and a target electronic device identifier corresponding to the first backup group in response to the first instruction, wherein the first backup group includes one or more electronic devices.
[0111] Specifically, the first instruction can be used to add the source electronic device to a backup group, namely the first backup group; for example, the first instruction can be generated in the source electronic device through user operation; in specific implementation, the user can turn on the automatic backup switch on the display interface of the source electronic device and specify a backup group, wherein the backup group can be a group with the same account or a group without an account, and the backup group can include one or more electronic devices. In addition, all electronic devices in the backup group can jointly maintain one or more backup keys. Exemplarily, a backup group can include two backup keys, a first backup key and a second backup key, wherein the first backup key can be used to encrypt the first file key, and the second backup key can be used to encrypt the second file key; therefore, electronic devices that join the backup group can obtain the above-mentioned backup keys; it should be noted that if the user does not have an existing backup group to choose from when specifying a backup group, the user can create a backup group by himself. After creating a new backup group on the source electronic device, the source electronic device can generate a first backup key and a second backup key corresponding to the backup group.
[0112] Now combined Figure 2A and Figure 2B To explain, Figure 2AThe user display interface 200 of the source electronic device before automatic backup is turned on is shown. The display interface 200 includes a function area 210 and an operation area 220, wherein the function area 210 is used to display the current function, such as automatic backup, file recovery, etc.; the operation area 220 is used to select the current corresponding function; Figure 2B The user display interface 300 is shown after the automatic backup of the source electronic device is turned on. The display interface 300 includes a group option area 310 and a selection area 320, wherein the group option area 310 is used to display the backup group currently to be selected, and the selection area 320 is used to select the backup group to be selected.
[0113] Among them, when the user needs to create a backup group, the source electronic device can first generate an identity of the backup group, and then create a backup group corresponding to the identity according to the identity; the source electronic device can also first create a new backup group and assign an identity to the backup group, which is not limited in this embodiment; after the user creates a new backup group on the source electronic device, the source electronic device can also bind the identity of the backup group with the identity of the target electronic device. It should be noted that the target electronic device here is used to identify the target address for storing backup files, so it can also be other storage devices, such as a server or a cloud, or a local storage device. This embodiment of the present application does not limit this. In addition, the target electronic device can be a device with different functions from the electronic devices in the backup group, that is, the backup keys can be shared between the devices in the backup group, and the target electronic device can be used to store backup files. Among them, the backup group can bind its own identity with the identity of the target electronic device, that is, the backup files of any electronic device in the backup group can be stored in the target electronic device, and the storage address of the target electronic device is shared by the devices in the backup group.
[0114] In a specific implementation, if a backup group is created on a source electronic device, a backup key corresponding to the backup group can be generated on the source electronic device, and a target electronic device can be selected, wherein the identifier of the target electronic device can be bound to the backup group identifier, and then the address of the target electronic device corresponding to the backup group is recorded, and the address can be used to store the backup file.
[0115] Optionally, if the source electronic device joins a backup group, the source electronic device can obtain the identity of the backup group. The source electronic device can also send a request to any electronic device in the backup group based on the identity of the backup group to obtain the backup key corresponding to the backup group identity and the identity of the target electronic device, and can encrypt the first file key and the second file key after obtaining the backup key sent by the electronic device in the backup group.
[0116] Step 104: encrypt the first file key using the first backup key, and encrypt the second file key using the second backup key to obtain a second ciphertext, and store the second ciphertext, wherein the second ciphertext at least includes the first file encryption key.
[0117] Specifically, since the ECE file and the SECE file will discard the first file key when the screen is locked, when the user turns on the automatic backup function in the source electronic device, that is, after selecting the backup group, the first backup key can be used to encrypt the first file key, thereby obtaining a second ciphertext encrypted with the first file key, and the second ciphertext can be stored, thereby avoiding backup failure caused by the discarding of the first file key.
[0118] Optionally, the source electronic device may also use the obtained second backup key to encrypt the second file key, thereby obtaining a second ciphertext encrypted from the second file key, and may store the second ciphertext.
[0119] It should be noted that the second ciphertext may include the second ciphertext encrypted by using the first backup key to encrypt the first file key, or may include the second ciphertext encrypted by using the first backup key to encrypt the first file key and the second ciphertext encrypted by using the second backup key to encrypt the second file key.
[0120] The second ciphertext may be stored in the file metadata of the source electronic device, or may be stored in the database of the source electronic device and a mapping relationship between the database index value and the file name is established; this embodiment of the present application does not limit this.
[0121] Step 105, receiving a second instruction for backing up a file, and in response to the second instruction, backing up the backup file to a target electronic device corresponding to the target electronic device identifier, wherein the backup file includes a first ciphertext, a second ciphertext, and a file identifier corresponding to the backup file.
[0122] Specifically, the second instruction can be used to start the backup of the file; for example, the backup of the file can be automatically triggered on the source electronic device; in the specific implementation, the user can pre-set the time point for the automatic backup, and when the preset time point is reached, the automatic backup of the file can be triggered.
[0123] After the file backup is started on the source electronic device, the backup file and the file identifier corresponding to the backup file can be backed up to the target electronic device, wherein the backup file can include the first ciphertext and the second ciphertext; Figure 3 To explain, Figure 3 As shown, the backup file can be represented by a file identifier, and the backup file can include a first ciphertext and a second ciphertext. The first ciphertext can include a file obtained by encrypting a first type of file to be backed up using a first file key, for example, the first ciphertext can be obtained by encrypting an ECE file and / or a SECE file using the first file key; the first ciphertext can also include a file obtained by encrypting a second type of file to be backed up using a second file key, for example, the first ciphertext can be obtained by encrypting a CE file and / or a DE file using the second file key; the second ciphertext can include a file obtained by encrypting the first file key using the first backup key; the second ciphertext can also include a file obtained by encrypting the second file key using the second backup key. It should be noted that, since the first file key and the second file key correspond to the file type, the first ciphertext encrypted by the first file key and the first ciphertext encrypted by the second file key also correspond to the file type. In addition, the second ciphertext encrypted by the first file key and the second ciphertext encrypted by the second file key also correspond to the file type; thereby, the target electronic device can select the corresponding backup key to decrypt the second ciphertext according to the file type, and select the corresponding file key to decrypt the first ciphertext.
[0124] Optionally, in step 105, after starting the file backup, the lock screen state of the current source electronic device can also be detected; because in the non-lock screen state, the CE, DE, ECE and SECE files can be backed up according to the negotiated key between the source electronic device and the target electronic device, that is, only the transmission key and the files encrypted by the transmission key can be backed up, and there is no need to back up the file key encrypted by the backup key to the target electronic device; wherein, the negotiated key can be used to encrypt the CE, DE, ECE and SECE files in the source electronic device, and transmit the ciphertext obtained after encrypting the CE, DE, ECE and SECE files to the target electronic device, and the negotiated key can be used to encrypt the CE, DE, ECE and SECE files in the source electronic device, and transmit the ciphertext obtained after encrypting the CE, DE, ECE and SECE files to the target electronic device. The negotiated key is obtained by the source electronic device and the target electronic device after negotiation. For the security of transmission, the negotiated key may be different from the first file key and the second file key. In the lock screen state, the transmission key cannot be used for backup. Therefore, the lock screen state of the terminal device can be further detected. When it is detected that the current terminal device is in the lock screen state, the first ciphertext and the second ciphertext can be sent to the target electronic device. Among them, the lock screen state of the source electronic device can be obtained by detecting the system of the source electronic device. In the specific implementation, after the source electronic device is locked, the source electronic device system will issue a lock screen notification, and all applications in the source electronic device will maintain the lock screen notification.
[0125] Optionally, in step 105, after starting the file backup, the running status of the SECE file can also be detected, and the running status can include opening and closing; wherein, the running status of the SECE file can be obtained by detecting the file handle of the SECE file in the process of the source electronic device; since if the file handle of the SECE file is detected in the process of the source electronic device, that is, the SECE file is in an open state, the system can read the SECE file normally even in the lock screen state, so the SECE file can also be backed up normally in the lock screen state, that is, there is no need to back up the encrypted file key to the target electronic device; and if the file handle of the SECE file is not detected in the process of the source electronic device, that is, the SECE file is in a closed state, the SECE file cannot be directly backed up, and therefore, the first ciphertext and the second ciphertext can be sent to the target electronic device at this time.
[0126] Then combine Figure 4 The file recovery method provided in the embodiment of the present application is described as follows: Figure 4 The flowchart of an embodiment of the file recovery method of the present application is shown, including:
[0127] Step 201, receiving a first instruction for file recovery, and in response to the first instruction, obtaining a first backup group identifier and a target electronic device identifier corresponding to the first backup group identifier; obtaining a first backup key and a second backup key for decrypting a first ciphertext according to the first backup group identifier, and initiating a file recovery request to the target electronic device, so that the target electronic device sends the first ciphertext and the second ciphertext according to the file recovery request.
[0128] Specifically, the first instruction can be used to perform file recovery; wherein, the first instruction can be implemented by the user operating on the display interface of the source electronic device; in a specific implementation, the user can find a file recovery menu on the display interface of the source electronic device, and through the user's operation of the menu, the current backup group set can be displayed on the display interface of the source electronic device, wherein the backup group set can include one or more backup groups, and the backup group set can correspond to the current electronic device; then the user can select one of the backup groups, and then all backup files under the backup group can be displayed on the display interface, and then the user can select one of the backup files for recovery.
[0129] Among them, the backup file can correspond to the address of the target electronic device, that is, after the user selects the file to be restored this time, the source electronic device can request the target electronic device to send the file to be restored this time. The file to be restored this time may include a first ciphertext and a second ciphertext. The first ciphertext may include a file encrypted with a file key using a backup key, and the second ciphertext may include a file encrypted with a backup file (the file to be restored this time) using a file key; and the backup key can be obtained by synchronizing the source electronic device with the backup group to which the file to be restored this time belongs.
[0130] Now combined Figure 2A , Figure 5A and Figure 5B To explain, Figure 2A The user interface 200 before the file recovery of the source electronic device is started is shown. When the user selects the file recovery option, the following information can be obtained: Figure 5A The user display interface 500 shown in FIG. 5 includes a group option area 510 and a selection area 520, wherein the group option area 510 is used to display the backup group currently to be selected, and the selection area 520 is used to select the backup group to be selected; when the user selects the backup group currently to be selected, the following information can be obtained: Figure 5B The user interface 600 shown includes a file option area 610 and a selection area 620, wherein the file option area 610 is used to display the backup files currently to be selected, and the selection area 620 is used to select the backup files to be selected.
[0131] It should be noted that any electronic device can initiate a file recovery request, and after the user operates the file recovery menu on the current electronic device, the candidate backup group set that pops up can correspond to the current electronic device, that is, the currently displayed backup group set can include one or more backup groups pre-joined by the electronic device.
[0132] Furthermore, when the user selects a backup file, that is, inputs a first instruction, the source electronic device may synchronize with any electronic device in the backup group to which the backup file belongs in response to the first instruction to obtain a backup key, wherein the backup key includes at least a first backup key and, optionally, may also include a second backup key. At the same time, the source electronic device may also initiate a file recovery request to the target electronic device, so that the target electronic device sends the backup file to the source electronic device, and the source electronic device completes the file recovery; wherein the first backup key and the second backup key may correspond to the backup group currently selected by the user, the first backup key may be used to decrypt the first ciphertext to obtain the first file key, and the second backup key may be used to decrypt the first ciphertext to obtain the second file key; the first ciphertext may include a key to be used to decrypt the first ciphertext to obtain the second file key. The second ciphertext may also include a file obtained by encrypting the first file key with the first backup key; the first file key may be used to decrypt the first type of backup file, and the second file key may be used to decrypt the second type of backup file. Exemplarily, the first type of backup file may include ECE and / or SECE files, and the second type of backup file may include CE and / or DE files. It should be noted that if the first ciphertext stored in the target electronic device is encrypted with the first backup key, the first ciphertext can be decrypted at the source electronic device using the first backup key. Similarly, if the first ciphertext is encrypted with the second backup key, the first ciphertext can be decrypted at the source electronic device using the second backup key.
[0133] Step 202: receiving a backup file sent by a target electronic device, wherein the backup file includes a first ciphertext and a second ciphertext.
[0134] Specifically, the backup file can be sent by the target electronic device to the source electronic device; in a specific implementation, when the target electronic device receives a request for file recovery from the source electronic device, it can send the corresponding backup file to the source electronic device, wherein the backup file can include a first ciphertext and a second ciphertext; the first ciphertext can include a file obtained by encrypting a first file key using a first backup key, and the first ciphertext can also include a file obtained by encrypting a second file key using a second backup key; the second ciphertext can include a file obtained by encrypting a first type of backup file using the first file key, and exemplarily, the first type of backup file can include an ECE file and / or a SECE file; the second ciphertext can also include a file obtained by encrypting a second type of backup file using a second file key, and exemplarily, the second type of backup file can include a CE file and / or a DE file.
[0135] It should be noted that the target electronic device can be a designated location for storing backup files, or other types of storage devices, such as a server or cloud, or a local storage device, and the embodiments of the present application are not limited to this.
[0136] Step 203, obtaining the file type of the first ciphertext. If the file type of the first ciphertext is the first type, decrypting the first ciphertext using the first backup key to obtain the first file key; if the file type of the first ciphertext is the second type, decrypting the first ciphertext using the second backup key to obtain the second file key.
[0137] Specifically, after receiving the first ciphertext, the file type corresponding to the first ciphertext can also be obtained. If the file type corresponding to the first ciphertext is ECE and / or SECE file type, that is, the first type, the first backup key can be used to decrypt the first ciphertext, thereby obtaining the first file key corresponding to the first type. If the file type corresponding to the first ciphertext is CE and DE file type, that is, the second type, the second backup key can be used to decrypt the first ciphertext, thereby obtaining the second file key corresponding to the second type.
[0138] Step 204, obtaining the file type of the second ciphertext. If the file type of the second ciphertext is the first type, decrypting the second ciphertext using the first file key to obtain a first type backup file; if the file type of the second ciphertext is the second type, decrypting the second ciphertext using the second file key to obtain a second type backup file.
[0139] Specifically, after receiving the second ciphertext, the file type of the second ciphertext can also be obtained. If the file type corresponding to the second ciphertext is ECE and / or SECE file type, that is, the first type, the first file key can be used to decrypt the second ciphertext, thereby obtaining the first type backup file; if the file type corresponding to the second ciphertext is CE and / or DE file type, that is, the second type, the second file key can be used to decrypt the second ciphertext, thereby obtaining the second type backup file.
[0140] Figure 6 This is a schematic diagram of the structure of an embodiment of the file backup device of this application, such as Figure 6 As shown, the file backup device 60 may include: an acquisition module 61, a first encryption module 62, a receiving module 63, a second encryption module 64 and a backup module 65;
[0141] An acquisition module 61 is used to acquire one or more files to be backed up and file types corresponding to the files to be backed up on the source electronic device, wherein the file types include a first type and a second type;
[0142] A first encryption module 62 is configured to obtain a first file key corresponding to the first type of files to be backed up and a second file key corresponding to the second type of files to be backed up, encrypt the first type of files to be backed up using the first file key and encrypt the second type of files to be backed up using the second file key to obtain a first ciphertext, and store the first ciphertext, wherein the first ciphertext at least includes the first type of encrypted files;
[0143] A receiving module 63 is configured to receive a first instruction for adding the source electronic device to a first backup group, and in response to the first instruction, obtain a first backup key, a second backup key, and a target electronic device identifier corresponding to the first backup group;
[0144] A second encryption module 64 is configured to encrypt the first file key using the first backup key and to encrypt the second file key using the second backup key to obtain a second ciphertext, and store the second ciphertext, wherein the second ciphertext at least includes the first file encryption key;
[0145] The backup module 65 is used to receive a second instruction for backing up a file, and in response to the second instruction, back up the backup file to a target electronic device corresponding to the target electronic device identifier, wherein the backup file includes the first ciphertext, the second ciphertext and the file identifier corresponding to the backup file.
[0146] In a possible implementation, the receiving module 63 may include: a creating unit 631, a generating unit 632 and a binding unit 633;
[0147] A creating unit 631, configured to create a first backup group in the source electronic device in response to the first instruction;
[0148] A generating unit 632 is configured to obtain an identity corresponding to the first backup group, and generate a first backup key and a second backup key corresponding to the first backup group identity in the source electronic device;
[0149] The binding unit 633 is configured to obtain a target electronic device identifier and bind the identity identifier of the first backup group with the target electronic device identifier.
[0150] In a possible implementation, the receiving module 63 may include: a request unit 634 and a receiving unit 635;
[0151] a request unit 634, configured to obtain an identity of a first backup group in response to the first instruction, and send a request to a first electronic device in the first backup group, so that the first electronic device sends a first backup key, a second backup key, and a target electronic device identity corresponding to the first backup group identity to the source electronic device;
[0152] The receiving unit 635 is configured to receive the first backup key, the second backup key, and the target electronic device identifier, and bind the identity identifier of the first backup group with the target electronic device identifier.
[0153] In a possible implementation, the backup module 65 may include: a detection unit 651 and a backup unit 652;
[0154] A detection unit 651, configured to detect a current state of the source electronic device in response to the second instruction;
[0155] The backup unit 652 is used to back up the backup file to the target electronic device corresponding to the target electronic device identifier if it is detected that the source electronic device is currently in a locked screen state.
[0156] In a possible implementation, the backup module 65 may include: a detection unit 653 and a backup unit 654;
[0157] A detection unit 653, configured to detect the status of the first type of files to be backed up in response to the second instruction;
[0158] The backup unit 654 is configured to back up the backup file to a target electronic device corresponding to the target electronic device identifier if it is detected that the first type of files to be backed up are in a closed state.
[0159] Figure 6 The file backup device provided in the embodiment shown can be used to execute the present application Figure 1-Figure 3 The technical solution of the method embodiment shown, its implementation principle and technical effects can be further referred to the relevant description in the method embodiment.
[0160] Figure 7 This is a schematic diagram of the structure of an embodiment of the file recovery device of the present application, such as Figure 7 As shown, the file recovery device 70 may include: a receiving module 71, a request module 72 and a recovery module 73;
[0161] The receiving module 71 is used to receive a first instruction for file recovery, and in response to the first instruction, obtain a file identifier of the backup file to be recovered and a first backup group identity identifier corresponding to the file identifier;
[0162] The request module 72 is used to obtain a first backup key, a second backup key and a target electronic device identifier corresponding to the first backup group identifier for decrypting the first ciphertext according to the first backup group identifier, and initiate a file recovery request to a target electronic device corresponding to the target electronic device identifier, so that the target electronic device sends the first ciphertext and the second ciphertext corresponding to the backup file identifier according to the file recovery request;
[0163] The recovery module 73 is used to receive the first ciphertext and the second ciphertext sent by the target electronic device; obtain the file type of the first ciphertext, and if the file type of the first ciphertext is the first type, use the first backup key to decrypt the first ciphertext to obtain the first file key; if the file type of the first ciphertext is the second type, use the second backup key to decrypt the first ciphertext to obtain the second file key; obtain the file type of the second ciphertext, and if the file type of the second ciphertext is the first type, use the first file key to decrypt the second ciphertext to obtain the first type backup file; if the file type of the second ciphertext is the second type, use the second file key to decrypt the second ciphertext to obtain the second type backup file.
[0164] In a possible implementation, the request module 72 can also be used to send a request to a first electronic device in a first backup group corresponding to the first backup group identity according to the first backup group identity, so that the first electronic device sends a first backup key, a second backup key and a target electronic device identity corresponding to the first backup group identity.
[0165] Figure 7 The file recovery device provided in the embodiment shown can be used to execute the present application Figure 4 The technical solution of the method embodiment shown in Figure 5, its implementation principle and technical effects can be further referred to the relevant description in the method embodiment.
[0166] It should be understood that the above Figure 1-Figure 3 The file backup device shown and Figure 4 -The division of the modules of the file recovery device shown in FIG5 is only a division of logical functions. In actual implementation, they can be fully or partially integrated into one physical entity, or they can be physically separated. Moreover, these modules can be all implemented in the form of software calling through processing elements; they can also be all implemented in the form of hardware; some modules can also be implemented in the form of software calling through processing elements, and some modules can be implemented in the form of hardware. For example, the detection module can be a separately established processing element, or it can be integrated in a chip of an electronic device. The implementation of other modules is similar. In addition, these modules can be fully or partially integrated together, or they can be implemented independently. In the implementation process, each step of the above method or each of the above modules can be completed by an integrated logic circuit of hardware in the processor element or instructions in the form of software.
[0167] For example, the above modules may be one or more integrated circuits configured to implement the above methods, such as one or more application specific integrated circuits (ASIC), or one or more microprocessors (DSP), or one or more field programmable gate arrays (FPGA). For another example, these modules may be integrated together to implement the above methods in the form of a system-on-a-chip (SOC).
[0168] Figure 8 This is a schematic diagram of the structure of an embodiment of the electronic device of the present application. Figure 8As shown, the electronic device 800 may include: an RF circuit 810 , a memory 820 , other input devices 830 , a display screen 840 , an I / O subsystem 850 and a processor 860 .
[0169] The RF circuit 810 can be used for receiving and sending signals during information transmission or calls. In particular, after receiving the downlink information of the base station, it is sent to the processor 860 for processing; in addition, the uplink data is sent to the base station. Generally, the RF circuit includes but is not limited to an antenna, at least one amplifier, a transceiver, a coupler, an LNA (low noise amplifier), a duplexer, etc. In addition, the RF circuit 810 can also communicate with the network and other devices through wireless communication. The wireless communication may use any communication standard or protocol, including but not limited to wireless local area networks (WLAN), global system of mobile communication (GSM) system, code division multiple access (CDMA) system, wideband code division multiple access (WCDMA) system, general packet radio service (GPRS), long term evolution (LTE) system, LTE frequency division duplex (FDD) system, LTE time division duplex (TDD), universal mobile telecommunication system (UMTS), worldwide interoperability for microwave access (WiMAX) communication system, future fifth generation (5G) system or new radio (NR), etc.
[0170] The memory 820 can be used to store software programs and modules. The processor 860 executes various functional applications and data processing of the electronic device 800 by running the software programs and modules stored in the memory 820. The memory 820 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the electronic device 800 (such as audio data, a phone book, etc.), etc. In addition, the memory 820 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0171] The other input devices 830 may be used to receive input digital or character information, and to generate key signal inputs related to user settings and function control of the electronic device 800. Specifically, the other input devices 830 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, an optical mouse (an optical mouse is a touch-sensitive surface that does not display visual output, or is an extension of a touch-sensitive surface formed by a touch screen), etc. The other input devices 830 are connected to the other input device controller 851 of the I / O subsystem 850, and perform signal interaction with the processor 860 under the control of the other device input controller 851.
[0172] The display screen 840 can be used to display information input by the user or information provided to the user and various menus of the electronic device 800, and can also accept user input. The specific display screen 840 may include a display panel 841 and a touch panel 842. The display panel 841 may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), etc. The touch panel 842, also known as a touch screen, a touch-sensitive screen, etc., can collect user contact or non-contact operations on or near it (such as operations performed by users using fingers, styluses, or any other suitable objects or accessories on or near the touch panel 842, and may also include somatosensory operations; the operations include single-point control operations, multi-point control operations, and other operation types), and drive the corresponding connection device according to a pre-set program. Optionally, the touch panel 842 may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch direction and posture, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into information that can be processed by the processor, and then sends it to the processor 860, and can receive the command sent by the processor 860 and execute it. In addition, the touch panel 842 can be implemented by various types such as resistive, capacitive, infrared and surface acoustic wave, and any technology developed in the future can also be used to implement the touch panel 842. Further, the touch panel 842 can cover the display panel 841, and the user can operate on or near the touch panel 842 covered on the display panel 841 according to the content displayed on the display panel 841 (the display content includes but is not limited to soft keyboard, virtual mouse, virtual button, icon, etc.). After the touch panel 842 detects the operation on or near it, it is transmitted to the processor 860 through the I / O subsystem 850 to determine the user input, and then the processor 860 provides corresponding visual output on the display panel 841 through the I / O subsystem 850 according to the user input. Although in Figure 8 In the embodiment, the touch panel 842 and the display panel 841 are used as two independent components to implement the input and output functions of the electronic device 800, but in some embodiments, the touch panel 842 and the display panel 841 can be integrated to implement the input and output functions of the electronic device 800.
[0173] The I / O subsystem 850 is used to control external devices for input and output, and may include other device input controllers 851 and display controllers 852. Optionally, one or more other input control device controllers 851 receive signals from other input devices 830 and / or send signals to other input devices 830. Other input devices 830 may include physical buttons (press buttons, rocker buttons, etc.), dials, slide switches, joysticks, click wheels, optical mice (optical mice are touch-sensitive surfaces that do not display visual output, or are extensions of touch-sensitive surfaces formed by touch screens). It is worth noting that other input control device controllers 851 may be connected to any one or more of the above devices. The display controller 852 in the I / O subsystem 850 receives signals from the display screen 840 and / or sends signals to the display screen 840. After the display screen 840 detects user input, the display controller 852 converts the detected user input into interaction with the user interface object displayed on the display screen 840, that is, realizes human-computer interaction.
[0174] The processor 860 is the control center of the electronic device 800. It uses various interfaces and lines to connect various parts of the entire mobile electronic device. By running or executing software programs and / or modules stored in the memory 820, and calling data stored in the memory 820, it executes various functions of the electronic device 800 and processes data, thereby monitoring the electronic device as a whole. Optionally, the processor 860 may include one or more processing units; preferably, the processor 860 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, etc., and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 860.
[0175] The electronic device 800 also includes a power source 870 (such as a battery) for supplying power to various components. Preferably, the power source can be logically connected to the processor 860 through a power management system, so that the power management system can manage functions such as charging, discharging, and power consumption.
[0176] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present invention is only a schematic illustration and does not constitute a structural limitation on the electronic device 800. In other embodiments of the present application, the electronic device 800 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
[0177] It is understandable that, in order to realize the above functions, the above-mentioned electronic devices, etc. include hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of each example described in the embodiments disclosed herein, the embodiments of the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the embodiments of the present invention.
[0178] The embodiment of the present application can divide the functional modules of the above-mentioned electronic device according to the above-mentioned method example. For example, each functional module can be divided corresponding to each function, or two or more functions can be integrated into one processing module. The above-mentioned integrated module can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiment of the present invention is schematic and is only a logical function division. There may be other division methods in actual implementation.
[0179] Through the description of the above implementation methods, technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. The specific working process of the system, device and unit described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0180] Each functional unit in each embodiment of the present application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of software functional units.
[0181] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as flash memory, mobile hard disk, read-only memory, random access memory, disk or optical disk.
[0182] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A file backup method, It is characterized in that include: Acquire one or more files to be backed up and file types corresponding to the files to be backed up on the source electronic device, wherein the file types include a first type and a second type; Obtaining a first file key corresponding to the first type of files to be backed up and a second file key corresponding to the second type of files to be backed up, encrypting the first type of files to be backed up using the first file key and encrypting the second type of files to be backed up using the second file key to obtain a first ciphertext, and storing the first ciphertext, wherein the first ciphertext at least includes the first type of encrypted files; receiving a first instruction for adding the source electronic device to a first backup group, and acquiring, in response to the first instruction, a first backup key, a second backup key, and a target electronic device identifier corresponding to the first backup group; Encrypting the first file key using the first backup key and encrypting the second file key using the second backup key to obtain a second ciphertext, and storing the second ciphertext, wherein the second ciphertext at least includes the first file encryption key; A second instruction for backing up a file is received, and in response to the second instruction, a backup file is backed up to a target electronic device corresponding to the target electronic device identifier, wherein the backup file includes the first ciphertext, the second ciphertext and a file identifier corresponding to the backup file.
2. The method according to claim 1, It is characterized in that The acquiring, in response to the first instruction, a first backup key, a second backup key and a target electronic device identifier corresponding to the first backup group comprises: In response to the first instruction, creating a first backup group in the source electronic device; Acquire an identity corresponding to the first backup group, and generate a first backup key and a second backup key corresponding to the first backup group identity in the source electronic device; The target electronic device identifier is obtained, and the identity identifier of the first backup group is bound to the target electronic device identifier.
3. The method according to claim 1, It is characterized in that The acquiring, in response to the first instruction, a first backup key, a second backup key and a target electronic device identifier corresponding to the first backup group comprises: In response to the first instruction, obtaining an identity of a first backup group, and sending a request to a first electronic device in the first backup group, so that the first electronic device sends a first backup key, a second backup key and a target electronic device identity corresponding to the first backup group identity to the source electronic device; The first backup key, the second backup key, and the target electronic device identifier are received, and the identity identifier of the first backup group is bound to the target electronic device identifier.
4. The method according to any one of claims 1 to 3, It is characterized in that The step of backing up the backup file to a target electronic device corresponding to the target electronic device identifier in response to the second instruction includes: In response to the second instruction, detecting a current state of the source electronic device; If it is detected that the source electronic device is currently in a locked screen state, the backup file is backed up to a target electronic device corresponding to the target electronic device identifier.
5. The method according to any one of claims 1 to 3, It is characterized in that The step of backing up the backup file to a target electronic device corresponding to the target electronic device identifier in response to the second instruction includes: In response to the second instruction, detecting the status of the first type of files to be backed up; If it is detected that the first type of files to be backed up are in a closed state, the backup files are backed up to a target electronic device corresponding to the target electronic device identifier.
6. A file recovery method, It is characterized in that include: receiving a first instruction for file recovery, and obtaining, in response to the first instruction, a file identifier of a backup file to be recovered and a first backup group identity identifier corresponding to the file identifier; Acquire a first backup key and a second backup key for decrypting the first ciphertext according to the first backup group identity, and a target electronic device identity corresponding to the first backup group identity, and initiate a file recovery request to a target electronic device corresponding to the target electronic device identity, so that the target electronic device sends the first ciphertext and the second ciphertext corresponding to the backup file identity according to the file recovery request; Receiving the first ciphertext and the second ciphertext sent by the target electronic device; obtaining a file type of the first ciphertext, and if the file type of the first ciphertext is the first type, decrypting the first ciphertext using the first backup key to obtain a first file key; If the file type of the first ciphertext is the second type, decrypt the first ciphertext using the second backup key to obtain a second file key; Obtaining a file type of the second ciphertext, and if the file type of the second ciphertext is the first type, decrypting the second ciphertext using the first file key to obtain a backup file of the first type; If the file type of the second ciphertext is the second type, the second ciphertext is decrypted using the second file key to obtain a second type backup file.
7. The method according to claim 6, It is characterized in that The step of acquiring the first backup key, the second backup key and the target electronic device identifier corresponding to the first backup group identifier for decrypting the first ciphertext according to the first backup group identifier includes: A request is sent to a first electronic device in a first backup group corresponding to the first backup group identity according to the first backup group identity, so that the first electronic device sends a first backup key, a second backup key and a target electronic device identity corresponding to the first backup group identity.
8. An electronic device, It is characterized in that include: A memory, the memory is used to store computer program code, the computer program code includes instructions, when the device reads the instructions from the memory, the device performs the following steps: Acquire one or more files to be backed up and file types corresponding to the files to be backed up on the source electronic device, wherein the file types include a first type and a second type; Obtaining a first file key corresponding to the first type of files to be backed up and a second file key corresponding to the second type of files to be backed up, encrypting the first type of files to be backed up using the first file key and encrypting the second type of files to be backed up using the second file key to obtain a first ciphertext, and storing the first ciphertext, wherein the first ciphertext at least includes the first type of encrypted files; receiving a first instruction for adding the source electronic device to a first backup group, and acquiring, in response to the first instruction, a first backup key, a second backup key, and a target electronic device identifier corresponding to the first backup group; Encrypting the first file key using the first backup key and encrypting the second file key using the second backup key to obtain a second ciphertext, and storing the second ciphertext, wherein the second ciphertext at least includes the first file encryption key; A second instruction for backing up a file is received, and in response to the second instruction, a backup file is backed up to a target electronic device corresponding to the target electronic device identifier, wherein the backup file includes the first ciphertext, the second ciphertext and a file identifier corresponding to the backup file.
9. The device according to claim 8, It is characterized in that When the instruction is executed by the device, the step of causing the device to execute, in response to the first instruction, obtaining the first backup key, the second backup key and the target electronic device identifier corresponding to the first backup group includes: In response to the first instruction, creating a first backup group in the source electronic device; Acquire an identity corresponding to the first backup group, and generate a first backup key and a second backup key corresponding to the first backup group identity in the source electronic device; The target electronic device identifier is obtained, and the identity identifier of the first backup group is bound to the target electronic device identifier.
10. The device according to claim 8, It is characterized in that When the instruction is executed by the device, the step of causing the device to execute, in response to the first instruction, obtaining the first backup key, the second backup key and the target electronic device identifier corresponding to the first backup group includes: In response to the first instruction, obtaining an identity of a first backup group, and sending a request to a first electronic device in the first backup group, so that the first electronic device sends a first backup key, a second backup key and a target electronic device identity corresponding to the first backup group identity to the source electronic device; The first backup key, the second backup key, and the target electronic device identifier are received, and the identity identifier of the first backup group is bound to the target electronic device identifier.
11. The device according to any one of claims 8 to 10, It is characterized in that When the instruction is executed by the device, the step of causing the device to execute, in response to the second instruction, backing up the backup file to a target electronic device corresponding to the target electronic device identifier includes: In response to the second instruction, detecting a current state of the source electronic device; If it is detected that the source electronic device is currently in a locked screen state, the backup file is backed up to a target electronic device corresponding to the target electronic device identifier.
12. The device according to any one of claims 8 to 10, It is characterized in that When the instruction is executed by the device, the step of causing the device to execute, in response to the second instruction, backing up the backup file to a target electronic device corresponding to the target electronic device identifier includes: In response to the second instruction, detecting the status of the first type of files to be backed up; If it is detected that the first type of files to be backed up are in a closed state, the backup files are backed up to a target electronic device corresponding to the target electronic device identifier.
13. An electronic device, It is characterized in that include: A memory, the memory is used to store computer program code, the computer program code includes instructions, when the device reads the instructions from the memory, the device performs the following steps: receiving a first instruction for file recovery, and obtaining, in response to the first instruction, a file identifier of a backup file to be recovered and a first backup group identity identifier corresponding to the file identifier; Acquire a first backup key and a second backup key for decrypting the first ciphertext according to the first backup group identity, and a target electronic device identity corresponding to the first backup group identity, and initiate a file recovery request to a target electronic device corresponding to the target electronic device identity, so that the target electronic device sends the first ciphertext and the second ciphertext corresponding to the backup file identity according to the file recovery request; Receiving the first ciphertext and the second ciphertext sent by the target electronic device; obtaining a file type of the first ciphertext, and if the file type of the first ciphertext is the first type, decrypting the first ciphertext using the first backup key to obtain a first file key; If the file type of the first ciphertext is the second type, decrypt the first ciphertext using the second backup key to obtain a second file key; Obtaining a file type of the second ciphertext, and if the file type of the second ciphertext is the first type, decrypting the second ciphertext using the first file key to obtain a backup file of the first type; If the file type of the second ciphertext is the second type, the second ciphertext is decrypted using the second file key to obtain a second type backup file.
14. The device according to claim 13, It is characterized in that When the instruction is executed by the device, the device executes the steps of acquiring, according to the first backup group identity, a first backup key and a second backup key for decrypting the first ciphertext and a target electronic device identifier corresponding to the first backup group identity, including: A request is sent to a first electronic device in a first backup group corresponding to the first backup group identity according to the first backup group identity, so that the first electronic device sends a first backup key, a second backup key and a target electronic device identity corresponding to the first backup group identity.
15. A computer-readable storage medium, It is characterized in that The method comprises computer instructions, which, when executed on the device, cause the device to execute the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
File encryption method, file decryption method, file encryption device, file decryption device and computer-readable storage medium
CN107659632A
Method and system for safely recovering encrypted data based on hardware
CN111130778A
System and method for backing up and restoring files encrypted with file-level content protection
US20110252233A1
