CN107766351B - File directory identification method and device - Google Patents

File directory identification method and device Download PDF

Info

Publication number
CN107766351B
CN107766351B CN201610677067.8A CN201610677067A CN107766351B CN 107766351 B CN107766351 B CN 107766351B CN 201610677067 A CN201610677067 A CN 201610677067A CN 107766351 B CN107766351 B CN 107766351B
Authority
CN
China
Prior art keywords
file
file directory
application program
attribute information
terminal
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
CN201610677067.8A
Other languages
Chinese (zh)
Other versions
CN107766351A (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 CN201610677067.8A priority Critical patent/CN107766351B/en
Publication of CN107766351A publication Critical patent/CN107766351A/en
Application granted granted Critical
Publication of CN107766351B publication Critical patent/CN107766351B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/1734Details of monitoring file system events, e.g. by the use of hooks, filter drivers, logs

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses file directory identification and a file directory identification device, and belongs to the technical field of internet. The method comprises the following steps: in the running process of an application program, when a creation event of a file directory is monitored, a hook function is called; monitoring a system function called in the file directory creation process through a hook function; and acquiring attribute information of the file directory according to the system function, wherein the attribute information is used for indicating the affiliated relationship between the file directory and the application program, and the attribute information at least comprises a file directory name and an application program identifier. The invention monitors the system function called when the file directory is created for the application program by calling the hook function, and further acquires the attribute information of the file directory according to the called system function. Because the attribute information of the file directory indicates the affiliation relationship between the file directory and the application program, the application program to which the file directory belongs can be identified without manual identification by a user, so that the identification cost is saved, and the identification precision is high.

Description

File directory identification method and device
Technical Field
The invention relates to the technical field of internet, in particular to a file directory identification method and device.
Background
In general, during the running process of an application program, a terminal creates a file directory for the application program on an SD (Secure Digital Card) Card, and then stores files that need to be cached during the running process of the application program under the created file directory. In order to avoid the file directories of different applications from colliding with each other, when the terminal creates a file directory for an application, the application information of the application is generally used as a prefix of a file directory name. As the number of cached files increases, the available space on the SD card becomes smaller and smaller, and the operating speed of the terminal becomes slower and slower. In order to increase the operation speed of the terminal, the application program to which the file directory on the SD card belongs needs to be identified, and the file directory on the SD card is selectively deleted according to the application program to which the file directory belongs.
At present, when identifying the file directory, a manual mode can be adopted, and a user identifies the application program to which the file directory belongs according to the prefix of the file directory.
In the process of implementing the invention, the inventor finds that the prior art has at least the following problems:
the identification is carried out in a manual mode, the identification cost is high, and when the file directory does not contain application information, a user cannot obtain the application program to which the file directory belongs, and the identification accuracy is low.
Disclosure of Invention
In order to solve the problems in the prior art, embodiments of the present invention provide a method and an apparatus for identifying a file directory. The technical scheme is as follows:
in one aspect, a method for identifying a file directory is provided, where the method includes:
in the running process of an application program, when a creation event of a file directory is monitored, a hook function is called;
monitoring a system function called in the file directory creation process through the hook function;
and acquiring attribute information of the file directory according to the system function, wherein the attribute information is used for indicating the affiliation between the file directory and the application program, and the attribute information at least comprises a file directory name and the application program identifier.
In another aspect, an apparatus for identifying a file directory is provided, the apparatus including:
the calling module is used for calling a hook function when a file directory creation event is monitored in the running process of the application program;
the monitoring module is used for monitoring the system function called in the file directory creating process through the hook function;
and the acquisition module is used for acquiring attribute information of the file directory according to the system function, wherein the attribute information is used for indicating the affiliation relationship between the file directory and the application program, and the attribute information at least comprises a file directory name and the application program identifier.
The technical scheme provided by the embodiment of the invention has the following beneficial effects:
and monitoring a system function called when the file directory is created for the application program by calling the hook function, and further acquiring the attribute information of the file directory according to the called system function. Because the attribute information of the file directory indicates the affiliation relationship between the file directory and the application program, the application program to which the file directory belongs can be identified without manual identification by a user, so that the identification cost is saved, and the identification precision is high.
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 file directory identification method according to an embodiment of the present invention;
FIG. 2 is a flowchart of a file directory identification method according to another embodiment of the present invention;
FIG. 3 is a diagram illustrating a garbage file list generation process according to another embodiment of the present invention;
FIG. 4 is a schematic diagram of a terminal display interface according to another embodiment of the present invention;
FIG. 5 is a schematic diagram of a terminal display interface according to another embodiment of the invention;
fig. 6 is a schematic structural diagram of an apparatus for identifying a file directory according to another embodiment of the present invention;
fig. 7 is a schematic structural diagram of an identification terminal of a file directory according to another 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.
When an application program in the terminal runs, a file directory is created on a local memory such as an SD card of the terminal so as to cache a file generated or received in the running process. With the increase of the service time of the terminal, more and more files are stored in the local memory of the terminal, the operation speed of the terminal is greatly reduced, in order to improve the operation speed of the terminal, each file directory in the local memory can be identified, and the files in the file directories are selectively deleted according to the application program to which each file directory belongs, so that more storage space is reserved for the terminal. Because the existing file directory identification method requires a user to manually identify each file directory, the identification cost is high, and the identification precision is low, therefore, an embodiment of the present invention provides a file directory identification method, and referring to fig. 1, the method provided by the embodiment of the present invention includes:
101. in the running process of an application program, when a file directory creation event is monitored, a hook function is called.
102. And monitoring a system function called in the file directory creation process through a hook function.
103. And acquiring attribute information of the file directory according to the system function, wherein the attribute information is used for indicating the affiliated relationship between the file directory and the application program, and the attribute information at least comprises a file directory name and an application program identifier.
According to the method provided by the embodiment of the invention, the system function called when the file directory is created for the application program is monitored by calling the hook function, and the attribute information of the file directory is acquired according to the called system function. Because the attribute information of the file directory indicates the affiliation relationship between the file directory and the application program, the application program to which the file directory belongs can be identified without manual identification by a user, so that the identification cost is saved, and the identification precision is high.
In another embodiment of the present invention, in the running process of the application program, when a creation event of a file directory is monitored, the invoking of the hook function includes:
in the running process of an application program, when a creation event of a file directory is monitored, a hook function is loaded into the process of the application program;
the hook function is executed in the process of the application.
In another embodiment of the present invention, in the running process of the application program, when a creation event of a file directory is monitored, the invoking of the hook function includes:
in the running process of an application program, when a creation event of a file directory is monitored, a hook function is called from an operating system, and the hook function is written into the operating system by a manufacturer through modifying system source codes.
In another embodiment of the present invention, after obtaining the attribute information of the file directory according to the system function, the method further includes:
reporting the attribute information of the file directories to a server, processing the attribute information of the file directories reported by a plurality of terminals by the server to obtain a junk file list, wherein the junk file list comprises the attribute information of the file directories, and sending the junk file list to the terminals;
receiving a junk file list sent by a server;
and cleaning the files in the junk file list according to the junk file list.
In another embodiment of the present invention, the clearing the file in the garbage file list according to the garbage file list includes:
when scanning files in an operating system, identifying a garbage file directory according to a garbage file list;
displaying a junk file processing page, wherein the junk file processing page comprises a junk file directory and a junk file cleaning option;
and when detecting that the junk file cleaning option is selected, deleting the files in the junk file directory.
All the above-mentioned optional technical solutions can be combined arbitrarily to form the optional embodiments of the present invention, and are not described herein again.
An embodiment of the present invention provides a method for identifying a file directory, and referring to fig. 2, a flow of the method provided by the embodiment of the present invention includes:
201. in the running process of an application program, when a file directory creation event is monitored, a terminal calls a hook function.
In this embodiment, the terminal may be a smart phone, a tablet computer, a notebook computer, a desktop computer, or the like, and the product type of the terminal is not specifically limited in this embodiment. In order to meet the use requirements of users, a plurality of application programs are installed in the terminal, including an audio and video application program, a navigation application program, a shopping application program, a reading application program, a management application program and the like. The management application is responsible for monitoring the operating system and managing other applications, for example, the management application can clean up junk files generated in the running process of other applications, repair system bugs, check and kill viruses, and the like.
Most application programs need to cache some files, such as pictures, audio, video and the like, in a local storage of the terminal, such as an SD card, in the running process, when a user needs the files again, the terminal preferentially obtains the files from the local storage without pulling the files from the Internet, so that the flow can be saved, and the response speed can be increased. Before caching files for the application program, the terminal needs to create a file directory for the application program on the SD card, and then stores the files needing to be cached in the file directory. With the increase of files cached on the SD card, the usable space on the SD card becomes smaller and smaller, and at this time, the file directory on the SD card needs to be identified, and then the files in the file directory are deleted in a targeted manner, so as to vacate more usable space for the terminal, thereby improving the operation performance of the terminal. Therefore, the method provided by the embodiment monitors the creation event of the file directory in real time in the running process of the application program, calls the hook function when the creation event of the file directory is monitored, and monitors the system function called when the file directory is created for the application program through the hook function.
The hook function is also called a hook function, and is a part of a windows message processing mechanism, and by setting the hook function, an application program can filter all messages and events on the level of an operating system and access messages which cannot be accessed under normal conditions. The hook function is written by a developer as a piece of code to process operating system messages.
During the running process of the application program, when a creation event of a file directory is monitored, the terminal calls a hook function, including but not limited to the following two ways.
In an embodiment of the invention, the terminal acquires the hook function, loads the hook function into the process of the application program in a code injection mode, and then executes the hook function in the process of the application program. In the computer field, code injection is a way to load executable code into an application process.
Under the linux system, the file executable by the terminal operating system is typically a so file, and therefore, in order to enable the hook function injected into the application program process to be executed, the terminal may convert the hook function into the so file before injecting the hook function into the application program process. Wherein the so files are all called Shared objects and are dynamic link library files under the linux system.
In another embodiment of the invention, the terminal can directly call the hook function from the operating system, and the hook function is written into the operating system by modifying the system source code by a manufacturer before the terminal leaves the factory.
202. And the terminal monitors the system function called in the file directory creation process through a hook function.
In this embodiment, when a creation event of a file directory is monitored, the terminal calls a hook function, and monitors a system function called by an operating system when a creation operation of the file directory of an application program is monitored by calling the hook function. The system function is a function inherent in the operating system.
203. And the terminal acquires the attribute information of the file directory according to the system function.
In the technical field of computers, since called system functions are different in the process of creating file directories of different application programs, a terminal monitors the system functions called by an operating system by calling a hook function, and can acquire attribute information of the file directories of the application programs, wherein the attribute information of the file directories is used for indicating the affiliated relationship between the file directories and the application programs, and the terminal can automatically identify the operating system corresponding to each file directory based on the attribute information of the file directories. The attribute information of the file directory includes a file directory name, an application identifier, a creating path of the file directory, and the like, and the embodiment does not specifically limit the attribute information of the file directory.
The attribute information of the file directory is actually acquired by the management application via the terminal.
204. And the terminal reports the attribute information of the file directory to the server.
In order to facilitate management of the attribute information of the file directories of different application programs, after acquiring the attribute information of the file directories, the management application program in the terminal can report the acquired attribute information of the file directories to a server corresponding to the management application program through a network or the like. When the terminal reports specifically, the attribute information of the file directory acquired within the preset time can be reported to the server every other preset time; the obtained attribute information of the file directory can be reported to the server in real time, and the embodiment does not specifically limit the way in which the terminal reports the attribute information of the file directory to the server.
In fact, in addition to the terminal according to the embodiment of the present invention reporting the attribute information of the file directory to the server, other terminals installed with the management application program also report the acquired attribute information of the file directory to the server.
205. And the server processes the attribute information of the file directories reported by the terminals to obtain a junk file list and sends the junk file list to the terminals.
After receiving the attribute information of the file directories reported by the terminals, the server analyzes the received attribute information of the file directories, removes the repeated attribute information of the file directories, and integrates the attribute information of different file directories into a junk file list.
Taking an example that a terminal a, a terminal B, a terminal C, and a terminal D report attribute information of a file directory to a server, where the attribute information of the file directory reported by the terminal a to the server includes attribute information of a file directory one and attribute information of a file directory two, the attribute information of the file directory reported by the terminal B to the server includes attribute information of a file directory three, attribute information of a file directory four, and attribute information of a file directory five, the attribute information of the file directory reported by the terminal C to the server includes attribute information of a file directory two, attribute information of a file directory four, and attribute information of a file directory six, and the attribute information of the file directory reported by the terminal D to the server includes attribute information of a file directory three and attribute information of a file directory seven. The server analyzes the received attribute information of the multiple file directories according to the attribute information of the file directories reported by the terminal A, the terminal B, the terminal C and the terminal D, removes the repeated attribute information of the file directory II, the repeated attribute information of the file directory III and the repeated attribute information of the file directory IV, and obtains a junk file list, wherein the junk file list comprises the attribute information of the file directory I, the attribute information of the file directory II, the attribute information of the file directory III, the attribute information of the file directory IV, the attribute information of the file directory V, the attribute information of the file directory VI and the attribute information of the file directory VII.
For the storage form of the attribute information of the file directory in the garbage file list, see table 1 below.
TABLE 1
Name of file directory Application identification Storage location
abcd 1 SD card
cedg 2 SD card
wetr 3 SD card
And after the junk file list is obtained, the server sends the obtained junk file list to each terminal provided with the management application program, and each terminal stores the junk file list.
Fig. 3 is a schematic diagram of a process of creating a junk file list, referring to fig. 3, after acquiring attribute information of a file directory, a terminal a, a terminal B, and a terminal C report the acquired attribute information of the file directory to a server, the server receives the attribute information of the file directory reported by the terminal a, the terminal B, and the terminal C, analyzes the received attribute information of a plurality of file directories to obtain a junk file list, and then sends the obtained junk file list to the terminal a, the terminal B, the terminal C, the terminal D, the terminal E, and the terminal F, which are equipped with a management application, and the terminal a, the terminal B, the terminal C, the terminal D, the terminal E, and the terminal F store the junk file list.
206. And when receiving the junk file list sent by the server, the terminal cleans the files in the junk file list according to the junk file list.
In this embodiment, the management application has a garbage cleaning function, based on which, when the management application scans files within the operating system through the terminal, the junk file directory may be identified from the junk file list and after scanning is complete, a junk file processing page may be displayed, see figure 4, the junk file processing page is displayed with junk file directories, each junk file directory is displayed with whether to select options or not, such as "screenshot directory", "junk file directory", "excess installation package directory", "background software directory" in fig. 4, and junk file cleanup options, such as "one-click cleanup acceleration" in fig. 4, and when the garbage file cleaning option is detected to be selected, deleting the files in the selected garbage file directory, thereby vacating more use space for the terminal and improving the performance of the terminal.
Fig. 5 is a schematic diagram of a terminal display interface, referring to fig. 5, when the terminal identifies a junk file directory during full-disk scanning of system files according to a junk file list, the terminal displays a "system album thumbnail", "fragmented files", "cleanable logs", "log logs", "shareSDK advertisements", "first video application advertisements", "second video advertisements", and the like of the identified junk file directory on a junk file processing page, and displays a "one-key cleaning acceleration" option, and when it is detected that the "one-key cleaning option" is selected, a file under the selected junk file directory is deleted.
According to the method provided by the embodiment of the invention, the system function called when the file directory is created for the application program is monitored by calling the hook function, and the attribute information of the file directory is acquired according to the called system function. Because the attribute information of the file directory indicates the affiliation relationship between the file directory and the application program, the application program to which the file directory belongs can be identified without manual identification by a user, so that the identification cost is saved, and the identification precision is high.
Referring to fig. 6, an embodiment of the present invention provides an apparatus for identifying a file directory, where the apparatus includes:
the calling module 601 is configured to, in an application program running process, call a hook function when a creation event of a file directory is monitored;
a monitoring module 602, configured to monitor, through a hook function, a system function called in a file directory creation process;
the obtaining module 603 is configured to obtain attribute information of the file directory according to the system function, where the attribute information is used to indicate an affiliation between the file directory and the application program, and the attribute information at least includes a file directory name and an application program identifier.
In another embodiment of the present invention, the calling module 601 is configured to, in an application program running process, load a hook function into a process of the application program when a file directory creation event is monitored; the hook function is executed in the process of the application.
In another embodiment of the present invention, the calling module 601 is configured to, during the running of the application program, call a hook function from the operating system when a creation event of the file directory is monitored, where the hook function is written into the operating system by a manufacturer by modifying system source code.
In another embodiment of the present invention, the apparatus further comprises:
the information reporting module is used for reporting the attribute information of the file directories to the server, processing the attribute information of the file directories reported by the plurality of terminals by the server to obtain a junk file list, wherein the junk file list comprises the attribute information of the plurality of file directories, and sending the junk file list to the terminals;
the receiving module is used for receiving a junk file list sent by the server;
and the clearing module is used for clearing the files in the junk file list according to the junk file list.
In another embodiment of the present invention, the cleaning module is configured to identify a garbage file directory according to a garbage file list when scanning a file in an operating system; displaying a junk file processing page, wherein the junk file processing page comprises a junk file directory and a junk file cleaning option; and when detecting that the junk file cleaning option is selected, deleting the files in the junk file directory.
To sum up, the apparatus provided in the embodiment of the present invention monitors a system function called when creating a file directory for an application program by calling a hook function, and further obtains attribute information of the file directory according to the called system function. Because the attribute information of the file directory indicates the affiliation relationship between the file directory and the application program, the application program to which the file directory belongs can be identified without manual identification by a user, so that the identification cost is saved, and the identification precision is high.
Referring to fig. 7, a schematic structural diagram of an identification terminal for a file directory according to an embodiment of the present invention is shown, where the terminal may be used to implement the file directory identification method provided in the foregoing embodiment. Specifically, the method comprises the following steps:
the terminal 700 may include components such as an RF (Radio Frequency) circuit 110, a memory 120 including one or more computer-readable storage media, an input unit 130, a display unit 140, a sensor 150, an audio circuit 160, a WiFi (Wireless Fidelity) module 170, a processor 180 including one or more processing cores, and a power supply 190. Those skilled in the art will appreciate that the terminal structure shown in fig. 7 is not intended to be limiting and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components. Wherein:
the RF circuit 110 may be used for receiving and transmitting signals during information transmission and reception or during a call, and in particular, receives downlink information from a base station and then sends the received downlink information to the one or more processors 180 for processing; in addition, data relating to uplink is transmitted to the base station. In general, the RF circuitry 110 includes, but is not limited to, an antenna, at least one Amplifier, a tuner, one or more oscillators, a Subscriber Identity Module (SIM) card, a transceiver, a coupler, an LNA (Low Noise Amplifier), a duplexer, and the like. In addition, the RF circuitry 110 may also communicate with networks and other devices via wireless communications. The wireless communication may use any communication standard or protocol, including but not limited to GSM (Global System for Mobile communications), GPRS (General Packet Radio Service), CDMA (Code Division Multiple Access), WCDMA (Wideband Code Division Multiple Access), LTE (Long Term Evolution), email, SMS (Short Messaging Service), and the like.
The memory 120 may be used to store software programs and modules, and the processor 180 executes various functional applications and data processing by operating the software programs and modules stored in the memory 120. The memory 120 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 by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the terminal 700, and the like. Further, the memory 120 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. Accordingly, the memory 120 may further include a memory controller to provide the processor 180 and the input unit 130 with access to the memory 120.
The input unit 130 may be used to receive input numeric or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control. In particular, the input unit 130 may include a touch-sensitive surface 131 as well as other input devices 132. The touch-sensitive surface 131, also referred to as a touch display screen or a touch pad, may collect touch operations by a user on or near the touch-sensitive surface 131 (e.g., operations by a user on or near the touch-sensitive surface 131 using a finger, a stylus, or any other suitable object or attachment), and drive the corresponding connection device according to a predetermined program. Alternatively, the touch sensitive surface 131 may comprise two parts, a touch detection means and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 180, and can receive and execute commands sent by the processor 180. Additionally, the touch-sensitive surface 131 may be implemented using various types of resistive, capacitive, infrared, and surface acoustic waves. In addition to the touch-sensitive surface 131, the input unit 130 may also include other input devices 132. In particular, other input devices 132 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like.
The display unit 140 may be used to display information input by or provided to a user and various graphical user interfaces of the terminal 700, which may be made up of graphics, text, icons, video, and any combination thereof. The Display unit 140 may include a Display panel 141, and optionally, the Display panel 141 may be configured in the form of an LCD (Liquid Crystal Display), an OLED (Organic Light-Emitting Diode), or the like. Further, the touch-sensitive surface 131 may cover the display panel 141, and when a touch operation is detected on or near the touch-sensitive surface 131, the touch operation is transmitted to the processor 180 to determine the type of the touch event, and then the processor 180 provides a corresponding visual output on the display panel 141 according to the type of the touch event. Although in FIG. 7, touch-sensitive surface 131 and display panel 141 are shown as two separate components to implement input and output functions, in some embodiments, touch-sensitive surface 131 may be integrated with display panel 141 to implement input and output functions.
The terminal 700 can also include at least one sensor 150, such as a light sensor, motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor that may adjust the brightness of the display panel 141 according to the brightness of ambient light, and a proximity sensor that may turn off the display panel 141 and/or a backlight when the terminal 700 is moved to the ear. As one of the motion sensors, the gravity acceleration sensor can detect the magnitude of acceleration in each direction (generally, three axes), can detect the magnitude and direction of gravity when the mobile phone is stationary, and can be used for applications of recognizing the posture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer and tapping), and the like; as for other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor, which can be configured in the terminal 700, detailed descriptions thereof are omitted.
Audio circuitry 160, speaker 161, and microphone 162 may provide an audio interface between a user and terminal 700. The audio circuit 160 may transmit the electrical signal converted from the received audio data to the speaker 161, and convert the electrical signal into a sound signal for output by the speaker 161; on the other hand, the microphone 162 converts the collected sound signal into an electric signal, converts the electric signal into audio data after being received by the audio circuit 160, and then outputs the audio data to the processor 180 for processing, and then to the RF circuit 110 to be transmitted to, for example, another terminal, or outputs the audio data to the memory 120 for further processing. The audio circuit 160 may also include an earbud jack to provide communication of a peripheral headset with the terminal 700.
WiFi belongs to a short-distance wireless transmission technology, and the terminal 700 can help a user send and receive e-mails, browse web pages, access streaming media, and the like through the WiFi module 170, and provides wireless broadband internet access for the user. Although fig. 7 shows the WiFi module 170, it is understood that it does not belong to the essential constitution of the terminal 700 and may be omitted entirely as needed within the scope not changing the essence of the invention.
The processor 180 is a control center of the terminal 700, connects various parts of the entire mobile phone using various interfaces and lines, and performs various functions of the terminal 700 and processes data by operating or executing software programs and/or modules stored in the memory 120 and calling data stored in the memory 120, thereby performing overall monitoring of the mobile phone. Optionally, processor 180 may include one or more processing cores; optionally, the processor 180 may integrate an application processor and a modem processor, wherein the application processor mainly handles operating systems, user interfaces, application programs, and the like, and the modem processor mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 180.
The terminal 700 also includes a power supply 190 (e.g., a battery) for powering the various components, which may preferably be logically coupled to the processor 180 via a power management system to manage charging, discharging, and power consumption management functions via the power management system. The power supply 190 may also include any component including one or more of a dc or ac power source, a recharging system, a power failure detection circuit, a power converter or inverter, a power status indicator, and the like.
Although not shown, the terminal 700 may further include a camera, a bluetooth module, etc., which will not be described herein. In this embodiment, the display unit of the terminal 700 is a touch screen display, and the terminal 700 further includes a memory and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors. The one or more programs include instructions for:
in the running process of an application program, when a creation event of a file directory is monitored, a hook function is called;
monitoring a system function called in the file directory creation process through a hook function;
and acquiring attribute information of the file directory according to the system function, wherein the attribute information is used for indicating the affiliated relationship between the file directory and the application program, and the attribute information at least comprises a file directory name and an application program identifier.
Assuming that the above is the first possible implementation manner, in a second possible implementation manner provided on the basis of the first possible implementation manner, the memory of the terminal further includes instructions for performing the following operations:
in the running process of an application program, when a creation event of a file directory is monitored, a hook function is called, and the method comprises the following steps:
in the running process of an application program, when a creation event of a file directory is monitored, a hook function is loaded into the process of the application program;
the hook function is executed in the process of the application.
Assuming that the above is the second possible implementation manner, in a third possible implementation manner provided on the basis of the second possible implementation manner, the memory of the terminal further includes instructions for performing the following operations:
in the running process of an application program, when a creation event of a file directory is monitored, a hook function is called, and the method comprises the following steps:
in the running process of an application program, when a creation event of a file directory is monitored, a hook function is called from an operating system, and the hook function is written into the operating system by a manufacturer through modifying system source codes.
Assuming that the above is the third possible implementation manner, in a fourth possible implementation manner provided on the basis of the third possible implementation manner, the memory of the terminal further includes instructions for performing the following operations:
after obtaining the attribute information of the file directory according to the system function, the method further includes:
reporting the attribute information of the file directories to a server, processing the attribute information of the file directories reported by a plurality of terminals by the server to obtain a junk file list, wherein the junk file list comprises the attribute information of the file directories, and sending the junk file list to the terminals;
receiving a junk file list sent by a server;
and cleaning the files in the junk file list according to the junk file list.
Assuming that the above is the fourth possible implementation manner, in a fifth possible implementation manner provided on the basis of the fourth possible implementation manner, the memory of the terminal further includes instructions for performing the following operations:
according to the garbage file list, cleaning the files in the garbage file list, comprising the following steps:
when scanning files in an operating system, identifying a garbage file directory according to a garbage file list;
displaying a junk file processing page, wherein the junk file processing page comprises a junk file directory and a junk file cleaning option;
and when detecting that the junk file cleaning option is selected, deleting the files in the junk file directory.
The terminal provided by the embodiment of the invention monitors the system function called when the file directory is created for the application program by calling the hook function, and further acquires the attribute information of the file directory according to the called system function. Because the attribute information of the file directory indicates the affiliation relationship between the file directory and the application program, the application program to which the file directory belongs can be identified without manual identification by a user, so that the identification cost is saved, and the identification precision is high.
An embodiment of the present invention further provides a computer-readable storage medium, where the computer-readable storage medium may be a computer-readable storage medium contained in the memory in the foregoing embodiment; or it may be a separate computer-readable storage medium not incorporated in the terminal. The computer-readable storage medium stores one or more programs, the one or more programs being used by one or more processors to perform a method for file directory identification, the method comprising:
in the running process of an application program, when a creation event of a file directory is monitored, a hook function is called;
monitoring a system function called in the file directory creation process through a hook function;
and acquiring attribute information of the file directory according to the system function, wherein the attribute information is used for indicating the affiliated relationship between the file directory and the application program, and the attribute information at least comprises a file directory name and an application program identifier.
Assuming that the above is the first possible implementation manner, in a second possible implementation manner provided on the basis of the first possible implementation manner, the memory of the terminal further includes instructions for performing the following operations:
in the running process of an application program, when a creation event of a file directory is monitored, a hook function is called, and the method comprises the following steps:
in the running process of an application program, when a creation event of a file directory is monitored, a hook function is loaded into the process of the application program;
the hook function is executed in the process of the application.
Assuming that the above is the second possible implementation manner, in a third possible implementation manner provided on the basis of the second possible implementation manner, the memory of the terminal further includes instructions for performing the following operations:
in the running process of an application program, when a creation event of a file directory is monitored, a hook function is called, and the method comprises the following steps:
in the running process of an application program, when a creation event of a file directory is monitored, a hook function is called from an operating system, and the hook function is written into the operating system by a manufacturer through modifying system source codes.
Assuming that the above is the third possible implementation manner, in a fourth possible implementation manner provided on the basis of the third possible implementation manner, the memory of the terminal further includes instructions for performing the following operations:
after obtaining the attribute information of the file directory according to the system function, the method further includes:
reporting the attribute information of the file directories to a server, processing the attribute information of the file directories reported by a plurality of terminals by the server to obtain a junk file list, wherein the junk file list comprises the attribute information of the file directories, and sending the junk file list to the terminals;
receiving a junk file list sent by a server;
and cleaning the files in the junk file list according to the junk file list.
Assuming that the above is the fourth possible implementation manner, in a fifth possible implementation manner provided on the basis of the fourth possible implementation manner, the memory of the terminal further includes instructions for performing the following operations:
according to the garbage file list, cleaning the files in the garbage file list, comprising the following steps:
when scanning files in an operating system, identifying a garbage file directory according to a garbage file list;
displaying a junk file processing page, wherein the junk file processing page comprises a junk file directory and a junk file cleaning option;
and when detecting that the junk file cleaning option is selected, deleting the files in the junk file directory.
The computer-readable storage medium provided in the embodiment of the present invention monitors a system function called when creating a file directory for an application program by calling a hook function, and further obtains attribute information of the file directory according to the called system function. Because the attribute information of the file directory indicates the affiliation relationship between the file directory and the application program, the application program to which the file directory belongs can be identified without manual identification by a user, so that the identification cost is saved, and the identification precision is high.
The embodiment of the invention provides a graphical user interface, which is used on an identification terminal of a file directory, wherein the identification terminal for executing the file directory comprises a touch screen display, a memory and one or more processors for executing one or more programs; the graphical user interface includes:
in the running process of an application program, when a creation event of a file directory is monitored, a hook function is called;
monitoring a system function called in the file directory creation process through a hook function;
and acquiring attribute information of the file directory according to the system function, wherein the attribute information is used for indicating the affiliated relationship between the file directory and the application program, and the attribute information at least comprises a file directory name and an application program identifier.
The graphical user interface provided by the embodiment of the invention monitors the system function called when the file directory is created for the application program by calling the hook function, and further acquires the attribute information of the file directory according to the called system function. Because the attribute information of the file directory indicates the affiliation relationship between the file directory and the application program, the application program to which the file directory belongs can be identified without manual identification by a user, so that the identification cost is saved, and the identification precision is high.
It should be noted that: in the file directory identification apparatus provided in the above embodiment, when identifying a file directory, only the division of each function module is illustrated, and in practical applications, the function distribution may be completed by different function modules according to needs, that is, the internal structure of the file directory identification apparatus is divided into different function modules to complete all or part of the functions described above. In addition, the file directory identification device and the file directory identification method provided by the above embodiments belong to the same concept, and specific implementation processes thereof are described in the method embodiments and are not described herein again.
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 (5)

1. A method for identifying a file directory, the method comprising:
in the running process of an application program, when a creation event of a file directory of the application program is monitored, a terminal directly calls a hook function from an operating system, and the hook function is written into the operating system by a manufacturer through modifying a system source code before the terminal leaves a factory;
monitoring a system function called in the file directory creation process through the hook function;
acquiring attribute information of the file directory according to the system function, wherein the attribute information is used for indicating the affiliation relationship between the file directory and the application program, and the attribute information at least comprises a file directory name, the application program identifier of the application program to which the file directory belongs and a creation path of the file directory;
the terminal reports the attribute information of the file directories acquired within the preset time to a server every other preset time or reports the acquired attribute information of the file directories to the server in real time, the server analyzes the received attribute information of the file directories reported by the multiple terminals, removes the repeated attribute information of the file directories, integrates the attribute information of the different file directories into a garbage file list, and sends the garbage file list to the terminal provided with a management application program, and the management application program has a garbage cleaning function;
receiving a junk file list sent by the server;
when the files in the operating system are scanned through the management application program, identifying a garbage file directory according to the garbage file list; after the scanning is finished, displaying a junk file processing page, wherein the junk file processing page comprises the junk file directories, a selection option corresponding to each junk file directory and a junk file cleaning option; and deleting the files in the garbage file directory when the garbage file cleaning option is detected to be selected.
2. The method according to claim 1, wherein during the running of the application program, when a creation event of a file directory of the application program is monitored, calling a hook function comprises:
in the running process of an application program, when a creation event of a file directory is monitored, loading the hook function into the process of the application program;
executing the hook function in the process of the application program.
3. An apparatus for identifying a file directory, the apparatus comprising:
the terminal comprises a calling module, a hook module and a processing module, wherein the calling module is used for calling a hook function from an operating system directly when a creation event of a file directory of an application program is monitored in the running process of the application program, and the hook function is written into the operating system by a manufacturer through modifying a system source code before the terminal leaves a factory;
the monitoring module is used for monitoring the system function called in the file directory creating process through the hook function;
an obtaining module, configured to obtain attribute information of the file directory according to the system function, where the attribute information is used to indicate an affiliation between the file directory and the application program, and the attribute information at least includes a file directory name, the application program identifier of the application program to which the file directory belongs, and a creation path of the file directory;
an information reporting module, configured to report, by the terminal, attribute information of the file directory acquired within a preset time interval to a server or report, in real time, the acquired attribute information of the file directory to the server, where the server analyzes the received attribute information of the file directories reported by the multiple terminals, removes duplicate attribute information of the file directories, integrates the attribute information of different file directories into a garbage file list, and sends the garbage file list to a terminal installed with a management application program, where the management application program has a garbage cleaning function;
the receiving module is used for receiving the junk file list sent by the server;
the cleaning module is used for identifying a garbage file directory according to the garbage file list when the files in the operating system are scanned through the management application program; after the scanning is finished, displaying a junk file processing page, wherein the junk file processing page comprises the junk file directories, a selection option corresponding to each junk file directory and a junk file cleaning option; and deleting the files in the garbage file directory when the garbage file cleaning option is detected to be selected.
4. The device according to claim 3, wherein the calling module is configured to, during the running of the application program, load the hook function into the process of the application program when a file directory creation event is monitored; executing the hook function in the process of the application program.
5. A computer-readable storage medium, characterized in that a computer program is stored in the computer-readable storage medium, which computer program, when being executed by a processor, carries out the method steps of any one of the claims 1-2.
CN201610677067.8A 2016-08-16 2016-08-16 File directory identification method and device Active CN107766351B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610677067.8A CN107766351B (en) 2016-08-16 2016-08-16 File directory identification method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610677067.8A CN107766351B (en) 2016-08-16 2016-08-16 File directory identification method and device

Publications (2)

Publication Number Publication Date
CN107766351A CN107766351A (en) 2018-03-06
CN107766351B true CN107766351B (en) 2020-12-25

Family

ID=61260100

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610677067.8A Active CN107766351B (en) 2016-08-16 2016-08-16 File directory identification method and device

Country Status (1)

Country Link
CN (1) CN107766351B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109299039A (en) * 2018-08-30 2019-02-01 努比亚技术有限公司 A kind of file management method, equipment and computer readable storage medium
CN109408465B (en) * 2018-10-29 2021-07-13 Oppo广东移动通信有限公司 File attribution information recording method, device, storage medium and terminal
CN113536180A (en) * 2021-06-28 2021-10-22 北京达佳互联信息技术有限公司 Item processing method, item processing device, electronic equipment, storage medium and program product

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102902909A (en) * 2012-10-10 2013-01-30 北京奇虎科技有限公司 System and method for preventing file from being tampered
CN103678506A (en) * 2013-11-20 2014-03-26 北京奇虎科技有限公司 Method and device for loading application program shortcuts in browser and browser
CN104376257A (en) * 2014-12-12 2015-02-25 北京奇虎科技有限公司 Application self-protection and active defense method and application self-protection and active defense device
CN105512276A (en) * 2015-12-04 2016-04-20 北京金山安全软件有限公司 Method and device for constructing junk file and electronic equipment

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6879988B2 (en) * 2000-03-09 2005-04-12 Pkware System and method for manipulating and managing computer archive files
US7979494B1 (en) * 2006-11-03 2011-07-12 Quest Software, Inc. Systems and methods for monitoring messaging systems
US9116906B2 (en) * 2012-06-12 2015-08-25 Sap Se Centralized read access logging
CN103514396B (en) * 2013-09-23 2017-11-03 北京奇虎科技有限公司 File/applied program processing method and device on communication terminal
CN105335367B (en) * 2014-05-30 2018-12-14 北京金山安全软件有限公司 Method, device and server for determining application program associated with file directory
CN105278925B (en) * 2014-06-05 2019-05-21 腾讯科技(深圳)有限公司 The method and device of rubbish removing is carried out to the software of unloading
CN104376255B (en) * 2014-11-28 2017-05-24 北京奇虎科技有限公司 Application program running control method and device
CN105786456B (en) * 2014-12-22 2018-10-12 迈普通信技术股份有限公司 A kind of method and device for realizing VxWorks task Hook Function function
CN104881291B (en) * 2015-06-03 2018-05-25 北京金山安全软件有限公司 Control method and device of default browser and terminal

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102902909A (en) * 2012-10-10 2013-01-30 北京奇虎科技有限公司 System and method for preventing file from being tampered
CN103678506A (en) * 2013-11-20 2014-03-26 北京奇虎科技有限公司 Method and device for loading application program shortcuts in browser and browser
CN104376257A (en) * 2014-12-12 2015-02-25 北京奇虎科技有限公司 Application self-protection and active defense method and application self-protection and active defense device
CN105512276A (en) * 2015-12-04 2016-04-20 北京金山安全软件有限公司 Method and device for constructing junk file and electronic equipment

Also Published As

Publication number Publication date
CN107766351A (en) 2018-03-06

Similar Documents

Publication Publication Date Title
CN104518953B (en) Method for deleting message, instant communication terminal and system
CN107368518B (en) Notification message management method, terminal and computer readable storage medium
CN109857403B (en) Page updating method and device, page processing method and device
CN106502703B (en) Function calling method and device
CN107204964B (en) Authority management method, device and system
CN104123120B (en) A kind of browser page data filtering method, device and system
CN106775833B (en) Device driver loading method, terminal and system
CN110020293B (en) Multimedia data display method, device and storage medium
CN103177217B (en) A kind of file scanning method, system and client and server
CN104869465A (en) Video playing control method and device
CN103607431B (en) Mobile terminal resource processing method, device and equipment
CN112749074B (en) Test case recommending method and device
CN107766351B (en) File directory identification method and device
CN103944922B (en) Data processing method, terminal, server and system
CN106682189B (en) File name display method and device
CN104135504B (en) A kind of service providing method, Apparatus and system based on application
CN103399706A (en) Page interaction method, device and terminal
CN106095423B (en) Method, terminal and server for providing browsing service
CN106302101B (en) Message reminding method, terminal and server
CN103227832A (en) Shared resource processing method and device
CN106230919B (en) File uploading method and device
CN105703808A (en) Method and device for transmitting data
CN104702643A (en) A webpage access method, device and system
CN104717283A (en) File downloading control method, terminal and logic processing server
CN108269223B (en) Webpage graph drawing method and terminal

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