Method, device and product for identifying foreign storage medium file under domestic operating system

By adding the external attribute and drawing an identification icon to external storage media files in the file manager of a domestic operating system, the problem of users being unable to identify external storage media files is solved, enabling rapid identification and secure management, and improving the system's flexibility and security.

CN118939616AInactive Publication Date: 2024-11-12KYLIN CORP
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411427350.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-14
Publication Date
2024-11-12
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In domestically developed operating systems, users cannot quickly identify files on external storage media, and existing technologies limit users' ability to customize icons and the difficulty of expanding functionality.

Method used

By identifying external storage media files in the file manager of a domestic operating system and adding the external attribute, calling the identification plugin, and drawing an identification icon, the identification of external storage media files can be achieved.

Benefits of technology

It improves the efficiency and security of file management, enabling users to quickly identify files on external storage media, reducing system security risks, and providing flexibility and scalability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118939616A_ABST
    Figure CN118939616A_ABST
Patent Text Reader

Abstract

The invention provides a method, device and product for identifying a foreign storage medium file under a domestic operating system, and the method comprises the steps: judging the foreign storage medium file needing to be identified through a file manager of the domestic operating system, and adding an external attribute for the foreign storage medium file; calling an identification plug-in through a file manager; and judging whether the file has an external attribute or not through the identification plug-in, and if the file has the external attribute, adding identification to the file in the icon view agent, the list view agent and the desktop icon view agent. According to the method, the striking identification icon is added to the file from the external storage medium, so that an administrator or a user can conveniently identify the external file.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of computer information technology, and in particular relates to a method, device and product for identifying external storage medium files under a domestic operating system. Background Art

[0002] In existing domestic operating system environments, in scenarios where multiple users or multiple departments collaborate, when a user uses a file manager to copy or cut files from external storage media (such as flash memory, hard disk, CD-ROM, digital versatile disk (DVD), etc.) to a local computer, other users and the user cannot quickly and intuitively see which files are from the external storage media. Figure 1 As shown in the figure, some files in the current directory are copied from external storage media, but they cannot be identified. This is very inconvenient for users, and it is impossible to classify and supervise such files. At the same time, external storage media are often used for data exchange and transmission due to their portability and ease of use. However, external storage media files may contain malware programs or other potential risks (such as memory leaks, etc.). Identifying such files helps to monitor the files and take further security measures, such as tracking analysis, isolation or deletion.

[0003] Existing domestic operating systems do not implement the function of identifying files on external storage media. The file identification icons are managed through the file manager, but the file manager only supports the automatic addition of identification for read-only, non-writable and linked files by default. To add file identification to external storage media, developers need to design and add them according to requirements. You can refer to the default identification addition scheme of the default file manager and add identification directly in the file manager according to the attributes. However, this scheme limits the user's ability to choose or design other identification icons according to their own needs. At the same time, for developers, it is also difficult to integrate and expand functions based on this fixed scheme. Summary of the invention

[0004] The purpose of the present invention is to provide a method, device and product for marking external storage medium files under a domestic operating system, adding eye-catching identification icons to files from external storage media to facilitate administrators or users to identify external files.

[0005] In order to achieve the above object, the technical solution of the present invention is as follows: A method for identifying external storage medium files under a domestic operating system, comprising: S1. Using a file manager of a domestic operating system, determine an external storage medium file that needs to be identified, and add an external attribute to the external storage medium file; S2. Call the identification plug-in through the file manager; S3. Determine whether the file has an external attribute through the identification plug-in. If so, add an identification to the file in the icon view agent, the list view agent and the desktop icon view agent.

[0006] Furthermore, the method for the file manager to implement the determination and attribute addition in step S1 includes: Add a judgment in the fileSync() method function in the FileOperation class in the file manager. If the source file address srcUri comes from an external storage medium and the destination address destUri is local, add the external attribute to the file through the system standard library function setxattr().

[0007] Furthermore, the method in which the file manager calls the identification plug-in in step S2 includes: Define the file identification drawing interface in the file manager source code, use the Q_DECLARE_INTERFACE() macro to declare the interface, define the getFileEmblemIcons() method that provides the identification icon class and the pure virtual function to obtain the file identification icon; define the interface in the identification plug-in to inherit the file identification drawing interface in the source code, and use the Q_INTERFACES() macro to declare that the inherited interface is the file identification drawing interface in the file manager source code.

[0008] Furthermore, step S3 specifically includes: Define the class for drawing external storage file logo in the plug-in and inherit the logo icon provider class to implement the getFileEmblemIcons() method for obtaining the file logo icon; In the getFileEmblemIcons() method, the parameter uri is the file path. The system standard library function getxattr() is used to obtain the file attributes according to the file uri. If the attribute is external, the file's logo icon name list is returned. The View is rendered by modifying the paint() method in the corresponding Delegate to load the file logo. In the icon view agent, list view agent and desktop icon view agent, the getFileEmblemIcons() method of the identification icon provider class is used to obtain the name list of the identification icons, and then the paint() method of the file identification icon is used to draw the identification icon of the external storage medium onto the file, thereby realizing the function of identifying the file on the external storage medium.

[0009] Another aspect of the present invention provides a device for identifying external storage medium files under a domestic operating system, comprising: Judgment module: judging the external storage medium file to be identified through the file manager of the domestic operating system, and adding external attribute to the external storage medium file; Calling module: calling the identification plug-in through the file manager; Identification module: determines whether the file has an external attribute through the identification plug-in, and if so, adds an identification to the file in the icon view agent, the list view agent and the desktop icon view agent.

[0010] Furthermore, the judgment module includes: Add a judgment in the fileSync() method function in the FileOperation class in the file manager. If the source file address srcUri comes from an external storage medium and the destination address destUri is local, add the external attribute to the file through the system standard library function setxattr().

[0011] Furthermore, the calling module includes: Define the file identification drawing interface in the file manager source code, use the Q_DECLARE_INTERFACE() macro to declare the interface, define the getFileEmblemIcons() method that provides the identification icon class and the pure virtual function to obtain the file identification icon; define the interface in the identification plug-in to inherit the file identification drawing interface in the source code, and use the Q_INTERFACES() macro to declare that the inherited interface is the file identification drawing interface in the file manager source code.

[0012] Furthermore, the identification module includes: Define the class for drawing external storage file logo in the plug-in and inherit the logo icon provider class to implement the getFileEmblemIcons() method for obtaining the file logo icon; In the getFileEmblemIcons() method, the parameter uri is the file path. The system standard library function getxattr() is used to obtain the file attributes according to the file uri. If the attribute is external, the file's logo icon name list is returned. The View is rendered by modifying the paint() method in the corresponding Delegate to load the file logo. In the icon view agent, list view agent and desktop icon view agent, the getFileEmblemIcons() method of the identification icon provider class is used to obtain the name list of the identification icons, and then the paint() method of the file identification icon is used to draw the identification icon of the external storage medium onto the file, thereby realizing the function of identifying the file on the external storage medium.

[0013] The present invention also provides a computer-readable storage medium, which stores a computer program, and the computer program is used to execute the above-mentioned method for identifying foreign storage medium files under the domestic operating system.

[0014] The present invention also provides a computer program product, including a computer program, which, when executed by a processor, implements the method for identifying external storage medium files under the domestic operating system.

[0015] Compared with the prior art, the present invention has the following beneficial effects: 1. The present invention can automatically add an identification icon to the file through the file manager when copying / cutting an external storage medium file to the local machine under a domestic operating system, so that the administrator or user can quickly identify the file from the external storage medium, thereby better classifying and supervising the file, improving the efficiency and convenience of file management, and reducing system security risks, ensuring the security and stability of the computer system.

[0016] 2. The present invention is specifically implemented in the plug-in as a function of identifying an icon for a file in an external storage medium, which can be deployed according to specific actual scenarios, and can also be expanded or redeveloped based on this function. If this function is not needed, the plug-in can be removed without any impact on the file manager program, meeting the needs of different users or scenarios, improving user experience, reducing system security risks, and being more flexible and scalable. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 This is a schematic diagram of a file manager interface in the prior art; Figure 2 A flow chart of a method for adding a mark to an external storage medium file according to an embodiment of the present invention; Figure 3 A flow chart of adding attributes to an external storage medium file in an embodiment of the present invention; Figure 4 This is an execution flow chart of a file manager calling a plug-in identification file in an embodiment of the present invention; Figure 5 The figure is a schematic diagram of the file manager interface after marking a file in an embodiment of the present invention. DETAILED DESCRIPTION

[0018] It should be noted that, in the absence of conflict, the embodiments of the present invention and the features in the embodiments may be combined with each other.

[0019] The present invention Figure 2As shown, it involves two parts: the main program and the plug-in program. The main program is a file manager. It is necessary to add an interface method for identifying icons in the main program, and to determine the source of the source file when cutting or copying files to the local computer. If the file comes from an external storage device, it is necessary to add the attribute of external. The plug-in program needs to implement the interface method in the main program to realize the function of identifying files on external storage media.

[0020] The process of adding external attributes is as follows Figure 3 As shown, including the following: Step 1: In the domestic operating system of the computer device, open the file manager to copy / cut files to the system directory; Step 2: Check whether the source file of the copied / cut file is from the external storage medium. If it is a file of the external storage medium, execute step 3. If not, do not execute the operation; Step 3: Determine whether the target address is an external storage medium. If not, it means that the file of the external storage medium is copied / cut to the local directory of the system, and then proceed to step 4. If it is, no operation is performed; Step 4: Add external attributes to the target file to complete the operation of adding attributes to the external storage media file.

[0021] After adding the external attribute, the process of calling the plug-in identification file is as follows Figure 4 As shown, the following steps are included: Step 1: Add an interface for drawing file identification icons in the file manager source code; Step 2: Write a file manager plug-in to inherit and implement the interface for drawing file corner marks; Step 3: Determine whether the plug-in is loaded normally. If it is loaded successfully, proceed to step 4. Otherwise, do not load the plug-in; Step 4: Get the properties of the previous file in the plug-in; Step 5: Determine whether the file attribute is external, if so, execute step 6. Otherwise, do not execute the operation; Step 6: Return the name list of the logo icons added to the corresponding file; Step 7: Determine whether the list of logo icons is empty, if not, execute step 8. If it is empty, do not execute the operation; Step 8: According to the returned icon list, load it in the list, icon and desktop icon view agent, and draw the identification icon for the file; Step 9: The external storage file displays the file ID.

[0022] To implement the above process, first of all, for the file manager, two functions need to be added. The first is to judge the source and destination address of the file after copying or cutting the file and before pasting the file. If it comes from an external storage medium and the destination address is a local path, the additional attribute external will be added to the file. The second is to add an interface for drawing a logo icon to add a logo icon to the file.

[0023] Secondly, which files are ultimately drawn icons for is specifically implemented in the plug-in. The plug-in program adds identification icons to files by reading the attributes of the files, thereby realizing the function of setting identification for files in external storage media.

[0024] The following is a specific implementation scheme of the embodiment of the present invention: 1. Access storage media, including but not limited to flash memory, hard disk, CD-ROM, digital versatile disk (DVD), etc. The system will automatically mount the storage media to the system directory. Use the file manager to copy or cut the files on the storage media to the local directory of the computer; 2. The file operation involves the fileSync() method in the FileOperation class in the file manager, which is used to synchronize the file to the local. Add a judgment in this function. If the source file address srcUri comes from the external storage medium and the destination address destUri is local, add the external attribute to the file through the system standard library function setxattr().

[0025] 3. Add the interface for drawing file icons to the file manager source code, use the Q_DECLARE_INTERFACE() macro to declare the interface, define the icon provider class and the getFileEmblemIcons() method of the pure virtual function to obtain the file's icon; 4. Define the interface in the plug-in to inherit the drawing file identification interface in the source code, and use the Q_INTERFACES() macro to declare that the inherited interface is the drawing file identification interface in the file manager source code; 5. Define the class for drawing external storage file logo in the plug-in and inherit the logo icon provider class to implement the getFileEmblemIcons() method to obtain the file logo icon; 6. In the getFileEmblemIcons() method, the parameter uri is the file path. The system standard library function getxattr() is used to obtain the file attributes according to the file uri. If the attribute is external, the file's logo icon name list is returned; 7. The file manager view display is implemented through the model, view and delegate architecture, where the delegate can be used to modify the model to implement the view display, or directly render and update the view. To update the file identifier icon, the view is rendered directly by modifying the paint() method in the corresponding delegate to load the file identifier.

[0026] 8. File identification loading involves three parts: icon view agent, list view agent and desktop icon view agent. In the agent, the getFileEmblemIcons() method provided by the identification icon provider class is used to obtain the name list of the identification icon, and then the paint() method of the file identification icon is used to draw the identification icon of the external storage medium onto the file, thereby realizing the function of identifying the file on the external storage medium.

[0027] The above-mentioned embodiments are only preferred implementations of the present invention, and are only used to help understand the method and core ideas of the present application. The protection scope of the present invention is not limited to the above-mentioned embodiments. All technical solutions under the idea of ​​the present invention belong to the protection scope of the present invention. It should be pointed out that for ordinary technicians in this technical field, some improvements and modifications without departing from the principle of the present invention should also be regarded as the protection scope of the present invention.

Claims

1. A method for identifying external storage medium files under a domestic operating system. It is characterized in that include: S1. Using a file manager of a domestic operating system, determine an external storage medium file that needs to be identified, and add an external attribute to the external storage medium file; S2. Call the identification plug-in through the file manager; S3. Determine whether the file has an external attribute through the identification plug-in. If so, add an identification to the file in the icon view agent, the list view agent and the desktop icon view agent.

2. According to the method for identifying external storage medium files under the domestic operating system of claim 1, It is characterized in that The method for the file manager to implement the judgment and attribute addition in step S1 includes: Add a judgment in the fileSync() method function in the FileOperation class in the file manager. If the source file address srcUri comes from an external storage medium and the destination address destUri is local, add the external attribute to the file through the system standard library function setxattr().

3. The method for identifying external storage medium files under the domestic operating system according to claim 1, It is characterized in that The method in which the file manager calls the identification plug-in in step S2 includes: Define the file identification drawing interface in the file manager source code, use the Q_DECLARE_INTERFACE() macro to declare the interface, define the getFileEmblemIcons() method that provides the identification icon class and the pure virtual function to obtain the file identification icon; define the interface in the identification plug-in to inherit the file identification drawing interface in the source code, and use the Q_INTERFACES() macro to declare that the inherited interface is the file identification drawing interface in the file manager source code.

4. The method for identifying files in external storage media under a domestic operating system according to claim 3, It is characterized in that Step S3 specifically includes: Define the class for drawing external storage file logo in the plug-in and inherit the logo icon provider class to implement the getFileEmblemIcons() method for obtaining the file logo icon; In the getFileEmblemIcons() method, the parameter uri is the file path. The system standard library function getxattr() is used to obtain the file attributes according to the file uri. If the attribute is external, the file's logo icon name list is returned. The View is rendered by modifying the paint() method in the corresponding Delegate to load the file logo. In the icon view agent, list view agent and desktop icon view agent, the getFileEmblemIcons() method of the identification icon provider class is used to obtain the name list of the identification icons, and then the paint() method of the file identification icon is used to draw the identification icon of the external storage medium onto the file, thereby realizing the function of identifying the file on the external storage medium.

5. A device for identifying files in external storage media under a domestic operating system, It is characterized in that include: Judgment module: judging the external storage medium file to be identified through the file manager of the domestic operating system, and adding external attribute to the external storage medium file; Calling module: calling the identification plug-in through the file manager; Identification module: determines whether the file has an external attribute through the identification plug-in, and if so, adds an identification to the file in the icon view agent, the list view agent and the desktop icon view agent.

6. The device for identifying files of external storage media under the domestic operating system according to claim 5, It is characterized in that The judgment module includes: Add a judgment in the fileSync() method function in the FileOperation class in the file manager. If the source file address srcUri comes from an external storage medium and the destination address destUri is local, add the external attribute to the file through the system standard library function setxattr().

7. The device for identifying files of external storage media under the domestic operating system according to claim 5, It is characterized in that The calling modules include: Define the file identification drawing interface in the file manager source code, use the Q_DECLARE_INTERFACE() macro to declare the interface, define the getFileEmblemIcons() method that provides the identification icon class and the pure virtual function to obtain the file identification icon; define the interface in the identification plug-in to inherit the file identification drawing interface in the source code, and use the Q_INTERFACES() macro to declare that the inherited interface is the file identification drawing interface in the file manager source code.

8. The device for identifying files of external storage media under the domestic operating system according to claim 7, It is characterized in that The identification module includes: Define the class for drawing external storage file logo in the plug-in and inherit the logo icon provider class to implement the getFileEmblemIcons() method for obtaining the file logo icon; In the getFileEmblemIcons() method, the parameter uri is the file path. The system standard library function getxattr() is used to obtain the file attributes according to the file uri. If the attribute is external, the file's logo icon name list is returned. The View is rendered by modifying the paint() method in the corresponding Delegate to load the file logo. In the icon view agent, list view agent and desktop icon view agent, the getFileEmblemIcons() method of the identification icon provider class is used to obtain the name list of the identification icons, and then the paint() method of the file identification icon is used to draw the identification icon of the external storage medium onto the file, thereby realizing the function of identifying the file on the external storage medium.

9. A computer-readable storage medium storing a computer program. It is characterized in that The computer program is used to execute the method for identifying external storage medium files under a domestic operating system as described in any one of claims 1-4.

10. A computer program product comprising a computer program, It is characterized in that When the computer program is executed by a processor, the method for identifying external storage medium files under a domestic operating system as described in any one of claims 1 to 4 is implemented.

Citation Information

Patent Citations

  • Image forming apparatus and method to display files having identifiers

    CN101577775A

  • File display device and method

    CN103024010A

  • File browsing method, electronic equipment and machine readable storage medium

    CN110770713A

  • Method and system for determining computer file source through identifier and medium

    CN113934990A

  • Method to identify known compilers functions, libraries and objects inside files and data items containing an executable code

    US20170372068A1