CN108897639B - File processing method and device - Google Patents

File processing method and device Download PDF

Info

Publication number
CN108897639B
CN108897639B CN201810579593.XA CN201810579593A CN108897639B CN 108897639 B CN108897639 B CN 108897639B CN 201810579593 A CN201810579593 A CN 201810579593A CN 108897639 B CN108897639 B CN 108897639B
Authority
CN
China
Prior art keywords
files
file
party application
file set
deletion
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810579593.XA
Other languages
Chinese (zh)
Other versions
CN108897639A (en
Inventor
杜冰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201810579593.XA priority Critical patent/CN108897639B/en
Publication of CN108897639A publication Critical patent/CN108897639A/en
Application granted granted Critical
Publication of CN108897639B publication Critical patent/CN108897639B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

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

Landscapes

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

Abstract

The embodiment of the application discloses a file processing method and a file processing device, wherein the method comprises the following steps: when detecting that a deletion request of a third-party application for a plurality of files is an illegal deletion request, dividing the plurality of files into a plurality of file sets; performing a transfer operation for a file in a first one of the plurality of file sets; executing deletion detection operation aiming at files in the ith file set, and simultaneously executing transfer operation aiming at files in the (i + 1) th file set, wherein the deletion detection operation is used for detecting whether the files in the ith file set are deleted, and the transfer operation is used for transferring the files in the (i + 1) th file set from an original storage space of the electronic equipment to a preset storage space. The embodiment of the application also discloses a corresponding file processing device. The file processing method and device are beneficial to improving the real-time performance of file processing, data loss caused by mistaken deletion of files by a third party application is avoided, and user loss is reduced.

Description

File processing method and device
Technical Field
The application relates to the technical field of electronic equipment, in particular to a file processing method and device.
Background
Because the electronic equipment has the advantages of convenient and quick data storage, capability of being read at any time and the like, more and more users store multimedia files such as photos, videos and the like on the electronic equipment. However, this storage method makes it convenient for users to store files, and at the same time, there is a risk that data is easily attacked by malicious programs and deleted.
Taking a smart phone carrying an Android system as an example, once some illegal application markets or malicious programs disguised as applications are installed on the smart phone, the storage authority of data in the smart phone can be acquired, so that operations such as deleting or modifying private or important data stored on the smart phone by a user can be performed. Once deleted, these deleted multimedia files cannot be restored, which brings inconvenience to the user.
Disclosure of Invention
The embodiment of the invention provides a file processing method and device, aiming at improving the real-time property of file processing, avoiding data loss caused by mistaken deletion of files by a third party application and reducing user loss.
In a first aspect, an embodiment of the present application provides a file processing method, including:
when detecting that a deletion request of a third-party application for a plurality of files is an illegal deletion request, dividing the plurality of files into a plurality of file sets, wherein the deletion request is a request of the third-party application in a preset operation process;
performing a transfer operation for a file in a first one of the plurality of file sets;
executing deletion detection operation aiming at files in an ith file set, and simultaneously executing transfer operation aiming at files in an (i + 1) th file set, wherein the deletion detection operation is used for detecting whether the files in the ith file set are deleted, the transfer operation is used for transferring the files in the (i + 1) th file set from an original storage space of an electronic device to a preset storage space, the plurality of file sets comprise the ith file set and the (i + 1) th file set, and i is a positive integer which is greater than or equal to 1 and less than or equal to the number of the file sets.
In a second aspect, an embodiment of the present application provides a file processing apparatus, including:
the device comprises a dividing unit, a processing unit and a processing unit, wherein the dividing unit is used for dividing a plurality of files into a plurality of file sets when detecting that a deleting request of a third-party application for the plurality of files is an illegal deleting request, and the deleting request is a request of the third-party application in a preset operation executing process;
a transfer unit configured to perform a transfer operation for a file in a first file set of the plurality of file sets;
the parallel processing unit is used for executing deletion detection operation on files in an ith file set and simultaneously executing transfer operation on files in an (i + 1) th file set, wherein the deletion detection operation is used for detecting whether the files in the ith file set are deleted or not, the transfer operation is used for transferring the files in the (i + 1) th file set from an original storage space of an electronic device to a preset storage space, the plurality of file sets comprise the ith file set and the (i + 1) th file set, and i is a positive integer which is greater than or equal to 1 and less than or equal to the number of the file sets.
In a third aspect, an embodiment of the present application provides an electronic device, including a processor, a memory, a communication interface, and one or more programs, where the one or more programs are stored in the memory and configured to be executed by the processor, and the program includes instructions for executing steps in any method of the first aspect of the embodiment of the present application.
In a fourth aspect, the present application provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program for electronic data exchange, where the computer program makes a computer perform part or all of the steps described in any one of the methods of the first aspect of the present application.
In a fifth aspect, the present application provides a computer program product, wherein the computer program product includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to perform some or all of the steps as described in any one of the methods of the first aspect of the embodiments of the present application. The computer program product may be a software installation package.
It can be seen that in the file processing method provided in the embodiment of the present application, when detecting that a deletion request of a third party application for multiple files is an illegal deletion request, an electronic device divides the multiple files into multiple file sets, where the deletion request is a request in a process of executing a preset operation by the third party application, executes a transfer operation for a file in a first file set of the multiple file sets, then executes a deletion detection operation for a file in an ith file set, and at the same time, executes a transfer operation for a file in an (i + 1) th file set, where the deletion detection operation is used to detect whether the file in the ith file set is deleted or not, the transfer operation is used to transfer the file in the (i + 1) th file set from an original storage space of the electronic device to a preset storage space, and the multiple file sets include the (i + 1) th file set and an (i + 1) th file set, i is a positive integer greater than or equal to 1 and less than or equal to the number of file sets. Therefore, when detecting that the deletion request of the third-party application for the plurality of files is an illegal deletion request, the electronic device divides the files to be deleted into the plurality of file sets and processes deletion detection operation and transfer operation of the file sets in parallel, so that the real-time property of file processing is improved, data loss caused by mistakenly deleting the files by the third-party application is avoided, and user loss is reduced.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings without creative efforts.
FIG. 1A is a schematic diagram of a program runtime space of a smart phone;
FIG. 1B is a system architecture diagram of an android system;
FIG. 2 is a schematic flow chart diagram illustrating a document processing method disclosed in an embodiment of the present application;
FIG. 3 is a schematic flow chart diagram of another document processing method disclosed in an embodiment of the present application;
FIG. 4 is a schematic flow chart diagram of another document processing method disclosed in an embodiment of the present application;
FIG. 5 is a block diagram of the components of a document processing apparatus according to an embodiment of the present disclosure;
fig. 6 is a schematic structural diagram of an electronic device disclosed in an embodiment of the present application;
fig. 7 is a schematic structural diagram of another electronic device disclosed in the embodiment of the present application.
Detailed Description
In order to make the technical solutions of the present invention better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The terms "first," "second," and the like in the description and claims of the present invention and in the above-described drawings are used for distinguishing between different objects and not for describing a particular order. Furthermore, the terms "include" and "have," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements listed, but may alternatively include other steps or elements not listed, or inherent to such process, method, article, or apparatus.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the invention. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein can be combined with other embodiments.
In order to better understand a file processing method and device disclosed in the embodiments of the present application, the embodiments of the present application are described in detail below.
As shown in fig. 1A, currently, electronic devices such as smart phones are generally provided with a program running space, where the program running space includes a user space and an operating system space, where the user space runs one or more application programs, and the one or more application programs are third-party application programs installed in the electronic devices.
The electronic device can specifically run an Android system, a mobile operating system iOS developed by apple Inc., and the like, and the electronic device is not limited herein. As shown in fig. 1B, for example that the electronic device runs an Android system, the corresponding user space includes an Application layer (Applications) in the Android system, and the operating system space may include an Application Framework layer (Application Framework) in the Android system, a system Runtime library layer (including system Runtime Libraries and Android Runtime runtimes), and a Linux Kernel layer (Linux Kernel). The application layer comprises various application programs which are directly interacted with the user or service programs which are written by the I +1ava language and run in the background. For example, programs that implement common basic functions on smartphones, such as Short Messaging Service (SMS) notes, phone dialing, picture viewer, calendar, games, maps, World Wide Web (Web) browser, and other applications developed by developers. The application framework layer provides a series of class libraries required by Android application development, can be used for reusing components, and can also realize personalized extension through inheritance. And the system operation library layer is a support of an application program framework and provides services for each component in the Android system. The system operation library layer is composed of a system class library and Android operation. The Android runtime comprises two parts, namely a core library and a Dalvik virtual machine. The Linux kernel layer is used for realizing core functions such as hardware device driving, process and memory management, a network protocol stack, power management, wireless communication and the like.
Electronic devices may include various handheld devices, vehicle-mounted devices, wearable devices (e.g., smartwatches, smartbands, pedometers, etc.), computing devices or other processing devices connected to wireless modems, as well as various forms of User Equipment (UE), Mobile Stations (MS), terminal Equipment (terminal device), and so forth, having wireless communication capabilities. For convenience of description, the above-mentioned devices are collectively referred to as electronic devices. The following describes embodiments of the present application in detail.
Referring to fig. 2, fig. 2 is a schematic flowchart illustrating a file processing method according to an embodiment of the present disclosure. As shown in fig. 2, the file processing method in the embodiment of the present application includes the following operations:
201, when detecting that a deletion request of a third party application for a plurality of files is an illegal deletion request, dividing the plurality of files into a plurality of file sets by an electronic device, wherein the deletion request is a request of the third party application in a preset operation process.
The third-party application includes various application programs installed in the use process of the electronic device, such as an instant chat application, a video application, a graphical user interface application, and the like, which are not limited herein.
The preset storage space may be, for example, a recycle bin or other local storage space different from the original storage space, or a cloud storage space, and the like.
202, the electronic device performs a transfer operation for a file in a first set of files in the plurality of sets of files.
203, the electronic device performs a deletion detection operation on files in the ith file set, and simultaneously performs a transfer operation on files in the (i + 1) th file set, wherein the deletion detection operation is used for detecting whether the files in the ith file set are deleted, the transfer operation is used for transferring the files in the (i + 1) th file set from an original storage space of the electronic device to a preset storage space, the plurality of file sets comprise the ith file set and the (i + 1) th file set, and i is a positive integer which is greater than or equal to 1 and less than or equal to the number of the file sets.
It can be seen that in the file processing method provided in the embodiment of the present application, when detecting that a deletion request of a third party application for multiple files is an illegal deletion request, an electronic device divides the multiple files into multiple file sets, where the deletion request is a request in a process of executing a preset operation by the third party application, executes a transfer operation for a file in a first file set of the multiple file sets, then executes a deletion detection operation for a file in an ith file set, and at the same time, executes a transfer operation for a file in an (i + 1) th file set, where the deletion detection operation is used to detect whether the file in the ith file set is deleted or not, the transfer operation is used to transfer the file in the (i + 1) th file set from an original storage space of the electronic device to a preset storage space, and the multiple file sets include the (i + 1) th file set and an (i + 1) th file set, i is a positive integer greater than or equal to 1 and less than or equal to the number of file sets. Therefore, when detecting that the deletion request of the third-party application for the plurality of files is an illegal deletion request, the electronic device divides the files to be deleted into the plurality of file sets and processes deletion detection operation and transfer operation of the file sets in parallel, so that the real-time property of file processing is improved, data loss caused by mistakenly deleting the files by the third-party application is avoided, and user loss is reduced.
In one embodiment, the electronic device may further perform the following:
generating a deletion response message when detecting that a result of a deletion detection operation for a file in a kth file set is that a file in the kth file set is deleted, wherein the kth file set is a last file set of transfer operations performed by the third-party application for the plurality of file sets;
feeding back the deletion response message to the third-party application to prompt the third-party application to continue to perform subsequent operations.
The subsequent operations executed by the third-party application may be various, and specifically, depending on the function that the current third-party application is running, if the third-party application is executing version update, the version update process needs to execute multiple steps of operations, where deleting the target file is one of the multiple steps of operations, and the operation after deleting the target file is the subsequent operation.
The third-party application can receive the deletion response message in time so as to smoothly execute the subsequent operation, so that the execution flow of the third-party application side is smooth and errorless.
In the prior art, when the electronic device transfers a plurality of files to the preset storage space, all the files are transferred to the preset storage space first, then deletion detection operation is performed, and then a deletion response message is fed back to the third-party application. According to the method and the device, the plurality of files are divided into the plurality of file sets, deletion detection operation of the files in the ith file set and transfer operation of the files in the (i + 1) th file set are processed in parallel, the speed of the third-party application receiving the feedback deletion response message is improved, and then the recovery speed of the deleted files is improved.
Therefore, when the last file set completes the deletion detection operation and the result of the deletion detection operation is that the files in the file set are deleted, the response message is sent to the third-party application, so that the situation that the third-party application is damaged due to repeated sending of the deletion request message because the third-party application cannot acquire the response message in time is avoided, and the stability and the safety of the electronic equipment background processing of the file deletion request of the third-party application are improved.
In one embodiment, a specific implementation manner of the electronic device detecting that the deletion request of the third-party application for the plurality of files is an illegal deletion request may be:
detecting a deletion request of the third-party application for the plurality of files;
detecting whether a portion of the plurality of files is unassociated with the third party application;
if it is detected that a part of the files are not associated with the third-party application, the deletion request of the third-party application for the files is detected to be an illegal deletion request.
The files associated with the third party application may be various files generated, cached, etc. by the third party application during use, such files being generated as a result of installation or operation of the third party application. Taking the above-mentioned files as picture files as an example, the pictures associated with the third-party application may be various pictures cached by the third-party application program in the using process, and the like. The picture not associated with the third-party application may be multimedia data shot by the user or multimedia data downloaded from the internet, and the generation of the part of the picture is irrelevant to the third-party application, and the deletion of the part of the picture by the third-party application may cause the loss of the multimedia data in the electronic device, and affect the normal use of the electronic device.
Therefore, whether a deletion request of the third-party application for the files is an illegal deletion request is judged by judging whether part of the deleted files is not associated with the third-party application, and the third-party application is prevented from directly and permanently deleting the target picture by transferring the files to a preset storage space under the condition that the deletion request of the third-party application for the files is judged to be the illegal deletion request.
In one embodiment, a specific implementation manner of the electronic device detecting that the deletion request of the third-party application for the plurality of files is an illegal deletion request may be:
detecting a deletion request of the third-party application for the plurality of files;
detecting whether the third-party application has the authority to delete the files;
and if the third-party application is detected to have no permission to delete the target folder, determining that the deletion request of the third-party application for the plurality of files is an illegal deletion request.
In some other embodiments, the deletion permissions of the plurality of files may be manually set by a user, or the system of the electronic device may be intelligently set based on a preset policy, which is not limited herein, and the preset policy may be that the deletion permission is set for a duplicate file, no deletion permission is set for a non-duplicate file, the deletion permission is set for a file associated with a third-party application, no deletion permission is set for a file not associated with a third-party application, and the like.
And if the deletion requests of the third-party application for the files are judged to be illegal deletion requests, the files are transferred to a preset storage space, so that the third-party application is prevented from directly and permanently deleting the target picture.
In one embodiment, the electronic device may further perform the following:
when the recovery requests of the multiple files are detected, executing a transfer operation for the files in the ith file set, and simultaneously executing a file position scanning operation for the files in the (i + 1) th file set, wherein the file position scanning operation is used for acquiring the positions of the files in the (i + 1) th file set in the preset storage space so as to transfer the files in the (i + 1) th file set from the preset storage space to the original storage space.
Referring to fig. 3, fig. 3 is a schematic flowchart of another document processing method according to an embodiment of the present application, consistent with the embodiment shown in fig. 2. As shown in fig. 3, the file processing method in the embodiment of the present application includes the following operations:
301, detecting, by an electronic device, a deletion request of the third-party application for the plurality of files;
302, the electronic device detecting whether a part of the plurality of files is not associated with the third-party application;
303, if it is detected that a part of the files are not associated with the third-party application, in order to detect that a deletion request of the third-party application for the files is an illegal deletion request, dividing, by the electronic device, the files into a plurality of file sets, where the deletion request is a request of the third-party application in a preset operation process;
304, the electronic device performing a transfer operation for a file in a first one of the plurality of file collections;
305, the electronic device performs a deletion detection operation on files in an ith file set, and simultaneously performs a transfer operation on files in an (i + 1) th file set, wherein the deletion detection operation is used for detecting whether the files in the ith file set are deleted, the transfer operation is used for transferring the files in the (i + 1) th file set from an original storage space of the electronic device to a preset storage space, the plurality of file sets comprise the ith file set and the (i + 1) th file set, and i is a positive integer which is greater than or equal to 1 and less than or equal to the number of the file sets;
306, when detecting that the result of the deletion detection operation for the files in the kth set of files is that the files in the kth set of files are deleted, the electronic device generates a deletion response message, wherein the kth set of files is the last set of files for which the third-party application performs the transfer operation for the plurality of sets of files;
307, the electronic device feeds back the deletion response message to the third-party application to prompt the third-party application to continue to perform subsequent operations;
308, when the recovery requests of the multiple files are detected, the electronic device performs a transfer operation for the files in the ith file set, and simultaneously performs a file location scanning operation for the files in the (i + 1) th file set, where the file location scanning operation is used to obtain the locations of the files in the (i + 1) th file set in the preset storage space so as to transfer the files in the (i + 1) th file set from the preset storage space to the original storage space.
It can be seen that in the file processing method provided in the embodiment of the present application, when detecting that a deletion request of a third party application for multiple files is an illegal deletion request, an electronic device divides the multiple files into multiple file sets, where the deletion request is a request in a process of executing a preset operation by the third party application, executes a transfer operation for a file in a first file set of the multiple file sets, then executes a deletion detection operation for a file in an ith file set, and at the same time, executes a transfer operation for a file in an (i + 1) th file set, where the deletion detection operation is used to detect whether the file in the ith file set is deleted or not, the transfer operation is used to transfer the file in the (i + 1) th file set from an original storage space of the electronic device to a preset storage space, and the multiple file sets include the (i + 1) th file set and an (i + 1) th file set, i is a positive integer greater than or equal to 1 and less than or equal to the number of file sets. Therefore, when detecting that the deletion request of the third-party application for the plurality of files is an illegal deletion request, the electronic device divides the files to be deleted into the plurality of file sets and processes deletion detection operation and transfer operation of the file sets in parallel, so that the real-time property of file processing is improved, data loss caused by mistakenly deleting the files by the third-party application is avoided, and user loss is reduced.
Referring to fig. 4, fig. 4 is a schematic flowchart of another document processing method according to an embodiment of the present application, consistent with the embodiment shown in fig. 2 or fig. 3. As shown in fig. 4, the file processing method in the embodiment of the present application includes the following operations:
401, detecting, by an electronic device, a deletion request of the third-party application for the plurality of files;
402, the electronic device detects whether the third-party application has the authority to delete the plurality of files;
403, if it is detected that the third-party application has no permission to delete the target folder, in order to detect that the deletion request of the third-party application for the plurality of files is an illegal deletion request, the electronic device divides the plurality of files into a plurality of file sets, and the deletion request is a request of the third-party application in a preset operation process;
404, the electronic device performs a transfer operation for a file in a first file set of the plurality of file sets;
405, the electronic device performs a deletion detection operation on files in an ith file set, and simultaneously performs a transfer operation on files in an (i + 1) th file set, wherein the deletion detection operation is used for detecting whether the files in the ith file set are deleted, the transfer operation is used for transferring the files in the (i + 1) th file set from an original storage space of the electronic device to a preset storage space, the plurality of file sets comprise the ith file set and the (i + 1) th file set, and i is a positive integer greater than or equal to 1 and less than or equal to the number of the file sets;
406, when it is detected that a result of the deletion detection operation for the file in the kth set of files is that the file in the kth set of files is deleted, the electronic device generates a deletion response message, wherein the kth set of files is a last set of files for which the third-party application performs the transfer operation for the plurality of sets of files;
407, the electronic device feeds back the deletion response message to the third-party application to prompt the third-party application to continue to perform subsequent operations;
408, when the restoration requests of the multiple files are detected, the electronic device performs a transfer operation for the files in the ith file set, and simultaneously performs a file location scanning operation for the files in the (i + 1) th file set, where the file location scanning operation is used to obtain the locations of the files in the (i + 1) th file set in the preset storage space so as to transfer the files in the (i + 1) th file set from the preset storage space to the original storage space.
It can be seen that in the file processing method provided in the embodiment of the present application, when detecting that a deletion request of a third party application for multiple files is an illegal deletion request, an electronic device divides the multiple files into multiple file sets, where the deletion request is a request in a process of executing a preset operation by the third party application, executes a transfer operation for a file in a first file set of the multiple file sets, then executes a deletion detection operation for a file in an ith file set, and at the same time, executes a transfer operation for a file in an (i + 1) th file set, where the deletion detection operation is used to detect whether the file in the ith file set is deleted or not, the transfer operation is used to transfer the file in the (i + 1) th file set from an original storage space of the electronic device to a preset storage space, and the multiple file sets include the (i + 1) th file set and an (i + 1) th file set, i is a positive integer greater than or equal to 1 and less than or equal to the number of file sets. Therefore, when detecting that the deletion request of the third-party application for the plurality of files is an illegal deletion request, the electronic device divides the files to be deleted into the plurality of file sets and processes deletion detection operation and transfer operation of the file sets in parallel, so that the real-time property of file processing is improved, data loss caused by mistakenly deleting the files by the third-party application is avoided, and user loss is reduced.
The above description has introduced the solution of the embodiment of the present application mainly from the perspective of the method-side implementation process. It is understood that the electronic device comprises corresponding hardware structures and/or software modules for performing the respective functions in order to realize the above-mentioned functions. Those of skill in the art will readily appreciate that the present application is capable of hardware or a combination of hardware and computer software implementing the various illustrative elements and algorithm steps described in connection with the embodiments provided herein. Whether a function is performed as hardware or computer software drives hardware depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiment of the present application, the electronic device may be divided into the functional units according to the method example, for example, each functional unit may be divided corresponding to each function, or two or more functions may be integrated into one processing unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit. It should be noted that the division of the unit in the embodiment of the present application is schematic, and is only a logic function division, and there may be another division manner in actual implementation.
The following is an embodiment of the apparatus of the present invention, which is used to perform the method implemented by the embodiment of the method of the present invention. Referring to fig. 5, fig. 5 is a block diagram of a unit composition of a document processing apparatus disclosed in an embodiment of the present application, and as shown in fig. 5, the document processing apparatus may include a dividing unit 501, a transferring unit 502, and a parallel processing unit 503, where:
the dividing unit 501 is configured to, when detecting that a deletion request of a third-party application for multiple files is an illegal deletion request, divide the multiple files into multiple file sets, where the deletion request is a request of the third-party application in a process of executing a preset operation;
a transfer unit 502 configured to perform a transfer operation for a file in a first file set of the plurality of file sets;
a parallel processing unit 503, configured to perform a deletion detection operation on files in an ith file set, and at the same time, perform a transfer operation on files in an (i + 1) th file set, where the deletion detection operation is used to detect whether files in the ith file set are deleted, the transfer operation is used to transfer files in the (i + 1) th file set from an original storage space of an electronic device to a preset storage space, where the plurality of file sets include the (i) th file set and the (i + 1) th file set, and i is a positive integer greater than or equal to 1 and less than or equal to the number of file sets.
It can be seen that, in the file processing apparatus provided in this embodiment of the present application, when it is detected that a deletion request of a third party application for multiple files is an illegal deletion request, the multiple files are divided into multiple file sets, the deletion request is a request in a process of executing a preset operation by the third party application, a transfer operation for a file in a first file set of the multiple file sets is executed, then a deletion detection operation for a file in an ith file set is executed, and at the same time, a transfer operation for a file in an (i + 1) th file set is executed, the deletion detection operation is used to detect whether a file in the ith file set is deleted, the transfer operation is used to transfer a file in the (i + 1) th file set from an original storage space of an electronic device to a preset storage space, the multiple file sets include the ith file set and the (i + 1) th file set, i is a positive integer greater than or equal to 1 and less than or equal to the number of file sets. Therefore, when detecting that the deletion request of the third-party application for the plurality of files is an illegal deletion request, the electronic device divides the files to be deleted into the plurality of file sets and processes deletion detection operation and transfer operation of the file sets in parallel, so that the real-time property of file processing is improved, data loss caused by mistakenly deleting the files by the third-party application is avoided, and user loss is reduced.
In one embodiment, the document processing apparatus further includes:
a generating unit 504, configured to generate a deletion response message when detecting that a result of the deletion detection operation for a file in a kth set of files is that a file in the kth set of files is deleted, where the kth set of files is a last set of files for which the third-party application performs a transfer operation for the plurality of sets of files;
a sending unit 505, configured to feed back the deletion response message to the third-party application to prompt the third-party application to continue to perform subsequent operations.
In one embodiment, when detecting that the deletion request of the third-party application for the plurality of files is an illegal deletion request, the method includes:
detecting a deletion request of the third-party application for the plurality of files;
detecting whether a portion of the plurality of files is unassociated with the third party application;
if it is detected that a part of the files are not associated with the third-party application, the deletion request of the third-party application for the files is detected to be an illegal deletion request.
In one embodiment, when detecting that the deletion request of the third-party application for the plurality of files is an illegal deletion request, the method includes:
detecting a deletion request of the third-party application for the plurality of files;
detecting whether the third-party application has the authority to delete the files;
and if the third-party application is detected to have no permission to delete the target folder, determining that the deletion request of the third-party application for the plurality of files is an illegal deletion request.
In one embodiment, the document processing apparatus further includes:
a restoring unit 506, configured to, when a restoring request of the multiple files is detected, perform a transfer operation for the files in the ith file set, and at the same time, perform a file location scanning operation for the files in the (i + 1) th file set, where the file location scanning operation is used to obtain locations of the files in the (i + 1) th file set in the preset storage space so as to transfer the files in the (i + 1) th file set from the preset storage space to the original storage space.
Specifically, the specific implementation of each unit may refer to the description of the relevant steps in the embodiments corresponding to fig. 2 to fig. 4, which is not described herein again.
It should be noted that the document processing apparatus described in the embodiment of the present invention is presented in the form of a functional unit. The term "unit" as used herein is to be understood in its broadest possible sense, and objects used to implement the functions described by the respective "unit" may be, for example, an integrated circuit ASIC, a single circuit, a processor (shared, dedicated, or chipset) and memory that execute one or more software or firmware programs, a combinational logic circuit, and/or other suitable components that provide the described functionality.
For example, the dividing unit 501 may be implemented by the electronic device shown in fig. 6 when detecting that the deletion request of the third party application for the plurality of files is an illegal deletion request, and specifically, the processor 601 may divide the plurality of files into a plurality of file sets by calling the executable program code in the memory 602 when detecting that the deletion request of the third party application for the plurality of files is an illegal deletion request.
Referring to fig. 6, fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure. The electronic device comprises a processor 601, a memory 602, a communication interface 603 and one or more programs, wherein the one or more programs are stored in the memory 602 and configured to be executed by the processor 801, the programs comprising instructions for performing the steps of:
when detecting that a deletion request of a third-party application for a plurality of files is an illegal deletion request, dividing the plurality of files into a plurality of file sets, wherein the deletion request is a request of the third-party application in a preset operation process;
performing a transfer operation for a file in a first one of the plurality of file sets;
executing deletion detection operation aiming at files in an ith file set, and simultaneously executing transfer operation aiming at files in an (i + 1) th file set, wherein the deletion detection operation is used for detecting whether the files in the ith file set are deleted, the transfer operation is used for transferring the files in the (i + 1) th file set from an original storage space of an electronic device to a preset storage space, the plurality of file sets comprise the ith file set and the (i + 1) th file set, and i is a positive integer which is greater than or equal to 1 and less than or equal to the number of the file sets.
It can be seen that in the file processing method provided in the embodiment of the present application, when detecting that a deletion request of a third party application for multiple files is an illegal deletion request, an electronic device divides the multiple files into multiple file sets, where the deletion request is a request in a process of executing a preset operation by the third party application, executes a transfer operation for a file in a first file set of the multiple file sets, then executes a deletion detection operation for a file in an ith file set, and at the same time, executes a transfer operation for a file in an (i + 1) th file set, where the deletion detection operation is used to detect whether the file in the ith file set is deleted or not, the transfer operation is used to transfer the file in the (i + 1) th file set from an original storage space of the electronic device to a preset storage space, and the multiple file sets include the (i + 1) th file set and an (i + 1) th file set, i is a positive integer greater than or equal to 1 and less than or equal to the number of file sets. Therefore, when detecting that the deletion request of the third-party application for the plurality of files is an illegal deletion request, the electronic device divides the files to be deleted into the plurality of file sets and processes deletion detection operation and transfer operation of the file sets in parallel, so that the real-time property of file processing is improved, data loss caused by mistakenly deleting the files by the third-party application is avoided, and user loss is reduced.
In one embodiment, the program further comprises instructions for:
generating a deletion response message when detecting that a result of a deletion detection operation for a file in a kth file set is that a file in the kth file set is deleted, wherein the kth file set is a last file set of transfer operations performed by the third-party application for the plurality of file sets;
feeding back the deletion response message to the third-party application to prompt the third-party application to continue to perform subsequent operations.
In one embodiment, the detecting that the deletion request of the third-party application for the plurality of files is an illegal deletion request includes:
detecting a deletion request of the third-party application for the plurality of files;
detecting whether a portion of the plurality of files is unassociated with the third party application;
if it is detected that a part of the files are not associated with the third-party application, the deletion request of the third-party application for the files is detected to be an illegal deletion request.
In one embodiment, the detecting that the deletion request of the third-party application for the plurality of files is an illegal deletion request includes:
detecting a deletion request of the third-party application for the plurality of files;
detecting whether the third-party application has the authority to delete the files;
and if the third-party application is detected to have no permission to delete the target folder, determining that the deletion request of the third-party application for the plurality of files is an illegal deletion request.
In one embodiment, the program further comprises instructions for:
when the recovery requests of the multiple files are detected, executing a transfer operation for the files in the ith file set, and simultaneously executing a file position scanning operation for the files in the (i + 1) th file set, wherein the file position scanning operation is used for acquiring the positions of the files in the (i + 1) th file set in the preset storage space so as to transfer the files in the (i + 1) th file set from the preset storage space to the original storage space.
The communication interface 603 includes, but is not limited to, an antenna, an amplifier, a transceiver, a coupler, an LNA (Low noise amplifier), a duplexer, and the like. The memory 602 includes at least one of: random access memory, non-volatile memory, and external memory.
Specifically, the specific implementation of each unit may refer to the description of the relevant steps in the embodiments corresponding to fig. 2 to fig. 4, which is not described herein again.
Referring to fig. 7, fig. 7 is a schematic structural diagram of an electronic device according to the present application, where the electronic device 700 includes: housing 710, circuit board 720, battery 730, cover 740, drop sensor 750, transceiver 760, display screen 770, and controller 780 that controls drop sensor 750, transceiver 760, and display screen 770; a cover 740 is provided on the housing 710, a fall sensor 750, a transceiver 760 and a controller 780 are provided on the circuit board 720, and a display 770 is connected to the controller 780, wherein the fall sensor 750 includes an acceleration sensor, a gyroscope, a timer, and the like.
The method comprises the steps that when detecting that a deletion request of a third-party application for multiple files is an illegal deletion request, the electronic equipment divides the multiple files into multiple file sets, wherein the deletion request is a request of the third-party application in a preset operation process; performing a transfer operation for a file in a first one of the plurality of file sets; executing deletion detection operation aiming at files in an ith file set, and simultaneously executing transfer operation aiming at files in an (i + 1) th file set, wherein the deletion detection operation is used for detecting whether the files in the ith file set are deleted, the transfer operation is used for transferring the files in the (i + 1) th file set from an original storage space of an electronic device to a preset storage space, the plurality of file sets comprise the ith file set and the (i + 1) th file set, and i is a positive integer which is greater than or equal to 1 and less than or equal to the number of the file sets.
The display screen 770 includes a touch screen and a display screen, and the display screen includes an organic light emitting diode display screen OLED.
The controller 780 may include a processor and a memory, wherein the processor is a control center of the electronic device, connects various parts of the whole electronic device by using various interfaces and lines, and performs various functions of the electronic device and processes data by running or executing software programs and/or modules stored in the memory and calling data stored in the memory, thereby performing overall monitoring of the electronic device. Optionally, the processor may integrate an application processor and a modem processor, wherein the application processor mainly handles operating systems, user interfaces, application programs, and the like, and the modem processor mainly handles wireless communications. It will be appreciated that the modem processor may not be integrated into the processor.
The memory may be used for storing software programs and modules, and the processor executes various functional applications and data processing of the electronic device by operating the software programs and modules stored in the memory. The memory may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function, and the like; the storage data area may store data created according to use of the electronic device, and the like. Further, the memory may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
Embodiments of the present application also provide a computer program product comprising a non-transitory computer-readable storage medium storing a computer program operable to cause a computer to perform some or all of the steps of any of the file processing methods as set forth in the above method embodiments.
The embodiment of the present application further provides a computer storage medium, where the computer storage medium may store a program, and the program includes some or all of the steps of any one of the file processing methods described in the above method embodiments when executed.
It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the order of acts, as some steps may occur in other orders or concurrently in accordance with the invention. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required by the invention.
In the foregoing embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus may be implemented in other manners. For example, the above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one type of division of logical functions, and there may be other divisions when actually implementing, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not implemented. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of some interfaces, devices or units, and may be an electric or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable memory. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a memory and includes several instructions for causing a computer device (which may be a personal computer, a server, a network device, or the like) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned memory comprises: various media capable of storing program codes, such as a usb disk, a read-only memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and the like.
Those skilled in the art will appreciate that all or part of the steps in the methods of the above embodiments may be implemented by associated hardware instructed by a program, which may be stored in a computer-readable memory, which may include: flash disks, read-only memories (ROMs), Random Access Memories (RAMs), magnetic or optical disks, and the like.
The foregoing embodiments of the present invention have been described in detail, and the principles and embodiments of the present invention are explained herein by using specific examples, which are only used to help understand the method and the core idea of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (10)

1. A file processing method, comprising:
when detecting that a deletion request of a third-party application for a plurality of files is an illegal deletion request, dividing the plurality of files into a plurality of file sets, wherein the deletion request is a request of the third-party application in a preset operation process; the third-party application comprises various application programs installed in the using process of the electronic equipment;
performing a transfer operation for a file in a first one of the plurality of file sets;
executing deletion detection operation for files in an ith file set, and simultaneously executing transfer operation for files in an (i + 1) th file set, wherein the deletion detection operation is used for detecting whether the files in the ith file set are deleted, the transfer operation is used for transferring the files in the (i + 1) th file set from an original storage space of an electronic device to a preset storage space, the plurality of file sets comprise the ith file set and the (i + 1) th file set, and i is a positive integer which is greater than or equal to 1 and less than or equal to the number of the file sets;
generating a deletion response message when detecting that a result of a deletion detection operation for a file in a kth file set is that a file in the kth file set is deleted, wherein the kth file set is a last file set of transfer operations performed by the third-party application for the plurality of file sets;
feeding back the deletion response message to the third-party application to prompt the third-party application to continue to perform subsequent operations.
2. The method of claim 1, wherein the detecting that the deletion request of the third-party application for the plurality of files is an illegal deletion request comprises:
detecting a deletion request of the third-party application for the plurality of files;
detecting whether a portion of the plurality of files is unassociated with the third party application;
if it is detected that a part of the files are not associated with the third-party application, the deletion request of the third-party application for the files is detected to be an illegal deletion request.
3. The method of claim 1, wherein the detecting that the deletion request of the third-party application for the plurality of files is an illegal deletion request comprises:
detecting a deletion request of the third-party application for the plurality of files;
detecting whether the third-party application has the authority to delete the files;
and if the third-party application is detected to have no permission to delete the files, determining that the deletion request of the third-party application for the files is an illegal deletion request.
4. The method of any one of claims 1 to 3, further comprising:
when the recovery requests of the multiple files are detected, executing a transfer operation for the files in the ith file set, and simultaneously executing a file position scanning operation for the files in the (i + 1) th file set, wherein the file position scanning operation is used for acquiring the positions of the files in the (i + 1) th file set in the preset storage space so as to transfer the files in the (i + 1) th file set from the preset storage space to the original storage space.
5. A document processing apparatus, characterized by comprising:
the device comprises a dividing unit, a processing unit and a processing unit, wherein the dividing unit is used for dividing a plurality of files into a plurality of file sets when detecting that a deleting request of a third-party application for the plurality of files is an illegal deleting request, and the deleting request is a request of the third-party application in a preset operation executing process; the third-party application comprises various application programs installed in the using process of the electronic equipment;
a transfer unit configured to perform a transfer operation for a file in a first file set of the plurality of file sets;
the parallel processing unit is used for executing deletion detection operation on files in an ith file set and simultaneously executing transfer operation on files in an (i + 1) th file set, wherein the deletion detection operation is used for detecting whether the files in the ith file set are deleted or not, the transfer operation is used for transferring the files in the (i + 1) th file set from an original storage space of an electronic device to a preset storage space, the plurality of file sets comprise the ith file set and the (i + 1) th file set, and i is a positive integer which is greater than or equal to 1 and less than or equal to the number of the file sets;
a generating unit, configured to generate a deletion response message when detecting that a result of a deletion detection operation for a file in a kth file set is that a file in the kth file set is deleted, where the kth file set is a last file set of the third-party application performing a transfer operation for the multiple file sets;
and the sending unit is used for feeding back the deletion response message to the third-party application so as to prompt the third-party application to continue to execute subsequent operations.
6. The apparatus of claim 5, wherein the detecting that the deletion request of the third-party application for the plurality of files is an illegal deletion request comprises:
detecting a deletion request of the third-party application for the plurality of files;
detecting whether a portion of the plurality of files is unassociated with the third party application;
if it is detected that a part of the files are not associated with the third-party application, the deletion request of the third-party application for the files is detected to be an illegal deletion request.
7. The apparatus of claim 5, wherein the detecting that the deletion request of the third-party application for the plurality of files is an illegal deletion request comprises:
detecting a deletion request of the third-party application for the plurality of files;
detecting whether the third-party application has the authority to delete the files;
and if the third-party application is detected to have no permission to delete the files, determining that the deletion request of the third-party application for the files is an illegal deletion request.
8. The apparatus of any one of claims 5 to 7, further comprising:
a restoring unit, configured to, when a restoring request of the multiple files is detected, perform a transfer operation for a file in the ith file set, and at the same time, perform a file location scanning operation for a file in the (i + 1) th file set, where the file location scanning operation is used to obtain a location of the file in the (i + 1) th file set in the preset storage space so as to transfer the file in the (i + 1) th file set from the preset storage space to the original storage space.
9. An electronic device comprising a processor, a memory, a communication interface, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the processor, the programs comprising instructions for performing the steps of the method of any of claims 1-4.
10. A computer-readable storage medium, characterized in that it stores a computer program for electronic data exchange, wherein the computer program causes a computer to perform the method according to any one of claims 1 to 4.
CN201810579593.XA 2018-06-05 2018-06-05 File processing method and device Active CN108897639B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810579593.XA CN108897639B (en) 2018-06-05 2018-06-05 File processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810579593.XA CN108897639B (en) 2018-06-05 2018-06-05 File processing method and device

Publications (2)

Publication Number Publication Date
CN108897639A CN108897639A (en) 2018-11-27
CN108897639B true CN108897639B (en) 2020-08-25

Family

ID=64344104

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810579593.XA Active CN108897639B (en) 2018-06-05 2018-06-05 File processing method and device

Country Status (1)

Country Link
CN (1) CN108897639B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111563064B (en) * 2020-04-28 2023-03-14 上海鸿翼软件技术股份有限公司 File operation method, system, device and readable storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105653582A (en) * 2015-12-21 2016-06-08 联想(北京)有限公司 File management method of electronic equipment and electronic equipment
CN105930436A (en) * 2016-04-19 2016-09-07 乐视控股(北京)有限公司 File recovery method and device for mobile terminal equipment
CN106506820A (en) * 2016-10-25 2017-03-15 广东欧珀移动通信有限公司 A kind of backup method of mobile terminal data and device
CN106570086A (en) * 2016-10-19 2017-04-19 上海携程商务有限公司 Data migration system and method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105653582A (en) * 2015-12-21 2016-06-08 联想(北京)有限公司 File management method of electronic equipment and electronic equipment
CN105930436A (en) * 2016-04-19 2016-09-07 乐视控股(北京)有限公司 File recovery method and device for mobile terminal equipment
CN106570086A (en) * 2016-10-19 2017-04-19 上海携程商务有限公司 Data migration system and method
CN106506820A (en) * 2016-10-25 2017-03-15 广东欧珀移动通信有限公司 A kind of backup method of mobile terminal data and device

Also Published As

Publication number Publication date
CN108897639A (en) 2018-11-27

Similar Documents

Publication Publication Date Title
US9792623B2 (en) Advertisement processing method and apparatus
US9100426B1 (en) Systems and methods for warning mobile device users about potentially malicious near field communication tags
US20160212209A1 (en) Method and apparatus for sharing application data
EP3032418A1 (en) Permission control method and device
CN108733797B (en) File processing method and related device
US20170168805A1 (en) Method and electronic device for system updating
US9747449B2 (en) Method and device for preventing application in an operating system from being uninstalled
EP2825956B1 (en) Method, apparatus and system of recovering an operating system on a portable communication device
US9268939B2 (en) Method and apparatus for determining virus-infected files
CN106681749B (en) Local code patch updating method and device based on android platform
US11063962B2 (en) Malicious URL detection method and apparatus, terminal, and computer storage medium
CN108090345B (en) Linux system external command execution method and device
CN110765394A (en) So file loading method and device, storage medium and terminal equipment
CN108984339B (en) Data recovery method and related product
CN108762983B (en) Multimedia data recovery method and device
CN108737655B (en) Picture processing method and related device
CN104573497A (en) Processing method and device for starting items
CN111373728B (en) Control method and device for camera application
CN102968321A (en) Application program installation device and application program installation method
CN108897639B (en) File processing method and device
CN112804160B (en) Application program-based current limiting method, device, equipment, medium and product
CN108763357B (en) File processing method and related device
CN108959955B (en) File processing method and device
CN108804258B (en) Data recovery method and device, mobile terminal and storage medium
CN115878138A (en) Application pre-downloading method and device, computer and storage medium

Legal Events

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