CN104133544B - Document handling method, device and terminal - Google Patents

Document handling method, device and terminal Download PDF

Info

Publication number
CN104133544B
CN104133544B CN201310375907.1A CN201310375907A CN104133544B CN 104133544 B CN104133544 B CN 104133544B CN 201310375907 A CN201310375907 A CN 201310375907A CN 104133544 B CN104133544 B CN 104133544B
Authority
CN
China
Prior art keywords
file
event
directory
sequence
events
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
CN201310375907.1A
Other languages
Chinese (zh)
Other versions
CN104133544A (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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201310375907.1A priority Critical patent/CN104133544B/en
Publication of CN104133544A publication Critical patent/CN104133544A/en
Application granted granted Critical
Publication of CN104133544B publication Critical patent/CN104133544B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Storage Device Security (AREA)

Abstract

The invention discloses a kind of document handling method, device and terminal, belong to computer realm.Described method comprises: monitor at least one file event corresponding with file, and the type of this file is the type of the file that specified application generates; Corresponding sequence of events is obtained according to the file event listened to; Whether the file event detected in sequence of events meets the first predetermined condition; If testing result is the file event in sequence of events meet the first predetermined condition, then predetermined process is carried out to this file.The present invention is by monitoring the file event corresponding with the file of particular type, obtain the sequence of events that file is corresponding, and when the file event in sequence of events meets predetermined condition, predetermined process is carried out to file detecting, solve in prior art and need user manually to complete processing procedure, thus waste user time, the problem of the electricity of a large amount of consumption terminal, reaches and saves processing time and terminal power, improves the object of terminal duration performance.

Description

File processing method and device and terminal
Technical Field
The present invention relates to the field of computers, and in particular, to a file processing method, device and terminal.
Background
With the continuous development of the field of mobile terminals, mobile terminals such as smart phones, tablet computers, electronic book readers and the like have become essential parts in the life of people. Through a mobile terminal with a specific function, people can record a droplet in life in a file such as a text, a picture, a video or an audio, and the like anytime and anywhere, for example, writing a log, taking several photos, recording a video or an audio.
For the purpose of protecting the privacy of the user, the mobile terminal generally provides processing options such as encryption or hiding for the user's files. The existing file processing method is mainly realized manually by a user. For example, taking the example that the user encrypts the shot photos, after the user uses the mobile terminal including the camera to shoot one or more photos, the user enters the album in the mobile terminal to find the just shot photo, clicks the call-out menu, and selects the encryption option to complete the encryption processing of the photo.
In the process of implementing the invention, the inventor finds that the prior art has at least the following problems:
the existing file processing method needs a user to manually complete processes of searching files, processing the files and the like, and particularly when the files needing to be processed are large, the user needs to process the files respectively, so that a large amount of time is wasted for the user, and meanwhile, a large amount of electric quantity of a terminal is consumed, and the endurance of the terminal is influenced.
Disclosure of Invention
In order to solve the problem that in the prior art, a user needs to manually complete a processing process, so that a large amount of time is wasted for the user and a large amount of electric quantity of a terminal is consumed, embodiments of the present invention provide a file processing method, an apparatus and a terminal. The technical scheme is as follows:
in one aspect, a file processing method is provided, and the method includes:
monitoring at least one file event corresponding to a file, wherein the type of the file is the type of the file generated by a specified application program, and each file event is used for representing a single operation on the file;
obtaining an event sequence corresponding to the file according to the at least one file event monitored;
detecting whether file events in the event sequence meet a first preset condition or not;
and if the detection result is that the file events in the event sequence meet the first preset condition, performing preset processing on the file.
In another aspect, there is provided a document processing apparatus, the apparatus including:
the event monitoring module is used for monitoring at least one file event corresponding to a file, wherein the type of the file is the type of the file generated by a specified application program, and each file event is used for representing a single operation on the file;
an event sequence obtaining module, configured to obtain an event sequence corresponding to the file according to the at least one file event monitored by the event monitoring module;
the first detection module is used for detecting whether the file events in the event sequence obtained by the event sequence obtaining module meet a first preset condition or not;
and the processing module is used for performing preset processing on the file if the detection result of the first detection module indicates that the file event in the event sequence meets the first preset condition.
In another aspect, a terminal is provided, where the terminal includes:
a document processing apparatus as in the other aspect above.
The technical scheme provided by the embodiment of the invention has the following beneficial effects:
the method and the device have the advantages that the file events corresponding to the files of the specific types are monitored, the event sequences corresponding to the files are obtained, and the files are subjected to scheduled processing when the file events in the event sequences meet the scheduled conditions, so that the problems that in the prior art, a user needs to manually complete the processing process, the user time is wasted, the electric quantity of the terminal is greatly consumed are solved, and the purposes of saving the processing time and the electric quantity of the terminal and improving the endurance performance of the terminal are achieved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a flowchart of a method of processing a document according to an embodiment of the present invention;
FIG. 2 is a flowchart of a file processing method according to a second embodiment of the present invention;
FIG. 3 is a diagram showing an apparatus structure of a document processing apparatus according to a third embodiment of the present invention;
FIG. 4 is a diagram showing an apparatus structure of a document processing apparatus according to a fourth embodiment of the present invention;
fig. 5 is a device configuration diagram of a terminal according to a fifth embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, embodiments of the present invention will be described in detail with reference to the accompanying drawings.
Example one
Referring to fig. 1, a flowchart of a method for processing a file according to an embodiment of the present invention is shown. The file processing method can comprise the following steps:
step 102, monitoring at least one file event corresponding to a file, wherein the type of the file comprises the type of the file generated by a specified application program, and each file event is used for representing a single operation on the file;
104, obtaining an event sequence corresponding to the file according to the monitored at least one file event;
step 106, detecting whether the file events in the event sequence meet a first preset condition;
step 108, if the detection result is that the file event in the event sequence meets the first predetermined condition, performing predetermined processing on the file.
In summary, in the file processing method provided in the embodiment of the present invention, the file event corresponding to the specific type of file is monitored to obtain the event sequence corresponding to the file, and the file is subjected to the predetermined processing when it is detected that the file event in the event sequence satisfies the predetermined condition, so that the problems that the user time is wasted and the electric quantity of the terminal is consumed in a large amount due to the fact that the user needs to manually complete the processing process in the prior art are solved, and the purposes of saving the processing time and the electric quantity of the terminal and improving the endurance performance of the terminal are achieved.
Example two
Based on a more preferable scheme of the file processing method provided by the first embodiment, please refer to fig. 2, which shows a method flowchart of the file processing method provided by the second embodiment of the present invention. The file processing method can be used for encrypting or hiding files in a terminal, the files can be documents, pictures, videos or audios and the like, and the terminal can be a mobile terminal such as a smart phone, a tablet computer, an electronic book reader or a digital camera. Taking an example of encrypting a shot photo in a smart phone including an image acquisition unit, the file processing method may include:
step 202, the terminal acquires an identifier of an application program at the stack top of a current operating system, and detects whether the acquired identifier of the application program is matched with an identifier of a specified application program;
specifically, when the file to be processed is a photograph just taken, the specified application program may be a camera program in a smartphone. In the smart phone, an application program at the top of a current operating system stack is usually displayed on the top layer of a screen of the smart phone, so that a terminal can start a stack top scanning thread for monitoring the change of the top of the operating system stack, when the application program at the top of the stack is monitored to be changed, an identifier of the application program at the top of the stack, such as the name of the application program, is obtained, whether the name of the application program is matched with the name of a camera program in the smart phone is detected, if the name of the application program is detected to be matched with the name of the camera program in the smart phone, it is indicated that the camera program in the smart phone is in an open state, and at the moment, if a newly generated picture type file is monitored, the newly generated picture type file can be determined to be a photo to be processed.
Step 204, if the obtained identifier of the application program is matched with the identifier of the specified application program, the terminal determines an effective directory;
for example, a user may manually change a storage directory of a newly-taken photo, and monitoring file events in all storage directories in the smart phone wastes too many resources and is not easy to implement. Therefore, before monitoring the picture file corresponding to the newly-taken picture, it is necessary to determine the active directory that the camera program may use to store the newly-taken picture, and only monitor the active directory for the file event. Specifically, the terminal may determine a storage directory meeting a second predetermined condition under the current operating system as an active directory, where the second predetermined condition may be one or a combination of two or more of the following three conditions:
1) the storage directory is in a non-hidden state;
since the camera program does not usually hide the storage directory, the terminal may listen only to the non-hidden storage directory.
2) The storage directory is located at a level less than a predetermined level;
in general, the number of hierarchies is not too high whether the default storage directory of the camera program or the storage directory manually set by the user, so the terminal may preset a predetermined hierarchy, for example, set the predetermined hierarchy to 5, and listen to the directory with the hierarchy number less than 5 as an active directory that the camera program may use to store a newly taken picture, while the storage directory with the hierarchy number greater than or equal to 5 is ignored.
3) The storage directory is a directory that the specified application program was last stored.
The directory storing the newly taken picture may not be changed between the last time the camera program takes the picture and the current time the camera program takes the picture, so that the terminal records the storage directory storing the newly taken picture in the camera program when the terminal last listens for a file event, and determines the recorded directory as an effective directory when the terminal this time listens.
By determining the effective directory, the terminal can avoid consuming too many resources while expanding the monitoring range as much as possible, and the terminal performance is improved.
Step 206, the terminal monitors each file event corresponding to the file in the active directory, filters the monitored file events, and adds the filtered file events into the event sequence corresponding to the file;
many types of files may be contained in the effective directory, not all types of files meet the requirements, and the event sequence corresponding to the file is acquired only when the type of the file is consistent with that of the file generated by the specified application program.
For example, in the second embodiment of the present invention, a photo newly taken by a camera program must be in a picture format, and a terminal may detect a format type of a file corresponding to a monitored file event, and if the file is not in a picture format such as BMP (Bitmap), JPEG (joint photographic experts group), or GIF (graphics interchange format), an event sequence corresponding to the file is not acquired.
In addition, there may be many file events corresponding to one file, and not all file events may be used to detect whether to process the file, and even if all the monitored file events are added to the event sequence, the terminal needs to select a part of the file events to detect in the subsequent process of detecting whether to process the file. If all file events are added into the event sequence, the file events which are not suitable for detection occupy too much memory resources, and a certain processing resource is additionally consumed in the subsequent process of detecting whether the file can be processed according to the file events in the event sequence because the file events which are not suitable for detection are contained in the event sequence. In order to reduce the consumption of memory and processing resources and improve the system performance, the type of the file event monitored by the terminal needs to be limited.
Specifically, for example, in the second embodiment of the present invention, the criterion for determining whether to process the photo generated by the camera program is that the photo is a newly taken photo, and for a newly taken photo, the generation process of a picture file is necessarily accompanied, and the generation process of the picture file corresponding to the photo mainly includes the following types of file events: create event Create, Open event Open, Modify event Modify, Close event Close, and Move To specified directory event Move To. In addition, the system may generate some events unrelated to the picture file generation process, such as Access event Access generated when the file is accessed, Move _ From specified directory event, negligible event generated when the monitoring item itself is terminated or removed, overflow event generated when the system is busy to cause file event overflow, directory related event generated when the directory is created or deleted, and the like. When monitoring file events, the terminal can be preset to monitor only 5 types of file events related to the generation process of the picture file, and the other types of file events are ignored.
Secondly, even the 5 types of file events may include situations that are not suitable for detecting whether to process the file, and further filtering the monitored predetermined type of file event is needed, for example, the terminal may monitor the predetermined type of file event corresponding to the file and detect whether to perform the predetermined processing on the file corresponding to the monitored predetermined type of file event currently; and if the detection result is that the monitored file corresponding to the file event of the preset type is not subjected to preset processing currently, adding the file event into the event sequence corresponding to the file.
In the second embodiment of the present invention, the predetermined processing performed by the terminal on the photo generated by taking the photo may include encrypting or hiding the photo. However, in the process of encrypting or hiding the photo, operations such as opening, modifying or closing the file may be involved, and file events such as an opening event, a modifying event or a closing event may be generated correspondingly.
Specifically, the terminal may record an identifier of a file undergoing a predetermined process, for example, a name or an ID (IDentity) of a photo, compare the name or the ID of the file corresponding to the file event with the name or the ID of the recorded file when the file event is monitored, and filter the file event if the name or the ID of the file corresponding to the file event is matched with the name or the ID of the recorded file.
Step 208, the terminal detects whether the file event in the event sequence meets a first predetermined condition;
after obtaining the filtered event sequence, the terminal may detect whether a file event in the event sequence meets a first predetermined condition, where the first predetermined condition may include one of the following two conditions:
1) the event sequence comprises a move-in appointed directory event;
the specified directory may be an active directory currently monitored by the terminal, and before the application program moves a file from outside the active directory into the active directory currently monitored, the operation processes of creating, opening, modifying, closing and the like of the file are usually completed under the original directory of the file, so that when an event sequence of a file contains an event of moving in the specified directory, other types of file events are often not included, and therefore, when the event sequence contains an event of moving in the specified directory, the file corresponding to the event sequence can be considered to be subjected to predetermined processing.
2) The event sequence comprises a creation event and at least one modification event, and the number of opening events and closing events contained in the event sequence is the same;
if the event sequence of a file contains a creation event, the file is indicated as a newly generated file, and if the event sequence only contains the creation event but does not contain a modification event, the newly created file is indicated as an empty file without being modified, and predetermined processing is not required. Therefore, the terminal may detect whether at least one modification event is further included in the event sequence when the creation event is included in the event sequence, and if so, determine that the file is not an empty file.
In addition, modifying a file requires opening and closing the file, and accordingly, an opening event and a closing event are necessarily generated, and when a file is in an open state, the file may not be modified, or some specific processing cannot be performed on the file in the open state, for example, the file in the open state cannot be encrypted. Therefore, the terminal needs to detect whether the file is in a closed state, specifically, the terminal may detect whether an open event and a close event in an event sequence corresponding to the file occur in pairs, for example, whether the numbers of the open event and the close event included in the event sequence are the same, and if the numbers are the same, the terminal detects that the file is in the closed state. For a newly created file, the terminal will determine it as a pending file only if the file is not an empty file and the file is in a closed state.
The method comprises the steps of detecting a combination of multiple types of file events, directly determining a file to be processed when detecting that an event sequence corresponding to the file contains a move-in appointed directory event, further detecting an opening event, a closing event and a modification event in the event sequence when detecting that the event sequence corresponding to the file contains a creation event, determining the file event as the file to be processed if detecting that the opening event and the closing event occur in pairs and at least one modification event is contained, and fully considering the specific situation in the file generating process, thereby effectively detecting whether the file can be processed or not and improving the detection accuracy.
Step 210, if the file event in the event sequence meets the first predetermined condition, the terminal performs predetermined processing on the file.
If the terminal detects that the file meets the processing condition through the file event in the event sequence, the file can be subjected to predetermined processing such as encryption or hiding.
Taking the example of encrypting a newly shot photo in a smart phone, in practical applications, the specific process of monitoring a file event and detecting whether to process the photo according to the monitored file event can be implemented as follows:
the smart phone presets the type of the file event monitored, and in the embodiment of the present invention, the preset type of the file event includes a Create event Create, an Open event Open, a Modify event Modify, a Close event Close, and a Move-in specified directory event Move _ To. It should be noted that the Close event Close can be divided into two categories: events Close _ Write that closes a writeable file or directory, or Close _ Write that closes a read-only file or directory, both of which can be classified as Close events.
Specifically, when the smart phone monitors a file event in an active directory, it first sequentially detects whether the monitored file event is a file event unrelated to the picture generation process, such as a negligible event, an overflow event, or a directory-related event.
If the file event is not a file event which is irrelevant to the picture generation process, such as an ignorable event, an overflow event or a directory-related event, whether a file corresponding to the file event is encrypted is further detected.
If the file event is not encrypted currently, the smart phone performs the following processing according to the specific type of the file event:
if the file event is a creation event, further detecting whether a file created by the file event is in a picture format, if so, correspondingly creating an information monitoring item for the file, setting an identifier of the creation event in the information monitoring item, and adding the information monitoring item into a monitoring item list;
if the file event is a moved-in appointed directory event, further detecting whether a file corresponding to the moved-in appointed directory event is in a picture format, if so, correspondingly creating an information monitoring item for the file, setting an identifier of the moved-in appointed directory event in the information monitoring item, and adding the information monitoring item into a monitoring item list;
if the file event is an opening event, searching an information monitoring item of a file corresponding to the opening event in a monitoring item list, and adding 1 to the count of the opening event;
if the file event is a closing event, searching an information monitoring item of a file corresponding to the closing event in a monitoring item list, and subtracting 1 from the count of the opening event;
if the file event is a modification event, searching the information monitoring item of the file corresponding to the modification event in the monitoring item list, and adding 1 to the count of the modification event.
While the above process is executed, the smart phone also selects a file to be encrypted according to the monitoring item list, and the specific selection methods may include the following two methods:
1) traversing the monitoring item list, and selecting files corresponding to the information monitoring items which comprise the identifiers of the created events, the count of the opened events is 0, and the count of the modified events is at least 1 as encrypted files;
2) and traversing the monitoring item list, and selecting files corresponding to the information monitoring items containing the identifiers of the moved-in appointed directory events as files to be encrypted.
And the smart phone encrypts the selected encrypted file.
It should be noted that, with the method provided in the second embodiment of the present invention, after a predetermined type of file event in an active directory is monitored, the monitored file event is distinguished by taking a file as an object, and an event sequence is respectively obtained for each file, so that respective detection of multiple files can be realized, mutual interference can be effectively avoided when different files in the same file directory are detected, and in addition, the method for respectively detecting multiple files can also simultaneously support the operation of multiple similar applications.
In summary, in the file processing method provided in the second embodiment of the present invention, the event sequence corresponding to the file is obtained by monitoring the file event corresponding to the file of the specific type, and the file is subjected to the predetermined processing when it is detected that the file event in the event sequence satisfies the predetermined condition, so that the problems that the user needs to manually complete the processing process in the prior art, thereby wasting the user time and consuming a large amount of electric quantity of the terminal are solved, and the purposes of saving the processing time and the electric quantity of the terminal and improving the endurance performance of the terminal are achieved; secondly, in the file processing method provided by the second embodiment of the present invention, by monitoring the file events of the predetermined type, filtering the monitored file events of the predetermined type, and only adding the file events suitable for detection into the event sequence, the purposes of reducing memory consumption and improving system performance are achieved; in addition, in the file processing method provided by the second embodiment of the present invention, the valid directories are determined in all the storage directories under the system, and the files in the valid directories are monitored, so that the purpose of avoiding consuming too many resources and improving the terminal performance while expanding the monitoring range as much as possible is achieved; in addition, the file processing method provided by the second embodiment of the present invention monitors files as objects, and obtains event sequences for each file, so as to be able to implement respective detection for multiple files, effectively avoid mutual interference when detecting different files in the same file directory, and provide support for the operation of multiple similar applications at the same time; finally, the file processing method provided by the second embodiment of the present invention fully considers the specific situation of file operation by detecting the combination of multiple types of file events, and can effectively detect whether the corresponding file can be processed, thereby improving the detection accuracy.
EXAMPLE III
Referring to fig. 3, a device structure diagram of a document processing device according to a third embodiment of the present invention is shown. The document processing apparatus may include:
an event monitoring module 301, configured to monitor at least one file event corresponding to a file, where the file type is a type of a file generated by a specified application program, and each file event is used to represent a single operation on the file;
an event sequence obtaining module 302, configured to obtain an event sequence corresponding to the file according to the at least one file event monitored by the event monitoring module 301;
a first detecting module 303, configured to detect whether a file event in the event sequence obtained by the event sequence obtaining module 302 meets a first predetermined condition;
a processing module 304, configured to perform predetermined processing on the file if the detection result of the first detecting module 303 is that the file event in the event sequence meets the first predetermined condition.
In summary, the file processing apparatus provided in the third embodiment of the present invention obtains the event sequence corresponding to the file by monitoring the file event corresponding to the specific type of file, and performs the predetermined processing on the file when it is detected that the file event in the event sequence satisfies the predetermined condition, so as to solve the problem that the user needs to manually complete the processing procedure in the prior art, thereby wasting the user time and consuming a large amount of electric power of the terminal, and achieve the purposes of saving the processing time and the electric power of the terminal and improving the endurance performance of the terminal.
Example four
Based on a more preferable scheme of the document processing apparatus provided in the third embodiment, please refer to fig. 4, which shows an apparatus structure diagram of the document processing apparatus provided in the fourth embodiment of the present invention. The file processing device can be implemented as a part of a terminal, and can be used for encrypting or hiding a file in the terminal, wherein the file can be a document, a picture, a video, an audio or the like, and the terminal can be a mobile terminal such as a smart phone, a tablet computer, an electronic book reader or a digital camera. The document processing apparatus may include:
an event monitoring module 401, configured to monitor at least one file event corresponding to a file, where the file type is a type of a file generated by a specified application program, and each file event is used to represent a single operation on the file;
an event sequence obtaining module 402, configured to obtain an event sequence corresponding to the file according to the at least one file event monitored by the event monitoring module 401;
a first detecting module 403, configured to detect whether a file event in the event sequence obtained by the event sequence obtaining module 402 meets a first predetermined condition;
a processing module 404, configured to perform predetermined processing on the file if the detection result of the first detecting module 403 indicates that the file event in the event sequence meets the first predetermined condition.
The device provided by the fourth embodiment of the invention monitors files as objects, acquires event sequences for each file respectively, can realize the respective detection of a plurality of files, can effectively avoid mutual interference when detecting different files in the same file directory, and can simultaneously provide support for the operation of a plurality of similar application programs by a method for respectively detecting a plurality of files.
The event monitoring module 401 is configured to monitor at least one file event of a predetermined type corresponding to the file;
the predetermined types of file events include: one of create event, open event, close event, modify event, or move into specified directory event.
The first detecting module 403 is configured to detect whether a file event in the event sequence meets the following conditions:
the event sequence comprises the immigration appointed directory event;
or,
the event sequence comprises the creation event and at least one modification event, and the number of the opening events and the number of the closing events in the event sequence are the same.
The first detection module 403 fully considers the specific situation of file operation by detecting the combination of multiple types of file events, and can effectively detect whether the corresponding file can be processed, thereby improving the detection accuracy.
The event sequence obtaining module 402 includes:
a detecting unit 402a, configured to detect whether the predetermined processing is currently performed on the file corresponding to the monitored file event;
an adding unit 402b, configured to add the file event to the event sequence if the detection result of the detecting unit 402a is that the predetermined processing is not currently performed on the file corresponding to the monitored file event.
Wherein the file is a file in an active directory, and the file processing apparatus further includes:
a directory determining module 405, configured to determine, before the event monitoring module 401 monitors at least one file event corresponding to a file, a storage directory meeting a second predetermined condition under a current operating system as the active directory;
wherein the second predetermined condition comprises at least one of the following three conditions:
the storage directory is in a non-hidden state;
the storage directory is located at a level less than a predetermined level;
the storage directory is a directory stored last time by the specified application program.
The file processing apparatus further includes:
an identifier obtaining module 406, configured to obtain an identifier of an application program on a stack top of a current operating system before the event monitoring module 401 monitors at least one file event corresponding to a file;
a second detecting module 407, configured to detect whether the identifier of the application acquired by the identifier acquiring module 406 matches the identifier of the specified application;
the event monitoring module 401 is configured to execute the step of monitoring at least one file event corresponding to a file if the detection result of the second detecting module 407 is that the obtained identifier of the application program matches the identifier of the specified application program.
The processing module 404 includes:
an encryption unit 404a for encrypting the file;
a hiding unit 404b for hiding the file.
In summary, the file processing apparatus provided in the fourth embodiment of the present invention obtains the event sequence corresponding to the file by monitoring the file event corresponding to the file of the specific type, and performs the predetermined processing on the file when it is detected that the file event in the event sequence satisfies the predetermined condition, so as to solve the problem that the user needs to manually complete the processing procedure in the prior art, thereby wasting the user time and consuming a large amount of electric power of the terminal, and achieve the purposes of saving the processing time and the electric power of the terminal and improving the endurance performance of the terminal; secondly, the file processing apparatus provided in the fourth embodiment of the present invention monitors the file events of the predetermined type, filters the monitored file events of the predetermined type, and adds only the file events suitable for detection into the event sequence, thereby achieving the purposes of reducing memory consumption and improving system performance; in addition, the file processing apparatus provided in the fourth embodiment of the present invention determines the valid directory in all the storage directories under the system, and monitors the files in the valid directory, so as to achieve the purpose of avoiding consuming too many resources and improving the terminal performance while expanding the monitoring range as much as possible; in addition, the file processing apparatus provided in the fourth embodiment of the present invention monitors files as objects, and obtains event sequences for each file, so as to be able to implement respective detection for multiple files, effectively avoid mutual interference when detecting different files in the same file directory, and provide support for running multiple similar applications at the same time; finally, the file processing apparatus provided in the fourth embodiment of the present invention fully considers the specific situation of file operation by detecting the combination of multiple types of file events, and can effectively detect whether the corresponding file can be processed, thereby improving the detection accuracy.
EXAMPLE five
Referring to fig. 5, an apparatus configuration diagram of a terminal according to a fifth embodiment of the present invention is shown. The terminal can be a mobile terminal such as a smart phone, a tablet computer, an electronic book reader or a digital camera, and can be used for encrypting or hiding files in the terminal. The terminal may include:
the document processing apparatus 001 according to the third or fourth embodiment.
In summary, in the terminal provided in the fifth embodiment of the present invention, the event sequence corresponding to the file is obtained by monitoring the file event corresponding to the file of the specific type, and the file is subjected to the predetermined processing when it is detected that the file event in the event sequence satisfies the predetermined condition, so that the problems that the user time is wasted and the electric quantity of the terminal is consumed in a large amount due to the fact that the user needs to manually complete the processing process in the prior art are solved, and the purposes of saving the processing time and the electric quantity of the terminal and improving the endurance performance of the terminal are achieved; secondly, the terminal provided by the fifth embodiment of the present invention monitors the predetermined type of file event, filters the monitored predetermined type of file event, and adds only the file event suitable for detection into the event sequence, thereby achieving the purposes of reducing memory consumption and improving system performance; in addition, the terminal provided by the fifth embodiment of the present invention determines the valid directory in all the storage directories under the system, and monitors the files in the valid directory, so as to achieve the purpose of avoiding consuming too many resources and improving the terminal performance while expanding the monitoring range as much as possible; in addition, the terminal provided by the fifth embodiment of the present invention monitors files as objects, and obtains event sequences for each file, so as to be able to implement respective detection for multiple files, effectively avoid mutual interference when detecting different files in the same file directory, and provide support for the operation of multiple similar applications at the same time; finally, the terminal provided by the fifth embodiment of the present invention fully considers the specific situation of file operation by detecting the combination of multiple types of file events, and can effectively detect whether the corresponding file can be processed, thereby improving the detection accuracy.
It should be noted that: in the document processing apparatus provided in the above embodiment, when processing a document, only the division of the functional modules is illustrated, and in practical applications, the function distribution may be completed by different functional modules according to needs, that is, the internal structure of the apparatus may be divided into different functional modules to complete all or part of the functions described above. In addition, the file processing apparatus and the file processing method provided by the above embodiments belong to the same concept, and specific implementation processes thereof are described in the method embodiments for details, which are not described herein again.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.

Claims (11)

1. A method of file processing, the method comprising:
monitoring at least one file event corresponding to a file, wherein the type of the file is the type of the file generated by a specified application program, and each file event is used for representing a single operation on the file;
obtaining an event sequence corresponding to the file according to the at least one file event monitored;
detecting whether file events in the event sequence meet a first preset condition or not; the first predetermined condition includes: the event sequence comprises a move-in appointed directory event; or, the event sequence comprises a creation event and at least one modification event, and the number of opening events and closing events contained in the event sequence is the same;
and if the detection result is that the file event in the event sequence meets the first preset condition, performing preset processing on the file, wherein the preset processing comprises encryption and/or hiding.
2. The method of claim 1, wherein listening for at least one file event corresponding to the file comprises:
monitoring at least one file event of a preset type corresponding to the file;
the predetermined types of file events include: one of create event, open event, close event, modify event, or move into specified directory event.
3. The method according to claim 2, wherein the obtaining the corresponding event sequence of the file according to the at least one file event monitored comprises:
detecting whether the preset processing is currently carried out on the monitored file corresponding to the file event;
and if the detection result is that the preset processing is not carried out on the file corresponding to the monitored file event at present, adding the file event into the event sequence.
4. The method according to any one of claims 1 to 3, wherein the file is a file under an active directory, and before the listening for at least one file event corresponding to the file, the method further comprises:
determining a storage directory meeting a second preset condition under the current operating system as the effective directory;
wherein the second predetermined condition comprises at least one of the following three conditions:
the storage directory is in a non-hidden state;
the storage directory is located at a level less than a predetermined level;
the storage directory is a directory stored last time by the specified application program.
5. The method of claim 4, wherein prior to listening for at least one file event corresponding to a file, the method further comprises:
acquiring an identifier of an application program at the top of a current operating system stack;
detecting whether the acquired identifier of the application program is matched with the identifier of the specified application program;
and if the detection result is that the acquired identifier of the application program is matched with the identifier of the specified application program, executing the step of monitoring at least one file event corresponding to the file.
6. A document processing apparatus, characterized in that the apparatus comprises:
the event monitoring module is used for monitoring at least one file event corresponding to a file, wherein the type of the file is the type of the file generated by a specified application program, and each file event is used for representing a single operation on the file;
an event sequence obtaining module, configured to obtain an event sequence corresponding to the file according to the at least one file event monitored by the event monitoring module;
the first detection module is used for detecting whether the file events in the event sequence obtained by the event sequence obtaining module meet a first preset condition or not; the first predetermined condition includes: the event sequence comprises a move-in appointed directory event; or, the event sequence comprises a creation event and at least one modification event, and the number of opening events and closing events contained in the event sequence is the same;
the processing module is used for carrying out preset processing on the file if the detection result of the first detection module indicates that the file event in the event sequence meets the first preset condition;
the processing module comprises:
an encryption unit configured to encrypt the file;
and the hiding unit is used for hiding the file.
7. The apparatus of claim 6, wherein the event monitoring module is configured to monitor at least one file event of a predetermined type corresponding to the file;
the predetermined types of file events include: one of create event, open event, close event, modify event, or move into specified directory event.
8. The apparatus of claim 7, wherein the sequence of events obtaining module comprises:
the detection unit is used for detecting whether the preset processing is currently carried out on the file corresponding to the monitored file event;
and the adding unit is used for adding the file event into the event sequence if the detection result of the detecting unit indicates that the preset processing is not performed on the monitored file corresponding to the file event currently.
9. The apparatus according to any one of claims 6 to 8, wherein the file is a file under a valid directory, the apparatus further comprising:
the directory determining module is used for determining a storage directory meeting a second preset condition under the current operating system as the effective directory before the event monitoring module monitors at least one file event corresponding to a file;
wherein the second predetermined condition comprises at least one of the following three conditions:
the storage directory is in a non-hidden state;
the storage directory is located at a level less than a predetermined level;
the storage directory is a directory stored last time by the specified application program.
10. The apparatus of claim 9, further comprising:
the identifier acquisition module is used for acquiring an identifier of an application program on the stack top of the current operating system before the event monitoring module monitors at least one file event corresponding to a file;
the second detection module is used for detecting whether the identifier of the application program acquired by the identifier acquisition module is matched with the identifier of the specified application program;
the event monitoring module is configured to execute the step of monitoring at least one file event corresponding to a file if the detection result of the second detection module is that the obtained identifier of the application program matches the identifier of the specified application program.
11. A terminal, characterized in that it comprises a document processing device according to any one of claims 6 to 10.
CN201310375907.1A 2013-08-26 2013-08-26 Document handling method, device and terminal Active CN104133544B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310375907.1A CN104133544B (en) 2013-08-26 2013-08-26 Document handling method, device and terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310375907.1A CN104133544B (en) 2013-08-26 2013-08-26 Document handling method, device and terminal

Publications (2)

Publication Number Publication Date
CN104133544A CN104133544A (en) 2014-11-05
CN104133544B true CN104133544B (en) 2016-03-30

Family

ID=51806256

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310375907.1A Active CN104133544B (en) 2013-08-26 2013-08-26 Document handling method, device and terminal

Country Status (1)

Country Link
CN (1) CN104133544B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104702701A (en) * 2015-03-30 2015-06-10 魅族科技(中国)有限公司 Method and device for sharing data
CN105530261B (en) * 2015-12-23 2019-02-12 北京奇虎科技有限公司 The guard method of privacy information and device
CN106815529A (en) * 2016-12-20 2017-06-09 合肥高维数据技术有限公司 Cell phone pictures safety protection system and method based on Steganography
CN110275862B (en) * 2019-06-26 2021-07-30 北京字节跳动网络技术有限公司 Method and device for counting number of created documents
CN111930814B (en) * 2020-05-29 2024-02-27 武汉达梦数据库股份有限公司 File event scheduling method based on ETL system and ETL system
CN113220645B (en) * 2021-05-31 2022-07-05 技德技术研究所(武汉)有限公司 Linux-compatible Android file display method and device
CN113688106B (en) * 2021-10-27 2022-04-15 广东睿江云计算股份有限公司 File monitoring method and device

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101246536A (en) * 2008-03-06 2008-08-20 北京鼎信高科信息技术有限公司 Method for encrypting and decrypting computer files based on process monitoring
CN101453327A (en) * 2007-11-29 2009-06-10 北京鼎信高科信息技术有限公司 Information leakage prevention system
CN101951443A (en) * 2010-09-25 2011-01-19 宇龙计算机通信科技(深圳)有限公司 File security method, system and mobile terminal

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101453327A (en) * 2007-11-29 2009-06-10 北京鼎信高科信息技术有限公司 Information leakage prevention system
CN101246536A (en) * 2008-03-06 2008-08-20 北京鼎信高科信息技术有限公司 Method for encrypting and decrypting computer files based on process monitoring
CN101951443A (en) * 2010-09-25 2011-01-19 宇龙计算机通信科技(深圳)有限公司 File security method, system and mobile terminal

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
Android智能手机***中文件实时监控的研究与实现;温敏,艾丽蓉,王志国;《科学技术与工程》;20090430;第9卷(第7期);第1717-1718页,第2节、第3.1节、第3.2节 *

Also Published As

Publication number Publication date
CN104133544A (en) 2014-11-05

Similar Documents

Publication Publication Date Title
CN104133544B (en) Document handling method, device and terminal
US10324899B2 (en) Methods for characterizing content item groups
US20060100978A1 (en) Multiple media type synchronization between host computer and media device
WO2015043512A1 (en) Picture management method and device
CN101188638A (en) Contact management method, device and terminal
CN104169913A (en) A picture display method and device and a terminal device
CN105183837A (en) Mobile terminal thumbnail list view display method and system
CN103699673B (en) A kind of image processing method of mobile terminal, device and mobile terminal
CN104103087A (en) Picture display and management method and system with text introduction function
CN103747354A (en) Smart television and external storage device connection control method and control device
CN106879263A (en) A kind of image pickup method and mobile device
EP3198471A1 (en) Media organization
CN103136264A (en) Accessory inquiring method and user terminal
WO2017076027A1 (en) Wallpaper processing method and apparatus
CN113076288A (en) File processing method and device, electronic equipment and storage medium
CN103530550B (en) File/applied program processing method on communication terminal and device
CN106201467B (en) Screenshot labeling interface display method and device
US10958955B1 (en) System for generating modified video output
CN103544221A (en) Method and system for generating video thumbnail in Android system
US20140207833A1 (en) File opening method, apparatus, and terminal
CN112654974B (en) File scanning method, file scanning device and terminal equipment
KR20050056764A (en) Muitimedia contents management apparatus in portable digital device and method thereof
WO2022188417A1 (en) Data processing method and apparatus, device, and storage medium
US20220027466A1 (en) System and method for generating a minimal forensic image of a dataset of interest
TW201430728A (en) Icon generating system and method for generating icon

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant