A method and apparatus for managing file hiding in a network attached storage device

By detecting file editing events in network-attached storage devices, configuring logical and system-level hiding attributes, constructing multi-level namespaces, and creating reference indexes, the compatibility issues of file hiding under multiple operating systems are resolved, achieving unified management and differentiated access, and improving access efficiency and reliability.

CN122045141BActive Publication Date: 2026-06-30SHENZHEN LINGDECHUANG TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHENZHEN LINGDECHUANG TECH CO LTD
Filing Date
2026-04-15
Publication Date
2026-06-30

AI Technical Summary

Technical Problem

In existing technologies, the file hiding mechanism of network attached storage devices has compatibility issues under multiple operating systems, resulting in inconsistent hiding attribute behavior, making it impossible to achieve unified management and differentiated access, and posing a single point of failure risk and data transmission delay.

Method used

By detecting file editing events, reading the target file's naming information and metadata, configuring logical-level and system-level hiding attributes based on operating system information, constructing multi-level namespaces and creating reference indexes, and dynamically controlling the file's visibility scope, a dual hiding mechanism at both the logical and system levels is achieved.

Benefits of technology

It achieves unified management and control of file hiding across multiple operating systems, meets the differentiated access needs of users with different permissions, reduces system computing overhead, and ensures the uniformity of the hiding state and access efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122045141B_ABST
    Figure CN122045141B_ABST
Patent Text Reader

Abstract

This application discloses a file hiding management method and apparatus for network attached storage devices. The method includes: reading the naming information and file metadata of a target file corresponding to a file editing event; determining the hiding level information of the target file and each preset operating system information according to each preset operating system information, the naming information, and the file metadata; configuring the logical-level hiding attribute of the target file according to each preset operating system information when the hiding level information is not the lowest set level; determining the target namespace in each preset multi-level namespace corresponding to each preset operating system information according to the hiding level information, and adding the target file to the target namespace. This technical solution achieves unified management and control of file hiding under multiple operating systems, realizing a dual hiding mechanism of logical-level hiding and system-level hiding, thereby meeting the differentiated access needs of users with different permissions and achieving fine-grained control over the file visibility range.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of electronic digital data processing technology, specifically relating to a file hiding management method and apparatus for a network attached storage device. Background Technology

[0002] Network attached storage (NET) devices, as the core carrier of cross-platform file sharing, need to be compatible with multiple operating systems such as Linux, macOS, and Windows to achieve centralized data storage and flexible access. However, the definitions and implementation mechanisms of file hiding differ fundamentally among different operating systems.

[0003] Currently, to address the compatibility issues of file hiding mechanisms across different operating systems, the mainstream solution is to deploy an intermediate platform or protocol conversion bridge (such as an SMB / CIFS server) to translate the hiding semantics of one operating system to another through protocol conversion and state maintenance. However, this translation model has significant limitations: first, its logic is complex, and differences in protocol parsing can easily lead to inconsistent behavior of hidden attributes on different clients, making true unified management impossible; second, this architecture relying on an intermediate layer carries the risk of single point of failure and increases data transmission latency; and third, it cannot achieve fine-grained management of the different visibility ranges of the same file for different users. Summary of the Invention

[0004] This application provides a file hiding management method and apparatus for network attached storage devices, aiming to achieve unified control over file hiding under multiple operating systems, realize a dual hiding mechanism of logical-level hiding and system-level hiding, thereby meeting the differentiated access needs of users with different permissions and achieving fine-grained control over the visible range of files.

[0005] In a first aspect, embodiments of this application provide a file hiding management method for a network-attached storage device, the method comprising:

[0006] Upon detecting a file editing event, read the naming information and file metadata of the target file corresponding to the file editing event;

[0007] Based on the preset operating system information, the naming information, and the file metadata, the hiding level information corresponding to the target file and the preset operating system information is determined respectively.

[0008] When the hiding level information is not the lowest level set, the logical level hiding attribute of the target file is configured according to each of the preset operating system information, wherein the lowest level indicates that the target file is a normally visible file that does not need to be hidden;

[0009] Based on the concealment level information, target namespaces are determined in the preset multi-level namespaces corresponding to each preset operating system information, and the target file is added to the target namespace. This is used to dynamically control the system-level concealment status of the target file for the visitor based on the association between the visitor's accessible namespace and the target namespace.

[0010] Furthermore, the preset multi-level namespace includes multiple hierarchical namespaces set progressively according to the hiding level information, and each hierarchical namespace includes a reference index pointing to the adjacent lower-level namespace;

[0011] Accordingly, adding the target file to the target namespace includes:

[0012] Create a reference index pointing to the target file in the target namespace.

[0013] Furthermore, creating a reference index pointing to the target file in the target namespace includes:

[0014] The target index naming rules are determined based on the preset operating system information corresponding to the target namespace;

[0015] Generate the index name corresponding to the target file according to the target index naming rules;

[0016] In the target namespace, a reference index pointing to the target file is created according to the index name.

[0017] Furthermore, the step of dynamically controlling the system-level hiding state of the target file from the visitor based on the association between the visitor's accessible namespace and the target namespace includes:

[0018] Parse the reference indexes in the visitor's accessible namespace to obtain the target object of each reference index;

[0019] If the target object is a file, the file is added to the access feedback result;

[0020] If the target object is a hierarchical namespace, continue parsing each reference index in the hierarchical namespace until all reference indexes under the accessible namespace are recursively parsed. If the target namespace is not traversed during the recursive parsing process, it indicates that the target file is hidden from the visitor at the system level.

[0021] Furthermore, determining the concealment level information of the target file corresponding to each preset operating system information based on the preset operating system information, the naming information, and the file metadata includes:

[0022] If the naming information does not include preset characters, the hiding level information of the target file corresponding to each of the preset operating system information is determined to be the lowest level set.

[0023] When the naming information includes preset characters, the hiding level information of the target file corresponding to each preset operating system information is determined according to each preset operating system information and the file metadata.

[0024] Furthermore, the preset operating system information includes Linux, macOS, and Windows systems;

[0025] Accordingly, configuring the logical-level hiding attribute of the target file according to the preset operating system information includes:

[0026] For the Linux system and the MacOS system, logical-level hidden attribute configuration operations are not performed;

[0027] For the Windows system, obtain the file system information of the network attached storage device, and configure the logical-level hidden attribute of the target file corresponding to the Windows system according to the file system information.

[0028] Furthermore, configuring the logical-level hidden attribute of the target file corresponding to the Windows system based on the file system information includes:

[0029] If the file system information is an NTFS file system, set the FILE_ATTRIBUTE_HIDDEN attribute of the target file to a hidden state;

[0030] or,

[0031] If the file system information is any one of FAT16, FAT32, and ExFAT file system, the ATTR_HIDDEN attribute of the target file is set to hidden.

[0032] Secondly, embodiments of this application provide a file hiding management device for a network-attached storage device, the device comprising:

[0033] The file information acquisition module is used to read the naming information and file metadata of the target file corresponding to the file editing event when a file editing event is detected.

[0034] The concealment level determination module is used to determine the concealment level information of the target file and the corresponding preset operating system information based on each preset operating system information, the naming information and the file metadata;

[0035] The logical hiding configuration module is used to configure the logical level hiding attribute of the target file according to each of the preset operating system information when the hiding level information is not the lowest level set, wherein the lowest level indicates that the target file is a normally visible file that does not need to be hidden;

[0036] The system hiding configuration module is used to determine the target namespace in the preset multi-level namespaces corresponding to each preset operating system information according to the hiding level information, and add the target file to the target namespace. It is used to dynamically control the system-level hiding status of the target file to the visitor according to the association between the visitor's accessible namespace and the target namespace.

[0037] Furthermore, the preset multi-level namespace includes multiple hierarchical namespaces set progressively according to the hiding level information, and each hierarchical namespace includes a reference index pointing to the adjacent lower-level namespace;

[0038] Accordingly, the system hidden configuration module is specifically used for:

[0039] Create a reference index pointing to the target file in the target namespace.

[0040] Furthermore, the system's hidden configuration module is specifically used for:

[0041] The target index naming rules are determined based on the preset operating system information corresponding to the target namespace;

[0042] Generate the index name corresponding to the target file according to the target index naming rules;

[0043] In the target namespace, a reference index pointing to the target file is created according to the index name.

[0044] Furthermore, the system's hidden configuration module is specifically used for:

[0045] Parse the reference indexes in the visitor's accessible namespace to obtain the target object of each reference index;

[0046] If the target object is a file, the file is added to the access feedback result;

[0047] If the target object is a hierarchical namespace, continue parsing each reference index in the hierarchical namespace until all reference indexes under the accessible namespace are recursively parsed. If the target namespace is not traversed during the recursive parsing process, it indicates that the target file is hidden from the visitor at the system level.

[0048] Furthermore, the concealment level determination module is specifically used for:

[0049] If the naming information does not include preset characters, the hiding level information of the target file corresponding to each of the preset operating system information is determined to be the lowest level set.

[0050] When the naming information includes preset characters, the hiding level information of the target file corresponding to each preset operating system information is determined according to each preset operating system information and the file metadata.

[0051] Furthermore, the preset operating system information includes Linux, macOS, and Windows systems;

[0052] Accordingly, the logical hiding configuration module is specifically used for:

[0053] For the Linux system and the MacOS system, logical-level hidden attribute configuration operations are not performed;

[0054] For the Windows system, obtain the file system information of the network attached storage device, and configure the logical-level hidden attribute of the target file corresponding to the Windows system according to the file system information.

[0055] Furthermore, the logically hidden configuration module is specifically used for:

[0056] If the file system information is an NTFS file system, set the FILE_ATTRIBUTE_HIDDEN attribute of the target file to a hidden state;

[0057] or,

[0058] If the file system information is any one of FAT16, FAT32, and ExFAT file system, the ATTR_HIDDEN attribute of the target file is set to hidden.

[0059] Thirdly, embodiments of this application provide an electronic device including a processor, a memory, and a program or instructions stored in the memory and executable on the processor, wherein the program or instructions, when executed by the processor, implement the method described in the first aspect.

[0060] Fourthly, embodiments of this application provide a readable storage medium on which a program or instructions are stored, which, when executed by a processor, implement the method described in the first aspect.

[0061] In this embodiment, upon detecting a file editing event, the naming information and file metadata of the target file corresponding to the file editing event are read. Hidden level information corresponding to the target file and each preset operating system information is determined based on preset operating system information, the naming information, and the file metadata. If the hidden level information is not the set minimum level, a logical-level hidden attribute of the target file is configured based on each preset operating system information, wherein the minimum level indicates that the target file is a normally visible file that does not need to be hidden. A target namespace is determined in each preset multi-level namespace corresponding to each preset operating system information based on the hidden level information, and the target file is added to the target namespace. This is used to dynamically control the system-level hiding state of the target file for the visitor based on the association between the visitor's accessible namespace and the target namespace. The above-described file hiding management method for network attached storage devices achieves unified control of file hiding under multiple operating systems, realizing a dual hiding mechanism of logical-level hiding and system-level hiding, thereby meeting the differentiated access needs of users with different permissions and achieving refined control of the file visibility range. Attached Figure Description

[0062] Figure 1 This is a flowchart illustrating a file hiding management method for a network attached storage device provided in an embodiment of this application;

[0063] Figure 2 This is a flowchart illustrating another file hiding management method for a network attached storage device provided in an embodiment of this application;

[0064] Figure 3 This is a flowchart illustrating another file hiding management method for a network attached storage device provided in an embodiment of this application;

[0065] Figure 4 This is a schematic diagram of the structure of a file hiding management device for a network attached storage device provided in an embodiment of this application;

[0066] Figure 5This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0067] To make the objectives, technical solutions, and advantages of this application clearer, specific embodiments of this application will be described in further detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are merely for explaining this application and not for limiting it. It should also be noted that, for ease of description, only the parts relevant to this application are shown in the drawings, not all of them. Before discussing exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although the flowcharts describe operations (or steps) as sequential processes, many of these operations can be performed in parallel, concurrently, or simultaneously. Furthermore, the order of the operations can be rearranged. The process can be terminated when its operation is completed, but may also have additional steps not included in the drawings. The process can correspond to a method, function, procedure, subroutine, subroutine, etc.

[0068] The technical solutions of the embodiments of this application will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application are within the scope of protection of this application.

[0069] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.

[0070] The file hiding management method and apparatus for network attached storage devices provided in this application will be described in detail below with reference to the accompanying drawings, through specific embodiments and application scenarios.

[0071] First, this application applies to scenarios where access to a network-attached storage device (NATS) is conducted through at least one operating system, and differentiated hiding and control of files on the NATS are required. Based on the above usage scenario, it is understood that the implementing entity of this application can be a NATS. Specifically, a NATS can be a dedicated file storage device connected to a network and providing file-level data storage services.

[0072] Figure 1 This is a flowchart illustrating a file hiding management method for a network attached storage device provided in an embodiment of this application. Figure 1 As shown, the specific steps include the following:

[0073] S101, upon detecting a file editing event, read the naming information and file metadata of the target file corresponding to the file editing event.

[0074] Among them, file editing events can be file creation or modification operations.

[0075] In one embodiment, file editing events can be detected by using a file system event listening mechanism on a network-attached storage device to monitor file operations in real time.

[0076] The target file is the file where the file editing event occurred.

[0077] The naming information can be the filename of the target file; the file metadata can be information fields used to describe file attributes, which may include file type, editor, editing time, and the operating system from which it was created.

[0078] In one embodiment, the naming information and file metadata of the target file corresponding to the file editing event can be obtained by calling the file system's metadata reading interface to read the target file corresponding to the file editing event.

[0079] S102, determine the hiding level information corresponding to the target file and each preset operating system information according to the preset operating system information, the naming information and the file metadata.

[0080] The preset operating system information can be pre-defined identifiers representing different operating systems. These operating systems can include Windows, Linux, and macOS.

[0081] Among them, the hiding level information corresponding to the target file and each preset operating system information can be a level identifier used to characterize the degree of hiding of the target file under the corresponding operating system.

[0082] In one embodiment, the method of determining the hiding level information of the target file corresponding to each preset operating system information based on each preset operating system information, naming information, and file metadata can be adopted. When the naming information does not include preset characters, the hiding level information of the target file corresponding to each preset operating system information can be determined to the lowest set level. When the naming information includes preset characters, the hiding level information of the target file corresponding to each preset operating system information can be determined based on each preset operating system information and file metadata.

[0083] S103, if the hiding level information is not the lowest level set, configure the logical level hiding attribute of the target file according to each of the preset operating system information, wherein the lowest level indicates that the target file is a normally visible file that does not need to be hidden.

[0084] The lowest level represents a target file that is normally visible and does not need to be hidden, meaning that the target file is visible to visitors by default in any operating system environment.

[0085] Among them, the logical level of hiding attribute can be a logical attribute flag that identifies whether a file is hidden in the corresponding operating system environment by setting file system attribute flags.

[0086] In one embodiment, the method of configuring the logical-level hidden attributes of the target file according to each preset operating system information can be achieved by modifying the file system attribute bits or extended attribute fields of the target file corresponding to each preset operating system information.

[0087] S104, based on the hiding level information, determine the target namespace in the preset multi-level namespace corresponding to each preset operating system information, and add the target file to the target namespace, so as to dynamically control the system-level hiding state of the target file to the visitor based on the association between the visitor's accessible namespace and the target namespace.

[0088] The preset multi-level namespaces corresponding to each preset operating system information can be virtual file directory systems built for different operating system environments. Specifically, a namespace can be a logical container used to isolate file views in a network-attached storage device. It can be understood that each preset operating system information corresponds to a preset multi-level namespace.

[0089] The target namespace can be the namespace corresponding to the hiding level information in each preset multi-level namespace.

[0090] In one embodiment, the method of determining the target namespace based on the concealment level information in the preset multi-level namespaces corresponding to each preset operating system information can be achieved by pre-setting the concealment level information of each namespace in the preset multi-level namespaces corresponding to each preset operating system information, matching the concealment level information of each namespace with the current concealment level information, and obtaining the target namespace.

[0091] In one embodiment, adding a target file to a target namespace can be achieved by establishing a file index mapping relationship for the target file in the target namespace or by creating a logical file reference.

[0092] Here, the visitor can be a user terminal device accessing a network-attached storage device; the accessible namespace can be a set of namespaces that are allowed to be accessed based on the visitor's identity and permissions. Specifically, the hidden level information that the visitor can access can be determined based on the visitor's identity and permissions, and the hidden level information corresponding to each namespace is matched with the accessible hidden level information to obtain the accessible namespace.

[0093] System-level hiding can be achieved by controlling access to files at the file system level to make files visible or invisible to visitors.

[0094] In one embodiment, the system-level hiding state of the target file to the visitor can be dynamically controlled based on the association between the visitor's accessible namespace and the target namespace. For example, if the accessible namespace is the target namespace where the target file is located, then the system-level hiding state of the target file to the visitor is not hidden.

[0095] Understandably, if the target file is not hidden at the system level for visitors, but the target file's hiding level is not the lowest level set, the target file will still be hidden at the logical level for visitors.

[0096] In this embodiment, upon detecting a file editing event, the naming information and file metadata of the target file corresponding to the file editing event are read. Hidden level information corresponding to the target file and each preset operating system information is determined based on preset operating system information, the naming information, and the file metadata. If the hidden level information is not the set minimum level, a logical-level hidden attribute of the target file is configured based on each preset operating system information, wherein the minimum level indicates that the target file is a normally visible file that does not need to be hidden. A target namespace is determined in each preset multi-level namespace corresponding to each preset operating system information based on the hidden level information, and the target file is added to the target namespace. This is used to dynamically control the system-level hiding state of the target file for the visitor based on the association between the visitor's accessible namespace and the target namespace. The above-described file hiding management method for network attached storage devices achieves unified control of file hiding under multiple operating systems, realizing a dual hiding mechanism of logical-level hiding and system-level hiding, thereby meeting the differentiated access needs of users with different permissions and achieving refined control of the file visibility range.

[0097] Figure 2 This is a flowchart illustrating another file hiding management method for network attached storage devices provided in an embodiment of this application. For example... Figure 2 As shown, the specific steps include the following:

[0098] S201, upon detecting a file editing event, read the naming information and file metadata of the target file corresponding to the file editing event.

[0099] S202, determine the hiding level information corresponding to the target file and each preset operating system information according to the preset operating system information, the naming information and the file metadata.

[0100] S203, if the hiding level information is not the lowest level set, configure the logical level hiding attribute of the target file according to each of the preset operating system information, wherein the lowest level indicates that the target file is a normally visible file that does not need to be hidden.

[0101] S204, determine the target namespace in the preset multi-level namespace corresponding to each preset operating system information according to the concealment level information; the preset multi-level namespace includes multiple hierarchical namespaces set progressively according to the concealment level information, and each hierarchical namespace includes a reference index pointing to the adjacent lower-level namespace.

[0102] The preset multi-level namespaces include multiple hierarchical namespaces set progressively according to the concealment level information. Specifically, the concealment level information corresponds to the namespace hierarchy from shallow to deep, from low to high. For example, level 0 corresponds to the public namespace (visible to all users), level 1 corresponds to the restricted namespace (visible to designated users), and level 2 corresponds to the confidential namespace (visible to administrators). The higher the level, the stricter the access restrictions. Furthermore, visitors who have access to a higher-level namespace can access all lower-level namespaces associated with that higher-level namespace by following the reference index.

[0103] Each namespace level includes a reference index pointing to an adjacent lower-level namespace. This is used to construct a hierarchical access chain from higher to lower levels, ensuring backward compatibility of permissions and continuity of access. An adjacent lower-level namespace can be a namespace whose hiding level information differs from the current namespace by one level and is of a lower level. The reference index can be a structured pointer.

[0104] S205, create a reference index pointing to the target file in the target namespace, which is used to dynamically control the system-level hiding state of the target file to the visitor based on the association between the visitor's accessible namespace and the target namespace.

[0105] In one embodiment, the method for creating a reference index pointing to the target file in the target namespace can be to directly use the naming information of the target file as the index name, and then create a reference index pointing to the target file in the target namespace.

[0106] In one embodiment, creating a reference index pointing to the target file in the target namespace includes: determining a target index naming rule based on preset operating system information corresponding to the target namespace; generating an index name corresponding to the target file based on the target index naming rule; and creating a reference index pointing to the target file in the target namespace according to the index name.

[0107] The index name can be a combination of characters used to uniquely identify the referenced index, serving as a unique identifier for the referenced index within the namespace. The target index naming rule can be a pre-defined file index naming generation rule for different operating systems. For example, in a pre-defined multi-level namespace for the Windows operating system, the index name can be generated using a naming method of "hidden level information + naming information".

[0108] In one embodiment, the method for determining the target index naming rule based on the preset operating system information corresponding to the target namespace can be by querying a pre-established mapping table between the operating system and the index naming rule, thereby determining the target index naming rule corresponding to the preset operating system information corresponding to the target namespace.

[0109] In one embodiment, the index name corresponding to the target file is generated according to the target index naming rules. That is, the specific information of the target file is concatenated and formatted according to the target index naming rules to generate a unique index name corresponding to the operating system naming convention.

[0110] In one embodiment, the method of creating a reference index pointing to the target file according to the index name in the target namespace can be achieved by creating an inode or logical link in the target namespace according to the index name, and making the inode point to the actual path or file identifier of the target file in the underlying storage, thereby forming a reference relationship between the target namespace and the target file.

[0111] The advantage of this approach is that it adapts to the index naming rules of various operating systems, ensuring that referenced indexes can be correctly identified and retrieved on different systems. This reduces the overhead of index parsing and hidden state determination, balancing control accuracy and access efficiency.

[0112] In one embodiment, dynamically controlling the system-level hiding state of the target file to the visitor based on the association between the visitor's accessible namespace and the target namespace includes: parsing each reference index in the visitor's accessible namespace to obtain the target object of each reference index; if the target object is a file, adding the file to the access feedback result; if the target object is a hierarchical namespace, continuing to parse each reference index in the hierarchical namespace until all reference indexes under the accessible namespace are recursively parsed, wherein if the target namespace is not traversed during the recursive parsing process, it indicates that the system-level hiding state of the target file to the visitor is hidden.

[0113] The target object of each reference index can be a storage path identifier pointing to a specific file or a path pointer pointing to other level namespaces.

[0114] In one embodiment, the method for resolving each reference index in the visitor's accessible namespace to obtain the target object of each reference index can be by reading the path identifier or pointer information stored in the reference index, matching the file system's metadata index table, and resolving the specific object type (file or hierarchical namespace) and associated address corresponding to the reference index.

[0115] The access feedback result can be a list of files returned to the visitor, which may include the naming information, storage path and basic attributes of all files that the visitor can access.

[0116] The target object is a file, which indicates that the reference index is directly associated with a specific accessible file, so the file can be added to the access feedback result.

[0117] The target object is the hierarchical namespace, which indicates that the reference index points to a lower-level namespace. Further parsing is required to obtain the accessible files at that level. Therefore, it is necessary to continue parsing each reference index in the hierarchical namespace until all reference indexes under the accessible namespace are recursively parsed. That is, all reference indexes in the accessible namespace and all its associated lower-level namespaces are traversed until there are no unresolved index objects.

[0118] Specifically, if the target namespace is not traversed during the recursive parsing process, it indicates that the target file is hidden from the system level of the visitor. That is, the visitor's permission scope cannot cover the target namespace where the target file is located, the access feedback result will not contain the target file, and the visitor cannot perceive the existence of the target file at the system level.

[0119] The advantages of this approach are that it only parses index links within the permission scope, avoiding a full traversal of the namespace, reducing system computational overhead, balancing control accuracy and access efficiency, and standardizing the recursive parsing logic. This allows for cross-system adaptation across Linux, macOS, and Windows, ensuring consistent rules for determining hidden states across different systems.

[0120] The advantage of this approach is that it constructs a hierarchical access structure with downward compatibility of permissions. This achieves precise binding between files of different security levels and namespace levels, allowing users with higher-level access permissions to access all lower levels progressively without needing to repeatedly configure permissions. This meets the needs of differentiated management and simplifies configuration logic.

[0121] Figure 3 This is a flowchart illustrating another file hiding management method for a network attached storage device provided in an embodiment of this application. For example... Figure 3 As shown, the specific steps include the following:

[0122] S301, upon detecting a file editing event, read the naming information and file metadata of the target file corresponding to the file editing event.

[0123] S302, if the naming information does not include preset characters, the hiding level information of the target file corresponding to each of the preset operating system information is determined to be the lowest level set, wherein the lowest level indicates that the target file is an ordinary visible file that does not need to be hidden.

[0124] The preset character can be a special character or combination of characters used to identify the hidden attribute of a file. It is understood that the underlying operating system of a network attached storage device is generally Linux. In Linux, if a file name begins with ".", it indicates that the file's logical level of hiding is hidden. Therefore, the preset character in this scheme can specifically refer to ".".

[0125] S303, if the naming information includes preset characters, determine the hiding level information of the target file corresponding to each preset operating system information according to each preset operating system information and the file metadata.

[0126] In one embodiment, the method of determining the hiding level information of the target file corresponding to each preset operating system information and file metadata can be achieved by performing rule matching calculation on file metadata based on preset hiding strategy rules.

[0127] Specifically, hiding policy rule tables for different operating systems can be pre-established in the network attached storage device. Each preset operating system corresponds to a set of hiding policy rules, which are used to define the correspondence between file metadata attributes and hiding level information. For example, in the hiding policy rules for the Windows operating system, the following rules can be set: the lowest hiding level is set to level 0; when the file type is a temporary file or a cache file, the hiding level is set to level 1; when the file editor is a system account or an administrator account, the hiding level is set to level 2.

[0128] S304, if the hiding level information is not the lowest level set, configure the logical level hiding attribute of the target file according to the preset operating system information.

[0129] In one embodiment, the preset operating system information includes Linux, macOS, and Windows systems; correspondingly, configuring the logical-level hiding attribute of the target file according to the preset operating system information includes: for the Linux and macOS systems, not performing the logical-level hiding attribute configuration operation; for the Windows system, obtaining the file system information of the network attached storage device, and configuring the logical-level hiding attribute of the target file corresponding to the Windows system according to the file system information.

[0130] Among them, the Linux system can be an open-source Unix-like operating system based on the Linux kernel; the MacOS system can be a proprietary desktop operating system; and the Windows system can be a graphical operating system developed by Microsoft.

[0131] Specifically, Linux and macOS natively support files starting with "." as hidden files, so logical-level hidden attribute configuration is not required.

[0132] The file system information of the network attached storage device can be the file system type used on the network attached storage device, which may include NTFS file system, FAT16 file system, FAT32 file system and ExFAT file system.

[0133] Accordingly, in one embodiment, the method of configuring the logical level hidden attribute of the target file and the Windows system according to the file system information can be as follows: if the file system information is an NTFS file system, the FILE_ATTRIBUTE_HIDDEN attribute of the target file is set to a hidden state; or, if the file system information is any one of a FAT16 file system, a FAT32 file system, and an ExFAT file system, the ATTR_HIDDEN attribute of the target file is set to a hidden state.

[0134] Specifically, the NTFS file system can be the journaling file system used by default in Windows NT series operating systems. Correspondingly, the FILE_ATTRIBUTE_HIDDEN attribute can be a flag in the NTFS file system used to mark files as hidden in the graphical interface.

[0135] The following is sample code for configuring the FILE_ATTRIBUTE_HIDDEN attribute of the target file:

[0136] static void ntfs_set_hidden_attr(struct ntfs_inode ni, struct ATTR_FILE_NAME de_name)

[0137] {

[0138] if (ni->mi.sbi->options->hide_dot_files) {

[0139] if (de_name->name_len>0&&

[0140] le16_to_cpu(de_name->name[0]) == '.')

[0141] ni->std_fa |= FILE_ATTRIBUTE_HIDDEN;

[0142] else

[0143] ni->std_fa&= ~FILE_ATTRIBUTE_HIDDEN;

[0144] }

[0145] }

[0146] Specifically, the FAT16 file system can be the file system used in early DOS and Windows 95; the FAT32 file system can be the enhanced file system supported by Windows 95 OSR2 and later versions; and the ExFAT file system can be the extended file allocation table file system optimized by Microsoft for flash memory devices. Correspondingly, the ATTR_HIDDEN attribute can be the attribute bit used to mark files as hidden in the FAT series file systems.

[0147] The following is sample code for configuring the ATTR_HIDDEN attribute of the target file:

[0148] static void vfat_set_hidden_attr(struct super_block sb, struct dentry dentry, struct inode inode)

[0149] {

[0150] if(MSDOS_SB(sb)->options.dotsOK) {

[0151] if (le16_to_cpu(dentry->d_name.name[0]) == '.') {

[0152] MSDOS_I(inode)->i_attrs |= ATTR_HIDDEN;

[0153] } else {

[0154] MSDOS_I(inode)->i_attrs&= ~ATTR_HIDDEN;

[0155] }

[0156] }

[0157] }

[0158] The advantage of this approach is that it accurately adapts to the characteristics of mainstream file systems supported by Windows, ensuring the effectiveness and compatibility of logical-level hidden attribute configurations.

[0159] The advantage of this solution is that it achieves unified management across operating systems without disrupting the usage habits of users on different operating systems, while avoiding permission conflicts, display anomalies, or performance overhead caused by repeated marking, making the dual-hiding mechanism more lightweight and reliable.

[0160] S305, based on the hiding level information, determine the target namespace in the preset multi-level namespace corresponding to each preset operating system information, and add the target file to the target namespace, so as to dynamically control the system-level hiding state of the target file to the visitor based on the association between the visitor's accessible namespace and the target namespace.

[0161] The advantage of this solution is that it is compatible with the native file hiding conventions of Linux systems (which use "." to indicate hidden files), reducing the user's operational costs, and also enables unified adaptation of hiding rules across multiple operating systems.

[0162] Figure 4 This is a schematic diagram of the structure of a file hiding management device for a network attached storage device provided in an embodiment of this application. Figure 4 As shown, the device includes:

[0163] The file information acquisition module 410 is used to read the naming information and file metadata of the target file corresponding to the file editing event when a file editing event is detected.

[0164] The concealment level determination module 420 is used to determine the concealment level information of the target file and the corresponding preset operating system information based on each preset operating system information, the naming information and the file metadata;

[0165] The logical hiding configuration module 430 is used to configure the logical level hiding attribute of the target file according to each of the preset operating system information when the hiding level information is not the lowest level set, wherein the lowest level indicates that the target file is an ordinary visible file that does not need to be hidden;

[0166] The system hiding configuration module 440 is used to determine the target namespace in the preset multi-level namespace corresponding to each preset operating system information according to the hiding level information, and add the target file to the target namespace. It is used to dynamically control the system-level hiding state of the target file to the visitor according to the association relationship between the visitor's accessible namespace and the target namespace.

[0167] Furthermore, the preset multi-level namespace includes multiple hierarchical namespaces set progressively according to the hiding level information, and each hierarchical namespace includes a reference index pointing to the adjacent lower-level namespace;

[0168] Accordingly, the system hidden configuration module 440 is specifically used for:

[0169] Create a reference index pointing to the target file in the target namespace.

[0170] Furthermore, the system hidden configuration module 440 is specifically used for:

[0171] The target index naming rules are determined based on the preset operating system information corresponding to the target namespace;

[0172] Generate the index name corresponding to the target file according to the target index naming rules;

[0173] In the target namespace, a reference index pointing to the target file is created according to the index name.

[0174] Furthermore, the system hidden configuration module 440 is specifically used for:

[0175] Parse the reference indexes in the visitor's accessible namespace to obtain the target object of each reference index;

[0176] If the target object is a file, the file is added to the access feedback result;

[0177] If the target object is a hierarchical namespace, continue parsing each reference index in the hierarchical namespace until all reference indexes under the accessible namespace are recursively parsed. If the target namespace is not traversed during the recursive parsing process, it indicates that the target file is hidden from the visitor at the system level.

[0178] Furthermore, the concealment level determination module 420 is specifically used for:

[0179] If the naming information does not include preset characters, the hiding level information of the target file corresponding to each of the preset operating system information is determined to be the lowest level set.

[0180] When the naming information includes preset characters, the hiding level information of the target file corresponding to each preset operating system information is determined according to each preset operating system information and the file metadata.

[0181] Furthermore, the preset operating system information includes Linux, macOS, and Windows systems;

[0182] Accordingly, the logical hiding configuration module 430 is specifically used for:

[0183] For the Linux system and the MacOS system, logical-level hidden attribute configuration operations are not performed;

[0184] For the Windows system, obtain the file system information of the network attached storage device, and configure the logical-level hidden attribute of the target file corresponding to the Windows system according to the file system information.

[0185] Furthermore, the logical hiding configuration module 430 is specifically used for:

[0186] If the file system information is an NTFS file system, set the FILE_ATTRIBUTE_HIDDEN attribute of the target file to a hidden state;

[0187] or,

[0188] If the file system information is any one of FAT16, FAT32, and ExFAT file system, the ATTR_HIDDEN attribute of the target file is set to hidden.

[0189] In this embodiment, the file information acquisition module is used to read the naming information and file metadata of the target file corresponding to the file editing event when a file editing event is detected; the hiding level determination module is used to determine the hiding level information of the target file and each of the preset operating system information according to each preset operating system information, the naming information, and the file metadata; the logical hiding configuration module is used to configure the logical level hiding attribute of the target file according to each of the preset operating system information when the hiding level information is not the lowest level set, wherein the lowest level indicates that the target file is a normally visible file that does not need to be hidden; the system hiding configuration module is used to determine the target namespace in the preset multi-level namespaces corresponding to each of the preset operating system information according to the hiding level information, and add the target file to the target namespace, and dynamically control the system-level hiding state of the target file for the visitor according to the association relationship between the visitor's accessible namespace and the target namespace. The above-mentioned file hiding management device for network attached storage devices realizes unified management and control of file hiding under multiple operating systems, realizes a dual hiding mechanism of logical level hiding and system level hiding, thereby meeting the differentiated access needs of users with different permissions and achieving fine-grained management of the file visibility range.

[0190] The file hiding management device for the network attached storage device in this application embodiment can be a device, or it can be a component, integrated circuit, or chip in a terminal. The device can be a mobile electronic device or a non-mobile electronic device. For example, mobile electronic devices can be mobile phones, tablets, laptops, PDAs, in-vehicle electronic devices, wearable devices, ultra-mobile personal computers (UMPCs), netbooks, or personal digital assistants (PDAs), etc., while non-mobile electronic devices can be servers, network attached storage (NAS), personal computers (PCs), televisions (TVs), ATMs, or self-service machines, etc. This application embodiment does not impose specific limitations.

[0191] The target file access device of the network attached storage device in this application embodiment can be a device with an operating system. The operating system can be Android, iOS, or other possible operating systems, and this application embodiment does not specifically limit it.

[0192] The file hiding management device for network attached storage devices provided in this application embodiment can implement the various processes implemented in the above embodiments. To avoid repetition, it will not be described again here.

[0193] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. For example... Figure 5 As shown, this application embodiment also provides an electronic device 500, including a processor 501, a memory 502, and a program or instructions stored in the memory 502 and executable on the processor 501. When the program or instructions are executed by the processor 501, they implement the various processes of the above-described file hiding management method embodiment for network attached storage devices and achieve the same technical effect. To avoid repetition, they will not be described again here.

[0194] It should be noted that the electronic devices in the embodiments of this application include the mobile electronic devices and non-mobile electronic devices described above.

[0195] This application also provides a readable storage medium storing a program or instructions. When the program or instructions are executed by a processor, they implement the various processes of the above-described file hiding management method embodiment for network attached storage devices and achieve the same technical effect. To avoid repetition, they will not be described again here.

[0196] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.

[0197] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.

[0198] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a computer software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0199] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.

[0200] The above description is merely a preferred embodiment and the technical principles employed in this application. This application is not limited to the specific embodiments described herein, and various obvious changes, readjustments, and substitutions that can be made by those skilled in the art will not depart from the scope of protection of this application. Therefore, although this application has been described in detail through the above embodiments, this application is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of this application, the scope of which is determined by the scope of the claims.

Claims

1. A file hiding management method of a network attached storage device, characterized by, The method includes: Upon detecting a file editing event, read the naming information and file metadata of the target file corresponding to the file editing event; Based on the preset operating system information, the naming information, and the file metadata, the hiding level information corresponding to the target file and the preset operating system information is determined respectively. When the hiding level information is not the lowest level set, the logical level hiding attribute of the target file is configured according to each of the preset operating system information, wherein the lowest level indicates that the target file is a normally visible file that does not need to be hidden; Based on the concealment level information, target namespaces are determined in the preset multi-level namespaces corresponding to each preset operating system information. The preset multi-level namespaces include multiple hierarchical namespaces progressively set according to the concealment level information, and each hierarchical namespace includes a reference index pointing to an adjacent lower-level namespace. A reference index pointing to the target file is created in the target namespace. Each reference index in the visitor's accessible namespace is parsed to obtain the target object of each reference index. If the target object is a file, the file is added to the access feedback result. If the target object is a hierarchical namespace, the reference indexes in the hierarchical namespace are parsed again until all reference indexes under the accessible namespace are recursively parsed. If the target namespace is not traversed during the recursive parsing process, it indicates that the target file is hidden from the visitor at the system level.

2. The method of claim 1, wherein Creating a reference index pointing to the target file in the target namespace includes: The target index naming rules are determined based on the preset operating system information corresponding to the target namespace; Generate the index name corresponding to the target file according to the target index naming rules; In the target namespace, a reference index pointing to the target file is created according to the index name.

3. The method of claim 1, wherein the file hiding management method of the network attached storage device is characterized by, The step of determining the hiding level information of the target file corresponding to each preset operating system information based on each preset operating system information, the naming information, and the file metadata includes: If the naming information does not include preset characters, the hiding level information of the target file corresponding to each of the preset operating system information is determined to be the lowest level set. When the naming information includes preset characters, the hiding level information of the target file corresponding to each preset operating system information is determined according to each preset operating system information and the file metadata.

4. The method of claim 3, wherein, The preset operating system information mentioned includes Linux, macOS, and Windows systems; Accordingly, configuring the logical-level hiding attribute of the target file according to the preset operating system information includes: For the Linux system and the MacOS system, logical-level hidden attribute configuration operations are not performed; For the Windows system, obtain the file system information of the network attached storage device, and configure the logical-level hidden attribute of the target file corresponding to the Windows system according to the file system information.

5. The method of claim 4, wherein, The step of configuring the logical-level hidden attribute of the target file corresponding to the Windows system according to the file system information includes: If the file system information is an NTFS file system, set the FILE_ATTRIBUTE_HIDDEN attribute of the target file to a hidden state; or, If the file system information is any one of FAT16, FAT32, or ExFAT, the ATTR_HIDDEN attribute of the target file is set to hidden.

6. A file hiding management device for a network attached storage device, characterized in that, The device includes: The file information acquisition module is used to read the naming information and file metadata of the target file corresponding to the file editing event when a file editing event is detected. The concealment level determination module is used to determine the concealment level information of the target file and the corresponding preset operating system information based on each preset operating system information, the naming information and the file metadata; The logical hiding configuration module is used to configure the logical level hiding attribute of the target file according to each of the preset operating system information when the hiding level information is not the lowest level set. The lowest level indicates that the target file is a normally visible file that does not need to be hidden. The system hiding configuration module is used to determine the target namespace in the preset multi-level namespaces corresponding to the preset operating system information according to the hiding level information. The preset multi-level namespaces include multiple hierarchical namespaces set progressively according to the hiding level information, and each hierarchical namespace includes a reference index pointing to an adjacent lower-level namespace. A reference index pointing to the target file is created in the target namespace. Each reference index in the visitor's accessible namespace is parsed to obtain the target object of each reference index. If the target object is a file, the file is added to the access feedback result. If the target object is a hierarchical namespace, each reference index in the hierarchical namespace is parsed again until all reference indices under the accessible namespace are recursively parsed. If the target namespace is not traversed during the recursive parsing process, it indicates that the target file is hidden from the visitor at the system level.

7. An electronic device, characterized in that, It includes a processor, a memory, and a program or instructions stored in the memory and executable on the processor, wherein when the program or instructions are executed by the processor, they implement the file hiding management method for a network attached storage device as described in any one of claims 1-5.

8. A readable storage medium, characterized in that, The readable storage medium stores a program or instructions, which, when executed by a processor, implement the file hiding management method for a network-attached storage device as described in any one of claims 1-5.

Citation Information

Patent Citations

  • CN121415415A

  • US7386546B1