Data processing method and device
By dividing the electronic device file data into two parts, storing them locally and in the cloud respectively, and using the communication line status to determine backup and deletion operations, the security issues of file data in diverse environments are solved, and a balance between file security and ease of use is achieved.
Patent Information
- Application Number
- CN202111446674.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-30
- Publication Date
- 2025-09-23
- Estimated Expiration
- 2041-11-30
AI Technical Summary
Existing data processing methods cannot guarantee the security of file data in electronic devices in diverse environments.
The file data on the electronic device is divided into two parts and stored in different locations, one part locally and the other part in the cloud or other storage locations. The backup and deletion operations of the data are determined by detecting the connection status of the communication line to ensure that the file is invalidated when necessary.
While ensuring the convenience of file use, it effectively improves the security of files, reduces the risk of data leakage, and avoids the operational complexity brought about by the easy cracking of encrypted files and complete file backup in existing technologies.
Smart Images

Figure CN114372285B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer application technology, and in particular to a data processing method and device. Background Art
[0002] Existing data processing methods cannot guarantee that file data in electronic devices remains secure in diverse environments. Summary of the Invention
[0003] Embodiments of the present invention provide a data processing method and device.
[0004] According to a first aspect of the present invention, a data processing method is provided, comprising: in response to a first electronic device satisfying a first condition, backing up first data of a first file on the first electronic device to a first location; when the first electronic device satisfies a second condition, deleting the first data from the first file.
[0005] According to an embodiment of the present invention, the method further includes: copying at least part of the data from the first file using a first method to obtain at least the first data.
[0006] According to an embodiment of the present invention, the method further includes: when the first electronic device meets the first condition again, acquiring the first data from the first location, and restoring the first data to the first file from which the first data was deleted.
[0007] According to an embodiment of the present invention, the data volume of the first data is not greater than the data volume of the first file from which the first data is deleted.
[0008] According to one embodiment of the present invention, the first condition includes that the first electronic device is connected to a preset communication line; accordingly, in response to the first electronic device satisfying the first condition, backing up the first data of the first file on the first electronic device to a first location includes: when the first electronic device is connected to the preset communication line, backing up the first data of the first file on the first electronic device to the first location via the preset communication line; wherein, the first location includes the cloud.
[0009] According to one embodiment of the present invention, while the first electronic device is connected to a preset communication line, the first condition also includes at least one of the following: after the first file in the first electronic device is updated and saved, no new update operation is performed on the file within a first set time; the save operation of the first file within a second set time is greater than or equal to a set number of times; a file splitting instruction is received for the first file in the first electronic device.
[0010] According to one embodiment of the present invention, the second condition includes being disconnected from a preset communication line; and deleting the first data from the first file when the first electronic device satisfies the second condition includes: deleting the first data from the first file when the first electronic device is disconnected from the preset communication line.
[0011] According to an embodiment of the present invention, the second condition further includes a third set time interval after detecting that the first electronic device is disconnected from the preset communication line.
[0012] According to one embodiment of the present invention, the method also includes: receiving a file deletion instruction, the file deletion instruction carrying a file identifier of the file to be deleted; confirming the deletion type of the file deletion instruction, the deletion type being used to indicate whether the file is to be completely deleted; and if the file needs to be completely deleted, deleting the first file and the first data at the first position.
[0013] According to a second aspect of the present invention, a data processing device is also provided, comprising: a backup module for backing up first data of a first file on a first electronic device to a first location in response to a first electronic device satisfying a first condition; and a deletion module for deleting the first data from the first file when the first electronic device satisfies a second condition.
[0014] In accordance with an embodiment of the present invention, a data processing method and apparatus backs up first data of a first file on a first electronic device to a first location in response to a first condition being satisfied by the first electronic device, and deletes the first data from the first file when the first electronic device satisfies a second condition. Thus, the first file on the first electronic device is divided into two parts, each stored in a different location. If the electronic device satisfies the second condition, the first data of the first file is deleted, rendering the first file invalid. This ensures both convenient file access and effective file security.
[0015] It should be understood that the teachings of the present invention do not necessarily achieve all of the beneficial effects described above, but specific technical solutions can achieve specific technical effects, and other embodiments of the present invention can also achieve beneficial effects not mentioned above. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] The above and other objects, features and advantages of the exemplary embodiments of the present invention will become readily apparent by reading the following detailed description with reference to the accompanying drawings, in which several embodiments of the present invention are shown by way of example and not limitation, in which:
[0017] In the drawings, the same or corresponding reference numerals denote the same or corresponding parts.
[0018] Figure 1 A schematic diagram of the implementation flow of the data processing method according to an embodiment of the present invention is shown;
[0019] Figure 2 A schematic diagram illustrating an implementation flow of a specific application example of the data processing method according to an embodiment of the present invention is shown;
[0020] Figure 3 A schematic diagram of a file segmentation process in a specific application example of the data processing method according to an embodiment of the present invention is shown;
[0021] Figure 4 It shows the data processing operation of the file update process in a specific application example of the data processing method according to the embodiment of the present invention;
[0022] Figure 5 A schematic diagram of the structure of a data processing device according to an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0023] The principles and spirit of the present invention will be described below with reference to several exemplary embodiments. It should be understood that these embodiments are provided solely to enable those skilled in the art to better understand and implement the present invention, and are not intended to limit the scope of the present invention in any way. Rather, these embodiments are provided to make the present invention more thorough and complete, and to fully convey the scope of the present invention to those skilled in the art.
[0024] The technical solution of the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0025] Figure 1 The figure shows a schematic diagram of the implementation flow of the data processing method according to an embodiment of the present invention.
[0026] refer to Figure 1 The data processing method of an embodiment of the present invention includes at least the following operation process: operation 101, in response to the first electronic device satisfying the first condition, backing up the first data of the first file on the first electronic device to the first location; operation 102, when the first electronic device satisfies the second condition, deleting the first data from the first file.
[0027] In operation 101 , in response to a first electronic device satisfying a first condition, first data of a first file on the first electronic device is backed up to a first location.
[0028] In one embodiment of the present invention, the first condition includes the first electronic device being connected to a preset communication line. Accordingly, in response to the first electronic device satisfying the first condition, backing up the first data of the first file on the first electronic device to the first location can be achieved by the following operation: when the first electronic device is connected to the preset communication line, backing up the first data of the first file on the first electronic device to the first location via the preset communication line.
[0029] The preset communication line may be a local area network (LAN) or a designated wired network. The LAN may be a wireless network or a wired network. The designated wired network may be a wide area network (WAN) connected via a password or other means. The first location may be a cloud, a designated server, a designated computer, or a storage device.
[0030] Specifically, when the first electronic device is connected to a preset communication line, the first data of the first file can be backed up to the cloud via a wireless network. Alternatively, the first data of the first file can be backed up to a designated computer host or storage of an enterprise or institution via a wired network.
[0031] In another embodiment of the present invention, while the first electronic device is connected to a preset communication line, the first condition also includes at least one of the following: after the first file in the first electronic device is updated and saved, no new update operation is performed on the file within a first set time; the save operation of the first file within a second set time is greater than or equal to a set number of times; a file splitting instruction for the first file in the first electronic device is received.
[0032] For example, since the first electronic device may always be in a state of being connected to the preset communication line, it is not necessary to continuously back up the first file when the first electronic device is connected to the preset communication line. In addition, the first electronic device may have completed the backup of the first file before it was disconnected from the preset communication network last time. Therefore, the first electronic device does not necessarily have to back up the first file immediately when the first electronic device is connected to the preset communication line. Based on this, another embodiment of the present invention further optimizes the solution, and when the update of the first file is completed or the file splitting instruction is received, the first data of the first file on the first electronic device is backed up to the first location.
[0033] Completing the update of the first file may include: after updating and saving the first file, no new update operation is performed on the first file within a first set time. Completing the update of the first file may also include: saving the first file greater than or equal to a set number of times within a second set time.
[0034] Receiving the file splitting instruction for the first file in the first electronic device may include moving the first file to a set folder, or setting a set attribute of the first file to require encryption for storage.
[0035] In one embodiment of the present invention, the data volume of the first data is not greater than the data volume of the first file from which the first data is deleted.
[0036] Specifically, since the first data needs to be moved to a first location, and typically, the first location is a storage space outside the first electronic device, to ensure data processing efficiency and effectively reduce the amount of data processed, the amount of the first data is configured to be no larger than the amount of the first file from which the first data is deleted.
[0037] In operation 102 , when the first electronic device satisfies a second condition, the first data is deleted from the first file.
[0038] In one embodiment of the present invention, the second condition includes being disconnected from a preset communication line; when the first electronic device satisfies the second condition, the first data is deleted from the first file, which can be achieved by the following operation: when the first electronic device is disconnected from the preset communication line, the first data is deleted from the first file.
[0039] Based on the above solution, when the first electronic device meets the first condition, the first data of the first file on the first electronic device is backed up to the first location. The file is stored in two parts, one part of the data being retained locally on the first electronic device, and the other part being backed up to the first location. Both parts of the first file are in a file format that is not accessible or editable. Without the other part of the data, the complete first file cannot be retrieved.
[0040] In one embodiment of the present invention, the second condition further includes a third set time interval after detecting that the first electronic device is disconnected from the preset communication line.
[0041] Specifically, in order to ensure that the data of the first file is not lost, after detecting that the first electronic device is disconnected from the preset communication line, the first data is deleted from the first file after a third set time interval.
[0042] In one embodiment of the present invention, at least part of the data is copied from the first file using the first method to obtain at least the first data.
[0043] Specifically, at least part of the data can be copied from the first file as the first data using a copy method. The first data can then be backed up to the first location. After the first data is copied, operations such as viewing and editing the first file can also be performed.
[0044] In one embodiment of the present invention, the process of copying the first data may be before the first electronic device is connected to the preset communication line, or may be after the first electronic device is connected to the preset communication line, which is not limited by the present invention.
[0045] In one embodiment of the present invention, when the first electronic device meets the first condition again, the first data is further obtained from the first location, and the first data is restored to the first file from which the first data was deleted.
[0046] For example, if the first electronic device is disconnected from the preset communication line and then reconnects to the preset communication line at some point, the first data can be retrieved from the first location and restored to the first file, so that the first file can be used after the first electronic device is reconnected to the preset communication line.
[0047] In one embodiment of the present invention, the data processing method also includes: receiving a file deletion instruction, the file deletion instruction carries a file identifier of the file to be deleted, and confirming the deletion type of the file deletion instruction, the deletion type is used to indicate whether the file is to be completely deleted, and if the file needs to be completely deleted, deleting the first file and the first data at the first location.
[0048] Specifically, after receiving a file deletion instruction, the first step is to confirm the deletion type of the file deletion instruction based on the file identifier of the file to be deleted carried in the file deletion instruction. If the deletion type indicates that the file needs to be completely deleted, the first file and the first data at the first location are deleted, thereby ensuring that all data in the first file is deleted.
[0049] Based on the above scheme, the present invention effectively solves the security problem of electronic data. Specifically, for files with high confidentiality and security requirements, the above data processing method can be used for processing. Even if the electronic device is stolen or illegally viewed, the data in the electronic device is not easily used by criminals, which effectively reduces the risk of leaking commercial secrets and technical secrets. It can effectively overcome the problem that the password of the local file encryption method in the prior art is easy to crack. At the same time, it can also effectively avoid the complicated and tedious operations brought about by the existing technology of completely backing up the complete file to a storage location such as a network disk, and the risk of missing the deletion of local files after uploading the modified files. For example: after backing up files to a network disk and deleting local files to reduce the risk of electronic device theft, it will be necessary to connect to the network disk or download files from the network disk to the local each time the data is queried or modified. After the file is viewed or modified, it is necessary to delete the local file in time and upload the modified file. The operation is cumbersome and there is a risk of missing the deletion of local files.
[0050] Figure 2 The flowchart of a specific application example of the data processing method according to the embodiment of the present invention is shown.
[0051] refer to Figure 2 The specific application example of the data processing method according to the embodiment of the present invention includes at least the following operation process:
[0052] Operation 201 determines the size of each block and the starting position of each block according to the file header, the number of threads and the set segmentation ratio, generates a configuration file and a status file, records the file ID, and sets a preset password.
[0053] Here, you can set the number of blocks to split the file into based on the number of threads. This way, you can maximize the data processing capabilities of the electronic device and ensure data processing efficiency.
[0054] The status file is used to indicate whether the file is being uploaded or downloaded, as well as the upload or download progress of the file. The configuration file is used to indicate the file segmentation method, specifically, it may include information such as file type, data segmentation ratio, and the start and end positions of each data block.
[0055] The specific instructions for file segmentation will be combined with Figure 3 A detailed description is given and will not be repeated here.
[0056] In operation 202, a setting file of the first electronic device is divided into first data and second data, wherein the data size of the first data is less than or equal to the data size of the second data. Operation 204 is performed on the first data, and operation 203 is performed on the second data.
[0057] In operation 203 , the second data and the state file are stored locally.
[0058] Operation 204 is to determine whether the first electronic device is connected to the enterprise intranet. If so, operation 205 is executed; otherwise, operation 207 is executed.
[0059] Operation 205: Upload the first data and the segmentation configuration file to the enterprise intranet server.
[0060] Operation 206 : Delete the local first data and the segmentation configuration file, and record the uploaded status in the status file.
[0061] Operation 207 : Recording status information that the split first data has not been uploaded in a status file.
[0062] Operation 208: disconnect from the enterprise intranet for a certain period of time and stop using the file.
[0063] Operation 209: Automatically delete the complete local file.
[0064] Operation 210: All data, configuration and status files continue to be retained locally, and the first data and segmentation configuration file are uploaded after connecting to the enterprise intranet.
[0065] Operation 211: Determine whether the first electronic device is connected to the enterprise intranet. If so, execute operation 205; otherwise, return to execute operation 210.
[0066] It should be noted that Figure 2 and below Figure 3-5 The solution is described using the enterprise LAN as an example of a preset communication line. The second data volume retained locally on the electronic device is set to be greater than or equal to the first data volume uploaded to the server. Data segmentation refers to extracting a file into two parts, the size ratio of which can be set based on actual needs. After data segmentation is completed, the complete file before data segmentation will continue to be retained until the first data with a smaller volume is uploaded. However, in actual applications, these settings can be adjusted based on actual conditions and are not limited by the present invention.
[0067] Figure 3 A schematic diagram of a file segmentation process in a specific application example of the data processing method according to an embodiment of the present invention is shown.
[0068] refer to Figure 3 In the specific application example of the data processing method according to the embodiment of the present invention, file segmentation can be achieved by the following operations:
[0069] 1. Divide the file into a file header and a file body. The file body is further divided into a plurality of data blocks. The number of data blocks is equal to the number of threads of the first electronic device. Each data block is further divided into two data blocks, one large and one small, according to a set file splitting ratio. If no file splitting ratio is set, a pre-set default file splitting ratio is used.
[0070] 2. Use the hash value of the complete file as a random seed to generate a random number, and then use the random number to perform an XOR operation on each data block to generate a temporary file.
[0071] 3. Merge the temporary file generated by the file header and the temporary file generated by the small data block into first data with a smaller data volume.
[0072] 4. The temporary files generated by the large data blocks are merged into the first data with a larger data volume;
[0073] 5. Finally, add the file ID in the split configuration file to the first data and the second data respectively to bind the data.
[0074] Figure 4 The data processing operation of the file update process in a specific application example of the data processing method according to the embodiment of the present invention is shown.
[0075] refer to Figure 4 The data processing operation of the file update process in the specific application example of the data processing method according to the embodiment of the present invention at least includes the following operation flow:
[0076] Operation 401: Update the complete file.
[0077] For example, the editing of the file is completed on the first electronic device.
[0078] Operation 402, splitting the set file of the first electronic device into first data and second data when one of the following file update conditions is met: after the first file is updated and saved, no new update operation is performed on the first file within a first set time interval; the number of save operations on the first file within a second set time is greater than or equal to a set number; a file splitting instruction for the first file in the first electronic device is received.
[0079] Automatically re-split files at a set time, or after a set number of updates, or choose to re-split manually.
[0080] The data volume of the first data is less than or equal to the data volume of the second data. Operation 404 is performed on the first data, and operation 403 is performed on the second data.
[0081] Operation 403: The new second data and status file replaces the old second data and status file.
[0082] Operation 404 is to determine whether the first electronic device is connected to the enterprise intranet. If so, operation 405 is executed; otherwise, operation 407 is executed.
[0083] In operation 405 , the new first data and the segmentation configuration file are uploaded to the enterprise intranet server to replace the old first data and the segmentation configuration file.
[0084] Operation 406 : Delete the local first data and the segmentation configuration file, and record the uploaded status in the status file.
[0085] Operation 407: Record the unuploaded status information in the status file.
[0086] Operation 408: disconnect from the enterprise intranet for a certain period of time and stop using the file.
[0087] Operation 409: Automatically delete the complete local file.
[0088] Operation 410: All data, configuration and status files continue to be retained locally, and the first data and segmentation configuration file are uploaded after connecting to the enterprise intranet.
[0089] Operation 411: Determine whether the first electronic device is connected to the enterprise intranet. If so, execute operation 405; otherwise, return to execute operation 410.
[0090] In the specific application example of the data processing method according to the embodiment of the present invention, file deletion and file recovery operations are also configured.
[0091] Specifically, if a file deletion instruction is received, it is first necessary to determine whether the file to be deleted has been split, whether the first data after the split has been uploaded, and whether the file should be completely deleted.
[0092] Secondly, determine the data that needs to be deleted based on the above information. For example, if the file corresponding to the file deletion instruction has been split, the first data obtained by the split has been uploaded, and the file needs to be completely deleted, then the first data and the split configuration file uploaded to the enterprise server, the local complete file, the second data, and the status file all need to be deleted. If the file corresponding to the file deletion instruction has not been split, and the deletion instruction on the file shows that the file does not need to be completely deleted, then the file can be split at this time, and the complete file before the split can be deleted. The first data obtained by the split is uploaded to the enterprise server. For example: it can be determined whether the splitting of the file is completed at the same time as the first electronic device is disconnected from the enterprise LAN or within a set time of disconnection from the enterprise LAN. If it is completed, the complete file on the first electronic device is deleted. If it is not completed, the complete file is deleted after the splitting of the file is completed.
[0093] To restore files, you can use the following operations:
[0094] 1. When receiving a file recovery instruction, determine whether the file has been over-segmented.
[0095] If the file has been split, and the second data with a smaller data volume and the split configuration file have been uploaded, then download the second data with a smaller data volume and the split configuration file when connecting to the intranet, and restore the complete file according to the split configuration file. After restoration, delete the second data with a smaller data volume and the split configuration file.
[0096] 2. If the second data with a smaller data volume and the split configuration file have not been uploaded, it means that the first electronic device is disconnected from the enterprise intranet. You can enter the preset password and restore the complete file according to the split configuration file. After restoration, delete the second data with a smaller data volume and the split configuration file.
[0097] 3. If the file is not split or the file is disconnected from the enterprise intranet and there is no second data with a smaller data volume and split configuration file locally, the recovery fails.
[0098] Specifically, file recovery and file segmentation are inverse processes. First, the starting position and size of each data block are determined based on the segmentation configuration file. Then, the data blocks are XORed using the random numbers generated during the file segmentation process to restore the data blocks and generate temporary files. Finally, the temporary files are merged into the complete file according to the position order recorded in the segmentation configuration file.
[0099] In accordance with an embodiment of the present invention, a data processing method and apparatus backs up first data of a first file on the first electronic device to a first location in response to a first electronic device satisfying a first condition, and deletes the first data from the first file when the first electronic device satisfies a second condition. Thus, the first file on the first electronic device is divided into two parts, each stored in a different location. If the electronic device satisfies the second set condition, the first data of the first file is deleted, rendering the first file invalid. This ensures both convenient file access and effective file security.
[0100] Similarly, based on the above data processing method, an embodiment of the present invention also provides a computer-readable storage medium, which stores a program. When the program is executed by a processor, the processor performs at least the following operation steps: Operation 101, in response to the first electronic device satisfying the first condition, backing up the first data of the first file on the first electronic device to the first location; Operation 102, when the first electronic device satisfies the second condition, deleting the first data from the first file.
[0101] Furthermore, based on the above data processing method, an embodiment of the present invention also provides a data processing device, such as Figure 5 The device 50 includes: a backup module 501, which is used to back up the first data of the first file on the first electronic device to a first location in response to the first electronic device satisfying the first condition; and a deletion module 502, which is used to delete the first data from the first file when the first electronic device satisfies the second condition.
[0102] According to an embodiment of the present invention, the apparatus 50 further includes: a copy module, configured to copy at least part of the data from the first file using a first method to obtain at least the first data.
[0103] According to an embodiment of the present invention, the apparatus 50 further includes: a recovery module, configured to obtain the first data from the first location and restore the first data to the first file from which the first data was deleted when the first electronic device meets the first condition again.
[0104] According to an embodiment of the present invention, the data size of the first data is not greater than the data size of the first file from which the first data is deleted.
[0105] According to one embodiment of the present invention, the first condition includes that the first electronic device is connected to a preset communication line; accordingly, the backup module 501 includes: a first backup submodule, which is used to back up the first data of the first file on the first electronic device to a first location via the preset communication line when the first electronic device is connected to the preset communication line; wherein the first location includes the cloud.
[0106] According to one embodiment of the present invention, when the first electronic device is connected to a preset communication line, the first condition also includes at least one of the following: after the first file in the first electronic device is updated and saved, no new update operation is performed on the file within a first set time interval; the save operation of the first file within a second set time is greater than or equal to a set number of times; a file splitting instruction for the first file in the first electronic device is received.
[0107] According to one embodiment of the present invention, the second condition includes disconnection from the preset communication line; the deletion module 502 includes: a deletion submodule, configured to delete the first data from the first file when the first electronic device is disconnected from the preset communication line.
[0108] According to an embodiment of the present invention, the second condition further includes a third set time interval after detecting that the first electronic device is disconnected from the preset communication line.
[0109] According to one embodiment of the present invention, the device 50 also includes: a deletion instruction receiving module, used to receive a file deletion instruction, the file deletion instruction carries the file identifier of the file to be deleted; a deletion type determination module, used to confirm the deletion type of the file deletion instruction, the deletion type is used to indicate whether the file is completely deleted; a complete deletion module, used to delete the first file and the first data at the first location when the file needs to be completely deleted.
[0110] It should be noted that the above description of the data processing device embodiment is different from the above description of the data processing device embodiment. Figures 1 to 5 The description of the method embodiment shown is similar, with the same Figures 1 to 4 The method embodiment shown in FIG. 1 has similar beneficial effects, so it will not be described in detail. For technical details not disclosed in the embodiment of the data processing device of the present invention, please refer to the aforementioned embodiment of the present invention. Figures 1 to 4 The description of the method embodiment shown in the figure is understood, and in order to save space, it is not repeated here.
[0111] It should be noted that, in this document, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or apparatus comprising the element.
[0112] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of units is merely a logical function division. In actual implementation, there may be other division methods, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.
[0113] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units; they may be located in one place or distributed across multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the scheme of this embodiment.
[0114] In addition, all functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may be separately used as a unit, or two or more units may be integrated into one unit; the above-mentioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0115] Those skilled in the art will understand that all or part of the steps of implementing the above-mentioned method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above-mentioned method embodiment; and the aforementioned storage medium includes: mobile storage devices, read-only memories (ROM), magnetic disks or optical disks, and other media that can store program codes.
[0116] Alternatively, if the above-mentioned integrated unit of the present invention is implemented in the form of a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a number of instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the methods of each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROMs, magnetic disks, or optical disks.
[0117] The above are merely specific embodiments of the present invention, but the scope of protection of the present invention is not limited thereto. Any modifications or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be based on the scope of protection of the claims.
Claims
1. A data processing method, comprising: In response to the first electronic device satisfying the first condition, backing up first data of a first file on the first electronic device to a first location; When the first electronic device meets a second condition, deleting the first data from the first file; The first data is obtained by the following operations: dividing the first file into a file header and a file body; dividing the file body into a plurality of data blocks, where the number of data blocks is the number of threads of the first electronic device; dividing each data block into two data blocks, one large and one small, according to a set file segmentation ratio; using the hash value of the first file as a random seed to generate a random number, and performing an XOR operation on each data block based on the random number to generate a temporary file; merging the temporary file generated by the file header and the temporary files generated by all the small data blocks into the first data, and merging the temporary files generated by all the large data blocks into the second data; adding the file ID in the segmentation configuration file to the first data and the second data, binding them to the first data and the second data respectively; When a file recovery instruction is received, the starting position and size of each data block are determined according to the segmentation configuration file bound to the first data and the second data, an XOR operation is performed on the data block using the random number in the file segmentation process, the data block is recovered, and a temporary file is generated; the temporary files are merged into the first file according to the position order recorded in the segmentation configuration file.
2. The method according to claim 1, further comprising: At least part of the data is copied from the first file using a first method to obtain at least the first data.
3. The method according to claim 1, further comprising: When the first electronic device meets the first condition again, the first data is acquired from the first location, and the first data is restored to the first file from which the first data is deleted. 4 . The method according to claim 3 , wherein the data size of the first data is not greater than the data size of the first file from which the first data is deleted.
5. The method according to claim 1, wherein the first condition comprises that the first electronic device is connected to a preset communication line; In response to the first electronic device satisfying the first condition, backing up first data of the first file on the first electronic device to the first location includes: When the first electronic device is connected to the preset communication line, backing up the first data of the first file on the first electronic device to a first location via the preset communication line; The first location includes the cloud.
6. The method according to claim 5, wherein when the first electronic device is connected to a preset communication line, the first condition further comprises at least one of the following: After the first file in the first electronic device is updated and saved, no new update operation is performed on the file within a first set time interval; The first file is saved for a set number of times or more within a second set time period; A file splitting instruction for a first file in the first electronic device is received.
7. The method according to claim 1, wherein the second condition comprises disconnection from a preset communication line; When the first electronic device satisfies a second condition, deleting the first data from the first file includes: When the first electronic device is disconnected from the preset communication line, the first data is deleted from the first file.
8. The method according to claim 7, wherein the second condition further comprises a third set time interval after detecting that the first electronic device is disconnected from a preset communication line.
9. The method according to claim 1, further comprising: Receiving a file deletion instruction, wherein the file deletion instruction carries a file identifier of a file to be deleted; Confirming the deletion type of the file deletion instruction, where the deletion type is used to indicate whether the file is to be completely deleted; When the file needs to be completely deleted, the first file and the first data at the first location are deleted.
10. A data processing device, comprising: a backup module, configured to back up first data of a first file on the first electronic device to a first location in response to the first electronic device satisfying a first condition; a deleting module, configured to delete the first data from the first file when the first electronic device meets a second condition; The first data is obtained by the following operations: dividing the first file into a file header and a file body; dividing the file body into a plurality of data blocks, where the number of data blocks is the number of threads of the first electronic device; dividing each data block into two data blocks, one large and one small, according to a set file segmentation ratio; using the hash value of the first file as a random seed to generate a random number, and performing an XOR operation on each data block based on the random number to generate a temporary file; merging the temporary file generated by the file header and the temporary files generated by all the small data blocks into the first data, and merging the temporary files generated by all the large data blocks into the second data; adding the file ID in the segmentation configuration file to the first data and the second data, binding them to the first data and the second data respectively; The device is further configured to, upon receiving a file recovery instruction, determine the starting position and size of each data block based on a segmentation configuration file bound to the first data and the second data, perform an XOR operation on the data blocks using random numbers in the file segmentation process, recover the data blocks, and generate a temporary file; Merge the temporary files into the first file according to the position order recorded in the split configuration file.
Citation Information
Patent Citations
Content management method and apparatus of mobile terminal
CN102693255A
Automatic data eliminating system of mobile device
CN105069359A
Method and electronic device for managing data
CN105760772A