CN108874591B - Document processing method and related product - Google Patents

Document processing method and related product Download PDF

Info

Publication number
CN108874591B
CN108874591B CN201810628050.2A CN201810628050A CN108874591B CN 108874591 B CN108874591 B CN 108874591B CN 201810628050 A CN201810628050 A CN 201810628050A CN 108874591 B CN108874591 B CN 108874591B
Authority
CN
China
Prior art keywords
deletion
file
party application
files
target folder
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
CN201810628050.2A
Other languages
Chinese (zh)
Other versions
CN108874591A (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 CN201810628050.2A priority Critical patent/CN108874591B/en
Publication of CN108874591A publication Critical patent/CN108874591A/en
Application granted granted Critical
Publication of CN108874591B publication Critical patent/CN108874591B/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/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)

Abstract

The application provides a file processing method and a related product, wherein the method is applied to an electronic device and comprises the following steps: receiving a deletion request of a target folder, and creating a temporary file in the target folder, wherein the temporary file is deleted when the deletion request is a deletion request of a third-party application; and executing the deletion request, and if the deletion of the temporary file is detected, executing a protection operation, wherein the protection operation is used for reserving the residual files in the target folder when the deletion request is executed. The method and the device are beneficial to solving the problem that the target file is deleted by a third party by mistake, and protect the user data.

Description

Document processing method and related product
Technical Field
The present application relates to the field of electronic technologies, and in particular, to a file processing method and a related product.
Background
With the rapid development of the technology of electronic devices (such as smart phones, etc.), the electronic devices are becoming more and more popular, the functions of the electronic devices are becoming more and more complete, and various third-party applications bring great convenience to users, and the electronic devices become indispensable electronic products in daily life of the users. However, when part of the third-party software is installed or uninstalled, part of the third-party software deletes application-related files such as a system album by mistake, so that user data is lost and user experience is affected.
Disclosure of Invention
The embodiment of the application provides a file processing method and a related product, and solves the problem that a third-party application deletes user data by mistake.
In a first aspect, an embodiment of the present application provides a file processing method, where the method is applied to an electronic device, and the method includes:
receiving a deletion request of a target folder, and creating a temporary file in the target folder, wherein the temporary file is deleted only when the deletion request is a deletion request of a third-party application, and the temporary file is deleted firstly when the third-party application requests to delete the target folder;
and executing the deletion request, and if the temporary file is deleted, protecting the residual files in the target folder from being permanently deleted.
In a second aspect, an embodiment of the present application provides an electronic device for processing a document, the electronic device including:
a receiving unit configured to receive a deletion request of a target folder;
a creating unit, configured to create a temporary file in the target folder, where the temporary file is deleted only when the deletion request is a deletion request of a third-party application, and the temporary file is deleted first when the third-party application requests to delete the target folder;
and the execution unit is used for executing the deletion request, protecting the residual files in the target folder from being permanently deleted if the temporary files are deleted, and protecting the residual files in the target folder from being permanently deleted.
In a third aspect, embodiments provide a terminal comprising one or more processors, one or more memories, one or more transceivers, and one or more programs stored in the memories and configured to be executed by the one or more processors, the programs including instructions for performing the steps in the method according to the first aspect.
In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium storing a computer program for electronic data exchange, wherein the computer program causes a computer to execute the method according to the first aspect.
In a fifth aspect, embodiments of the present application provide a computer program product comprising a non-transitory computer-readable storage medium storing a computer program, the computer being operable to cause a computer to perform the method according to the first aspect.
The embodiment of the application has the following beneficial effects:
it can be seen that, in the embodiment of the present application, when a deletion request of a target folder is received, a temporary file of the target folder is first created, when creating the temporary file ensures that the temporary file can only be deleted by the third party application, and is deleted first when the third party application deletes the target folder, so when responding to the deletion request after creating the temporary file, if the temporary file is deleted, determining that the deletion request is a deletion request of a third-party application, protecting the remaining files in the target folder from permanent deletion, protecting the remaining files in the target folder from permanent deletion after the temporary file is deleted, therefore, the problem that the residual files of the target folder are deleted by mistake by a third-party application to cause permanent loss of user data is solved, the protection operation is executed under the condition that a user does not sense the user, and the user experience is improved.
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 some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1A is a schematic flowchart of a document processing method according to an embodiment of the present application;
fig. 1B is a schematic diagram illustrating a prompt for prompting to close an access right according to an embodiment of the present application;
FIG. 2 is a schematic flow chart diagram of another document processing method provided in the embodiments of the present application;
FIG. 3 is a schematic flow chart diagram illustrating another document processing method according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of an electronic device disclosed in an embodiment of the present application;
FIG. 5 is a block diagram illustrating functional units of an electronic device according to an embodiment of the present disclosure;
fig. 6 is a schematic structural diagram of a smart phone disclosed in an embodiment of the present application.
Detailed Description
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 some, but not all, embodiments of the present application. 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 application.
The terms "first," "second," "third," and "fourth," etc. in the description and claims of this application and in the accompanying 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, result, or characteristic described in connection with the embodiment can be included in at least one embodiment of the application. 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.
The electronic device according to the embodiment of the present application may include various handheld devices, vehicle-mounted devices, wearable devices, computing devices or other processing devices connected to a wireless modem, and various forms of User Equipment (UE), Mobile Stations (MS), terminal devices (terminal device), and so on. For convenience of description, the above-mentioned apparatuses are collectively referred to as electronic devices. The operating system related to the embodiment of the invention is a software system which performs unified management on hardware resources and provides a service interface for a user.
Referring to fig. 1A first, in fig. 1A, a file processing method provided by an embodiment of the present application is applied to an electronic device, and the method includes:
and step S101, receiving a deletion request of the target folder.
The target folder may be a folder under the gallery directory, where the directory name corresponding to the target folder may be: cameras (Camera), Screenshots (Screenshots), WeChat, QQ and the like, and the files in the target folder can be various files such as pictures, texts, audios and videos.
The deletion request of the third-party application is specifically a deletion request for deleting the target folder caused by a system error when the third-party application is installed, uninstalled or cleared of the data cache of the third application, the electronic device may be in a screen-off state when the deletion request is generated, and the deletion request may be generated when the third-party application runs in the background and performs related operations.
And step S102, creating a temporary file in the target folder, and deleting the temporary file when the deletion request is a deletion request of a third-party application.
Optionally, the creating a temporary file in the target folder specifically includes the following steps: after receiving the deletion request, acquiring a deletion sequence of the target folder, namely a deletion sequence of files in the target folder, wherein the deletion sequence is generally a deletion sequence according to file names, a deletion sequence according to file creation time, a deletion sequence according to a file memory or a deletion sequence according to the use heat of the files; the file attributes of the files in the target folder and the deletion sequence, such as the folders in the gallery, are obtained, and the files in the gallery folder are generally deleted according to the sequence of the creation time, that is, when any one folder in the gallery is deleted, the file with the earliest creation time in the folder is deleted firstly, and then all the files in the folder are deleted in sequence according to the sequence of the creation time. Therefore, the creation time of each file in the target folder is obtained, the temporary file is created according to the creation time of each file, namely, the creation time of the temporary file is set to be the earliest, the temporary file is ensured to be positioned at the first position in a deletion list corresponding to the deletion sequence, namely, the temporary file is deleted firstly when the target folder is deleted by a third-party application.
Step S103, executing the deletion request, and if it is detected that the temporary file is deleted, executing a protection operation, where the protection operation is used to retain the remaining files in the target folder when the deletion request is executed.
Optionally, the protection operation may be preset, and is specifically configured to protect remaining files in the target folder from being permanently deleted when the third-party application deletes the target folder.
Further, executing the protection operation specifically includes the following steps: after the temporary file is deleted, the deletion request for the remaining file in the deletion request is ignored, that is, the remaining file is not deleted, and since the deletion request is a deletion request of a third-party application, subsequent operations of the third-party application cannot be executed. The reason is that a multi-step operation is required to execute the current function of the third application, wherein the target folder is deleted as one step in the multi-step operation, and the next operation must be executed based on the completion response of the previous operation, so that when the deletion request for the remaining files in the deletion request is ignored, the operation of deleting the target folder is not completed, and the subsequent operation of the third application cannot be executed.
The subsequent operation of the third-party application may be various, and specifically relates to a function that the third-party application is currently running, if the third-party application is executing version update, the version update process needs to execute multi-step operations, where deleting the target folder is one step of the multi-step operations, and the operation after deleting the target folder is the subsequent operation.
Further, after the deletion request for the remaining files in the deletion request is ignored, the access right of the third-party application to the target folder is closed to obtain a closing response, and the closing response is fed back to the third-party application so as to execute the subsequent operation of the third-party application. Certainly, the access permission of the third-party application to the target folder may be actively closed by the user, that is, after the deletion request is ignored, since the third party has not received the deletion response all the time, the third-party application cannot perform subsequent operations, and the user needs to be prompted to close the access permission of the third-party application to the target folder.
For example, as shown in fig. 1B, if a delete request for deleting an album is generated when a microblog is unloaded, since the delete request for deleting the album is ignored, execution of the delete album operation in the unloading function fails, which results in failure of unloading the microblog, a prompt box pops up after the unload failure, sends out prompt information, prompts a user to unload the microblog again after closing the access right of the microblog to the album, and can unload the microblog, where the prompt information is specifically "unload failure, please close the access right of the microblog to the album before unloading the microblog".
It can be seen that, in the embodiment of the present application, after receiving a deletion request of a target folder, a temporary file of the target folder is created, a file attribute of the temporary file is modified to be only deleted by a third-party application and not visible to a user, if the temporary file is deleted, the deletion request is determined to be a deletion request of the third-party application, the deletion request for the remaining files in the target folder is ignored, and the access right of the third-party application to the target folder is closed, so as to complete subsequent operations of the third-party application, thereby solving the problem of mistakenly deleting the target folder when executing the current function of the third-party application, protecting user data, and improving user experience.
Referring to fig. 2, fig. 2 is a diagram of another file processing method provided in an embodiment of the present application, where the method is applied to an electronic device, and the method includes the following steps:
step S201, a deletion request of the target folder is received.
Step S202, a temporary file is created in the target folder, and the temporary file is deleted when the deletion request is a deletion request of a third-party application.
Step S203, executing the deletion request, copying the remaining files in the target folder to a preset storage space if the deletion of the temporary file is detected, continuing to respond to the deletion request for the remaining files in the deletion request after the copying is completed, and deleting the remaining files according to the deletion sequence to obtain a first deletion response.
The preset storage space may be a preset storage space dedicated to caching data, and specifically, the preset storage space may be a hidden recycle bin configured to receive a file transferred from the target folder.
Optionally, copying the remaining files in the target folder to a preset storage space includes: after the temporary file is deleted, if the residual file is not completely copied to the preset storage space, the copying operation is suspended, the first temporary file is re-created, and when the deletion of the first temporary file is executed, the residual file is continuously copied until the residual file is copied to the preset storage space or the total memory and the copying speed of the residual file are acquired; determining the copying duration of the residual files according to the total memory and the copying speed; acquiring a deleting time length required for deleting a temporary file; and determining a first number of the needed temporary files according to the deleting duration and the copying duration, and creating the temporary files of the first number in the target folder, so that after the temporary files of the first number are deleted, all the residual files are copied to the preset storage space.
Step S204, feeding back the first deletion response to the third-party application so as to continue to execute subsequent operations of the third-party application, and restoring the remaining files from the preset storage space after detecting that the subsequent operations are completed.
The subsequent operations of the third-party application may be various, and are specifically related to the currently running function of the third-party application, for example, if the third-party application is being uninstalled, the uninstalling process needs to perform a multi-step operation, where deleting the target folder is one step of the multi-step operation, and the operation after deleting the target folder is the subsequent operation.
It can be seen that, in this embodiment, when it is determined that the deletion request is a deletion request of the third-party application, after deleting the temporary file, first transferring the remaining files in the target folder to a preset storage space, then deleting the remaining files, that is, deleting the target folder to obtain a deletion response, and feeding back the deletion response to the third-party application, so that the third-party application executes subsequent operations, thereby ensuring smooth execution of the current running function of the third-party application while protecting data in the target folder; moreover, the whole process of transferring the residual files is operated in the background, so that the user cannot perceive the residual files, and the user experience is improved.
Optionally, in a possible example, in terms of protecting the remaining files in the target folder from being permanently deleted, the method further includes:
and if the total memory is larger than a threshold value, selecting one file from the remaining files each time according to the deletion sequence, copying the file to a preset storage space, deleting the file from the remaining files after the file is copied, obtaining a second deletion response after the copying and deleting operation of the last file in the remaining files are detected to be completed, feeding the second deletion response back to the third-party application so as to continue to execute the subsequent operation of the third-party application, and restoring the remaining files from the preset storage space after the execution of the subsequent operation is detected to be completed.
The threshold may be 1GB, 2GB, 3GB, or another value.
The restoring of the remaining files may be performed according to a deletion order during deletion, or may be performed randomly, where the restoration order is not limited herein.
It can be seen that, in this example, first, the total memory of the remaining files is obtained, if the total memory is greater than the threshold, if the remaining files are copied to the preset storage space together, a memory space as large as the total memory of the remaining files needs to be reserved for the preset storage space, at this time, the storage space of the preset storage space and the total memory of the remaining files will occupy a large amount of memory of the electronic device, since the memory of the electronic device is limited, and too much storage space cannot be allocated for the preset storage space, so that the remaining files cannot be copied completely or copy fails, when the memory of the target folder is large, this way of copying together is no longer applicable, in this example, the remaining files are copied to the preset storage space in sequence, only one file is copied each time, and the file is deleted after the copying is completed, so that after the target folder is copied to the preset storage space, the memory occupied by the target folder is released, so that the sequential copying mode does not need to reserve a storage space for the preset storage space, the memory pressure of the electronic device is reduced, the problem that the residual files cannot be completely copied or the copying fails when the target folder is large is solved, and the memory pressure of the electronic device is relieved.
Referring to fig. 3, fig. 3 is a diagram of another file processing method provided in an embodiment of the present application, where the method is applied to an electronic device, and the method includes:
step S301, when a deletion request for a target folder is received, a temporary file is created in the target folder.
Step S302, executing the deletion request, and if the temporary file is deleted, obtaining a total memory of the remaining files in the target folder, and if the total memory is greater than a threshold, compressing the remaining files according to a preset compression rule to obtain a compressed file.
Step S303, copying the compressed file to a preset storage space, deleting the target folder to obtain a deletion response, feeding back the deletion response to the third-party application to execute a subsequent operation of the third-party application, restoring the compressed file from the preset storage space after the subsequent operation of the third-party application is completed, and decompressing the file to obtain the target folder.
The preset storage space may be a preset storage space dedicated to caching data, and specifically, the preset storage space may be a hidden recycle bin configured to receive a file transferred from the target folder.
It can be seen that, in the embodiment of the present application, when it is determined that a third-party application deletes a target folder, first, a memory of the target folder is detected, if the memory is greater than a threshold, the target folder is compressed to obtain a compressed file to reduce the memory of the target folder, the compressed file is transferred to a preset storage space, the target file is deleted to obtain a deletion response, the deletion response is fed back to the third-party application to execute a subsequent operation of the third-party application, and after the completion of the subsequent operation is detected, the compressed file is restored and the compressed file is decompressed to obtain the target folder.
Consistent with the embodiments shown in fig. 1A, fig. 2, and fig. 3, please refer to fig. 4, fig. 4 is a schematic structural diagram of an electronic device 400 provided in an embodiment of the present application, where the electronic device 400 includes a touch display screen as shown in fig. 4, the electronic device 400 includes a processor, a memory, a communication interface, and one or more programs, where the one or more programs are different from the one or more application programs, and the one or more programs are stored in the memory and configured to be executed by the processor, and the programs include instructions for performing the following steps;
receiving a deletion request of a target folder, creating a temporary file in the target folder, and deleting the temporary file when the deletion request is a deletion request of a third-party application;
and executing the deletion request, and if the deletion of the temporary file is detected, executing a protection operation, wherein the protection operation is used for reserving the residual files in the target folder when the deletion request is executed.
In one possible example, the instructions in the program are specifically configured to, in creating a temporary file in the target folder, perform the following operations: and acquiring the deletion sequence of the files in the target folder, and creating the temporary file according to the deletion sequence so that the temporary file is positioned at the head of a deletion list when the target folder is deleted according to the deletion sequence.
In a possible example, in terms of performing the protection operation, the instructions in the program are specifically configured to perform the following operations: and ignoring the deletion request for the residual files in the deletion request, closing the access authority of the third-party application to the target folder to obtain a closing response, and feeding back the closing response to the third-party application so as to execute the subsequent operation of the third-party application.
In a possible example, in terms of performing the protection operation, the instructions in the program are specifically configured to perform the following operations: copying the residual files to a preset storage space, continuing to respond to a deletion request of the residual files in the deletion request after the copying is finished, deleting the residual files according to the deletion sequence to obtain a first deletion response, feeding the first deletion response back to the third-party application so as to continue to execute the subsequent operation, and restoring the residual files from the preset storage space after the completion of the subsequent operation is detected.
In a possible example, in terms of performing the protection operation, the instructions in the program are specifically configured to perform the following operations:
and if the total memory is larger than a threshold value, selecting one file from the remaining files to copy to the preset storage space each time according to the deletion sequence, deleting the file after the file is copied, obtaining a second deletion response after the last file in the remaining files is deleted, feeding the second deletion response back to the third-party application so as to continue to execute the subsequent operation, and restoring the remaining files from the preset storage space after the subsequent operation is detected to be completed.
Referring to fig. 5, fig. 5 is a block diagram illustrating a possible functional unit composition of the electronic device 500 for channel selection according to the above embodiment, where the electronic device 500 includes a receiving unit 510, a creating unit 520, and an executing unit 530;
a receiving unit 510, configured to receive a deletion request of a target folder;
a creating unit 520, configured to create a temporary file in the target folder, and delete the temporary file when the deletion request is a deletion request of a third-party application;
an executing unit 530, configured to execute the deletion request, and if deletion of the temporary file is detected, execute a protection operation, where the protection operation is configured to reserve remaining files in the target folder when the deletion request is executed.
In a possible example, in creating a temporary file in the target folder, the creating unit 520 is specifically configured to obtain a deletion order of files in the target folder, and create the temporary file according to the deletion order, so that the temporary file is located at a top of a deletion list when the target folder is deleted according to the deletion order.
In a possible example, in terms of performing the protection operation, the executing unit 530 is specifically configured to ignore the deletion request for the remaining files in the deletion request, close the access right of the third-party application to the target folder to obtain a close response, and feed back the close response to the third-party application so as to perform a subsequent operation of the third-party application.
In a possible example, in terms of executing the protection operation, the executing unit 530 is further configured to copy the remaining files to a preset storage space, continue to respond to a deletion request for the remaining files in the deletion request after the copying is completed, delete the remaining files according to the deletion order to obtain a first deletion response, feed back the first deletion response to the third party application so as to continue to execute the subsequent operation, and restore the remaining files from the preset storage space after the subsequent operation is detected to be completed.
In a possible example, in terms of executing the protection operation, the executing unit 530 is further configured to obtain a total memory of the remaining files, select one file from the remaining files to copy to the preset storage space each time according to the deletion order if the total memory is greater than a threshold, delete the file after the copying of the file is completed, obtain a second deletion response after the deletion of the last file from the remaining files is completed, feed back the second deletion response to the third party application so as to continue to execute the subsequent operation, and restore the remaining files from the preset storage space after the completion of the subsequent operation is detected.
Referring to fig. 6, fig. 6 is a block diagram illustrating a partial structure of a mobile phone related to an electronic device provided in an embodiment of the present application. Referring to fig. 6, the handset includes: radio Frequency (RF) circuit 610, memory 620, input unit 630, sensor 650, audio circuit 660, WIFI module 670, application processor 680, and power supply 690. Those skilled in the art will appreciate that the handset configuration shown in fig. 6 is not intended to be limiting and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
The following describes each component of the mobile phone in detail with reference to fig. 6:
the input unit 630 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the cellular phone. Specifically, the input unit 630 may include a touch display screen 633, a fingerprint recognition device 631, a face recognition device 634, an iris recognition device 635, and other input devices 632. In particular, other input devices 632 may include, but are not limited to, one or more of physical keys, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like.
The application processor 680 is configured to receive a deletion request of a target folder, create a temporary file in the target folder, delete the temporary file only when the deletion request is a deletion request of a third-party application, delete the temporary file first when the third-party application requests to delete the target folder, execute the deletion request, and execute a protection operation if deletion of the temporary file is detected, where the protection operation is used to retain remaining files in the target folder when the deletion request is executed.
Optionally, in the aspect of creating the temporary file in the target folder, the application processor 680 is specifically configured to obtain a deletion order of files in the target folder, and create the temporary file according to the deletion order, so that the temporary file is located at a head of a deletion list when the target folder is deleted according to the deletion order.
Optionally, in terms of executing the protection operation, the application processor 680 is specifically configured to ignore the deletion request for the remaining files in the deletion request, close the access right of the third-party application to the target folder to obtain a close response, and feed back the close response to the third-party application so as to execute a subsequent operation of the third-party application.
Optionally, in terms of executing the protection operation, the application processor 680 is further configured to copy the remaining files to a preset storage space, continue to respond to the deletion request for the remaining files in the deletion request after the copying is completed, delete the remaining files according to the deletion order to obtain a first deletion response, feed back the first deletion response to the third party application so as to continue to execute the subsequent operation, and restore the remaining files from the preset storage space after the subsequent operation is detected to be completed.
Optionally, in terms of executing the protection operation, the application processor 680 is further configured to obtain a total memory of the remaining files, select one file from the remaining files to copy to the preset storage space each time according to the deletion order if the total memory is greater than a threshold, delete the file after the copying of the file is completed, obtain a second deletion response after the deletion of the last file from the remaining files is completed, feed back the second deletion response to the third-party application so as to continue to execute the subsequent operation, and restore the remaining files from the preset storage space after the completion of the subsequent operation is detected.
The application processor 680 is a control center of the mobile phone, connects various parts of the entire mobile phone by using various interfaces and lines, and performs various functions of the mobile phone and processes data by operating or executing software programs and/or modules stored in the memory 620 and calling data stored in the memory 620, thereby integrally monitoring the mobile phone. Optionally, applications processor 680 may include one or more processing units.
Further, the memory 620 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.
The RF circuitry 610 may be used for the reception and transmission of information. In general, RF circuit 610 includes, but is not limited to, an antenna, at least one Amplifier, a transceiver, a coupler, a Low Noise Amplifier (LNA), a duplexer, and the like. In addition, the RF circuitry 610 may also communicate with networks and other devices via wireless communications. The wireless communication may use any communication standard or protocol, including but not limited to Global System for Mobile communication (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), email, Short Message Service (SMS), etc.
The handset may also include at least one sensor 650, such as a light sensor, motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the touch display screen according to the brightness of ambient light, and the proximity sensor may turn off the touch display screen and/or the backlight when the mobile phone moves to the ear. As one of the motion sensors, the accelerometer sensor can detect the magnitude of acceleration in each direction (generally, three axes), can detect the magnitude and direction of gravity when stationary, and can be used for applications of recognizing the posture of a mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer and tapping), and the like; as for other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor, which can be configured on the mobile phone, further description is omitted here.
Audio circuit 660, speaker 661, and microphone 662 can provide an audio interface between a user and a cell phone. The audio circuit 660 can transmit the electric signal converted from the received audio data to the loudspeaker 661, and the electric signal is converted into a sound signal by the loudspeaker 661 to be played; on the other hand, the microphone 662 converts the collected sound signals into electrical signals, which are received by the audio circuit 660 and converted into audio data, which are processed by the audio playback application processor 680 and then transmitted via the RF circuit 610 to, for example, another cellular phone, or played to the memory 620 for further processing.
WIFI belongs to short-distance wireless transmission technology, and the mobile phone can help a user to receive and send emails, browse webpages, access streaming media and the like through the WIFI module 670, and provides wireless broadband internet access for the user. Although fig. 6 shows the WIFI module 670, it is understood that it does not belong to the essential constitution of the cellular phone, and it can be omitted entirely as needed within the scope of not changing the essence of the application.
The handset also includes a power supply 690 (e.g., a battery) for supplying power to the various components, and optionally, the power supply may be logically connected to the application processor 680 via a power management system, so that the power management system may perform functions such as managing charging, discharging, and power consumption.
Although not shown, the mobile phone may further include a camera, a bluetooth module, a light supplement device, a light sensor, and the like, which are not described herein again.
Embodiments of the present application also provide a computer storage medium, wherein the computer storage medium stores a computer program for electronic data exchange, and the computer program enables a computer to execute part or all of the steps of any one of the file processing methods as described in the above method embodiments.
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.
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 application is not limited by the order of acts described, as some steps may occur in other orders or concurrently depending on the application. Further, those skilled in the art should also appreciate that the embodiments described in the specification are exemplary embodiments and that the acts and modules referred to are not necessarily required in this application.
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 application 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 may be implemented in the form of hardware, or may be implemented in the form of a software program module.
The integrated units, if implemented in the form of software program modules and sold or used as stand-alone products, may be stored in a computer readable memory. Based on such understanding, the technical solution of the present application may be substantially implemented or a part of or all or part of the technical solution contributing to the prior art may be embodied in the form of a software product stored in a memory, and including several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method described in the embodiments of the present application. And the aforementioned memory comprises: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
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 Memory disks, Read-Only memories (ROMs), Random Access Memories (RAMs), magnetic or optical disks, and the like.
The foregoing detailed description of the embodiments of the present application has been presented to illustrate the principles and implementations of the present application, and the above description of the embodiments is only provided to help understand the method and the core concept of the present application; meanwhile, for a person skilled in the art, according to the idea of the present application, 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 application.

Claims (10)

1. A file processing method is applied to an electronic device, and comprises the following steps:
receiving a deletion request of a target folder, and acquiring a deletion sequence of files in the target folder; creating a temporary file in the target folder according to the deleting sequence so that the temporary file is positioned at the head of a deleting list when the target folder is deleted according to the deleting sequence, wherein the temporary file is deleted when a deleting request is a deleting request of a third-party application;
and executing the deletion request, and if the deletion of the temporary file is detected, executing a protection operation, wherein the protection operation is used for reserving the residual files in the target folder when the deletion request is executed.
2. The method of claim 1, wherein the performing the protection operation comprises:
and ignoring the deletion request for the residual files in the deletion request, closing the access authority of the third-party application to the target folder to obtain a closing response, and feeding back the closing response to the third-party application so as to execute the subsequent operation of the third-party application.
3. The method of claim 1, wherein the performing the protection operation comprises:
copying the residual files to a preset storage space, continuing to respond to a deletion request of the residual files in the deletion request after copying is completed, deleting the residual files according to the deletion sequence to obtain a first deletion response, feeding the first deletion response back to the third-party application so as to continue to execute subsequent operations of the third-party application, and restoring the residual files from the preset storage space after the completion of the subsequent operations is detected.
4. The method of claim 1, wherein the performing the protection operation comprises:
and if the total memory is larger than a threshold value, selecting one file from the remaining files to copy to a preset storage space each time according to the deletion sequence, deleting the file after the file is copied, obtaining a second deletion response after the last file in the remaining files is deleted, feeding the second deletion response back to the third-party application so as to continue to execute subsequent operations of the third-party application, and restoring the remaining files from the preset storage space after the subsequent operations are detected to be completed.
5. An electronic device for processing a document, the electronic device comprising:
a receiving unit configured to receive a deletion request of a target folder;
the creating unit is used for acquiring the deletion sequence of the files in the target folder; creating a temporary file in the target folder according to the deleting sequence so that the temporary file is positioned at the head of a deleting list when the target folder is deleted according to the deleting sequence, wherein the temporary file is deleted when a deleting request is a deleting request of a third-party application;
and the execution unit is used for executing the deletion request, and executing a protection operation if the deletion of the temporary file is detected, wherein the protection operation is used for reserving the residual files in the target folder when the deletion request is executed.
6. The electronic device of claim 5,
when the protection operation is executed, the execution unit is specifically configured to: and ignoring the deletion request for the residual files in the deletion request, closing the access authority of the third-party application to the target folder to obtain a closing response, and feeding back the closing response to the third-party application so as to execute the subsequent operation of the third-party application.
7. The electronic device of claim 5,
when the protection operation is executed, the execution unit is specifically configured to: copying the residual files to a preset storage space, continuing to respond to a deletion request of the residual files in the deletion request after copying is completed, deleting the residual files according to the deletion sequence to obtain a first deletion response, feeding the first deletion response back to the third-party application so as to continue to execute subsequent operations of the third-party application, and restoring the residual files from the preset storage space after the completion of the subsequent operations is detected.
8. The electronic device of claim 5,
when the protection operation is executed, the execution unit is specifically configured to: and if the total memory is larger than a threshold value, selecting one file from the remaining files to copy to a preset storage space each time according to the deletion sequence, deleting the file after the file is copied, obtaining a second deletion response after the last file in the remaining files is deleted, feeding the second deletion response back to the third-party application so as to continue to execute subsequent operations of the third-party application, and restoring the remaining files from the preset storage space after the subsequent operations are detected to be completed.
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 the computer-readable storage medium 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-4, the computer comprising an electronic device.
CN201810628050.2A 2018-06-19 2018-06-19 Document processing method and related product Active CN108874591B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810628050.2A CN108874591B (en) 2018-06-19 2018-06-19 Document processing method and related product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810628050.2A CN108874591B (en) 2018-06-19 2018-06-19 Document processing method and related product

Publications (2)

Publication Number Publication Date
CN108874591A CN108874591A (en) 2018-11-23
CN108874591B true CN108874591B (en) 2022-04-29

Family

ID=64339597

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810628050.2A Active CN108874591B (en) 2018-06-19 2018-06-19 Document processing method and related product

Country Status (1)

Country Link
CN (1) CN108874591B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109871361B (en) * 2018-11-26 2023-05-23 北京乐我无限科技有限责任公司 File uploading method and device, electronic equipment and readable storage medium
CN113626391B (en) * 2021-08-27 2023-04-14 四川虹美智能科技有限公司 Processing method for cache file of operating system

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140181033A1 (en) * 2012-12-21 2014-06-26 Commvault Systems, Inc. Systems and methods to track deleted files
CN103176828B (en) * 2013-03-29 2017-06-09 北京奇虎科技有限公司 Delete the method and device of application program Stub File
CN103927077A (en) * 2014-03-13 2014-07-16 联想(北京)有限公司 File display method and electronic equipment
CN103886059A (en) * 2014-03-17 2014-06-25 可牛网络技术(北京)有限公司 Method and device for cleaning up files
CN106407831A (en) * 2015-07-31 2017-02-15 中兴通讯股份有限公司 File protection method and device, and mobile terminal
CN106709034A (en) * 2016-12-29 2017-05-24 广东欧珀移动通信有限公司 File protection method and apparatus, and terminal
CN107402846B (en) * 2017-07-24 2021-02-26 广州三星通信技术研究有限公司 File processing method and device

Also Published As

Publication number Publication date
CN108874591A (en) 2018-11-23

Similar Documents

Publication Publication Date Title
US10635449B2 (en) Method and apparatus for running game client
US11025963B2 (en) Data processing method, apparatus, and system for live streaming page
KR102356349B1 (en) File processing method and mobile terminal
CN108566332B (en) Instant messaging information processing method, device and storage medium
CN105490919A (en) Message withdrawal method and device
US11202066B2 (en) Video data encoding and decoding method, device, and system, and storage medium
CN110430592B (en) Network control method and related product
CN106528638B (en) Method for deleting backup data and mobile terminal
CN106569910B (en) Data backup and transmission method and mobile terminal
CN104243671A (en) Volume adjustment method and device and electronic device
WO2018059131A1 (en) Method and device for updating sequence of fingerprint templates for matching
CN108549698B (en) File processing method and device, mobile terminal and computer readable storage medium
CN106507269B (en) Data migration method and terminal equipment
CN104978176A (en) Application program interface calling method and device
CN107329778B (en) System updating method and related product
CN103269374A (en) Method, device and equipment for recording synchronization
CN108090345B (en) Linux system external command execution method and device
CN106445743A (en) Data backup transmission method and mobile terminal
CN105185401A (en) Method and device for synchronizing multi-media file list
CN108874591B (en) Document processing method and related product
CN106484563B (en) Data migration method and terminal equipment
CN114860677A (en) File redundancy removal method for terminal equipment, terminal equipment and storage medium
CN114691277A (en) Application program processing method, intelligent terminal and storage medium
US20160330423A1 (en) Video shooting method and apparatus
CN104426926A (en) Processing method and apparatus for regularly issued data

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