CN108733797B - File processing method and related device - Google Patents

File processing method and related device Download PDF

Info

Publication number
CN108733797B
CN108733797B CN201810469287.0A CN201810469287A CN108733797B CN 108733797 B CN108733797 B CN 108733797B CN 201810469287 A CN201810469287 A CN 201810469287A CN 108733797 B CN108733797 B CN 108733797B
Authority
CN
China
Prior art keywords
file
target file
deletion
target
condition
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
CN201810469287.0A
Other languages
Chinese (zh)
Other versions
CN108733797A (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 CN201810469287.0A priority Critical patent/CN108733797B/en
Publication of CN108733797A publication Critical patent/CN108733797A/en
Application granted granted Critical
Publication of CN108733797B publication Critical patent/CN108733797B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The application discloses a file processing method and a related device, which are applied to a mobile terminal and comprise the following steps: when a deletion request of a third-party application of the mobile terminal for a target file is detected, determining the file type of the target file; when the file type is detected to be a preset file type, performing behavior validity detection on the deletion request to obtain a detection result; if the detection result is determined to be legal, deleting the target file, and feeding back a deletion response to the third party application to prompt the third party to continue to execute subsequent operations; and if the detection result is determined to be illegal, transferring the target file to a recycling bin, feeding back a deletion response to the third-party application to prompt the third party to continue to execute subsequent operations, and recovering the target file from the recycling bin after the subsequent operations are executed. The method and the device are beneficial to improving the security and the flexibility of file protection of the mobile terminal.

Description

File processing method and related device
Technical Field
The present application relates to the field of electronic technologies, and in particular, to a file processing method and a related apparatus.
Background
With the rapid development and the increasing popularity of the technology of the intelligent terminal (such as a smart phone), the technology of the intelligent terminal is now an indispensable electronic product in the daily life of users. Part of third-party software of the intelligent terminal can delete application-related files such as a system photo album and the like by mistake, even delete a root directory folder, so that user data is permanently lost, and user experience is influenced.
Disclosure of Invention
The embodiment of the application provides a file processing method and a related device, which are beneficial to improving the security and the flexibility of file protection of a mobile terminal.
In a first aspect, an embodiment of the present application provides a file processing method, including:
when a deletion request of a third-party application of the mobile terminal for a target file is detected, determining the file type of the target file;
when the file type is detected to be a preset file type, performing behavior validity detection on the deletion request to obtain a detection result;
if the detection result is determined to be legal, deleting the target file, and feeding back a deletion response to the third-party application to prompt the third party to continue to execute subsequent operations;
and if the detection result is determined to be illegal, transferring the target file to a recycle bin, feeding back the deletion response to the third-party application to prompt the third party to continue to execute subsequent operations, and recovering the target file from the recycle bin after the subsequent operations are executed.
In a second aspect, an embodiment of the present application provides a file processing apparatus, including a determination unit, a detection unit, a deletion unit, and a transfer unit, wherein,
the determining unit is used for determining the file type of the target file when detecting a deletion request of a third-party application of the mobile terminal for the target file;
the detection unit is used for performing behavior validity detection on the deletion request to obtain a detection result when detecting that the file type is a preset file type;
the deleting unit is used for deleting the target file if the detection result is determined to be legal, and feeding a deleting response back to the third-party application to prompt the third party to continue to execute subsequent operations;
the transfer unit is configured to transfer the target file to a recycle bin if the detection result is determined to be illegal, feed back the deletion response to the third-party application to prompt the third party to continue to perform subsequent operations, and recover the target file from the recycle bin after the subsequent operations are performed.
In a third aspect, an embodiment of the present application provides a mobile terminal, including a processor, a memory, a communication interface, and one or more programs, where the one or more programs are stored in the memory and configured to be executed by the processor, and the program includes instructions for executing steps of any method in the first aspect of the embodiment of the present application.
In a fourth aspect, the present application provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program for electronic data exchange, where the computer program makes a computer perform part or all of the steps described in any one of the methods of the first aspect of the present application.
It can be seen that, in the embodiment of the present application, when detecting a deletion request of a third-party application of the mobile terminal for a target file, the mobile terminal determines a file type of the target file, and when detecting that the file type is a preset file type, performs behavior validity detection on the deletion request to obtain a detection result, and if determining that the detection result is legal, deletes the target file, and feeds back a deletion response to the third-party application to prompt the third party to continue to execute subsequent operations, and if determining that the detection result is illegal, transfers the target file to a recycle bin, and feeds back the deletion response to the third-party application to prompt the third party to continue to execute the subsequent operations, and recovers the target file from the recycle bin after the subsequent operations are completed. The method has the advantages that the mobile terminal can detect the legality of the file of the deletion request at this time by the home terminal according to the file deletion request of the third-party application, delete the target file under the legal condition and feed back the deletion response to ensure the normal operation of the third-party application, timely transfer the target file under the illegal condition to avoid the mistaken deletion of the target file, feed back the deletion response to ensure the normal operation of the third-party application, and reply the target file after the subsequent operation of the third-party application is completed, so that the target file cannot be timely searched due to position transfer is avoided, the safety and intelligence of file protection of the mobile terminal are improved, and the operation stability of the application is effectively ensured.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments or the background art of the present application, the drawings required to be used in the embodiments or the background art of the present application will be described below.
FIG. 1A is a schematic diagram of a program runtime space of a smart phone;
FIG. 1B is a system architecture diagram of an android system;
FIG. 2 is a schematic flowchart of a document processing method according to an embodiment of the present application;
FIG. 3 is a schematic flow chart diagram of another document processing method disclosed in an embodiment of the present application;
FIG. 4 is a schematic flow chart diagram of another document processing method disclosed in an embodiment of the present application;
fig. 5 is a schematic structural diagram of a mobile terminal disclosed in an embodiment of the present application;
fig. 6 is a block diagram illustrating functional units of a mobile terminal according to an embodiment of the present disclosure;
fig. 7 is a schematic structural diagram of a smart phone disclosed in an embodiment of the present application.
Detailed description of the invention
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only partial embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The following are detailed below.
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, structure, 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.
As shown in fig. 1A, a current mobile terminal such as a smart phone is generally provided with a program running space, where the program running space includes a user space and an operating system space, where the user space runs one or more application programs, and the one or more application programs are third-party application programs installed on the mobile terminal.
The mobile terminal can specifically run an Android system, a mobile operating system iOS developed by apple Inc., and the like, and the mobile terminal is not limited herein. As shown in fig. 1B, for example, the mobile terminal runs an Android system, the corresponding user space includes an Application layer (Applications) in the Android system, and the operating system space may include an Application Framework layer (Application Framework) in the Android system, a system Runtime library layer (including system Runtime Libraries and Android Runtime runtimes), and a Linux Kernel layer (Linux Kernel). The application layer comprises various application programs which are directly interacted with the user or service programs which are written by Java language and run in the background. For example, programs that implement common basic functions on smartphones, such as Short Messaging Service (SMS) SMS, phone dialing, picture viewer, calendar, games, maps, World Wide Web (Web) browser, and other applications developed by developers. The application framework layer provides a series of class libraries required by Android application development, can be used for reusing components, and can also realize personalized extension through inheritance. And the system operation library layer is a support of an application program framework and provides services for each component in the Android system. The system operation library layer is composed of a system class library and Android operation. The Android runtime comprises two parts, namely a core library and a Dalvik virtual machine. The Linux kernel layer is used for realizing core functions such as hardware device driving, process and memory management, a network protocol stack, power management, wireless communication and the like.
Mobile terminals may include various handheld devices, vehicle-mounted devices, wearable devices (e.g., smartwatches, smartbands, pedometers, etc.), computing devices or other processing devices connected to wireless modems, as well as various forms of User Equipment (UE), Mobile Stations (MS), terminal Equipment (terminal device), and so forth, having wireless communication capabilities. For convenience of description, the above-mentioned devices are collectively referred to as a mobile terminal. The following describes embodiments of the present application in detail.
Referring to fig. 2, fig. 2 is a schematic flowchart of a file processing method provided in an embodiment of the present application, and the file processing method is applied to a mobile terminal, and includes:
s201, when detecting a deletion request of a third-party application of the mobile terminal for a target file, the mobile terminal determines the file type of the target file;
the third-party application comprises various applications installed in the using process of the mobile terminal, such as an instant messaging application, a browser application and the like.
The file type of the target file may be, for example, a photo, a system file, an internal storage space file, etc., and may be preset by a user, and the target file may be classified according to a directory of the file to which the target file belongs, or classified according to a function thereof, etc., which is not limited uniquely.
S202, when the mobile terminal detects that the file type is a preset file type, performing behavior validity detection on the deletion request to obtain a detection result;
s203, if the mobile terminal determines that the detection result is legal, deleting the target file, and feeding back a deletion response to the third party application to prompt the third party to continue to execute subsequent operations;
the subsequent operations executed by the third-party application may be various, and specifically, the subsequent operations are related to the function currently running by the third-party application, for example, when the third-party application is executing version update, the version update process needs to execute multi-step operations, where deleting the target file is one of the multi-step operations, and the operation after deleting the target file is the subsequent operation.
S204, if the mobile terminal determines that the detection result is illegal, the target file is transferred to a recycling bin, the deletion response is fed back to the third party application to enable the third party to continue to execute subsequent operations, and the target file is recovered from the recycling bin after the subsequent operations are executed.
It can be seen that, in the embodiment of the present application, when detecting a deletion request of a third-party application of the mobile terminal for a target file, the mobile terminal determines a file type of the target file, and when detecting that the file type is a preset file type, performs behavior validity detection on the deletion request to obtain a detection result, and if determining that the detection result is legal, deletes the target file, and feeds back a deletion response to the third-party application to prompt the third party to continue to execute subsequent operations, and if determining that the detection result is illegal, transfers the target file to a recycle bin, and feeds back the deletion response to the third-party application to prompt the third party to continue to execute the subsequent operations, and recovers the target file from the recycle bin after the subsequent operations are completed. The method has the advantages that the mobile terminal can detect the legality of the file of the deletion request at this time by the home terminal according to the file deletion request of the third-party application, delete the target file under the legal condition and feed back the deletion response to ensure the normal operation of the third-party application, timely transfer the target file under the illegal condition to avoid the mistaken deletion of the target file, feed back the deletion response to ensure the normal operation of the third-party application, and reply the target file after the subsequent operation of the third-party application is completed, so that the target file cannot be timely searched due to position transfer is avoided, the safety and intelligence of file protection of the mobile terminal are improved, and the operation stability of the application is effectively ensured.
In one possible example, the performing, by the mobile terminal, the validity detection on the deletion request to obtain a detection result includes: the mobile terminal acquires a preset condition set, wherein the condition set comprises a plurality of conditions for judging the validity of a deleting action; executing preset operation aiming at each condition to obtain a condition detection result, wherein the preset operation comprises the steps of obtaining state information required by each condition and determining the condition detection result according to the state information; and determining the detection result of the deletion request according to the number of legal detection results in the condition detection result.
It can be seen that, in this example, since the deletion request of the third-party application for the target file needs to be analyzed in combination with the characteristics of the situation of illegally deleting the file when the user does not directly participate in the validity confirmation, generally, when the file is deleted due to a program error or the like in the background of the third-party application, a plurality of consecutive files are deleted, and taking a photo as an example, the photo of this album may be deleted in a short time, so that by multi-dimensional condition detection, it is possible to more accurately locate whether the current deletion request belongs to the illegal deletion request, avoid that the file of the mobile electronic is illegally deleted, and improve the security of file processing performed by the mobile terminal.
In one possible example, the plurality of conditions for determining the validity of the deletion behavior includes at least two of: the method comprises the steps of obtaining a target file, wherein the target file comprises a condition of quantity dimension of the target file, a condition of file continuity dimension of the target file, a condition of proportion dimension of the target file in a file directory and a condition of using heat dimension of the target file, and the file directory is a directory to which the target file belongs.
The condition of the number dimension of the target files may be, for example, that when the third-party application background requests to delete a target file, if the number of the target files requested to be deleted is greater than or equal to a preset number, the corresponding condition detection result is illegal, and if the number is less than the preset number, the corresponding condition detection result is legal.
The condition of the file continuity dimension of the target file may be, for example, that when the third-party application background requests to delete the target file, if the file continuity of the target file requested to be deleted is adjacent to each other, the corresponding condition detection result is illegal, and if the file continuity of the target file requested to be deleted is at random intervals, the corresponding condition detection result is legal.
The condition of the proportion dimension of the target file in the file directory may be, for example, that when the third-party application background requests to delete the target file, if the quantity proportion of the target file in the file directory is less than or equal to the preset proportion, the corresponding condition detection result is illegal, and if the quantity proportion of the target file in the file directory is greater than the preset proportion, the corresponding condition detection result is legal.
The condition of the usage heat dimension of the target file may be, for example, that when the third-party application background requests to delete the target file, if the usage heat of the target file is greater than or equal to the preset heat, the corresponding condition detection result is illegal, and if the usage heat of the target file is less than the preset heat, the corresponding condition detection result is legal.
Therefore, in this example, the mobile terminal can obtain an accurate detection result as much as possible in the number dimension, the file continuity temperature, the file proportion dimension, and the usage heat dimension, and the accuracy of detecting the file deletion validity is improved.
In one possible example, the performing, by the mobile terminal, the validity detection on the deletion request to obtain a detection result includes: the mobile terminal determines the file type of the target file; screening out files which accord with the deletion habit of the user from the target files through the file screening model; calculating the proportion of the file which accords with the deletion habit of the user relative to the target file; and determining the detection result of the deletion request according to the ratio.
It can be seen that in this example, since the deletion habit of the user is generally continuous and unchanged for the same type of file, for example, for a photo, the user may be used to delete an overexposed photo, a half-length photo, and the like, the files meeting the deletion habit of the user in the target file are predicted through the file screening model meeting the user habit, the occupation ratio is further calculated, the detection result is accurately identified according to the occupation ratio, the misrecognition rate is reduced, and the accuracy of detecting the validity of file deletion is improved.
In one possible example, the method further comprises: the mobile terminal acquires a file record of a user actively deleting a file; screening out file records of which the file types of the deleted files are the same as the file types of the target files from the file records; and training a preset model according to the screened file records to obtain the file screening model.
Therefore, in this example, the mobile terminal can obtain the file screening model with higher prediction accuracy through model training, so that the accuracy of file screening is improved.
Referring to fig. 3, fig. 3 is a schematic flowchart of a file processing method according to an embodiment of the present application, and the file processing method is applied to a mobile terminal. As shown in the figure, the processing method of the file comprises the following steps:
s301, when detecting a deletion request of a third-party application of the mobile terminal for a target file, the mobile terminal determines the file type of the target file;
s302, when the mobile terminal detects that the file type is a preset file type, acquiring a preset condition set, wherein the condition set comprises a plurality of conditions for judging the validity of a deletion behavior;
s303, the mobile terminal executes preset operation aiming at each condition to obtain a condition detection result, wherein the preset operation comprises the steps of obtaining state information required by each condition and determining the condition detection result according to the state information;
s304, the mobile terminal determines the detection result of the deletion request according to the number of legal detection results in the condition detection result.
S305, if the mobile terminal determines that the detection result is legal, deleting the target file, and feeding a deletion response back to the third-party application to prompt the third party to continue to execute subsequent operations;
s306, if the mobile terminal determines that the detection result is illegal, the target file is transferred to a recycling bin, the deletion response is fed back to the third-party application to prompt the third party to continue to execute subsequent operations, and the target file is recovered from the recycling bin after the subsequent operations are executed.
It can be seen that, in the embodiment of the present application, when detecting a deletion request of a third-party application of the mobile terminal for a target file, the mobile terminal determines a file type of the target file, and when detecting that the file type is a preset file type, performs behavior validity detection on the deletion request to obtain a detection result, and if determining that the detection result is legal, deletes the target file, and feeds back a deletion response to the third-party application to prompt the third party to continue to execute subsequent operations, and if determining that the detection result is illegal, transfers the target file to a recycle bin, and feeds back the deletion response to the third-party application to prompt the third party to continue to execute the subsequent operations, and recovers the target file from the recycle bin after the subsequent operations are completed. The method has the advantages that the mobile terminal can detect the legality of the file of the deletion request at this time by the home terminal according to the file deletion request of the third-party application, delete the target file under the legal condition and feed back the deletion response to ensure the normal operation of the third-party application, timely transfer the target file under the illegal condition to avoid the mistaken deletion of the target file, feed back the deletion response to ensure the normal operation of the third-party application, and reply the target file after the subsequent operation of the third-party application is completed, so that the target file cannot be timely searched due to position transfer is avoided, the safety and intelligence of file protection of the mobile terminal are improved, and the operation stability of the application is effectively ensured.
In addition, since the third-party application needs to analyze the characteristics of the situation of illegally deleting the file when the user does not directly participate in the validity confirmation for the deletion request of the target file, generally, when the third-party application background deletes the file due to a program error or the like, a plurality of continuous files are deleted, and the photo of the album may be deleted in a short time by taking the photo as an example, so that whether the current deletion request belongs to the illegal deletion request can be more accurately located through multi-dimensional condition detection, the file of the mobile electronic is prevented from being illegally deleted, and the security of file processing by the mobile terminal is improved.
Referring to fig. 4, fig. 4 is a schematic flowchart of a file processing method according to an embodiment of the present application, and the file processing method is applied to a mobile terminal. As shown in the figure, the processing method of the file comprises the following steps:
s401, when detecting a deletion request of a third party application of a mobile terminal for a target file, the mobile terminal determines the file type of the target file;
s402, when the mobile terminal detects that the file type is a preset file type, determining the file type of the target file;
s403, the mobile terminal screens out files conforming to the deletion habit of the user from the target files through the file screening model;
s404, the mobile terminal calculates the proportion of the file conforming to the deletion habit of the user relative to the target file;
s405, the mobile terminal determines the detection result of the deletion request according to the ratio.
S406, if the mobile terminal determines that the detection result is legal, deleting the target file, and feeding a deletion response back to the third-party application to prompt the third party to continue to execute subsequent operations;
s407, if the mobile terminal determines that the detection result is illegal, transferring the target file to a recycling bin, feeding back the deletion response to the third party application to prompt the third party to continue to execute subsequent operations, and recovering the target file from the recycling bin after the subsequent operations are executed.
It can be seen that, in the embodiment of the present application, when the mobile terminal detects a deletion request of a third-party application of the mobile terminal for a target file, the file type of the target file is determined, then when the file type is detected to be a preset file type, the behavioral validity of the deletion request is detected to obtain a detection result, if the detection result is determined to be legal, the target file is deleted, a deletion response is fed back to the third-party application to prompt the third party to continue to execute subsequent operations, if the detection result is determined to be illegal, the target file is transferred to a recycle bin, a deletion response is fed back to the third-party application to prompt the third party to continue to execute the subsequent operations, and the target file is recovered from the recycle bin after the subsequent operations are executed. The method has the advantages that the mobile terminal can detect the legality of the file of the deletion request at this time by the home terminal according to the file deletion request of the third-party application, delete the target file under the legal condition and feed back the deletion response to ensure the normal operation of the third-party application, timely transfer the target file under the illegal condition to avoid the mistaken deletion of the target file, feed back the deletion response to ensure the normal operation of the third-party application, and reply the target file after the subsequent operation of the third-party application is completed, so that the target file cannot be timely searched due to position transfer is avoided, the safety and intelligence of file protection of the mobile terminal are improved, and the operation stability of the application is effectively ensured.
In addition, due to the fact that the deleting habit of the user is generally continuous and unchangeable for the same type of files, for example, the user may be used to delete overexposed photos, half-length photos and the like, the files meeting the deleting habit of the user in the target files are predicted through the file screening model meeting the user habit, the occupation ratio is calculated, the detection result is accurately identified according to the occupation ratio, the false identification rate is reduced, and the accuracy of file deleting validity detection is improved.
Consistent with the embodiments shown in fig. 2, fig. 3, and fig. 4, please refer to fig. 5, and fig. 5 is a schematic structural diagram of a mobile terminal provided in an embodiment of the present application, where the mobile terminal runs one or more application programs and an operating system, and as shown, the mobile terminal 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;
when a deletion request of a third-party application of the mobile terminal for a target file is detected, determining the file type of the target file;
when the file type is detected to be a preset file type, performing behavior validity detection on the deletion request to obtain a detection result;
if the detection result is determined to be legal, deleting the target file, and feeding back a deletion response to the third-party application to prompt the third party to continue to execute subsequent operations;
and if the detection result is determined to be illegal, transferring the target file to a recycle bin, feeding back the deletion response to the third-party application to prompt the third party to continue to execute subsequent operations, and recovering the target file from the recycle bin after the subsequent operations are executed.
It can be seen that, in the embodiment of the present application, when detecting a deletion request of a third-party application of the mobile terminal for a target file, the mobile terminal determines a file type of the target file, and when detecting that the file type is a preset file type, performs behavior validity detection on the deletion request to obtain a detection result, and if determining that the detection result is legal, deletes the target file, and feeds back a deletion response to the third-party application to prompt the third party to continue to execute subsequent operations, and if determining that the detection result is illegal, transfers the target file to a recycle bin, and feeds back the deletion response to the third-party application to prompt the third party to continue to execute the subsequent operations, and recovers the target file from the recycle bin after the subsequent operations are completed. The method has the advantages that the mobile terminal can detect the legality of the file of the deletion request at this time by the home terminal according to the file deletion request of the third-party application, delete the target file under the legal condition and feed back the deletion response to ensure the normal operation of the third-party application, timely transfer the target file under the illegal condition to avoid the mistaken deletion of the target file, feed back the deletion response to ensure the normal operation of the third-party application, and reply the target file after the subsequent operation of the third-party application is completed, so that the target file cannot be timely searched due to position transfer is avoided, the safety and intelligence of file protection of the mobile terminal are improved, and the operation stability of the application is effectively ensured.
In one possible example, in terms of performing the deletion behavior validity detection on the deletion request to obtain a detection result, the instructions in the program are specifically configured to perform the following operations: acquiring a preset condition set, wherein the condition set comprises a plurality of conditions for judging the legality of a deleting behavior; executing preset operation aiming at each condition to obtain a condition detection result, wherein the preset operation comprises acquiring state information required by each condition and determining the condition detection result according to the state information; and determining the detection result of the deletion request according to the number of legal detection results in the condition detection result.
In one possible example, the plurality of conditions for determining the validity of the deletion behavior includes at least two of: the method comprises the steps of obtaining a target file, wherein the target file comprises a condition of quantity dimension of the target file, a condition of file continuity dimension of the target file, a condition of proportion dimension of the target file in a file directory and a condition of using heat dimension of the target file, and the file directory is a directory to which the target file belongs.
In one possible example, in terms of performing the deletion behavior validity detection on the deletion request to obtain a detection result, the instructions in the program are specifically configured to perform the following operations: acquiring a file screening model adapted to the file type; screening files meeting the deletion habit of the user from the target files through the file screening model; calculating the proportion of the file conforming to the deletion habit of the user relative to the target file; and determining the detection result of the deletion request according to the ratio.
In one possible example, the method further comprises: acquiring a file record of a user actively deleting a file; screening out file records of which the file types of the deleted files are the same as the file types of the target files from the file records; and training a preset model according to the screened file records to obtain the file screening model.
The above embodiments mainly introduce the scheme of the embodiments of the present application from the perspective of the method-side implementation process. It is understood that the mobile terminal includes hardware structures and/or software modules for performing the respective functions in order to implement the above-described functions. Those of skill in the art would readily appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as hardware or combinations of hardware and computer software. Whether a function is performed as hardware or computer software drives hardware depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiment of the present application, the mobile terminal may be divided into the functional units according to the method example, for example, each functional unit may be divided corresponding to each function, or two or more functions may be integrated into one processing unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit. It should be noted that the division of the unit in the embodiment of the present application is schematic, and is only a logic function division, and there may be another division manner in actual implementation.
The following is an embodiment of the apparatus of the present invention, which is used to perform the method implemented by the embodiment of the method of the present invention. As shown in fig. 6, the mobile terminal may include a determination unit 601, a detection unit 602, a deletion unit 603, and a transfer unit 604, wherein,
the determining unit 601 is configured to determine a file type of a target file when a deletion request of a third-party application of the mobile terminal for the target file is detected;
the detecting unit 602 is configured to perform behavior validity detection on the deletion request to obtain a detection result when detecting that the file type is a preset file type;
the deleting unit 603 is configured to delete the target file if it is determined that the detection result is legal, and feed a deletion response back to the third-party application to prompt the third party to continue to perform subsequent operations;
the transferring unit 604 is configured to transfer the target file to a recycle bin if it is determined that the detection result is illegal, feed back the deletion response to the third-party application to prompt the third party to continue to perform subsequent operations, and recover the target file from the recycle bin after the subsequent operations are performed.
It can be seen that, in the embodiment of the present application, when detecting a deletion request of a third-party application of the mobile terminal for a target file, the mobile terminal determines a file type of the target file, and when detecting that the file type is a preset file type, performs behavior validity detection on the deletion request to obtain a detection result, and if determining that the detection result is legal, deletes the target file, and feeds back a deletion response to the third-party application to prompt the third party to continue to execute subsequent operations, and if determining that the detection result is illegal, transfers the target file to a recycle bin, and feeds back the deletion response to the third-party application to prompt the third party to continue to execute the subsequent operations, and recovers the target file from the recycle bin after the subsequent operations are completed. The method has the advantages that the mobile terminal can detect the legality of the file of the deletion request at this time by the home terminal according to the file deletion request of the third-party application, delete the target file under the legal condition and feed back the deletion response to ensure the normal operation of the third-party application, timely transfer the target file under the illegal condition to avoid the mistaken deletion of the target file, feed back the deletion response to ensure the normal operation of the third-party application, and reply the target file after the subsequent operation of the third-party application is completed, so that the target file cannot be timely searched due to position transfer is avoided, the safety and intelligence of file protection of the mobile terminal are improved, and the operation stability of the application is effectively ensured.
In a possible example, in the aspect of performing the deletion behavior validity detection on the deletion request to obtain the detection result, the detection unit is specifically configured to: acquiring a preset condition set, wherein the condition set comprises a plurality of conditions for judging the legality of a deleting behavior; executing preset operation aiming at each condition to obtain a condition detection result, wherein the preset operation comprises acquiring state information required by each condition and determining the condition detection result according to the state information; and determining the detection result of the deletion request according to the number of legal detection results in the condition detection result.
In one possible example, the plurality of conditions for determining the validity of the deletion behavior includes at least two of: the method comprises the steps of obtaining a target file, wherein the target file comprises a condition of quantity dimension of the target file, a condition of file continuity dimension of the target file, a condition of proportion dimension of the target file in a file directory and a condition of using heat dimension of the target file, and the file directory is a directory to which the target file belongs.
In a possible example, in the aspect of performing the deletion behavior validity detection on the deletion request to obtain the detection result, the detection unit is specifically configured to: acquiring a file screening model adapted to the file type; screening out files which accord with the deletion habit of the user from the target files through the file screening model; calculating the proportion of the file conforming to the deletion habit of the user relative to the target file; and determining the detection result of the deletion request according to the proportion.
In one possible example, the apparatus further comprises: an acquisition unit, a screening unit and a training unit, wherein,
the acquisition unit is used for acquiring the file record of the file actively deleted by the user;
the screening unit is used for screening out file records of which the file types of the deleted files are the same as the file types of the target files from the file records;
and the training unit is used for training a preset model according to the screened file records to obtain the file screening model.
Among them, the determination unit 601, the detection unit 602, the deletion unit 603, and the transfer unit 604 may be processors.
Referring to fig. 7, fig. 7 is a schematic structural diagram of a mobile terminal according to the present application, where the mobile terminal 700 includes: housing 710, circuit board 720, battery 730, cover 740, drop sensor 750, transceiver 760, display screen 770, and controller 780 that controls drop sensor 750, transceiver 760, and display screen 770; a cover 740 is provided on the housing 710, a fall sensor 750, a transceiver 760 and a controller 780 are provided on the circuit board 720, and a display 770 is connected to the controller 780, wherein the fall sensor 750 includes an acceleration sensor, a gyroscope, a timer, and the like.
The method comprises the steps that when the mobile terminal detects a deletion request of a third-party application of the mobile terminal for a target file, the file type of the target file is determined; when the file type is detected to be a preset file type, performing behavior validity detection on the deletion request to obtain a detection result; if the detection result is determined to be legal, deleting the target file, and feeding back a deletion response to the third party application to prompt the third party to continue to execute subsequent operations; and if the detection result is determined to be illegal, transferring the target file to a recycling bin, feeding back a deletion response to the third-party application to prompt the third party to continue to execute subsequent operations, and recovering the target file from the recycling bin after the subsequent operations are executed.
The display screen 770 includes a touch screen and a display screen, and the display screen includes an organic light emitting diode display screen OLED.
The controller 780 may include a processor, which is a control center of the mobile terminal, and a memory, which is connected to various parts of the entire mobile terminal through various interfaces and lines, and performs various functions of the mobile terminal and processes data by operating or executing software programs and/or modules stored in the memory and calling data stored in the memory, thereby monitoring the mobile terminal as a whole. Optionally, the processor may integrate an application processor and a modem processor, wherein the application processor mainly handles an operating system, a user interface, application programs, and the like, and the modem processor mainly handles wireless communication. It will be appreciated that the modem processor may not be integrated into the processor.
The memory can be used for storing software programs and modules, and the processor executes various functional applications and data processing of the mobile terminal by running the software programs and modules stored in the memory. The memory may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function, and the like; the storage data area may store data created according to the use of the mobile terminal, and the like. Further, the memory may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
Embodiments of the present application also provide a computer storage medium, where 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 methods described in the above method embodiments, and the computer includes a mobile terminal.
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 methods as described in the above method embodiments. The computer program product may be a software installation package, the computer comprising a mobile terminal.
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 preferred 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 above-described division of the units is only one type of division of logical functions, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. 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 can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit may be stored in a computer readable memory if it is implemented in the form of a software functional unit and sold or used as a stand-alone product. 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 mobile terminal, or a network device) to execute all or part of the steps of the above-mentioned method of 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 (6)

1. A file processing method, comprising:
when a deletion request of a third-party application of the mobile terminal for a target file is detected, determining the file type of the target file;
when the file type is detected to be a preset file type, acquiring a preset condition set, wherein the condition set comprises a plurality of conditions for judging the validity of a deletion behavior, and the conditions for judging the validity of the deletion behavior comprise at least two of the following conditions: the method comprises the following steps of (1) a condition of quantity dimension of a target file, a condition of file continuity dimension of the target file, a condition of proportion dimension of the target file in a file directory and a condition of using heat dimension of the target file, wherein the file directory is a directory to which the target file belongs;
executing a preset operation aiming at each condition to obtain a condition detection result, wherein the preset operation comprises the steps of obtaining state information required by each condition, and performing behavior validity detection on the deletion request according to the state information to obtain a detection result; alternatively, the first and second electrodes may be,
obtaining a file screening model adapted to the file type; screening files meeting the deletion habit of the user from the target files through the file screening model; calculating the proportion of the file which accords with the deletion habit of the user relative to the target file; determining to perform behavior validity detection on the deletion request according to the proportion to obtain a detection result;
if the detection result is determined to be legal, deleting the target file, and feeding back a deletion response to the third-party application to prompt the third party to continue to execute subsequent operations;
and if the detection result is determined to be illegal, transferring the target file to a recycle bin, feeding back the deletion response to the third-party application to prompt the third party to continue to execute subsequent operations, and recovering the target file from the recycle bin after the subsequent operations are executed.
2. The method of claim 1, further comprising:
acquiring a file record of a user actively deleting a file;
screening out file records of which the file types of the deleted files are the same as the file types of the target files from the file records;
and training a preset model according to the screened file records to obtain the file screening model.
3. A file processing apparatus comprising a determination unit, a detection unit, a deletion unit, and a transfer unit, wherein,
the determining unit is used for determining the file type of the target file when detecting a deletion request of a third-party application of the mobile terminal for the target file;
the detection unit is configured to, when detecting that the file type is a preset file type, obtain a preset condition set, where the condition set includes a plurality of conditions for determining validity of a deletion behavior, and the plurality of conditions for determining validity of the deletion behavior include at least two of the following conditions: the method comprises the following steps of (1) a condition of quantity dimension of a target file, a condition of file continuity dimension of the target file, a condition of proportion dimension of the target file in a file directory and a condition of using heat dimension of the target file, wherein the file directory is a directory to which the target file belongs; executing a preset operation aiming at each condition to obtain a condition detection result, wherein the preset operation comprises the steps of obtaining state information required by each condition, and performing behavior validity detection on the deletion request according to the state information to obtain a detection result; or, a file screening model adapted to the file type is obtained; screening out files which accord with the deletion habit of the user from the target files through the file screening model; calculating the proportion of the file which accords with the deletion habit of the user relative to the target file; determining to perform behavior validity detection on the deletion request according to the proportion to obtain a detection result;
the deleting unit is used for deleting the target file if the detection result is determined to be legal, and feeding a deleting response back to the third-party application to prompt the third party to continue to execute subsequent operations;
the transfer unit is configured to transfer the target file to a recycle bin if the detection result is determined to be illegal, feed back the deletion response to the third-party application to prompt the third party to continue to perform subsequent operations, and recover the target file from the recycle bin after the subsequent operations are performed.
4. The apparatus of claim 3, further comprising: an acquisition unit, a screening unit and a training unit, wherein,
the acquisition unit is used for acquiring the file record of the file actively deleted by the user;
the screening unit is used for screening out file records of which the file types of the deleted files are the same as the file types of the target files from the file records;
and the training unit is used for training a preset model according to the screened file records to obtain the file screening model.
5. A mobile terminal comprising a processor, memory, a communications interface, and one or more programs stored in the memory and configured for execution by the processor, the programs including instructions for performing the steps in the method of claim 1 or 2.
6. A computer-readable storage medium, characterized in that a computer program for electronic data exchange is stored, wherein the computer program causes a computer to perform the method according to claim 1 or 2.
CN201810469287.0A 2018-05-16 2018-05-16 File processing method and related device Active CN108733797B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810469287.0A CN108733797B (en) 2018-05-16 2018-05-16 File processing method and related device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810469287.0A CN108733797B (en) 2018-05-16 2018-05-16 File processing method and related device

Publications (2)

Publication Number Publication Date
CN108733797A CN108733797A (en) 2018-11-02
CN108733797B true CN108733797B (en) 2022-06-07

Family

ID=63938429

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810469287.0A Active CN108733797B (en) 2018-05-16 2018-05-16 File processing method and related device

Country Status (1)

Country Link
CN (1) CN108733797B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109885171B (en) * 2019-02-26 2023-05-16 维沃移动通信有限公司 File operation method and terminal equipment
CN110187893B (en) * 2019-05-21 2023-12-08 维沃移动通信有限公司 Method for deleting application, mobile terminal and computer readable storage medium
CN110276205B (en) * 2019-06-06 2021-06-15 深圳市杰科数码有限公司 Method and system for generating product serial number file, electronic device and storage medium
CN110489384A (en) * 2019-07-23 2019-11-22 广东以诺通讯有限公司 A kind of memory space optimization method and terminal based on terminal study
CN110888847B (en) * 2019-12-16 2023-04-21 新华三技术有限公司成都分公司 Recycle bin system and file recycling method
CN112286866A (en) * 2020-10-23 2021-01-29 星辰天合(北京)数据科技有限公司 Data processing method and device, electronic equipment and computer readable storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105653397A (en) * 2015-09-30 2016-06-08 宇龙计算机通信科技(深圳)有限公司 Recovery processing method, apparatus and electronic device
CN106709034A (en) * 2016-12-29 2017-05-24 广东欧珀移动通信有限公司 File protection method and apparatus, and terminal

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9098370B2 (en) * 2010-11-08 2015-08-04 Cbs Interactive, Inc. Apparatus and methods for improving uninstall process
KR101605156B1 (en) * 2014-12-11 2016-03-21 네이버비즈니스플랫폼 주식회사 Device, method, and computer for providing file deleting service

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105653397A (en) * 2015-09-30 2016-06-08 宇龙计算机通信科技(深圳)有限公司 Recovery processing method, apparatus and electronic device
CN106709034A (en) * 2016-12-29 2017-05-24 广东欧珀移动通信有限公司 File protection method and apparatus, and terminal

Also Published As

Publication number Publication date
CN108733797A (en) 2018-11-02

Similar Documents

Publication Publication Date Title
CN108733797B (en) File processing method and related device
CN108829477B (en) Interface jump method, device, computer equipment and storage medium
CN107729836B (en) Face recognition method and related product
CN106778248B (en) Method and device for starting application program Activity
EP3493059A1 (en) Application data migration method and device
CN107807852B (en) Application program performance control method, device and computer readable storage medium
CN107197462B (en) Wireless network type detection method and device and electronic equipment
CN106709341B (en) A kind for the treatment of method of virus and device for file packet
WO2014032509A1 (en) Data transfer method and system
CN108984339B (en) Data recovery method and related product
CN108540509B (en) Processing method and device of terminal browser, server and intelligent terminal
CN110990825B (en) Method and device for binding recommender and recommended person, storage medium and electronic equipment
CN106599115B (en) Data protection method, device and terminal
CN108737655B (en) Picture processing method and related device
CN108762983B (en) Multimedia data recovery method and device
CN108763357B (en) File processing method and related device
CN108804258B (en) Data recovery method and device, mobile terminal and storage medium
CN103365672A (en) Method and system for processing description information of application program
CN106293814B (en) Upgrading method and device
CN108897639B (en) File processing method and device
CN111104142A (en) Software upgrading method and device, electronic equipment and storage medium
CN108874586B (en) Data recovery method and related product
CN108762985B (en) Data recovery method and related product
CN105610596A (en) Resource directory management method and network terminal
CN109151557B (en) Video creation method and related device

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