CN108563754B - File processing method and device, mobile terminal and computer readable storage medium - Google Patents

File processing method and device, mobile terminal and computer readable storage medium Download PDF

Info

Publication number
CN108563754B
CN108563754B CN201810338785.1A CN201810338785A CN108563754B CN 108563754 B CN108563754 B CN 108563754B CN 201810338785 A CN201810338785 A CN 201810338785A CN 108563754 B CN108563754 B CN 108563754B
Authority
CN
China
Prior art keywords
target file
file
directory
mobile terminal
deleting
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
CN201810338785.1A
Other languages
Chinese (zh)
Other versions
CN108563754A (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 CN201810338785.1A priority Critical patent/CN108563754B/en
Publication of CN108563754A publication Critical patent/CN108563754A/en
Application granted granted Critical
Publication of CN108563754B publication Critical patent/CN108563754B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database

Abstract

The embodiment of the application relates to a file processing method, a file processing device, a mobile terminal and a computer readable storage medium. The method comprises the following steps: when detecting that an application program executes a deleting operation, acquiring a target file of the deleting operation; acquiring directory information of the target file; when the directory information contains a specific flag bit, judging whether the file format of the target file is a preset format or not; and if the file format is a preset format, prompting the deletion operation. The file processing method, the file processing device, the mobile terminal and the computer readable storage medium can prevent the situation that important files are deleted by mistake and reduce the risk of data loss.

Description

File processing method and device, mobile terminal and computer readable storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a file processing method and apparatus, a mobile terminal, and a computer-readable storage medium.
Background
With the rapid development of internet technology, a terminal is more and more important in people's schedule life, and a lot of important files such as pictures, videos, documents (excel, txt, doc and the like) are usually stored on the terminal. In the conventional method, the problem that the file is deleted by the application program by mistake can occur, and data loss is caused.
Disclosure of Invention
The embodiment of the application provides a file processing method, a file processing device, a mobile terminal and a computer readable storage medium, which can prevent an important file from being deleted by mistake and reduce the risk of data loss.
A method of file processing, comprising:
when detecting that an application program executes a deleting operation, acquiring a target file of the deleting operation;
acquiring directory information of the target file;
when the directory information contains a specific flag bit, judging whether the file format of the target file is a preset format or not;
and if the file format is a preset format, prompting the deletion operation.
A document processing apparatus comprising:
the operation detection module is used for acquiring a target file of the deletion operation when detecting that the application program executes the deletion operation;
the directory acquisition module is used for acquiring directory information of the target file;
the format judging module is used for judging whether the file format of the target file is a preset format or not when the directory information contains a specific flag bit;
and the prompting module is used for prompting the deleting operation if the file format is a preset format.
A mobile terminal comprising a memory and a processor, the memory having stored therein a computer program which, when executed by the processor, causes the processor to carry out the method as described above.
A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the method as set forth above.
According to the file processing method, the file processing device, the mobile terminal and the computer readable storage medium, when the deletion operation executed by the application program is detected, the target file of the deletion operation is obtained, the directory information of the target file is obtained, when the directory information contains the specific flag bit, whether the file format of the target file is the preset format or not is judged, if the file format is the preset format, the deletion operation is prompted, the important file can be protected, the situation that the important file is deleted by mistake is prevented, and the risk of data loss is reduced.
Drawings
FIG. 1 is a block diagram of a mobile terminal in one embodiment;
FIG. 2 is a flowchart illustrating a method of document processing according to one embodiment;
FIG. 3 is a diagram illustrating an interface for prompting a delete operation in one embodiment;
FIG. 4 is a schematic diagram illustrating a process for transferring a target file to a temporary directory in one embodiment;
FIG. 5 is a schematic diagram of an interface for prompting a delete operation in another embodiment;
FIG. 6 is a flow diagram that illustrates direct deletion of a target file, in one embodiment;
FIG. 7 is a flow diagram that illustrates the writing of directory information to a kernel file according to a configuration file, under an embodiment;
FIG. 8 is a block diagram of a file processing apparatus in one embodiment;
FIG. 9 is a block diagram of a document processing apparatus in another embodiment;
fig. 10 is a block diagram of a mobile terminal in another embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
It will be understood that, as used herein, the terms "first," "second," and the like may be used herein to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish one element from another. For example, a first client may be referred to as a second client, and similarly, a second client may be referred to as a first client, without departing from the scope of the present application. Both the first client and the second client are clients, but they are not the same client.
Fig. 1 is a block diagram of a mobile terminal in one embodiment. As shown in fig. 1, the mobile terminal includes a processor, a memory, a network interface, a display screen, and an input device, which are connected through a system bus. The memory may include, among other things, a non-volatile storage medium and a processor. The non-volatile storage medium of the mobile terminal stores an operating system and a computer program, and the computer program is executed by a processor to implement a file processing method provided in the embodiment of the present application. The processor is used to provide computing and control capabilities to support the operation of the entire mobile terminal. The internal memory in the mobile terminal provides an environment for the execution of the computer program in the non-volatile storage medium. The network interface of the mobile terminal is used for data transmission with other electronic devices, such as obtaining a server white list from a server. The display screen of the mobile terminal can be a liquid crystal display screen or an electronic ink display screen, and the input device can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on a shell of the mobile terminal, or an external keyboard, a touch pad or a mouse. The mobile terminal can be a mobile phone, a tablet computer, a personal digital assistant or a wearable device. Those skilled in the art will appreciate that the architecture shown in fig. 1 is only a block diagram of a portion of the architecture associated with the subject application and does not constitute a limitation on the mobile terminal to which the subject application applies, and that a particular mobile terminal may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
As shown in fig. 2, in one embodiment, there is provided a file processing method including the steps of:
step 210, when detecting that the application program executes the deletion operation, acquiring a target file of the deletion operation.
The mobile terminal can monitor the deletion operation of each application program, wherein the deletion operation refers to the operation of deleting the stored files. The application program monitored by the mobile terminal may include a system application and a third party application, where the system application generally refers to an application developed by a manufacturer of the mobile terminal, the mobile terminal may be provided with the system application when the mobile terminal leaves a factory, the third party application generally refers to an application developed by an organization or a person other than the manufacturer, and the third party application may be installed on the mobile terminal when the user uses the mobile terminal.
When an application needs to delete a file, a delete function may be invoked. The mobile terminal can monitor the call of the deletion function, and when the deletion function is detected to be called, the application program calling the deletion function can execute the deletion operation. The mobile terminal can obtain an application program calling a deletion function and obtain a target file of deletion operation, wherein the target file refers to a deleted file. The target files for the deletion operation performed by the application program may be one or more, and may be target files in the same file format or target files in different file formats.
Step 220, obtaining the directory information of the target file.
The mobile terminal can obtain the folder to which each target file belongs, and obtain the directory information according to the folder to which the target file belongs, and the file directory can establish the corresponding relation between the file name and the physical address in the storage space. The directory information of the target file may include a folder name to which the target file belongs, a folder storage address to which the target file belongs, and the like. The file directory included in the directory information may be a primary directory, a secondary directory, a multi-level directory, or the like.
Step 230, when the directory information includes the specific flag bit, determining whether the file format of the target file is a preset format, if so, performing step 240, and if not, performing step 250.
The mobile terminal can detect whether the directory information contains a specific flag bit, wherein the specific flag bit can be equivalent to an anti-deletion-error flag bit, and the specific flag bit can be used for indicating that the file in the file directory is a protected and important file. The specific flag bit can be expressed in different modes according to actual requirements.
In one embodiment, the mobile terminal may add a specific flag bit in a file directory through a configuration file, and the configuration file may record configuration information such as a protected file format, a file type, or a file directory. The file format may include, but is not limited to, jpg, doc, gif, etc., and may be represented by a suffix name of the file. The file types may include, but are not limited to, pictures, video, audio, and the like. The mobile terminal can obtain the configuration file, search the file directory corresponding to the configuration information according to the configuration information recorded in the configuration file, and add a specific marker bit in the searched file directory. For example, a protected file type is recorded in the configuration file, and the mobile terminal may find a file directory containing the protected file type and add a specific flag bit in the file directory containing the protected file type.
If the directory information does not include a specific flag bit, it can be indicated that the target file is not a protected file, and the mobile terminal can directly delete the target file. If the directory information contains a specific flag bit, the mobile terminal can determine whether the file format of the target file is a preset format, and the preset format can refer to a protected file format. The mobile terminal can read the file name of the target file and judge whether the file format of the target file is a preset format or not according to the suffix name contained in the file name. Whether the directory information contains the specific zone bit is judged first, and whether the file format of the target file is the preset format is judged after the specific zone bit is contained, so that whether the target file is the protected file can be determined, the detection is carried out from big to small.
And step 240, prompting the deletion operation.
If the file format of the target file is not the preset format, the mobile terminal can directly delete the target file. If the file format of the target file is the preset format, the mobile terminal can prompt the deletion operation. The prompting mode can be set according to actual requirements, for example, prompting information can be displayed on an interface, vibration can be carried out, or voice information can be played for prompting and the like. The mobile terminal can prompt the application program, the target file and the like which are subjected to the deleting operation. For example, but not limited to, a prompt voice "find X application deletes your video" may be played.
In one embodiment, the mobile terminal prompts the deletion operation, and the user can select the prompt, delete the file or keep the file, etc. The mobile terminal can receive the selection operation aiming at the prompt, if the selection operation selects to delete the file, the mobile terminal can directly delete the target file, and if the selection operation selects to reserve the file, the target file can not be deleted, so that the important file can be prevented from being deleted by mistake.
Step 250, delete target file.
FIG. 3 is a diagram illustrating an interface for prompting a delete operation in one embodiment. As shown in fig. 3, the mobile terminal detects that the application a performs a deletion operation, and a target file for the deletion operation may include 6 photos. The mobile terminal can obtain the directory information of the 6 photos, and can detect that the directory information contains a specific flag bit, and the file format of the 6 photos is a preset format. The mobile terminal may prompt for the delete operation and may present a prompt 302 "find a application deletes your 6 photos" on the interface.
In this embodiment, when it is detected that the application executes the deletion operation, the target file of the deletion operation is acquired, the directory information of the target file is acquired, when the directory information includes the specific flag bit, whether the file format of the target file is the preset format is determined, and if the file format is the preset format, the deletion operation is prompted, so that the important file can be protected, the situation that the important file is deleted by mistake is prevented, and the risk of data loss is reduced.
As shown in fig. 4, in an embodiment, after acquiring the target file of the deletion operation when detecting that the application performs the deletion operation in step 210, the method further includes the following steps:
step 402, transferring the target file to the temporary directory, and recording directory information of the target file before transfer.
The mobile terminal detects that the application program executes the deleting operation, can acquire the target file of the deleting operation, and transfers the target file to a temporary directory created in advance. The temporary directory is equivalent to a temporary folder and can be used for caching the target file of the deletion operation. The mobile terminal can set access authority to the temporary directory, and only the application program with the access authority can access the temporary directory. Optionally, the mobile terminal may set the access right of the application program to the temporary directory according to actual requirements, for example, it may be set that the system application has the access right, and the third-party application does not have the access right. The mobile terminal may also count the trust value of each application, which may be determined by a number of different factors, such as the access frequency of the user, the service logic of the application, the update frequency, etc. The application program with the trust value greater than the threshold may be set to have access right, and the application with the trust value less than or equal to the threshold may not have access right.
The mobile terminal transfers the target file to the temporary directory, and may record directory information of the target file before transfer, where the directory information of the target file before transfer may refer to directory information corresponding to a folder to which the target file belongs before transfer.
Step 404, when the time length for transferring the target file to the temporary directory reaches the time length threshold, obtaining the directory information of the target file before transferring.
The mobile terminal can record the time length of the target file transferred to the temporary directory, and when the time length of the target file transferred to the temporary directory reaches a time length threshold value, the target file can be processed, including the processes of deleting the target file or detecting whether the target file is a protected file or not. Alternatively, the time threshold may be set according to actual requirements, such as 5 minutes, 10 minutes, and the like. The mobile terminal may also set a processing time for processing the target files in the temporary directory, for example, when the mobile terminal is in a charging state, the mobile terminal may set a batch processing for each target file included in the temporary directory, and when the mobile terminal is in a screen-off state, the mobile terminal may set a batch processing for the target files included in the temporary directory, but the present invention is not limited thereto. The processing efficiency of the target file can be improved and the power consumption can be reduced.
In one embodiment, when the duration of transferring the target file to the temporary directory reaches the duration threshold, the mobile terminal may obtain directory information of the target file before transferring, and when the directory information includes a specific flag bit, may determine whether the file format of the target file is a preset format. If the file format of the target file is the preset format, the mobile terminal can prompt the deletion operation. The user may select for the prompt. The mobile terminal may receive a selection operation performed for the prompt, and if the selection operation selects a first option, which may be an option to delete a file, the mobile terminal may delete the target file in the temporary directory. If the selection operation selects the second option, which may be a file retention option, the mobile terminal may restore the target file to the directory corresponding to the directory information before the transfer, and restore the target file.
Fig. 5 is a schematic interface diagram for prompting a deletion operation in another embodiment. As shown in fig. 5, the mobile terminal detects that the application a performs a deletion operation, and the target file for the deletion operation may include 6 photos. The mobile terminal can transfer the 6 photos to the temporary directory, when the time length for transferring the 6 photos to the temporary directory reaches the time length threshold value for 3 minutes, the mobile terminal can obtain the directory information of the 6 photos, and can detect that the directory information contains a specific mark bit, and the file format of the 6 photos is a preset format. The mobile terminal may prompt for the deletion operation, and may present a prompt message 502 "find that the a application deleted your 6 photos and needs help you recover? ". The user may select for the reminder 502. When the selection operation received by the mobile terminal is the first option 504, the 6 photos under the temporary directory may be deleted. When the selection operation received by the mobile terminal is the second option 506, the 6 photos may be restored to the directory corresponding to the directory information before the transfer.
In this embodiment, the target file of the deletion operation may be cached through the temporary directory, and when the time length for transferring the target file to the temporary directory reaches the time length threshold, the target file is processed, so that a situation that an important file is deleted by mistake can be further prevented, and a risk of data loss is reduced.
As shown in fig. 6, in an embodiment, after acquiring the target file of the deletion operation when detecting that the application performs the deletion operation in step 210, the method further includes the following steps:
step 602, extracting the creating application identifier of the target file.
When the application program creates the file, the application identifier may be added to the created file, and the application identifier may be information that can uniquely identify the application program, such as the name and the number of the application program. The application identifier may also be an application summary, the mobile terminal may obtain application information of the application program, the application information may include, but is not limited to, a name, a version number, a developer, an application type, and the like, and the application summary may be generated according to the application information and used as the application identifier. Alternatively, the application Digest may be a Message Digest Algorithm fifth edition (MD 5) Digest, or may be another Algorithm Digest, which is not limited to this.
And step 604, deleting the target file when the application identification of the application program is consistent with the created application identification.
The mobile terminal can obtain the application identifier of the application program for deleting operation, and extract the created application identifier of each target file for deleting operation, wherein the created application identifier is the application identifier of the application program for creating the target file. The mobile terminal can compare the application identifier of the application program subjected to the deleting operation with the created application identifier and judge whether the application identifier and the created application identifier are consistent. If the application identifier of the application program subjected to the deletion operation is consistent with the created application identifier, it can be shown that the application programs for creating and deleting the target file are the same, and the mobile terminal can directly delete the target file.
If the application identifier of the application program performing the deletion operation is not consistent with the created application identifier, it may be stated that the application programs creating and deleting the target file are different. The mobile terminal can detect whether the target file is a protected file or not, can judge whether the directory information of the target file contains a specific flag bit or not, and if so, further judges whether the file format of the target file is a preset format or not. If the target file is a protected file, the mobile terminal can prompt the deletion operation.
In this embodiment, when the application programs for creating the target file and deleting the target file are consistent, the target file is directly deleted without detecting whether the target file is a protected file, so that the detection times are reduced, the detection efficiency can be improved, and the system power consumption can be reduced.
In one embodiment, after acquiring the target file of the deletion operation when the application program is detected to perform the deletion operation in step 210, the method further includes: when the application program exists in the white list, the target file is deleted.
The mobile terminal may store a white list in which trusted applications may be recorded. When the mobile terminal detects that the application program is executing the deleting operation, the application identifier of the application program can be obtained, and whether the application program exists in the white list or not is judged according to the application identifier. If the application program exists in the white list, the mobile terminal can directly delete the target file without detecting whether the target file is a protected file.
In one embodiment, the whitelist may include a local whitelist and a cloud whitelist, in which trusted system applications and third party applications may be recorded. The mobile terminal developer can research and test each application program in the market and calculate the trust value of each application program, wherein the trust value can be calculated according to the service logic, the updating frequency, the downloading user amount and the like of the application program. A developer of the mobile terminal can update the cloud white list at regular time according to the research and test results, trusted application programs are added into the cloud white list, the application programs with the trust values larger than the trust threshold value can be added into the white list, the flexibility of the white list is improved, and the application programs of the white list are enabled to be in line with the market.
Before judging whether the application program subjected to the deleting operation exists in the white list, the mobile terminal can obtain the local white list and the cloud white list, compare the local white list with the cloud white list and judge whether the local white list and the cloud white list are consistent. And if the application program in the local white list is inconsistent with the application program in the cloud white list, updating the local white list according to the cloud white list with reference to the cloud white list, and ensuring the synchronization between the local white list and the cloud white list. Optionally, the mobile terminal may also obtain the local white list and the cloud white list at a fixed time, and perform synchronization between the two, for example, the mobile terminal may perform synchronization at 4 am, or perform synchronization when the mobile terminal is powered on, but is not limited thereto.
In this embodiment, when the application program performing the deletion operation exists in the white list, the target file may be directly deleted without detecting whether the target file is a protected file, so as to reduce the number of detection times, improve the detection efficiency, and reduce the power consumption of the system.
As shown in fig. 7, in an embodiment, the file processing method further includes the following steps:
step 702, when the mobile terminal is powered on and started, a configuration file is obtained.
When the mobile terminal is started, the protected file directory can be configured, and a specific zone bit is added in the protected file directory. When the mobile terminal is started, the mobile terminal can obtain a configuration file, and the configuration file can record configuration information such as protected file formats, file types or file directories. Optionally, the configuration file may include a local configuration file and/or a cloud configuration file, the local configuration file is stored locally in the mobile terminal, and the cloud configuration file may be stored in the server. The mobile terminal can acquire the cloud configuration file from the server, and update the local configuration file according to the cloud configuration file, so that synchronization between the cloud configuration file and the local configuration file is guaranteed.
Step 704, determining the directory information added with the specific flag bit according to the configuration file, and writing the determined directory information into the kernel file.
After the mobile terminal updates the local configuration file, the directory information added with the specific flag bit can be determined according to the local configuration file. The mobile terminal can search the file directory corresponding to the configuration information according to the configuration information recorded in the local configuration file, write the searched directory information into the kernel file, and add a specific flag bit in the searched directory information. The mobile terminal can write the directory information into the kernel file during the period from the start-up to the interface entry, so that the file detection efficiency can be improved.
When the mobile terminal detects that the application program executes the deleting operation, the directory information of the target file of the deleting operation can be obtained, the kernel file is read, whether the directory information of the target file exists in the kernel file or not is judged, and if the directory information exists in the kernel file, the directory information can be determined to contain the specific zone bit.
In this embodiment, the configuration file can be obtained when the computer is started, and the protected file directory is written into the kernel file according to the configuration file, so that the situation that an important file is deleted by mistake can be further prevented, and the risk of data loss is reduced.
In one embodiment, a file processing method is provided, including the steps of:
and (1) acquiring a target file of the deletion operation when the application program is detected to execute the deletion operation.
In one embodiment, after the step (1), the method further comprises: extracting a creating application identifier of the target file, wherein the creating application identifier is an application identifier of an application program for creating the target file; and when the application identification of the application program is consistent with the created application identification, deleting the target file.
In one embodiment, after the step (1), the method further comprises: when the application program exists in the white list, the target file is deleted.
In one embodiment, the whitelist includes a local whitelist and a cloud whitelist; before deleting the target file when the application program exists in the white list, the method further comprises the following steps: acquiring a local white list and a cloud white list; and when the local white list is inconsistent with the cloud white list, updating the local white list according to the cloud white list.
And (2) acquiring the directory information of the target file.
In one embodiment, after the step (1), the method further comprises: transferring the target file to a temporary directory, and recording directory information of the target file before transfer; step (2), comprising: and when the time length of the target file transferred to the temporary directory reaches the time length threshold value, acquiring the directory information of the target file before the transfer.
And (3) judging whether the file format of the target file is a preset format or not when the directory information contains the specific flag bit.
And (4) if the file format is the preset format, prompting the deletion operation.
In one embodiment, after the step (4), the method further comprises: receiving selection operation performed aiming at the prompt; if the selection operation selects the first option, deleting the target file in the temporary directory; and if the selection operation selects the second option, restoring the target file to the directory corresponding to the directory information.
In one embodiment, the file processing method further includes: when the mobile terminal is started, acquiring a configuration file; and determining the directory information added with the specific zone bit according to the configuration file, and writing the determined directory information into the kernel file.
In this embodiment, when it is detected that the application executes the deletion operation, the target file of the deletion operation is acquired, the directory information of the target file is acquired, when the directory information includes the specific flag bit, whether the file format of the target file is the preset format is determined, and if the file format is the preset format, the deletion operation is prompted, so that the important file can be protected, the situation that the important file is deleted by mistake is prevented, and the risk of data loss is reduced.
It should be understood that, although the steps in the respective flow charts described above are shown in sequence as indicated by the arrows, the steps are not necessarily performed in sequence as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least a portion of the steps in the various flow diagrams described above may include multiple sub-steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of performing the sub-steps or stages is not necessarily sequential, but may be performed alternately or alternatingly with other steps or at least a portion of the sub-steps or stages of other steps.
As shown in fig. 8, in an embodiment, a file processing apparatus 800 is provided, which includes an operation detection module 810, a directory acquisition module 820, a format determination module 830, and a prompt module 840.
And the operation detection module 810 is configured to, when detecting that the application performs the deletion operation, obtain a target file of the deletion operation.
A directory obtaining module 820, configured to obtain directory information of the target file.
The format determining module 830 is configured to determine whether the file format of the target file is a preset format when the directory information includes the specific flag bit.
The prompting module 840 is configured to prompt the deletion operation if the file format is the preset format.
In this embodiment, when it is detected that the application executes the deletion operation, the target file of the deletion operation is acquired, the directory information of the target file is acquired, when the directory information includes the specific flag bit, whether the file format of the target file is the preset format is determined, and if the file format is the preset format, the deletion operation is prompted, so that the important file can be protected, the situation that the important file is deleted by mistake is prevented, and the risk of data loss is reduced.
As shown in fig. 9, in an embodiment, the file processing apparatus 800 further includes a transferring module 850 in addition to the operation detecting module 810, the directory obtaining module 820, the format determining module 830 and the prompting module 840.
And the transferring module 850 is used for transferring the target file to the temporary directory and recording the directory information of the target file before transfer.
The directory obtaining module 820 is further configured to obtain directory information of the target file before the target file is transferred when the duration that the target file is transferred to the temporary directory reaches the duration threshold.
In one embodiment, the file processing apparatus 800 includes an operation receiving module, a deleting module, and a restoring module, in addition to the operation detecting module 810, the directory obtaining module 820, the format determining module 830, the prompting module 840, and the transferring module 850.
And the operation receiving module is used for receiving selection operation aiming at the prompt.
And the deleting module is used for deleting the target file in the temporary directory if the first option is selected by the selecting operation.
And the restoring module is used for restoring the target file to the directory corresponding to the directory information if the second option is selected by the selecting operation.
In this embodiment, the target file of the deletion operation may be cached through the temporary directory, and when the time length for transferring the target file to the temporary directory reaches the time length threshold, the target file is processed, so that a situation that an important file is deleted by mistake can be further prevented, and a risk of data loss is reduced.
In one embodiment, the deletion module is further configured to extract a created application identifier of the target file, and delete the target file when the application identifier of the application program is consistent with the created application identifier, where the created application identifier is the application identifier of the application program that created the target file.
In this embodiment, when the application programs for creating the target file and deleting the target file are consistent, the target file is directly deleted without detecting whether the target file is a protected file, so that the detection times are reduced, the detection efficiency can be improved, and the system power consumption can be reduced.
In one embodiment, the deletion module is further configured to delete the target file when the application exists on the whitelist.
Optionally, the white list includes a local white list and a cloud white list. The file processing apparatus 800 includes a list acquisition module and an update module, in addition to the operation detection module 810, the directory acquisition module 820, the format determination module 830, the prompt module 840, the transfer module 850, the operation receiving module, the deletion module and the restoration module.
And the list acquisition module is used for acquiring a local white list and a cloud white list.
And the updating module is used for updating the local white list according to the cloud white list when the local white list is inconsistent with the cloud white list.
In this embodiment, when the application program performing the deletion operation exists in the white list, the target file may be directly deleted without detecting whether the target file is a protected file, so as to reduce the number of detection times, improve the detection efficiency, and reduce the power consumption of the system.
In an embodiment, the file processing apparatus 800 further includes a writing module in addition to the operation detection module 810, the directory obtaining module 820, the format determination module 830, the prompting module 840, the transferring module 850, the operation receiving module, the deleting module, the restoring module, the list obtaining module, and the updating module.
And the writing module is used for acquiring the configuration file when the mobile terminal is started, determining the directory information added with the specific zone bit according to the configuration file, and writing the determined directory information into the kernel file.
In this embodiment, the configuration file can be obtained when the computer is started, and the protected file directory is written into the kernel file according to the configuration file, so that the situation that an important file is deleted by mistake can be further prevented, and the risk of data loss is reduced.
The embodiment of the application also provides the mobile terminal. As shown in fig. 10, for convenience of explanation, only the parts related to the embodiments of the present application are shown, and details of the technology are not disclosed, please refer to the method part of the embodiments of the present application. The mobile terminal may be any terminal device including a mobile phone, a tablet computer, a Personal Digital Assistant (PDA), a Point of Sales (POS), a vehicle-mounted computer, a wearable device, and the like, taking the mobile terminal as the mobile phone as an example:
fig. 10 is a block diagram of a partial structure of a mobile phone related to a mobile terminal according to an embodiment of the present application. Referring to fig. 10, the cellular phone includes: radio Frequency (RF) circuit 1010, memory 1020, input unit 1030, display unit 1040, sensor 1050, audio circuit 1060, wireless fidelity (WiFi) module 1070, processor 1080, and power source 1090. Those skilled in the art will appreciate that the handset configuration shown in fig. 10 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 RF circuit 1010 may be configured to receive and transmit signals during information transmission and reception or during a call, and may receive downlink information of a base station and then process the received downlink information to the processor 1080; the uplink data may also be transmitted to the base station. Typically, the RF circuitry 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 1010 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, GSM, GPRS, CDMA, W-CDMA, Long Term Evolution (LTE), email, Short Messaging Service (SMS), etc.
The memory 1020 can be used for storing software programs and modules, and the processor 1080 executes various functional applications and data processing of the mobile phone by operating the software programs and modules stored in the memory 1020. The memory 1020 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required for at least one function (such as an application program for a sound playing function, an application program for an image playing function, and the like), and the like; the data storage area may store data (such as audio data, an address book, etc.) created according to the use of the mobile phone, and the like. Further, the memory 1020 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 input unit 1030 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 1000. Specifically, the input unit 1030 may include a touch panel 1032 and other input devices 1034. Touch panel 1032, which may also be referred to as a touch screen, may collect touch operations by a user (e.g., operations by a user on or near touch panel 1032 using a finger, a stylus, or any other suitable object or accessory) and drive the corresponding connection device according to a predetermined program. In one embodiment, touch panel 1032 can include two portions, a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 1080, and can receive and execute commands sent by the processor 1080. In addition, the touch panel 1032 may be implemented using various types such as resistive, capacitive, infrared, and surface acoustic wave. The input unit 1030 may include other input devices 1034 in addition to the touch panel 1032. In particular, other input devices 1034 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), and the like.
The display unit 1040 may be used to display information input by a user or information provided to the user and various menus of the cellular phone. The display unit 1040 may include a display panel 1042. In one embodiment, the Display panel 1042 may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like. In one embodiment, the touch panel 1032 can overlay the display panel 1042, and when the touch panel 1032 detects a touch operation thereon or nearby, the touch operation is transmitted to the processor 1080 to determine the type of the touch event, and then the processor 1080 provides a corresponding visual output on the display panel 1042 according to the type of the touch event. Although in fig. 10, the touch panel 1032 and the display panel 1042 are two separate components to implement the input and output functions of the mobile phone, in some embodiments, the touch panel 1032 and the display panel 1042 may be integrated to implement the input and output functions of the mobile phone.
The cell phone 1000 may also include at least one sensor 1050, 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 display panel 1042 according to the brightness of ambient light, and the proximity sensor may turn off the display panel 1042 and/or the backlight when the mobile phone moves to the ear. The motion sensor can comprise an acceleration sensor, the acceleration sensor can detect the magnitude of acceleration in each direction, the magnitude and the direction of gravity can be detected when the mobile phone is static, and the motion sensor can be used for identifying the application of the gesture of the mobile phone (such as horizontal and vertical screen switching), the vibration identification related functions (such as pedometer and knocking) and the like; the mobile phone may be provided with other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor.
Audio circuitry 1060, speaker 1062, and microphone 1064 may provide an audio interface between a user and a cell phone. The audio circuit 1060 can transmit the electrical signal converted from the received audio data to the speaker 1062, and the electrical signal is converted into a sound signal by the speaker 1062 and output; on the other hand, the microphone 1064 converts the collected sound signal into an electrical signal, which is received by the audio circuit 1060 and converted into audio data, and the audio data is processed by the audio data output processor 1080 and then transmitted to another mobile phone through the RF circuit 1010, or the audio data is output to the memory 1020 for subsequent processing.
WiFi belongs to short-distance wireless transmission technology, and the mobile phone can help the user to send and receive e-mail, browse web pages, access streaming media, etc. through the WiFi module 1070, which provides wireless broadband internet access for the user. Although fig. 10 shows the WiFi module 1070, it is to be understood that it does not belong to the essential constitution of the handset 1000 and may be omitted as needed.
The processor 1080 is a control center of the mobile phone, connects various parts of the whole mobile phone by using various interfaces and lines, and executes various functions of the mobile phone and processes data by operating or executing software programs and/or modules stored in the memory 1020 and calling data stored in the memory 1020, thereby integrally monitoring the mobile phone. In one embodiment, processor 1080 may include one or more processing units. In one embodiment, processor 1080 may integrate an application processor and a modem, wherein the application processor primarily handles operating systems, user interfaces, application programs, and the like; the modem handles primarily wireless communications. It is to be appreciated that the modem can be non-integrated with the processor 1080. For example, the processor 1080 may integrate an application processor and a baseband processor, which may constitute a modem with other peripheral chips, etc. The handset 1000 also includes a power supply 1090 (e.g., a battery) for powering the various components, which may preferably be logically coupled to the processor 1080 via a power management system that may be configured to manage charging, discharging, and power consumption.
In one embodiment, the cell phone 1000 may also include a camera, a bluetooth module, and the like.
In the embodiment of the present application, the processor 1080 included in the mobile terminal implements the file processing method described above when executing the computer program stored in the memory.
In one embodiment, the mobile terminal can include a memory 1020 and a processor 1080, wherein the memory 1020 stores a computer program that, when executed by the processor 1080, causes the processor to perform the steps of:
when detecting that the application program executes the deleting operation, acquiring a target file of the deleting operation;
acquiring directory information of a target file;
when the directory information contains a specific flag bit, judging whether the file format of the target file is a preset format or not;
and if the file format is the preset format, prompting the deletion operation.
In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, which, when executed by a processor, implements the file processing method described above.
In one embodiment, a computer program product is provided that comprises a computer program, which when run on a computer device causes the computer device to perform the file processing method described above when executed.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a non-volatile computer-readable storage medium, and can include the processes of the embodiments of the methods described above when the program is executed. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), or the like.
Any reference to memory, storage, database, or other medium as used herein may include non-volatile and/or volatile memory. Suitable non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM), which acts as external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), Enhanced SDRAM (ESDRAM), synchronous Link (Synchlink) DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and bus dynamic RAM (RDRAM).
The technical features of the embodiments described above may be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the embodiments described above are not described, but should be considered as being within the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (9)

1. A file processing method, comprising:
when detecting that an application program executes a deleting operation, acquiring a target file of the deleting operation;
transferring the target file to a temporary directory, and recording directory information of the target file before transfer, wherein the temporary directory is a temporary folder and is used for caching the target file subjected to deletion operation;
when the time length of the target file transferred to the temporary directory reaches a time length threshold value, acquiring directory information of the target file before transfer;
when the directory information contains a specific flag bit, judging whether the file format of the target file is a preset format or not, wherein the specific flag bit is an anti-error-deletion flag bit;
if the file format is a preset format, prompting the deletion operation;
after the obtaining of the target file of the deletion operation, the method further includes:
extracting a creating application identifier of the target file, wherein the creating application identifier is an application identifier of an application program for creating the target file;
and when the application identification of the application program is consistent with the created application identification, deleting the target file.
2. The method of claim 1, wherein after said prompting for said deletion operation, said method further comprises:
receiving selection operation performed aiming at the prompt;
if the selection operation selects the first option, deleting the target file in the temporary directory;
and if the selection operation selects the second option, restoring the target file to the directory corresponding to the directory information.
3. The method of claim 1, wherein after the obtaining of the target file of the delete operation, the method further comprises:
and when the application program exists in a white list, deleting the target file.
4. The method of claim 3, wherein the whitelist comprises a local whitelist and a cloud whitelist;
before deleting the target file when the application program exists in the white list, the method further comprises:
acquiring a local white list and a cloud white list;
and when the local white list is inconsistent with the cloud white list, updating the local white list according to the cloud white list.
5. The method of any of claims 1 to 4, further comprising:
when the mobile terminal is started, acquiring a configuration file;
and determining the directory information added with the specific zone bit according to the configuration file, and writing the determined directory information into the kernel file.
6. A document processing apparatus, characterized by comprising:
the operation detection module is used for acquiring a target file of the deletion operation when detecting that the application program executes the deletion operation;
the transfer module is used for transferring the target file to a temporary directory and recording directory information of the target file before transfer, wherein the temporary directory is a temporary folder and is used for caching the target file subjected to deletion operation;
the directory obtaining module is used for obtaining directory information of the target file before the target file is transferred when the time length of the target file transferred to the temporary directory reaches a time length threshold value;
the format judging module is used for judging whether the file format of the target file is a preset format or not when the directory information contains a specific flag bit, wherein the specific flag bit is an anti-deletion-prevention flag bit;
the prompt module is used for prompting the deletion operation if the file format is a preset format;
the device further comprises: a deleting module, configured to extract a created application identifier of the target file after the target file of the deleting operation is obtained, where the created application identifier is an application identifier of an application program that creates the target file; and when the application identification of the application program is consistent with the created application identification, deleting the target file.
7. The apparatus of claim 6, further comprising:
the operation receiving module is used for receiving selection operation aiming at the prompt;
the deleting module is used for deleting the target file in the temporary directory if the first option is selected by the selecting operation;
and the restoring module is used for restoring the target file to the directory corresponding to the directory information if the second option is selected by the selecting operation.
8. A mobile terminal comprising a memory and a processor, the memory having stored therein a computer program which, when executed by the processor, causes the processor to carry out the method of any of claims 1 to 5.
9. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1 to 5.
CN201810338785.1A 2018-04-16 2018-04-16 File processing method and device, mobile terminal and computer readable storage medium Active CN108563754B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810338785.1A CN108563754B (en) 2018-04-16 2018-04-16 File processing method and device, mobile terminal and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810338785.1A CN108563754B (en) 2018-04-16 2018-04-16 File processing method and device, mobile terminal and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN108563754A CN108563754A (en) 2018-09-21
CN108563754B true CN108563754B (en) 2021-09-28

Family

ID=63535235

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810338785.1A Active CN108563754B (en) 2018-04-16 2018-04-16 File processing method and device, mobile terminal and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN108563754B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109819014B (en) * 2018-12-14 2022-10-25 平安普惠企业管理有限公司 Project deployment method and device, computer equipment and storage medium
CN112995015B (en) * 2019-12-17 2022-07-05 腾讯科技(深圳)有限公司 Message sending method, device, terminal and storage medium
CN111459385B (en) * 2020-03-31 2022-05-17 维沃移动通信有限公司 Information display method and electronic equipment
CN112099822B (en) * 2020-08-26 2023-09-15 华人运通(江苏)技术有限公司 File update reminding method, device, equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008052643A (en) * 2006-08-28 2008-03-06 Canon Inc Document processing system, and method for controlling document processing
CN105740455A (en) * 2016-02-04 2016-07-06 北京金山安全软件有限公司 Picture deleting method and device and electronic equipment
CN106709034A (en) * 2016-12-29 2017-05-24 广东欧珀移动通信有限公司 File protection method and apparatus, and terminal
CN106991130A (en) * 2017-03-07 2017-07-28 广东欧珀移动通信有限公司 A kind of document handling method, device and intelligent terminal
CN107491482A (en) * 2017-07-12 2017-12-19 维沃移动通信有限公司 A kind of reminding method and mobile terminal
CN107609027A (en) * 2017-08-08 2018-01-19 捷开通讯(深圳)有限公司 The anti-deleted marker position of file is set and prevents from deleting the method and device of file by mistake

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH08202603A (en) * 1995-01-26 1996-08-09 Hitachi Ltd Document preparing device and document file compiling method
CN103838843A (en) * 2014-03-03 2014-06-04 联想(北京)有限公司 File processing method and electronic equipment
CN103955421A (en) * 2014-05-06 2014-07-30 珠海市君天电子科技有限公司 Method and system for file deletion
CN107423369A (en) * 2017-07-01 2017-12-01 珠海格力电器股份有限公司 A kind of method and device for handling file to be deleted
CN107506642A (en) * 2017-08-10 2017-12-22 四川长虹电器股份有限公司 The method and system for preventing file from being damaged by malicious operation behavior
CN107766549A (en) * 2017-10-31 2018-03-06 珠海市魅族科技有限公司 Text delet method and device, terminal installation and readable storage medium storing program for executing

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008052643A (en) * 2006-08-28 2008-03-06 Canon Inc Document processing system, and method for controlling document processing
CN105740455A (en) * 2016-02-04 2016-07-06 北京金山安全软件有限公司 Picture deleting method and device and electronic equipment
CN106709034A (en) * 2016-12-29 2017-05-24 广东欧珀移动通信有限公司 File protection method and apparatus, and terminal
CN106991130A (en) * 2017-03-07 2017-07-28 广东欧珀移动通信有限公司 A kind of document handling method, device and intelligent terminal
CN107491482A (en) * 2017-07-12 2017-12-19 维沃移动通信有限公司 A kind of reminding method and mobile terminal
CN107609027A (en) * 2017-08-08 2018-01-19 捷开通讯(深圳)有限公司 The anti-deleted marker position of file is set and prevents from deleting the method and device of file by mistake

Also Published As

Publication number Publication date
CN108563754A (en) 2018-09-21

Similar Documents

Publication Publication Date Title
CN108549698B (en) File processing method and device, mobile terminal and computer readable storage medium
CN108563754B (en) File processing method and device, mobile terminal and computer readable storage medium
CN108536783B (en) Data processing method and device, terminal and computer readable storage medium
CN107729815B (en) Image processing method, image processing device, mobile terminal and computer readable storage medium
CN103327189B (en) Method and device for uploading, browsing and deleting pictures
CN107484154B (en) Data switching method and device, terminal and computer readable storage medium
US20140115021A1 (en) Method and Terminal for Accessing a File of a Terminal
CN109445917B (en) Application processing method and device, electronic equipment and computer readable storage medium
CN106951492B (en) File searching method and device and electronic equipment
CN108509788B (en) Information sharing method and device, computer readable storage medium and terminal
CN109002547B (en) Log file storage method, mobile terminal and computer readable storage medium
CN108256466B (en) Data processing method and device, electronic equipment and computer readable storage medium
CN107341032B (en) Data loading method, mobile terminal and computer readable storage medium
CN107729391B (en) Image processing method, image processing device, computer-readable storage medium and mobile terminal
CN110018886B (en) Application state switching method and device, electronic equipment and readable storage medium
CN106657254A (en) Synchronization method, device and system for contact information
CN108513005B (en) Contact person information processing method and device, electronic equipment and storage medium
CN109684132B (en) Data backup method of mobile terminal, mobile terminal and storage medium
CN107145572B (en) Data processing method and device, computer equipment and storage medium
CN113039517B (en) Audio resource calling method and device and electronic equipment
CN112913267B (en) Resource processing method, device, terminal, server and readable storage medium
CN108228357B (en) Memory cleaning method and mobile terminal
CN109992322B (en) Application program unloading method and device, storage medium and terminal
CN104424321A (en) File directory obtainment method and file directory obtainment device
CN112997132A (en) Application freezing method and device and electronic equipment

Legal Events

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