CN109359092B - File management method, desktop display method, device, terminal and medium - Google Patents

File management method, desktop display method, device, terminal and medium Download PDF

Info

Publication number
CN109359092B
CN109359092B CN201811135555.1A CN201811135555A CN109359092B CN 109359092 B CN109359092 B CN 109359092B CN 201811135555 A CN201811135555 A CN 201811135555A CN 109359092 B CN109359092 B CN 109359092B
Authority
CN
China
Prior art keywords
file
target
information
operating system
latest
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
CN201811135555.1A
Other languages
Chinese (zh)
Other versions
CN109359092A (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 CN201811135555.1A priority Critical patent/CN109359092B/en
Publication of CN109359092A publication Critical patent/CN109359092A/en
Application granted granted Critical
Publication of CN109359092B publication Critical patent/CN109359092B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The embodiment of the invention discloses a file management method, a desktop display method, a device, a terminal and a medium, wherein the file management method is applied to the terminal and comprises the following steps: acquiring process information of a target process in an operating system of the terminal, wherein the target process is any process which is started in the operating system and has a file operation event; analyzing the process information of the target process to obtain the file information of the target file, wherein the file information of the target file comprises the file path of the target file; and updating the latest file directory of the operating system according to the file information of the target file. The invention can store the file information of the file opened by adopting the non-standard operation method into the license catalog in time, thereby ensuring the accuracy and the comprehensiveness of the license catalog.

Description

File management method, desktop display method, device, terminal and medium
Technical Field
The present invention relates to the field of internet technologies, and in particular, to the field of data processing technologies, and in particular, to a file management method, a desktop display method, a file management device, a desktop display device, a terminal, and a computer storage medium.
Background
File management is a collective term for a group of software, managed files, and some data structures required for implementing file management in an operating system, and mainly relates to logical organization and physical organization of files. When the operating system manages files, the file information of the files recently opened by the user is stored in a latest file directory (a license directory) of the operating system, so that the user can conveniently and quickly find the files recently opened through the license directory.
Currently, file operation methods can be classified into standard operation methods and non-standard operation methods, and the standard operation method generally refers to a method of operating a file by entering a system hard disk according to a file path, for example: for a file with a file path of D/A folder/a.docx, the user opens the file according to the method of opening D disc, opening A folder and opening a.docx file, and the operation method is regarded as a standard operation method; the non-standard operation method generally refers to a method of operating a file by an application program; for example: the file a.docx file is a file received and downloaded through instant messaging software, and a user directly opens the file a.docx through the instant messaging software, and the operation method is considered to be a non-standard operation method. In the prior art, when a standard operation method is adopted to operate a file, an operating system responds to an operation instruction to open the file, and meanwhile, the operating system automatically records file information of the operated file and stores the file information into a percent directory; however, if the file operation is performed by adopting the non-standard operation method, the operating system cannot record the file information of the operated file, so that the license directory of the operating system cannot accurately and comprehensively store the file information of the file recently opened by the user.
Disclosure of Invention
The embodiment of the invention provides a file management method, a desktop display method, a device, a terminal and a medium, which can store file information of a file opened by adopting a non-standard operation method into a license catalog in time, and ensure the accuracy and the comprehensiveness of the license catalog.
In one aspect, an embodiment of the present invention provides a file management method, applied to a terminal, where the file management method includes:
acquiring process information of a target process in an operating system of the terminal, wherein the target process is any process which is started in the operating system and has a file operation event; the process information of the target process comprises command line parameters, wherein the command line parameters carry file information of a target file corresponding to a file operation event of the target process;
analyzing the process information of the target process to obtain the file information of the target file, wherein the file information of the target file comprises the file path of the target file;
and updating the latest file directory of the operating system according to the file information of the target file.
On the other hand, the embodiment of the invention provides a desktop display method, which is applied to a terminal, and comprises the following steps:
Reading a latest file directory in an operating system of the terminal, wherein the latest file directory comprises file information of one or more files, and the file information of one or more files in the latest file directory is managed by adopting the file management method;
acquiring a latest file display window displayed in a desktop of the terminal;
displaying the read file information of one or more files in the latest file directory in the latest file display window.
In still another aspect, an embodiment of the present invention provides a file management apparatus, applied to a terminal, including:
the system comprises an acquisition unit, a file operation unit and a file operation unit, wherein the acquisition unit is used for acquiring process information of a target process in an operating system of the terminal, wherein the target process is any process which is started in the operating system and has a file operation event; the process information of the target process comprises command line parameters, wherein the command line parameters carry file information of a target file corresponding to a file operation event of the target process;
the analysis unit is used for analyzing the process information of the target process to acquire the file information of the target file, wherein the file information of the target file comprises the file path of the target file;
And the updating unit is used for updating the latest file directory of the operating system according to the file information of the target file.
In still another aspect, an embodiment of the present invention provides a desktop display apparatus, which is applied to a terminal, including:
a reading unit, configured to read a latest file directory in an operating system of the terminal, where the latest file target includes file information of one or more files, and the file information of one or more files in the latest file directory is managed by using the file management method described above;
the acquisition unit is used for acquiring a latest file display window displayed in a desktop of the terminal;
and a display unit for displaying the read file information of one or more files in the latest file directory in the latest file display window.
In still another aspect, an embodiment of the present invention provides a terminal, where the terminal includes an input device and an output device, and the terminal further includes:
a processor adapted to implement one or more instructions; the method comprises the steps of,
a computer storage medium storing one or more first instructions adapted to be loaded by the processor and to perform the steps of:
Acquiring process information of a target process in an operating system of the terminal, wherein the target process is any process which is started in the operating system and has a file operation event; the process information of the target process comprises command line parameters, wherein the command line parameters carry file information of a target file corresponding to a file operation event of the target process;
analyzing the process information of the target process to obtain the file information of the target file, wherein the file information of the target file comprises the file path of the target file;
and updating the latest file directory of the operating system according to the file information of the target file.
Alternatively, the computer storage medium stores one or more second instructions adapted to be loaded by the processor and perform the steps of:
reading a latest file directory in an operating system of the terminal, wherein the latest file directory comprises file information of one or more files, and the file information of one or more files in the latest file directory is managed by adopting the file management method;
acquiring a latest file display window displayed in a desktop of the terminal;
Displaying the read file information of one or more files in the latest file directory in the latest file display window.
In yet another aspect, embodiments of the present invention provide a computer storage medium storing one or more first instructions adapted to be loaded by a processor and to perform the steps of:
acquiring process information of a target process in an operating system of the terminal, wherein the target process is any process which is started in the operating system and has a file operation event; the process information of the target process comprises command line parameters, wherein the command line parameters carry file information of a target file corresponding to a file operation event of the target process;
analyzing the process information of the target process to obtain the file information of the target file, wherein the file information of the target file comprises the file path of the target file;
and updating the latest file directory of the operating system according to the file information of the target file.
Alternatively, the computer storage medium stores one or more second instructions adapted to be loaded by a processor and perform the steps of:
Reading a latest file directory in an operating system of the terminal, wherein the latest file directory comprises file information of one or more files, and the file information of one or more files in the latest file directory is managed by adopting the file management method;
acquiring a latest file display window displayed in a desktop of the terminal;
displaying the read file information of one or more files in the latest file directory in the latest file display window.
In the embodiment of the invention, when the target process operates (such as opening, modifying and the like) on the target file, the process information of the target process can be acquired; the process information comprises a command line parameter, the command line parameter carries file information of a target file, the file information of the target file can be obtained by analyzing the process information, and then the latest file directory of the operating system can be updated according to the file information. Therefore, the embodiment of the invention realizes file management by acquiring and analyzing the process information, so that corresponding process information can be intercepted and managed as long as the file operation event exists, thereby timely storing the file information of the recently operated target file into the license catalog and ensuring the accuracy and the comprehensiveness of the license catalog.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic diagram of an operating system according to an embodiment of the present invention;
FIG. 2 is a flow chart of a file management method according to an embodiment of the present invention;
FIG. 3 is a flowchart illustrating a file management method according to another embodiment of the present invention;
FIG. 4 is an application scenario diagram of a file management method according to an embodiment of the present invention;
fig. 5 is a schematic flow chart of a desktop display method according to an embodiment of the present invention;
fig. 6a is an application scenario diagram of a desktop display method according to an embodiment of the present invention;
FIG. 6b is an application scenario diagram of another desktop display method according to an embodiment of the present invention;
FIG. 6c is an application scenario diagram of another desktop display method according to an embodiment of the present invention;
FIG. 7 is a schematic diagram of a file management apparatus according to an embodiment of the present invention;
Fig. 8 is a schematic structural diagram of a desktop display device according to an embodiment of the present invention;
fig. 9 is a schematic structural diagram of a terminal according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention.
An Operating System (OS) is a computer program that manages and controls computer hardware and software resources, and in an embodiment of the present invention, the Operating System may refer to a System that has a process monitoring function and includes a recovery directory, and may include, but is not limited to: windows operating system (Windows operating system), linux operating system, android operating system (Android system), etc. Taking Windows operating system as an example, as shown in FIG. 1, the operating system can be divided into Kernel mode (Kernel Model) and User mode (User Model). The kernel mode part comprises a system service distributor and a driving layer, wherein the system service distributor can be used for realizing communication between the driving layer and the user mode part, and the driving layer can be used for monitoring one or more started processes in the operating system; the user mode portion includes an application layer that includes an application programming interface and one or more applications or the like that can obtain corresponding system services from the kernel mode portion by invoking the application programming interface.
In the embodiment of the present invention, the operating system includes a file management program, which may be an application program located at an application layer, that is, an exe (executable program ) program in the Windows operating system; the file manager may be used to perform management operations on a count directory in an operating system. The method comprises the steps that a license catalog is a user-state file catalog in an operating system, and a license target is used for recording file information of a file which is recently operated in the operating system; the "latest" herein refers to a preset period of time before the current system time of the operating system, which may be set according to actual needs, for example, the preset period of time may be set to 5 minutes, 20 minutes, 10 hours, etc.; for example, the current system time of the operating system is 10:30, and the preset time period is 10 hours: if the user opens file a at 10:15, it can be determined that file a is the most recently operated file. The files may include, but are not limited to, various types of files such as video, audio, documents, pictures, etc., and may be files stored in a system hard disk of an operating system, files downloaded in real time through various application programs in the operating system, or files stored in a cloud of various application programs in the operating system. File information may be used to describe various attributes of a file, which may include, but is not limited to: file path, file name, file size, time parameters of the file, etc.
A process is a running activity of a program in a computer on a certain data set, is a basic unit of resource allocation and scheduling by an operating system, and is a basis of an operating system structure. The processes may include two types, a service process and an application process; the service process refers to a process generated to ensure normal running of the operating system, or refers to a process generated by the operating system to respond to a user performing a file operation by using a standard operation method (for example, opening a file by using a standard operation method). The application process refers to a process generated by an operating system to support normal running of an application program when the application program in an application layer is started, and generally, one application program corresponds to one application process; for example: when an email (Electronic Mail) application program in an application layer is started, an application process corresponding to the email application program is started at a driving layer of an operating system so as to support the normal operation of the email application program; correspondingly, when an application program in the application layer executes file operation, a file operation event generated by an application process corresponding to the application program can be monitored in a driving layer of an operating system; as indicated by the dashed box in fig. 1.
Based on this, the embodiment of the invention provides a file management scheme, which specifically comprises the following steps: when there is a file operation (such as opening a file, modifying a file, etc.) in the operating system, whether the file operation is performed by a standard operation method (such as an operation that a user enters a system hard disk according to a file path to open the file), or the file operation is performed by a non-standard operation method (such as an operation that a user opens the file through an application program), in response to the file operation, a driver layer of the operating system detects process information of a corresponding process (including a service process or an application process), and then the process information is transferred to a file management program to analyze, so that file information of a file that is recently operated can be obtained, and further, the file information of the file that is recently operated can be updated into a license directory of the operating system. As described in the foregoing background art, the operating system has a function of automatically recording file information of files operated by a standard operating method, so in order to save resources and avoid duplicate recording, the file management scheme of the embodiment of the present invention focuses on managing a target file operated by a non-standard operating method, that is, the target process may include an application process generated in response to file operations performed by a non-standard operating method.
In combination with the operating system architecture diagram shown in fig. 1, the working principle of the file management scheme is as follows: (1) the operating system may call a driver layer (driver module) in the kernel mode part to load a system driver through which a hook system API (Application Programming Interface ) is hooked to monitor each started process in the operating system in real time; (2) if a certain target file is subjected to operations such as opening, modifying or editing, the operating system can monitor a target process which is started and has a file operation event in a driving layer, the target process can be an application process, and then the process information of the target process can be acquired, wherein the process information of the target process comprises command line parameters, and the command line parameters at least carry the file information of the target file; (3) the system service distributor transfers the process information of the target process from the driver layer to a file management program (i.e., exe program) in the application layer. (4) After the process information of the target process is acquired, the file management program analyzes the process information of the target process to acquire the file information of the target file, and writes the file information of the target file into a license directory of an operating system.
The file management scheme provided by the embodiment of the invention realizes the management of the recently operated file by acquiring and analyzing the process information; therefore, the corresponding process information can be intercepted and managed only by the existence of the file operation event, so that the file information of the recently operated target file can be timely stored in the license catalog, and the accuracy and the comprehensiveness of the license catalog are ensured.
Based on the above description, the embodiment of the present invention proposes a file management method as shown in fig. 2, and the file management method may be applied to a terminal, where the terminal may include, but is not limited to: smart phones, desktop computers, notebook computers, laptop computers, etc.; the terminal is provided with an operating system, and the operating system comprises a driving layer and a file management program. Referring to fig. 2, the file management method may be executed by a file management program in the above-mentioned operating system, and the file management method may include the following steps S201 to S203:
s201, process information of a target process in an operating system of the terminal is obtained.
The file management program can acquire the process information of a target process in the operating system from a driving layer of the operating system of the terminal, wherein the target process is any process which is started in the operating system and has a file operation event. Specifically, the driver layer may monitor each started process in the operating system in real time, such as process 1, process 2, process 3, process N, and so on in fig. 2. If the user performs file operation on the target file through the target application program, the driving layer can monitor that a corresponding file operation event exists in a target process corresponding to the target application program. In one embodiment, the file manipulation event may include, but is not limited to: file access events (also referred to as file open events), file creation events, file update events, file save events, and so forth.
If the driver layer monitors that one or more started processes have file operation events, one process can be selected from the one or more started processes with file operation events as a target process. The driver layer may then obtain process information of the target process, where the process information of the target process may include a command line parameter, where the command line parameter carries file information of a target file corresponding to a file operation event of the target process, and the command line parameter is a parameter given in a command line when the operating system operates the target process in a command line manner. After the driving layer obtains the process information of the target process, the driving layer can transmit the process information of the target process to the file management program so that the file management program can obtain the process information of the target process.
S202, analyzing the process information of the target process to acquire the file information of the target file, wherein the file information of the target file comprises the file path of the target file.
S203, updating the latest file directory of the operating system according to the file information of the target file.
In steps S202-S203, since the command line parameter in the process information of the target process carries the file information of the target file, after the file management program obtains the process information of the target process, the command line parameter in the process information may be analyzed in step S202, so that the file information of the target file may be obtained, where the file information includes the file path of the target file. In one embodiment, the file information may further include information such as a file name, a file type, a file size, and the like of the target file. After the file information of the target file is acquired, the latest file directory of the operating system may be updated according to the file information of the target file.
In one embodiment, the updating of the latest file directory of the operating system according to the file information of the target file may be: detecting whether file information of a target file exists in a latest file directory of an operating system; if the file information of the target file does not exist in the latest file directory of the operating system, the file information of the target file is added into the latest file directory of the operating system. In one embodiment, the file information of the target file further includes at least one of: file name, file size and time parameters; if the file information of the target file exists in the latest file catalog of the operating system, judging whether the file information of the target file carried in the command line parameter is consistent with the file information of the target file existing in the latest file catalog of the operating system; if the file information of the target file carried in the command line parameters is inconsistent, updating the latest file directory of the operating system. Wherein the time parameter comprises at least one of: creation time parameter, access time parameter, update time parameter, and save time parameter.
In the embodiment of the invention, when the target process operates (such as opening, modifying and the like) on the target file, the process information of the target process can be acquired; the process information comprises a command line parameter, the command line parameter carries file information of a target file, the file information of the target file can be obtained by analyzing the process information, and then the latest file directory of the operating system can be updated according to the file information. Therefore, the embodiment of the invention realizes file management by acquiring and analyzing the process information, so that corresponding process information can be intercepted and managed as long as the file operation event exists, thereby timely storing the file information of the recently operated target file into the license catalog and ensuring the accuracy and the comprehensiveness of the license catalog.
Based on the above description, an embodiment of the present invention proposes a file management method as shown in fig. 3, which may be applied to a terminal, which may include, but is not limited to: smart phones, desktop computers, notebook computers, laptop computers, etc.; the terminal is provided with an operating system, and the operating system comprises a driving layer and a file management program. Referring to fig. 3, the file management method may be executed by the file management program in the operating system, and the file management method may include the following steps S301 to S306:
s301, a message notification is acquired from the driver layer.
From the foregoing, the driver layer may monitor each initiated process in the operating system. In the implementation process, the driving layer may load a system driver, and the system driver may call back through a HOOK registry in a HOOK framework in the driving layer, where the HOOK is a system mechanism provided in an operating system to replace "interrupt" under DOS (Disk Operating System ), and may be called "HOOK" or "HOOK", that is, the HOOK framework may be called a HOOK framework; and hooks the system API according to the SSDT (System Services Descriptor Table ) to enable monitoring of started processes in the operating system.
After the driving layer monitors the target process with the file operation event in the started process, the driving layer can intercept the process information of the target process through HOOK, and throw the process information of the target process to the file management program through the policy engine, and send a message notification to the file management program. Specifically, the driving layer may firstly package the process information of the target process, and insert the packaged process information into the event queue to wait for being thrown to the file management program; and then the driving layer can sequentially upload the information (including the packed process information) in the event queue to the file management program through IPC communication (Inter-Process Communication ) according to preset upload logic.
The file management program may obtain the message notification from the driver layer, where the message notification may carry process information of the target process, where the process information of the target process is intercepted by the driver layer when it is detected that the target process is started in the operating system and a file operation event exists.
S302, analyzing the process information of the target process from the message notification.
Because the message notification carries the process information of the target process, the file management program can analyze the message notification after acquiring the message notification, so as to acquire the process information of the target process, and the process information of the target process can comprise command line parameters which carry the file information of the target file corresponding to the file operation event of the target process.
S303, analyzing file information of the target file from command line parameters in the process information of the target process, wherein the file information of the target file comprises a file path of the target file.
As can be seen from the foregoing, since the operating system itself has a function of recording file information of the file operated by the standard operating method, in order to save processing resources, avoid dragging the operating speed of the operating system due to occupation of the processing resources and repeatedly recording the file information, the file management method provided by the embodiment of the present invention focuses on managing the target file operated by the non-standard operating method. That is, if the target process is a service process generated in response to the file operation on the target file using the standard operation method, the operating system may be used to directly record the file information of the target file without wasting processing resources to execute step S303. Therefore, in one embodiment, the process information of the target process may further include a process name of the target process, and after step S302, the method may further include the following steps: (1) obtaining a blacklist, wherein the blacklist comprises at least one name of a non-associated process, the non-associated process refers to a service process generated by an operating system in order to respond to file operation by a user by adopting a standard operation method, or refers to a service process generated by the operating system in order to ensure normal operation of the operating system, and the service process may also open certain files to generate file operation events, but the file operation events are only generated by the inside of the operating system in order to support normal operation and are not generated by actual operation of a target file by the user through an application program; taking Windows operating system as an example, the unassociated process may include: svchost.exe (a system program in the Windows operating system, which is a generic host process name of a service running in a dynamic link library), conhost.exe (Console Host Process, a host process of a command line program), dllhost.exe (a part of the Windows operating system for managing a dynamic link library application), and the like. (2) Judging whether the name of the target process belongs to a blacklist or not; (3) if the name of the target process does not belong to the blacklist, step S303 is performed.
In still another embodiment, the process information of the target process may further include a process name of the target process, and after step S302, the method may further include the following steps: (1) acquiring a white list, wherein the white list can comprise at least one name of an associated process, and the associated process is an application process corresponding to an application program in an operating system; the associated process refers to an application process with file operation capability in an operating system, for example: an application process corresponding to an instant messaging application program, an application process corresponding to an email application program, and the like; (2) judging whether the name of the target process belongs to a white list or not; (3) if the name of the target process belongs to the white list, step S303 is executed.
In yet another embodiment, if the target process is an application process corresponding to an application program, since the command line parameters of different application programs are different, for example, space is included in the command line parameters of some application programs, special characters and escape characters are included in the command line parameters of some application programs, outliers are included in the command line parameters of some application programs, and so on. Therefore, the embodiment of the invention adopts a unified preset parameter format aiming at the command line parameters of different application programs, so that the command line parameters can be analyzed conveniently, and the analysis efficiency is improved. Therefore, after parsing out the process information of the target process in step S302, the following steps may be further included: (1) judging whether the parameter format of the command line parameters in the process information of the target process meets the preset parameter format or not; (2) if yes, executing the step of analyzing the file information of the target file from the command line parameters in the process information of the target process, namely executing step S303; (3) if not, carrying out normalization processing on command line parameters in the process information of the target process according to a preset parameter format; for the normalized command line parameters, a step of parsing file information of the target file from the command line parameters in the process information of the target process is performed, that is, step S303 is performed.
The specific implementation mode of carrying out normalization processing on the command line parameters in the process information of the target process according to the preset parameter format can be as follows: acquiring a filter of a target application program corresponding to a target process; and applying the command line parameters to a preset parameter format by adopting the filter to match so as to normalize the command line parameters.
It should be noted that, the step of determining whether the target process is a service process and the step of determining whether the parameter format of the command line parameter satisfies the preset parameter format may be performed, that is, when the target process is not a service process and the parameter format of the command line parameter satisfies the preset parameter format, step S303 is performed. In one embodiment, after analyzing the process information of the target process, it may be first determined whether the target process is a service process; if not, judging whether the parameter format of the command line parameters meets the preset parameter format; if yes, go to step S303; if not, carrying out normalization processing on the command line parameters. In another embodiment, the step of determining whether the parameter format of the command line parameter satisfies the preset parameter format may be performed first, and then the step of determining whether the target process is a service process may be performed, and if not, the step S303 may be performed. In still another embodiment, the step of determining whether the target process is a service process and the step of determining whether the parameter format of the command line parameter satisfies the preset parameter format may be performed simultaneously, which is not limited herein. In other embodiments, only the step of determining whether the target process is a service process or whether the parameter format of the command line parameter satisfies the preset parameter format may be performed.
S304, verifying the validity of the target file according to the file information of the target file.
Since the user may change the file information of the target file after the file management program obtains the file information of the target file, for example, the file path in the file information of the target file obtained by the file management program is "application a/folder 1", and the user moves the target file from "folder 1" to "folder 2", the actual file path of the target file at this time is changed to "application a/folder 2". In this case, the "no object file in folder 1", i.e., the file path "application a/folder 1" in the acquired file information is an erroneous file path. For another example, the file path in the file information of the target file obtained by the file management program is "application a/folder 1", and the user deletes the target file, and at this time, there is no target file in "folder 1", and the file path "application a/folder 1" is also an erroneous file path. If the error file path is updated to the latest file directory, the user cannot quickly open the target file in the latest file directory, and the user cannot find the target file through the error file path.
Therefore, after the file information of the target file is obtained, the validity of the target file can be checked according to the file information of the target file, so as to judge whether the file path is correct, i.e. whether the target file corresponding to the file path exists. Specifically, when the validity of the target file is verified according to the file information of the target file, if the validity of the target file is verified through the standard API, when the operating system accesses the target file through the standard API, there is a very high probability that the target application program accessing the target file generates file access conflict, thereby affecting the operation of the target application program. Thus, embodiments of the present invention employ a non-preemptive API to check the validity of a target file, which may include, but is not limited to: a memory mapped API, an API that creates temporary folders, etc. The validity of the target file is checked by adopting the non-preemptive API, so that the condition that the operating system and the target application program generate file access conflict can be avoided, and the normal operation of the target application program can be ensured.
Accordingly, in one embodiment, the specific embodiment of verifying the validity of the target file according to the file information of the target file may be: (1) calling a first non-preemptive application programming interface to create a temporary folder; (2) acquiring a target file according to a file path of the target file; (3) and if the target file is successfully stored in the temporary folder, determining that the target file is successfully checked. The non-preemptive first application programming interface in this embodiment may be an API that creates temporary folders.
In still another embodiment, the specific embodiment of verifying the validity of the target file according to the file information of the target file may be: (1) calling a second non-preemptive application programming interface to create a temporary operation area and a mapping relation between the temporary operation area and the memory of an operating system; (2) acquiring a target file according to a file path of the target file, and mapping the target file from a memory of an operating system to a temporary operating area according to the mapping relation; (3) and if the target file is successfully accessed in the temporary operation area, determining that the target file is successfully checked. The non-preemptive second application programming interface in this embodiment may be a memory mapped API.
In other embodiments, the file information may further include a file name of the target file, and before verifying the validity of the target file according to the file information of the target file, the validity of the target file may be further verified preliminarily according to the file name of the target file. Specific: (1) acquiring a white list, wherein the white list comprises at least one file extension of an effective file, and the file extension is also called a suffix name of the file, so that the white list is a mechanism for marking the file type by an operating system; (2) judging whether the file extension of the file name of the target file belongs to a white list or not; (3) if the file extension of the file name of the target file belongs to the white list, executing the step of checking the validity of the target file according to the file information of the target file, namely further adopting a non-preemptive API to check the validity of the target file according to the file path of the target file; and if the file extension name of the file name of the target file does not belong to the white list, determining that the target file is an invalid file. (4) If the target file is an invalid file, the subsequent step of checking the validity of the target file according to the file information of the target file is not executed any more, and processing resources can be saved.
S305, if the verification of the target file is successful, acquiring the file information of the target file.
S306, updating the latest file directory of the operating system according to the file information of the target file.
In the embodiment of the invention, when the target process operates (such as opening, modifying and the like) on the target file, the process information of the target process can be acquired; the process information comprises a command line parameter, the command line parameter carries file information of a target file, the file information of the target file can be obtained by analyzing the process information, and then the latest file directory of the operating system can be updated according to the file information. Therefore, the embodiment of the invention realizes file management by acquiring and analyzing the process information, so that corresponding process information can be intercepted and managed as long as the file operation event exists, thereby timely storing the file information of the recently operated target file into the license catalog and ensuring the accuracy and the comprehensiveness of the license catalog.
Based on the description of the above embodiment, the embodiment of the present invention further provides an application scenario diagram of a file management method, as shown in fig. 4. The drive layer of the operating system can monitor each started process in the operating system in real time. The user opens the file 1 (target file) through the application program 1 in the desktop, that is, the user performs a file operation on the target file through the application program 1, and at this time, the application program 1 can trigger the corresponding process 1 (target process) to generate a file operation event. After the driving layer of the operating system monitors that the process 1 generates the file operation event, the process information of the process 1 can be acquired and transferred to the file management program. The file management program may analyze the process information to obtain file information of the file 1, where the file information may include a file path of the file 1; the file manager may then update the file information for file 1 into the last file directory of the operating system. Products in the operating system that rely on information such as the user's most recently opened file (e.g., desktop organizer applications, desktop display applications, etc.) may read file information for one or more files from the most recent file directory, the file information for the one or more files including file 1's file information. And displaying the read file information of the one or more files in a latest file display window of the desktop.
Therefore, on the basis that the operating system has the function of automatically recording the file information of the file operated by the standard operating method, the file management method provided by the embodiment of the invention can also record the file information of the target file operated by the non-standard operating method, so that the accuracy and the comprehensiveness of the license catalog are ensured. Of course, if the operating system does not have the function of automatically recording the file information of the file operated by the standard operating method, the file management method provided by the embodiment of the invention can also be used for recording the file information of the target file operated by the standard operating method, namely, the service process which is started and has the file operation event is also used as the target process to realize the file management.
Based on the description of the embodiments, the embodiment of the invention provides a desktop display method, which is applied to a terminal. Please refer to fig. 5. The desktop display method can be executed by a product (such as a desktop collating application program) in an operating system of the terminal, wherein the product depends on the information that a user recently opens a file. As shown in fig. 5, the desktop display method may include the following steps S501 to S503:
S501, the latest file directory in the operating system of the terminal is read.
Wherein the latest file directory includes file information of one or more files, and the file information of the one or more files in the latest file directory is managed using the file management method shown in fig. 2 or 3. In one embodiment, the desktop collation application may periodically (e.g., every 5 minutes, every 2 hours, etc.) read file information for one or more files in the last file directory of the operating system. In yet another embodiment, when the last file directory update of the operating system, the file manager may send a notification of the directory update to the desktop collation application. The desktop collation application may read file information for one or more files in the last file directory of the operating system after receiving notification of the directory update.
S502, acquiring a latest file display window displayed in a desktop of the terminal.
One or more file display windows may be included in the desktop, such as: a recent file display window for receiving and displaying a file recently operated (e.g., recently opened) by a user, a commonly used file display window for receiving and displaying a commonly used file by a user, a desktop file display window for receiving and displaying a file on a desktop of a terminal, and the like. Wherein the latest file display window corresponds to the latest file catalog one by one. Before displaying the file information of one or more files in the latest file directory, the desktop finishing application program needs to acquire the latest file display window in the desktop, i.e. determine the position of the latest file display window in the terminal desktop. In one embodiment, the desktop collation application may obtain the most recent file display window directly from the window name. In yet another embodiment, the desktop collation application may determine the location of the most recent file display window based on the mapping of the most recent file directory to the location of the most recent file display window. In still another embodiment, each file display window has a window identifier, and the desktop collation application may determine the target window identifier corresponding to the latest file directory first, and then determine the latest file display window according to the target window identifier.
S503, displaying the file information of the one or more files in the read latest file directory in the latest file display window.
In one embodiment, the file information may include a file path. In yet another embodiment, the file information may further include one or more of file name, file type, file size, etc.
When the file information of the file recently opened by the user is displayed in the recent file display window, the embodiment of the invention can read the file information of one or more files in the recent file catalog of the operating system, and display the read file information of one or more files in the recent file display window, so that the user can conveniently check the file information, and the user can quickly open the target file through the recent file display window. Because the file information of the one or more files is managed by adopting the file management method, the latest file display window can accurately and comprehensively display the file information of the file recently opened by the user, and the user experience can be improved.
Based on the above description, the embodiment of the present invention further proposes an application scenario diagram of a desktop display method as shown in fig. 6a to 6c, where the desktop display method may be executed by a desktop collation application in a terminal. The desktop organizer application may be displayed in the form of an icon in the desktop of the user interface or terminal, as shown in fig. 6 a. The user may start the desktop collating application by clicking the icon, and after detecting a click command of clicking the icon by the user, the terminal may start the desktop collating application and display one or more file display windows on the desktop of the terminal, where the application scenario is shown in fig. 6b, for example, by displaying only the latest file display window. It should be appreciated that in other application scenarios, other file display windows may also be displayed, such as a desktop file display window.
After the desktop collating application is started, the latest file directory in the operating system may be read, and the latest file display window may be obtained from one or more file display windows displayed in the desktop of the terminal. File information of the one or more files in the read latest file directory, which may include one or more of file path, file name, file type, file size, etc., is then displayed in the latest file display window, as shown in fig. 6 c.
When the file information of the file recently opened by the user is displayed in the recent file display window, the embodiment of the invention can read the file information of one or more files in the recent file catalog of the operating system, and display the read file information of one or more files in the recent file display window, so that the user can conveniently check the file information, and the user can quickly open the target file through the recent file display window. Because the file information of the one or more files is managed by adopting the file management method, the latest file display window can accurately and comprehensively display the file information of the file recently opened by the user, and the user experience can be improved.
Based on the description of the above embodiments of the file management method, the embodiments of the present invention also provide a file management apparatus, which may be an application program (including program code) running in a terminal, and specifically may be the file management program in the above embodiments. The file management apparatus may perform the methods shown in fig. 2 and 3. Referring to fig. 7, the file management apparatus may operate the following units:
an obtaining unit 101, configured to obtain process information of a target process in an operating system of the terminal, where the target process is any process that has been started in the operating system and has a file operation event; the process information of the target process comprises command line parameters, and the command line parameters carry file information of a target file corresponding to a file operation event of the target process.
And an analysis unit 102, configured to analyze the process information of the target process to obtain file information of the target file, where the file information of the target file includes a file path of the target file.
An updating unit 103, configured to update a latest file directory of the operating system according to file information of the target file.
In one embodiment, the operating system includes a driver layer; accordingly, when acquiring the process information of the target process in the operating system of the terminal, the acquiring unit 101 may be specifically configured to: acquiring a message notification from the driving layer, wherein the message notification carries process information of the target process, and the process information of the target process is intercepted by the driving layer when the driving layer monitors that the target process is started in the operating system and a file operation event exists; and analyzing the process information of the target process from the message notification.
In still another embodiment, when analyzing the process information of the target process to obtain the file information of the target file, the analysis unit 102 may specifically be configured to: analyzing file information of the target file from command line parameters in the process information of the target process; verifying the validity of the target file according to the file information of the target file; and if the target file is successfully checked, acquiring the file information of the target file.
In yet another embodiment, the process information of the target process further includes a name of the target process, and the obtaining unit 101 is further configured to: obtaining a blacklist, wherein the blacklist comprises at least one name of a non-associated process, and the non-associated process is a service process in the operating system;
The analysis unit 102 may be further configured to: judging whether the name of the target process belongs to the blacklist or not; and if the name of the target process does not belong to the blacklist, executing the step of analyzing the file information of the target file from the command line parameters in the process information of the target process.
In yet another embodiment, the analysis unit 102 may be further configured to: judging whether the parameter format of the command line parameters in the process information of the target process meets a preset parameter format or not; if yes, executing the step of analyzing the file information of the target file from the command line parameters in the process information of the target process; if not, carrying out normalization processing on command line parameters in the process information of the target process according to the preset parameter format; and executing the step of analyzing the file information of the target file from the command line parameters in the process information of the target process aiming at the command line parameters after normalization processing.
In still another embodiment, when verifying the validity of the target file according to the file information of the target file, the analysis unit 102 may specifically be configured to: calling a first non-preemptive application programming interface to create a temporary folder; acquiring the target file according to the file path of the target file; and if the target file is successfully stored in the temporary folder, determining that the target file is successfully checked.
In still another embodiment, when verifying the validity of the target file according to the file information of the target file, the analysis unit 102 may specifically be configured to: calling a second non-preemptive application programming interface to create a temporary operation area and a mapping relation between the temporary operation area and a memory of an operating system; acquiring the target file according to the file path of the target file, and mapping the target file from the memory of the operating system to the temporary operating area according to the mapping relation; and if the target file is successfully accessed in the temporary operation area, determining that the target file is successfully checked.
In yet another embodiment, the file information further includes a file name of the target file; the obtaining unit 101 is further configured to, before verifying the validity of the target file according to the file information of the target file: acquiring a white list, wherein the white list comprises file extension names of at least one effective file;
the analysis unit 102 is further configured to: judging whether the file extension of the file name of the target file belongs to the white list or not; if the file extension of the file name of the target file belongs to the white list, executing a step of checking the validity of the target file according to the file information of the target file; and if the file extension of the file name of the target file does not belong to the white list, determining that the target file is an invalid file.
In still another embodiment, when updating the latest file directory of the operating system according to the file information of the target file, the updating unit 103 may be specifically configured to: detecting whether file information of the target file exists in a latest file directory of the operating system; if the file information of the target file does not exist in the latest file directory of the operating system, the file information of the target file is added into the latest file directory of the operating system.
In yet another embodiment, the file information of the target file further includes at least one of: file name, file size and time parameters; the updating unit 103 may be further configured to: if the file information of the target file exists in the latest file catalog of the operating system, judging whether the file information of the target file carried in the command line parameter is consistent with the file information of the target file existing in the latest file catalog of the operating system; if not, updating the latest file directory of the operating system according to the file information of the target file carried in the command line parameters; wherein the time parameter comprises at least one of: creation time parameter, access time parameter, update time parameter, and save time parameter.
According to one embodiment of the invention, the steps involved in the methods shown in fig. 2 and 3 may each be performed by a respective unit in the file management apparatus shown in fig. 7. For example, steps S201, S202, S203 shown in fig. 2 may be performed by the acquisition unit 101, the analysis unit 102, and the update unit 103 shown in fig. 7, respectively; as another example, steps S301 to S302 shown in fig. 3 may be performed by the acquisition unit 101 shown in fig. 7, steps S303 to S305 may be performed by the analysis unit 102 shown in fig. 7, and step S306 may be performed by the update unit 103 shown in fig. 7.
According to another embodiment of the present invention, each unit in the file management apparatus shown in fig. 7 may be separately or completely combined into one or several additional units, or some unit(s) thereof may be further split into a plurality of units with smaller functions, which may achieve the same operation without affecting the implementation of the technical effects of the embodiments of the present invention. The above units are divided based on logic functions, and in practical applications, the functions of one unit may be implemented by a plurality of units, or the functions of a plurality of units may be implemented by one unit. In other embodiments of the present invention, the file management apparatus may also include other units, and in practical applications, these functions may also be implemented with assistance from other units, and may be implemented by cooperation of a plurality of units.
According to another embodiment of the present invention, a file management apparatus device as shown in fig. 7 may be constructed by running a computer program (including program code) capable of executing the steps involved in the respective methods as shown in fig. 2 and 3 on a general-purpose computing device such as a computer including a processing element such as a Central Processing Unit (CPU), a random access storage medium (RAM), a read only storage medium (ROM), and the like, and a storage element, and implementing the file management method of the embodiment of the present invention. The computer program may be recorded on, for example, a computer-readable recording medium, and loaded into and executed by the above-described computing device via the computer-readable recording medium.
In the embodiment of the invention, when the target process operates (such as opening, modifying and the like) on the target file, the process information of the target process can be acquired; the process information comprises a command line parameter, the command line parameter carries file information of a target file, the file information of the target file can be obtained by analyzing the process information, and then the latest file directory of the operating system can be updated according to the file information. Therefore, the embodiment of the invention realizes file management by acquiring and analyzing the process information, so that corresponding process information can be intercepted and managed as long as the file operation event exists, thereby timely storing the file information of the recently operated target file into the license catalog and ensuring the accuracy and the comprehensiveness of the license catalog.
Based on the description of the embodiment of the desktop display method, the embodiment of the invention also provides a desktop display device, which may be an application program (including program code) running in the terminal, specifically may be a desktop collating application program in the embodiment, and the application program may be displayed in the form of an icon in a user interface or a desktop of the terminal, so that a user clicks the icon to start the desktop collating application program. The file management apparatus may perform the method shown in fig. 5. Referring to fig. 8, the desktop display apparatus may operate as follows:
a reading unit 201, configured to read a latest file directory in an operating system of the terminal, where the latest file directory includes file information of one or more files, and the file information of one or more files in the latest file directory is managed by using a file management method as shown in fig. 2 or 3.
An obtaining unit 202, configured to obtain a latest file display window displayed in a desktop of the terminal.
A display unit 203 for displaying the read file information of one or more files in the latest file directory in the latest file display window.
When the file information of the file recently opened by the user is displayed in the recent file display window, the embodiment of the invention can read the file information of one or more files in the recent file catalog of the operating system, and display the read file information of one or more files in the recent file display window, so that the user can conveniently check the file information, and the user can quickly open the target file through the recent file display window. Because the file information of the one or more files is managed by adopting the file management method, the latest file display window can accurately and comprehensively display the file information of the file recently opened by the user, and the user experience can be improved.
Based on the description of the method embodiment and the device embodiment, the embodiment of the invention also provides a terminal. Referring to fig. 9, the terminal internal structure includes a processor 301, an input device 302, an output device 303, and a computer storage medium 304. The processor 301, the input device 302, the output device 303, and the computer storage medium 304 in the terminal may be connected by a bus or other means, and in fig. 9, which is shown as an example by the bus 305 according to the embodiment of the present invention. The computer storage medium 304 is used to store a computer program, the computer program including one or more instructions, and the processor 301 is configured to execute the instructions stored in the computer storage medium 304. The processor 301, or CPU (Central Processing Unit ), is a computing core as well as a control core of the terminal, adapted to implement one or more instructions, in particular to load and execute one or more instructions to implement a corresponding method flow or a corresponding function.
In one embodiment, the processor 301 according to the embodiment of the present invention may be configured to perform a series of file management according to the obtained process information, including: acquiring process information of a target process in an operating system of a terminal, wherein the target process is any process which is started in the operating system and has a file operation event; the process information of the target process comprises command line parameters, wherein the command line parameters carry file information of a target file corresponding to a file operation event of the target process; analyzing the process information of the target process to obtain the file information of the target file, wherein the file information of the target file comprises the file path of the target file; updating the latest file directory of the operating system according to the file information of the target file, and the like.
In yet another embodiment, the processor 301 according to the present invention may be further configured to perform a series of desktop display operations according to the obtained file information, including: reading a latest file directory in an operating system of the terminal, wherein the latest file directory comprises file information of one or more files, and the file information of one or more files in the latest file directory is managed by adopting a file management method as shown in fig. 2 or 3; acquiring a latest file display window displayed in a desktop of the terminal; displaying the read file information of one or more files in the latest file directory in the latest file display window, and the like.
The embodiment of the invention also provides a computer storage medium (Memory), which is a Memory device in the terminal and is used for storing programs and data. It will be appreciated that the computer storage medium herein may include both a built-in storage medium in the terminal and an extended storage medium supported by the terminal. The computer storage medium provides a storage space that stores an operating system of the terminal. Also stored in this memory space are one or more instructions, which may be one or more computer programs (including program code), adapted to be loaded and executed by the processor 301. The computer storage medium herein may be a high-speed RAM memory or a non-volatile memory (non-volatile memory), such as at least one magnetic disk memory; optionally, at least one computer storage medium remote from the processor may be present.
In one embodiment, one or more first instructions stored in a computer storage medium may be loaded and executed by the processor 301 to implement the respective steps of the methods described above in relation to the file management embodiments; in particular implementations, one or more first instructions in the computer storage medium are loaded by the processor 301 and perform the steps of:
Acquiring process information of a target process in an operating system of the terminal, wherein the target process is any process which is started in the operating system and has a file operation event; the process information of the target process comprises command line parameters, wherein the command line parameters carry file information of a target file corresponding to a file operation event of the target process;
analyzing the process information of the target process to obtain the file information of the target file, wherein the file information of the target file comprises the file path of the target file;
and updating the latest file directory of the operating system according to the file information of the target file.
In one embodiment, the operating system includes a driver layer; the one or more first instructions are loaded and executed by the processor 301 when acquiring process information of a target process in an operating system of the terminal:
acquiring a message notification from the driving layer, wherein the message notification carries process information of the target process, and the process information of the target process is intercepted by the driving layer when the driving layer monitors that the target process is started in the operating system and a file operation event exists;
And analyzing the process information of the target process from the message notification.
In yet another embodiment, the one or more first instructions are loaded and executed by the processor 301 when analyzing the process information of the target process to obtain the file information of the target file:
analyzing file information of the target file from command line parameters in the process information of the target process;
verifying the validity of the target file according to the file information of the target file;
and if the target file is successfully checked, acquiring the file information of the target file.
In yet another embodiment, the process information of the target process further includes a name of the target process, and the one or more first instructions are loaded and executed by the processor 301:
obtaining a blacklist, wherein the blacklist comprises at least one name of a non-associated process, and the non-associated process is a service process in the operating system;
judging whether the name of the target process belongs to the blacklist or not;
and if the name of the target process does not belong to the blacklist, executing the step of analyzing the file information of the target file from the command line parameters in the process information of the target process.
In yet another embodiment, the one or more first instructions are loaded and executed by the processor 301:
judging whether the parameter format of the command line parameters in the process information of the target process meets a preset parameter format or not;
if yes, executing the step of analyzing the file information of the target file from the command line parameters in the process information of the target process;
if not, carrying out normalization processing on command line parameters in the process information of the target process according to the preset parameter format;
and executing the step of analyzing the file information of the target file from the command line parameters in the process information of the target process aiming at the command line parameters after normalization processing.
In yet another embodiment, the one or more first instructions are loaded and executed by the processor 301 when verifying the validity of the target file based on the file information of the target file:
calling a first non-preemptive application programming interface to create a temporary folder;
acquiring the target file according to the file path of the target file;
and if the target file is successfully stored in the temporary folder, determining that the target file is successfully checked.
In yet another embodiment, the one or more first instructions are loaded and executed by the processor 301 when verifying the validity of the target file based on the file information of the target file:
calling a second non-preemptive application programming interface to create a temporary operation area and a mapping relation between the temporary operation area and a memory of an operating system;
acquiring the target file according to the file path of the target file, and mapping the target file from the memory of the operating system to the temporary operating area according to the mapping relation;
and if the target file is successfully accessed in the temporary operation area, determining that the target file is successfully checked.
In yet another embodiment, the file information further includes a file name of the target file; the one or more first instructions are loaded and executed by the processor 301 before verifying the validity of the target file based on the file information of the target file:
acquiring a white list, wherein the white list comprises file extension names of at least one effective file;
judging whether the file extension of the file name of the target file belongs to the white list or not;
If the file extension of the file name of the target file belongs to the white list, executing a step of checking the validity of the target file according to the file information of the target file;
and if the file extension of the file name of the target file does not belong to the white list, determining that the target file is an invalid file.
In yet another embodiment, the one or more first instructions are loaded and executed by the processor 301 when updating the latest file directory of the operating system based on the file information of the target file:
detecting whether file information of the target file exists in a latest file directory of the operating system;
if the file information of the target file does not exist in the latest file directory of the operating system, the file information of the target file is added into the latest file directory of the operating system.
In yet another embodiment, the file information of the target file further includes at least one of: file name, file size and time parameters; the one or more first instructions are loaded and executed by the processor 301:
if the file information of the target file exists in the latest file catalog of the operating system, judging whether the file information of the target file carried in the command line parameter is consistent with the file information of the target file existing in the latest file catalog of the operating system;
If not, updating the latest file directory of the operating system according to the file information of the target file carried in the command line parameters;
wherein the time parameter comprises at least one of: creation time parameter, access time parameter, update time parameter, and save time parameter.
In the embodiment of the invention, when the target process operates (such as opening, modifying and the like) on the target file, the process information of the target process can be acquired; the process information comprises a command line parameter, the command line parameter carries file information of a target file, the file information of the target file can be obtained by analyzing the process information, and then the latest file directory of the operating system can be updated according to the file information. Therefore, the embodiment of the invention realizes file management by acquiring and analyzing the process information, so that corresponding process information can be intercepted and managed as long as the file operation event exists, thereby timely storing the file information of the recently operated target file into the license catalog and ensuring the accuracy and the comprehensiveness of the license catalog.
In yet another embodiment, one or more second instructions stored in a computer storage medium may be loaded and executed by the processor 301 to implement the respective steps of the methods described above in connection with the desktop display embodiments; in particular implementations, one or more second instructions in the computer storage medium are loaded by the processor 301 and perform the steps of:
Reading a latest file directory in an operating system of the terminal, wherein the latest file directory comprises file information of one or more files, and the file information of one or more files in the latest file directory is managed by adopting a file management method shown in fig. 2 or 3;
acquiring a latest file display window displayed in a desktop of the terminal;
displaying the read file information of one or more files in the latest file directory in the latest file display window, wherein the file information comprises a file path.
When the file information of the file recently opened by the user is displayed in the recent file display window, the embodiment of the invention can read the file information of one or more files in the recent file catalog of the operating system, and display the read file information of one or more files in the recent file display window, so that the user can conveniently check the file information, and the user can quickly open the target file through the recent file display window. Because the file information of the one or more files is managed by adopting the file management method, the latest file display window can accurately and comprehensively display the file information of the file recently opened by the user, and the user experience can be improved.
The foregoing disclosure is illustrative of the present invention and is not to be construed as limiting the scope of the invention, which is defined by the appended claims.

Claims (11)

1. A file management method applied to a terminal, the method comprising:
acquiring process information of a target process in an operating system of the terminal, wherein the target process is any process which is started in the operating system and has a file operation event; the process information of the target process comprises command line parameters, wherein the command line parameters carry file information of a target file corresponding to a file operation event of the target process; the file operation event includes at least one of: file access events, file update events; the target file comprises a file stored by the cloud of any application program in the operating system; the process information of the target process comprises the name of the target process;
obtaining a blacklist, wherein the blacklist comprises at least one name of a non-associated process, and the non-associated process is a service process in the operating system;
if the name of the target process does not belong to the blacklist, analyzing file information of the target file from command line parameters in process information of the target process, wherein the file information of the target file comprises a file path of the target file;
A non-preemptive application programming interface is adopted, and the validity of the target file is checked according to the file information of the target file;
and if the target file is successfully checked, acquiring file information of the target file, and updating the latest file directory of the operating system according to the file information of the target file.
2. The method of claim 1, wherein the operating system comprises a driver layer; the obtaining the process information of the target process in the operating system of the terminal comprises the following steps:
acquiring a message notification from the driving layer, wherein the message notification carries process information of the target process, and the process information of the target process is intercepted by the driving layer when the driving layer monitors that the target process is started in the operating system and a file operation event exists;
and analyzing the process information of the target process from the message notification.
3. The method of claim 1, wherein the method further comprises:
judging whether the parameter format of the command line parameters in the process information of the target process meets a preset parameter format or not;
if yes, executing the step of analyzing the file information of the target file from the command line parameters in the process information of the target process;
If not, carrying out normalization processing on command line parameters in the process information of the target process according to the preset parameter format;
and executing the step of analyzing the file information of the target file from the command line parameters in the process information of the target process aiming at the command line parameters after normalization processing.
4. The method of claim 1, wherein verifying the validity of the target file based on file information of the target file comprises:
calling a first non-preemptive application programming interface to create a temporary folder;
acquiring the target file according to the file path of the target file;
and if the target file is successfully stored in the temporary folder, determining that the target file is successfully checked.
5. The method of claim 1, wherein verifying the validity of the target file based on file information of the target file comprises:
calling a second non-preemptive application programming interface to create a temporary operation area and a mapping relation between the temporary operation area and a memory of an operating system;
acquiring the target file according to the file path of the target file, and mapping the target file from the memory of the operating system to the temporary operating area according to the mapping relation;
And if the target file is successfully accessed in the temporary operation area, determining that the target file is successfully checked.
6. The method of claim 1, wherein the file information further includes a file name of the target file; before the validity of the target file is checked according to the file information of the target file, the method further comprises:
acquiring a white list, wherein the white list comprises file extension names of at least one effective file;
judging whether the file extension of the file name of the target file belongs to the white list or not;
if the file extension of the file name of the target file belongs to the white list, executing a step of checking the validity of the target file according to the file information of the target file;
and if the file extension of the file name of the target file does not belong to the white list, determining that the target file is an invalid file.
7. The method of claim 1 or 2, wherein updating the latest file directory of the operating system based on the file information of the target file comprises:
detecting whether file information of the target file exists in a latest file directory of the operating system;
If the file information of the target file does not exist in the latest file directory of the operating system, the file information of the target file is added into the latest file directory of the operating system.
8. The method of claim 7, wherein the file information of the target file further comprises at least one of: file name, file size and time parameters; the method further comprises the steps of:
if the file information of the target file exists in the latest file catalog of the operating system, judging whether the file information of the target file carried in the command line parameter is consistent with the file information of the target file existing in the latest file catalog of the operating system;
if not, updating the latest file directory of the operating system according to the file information of the target file carried in the command line parameters;
wherein the time parameter comprises at least one of: creation time parameter, access time parameter, update time parameter, and save time parameter.
9. The desktop display method is applied to a terminal and is characterized by comprising the following steps:
reading a latest file directory in an operating system of the terminal, wherein the latest file directory comprises file information of one or more files, and the file information of one or more files in the latest file directory is managed by adopting the file management method according to any one of claims 1-8;
Acquiring a latest file display window displayed in a desktop of the terminal;
displaying the read file information of one or more files in the latest file directory in the latest file display window.
10. A terminal comprising an input device and an output device, further comprising:
a processor adapted to implement one or more instructions; the method comprises the steps of,
a computer storage medium storing one or more first instructions adapted to be loaded by the processor and to perform the file management method of any of claims 1-8; alternatively, the computer storage medium stores one or more second instructions adapted to be loaded by the processor and to perform the desktop display method of claim 9.
11. A computer storage medium storing one or more first instructions adapted to be loaded by a processor and to perform the file management method of any of claims 1-8; alternatively, the computer storage medium stores one or more second instructions adapted to be loaded by the processor and to perform the desktop display method of claim 9.
CN201811135555.1A 2018-09-27 2018-09-27 File management method, desktop display method, device, terminal and medium Active CN109359092B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811135555.1A CN109359092B (en) 2018-09-27 2018-09-27 File management method, desktop display method, device, terminal and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811135555.1A CN109359092B (en) 2018-09-27 2018-09-27 File management method, desktop display method, device, terminal and medium

Publications (2)

Publication Number Publication Date
CN109359092A CN109359092A (en) 2019-02-19
CN109359092B true CN109359092B (en) 2023-05-26

Family

ID=65348142

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811135555.1A Active CN109359092B (en) 2018-09-27 2018-09-27 File management method, desktop display method, device, terminal and medium

Country Status (1)

Country Link
CN (1) CN109359092B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111913914A (en) * 2020-08-20 2020-11-10 珠海奔图电子有限公司 File processing method and device, electronic equipment and storage medium
CN113051224A (en) * 2021-04-08 2021-06-29 平安国际智慧城市科技股份有限公司 File transmission method and device, electronic equipment and computer readable storage medium
CN113296943B (en) * 2021-05-17 2022-04-19 广州文石信息科技有限公司 Multi-document multi-process display method, device, equipment and storage medium
CN116662270A (en) * 2022-09-09 2023-08-29 荣耀终端有限公司 File analysis method and related device

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100122313A1 (en) * 2008-11-09 2010-05-13 Aspect9, Inc. Method and system for restricting file access in a computer system
CN101901313A (en) * 2010-06-10 2010-12-01 中科方德软件有限公司 Linux file protection system and method
CN102135892A (en) * 2010-01-22 2011-07-27 北京金山数字娱乐科技有限公司 Application program running method, device and system
CN104462296A (en) * 2014-11-28 2015-03-25 小米科技有限责任公司 File managing method and device and terminal
CN106919665A (en) * 2017-02-16 2017-07-04 江苏神州信源系统工程有限公司 The management-control method and device of e-file in a kind of Windows operating system
CN108228894A (en) * 2018-02-05 2018-06-29 腾讯科技(深圳)有限公司 Check the method, apparatus and terminal for using file recently

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100122313A1 (en) * 2008-11-09 2010-05-13 Aspect9, Inc. Method and system for restricting file access in a computer system
CN102135892A (en) * 2010-01-22 2011-07-27 北京金山数字娱乐科技有限公司 Application program running method, device and system
CN101901313A (en) * 2010-06-10 2010-12-01 中科方德软件有限公司 Linux file protection system and method
CN104462296A (en) * 2014-11-28 2015-03-25 小米科技有限责任公司 File managing method and device and terminal
CN106919665A (en) * 2017-02-16 2017-07-04 江苏神州信源系统工程有限公司 The management-control method and device of e-file in a kind of Windows operating system
CN108228894A (en) * 2018-02-05 2018-06-29 腾讯科技(深圳)有限公司 Check the method, apparatus and terminal for using file recently

Also Published As

Publication number Publication date
CN109359092A (en) 2019-02-19

Similar Documents

Publication Publication Date Title
CN109359092B (en) File management method, desktop display method, device, terminal and medium
US8448165B1 (en) System and method for logging operations of virtual machines
CN109597677B (en) Method and apparatus for processing information
US8713582B2 (en) Providing policy-based operating system services in an operating system on a computing system
US8316120B2 (en) Applicability detection using third party target state
US20110154325A1 (en) Virtual machine system, system for forcing policy, method for forcing policy, and virtual machine control program
CN104603750A (en) Layout and execution of software applications using BPRAM
US11269663B2 (en) Method and apparatus for adapting handle device to third-party application, and storage medium
CN110413432B (en) Information processing method, electronic equipment and storage medium
JP5376258B2 (en) Maintenance system, maintenance method, and maintenance program
CN104583948A (en) Layout and execution of operating systems using BPRAM
EP3709199A1 (en) Container security policy handling method and related device
US9477538B2 (en) Method and system for the support of application specific policies for conventional operating systems
US10275595B2 (en) System and method for characterizing malware
CN113342554B (en) IO multiplexing method, medium, device and operating system
CN111522706A (en) Method and device for monitoring page abnormity of front-end application
US11861364B2 (en) Circular shadow stack in audit mode
EP3574428B1 (en) Safe data access through any data channel
US20170315854A1 (en) Error determination from logs
US9684660B2 (en) File processing method and system
CN111078418A (en) Operation synchronization method and device, electronic equipment and computer readable storage medium
JP5884566B2 (en) Batch processing system, progress confirmation device, progress confirmation method, and program
CN110442380B (en) Data preheating method and computing equipment
CN113282363A (en) Method and device for optimizing hybrid APP
US20210397498A1 (en) Information processing apparatus, control method, and program

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