File management and control method and device, equipment and storage medium
Patent Information
- Application Number
- CN202310883995.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-18
- Publication Date
- 2025-01-28
AI Technical Summary
The lack of a link to control the installation package files to be installed in the prior art, which makes it difficult for users to avoid the installation of messy software when they are incorrectly operated, affecting computer performance.
By detecting whether the file to be started is a installation package file, and the file features are matched with the preset target installation package file, it is prohibited to start and avoid installation.
Improve the fault tolerance of users' error operation, and prevent the computer installation from applying applications that users do not want to install or prohibit installation to ensure the reliability of computer operation.
Smart Images

Figure CN119376805A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a file management method, device, equipment and storage medium. Background Art
[0002] With the rapid development of computer technology, the installation process of application software has become simpler and faster. Nowadays, users only need to start and run the installation package file of the application on the computer, and the computer can complete the installation of the corresponding application based on the installation package file.
[0003] Although the quick installation of applications brings great convenience to users, the lack of control over the installation package files to be installed reduces the fault tolerance of user errors. For example, companies do not want employees to install some messy software on corporate computers. When users mistakenly start the installation package files of messy software, the messy software will be quickly installed on the computer, causing users to spend time uninstalling the messy software from the computer. Otherwise, these messy software will occupy the memory of the corporate computer and affect the use and performance of the corporate computer. Therefore, there is an urgent need for a technical solution that can control the applications to be installed on the computer. Summary of the invention
[0004] The present application provides a file management method, device, equipment and storage medium to solve the problem in the prior art of lacking a link for managing installation package files to be installed, thereby improving the fault tolerance of user misoperation.
[0005] In a first aspect, the present application provides a file management method, comprising:
[0006] In response to a file startup operation, if the file to be started corresponding to the file startup operation is an executable file, detecting whether the file to be started is an installation package file;
[0007] In the case where the file to be started is an installation package file, matching the file characteristics of the file to be started with the file characteristics of a preset target installation package file;
[0008] If the file features match, the startup of the file to be started is prohibited;
[0009] When the file to be started is not an installation package file or the file features do not match, the file to be started is started.
[0010] In a second aspect, the present application provides a file management device, including:
[0011] An installation package detection module is configured to, in response to a file startup operation, detect whether the file to be started corresponding to the file startup operation is an installation package file when the file to be started corresponding to the file startup operation is an executable file;
[0012] a feature matching module, configured to match the file feature of the file to be started with the file feature of a preset target installation package file when the file to be started is an installation package file;
[0013] A first file processing module is configured to prohibit starting the to-be-started file when the file features match;
[0014] The second file processing module is configured to start the file to be started when the file to be started is not an installation package file or the file feature does not match.
[0015] In a third aspect, the present application provides a file management device, including:
[0016] one or more processors;
[0017] A memory stores one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the file management method as described in the first aspect.
[0018] In a fourth aspect, the present application provides a storage medium comprising computer executable instructions, which, when executed by a computer processor, are used to execute the file management method as described in the first aspect.
[0019] In the present application, when a user inputs a file startup operation to a computer, in response to the file startup operation, when it is determined that the file to be started corresponding to the file startup operation is an executable file, it is detected whether the file to be started is an installation package file. When it is determined that the file to be started is an installation package file, the file characteristics of the installation package file are matched with the file characteristics of the preset target installation package file; if the file characteristics of the two match, it indicates that the file to be started is an installation package file of an application that the computer prohibits installation or the user does not want to install, so the startup file is prohibited. If the file characteristics of the two do not match, it indicates that the file to be started is an installation package file of an application that the computer can install or the user wants to install, so the startup file can be started normally so that the computer can run the process of installing the corresponding application. Through the above technical means, when the user inputs the file startup operation, the startup file is controlled and the installation operation of the target installation package file is intercepted in time, so as to avoid the computer from installing applications that the user does not want to install or prohibits installation, and improve the fault tolerance of user misoperation. For the startup operations of the remaining non-target installation package files, the computer responds in time to ensure that the installed applications can run normally, the applications that are not installed can be installed normally, and the non-executable files can be opened normally, so as to ensure the reliability of the computer's operation. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 This is a flowchart of a file management method provided by an embodiment of the present application;
[0021] Figure 2 It is a flowchart of determining whether a file to be started is an installation package file or a non-installation package file by using file features provided by an embodiment of the present application;
[0022] Figure 3 It is a flowchart of determining whether a file to be started is an installation package file or a non-installation package file through a header part provided by an embodiment of the present application;
[0023] Figure 4 It is a flowchart of determining whether a file to be started is an installation package file or a non-installation package file through a resource file provided by an embodiment of the present application;
[0024] Figure 5 It is a flowchart for judging whether the file to be started is an installation package file or a non-installation package file by previewing the content;
[0025] Figure 6 is a flowchart of the installation package file detection process provided by an embodiment of the present application;
[0026] Figure 7 It is a structural schematic diagram of a file control device provided in an embodiment of the present application;
[0027] Figure 8 It is a structural schematic diagram of a file management device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0028] In order to make the purpose, technical scheme and advantages of the present application clearer, the specific embodiments of the present application are further described in detail below in conjunction with the accompanying drawings. It is understood that the specific embodiments described herein are only used to explain the present application, rather than to limit the present application. It should also be noted that, for the convenience of description, only the part related to the present application but not all the contents are shown in the accompanying drawings. Before discussing the exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flow charts. Although the flow chart describes each operation (or step) as a sequential process, many of the operations therein can be implemented in parallel, concurrently or simultaneously. In addition, the order of each operation can be rearranged. The process can be terminated when its operation is completed, but it can also have additional steps not included in the accompanying drawings. The process can correspond to a method, a function, a procedure, a subroutine, a subprogram, etc.
[0029] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.
[0030] In the more common existing implementation methods, for the installation package file of an uninstalled application, when the user starts the installation package file, the computer can start running the operation of installing the application, and the installation operation is very convenient. Although the quick installation of the application brings great convenience to the user, the lack of control over the installation package file to be installed reduces the fault tolerance of user misoperation. For example, an enterprise does not want employees to install entertainment software such as games or film and television applications, cluttered software, and software developed by competitors on corporate computers, but users may mistakenly start the installation package of these software, and these software will be quickly installed on the computer, causing the user to spend time uninstalling the cluttered software from the computer later, otherwise these cluttered software will occupy the memory of the corporate computer and affect the use and performance of the corporate computer.
[0031] To solve the above problems, the present embodiment provides a file management method to solve the problem in the prior art of lacking a link for managing the installation package files to be installed, thereby improving the fault tolerance of user misoperation.
[0032] The file control method provided in this embodiment can be executed by a file control device, which can be implemented by software and / or hardware, and can be composed of two or more physical entities or one physical entity. For example, the file control device can be a computer.
[0033] The file control device is installed with at least one type of operating system, wherein the operating system includes but is not limited to Android system, Linux system and Windows system. The file control device can install at least one application based on the operating system, and the application can be an application that comes with the operating system or an application downloaded from a third-party device or server. In one embodiment, the file control device can be provided with an application that executes the file control method.
[0034] For ease of understanding, this embodiment is described by taking a computer as an example of a subject that executes the file management method.
[0035] Figure 1 A flowchart of a file management method provided in an embodiment of the present application is given. Figure 1 , the document management methods specifically include:
[0036] S110 . In response to a file startup operation, if the file to be started corresponding to the file startup operation is an executable file, detecting whether the file to be started is an installation package file.
[0037] Among them, the file startup operation refers to the operation input by the user for starting the file. The file startup operation can be single-clicking the file or double-clicking the file, etc. The files mentioned in this embodiment include non-executable files such as pictures, documents, videos or audios that cannot be loaded by the operating system, and also include executable files that can be loaded and executed by the operating system. That is, all files accessible on the computer can be regarded as files that can be started through the file startup operation.
[0038] The file to be started refers to the file to be started corresponding to the file startup operation. Since the installation package file is an executable file directly loaded and executed by the operating system, when the file to be started is a non-executable file such as a picture, document, video or audio that cannot be directly loaded by the operating system, it can be confirmed that the file to be started is a non-installation package file, and then the computer can start the file to be started, so as to open the content such as the picture, document, video or audio for the user to view.
[0039] Installation package files are executable files, but not all executable files are installation package files. For example, executable files may also be dynamic libraries, kernel files, and applications that have been installed. Therefore, when it is determined that the file to be started is an executable file, it can be further detected whether the file to be started is an installation package file.
[0040] In one embodiment, the contents stored in the address spaces corresponding to the file headers of the executable file and the file headers of the non-executable file are different, and the contents stored in the address spaces corresponding to the file headers of the file to be started can be used to determine whether the file to be started is an executable file or a non-executable file. Exemplarily, when it is confirmed that the address space corresponding to the file header of the file to be started stores the identification information of the executable file, it is determined that the file to be started is an executable file. It should be noted that the structures of the executable files executed by different operating systems are different. For Windows systems, the executable files are PE (Portable Executable) file structures, and for Linux systems, the executable files are ELF (Executable and Linking Format) file structures. The identification information stored in the address spaces corresponding to the file headers of executable files of different structures is different. This embodiment is described by taking the operating system as Windows system and the executable file as PE file as an example. The first two bytes of the PE file header store an address information, and the storage space corresponding to the address information stores "MZ". The offset 0x3c byte of the file header of the executable file stores an address information, and the storage space corresponding to the address information stores "PE". Therefore, when it is found that the first two bytes of the file header of the to-be-started file and the address space corresponding to the offset 0x3c byte store "MZ" and "PE", it can be confirmed that the to-be-started file is an executable file, otherwise it is confirmed that the to-be-started file is a non-executable file.
[0041] The embodiment of the present application provides multiple detection methods to determine whether the file to be started is an installation package file, so as to judge from the file characteristics, file size, file structure and file preview content of the file to be started respectively, thereby improving the accuracy of installation package file detection.
[0042] In one embodiment, the detection of whether the file to be started is an installation package file or a non-installation package file can be specifically performed by judging whether the file to be started is an installation package file or a non-installation package file according to the file features of the file to be started. Figure 2 As shown, the step of determining whether the file to be started is an installation package file or a non-installation package file according to the file feature specifically includes S1101-S1103:
[0043] S1101. Extract file features of a file to be started, where the file features include at least one of a file name, a file signature, and a product name.
[0044] S1102: When the file feature of the file to be started matches the file feature of the installation package file in the preset false detection list, determine that the file to be started is an installation package file.
[0045] S1103: When the file feature of the to-be-started file matches the file feature of the non-installation package file in the preset false detection list, determine that the to-be-started file is a non-installation package file.
[0046] The false detection list is generated based on the files with errors in the previous detection results. For example, when the computer mistakenly identifies the installation package file A as a non-installation package file, the installation package file A can be saved in the false detection list, or, when the computer mistakenly identifies the non-installation package file B as an installation package file, the installation package file B can be saved in the false detection list. When the file characteristics of the file to be started match the characteristics of the installation package file A in the false detection list, it indicates that the file to be started is the installation package file A, so it can be determined that the file to be started is the installation package file; when the file characteristics of the file to be started match the characteristics of the non-installation file B in the false detection list, it indicates that the file to be started is the non-installation package file B, so it can be determined that the file to be started is a non-installation package file. When the file characteristics of the file to be started do not match the file characteristics of any file in the false detection list, it is impossible to confirm whether the file to be started is an installation package file or a non-installation package file, and other detection methods can be used to make a judgment. It can be understood that the files in the false detection list are files that are difficult to detect and have low detection accuracy. This embodiment matches the file features of the file to be started with the file features of each file in the false detection list to screen out installation package files or non-installation package files that are more difficult to detect, thereby improving the accuracy of installation package detection.
[0047] In one embodiment, the detection of whether the file to be started is an installation package file or a non-installation package file can be specifically performed by judging whether the file to be started is an installation package file or a non-installation package file through the header part in the file structure of the file to be started. Figure 3 As shown, the step of judging whether the file to be started is an installation package file or a non-installation package file through the header part specifically includes S1104-S1105:
[0048] S1104: Obtain a subsystem value of the file to be started according to the header portion of the file to be started.
[0049] S1105: When the subsystem value of the file to be started is not the subsystem value corresponding to the graphical user interface, determine that the file to be started is a non-installation package file.
[0050] Exemplarily, the head of the PE file is divided into a PE Header, which is stored in the rear part of the Dos Header. The subsystem field in the header of the PE file stores the subsystem value of the corresponding PE file, and the subsystem value represents the subsystem of the specified interface of the PE file. The optional subsystems under the Windows system are CUI (command line interface) and GUI (graphical user interface). Correspondingly, the subsystem value in the header of the PE file includes CUI Subsystem and GUI Subsystem. When the subsystem value of the file to be started is CUI Subsystem, it can be determined that the specified interface of the file to be started is a command line interface, and when the subsystem value of the file to be started is GUI Subsystem, it can be determined that the specified interface of the file to be started is a graphical user interface. For the installation package file of the application, it specifies the use of a graphical user interface. When the specified interface of the file to be started is a command line interface, it can be determined that the file to be started is a non-installation package file. However, in addition to the installation package file, the specified interface of other executable files may also be a graphical user interface, that is, this embodiment cannot determine that the file to be started is an installation package file, but can be used to quickly filter some non-installation package files. After determining that the subsystem value of the file to be started is GUI Subsystem, other detection methods may be used to further determine whether the file to be started is a non-installation package file or an installation package file.
[0051] In one embodiment, the detection of whether the file to be started is an installation package file or a non-installation package file can be specifically performed by judging whether the file to be started is an installation package file or a non-installation package file through a resource file in the file structure of the file to be started. Figure 4 As shown, the step of judging whether the file to be started is an installation package file or a non-installation package file through the resource file specifically includes S1106-S1107:
[0052] S1106. Obtain the name of the resource file according to the resource file of the file to be started.
[0053] S1107. When the name of the resource file matches a preset packaging name, determine that the file to be started is an installation package file; wherein the packaging name is the name of the resource file of the installation package file generated by packaging based on the corresponding packaging software.
[0054] Among them, the resource file refers to the manifest resource file with the resource type of RT_MANIFEST, and the manifest resource file stores the description information about the corresponding PE file. The installation package file is generated by packaging software for a series of files such as executable files, texts and pictures. Correspondingly, the name (name value) of the manifest resource file of the installation package file represents which packaging software packaged and generated the installation package file. Since the non-installation package file is not packaged by the packaging software, the name of the manifest resource file of the non-installation package file is not the packaging name corresponding to the packaging software. Therefore, whether the PE file is an installation package file can be determined based on whether the name of the manifest resource file of the PE file matches the packaging name corresponding to the preset packaging software. Table 1 is the packaging software and corresponding packaging names provided in the embodiment of the present application.
[0055] Table 1
[0056] Packaged Software Package Name Inno Setup JR.Inno.Setup NSIS Nullsoft.NSIS.exehead MSP setup.exe InstallShield InstallShield.Setup
[0057] As shown in Table 1, when the name of the manifest resource file in the file to be started is JR.Inno.Setup, Nullsoft.NSIS.exehead, setup.exe or InstallShield.Setup, it can be confirmed that the file to be started is an installation package file. However, due to the large number of existing packaged software, it is difficult to list the corresponding package names of all packaged software and match them with the name of the manifest resource file in the file to be started in the actual detection process, that is, when the name of the manifest resource file in the file to be started is not the preset package name, it is impossible to determine whether the file to be started is an installation package file or a non-installation package file, and other detection methods can be used to detect the file to be started. It should be noted that most of the existing installation packages are generated based on several commonly used packaged software packages, so the accuracy of detecting the file to be started based on the name of the manifest resource file provided in this embodiment can reach 95%, and there is no need to parse the preview content of the file to be started, and the detection speed is faster.
[0058] In one embodiment, it is detected whether the file to be started is an installation package file or a non-installation package file. Specifically, it can be determined whether the file to be started is an installation package file or a non-installation package file by the file size of the file to be started. Among them, the file size refers to the size of the storage space occupied by the corresponding file. Exemplarily, when the file size of the file to be started is greater than or equal to a preset size threshold, the file to be started is determined to be an installation package file. It can be understood that the file size of the non-installation package file is smaller, so this embodiment sets the size threshold to the maximum size of the non-installation package file, and the maximum size is generally set to 500M. When the file size of the file to be started is greater than 500M, it can be determined that the file to be started is an installation package file. However, the file size of some installation package files is about the same as that of non-installation package files. When the file size of the file to be started is less than 500M, it cannot be determined whether the file to be started is an installation package file or a non-installation package file, and other detection methods can be used to make a judgment.
[0059] In one embodiment, the detection of whether the file to be started is an installation package file or a non-installation package file can be specifically performed by judging whether the file to be started is an installation package file or a non-installation package file through the preview content of the file to be started. Figure 5 As shown, the step of judging whether the file to be started is an installation package file or a non-installation package file through the preview content specifically includes S1108-S1110:
[0060] S1108: Obtain preview content of the file to be started through the preset decompression software.
[0061] S1109: When the preview content includes a preset block structure, determine that the file to be started is a non-installation package file.
[0062] S1110: When the preview content does not include a preset block structure, determine that the file to be started is an installation package file.
[0063] Exemplarily, the principle of making an installation package file is to compress the resource file of the application using a compression algorithm, and then convert the compressed file into a PE file. The non-installation package file is generated by the four processes of preprocessing, compiling, assembling and linking. In these processes, the non-installation package file will generate text blocks, data blocks, rsrc blocks, reloc blocks and rdata blocks. Therefore, the preview content of the installation package file and the non-installation package file after decompression is not the same. The preview content of the non-installation package file after decompression includes text blocks, data blocks, rsrc blocks, reloc blocks and rdata blocks, while the installation package file does not include these block structures. When the preview content of the file to be started includes text blocks, data blocks, rsrc blocks, reloc blocks and rdata blocks, it can be determined that the file to be started is a non-installation package file. When the preview content of the file to be started does not include text blocks, data blocks, rsrc blocks, reloc blocks and rdata blocks, it can be determined that the file to be started is an installation package file. Compared with other detection methods, the detection method described in this embodiment judges the file to be started from the file preview content that best reflects the file type to improve the accuracy of the installation package file detection. Since this embodiment needs to decompress the startup file, the detection speed is slow. It can first be preliminarily screened through other detection methods, and finally an accurate judgment can be made based on the preview content of the startup file, thereby optimizing the detection efficiency while ensuring the detection accuracy.
[0064] In one embodiment, the detection method based on the file characteristics of the file to be started, the detection method based on the header part in the file structure of the file to be started, the detection method based on the resource files in the file structure of the file to be started, the detection method based on the file size of the file to be started, and the detection method based on the preview content of the file to be started provided in the above embodiments can be combined to conduct a comprehensive detection on the file to be started. Exemplarily, the detection method based on the file characteristics of the file to be started, the detection method based on the header part in the file structure of the file to be started, the detection method based on the resource files in the file structure of the file to be started, the detection method based on the file size of the file to be started, and the detection method based on the preview content of the file to be started can be run in sequence to determine whether the file to be started is an installation package file or a non-installation package file. Figure 6As shown, the computer reads the identification information of the file header corresponding to the address space of the file to be started through the installation package detection program, and determines whether the file to be started is an executable file through the identification information. In the case where it is determined that the file to be started is an executable file, the file features of the file to be started are extracted, and the extracted file features are sent to the background for matching the false detection list, and the matching result returned by the background is obtained. If the matching result is matched with the installation package file in the false detection list, it is determined that the file to be started is an installation package file, and if the matching result is matched with the non-installation package file in the false detection list, it is determined that the file to be started is a non-installation package file. If the matching result is not matched with any file in the false detection list, the subsystem value of the header part of the file to be started is obtained. In the case where the subsystem value is not GUI Subsystem, it is determined that the file to be started is a non-installation package file. In the case where the subsystem value is GUI Subsystem, the name of the manifest resource file is obtained from the manifest resource file of the file to be started, and in the case where the name of the manifest resource file matches the preset package name, it is determined that the file to be started is an installation package file. In the case where the name of the manifest resource file does not match the preset package name, if the file size of the file to be started is greater than 500M, it can be determined that the file to be started is an installation package file. If the file size of the file to be started is less than or equal to 500M, the preview content of the file to be started can be obtained using decompression software. If the preview content includes the preset block structure, it is determined that the file to be started is not an installation package file. If the preview content does not include the preset block structure, it is determined that the file to be started is an installation package file.
[0065] In another embodiment, any two of the multiple detection methods provided in the above-mentioned embodiments can also be combined to detect the startup file. Exemplarily, the judgment can be made based on the subsystem value of the file to be started first, and then the name of the manifest resource file of the file to be started and / or the preview content of the file to be started can be used to make the judgment, so as to reduce the judgment logic of the file to be started, improve the detection efficiency and ensure the accuracy of the detection. In another embodiment, any three of the multiple detection methods provided in the above-mentioned embodiments can also be combined to detect the startup file. Exemplarily, the judgment can be made based on the subsystem value of the file to be started first, and then the name of the manifest resource file of the file to be started can be used to judge the startup file, and finally the preview content of the file to be started can be used to judge. In another embodiment, any four of the multiple detection methods in the above-mentioned embodiments can also be combined to detect the startup file.
[0066] In one embodiment, the computer can save the detection results of each file to be started through the background monitoring system. If the user finds that there is an error in the detection result of a file to be started through the background monitoring system, the user can manually store the file to be started with the accurate file type in the false detection list, so that the computer can accurately detect whether the file to be started is an installation package file or a non-installation package file next time.
[0067] S120: When the file to be started is an installation package file, match the file characteristics of the file to be started with the file characteristics of a preset target installation package file.
[0068] The target installation package file refers to the installation package file of the application program that is prohibited from being installed on the computer, which is generally configured in advance by the user. When it is determined that the file to be started is an installation package file, the file characteristics of the file to be started can be matched with the file characteristics of the target installation package file to further determine whether the file to be started is the installation package file of the application program that is prohibited from being installed on the computer.
[0069] S130: When the file features match, prohibiting the startup of the file to be started.
[0070] If the file characteristics of the file to be started match the file characteristics of the target installation package file, it can be determined that the file to be started is an installation package file of an application that is prohibited from being installed on the computer, and therefore the startup of the file to be started is prohibited to prevent the computer from installing the corresponding application. In this embodiment, the file characteristics include at least one of the file name, the file signature, and the product name, and the file name, file signature, and / or product name of the file to be started can be compared with the file name, file signature, and / or product name of the target installation package file to determine whether the file characteristics of the file to be started match those of the target installation package file.
[0071] S140: When the file to be started is not an installation package file or the file features do not match, start the file to be started.
[0072] If the file to be started is not an installation package file, it can be determined that the file to be started is not an installation package file of an application that is prohibited from being installed on the computer. At this time, the file to be started can be started to ensure that the computer can normally run dynamic libraries, kernel files, or other executable files such as installed applications. Similarly, if the file characteristics of the file to be started do not match the file characteristics of the target installation package file, it can be determined that the file to be started is not an installation package file of an application that is prohibited from being installed on the computer. At this time, the file to be started can be started to ensure that the computer can install installation package files other than the target installation package file.
[0073] It should be noted that the reason why the embodiment of the present application first determines whether the file to be started is an installation package file, rather than directly matching the file features of the file to be started with the file features of the target installation package file, is because the file to be started may also be a non-executable file, an executable file of an application that has been installed, or other types of executable files such as a dynamic library and a kernel file. If the file features of these files belong to the same supplier as the target installation package file, then the file features of these files may also match the file features of the target installation package file, which causes the computer to not perform operations such as opening non-executable files or running executable files of applications that have been installed or other executable files, affecting the normal operation of the computer. Therefore, after determining whether the file to be started is an installation package file, the embodiment of the present application can only prohibit the startup of the installation package file that matches the file features of the target installation package file, thereby ensuring the reliability of the computer's operation.
[0074] In summary, the file control method provided in the embodiment of the present application is to respond to the file start operation when the user inputs the file start operation to the computer, and detect whether the file to be started is an installation package file when it is determined that the file to be started corresponding to the file start operation is an executable file. In the case where it is determined that the file to be started is an installation package file, the file characteristics of the installation package file are matched with the file characteristics of the preset target installation package file; if the file characteristics of the two match, it indicates that the file to be started is an installation package file of an application that the computer prohibits installation or the user does not want to install, so the startup of the file to be started is prohibited. If the file characteristics of the two do not match, it indicates that the file to be started is an installation package file of an application that the computer can install or the user wants to install, so the file to be started can be started normally so that the computer can run the process of installing the corresponding application. Through the above technical means, when the user inputs the file start operation, the startup file is controlled and the installation operation of the target installation package file is intercepted in time, so as to avoid the computer from installing applications that the user does not want to install or prohibits installation, and improve the fault tolerance of user misoperation. For the startup operations of the remaining non-target installation package files, the computer responds in time to ensure that the installed applications can run normally, the applications that are not installed can be installed normally, and the non-executable files can be opened normally, so as to ensure the reliability of the computer's operation.
[0075] Based on the above embodiments, Figure 7 A schematic diagram of the structure of a file control device provided in an embodiment of the present application. Figure 7 The file control device provided in this embodiment specifically includes: an installation package detection module 21, a feature matching module 22, a first file processing module 23 and a second file processing module 24.
[0076] The installation package detection module is configured to detect, in response to a file startup operation, whether the file to be started corresponding to the file startup operation is an installation package file or a non-installation package file when the file to be started corresponding to the file startup operation is an executable file;
[0077] A feature matching module is configured to match the file feature of the file to be started with the file feature of a preset target installation package file when the file to be started is an installation package file;
[0078] The first file processing module is configured to prohibit starting the to-be-started file when the file features match;
[0079] The second file processing module is configured to start the file to be started when the file to be started is not an installation package file or the file feature does not match.
[0080] Based on the above embodiment, the installation package detection module includes: an executable file confirmation unit, which is configured to detect whether the file to be started is an installation package file or a non-installation package file when confirming that the address space corresponding to the file header of the file to be started stores the identification information of the executable file.
[0081] On the basis of the above embodiment, the installation package detection module includes: a feature extraction unit, configured to extract file features of the file to be started, the file features including at least one of the file name, the file signature and the product name; a first judgment unit, configured to determine that the file to be started is an installation package file when the file features of the file to be started match the file features of the installation package file in a preset false detection list; a second judgment unit, configured to determine that the file to be started is a non-installation package file when the file features of the file to be started match the file features of the non-installation package files in a preset false detection list.
[0082] Based on the above embodiment, the installation package detection module includes: a subsystem value acquisition unit, configured to obtain the subsystem value of the file to be started according to the header part of the file to be started; a third judgment unit, configured to determine that the file to be started is a non-installation package file when the subsystem value of the file to be started is not the subsystem value corresponding to the graphic user interface.
[0083] Based on the above embodiment, the installation package detection module includes: a resource file name acquisition unit, configured to obtain the name of the resource file based on the resource file of the file to be started; a fourth judgment unit, configured to determine that the file to be started is an installation package file when the name of the resource file matches a preset packaging name; wherein the packaging name is the name of the resource file of the installation package file generated based on the corresponding packaging software.
[0084] Based on the above embodiment, the installation package detection module includes: a fifth judgment unit configured to determine that the file to be started is an installation package file when the file size of the file to be started is greater than a preset size threshold.
[0085] Based on the above embodiment, the installation package detection module includes: a preview content acquisition unit, configured to obtain the preview content of the file to be started through a preset decompression software; a sixth judgment unit, configured to determine that the file to be started is a non-installation package file when the preview content includes a preset block structure; and a seventh judgment unit, configured to determine that the file to be started is an installation package file when the preview content does not include a preset block structure.
[0086] As described above, the file control device provided in the embodiment of the present application responds to the file start operation when the user inputs the file start operation to the computer, and detects whether the file to be started is an installation package file when it is determined that the file to be started corresponding to the file start operation is an executable file. In the case where it is determined that the file to be started is an installation package file, the file characteristics of the installation package file are matched with the file characteristics of the preset target installation package file; if the file characteristics of the two match, it indicates that the file to be started is an installation package file of an application that the computer prohibits installation or the user does not want to install, so the startup of the file to be started is prohibited. If the file characteristics of the two do not match, it indicates that the file to be started is an installation package file of an application that the computer can install or the user wants to install, so the file to be started can be started normally so that the computer runs the process of installing the corresponding application. Through the above technical means, when the user inputs the file start operation, the startup file is controlled and the installation operation of the target installation package file is timely intercepted, so as to avoid the computer from installing applications that the user does not want to install or prohibits installation, and improve the fault tolerance of user misoperation. For the startup operations of the remaining non-target installation package files, the computer responds in time to ensure that the installed applications can run normally, the applications that are not installed can be installed normally, and the non-executable files can be opened normally, so as to ensure the reliability of the computer's operation.
[0087] The file control device provided in the embodiment of the present application can be used to execute the file control method provided in the above embodiment, and has corresponding functions and beneficial effects.
[0088] Figure 8 This is a schematic diagram of the structure of a file management device provided in an embodiment of the present application, with reference to Figure 8The file control device includes: a processor 31, a memory 32, a communication device 33, an input device 34, and an output device 35. The number of processors 31 in the file control device can be one or more, and the number of memories 32 in the file control device can be one or more. The processor 31, memory 32, communication device 33, input device 34, and output device 35 of the file control device can be connected via a bus or other means.
[0089] The memory 32, as a computer-readable storage medium, can be used to store software programs, computer executable programs and modules, such as program instructions / modules corresponding to the file control method of any embodiment of the present application (for example, the installation package detection module 21, the feature matching module 22, the first file processing module 23 and the second file processing module 24 in the file control device). The memory 32 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the device, etc. In addition, the memory 32 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some instances, the memory may further include a memory remotely arranged relative to the processor, and these remote memories may be connected to the device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network and a combination thereof.
[0090] The communication device 33 is used for data transmission.
[0091] The processor 31 executes various functional applications and data processing of the device by running the software programs, instructions and modules stored in the memory 32, that is, implements the above-mentioned file management method.
[0092] The input device 34 may be used to receive input digital or character information and generate key signal input related to user settings and function control of the device. The output device 35 may include a display device such as a display screen.
[0093] The file control device provided above can be used to execute the file control method provided in the above embodiment, and has corresponding functions and beneficial effects.
[0094] An embodiment of the present application also provides a storage medium containing computer executable instructions, which are used to execute a file management method when executed by a computer processor. The file management method includes: in response to a file startup operation, when the file to be started corresponding to the file startup operation is an executable file, detecting whether the file to be started is an installation package file or a non-installation package file; when the file to be started is an installation package file, matching the file characteristics of the file to be started with the file characteristics of a preset target installation package file; when the file characteristics match, prohibiting the startup of the file to be started; when the file to be started is a non-installation package file or the file characteristics do not match, starting the file to be started.
[0095] Storage medium - any of various types of memory devices or storage devices. The term "storage medium" is intended to include: installation media, such as CD-ROM, floppy disk or tape device; computer system memory or random access memory, such as DRAM, DDR RAM, SRAM, EDO RAM, Rambus RAM, etc.; non-volatile memory, such as flash memory, magnetic media (such as hard disk or optical storage); registers or other similar types of memory elements, etc. Storage media may also include other types of memory or combinations thereof. In addition, the storage medium may be located in the first computer system in which the program is executed, or may be located in a different second computer system, which is connected to the first computer system via a network (such as the Internet). The second computer system can provide program instructions to the first computer for execution. The term "storage medium" may include two or more storage media residing in different locations (for example, in different computer systems connected by a network). The storage medium may store program instructions (for example, embodied as a computer program) that can be executed by one or more processors.
[0096] Of course, the storage medium containing computer executable instructions provided in the embodiment of the present application, whose computer executable instructions are not limited to the above file management method, can also execute related operations in the file management method provided in any embodiment of the present application.
[0097] The file control apparatus, storage medium and file control device provided in the above embodiments can execute the file control method provided in any embodiment of the present application. For technical details not described in detail in the above embodiments, please refer to the file control method provided in any embodiment of the present application.
[0098] The above are only preferred embodiments of the present application and the technical principles used. The present application is not limited to the specific embodiments herein, and various obvious changes, readjustments and substitutions that can be made by those skilled in the art will not deviate from the protection scope of the present application. Therefore, although the present application is described in more detail through the above embodiments, the present application is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present application, and the scope of the present application is determined by the scope of the claims.
Claims
1. A file management method, characterized in that: include: In response to a file startup operation, if the file to be started corresponding to the file startup operation is an executable file, detecting whether the file to be started is an installation package file or a non-installation package file; In the case where the file to be started is an installation package file, matching the file characteristics of the file to be started with the file characteristics of a preset target installation package file; If the file features match, the startup of the file to be started is prohibited; When the file to be started is not an installation package file or the file features do not match, the file to be started is started.
2. The file management method according to claim 1, characterized in that: When the file to be started corresponding to the file startup operation is an executable file, detecting whether the file to be started is an installation package file or a non-installation package file includes: When it is confirmed that the identification information of the executable file is stored in the address space corresponding to the file header of the file to be started, it is detected whether the file to be started is an installation package file or a non-installation package file.
3. The file management method according to claim 1, characterized in that: The detecting whether the to-be-started file is an installation package file or a non-installation package file includes: Extracting a file feature of the file to be started, wherein the file feature includes at least one of a file name, a file signature, and a product name; In a case where the file feature of the to-be-started file matches the file feature of the installation package file in the preset false detection list, determining that the to-be-started file is an installation package file; When the file feature of the to-be-started file matches the file feature of the non-installation package file in the preset false detection list, it is determined that the to-be-started file is a non-installation package file.
4. The file management method according to claim 1, characterized in that: The detecting whether the to-be-started file is an installation package file or a non-installation package file includes: According to the header part of the file to be started, obtaining the subsystem value of the file to be started; When the subsystem value of the file to be started is not the subsystem value corresponding to the graphic user interface, it is determined that the file to be started is a non-installation package file.
5. The file management method according to claim 1, characterized in that: The detecting whether the to-be-started file is an installation package file or a non-installation package file includes: According to the resource file of the file to be started, obtaining the name of the resource file; In the case where the name of the resource file matches a preset packaging name, it is determined that the file to be started is an installation package file; wherein the packaging name is the name of the resource file of the installation package file generated based on the corresponding packaging software.
6. The file control method according to claim 1, characterized in that: The detecting whether the to-be-started file is an installation package file or a non-installation package file includes: When the file size of the file to be started is greater than a preset size threshold, it is determined that the file to be started is an installation package file.
7. The file management method according to claim 1, characterized in that: The detecting whether the to-be-started file is an installation package file or a non-installation package file includes: Obtaining the preview content of the file to be started through the preset decompression software; In a case where the preview content includes a preset block structure, determining that the file to be started is a non-installation package file; When the preview content does not include a preset block structure, it is determined that the file to be started is an installation package file.
8. A file control device, characterized in that: include: An installation package detection module is configured to, in response to a file startup operation, detect whether the file to be started corresponding to the file startup operation is an installation package file or a non-installation package file when the file to be started corresponding to the file startup operation is an executable file; a feature matching module, configured to match the file feature of the file to be started with the file feature of a preset target installation package file when the file to be started is an installation package file; A first file processing module is configured to prohibit starting the to-be-started file when the file features match; The second file processing module is configured to start the file to be started when the file to be started is not an installation package file or the file feature does not match.
9. A file management device, characterized in that: include: one or more processors; A memory stores one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the file management method as described in any one of claims 1 to 7.
10. A storage medium containing computer executable instructions, characterized in that: The computer executable instructions, when executed by a computer processor, are used to execute the file management method as described in any one of claims 1-7.