File extension attribute management method, file storage client and device
By defining attribute setting formats between the file storage client and the object storage service node, the problem that the object storage system cannot manage file extension attributes is solved, and more complete file services and better file application compatibility is achieved.
Patent Information
- Application Number
- CN202410284846.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2023-11-27
- Filing Date
- 2024-03-12
- Publication Date
- 2025-05-27
AI Technical Summary
Existing object storage systems cannot effectively manage file extension properties, resulting in the inability to implement complete management of file extension properties.
Provide a file extension attribute management method, which receives attribute setting instructions through the file storage client, determines attribute setting requests based on the interface provided by the object storage service node, and sends a request to the object storage service node to manage file extension attributes.
It realizes file extension attribute management of file services provided by the object storage system, enhances semantic compatibility of the object storage system, can better be compatible with file applications, and provides more complete file services.
Smart Images

Figure CN120045526A_ABST
Abstract
Description
[0001] This application claims the priority of a Chinese patent application with the application number 202311607099.7 and the application title "A Method, Device and Other Equipment for Data Processing" filed with the National Intellectual Property Administration on November 27, 2023, the entire content of which is incorporated herein by reference. Technical Field
[0002] This application relates to the field of storage technology, and specifically relates to a method for managing file extended attributes, a file storage client, and a device. Background Art
[0003] File storage stores data in the form of files on file storage service nodes, and object storage stores data in the form of objects on object storage service nodes. Since object storage does not have a directory and file hierarchy, the object storage service nodes using object storage can store a large amount of data, which makes the application of object storage more and more extensive.
[0004] Currently, in order to be compatible with some application programs that can only access data through file interfaces (i.e., application programs in the file ecosystem, also known as file applications), such as desktop cloud application programs, media asset video editing application programs, etc., the object storage system (including object storage service nodes and file storage clients) provides a file service based on object storage. That is to say, file applications can access the data stored in the form of objects on the object storage service nodes through the file storage clients of the object storage system.
[0005] However, due to the significant differences between the file semantics used by file extended attributes and the semantics of object storage, the file service provided by the object storage system cannot manage file extended attributes. Summary of the Invention
[0006] This application provides a method for managing file extended attributes, a file storage client, and a device, which can manage file extended attributes for the file service provided by the object storage system, and helps the object storage system to provide a more perfect file service.
[0007] To achieve the above object, this application adopts the following technical solutions:
[0008] In a first aspect, a method for managing file extension attributes is provided, which is applied to a file storage client. The file storage client runs on a Windows operating system, and the Windows operating system also provides a local file system. The directory tree of the local file system includes a target node, and the target node is a file or a directory. The file or directory is stored in an object storage service node. The method includes: receiving an attribute setting instruction, where the attribute setting instruction indicates setting the target file extension attribute of the target node to a target state, and the target state includes a configured state or an unconfigured state; determining an attribute setting request based on the attribute setting instruction and a target interface provided by the object storage service node, where the interface provided by the object storage service node is used to indicate the format of the attribute setting request, and the attribute setting request is used to request setting the target file extension attribute of the target node to the target state; and sending the attribute setting request to the object storage service node to request the object storage service node to set the target file extension attribute of the target node to the target state.
[0009] In this solution, the file storage client runs on a Windows operating system. The directory tree of the local file system provided by the Windows operating system includes a target node, and the target node can be a file or a directory. The file or directory is stored on the object storage service node. On this basis, after receiving the attribute setting instruction, the file storage client can determine an attribute setting request based on the content indicated by the attribute setting instruction and the target interface provided by the object storage service node, which is used to request setting the target file extension attribute of the target node to the target state. Then, the file storage client sends the attribute setting request to the object storage service node to request the object storage service node to set the target file extension attribute of the target node to the target state.
[0010] When managing file extension attributes is required, the file storage client determines an attribute setting request through the attribute setting instruction and the format indicated by the target interface provided by the object storage service node, realizing the conversion of the semantics of file extension attributes (i.e., the attribute setting instruction) into the semantics of object storage (i.e., the attribute setting request). Furthermore, the attribute setting request can use the semantics of object storage to indicate the content indicated by the attribute setting instruction. In this way, the object storage service node can accurately identify the content requested by the attribute setting request, and thus manage file extension attributes based on the content requested by the attribute setting request. Therefore, through the solution of this application, the object storage system can improve the semantics of object storage, making the semantics of object storage compatible with file extension attributes, so as to provide a management service for file extension attributes on the basis of providing file services, and further realize providing a more perfect file service, making object storage better compatible with file applications.
[0011] In a possible implementation, the attribute setting request includes a message content and an operation command. The message content is used to indicate the extended attributes of the target file, and the operation command is used to indicate the target state. In this way, it helps to follow the request presentation form of the target interface.
[0012] In another possible implementation, the attribute setting request includes a message content, and the message content is used to indicate the extended attributes of the target file and the target state. In this way, it helps to improve the diversity of the ways to indicate the extended attributes of the target file and the target state.
[0013] In another possible implementation, the message content includes the value of the extended attributes of the target file, and the value of the extended attributes of the target file is the same as the value in the Windows operating system. In this way, it helps to improve the accuracy of the semantic conversion process between object storage semantics and file extended attributes semantics.
[0014] In another possible implementation, the method further includes: receiving a target instruction, where the target instruction is used to indicate performing a target operation on a target node; the target operation is related to the extended attributes of the target file; determining the permission verification result of the target operation based on the state of the extended attributes of the target file; the permission verification result includes passing the verification or failing the verification; in the case where the permission verification result is failing the verification, returning a response message based on the target instruction; the response message is used to indicate rejecting to perform the target operation on the target node. The file storage client of the object storage system provides the implementation function of the extended attributes of the file, such as implementing read-only attributes, which helps the object storage system to provide a more complete file extended attribute management service.
[0015] In another possible implementation, the method further includes: in the case where the permission verification result is passing the verification, returning a first response message based on the target instruction; the first response message is used to indicate allowing to perform the target operation on the target node.
[0016] In another possible implementation, in the case where the target node is the first file, the method further includes: obtaining the first file based on the attribute setting instruction; performing the operation indicated by the attribute setting instruction on the first file to obtain a second file; sending a first storage request to the object storage service node, where the first storage request is used to request to store the second file; the first storage request includes the second file.
[0017] In this approach, the file storage client obtains the first file indicated by the attribute setting instruction and performs the operation indicated by the attribute setting instruction on the first file, thereby implementing the target file extended attributes for the first file. For example, implementing encryption attributes, compression attributes, etc. for the first file. In addition, by sending a first storage request to the object storage service node, data to be stored (i.e., the second file) that is semantically irrelevant to the Windows file extended attributes is provided to the object storage service node, thereby enabling the object storage service node to avoid performing operations related to the semantics of the Windows file extended attributes, such as encryption operations, compression operations, etc.
[0018] In another possible implementation, when the target node is the third file, the method further includes: receiving a storage instruction for indicating storing the third file; the target file extended attributes of the third file being in a configured state; performing the operation indicated by the target file extended attributes on the third file to obtain a fourth file; sending a second storage request to the object storage service node, where the second storage request is used to request the object storage service node to store the fourth file; the storage request includes the fourth file. In this approach, the file storage client provides the implementation function of the file extended attributes, such as implementing encryption attributes, compression attributes, etc., thereby helping the object storage system to provide a more complete file extended attribute management service.
[0019] In another possible implementation, the method further includes: receiving an attribute acquisition instruction for indicating acquiring the file extended attributes of the target node; based on the attribute acquisition instruction, acquiring and returning the file extended attributes of the target node. The file storage client of the object storage system provides the query function of the file extended attributes, thereby helping the object storage system to provide a more complete file extended attribute management service.
[0020] In another possible implementation, the file storage client runs on an electronic device; based on the attribute acquisition instruction, acquiring the file extended attributes of the target node includes: based on the attribute acquisition instruction, acquiring the file extended attributes of the target node from the storage medium of the electronic device. In this way, it helps to improve the acquisition efficiency of the file extended attributes.
[0021] In another possible implementation, based on the attribute acquisition instruction, acquiring the file extended attributes of the target node includes: based on the attribute acquisition instruction, acquiring the file extended attributes of the target node from the object storage service node. In this way, it helps to improve the accuracy of the acquired file extended attributes.
[0022] In another possible implementation, the method further includes: writing the file extension attributes of the target node obtained from the object storage service node into the storage medium of the electronic device. In this way, when the file extension attributes need to be obtained subsequently, they can be obtained from the local storage medium, which helps to improve the efficiency of obtaining the file extension attributes subsequently.
[0023] In another possible implementation, the method further includes: receiving a metadata acquisition instruction for instructing to acquire the metadata of a target node; based on the metadata acquisition instruction, acquiring and returning the target metadata of the target node; the target metadata of the target node includes the file extension attributes of the target node. When acquiring the metadata of the target node, the file extension attributes of the target node are provided simultaneously, which helps to improve the integrity of the metadata of the target node.
[0024] In another possible implementation, the file storage client runs on the electronic device; based on the metadata acquisition instruction, acquiring the target metadata of the target node includes: based on the metadata acquisition instruction, acquiring the target metadata of the target node from the storage medium of the electronic device. In this way, it helps to improve the acquisition efficiency of the target metadata.
[0025] In another possible implementation, based on the metadata acquisition instruction, acquiring the target metadata of the target node includes: based on the metadata acquisition instruction, acquiring the target metadata of the target node from the object storage service node. In this way, it helps to improve the accuracy of the target metadata.
[0026] In another possible implementation, when the target node is a target directory, the method further includes: receiving a directory listing instruction for instructing to list the target directory; based on the directory listing instruction, acquiring and returning the target metadata of the target directory; the target metadata of the target directory includes the file extension attributes of at least one file / sub-directory under the target directory. In this method, when listing the directory, the file extension attributes of at least one file / sub-directory under the directory are provided simultaneously, which helps to improve the comprehensiveness of listing the directory.
[0027] In another possible implementation, the file storage client runs on the electronic device; based on the directory listing instruction, acquiring the target metadata of the target directory includes: based on the directory listing instruction, acquiring the target metadata of the target directory from the storage medium of the electronic device. In this way, it helps to improve the acquisition efficiency of the target metadata.
[0028] In another possible implementation, based on the directory listing instruction, acquiring the target metadata of the target directory includes: based on the directory listing instruction, acquiring the target metadata of the target directory from the object storage service node. In this way, it helps to improve the accuracy of the target metadata.
[0029] In a second aspect, a method for managing file extended attributes is provided, which is applied to an object storage service node. A target object is stored on the object storage service node, and the object storage service node is used to map the target object to a target node on a directory tree, where the target node is a file or a directory. The method includes: receiving an attribute setting request sent by a file storage client, where the format of the attribute setting request is determined according to a target interface provided by the object storage service node, and the attribute setting request is used to request setting the target file extended attribute of the target node to a target state, and the target state includes a configured state or an unconfigured state; parsing the attribute setting request through the target interface to obtain the content requested by the attribute setting request; and based on the content requested by the attribute setting request, the object storage service node sets the target file extended attribute of the target node to the target state.
[0030] In this solution, after receiving the attribute setting request sent by the file storage client, the object storage service node determines the content requested by the attribute setting request by parsing the attribute setting request, that is, setting the target file extended attribute of the target node to the target state, and thus based on the content requested by the attribute setting request, sets the target file extended attribute of the target node to the target state, thereby realizing the management of file extended attributes.
[0031] Since the attribute setting request is determined according to the interface provided by the object storage service node, the attribute setting request indicates the requested content through the semantics of the object storage. In this way, the object storage service node can accurately identify the content requested by the attribute setting request, thereby ensuring the realization of managing file extended attributes. Thus, through the solution of this application, the object storage system can improve the semantics of the object storage, so that the semantics of the object storage can be compatible with file extended attributes, thereby providing a management service for file extended attributes on the basis of providing a file service, and further providing a more perfect file service, enabling the object storage to better be compatible with file applications.
[0032] In a possible implementation manner, when the target state is the configured state, based on the content requested by the attribute setting request, setting the target file extended attribute of the target node to the target state includes: generating a target field of the target node based on the content requested by the attribute setting request; the target field of the target node is used to indicate that the target file extended attribute has been configured; and storing the target field of the target node based on the identifier of the target node. In this implementation manner, the object storage service node indicates that the target file extended attribute of the target node has been configured by storing the target field, that is, the state of the target file extended attribute is the configured state. In this way, it helps to improve the accuracy of the state indication of the target file extended attribute.
[0033] In another possible implementation, when the target state is the unconfigured state, based on the content requested by the attribute setting request, the target file extension attribute of the target node is set to the target state, including: deleting the target field of the target node based on the content requested by the attribute setting request; the target field of the target node is used to indicate that the target file extension attribute has been configured.
[0034] In this implementation, the object storage service node indicates that the target node has not configured the target file extension attribute by deleting the target field, that is, by not storing the target field. In this way, it helps to improve the accuracy of the status indication of the target file extension attribute.
[0035] In another possible implementation, the object storage service node stores a target string, and the target string is used to indicate the status of the file extension attribute of the target node; based on the content requested by the attribute setting request, the target file extension attribute of the target node is set to the target state, including: when the target state is the configured state, based on the content requested by the attribute setting request, setting the target bit of the target string to the first value; the target bit is used to indicate the target file extension attribute, and the first value is used to indicate the configured state; when the target state is the unconfigured state, based on the content requested by the attribute setting request, setting the target bit of the target string to the second value; the second value is used to indicate the unconfigured state. In this implementation, different file extension attributes are indicated by different bits of a string, and different states are indicated by the values. In this way, it helps to reduce the storage space occupied by the file extension attribute in the relevant fields.
[0036] In another possible implementation, the attribute setting request includes a message content and an operation command, the message content is used to indicate the target file extension attribute, and the operation command is used to indicate the target state. Alternatively, the attribute setting request includes a message content, and the message content is used to indicate the target file extension attribute and the target state.
[0037] In another possible implementation, the attribute setting request includes the value of the target file extension attribute; the object storage service node sets the target file extension attribute of the target node to the target state based on the content requested by the attribute setting request, including: determining the value of the target file extension attribute based on the attribute setting request; when the value of the target file extension attribute is the same as the target value, setting the target file extension attribute of the target node to the target state based on the content requested by the attribute setting request; the target value is the value of the target file extension attribute in the Windows operating system. In this implementation, by verifying the value of the target file extension attribute, it helps to improve the accuracy of subsequent file extension attribute management.
[0038] In another possible implementation, the method further includes: when the value of the target file extension attribute is different from the target value, returning a prompt message to the file storage client, where the prompt message is used to indicate that there is an error in the value of the target file extension attribute. In this way, it helps the file storage client to adjust the generation logic of the attribute setting request in a timely manner and avoid generating incorrect requests subsequently.
[0039] In another possible implementation, the method further includes: receiving an attribute acquisition request sent by the file storage client, where the attribute acquisition request is used to request the file extension attribute of the target node; based on the attribute acquisition request, returning the file extension attribute of the target node to the file storage client. In this way, the object storage service node provides a query service for the file extension attribute.
[0040] In another possible implementation, the method further includes: receiving a metadata acquisition request sent by the file storage client, where the metadata acquisition request is used to request the metadata of the target node; based on the metadata acquisition request, returning the target metadata of the target node to the file storage client; the target metadata of the target node includes the file extension attribute of the target node. In this way, when requesting the metadata of the target node, providing the file extension attribute of the target node at the same time helps to improve the integrity of the metadata of the target node.
[0041] In another possible implementation, when the target node is a target directory, the method further includes: receiving a directory listing request sent by the file storage client, where the directory listing request is used to request the metadata of the target directory; based on the directory listing request, returning the target metadata of the target directory to the file storage client; the target metadata of the target directory includes the file extension attributes of at least one file / subdirectory under the target directory. In this way, when requesting to list a directory, providing the file extension attributes of at least one file / subdirectory under the target directory at the same time helps to improve the comprehensiveness of the directory listing.
[0042] In another possible implementation, the method further includes: receiving a deletion request sent by the file storage client, where the deletion request is used to request the deletion of the metadata of the target node; based on the deletion request, deleting the file extension attribute of the target node. In this way, when requesting to delete the metadata of the target node, deleting the file extension attribute of the target node at the same time helps to comprehensively clear the relevant data of the target node, thereby helping to avoid useless data occupying storage space.
[0043] In a third aspect, a method for managing file extended attributes is provided for an object storage system. The object storage system includes an object storage service node and a file storage client. A target object is stored on the object storage service node, and the object storage service node is configured to map the target object to a target node on a directory tree. The file storage client runs on a Windows operating system, and the Windows operating system provides a local file system. The directory tree of the local file system includes the target node, and the target node is a file or a directory. The method includes: The file storage client receives an attribute setting instruction, which indicates setting the target file extended attribute of the target node to a target state. The target state includes a configured state or an unconfigured state. The file storage client determines an attribute setting request based on the attribute setting instruction and a target interface provided by the object storage service node. The target interface is used to indicate the format of the attribute setting request, and the attribute setting request is used to request setting the target file extended attribute of the target node to the target state. The file storage client sends the attribute setting request to the object storage service node to request the object storage service node to set the target file extended attribute of the target node to the target state. The object storage service node receives the attribute setting request sent by the file storage client. The object storage service node parses the attribute setting request through the target interface to obtain the content requested by the attribute setting request. The object storage service node sets the target file extended attribute of the target node to the target state based on the content requested by the attribute setting request.
[0044] It should be noted that in the third aspect, the file storage client can also be used to execute any possible implementation provided in the first aspect, and the object storage service node can also be used to execute any possible implementation provided in the second aspect.
[0045] In a fourth aspect, a file storage client is provided. The file storage client includes: functional modules for executing any method provided in the first aspect, and the actions performed by each functional module are executed by hardware or by hardware executing corresponding software. For example, the file storage client may include a receiving module, an attribute management module, and a sending module. The receiving module is configured to receive an attribute setting instruction, which indicates setting the target file extended attribute of the target node to a target state. The target state includes a configured state or an unconfigured state. The attribute management module is configured to determine an attribute setting request based on the attribute setting instruction and a target interface provided by the object storage service node. The target interface provided by the object storage service node is used to indicate the format of the attribute setting request, and the attribute setting request is used to request setting the target file extended attribute of the target node to the target state. The sending module is configured to send the attribute setting request to the object storage service node to request the object storage service node to set the target file extended attribute of the target node to the target state.
[0046] In a fifth aspect, a file extended attribute management device is provided. The device includes: functional modules for performing any of the methods provided in the second aspect, and the actions performed by each functional module are implemented by hardware execution or by corresponding software executed by the hardware. For example, the file extended attribute management device may include a receiving module, a parsing module, and a storage module; the receiving module is configured to receive an attribute setting request sent by a file storage client, and the format of the attribute setting request is determined according to a target interface provided by an object storage service node. The attribute setting request is used to request to set the target file extended attribute of a target node to a target state, and the target state includes a configured state or an unconfigured state; the parsing module is configured to parse the attribute setting request through the target interface to obtain the content requested by the attribute setting request; the management module is configured to set the target file extended attribute of the target node to the target state based on the content requested by the attribute setting request.
[0047] In a sixth aspect, an object storage system is provided. The object storage system includes a file storage client and an object storage service node. A target object is stored on the object storage service node, and the object storage service node is configured to map the target object to a target node on a directory tree; the file storage client runs on a Windows operating system, and the Windows operating system provides a local file system. The directory tree of the local file system includes the target node, and the target node is a file or a directory. The file storage client is configured to receive an attribute setting instruction, and the attribute setting instruction indicates to set the target file extended attribute of the target node to a target state; the target state includes a configured state or an unconfigured state; the file storage client is further configured to determine an attribute setting request based on the attribute setting instruction and the target interface provided by the object storage service node; the target interface of the object storage service node is used to indicate the format of the attribute setting request, and the attribute setting request is used to request to set the target file extended attribute of the target node to the target state; the file storage client is further configured to send the attribute setting request to the object storage service node to request the object storage service node to set the target file extended attribute of the target node to the target state; the object storage service node is configured to receive the attribute setting request sent by the file storage client of the object storage system; the object storage service node parses the attribute setting request through the target interface to obtain the content requested by the attribute setting request; the object storage service node is configured to set the target file extended attribute of the target node to the target state based on the content requested by the attribute setting request.
[0048] It should be noted that in the sixth aspect, the file storage client may also be configured to perform any of the possible implementation manners provided in the first aspect above, and the object storage service node may also be configured to perform any of the possible implementation manners provided in the second aspect above.
[0049] In a seventh aspect, a processor is provided, which is used to execute the steps of any one of the methods provided in the first aspect above.
[0050] In an eighth aspect, a processor is provided, which is used to execute the steps of any one of the methods provided in the second aspect above.
[0051] In a ninth aspect, a chip is provided, including: a processor and a power supply circuit; the power supply circuit is used to supply power to the chip, and the processor is used to execute the steps of any one of the methods provided in the first aspect above.
[0052] In a tenth aspect, a chip is provided, including: a processor and a power supply circuit; the power supply circuit is used to supply power to the chip, and the processor is used to execute the steps of any one of the methods provided in the second aspect above.
[0053] In an eleventh aspect, an electronic device is provided, including: a processor, a memory, and a computer program / instructions stored in the memory; the processor executes the computer program / instructions to enable the electronic device to implement the steps of any one of the methods provided in the first aspect above.
[0054] In a twelfth aspect, a computing device is provided, including a processor, a memory, and a computer program / instructions stored in the memory; the processor executes the computer program / instructions to enable the computing device to implement the steps of any one of the methods provided in the second aspect above.
[0055] In a thirteenth aspect, a computing device cluster is provided, including: at least one computing device, and each computing device in the at least one computing device includes a processor and a memory; each computing device includes a processor, a memory, and a computer program / instructions stored in the memory; the processor executes the computer program / instructions to enable the computing device cluster to implement the steps of any one of the methods provided in the second aspect above.
[0056] In a fourteenth aspect, a computer program product is provided, including: computer program / instructions; when the computer program / instructions are executed by a processor of an electronic device, the steps of any one of the methods provided in the first aspect above can be implemented.
[0057] In a fifteenth aspect, a computer program product is provided, including: computer program / instructions; when the computer program / instructions are executed by a processor of a computing device, the steps of any one of the methods provided in the second aspect above can be implemented.
[0058] In a sixteenth aspect, a computer-readable storage medium is provided, on which computer program / instructions are stored, and when the computer program / instructions are executed by a processor of an electronic device, the steps of any one of the methods provided in the first aspect above can be implemented.
[0059] In a seventeenth aspect, there is provided a computer-readable storage medium, on which computer programs / instructions are stored. When the computer programs / instructions are executed by a processor of a computing device, the steps of any of the methods provided in the second aspect above can be implemented.
[0060] Among them, for the technical effects brought by any of the design manners from the second aspect to the seventeenth aspect, reference can be made to the technical effects brought by different design manners in the first aspect above, which will not be elaborated herein. Description of the Drawings
[0061] Figure 1 It is a schematic diagram of a system architecture provided by an embodiment of the present application;
[0062] Figure 2 It is a schematic diagram of another system architecture provided by an embodiment of the present application;
[0063] Figure 3 It is a flowchart of a method for managing file extended attributes provided by an embodiment of the present application;
[0064] Figure 4 It is a schematic diagram of an attribute interface provided by an embodiment of the present application;
[0065] Figure 5 It is a framework diagram of setting file extended attributes provided by an embodiment of the present application;
[0066] Figure 6 It is a schematic diagram of setting file extended attributes provided by an embodiment of the present application;
[0067] Figure 7 It is a flowchart of another method for managing file extended attributes provided by an embodiment of the present application;
[0068] Figure 8 It is a flowchart of another method for managing file extended attributes provided by an embodiment of the present application;
[0069] Figure 9 It is a framework diagram of obtaining file extended attributes provided by an embodiment of the present application;
[0070] Figure 10 It is a schematic diagram of obtaining file extended attributes provided by an embodiment of the present application;
[0071] Figure 11 It is a schematic diagram of obtaining metadata of a file provided by an embodiment of the present application;
[0072] Figure 12 It is a schematic diagram of obtaining metadata of a directory provided by an embodiment of the present application;
[0073] Figure 13 A framework diagram for listing directories provided by an embodiment of the present application;
[0074] Figure 14 A flowchart of another file extended attribute management method provided by an embodiment of the present application;
[0075] Figure 15 A schematic diagram for implementing file extended attributes provided by an embodiment of the present application;
[0076] Figure 16 A flowchart of another file extended attribute management method provided by an embodiment of the present application;
[0077] Figure 17 A flowchart of another file extended attribute management method provided by an embodiment of the present application;
[0078] Figure 18 Another schematic diagram for implementing file extended attributes provided by an embodiment of the present application;
[0079] Figure 19 A schematic diagram of a file storage client provided by an embodiment of the present application;
[0080] Figure 20 A schematic diagram of a file extended attribute management device provided by an embodiment of the present application;
[0081] Figure 21 A schematic diagram of a computing device provided by an embodiment of the present application;
[0082] Figure 22 A schematic diagram of a computing device cluster provided by an embodiment of the present application;
[0083] Figure 23 A schematic diagram of the connection of a computing device cluster provided by an embodiment of the present application;
[0084] Figure 24 A schematic diagram of an electronic device provided by an embodiment of the present application. Detailed implementation manners
[0085] Next, the technical solutions in the embodiments of the present application will be described with reference to the accompanying drawings in the embodiments of the present application.
[0086] Among them, in the description of the embodiments of the present application, unless otherwise specified, " / " indicates that the objects associated before and after are in an "or" relationship, for example, A / B can represent A or B; "and / or" in the present application is only a kind of association relationship describing the associated objects, indicating that there can be three relationships, for example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. And, in the description of the embodiments of the present application, unless otherwise specified, "multiple" refers to two or more than two. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple.
[0087] In addition, in order to clearly describe the technical solutions of the embodiments of the present application, in the embodiments of the present application, the words "first", "second", etc. are used to distinguish the same items or similar items with substantially the same functions and effects. Those skilled in the art can understand that the words "first", "second", etc. do not limit the quantity and execution order, and the words "first", "second", etc. do not necessarily limit the difference.
[0088] Meanwhile, in the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a concrete manner for ease of understanding.
[0089] The following is a brief introduction to the relevant terms involved in the embodiments of the present application.
[0090] File storage service (FSS): It stores data in the form of files on file storage service nodes. File storage service nodes provide a multi-level tree directory storage method based on the file system. File storage service nodes are used to provide operations that conform to file semantics (i.e., file services), such as: read files, write files, create files, delete files, open files, close files, rename files, etc.
[0091] Object Storage Service (OBS): Data is stored in object storage nodes in the form of objects. Object storage nodes provide a flat storage method based on buckets and objects. All objects in a bucket are at the same logical level, removing the multi-level tree directory structure in file storage service nodes. Object storage nodes are used to provide operations that conform to object semantics (i.e., object services), such as: uploading objects, downloading objects, listing each object in a bucket, copying objects, moving objects, deleting objects, deleting each object in a bucket, etc.
[0092] Bucket: Can also be simply referred to as a bucket. It is a container on an object storage node for storing objects. Each bucket has its own storage class, access permission, region, and other attributes.
[0093] Object: It is the basic unit of data storage on an object storage node. An object is a collection of a file's data and its associated attribute information (which can also be called metadata). An object can include a key, metadata, and data.
[0094] Among them, the key is the name of the object, which can also be called the object name or object identifier. Each object in a bucket has a unique key. Metadata is the descriptive information of the object. Metadata includes user metadata and system metadata. User metadata is specified by the user when uploading an object and is user-defined object description information. System metadata is automatically generated by the object storage service node. Data is the data content of the object, that is, the data of the file, which can also be called user data.
[0095] File System: It is software in the operating system responsible for managing and storing file information. The file system includes a basic file system and several file subsystems, and users can disassemble and install file subsystems as needed. Among them, the target tree provided by the file system can include a root directory, subdirectories, and files under the subdirectories. Among them, the root directory or subdirectory can include files and the next-level subdirectory.
[0096] User Space and Kernel Space: The virtual memory of an electronic device can be divided into user space and kernel space. User space is used to run user applications, and kernel space is used to run the kernel of the operating system. Among them, user space and kernel space are isolated from each other. Kernel space can execute any command and call all resources of the operating system. User space can only perform simple operations and cannot directly call the resources of the operating system. It needs to call the resources of the operating system through kernel space.
[0097] Filesystem in User Space (FUSE): It is a component of the operating system and runs in user space. It should be noted that in the embodiments of this application, FUSE can be a component of the Windows operating system.
[0098] File extended attributes: They are file constants provided by the file system and are used to indicate certain properties of files or directories in the file system.
[0099] It should be noted that in the embodiments of this application, file extended attributes can refer to the file constants provided by the local file system in the Windows operating system, which will not be elaborated further hereinafter.
[0100] File storage client: It is used to interact with the object storage service node, such as sending requests to the object storage service node, receiving response information returned by the object storage service node, etc.
[0101] It should be noted that in the embodiments of this application, the file storage client of the object storage system can provide an interface for the Windows operating system, and the Windows operating system can interact with the file storage client through the interface provided by the file storage client.
[0102] Pass-through: It means that during the data transmission process, the data packet is transmitted from the source address to the destination address without any processing of the data content. That is to say, the service content in the data packet will not be changed, and its original format and instructions will be maintained to ensure the integrity and accuracy of data transmission.
[0103] It should be noted that in the embodiments of this application, pass-through can refer to the file storage client of the object storage system transmitting file extended attributes to the operating system without performing related operations to implement file extended attributes.
[0104] Hereinafter, an exemplary introduction to the application scenarios of the embodiments of this application will be given.
[0105] With the development of storage technology, in order to be able to store unstructured data such as movies, office documents, images, etc. more conveniently, object storage has been proposed in related technologies. Object storage uses a flat address space to store data. In this address space, there is no layering of directories and files. Therefore, an object storage service node can store a large amount of data.
[0106] To be compatible with file applications, an object storage system (including an object storage service node and a file storage client) provides a file service based on object storage, that is, a file service is built on top of object storage. However, since the file semantics used for file extended attributes are quite different from the semantics of object storage, the file service provided by the object storage system cannot manage file extended attributes.
[0107] In view of this, an embodiment of this application provides a method for managing file extended attributes, which is applied to a file storage client. After receiving a management instruction for file extended attributes (such as: an attribute setting instruction), the file storage client can determine an attribute setting request based on the content indicated by the attribute setting instruction and a target interface provided by the object storage service node, for requesting the management content indicated by the attribute setting instruction, such as: requesting to set the target file extended attribute of the target node to the target state. Then, the file storage client sends the attribute setting request to the object storage service node to request the object storage service node to set the target file extended attribute of the target node to the target state.
[0108] Since the file storage client determines the attribute setting request through the format indicated by the attribute setting instruction and the target interface provided by the object storage service node, it realizes the conversion of the semantics of file extended attributes (i.e., the attribute setting instruction) into the semantics of object storage (i.e., the attribute setting request). Furthermore, the attribute setting request can use the semantics of object storage to indicate the content indicated by the attribute setting instruction. In this way, the object storage service node can accurately identify the content requested by the attribute setting request, and thus manage the file extended attributes based on the content requested by the attribute setting request. Therefore, through the solution of this application, the object storage system can improve the semantics of object storage, making the semantics of object storage compatible with the semantics of file extended attributes, so as to provide a management service for file extended attributes on the basis of providing a file service, and further realize the provision of a more complete file service, enabling object storage to better be compatible with file applications.
[0109] Hereinafter, an exemplary introduction to the system architecture of an embodiment of this application will be given.
[0110] The method for managing file extended attributes provided by an embodiment of this application is applicable to an object storage system. The object storage system includes an object storage service node (Server) and a file storage client (Client), and the file storage client and the object storage service node can communicate. Among them, the object storage system can provide a file service and an object service.
[0111] In an embodiment of this application, the object storage service node may include at least one computing device.
[0112] It should be noted that in the embodiments of the present application, at least one may be one, or may also be multiple, where multiple means two or more than two, which will not be elaborated hereinafter.
[0113] Optionally, the computing device may be a network device or a terminal device. The network device may include a server, etc. Among them, the server may be a physical server, or may be two or more physical servers sharing different responsibilities, and cooperate with each other to implement various functions of the server. Exemplarily, the server may be a blade server, a high-density server, a rack server, or a tower server, etc. The terminal device may include an ultra-mobile personal computer (UMPC), a notebook computer, a netbook, a desktop computer, an all-in-one computer, etc.
[0114] It should be noted that the above is only an exemplary illustration, and the embodiments of the present application do not limit the specific device form of the computing device.
[0115] In the embodiments of the present application, the object storage service node may further include a storage device, and the storage device may include one or more storage buckets, and one or more storage buckets are used to store objects.
[0116] Exemplarily, the storage device may include a hard disk drive (HDD), a solid state disk / drive (SSD), etc. It should be noted that the embodiments of the present application do not limit the form of the storage device, and the above is only an exemplary illustration. In addition, the number of storage devices in the embodiments of the present application is not limited either.
[0117] In the embodiments of the present application, the storage device may be set on the computing device, or may be set independently of the computing device. When the storage device is set independently of the computing device, the storage device and the computing device can communicate.
[0118] In the embodiments of the present application, the object storage service node stores data through the storage bucket, that is to say, the object storage service node stores the data in the storage bucket in the form of an object.
[0119] To facilitate users' management of data in a bucket, the object storage service node also provides a way to simulate a folder. By adding " / " to the object name, the object is presented in the form of a folder on the OBS management console. Exemplarily, if the object name of object 0 is abc.jpg, to simulate object 0 as a file under a folder, the object identifier of object 0 can be modified to test / abc.jpg. Here, "test" is the simulated folder. When a user lists the objects in a bucket through the object interface, if the object identifiers obtained are separated by " / ", and there is content after the last " / ", it indicates a file, that is, the object indicated by the object identifier is a file. If there is no content after the last " / ", it indicates a folder path, that is, the object indicated by the object identifier is a simulated folder. Exemplarily, the object identifier of object 1 is test / , so object 1 represents a folder path.
[0120] It should be noted that when an object is simulated as a folder, the object identifier includes the folder path and the object name. In addition, when an object is not simulated as a folder, the object identifier can be the object name.
[0121] In the embodiments of this application, the object storage service node can map the objects in a bucket to the nodes on a directory tree through a hierarchical namespace. Among them, the nodes can be files or directories. An object including user data can be mapped to a file, and a simulated folder (i.e., an object without user data) can be mapped to a directory. On this basis, after the user sets the file service feature to be enabled for the object storage service node, the object storage service node can provide file services.
[0122] In the embodiments of this application, the file storage client can be installed on the user's electronic device. The electronic device can communicate with the object storage service node through the file storage client. The user can rent cloud storage services from a cloud service provider through the file storage client, such as renting a bucket. After that, the user can store data in the bucket through the file storage client.
[0123] On this basis, the electronic device can communicate with the object storage service node through the file storage client, so as to realize using the object storage system to provide file services, such as accessing files, managing file extended attributes, etc.
[0124] It should be noted that since the object storage system can provide file services through the file storage client, this file storage client can also be called a file system client (SFC).
[0125] Optionally, the electronic device may be a terminal device or a network device. The terminal device may include a mobile phone, a tablet computer, a handheld computer, a PC, a cellular phone, a personal digital assistant (PDA), a wearable device (such as a smart watch, a smart bracelet, etc.), a smart home device (such as a television, etc.), a car computer (such as an in-vehicle computer, etc.), a smart screen, a game console, headphones, an AI speaker, an augmented reality (AR) / virtual reality (VR) device, an ultra-mobile personal computer (UMPC), a notebook computer, a netbook, a desktop computer, or an all-in-one computer, etc. The network device may include a server, etc. Among them, the server may be a physical server, or may be two or more physical servers sharing different responsibilities and cooperating with each other to implement various functions of the server. Exemplarily, the server may be a blade server, a high-density server, a rack server, or a tower server, etc.
[0126] It should be noted that the above is only an exemplary description, and the embodiments of the present application do not limit the specific device form of the electronic device.
[0127] As Figure 1 shown, it is a schematic diagram of a system architecture provided by an embodiment of the present application.
[0128] Refer to Figure 1 , the system architecture may include an object storage service node, a file storage client, and an electronic device. Among them, the file storage client may be installed on the electronic device.
[0129] The cloud service provider provides cloud services (such as object services, file services, file extended attribute management services, etc.) for users through the object storage service node. The cloud service tenant (i.e., the user) rents the cloud services provided by the cloud service provider through the file storage client on the electronic device.
[0130] Exemplarily, the storage device of the object storage service node may include storage bucket 1,......, storage bucket N, where N is a positive integer greater than 1. After the user logs in to the file storage client through the electronic device, the user can rent a storage bucket from the cloud service provider (such as renting storage bucket 1). After renting storage bucket 1, the user can send the data to be stored (such as data 0 - data 4) to the object storage service node through the file storage client. After the object storage service node receives data 0 - data 4, it stores data 0 - data 4 in storage bucket 1 in the form of objects (i.e., object 0 - object 4).
[0131] It should be noted that the embodiments of the present application do not limit the number of computing devices included in the object storage service node, the number of storage devices, and the number of storage buckets included in the storage device, Figure 1 which is only for exemplary illustration.
[0132] As Figure 2 shown, it is a schematic diagram of another system architecture provided by the embodiments of the present application.
[0133] Referring to Figure 2 , a window operating system and a file storage client are installed on the electronic device, and the file storage client runs on the window operating system. The window operating system can call the interface provided by the file storage client to interact with the file storage client.
[0134] It should be noted that the embodiments of the present application do not limit the case of "window", for example, "window" can also be represented by "Window", which will not be elaborated hereinafter.
[0135] Since the file storage client is installed on the electronic device running the Windows operating system, the file storage client can also be referred to as the Windows file storage client (client).
[0136] In the embodiments of the present application, the windows operating system also provides a local file system. The local file system is used to provide a data storage mechanism based on files and directories. Among them, the target tree provided by the local file system may include a root directory, subdirectories, and files under the subdirectories. The root directory or subdirectories may include files and the next-level subdirectories.
[0137] Exemplarily, the directory tree of the local file system may include multiple nodes, and each node in the multiple nodes may be a file or a directory, and the file or directory is stored in the storage bucket of the object storage service node.
[0138] In the embodiments of the present application, the file storage client can interact with the object storage service node through the interface provided by the object storage service node. On this basis, the file storage client can transmit storage data irrelevant to the Windows semantics to the object storage service node.
[0139] It should be noted that in the embodiments of the present application, when the file storage client performs an operation, it can be considered that the operation is performed during the process of the electronic device running the file storage client, or the electronic device performs an operation through the file storage client, which will not be elaborated hereinafter.
[0140] Exemplarily, the interface provided by the object storage service node may be a representational state transfer (REST) application programming interface (API).
[0141] In the embodiments of the present application, the Windows operating system includes a FUSE module, and the FUSE module can be used to interact with the file storage client. That is to say, the Windows operating system can interact with the file storage client through the FUSE module. On this basis, the file storage client can provide data conforming to the Windows semantics for the Windows operating system.
[0142] It should be noted that in the embodiments of the present application, when the FUSE module performs an operation, it can be considered that the operation is performed during the process of the electronic device running the FUSE module, or the electronic device performs an operation through the FUSE module, which will not be elaborated hereinafter.
[0143] In addition, since the file storage client can interact with Windows through the FUSE module, it can be considered that the file storage client is a FUSE-based file storage client.
[0144] In the embodiments of the present application, the file storage client can also be used to manage file extended attributes, such as configuring file extended attributes for nodes on the directory tree, canceling the configured file extended attributes of nodes on the directory, etc.
[0145] In the embodiments of the present application, the file storage client can also be used to implement file extended attributes. For example, when a node is configured with a read-only attribute, write operations performed on the node are intercepted, etc.
[0146] Exemplarily, when the encryption attribute and compression attribute of a file are in a configured state, the file storage client can perform operations related to Windows semantics such as encrypting and compressing the file, and obtain an encrypted file and a compressed file, so as to provide storage data irrelevant to the Windows semantics for the object storage service node. Then, the file storage client transmits the encrypted file and the compressed file to the object storage service node. After receiving the encrypted file and the compressed file, the object storage service node can directly store the encrypted file and the compressed file without caring about the Windows semantics of the storage data.
[0147] Exemplarily, after the file storage client obtains the encrypted file and the compressed file from the object storage service node, it can decrypt the encrypted file, decompress the compressed file, and obtain the decrypted file and the decompressed file. After that, the file storage client can transfer the decrypted file and the decompressed file to the operating system, which is then displayed to the user by the operating system or transferred to an application for use.
[0148] Based on the above, the file storage client can manage and logically implement the specific meaning represented by the file extension attributes.
[0149] In an embodiment of the present application, the file storage client may include an attribute management module, and the attribute management module may be used to manage file extension attributes.
[0150] Exemplarily, the file storage client can map the management instruction of the file extension attribute (e.g., the attribute setting instruction) to an attribute setting request through the attribute management module, and send the attribute setting request to the object storage service node to request the management of the file extension attribute.
[0151] In an embodiment of the present application, the file storage client may include an attribute implementation module, and the attribute implementation module may be used to implement file extension attributes. Exemplarily, the file storage client can implement the read-only attribute, encryption attribute, compression attribute, etc. of the file through the attribute implementation module.
[0152] It should be noted that the functions implemented by the attribute management module and the functions implemented by the attribute implementation module may also be implemented by one module, and the embodiments of the present application do not limit this.
[0153] In an embodiment of the present application, the object storage service node is configured with a parsing module, and the parsing module may be used to implement the parsing of the attribute setting request to determine the management method of the file extension attribute based on the content requested by the attribute setting request, such as setting the target file extension attribute of the target node to the target state, etc.
[0154] It should be noted that in an embodiment of the present application, a certain operation executed by the parsing module can be considered as an operation executed during the operation of the parsing module of the object storage service node, or the object storage service node executes a certain operation through the parsing module, which will not be elaborated hereinafter.
[0155] Exemplarily, the file extension attributes managed by the file storage client may include: read-only attribute, hidden attribute, system attribute, directory attribute, archive attribute, install device driver attribute, normal attribute, temporary attribute, sparse file attribute, reparse point attribute, compression attribute, offline attribute, no content indexing attribute, encryption attribute, integrity stream attribute, virtual reality attribute, no erased data attribute, custom extension attribute, fixed attribute, unfixed attribute, re-call open attribute, call data access attribute, etc.
[0156] See Figure 2 , the object storage service node provides a service interface and a management interface. The service interface is used to access the objects stored on the object storage service node, and the management interface is used to manage the file extension attributes of the objects stored on the object storage service node.
[0157] Based on this, the file storage client can perform read operations, write operations, etc. on the objects stored on the object storage service node through the service interface. In addition, the file extension attributes of the objects stored on the object storage service node can also be managed through the management interface.
[0158] In the embodiments of the present application, the object storage service node also stores the metadata of the object. Among them, the object storage service node can parse the attribute setting request through the parsing module to determine the management method of the file extension attribute, such as: generating a target field, modifying the value of the target string, etc., for indicating the status of the file extension attribute, etc. Among them, the target field and the target string can be stored in the metadata of the object to facilitate the permanent storage of the file extension attribute.
[0159] It should be noted that the system architecture and application scenarios described in the embodiments of the present application are for more clearly explaining the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided by the embodiments of the present application. Those of ordinary skill in the art know that with the evolution of the system architecture and the emergence of new application scenarios, the technical solutions provided by the embodiments of the present application are equally applicable to similar technical problems.
[0160] For the sake of easy understanding, the file extension attribute management method provided by the embodiments of the present application will be exemplarily introduced below in combination with the above system architecture and the accompanying drawings.
[0161] The embodiments of the present application will exemplarily introduce the solution of the file extension attribute management method in three parts.
[0162] The first part, in combination with Figures 3 to 7 , introduce the solution for setting the file extension attributes of files or directories, such as: configuring at least one file extension attribute for the target node, canceling at least one file extension attribute already configured for the target node, etc.
[0163] The second part, in combination with Figures 8 to 13 , introduce the solution for querying the file extension attributes of files or directories, such as: querying at least one file extension attribute of the target node.
[0164] The third part, in combination with Figures 14 to 18 , introduce the solution for implementing the file extension attributes of files or directories, such as: implementing at least one file extension attribute of the target node.
[0165] The following, in conjunction with Figures 3 to 7 , introduce the first part of the embodiments of the present application.
[0166] Figure 3 is a flowchart of a method for managing file extended attributes shown according to an exemplary embodiment. Exemplarily, the method for managing file extended attributes may include the following steps 301-step 303.
[0167] It should be noted that in the embodiments of the present application, "step" can be abbreviated as "S", and will not be elaborated hereinafter.
[0168] In the embodiments of the present application, the object storage service node stores multiple objects. Exemplarily, the multiple objects may include a target object, and the target object may be any one of the multiple objects. Among them, one object can be used to indicate a file or a folder. When one object is used to indicate a file, the one object may include user data, metadata, and an object identifier (ID). When one object is used to indicate a folder, the one object may include metadata and an object identifier.
[0169] The object storage service node maps the multiple objects stored in the bucket to multiple nodes on the directory tree. Exemplarily, the multiple nodes include a target node, and the target node is a node mapped based on the target object.
[0170] It should be noted that when a node is a file, the node may also be referred to as a file node. When a node is a directory, the node may also be referred to as a directory node.
[0171] It can be understood that an object used to indicate a file will be mapped to a file node on the directory tree, and an object used to indicate a folder will be mapped to a directory node on the directory tree.
[0172] In the embodiments of the present application, the object storage service node stores the mapping relationship between multiple objects and multiple nodes. Among them, there is a one-to-one correspondence between the multiple objects and the multiple nodes, that is to say, there is a mapping relationship between one object and the node mapped by the one object. Exemplarily, there is a mapping relationship between the target node and the target object.
[0173] The following takes the target element stored on the object storage service node as an example to illustrate the relationship between the node and the object.
[0174] Exemplarily, the object storage service node stores the target element in the storage bucket in the form of an object. The target element can be user data or a simulated folder. When the user accesses the target element based on the object file storage client, the target data can be referred to as the target object. When the user accesses the target element based on the file system file storage client, the target data is referred to as the target node. Among them, the target node and the target object with a mapping relationship point to the same element (i.e., the target element).
[0175] Hereinafter, taking the target object and the target node mapped by the target object as an example, an exemplary description is given of the file extended attribute management method provided by the embodiments of the present application. Among them, the identifier of the target object and the identifier of the target node are both target identifiers.
[0176] Exemplarily, the representation form of the target identifier can be a Uniform Resource Identifier (URI), a string, etc., and the embodiments of the present application do not limit this.
[0177] In the embodiments of the present application, a Window operating system and a file storage client are installed on the electronic device. The Window operating system can interact with the file storage client through the FUSE module, and the file storage client can interact with the object storage service node through the interface provided by the object storage service node.
[0178] Step 301: The file storage client receives an attribute setting instruction, and the attribute setting instruction indicates to set the target file extended attribute of the target node to the target state. Among them, the target state includes a configured state or an unconfigured state.
[0179] It can be understood that setting the target file extended attribute to the configured state can be considered as configuring the target file extended attribute for the target node, and setting the target file extended attribute to the unconfigured state can be considered as canceling the target file extended attribute configured for the target node.
[0180] In the embodiments of the present application, the attribute setting instruction indicates the target node. Exemplarily, the attribute setting instruction can include the identifier of the target node, the path of the target node, etc., so as to implement indicating the target node. In this way, it helps to avoid the file storage client setting the file extended attribute of a non-target node, thereby helping to ensure the accuracy of the subsequent operations performed by the file storage client.
[0181] In the embodiments of the present application, the attribute setting instruction indicates the target file extended attribute. Exemplarily, the attribute setting instruction may include the identifier of the target file extended attribute, the name of the target file extended attribute, etc., so as to implement indicating the target file extended attribute. In this way, it helps to avoid the file storage client from managing non-target file extended attributes, thereby helping to ensure the accuracy of the operations subsequently performed by the file storage client.
[0182] Optionally, the target file extended attribute may include at least one of: read-only attribute, hidden attribute, system attribute, directory attribute, archive attribute, install device driver attribute, normal attribute, temporary attribute, sparse file extended attribute, reparse point attribute, compression attribute, offline attribute, no content indexing attribute, encryption attribute, integrity stream attribute, virtual reality attribute, no erasure data attribute, custom extended attribute, fixed attribute, unfixed attribute, recall open attribute, call data access attribute.
[0183] It should be noted that the embodiments of the present application do not limit the type of the target file extended attribute, and the above is only an exemplary illustration.
[0184] Optionally, the target file extended attribute refers to a type of attribute, that is, each file extended attribute indicated by the attribute setting instruction. Since the attribute setting instruction can simultaneously indicate setting one or more file extended attributes, therefore, the target file extended attribute can also refer to one or more file extended attributes, that is to say, one or more file extended attributes can all be referred to as the target file extended attribute.
[0185] Exemplarily, the attribute setting instruction may indicate setting file extended attributes such as read-only attribute, hidden attribute, encryption attribute, compression attribute, etc. Based on this, the target file extended attribute may include read-only attribute, hidden attribute, encryption attribute, compression attribute, etc. That is to say, read-only attribute, hidden attribute, encryption attribute, compression attribute, etc. can all be referred to as the target file extended attribute.
[0186] In this embodiment, by setting the attribute setting instruction, it can indicate multiple file extended attributes, that is, taking multiple file extended attributes as the target file extended attributes. In this way, the state of setting multiple file extended attributes can be achieved, thereby helping to improve the setting efficiency of the file extended attributes, and further helping to improve the user experience.
[0187] In the embodiments of the present application, the attribute setting instruction indicates the target state. In this way, it helps to avoid the file storage client from setting non-target states, thereby helping to ensure the accuracy of the operations subsequently performed by the file storage client.
[0188] In the embodiments of the present application, when the target file extension attributes include multiple file extension attributes, the target status of each file extension attribute among the multiple file extension attributes may be different, or may also be the same. That is to say, the target statuses of different target file extension attributes may be the same, or may also be different. In this way, even file extension attributes with different target statuses can be set through the same instruction, which helps to improve the setting efficiency of file extension attributes.
[0189] Exemplarily, the attribute setting instruction indicates target file extension attributes such as read-only attribute, hidden attribute, encryption attribute, compression attribute, etc. On this basis, the attribute setting instruction also indicates that the read-only attribute is set to the configured state, the hidden attribute is set to the unconfigured state, the encryption attribute is set to the configured state, and the compression attribute is set to the configured state. Thus, the target status of the read-only attribute is the configured state, the target status of the hidden attribute is the unconfigured state, the target status of the encryption attribute is the configured state, and the target status of the compression attribute is the configured state.
[0190] In the embodiments of the present application, the attribute setting instruction includes multiple situations. Hereinafter, exemplary introductions are made through Situation 1 to Situation 2.
[0191] Situation 1: The attribute setting instruction is an instruction triggered by the user.
[0192] In one example, the user can directly instruct to set the target file extension attribute of the target node to the target status.
[0193] Exemplarily, as shown in (a) of Figure 4 , the electronic device displays the attribute interface of the target node, and this attribute interface indicates the read-only attribute and the hidden attribute. The box on the left side of the read-only attribute is not selected, so the current status of the read-only attribute is the unconfigured state. The box on the left side of the hidden attribute is selected, so the current status of the hidden attribute is the configured state.
[0194] Example 1, as shown in (b) of Figure 4 , when the user selects the box on the left side of the read-only attribute through the electronic device, the electronic device responds to the user's trigger operation (i.e., selecting the box) and sends an attribute setting instruction to the file storage client. This attribute setting instruction indicates that the read-only attribute (i.e., the target file extension attribute) is set to the configured state (i.e., the target status).
[0195] Example 2, as shown in (c) of Figure 4 , when the user deselects the box on the left side of the hidden attribute through the electronic device, the electronic device responds to the user's trigger operation (i.e., deselecting the box) and sends an attribute setting instruction to the file storage client. This attribute setting instruction indicates that the hidden attribute (i.e., the target file extension attribute) is set to the unconfigured state (i.e., the target status).
[0196] Exemplarily, as Figure 4 shown in (d) of [], when the user selects the solution on the left side of the read-only attribute and deselects the solution on the left side of the hidden attribute through the electronic device, the electronic device responds to the user's trigger operation and sends a file storage client attribute setting instruction to the file storage client. The attribute setting instruction instructs to set the read-only attribute to the configured state and the hidden attribute to the unconfigured state.
[0197] In another example, the user indicates to perform a first operation on the target node, so as to indicate to set the target file extension attribute of the target node to the target state. Among them, the first operation is related to the target file extension attribute.
[0198] Example 3: The user instructs the electronic device to encrypt the target node. The electronic device responds to the user's trigger operation and sends an encryption instruction (i.e., an attribute setting instruction) to the file storage client. After receiving the encryption instruction, the file storage client performs an encryption operation on the target node and sets the encryption attribute (i.e., the target file extension attribute) of the target node to the configured state (i.e., the target state). That is to say, on the basis of instructing to encrypt the target node, the encryption instruction also instructs to set the encryption attribute of the target node to the configured state.
[0199] Example 4: The user instructs the electronic device to compress the target node. The electronic device responds to the user's trigger operation and sends a compression instruction (i.e., an attribute setting instruction) to the file storage client. After receiving the compression instruction, the file storage client performs a compression operation on the target node and sets the compression attribute (i.e., the target file extension attribute) of the target node to the configured state (i.e., the target state). That is to say, on the basis of instructing to compress the target node, the compression instruction also instructs to set the compression attribute of the target node to the configured state.
[0200] In the embodiment of the present application, after the user triggers an attribute setting instruction through the electronic device, the Windows operating system running on the electronic device sends the attribute setting instruction to the file storage client, so as to instruct the file storage client to set the target file extension attribute of the target node to the target state.
[0201] It should be noted that in the embodiment of the present application, when the operating system performs a certain operation, it can be considered that the electronic device performs a certain operation during the process of running the operating system, or the electronic device performs a certain operation through the operating system, which will not be elaborated hereinafter.
[0202] In this embodiment, by setting that the attribute setting instruction can be an instruction triggered by the user, in this way, the user can set the file extension attribute for different nodes, which helps to improve the user experience.
[0203] Case 2: The attribute setting instruction is an instruction triggered by the target application.
[0204] Exemplarily, during the process of the electronic device running the target application (hereinafter simply referred to as the target application), if it is necessary to set the target file extension attribute of the target node to the target state, the target application can send a setting instruction to the operating system to indicate setting the target file extension attribute of the target node to the target state. In response to the received setting instruction, the operating system sends an attribute setting instruction to the file storage client to instruct the file storage client to set the target file extension attribute of the target node to the target state.
[0205] It should be noted that in the embodiments of the present application, when the target application performs a certain operation, it can be considered that the electronic device performs a certain operation during the process of running the target application, or the electronic device performs a certain operation through the target application, which will not be elaborated hereinafter.
[0206] Exemplarily, the target application can be a file application such as a desktop cloud application or a media asset video application. It should be noted that the embodiments of the present application do not limit the type of the target application, and the above is only an exemplary illustration.
[0207] It should be noted that for other descriptions of Case 2, reference can be made to the descriptions of Case 1, which will not be elaborated here.
[0208] In this embodiment, by setting that the attribute setting instruction can be an instruction triggered by the target application, the permission to set the file extension attribute for the target application can be realized, so that the object storage can better be compatible with the file application and provide more comprehensive file services for the file application.
[0209] Hereinafter, an exemplary introduction will be made to the manner in which the Windows operating system sends an attribute setting instruction to the file storage client.
[0210] In the embodiments of the present application, the Windows operating system can send an attribute setting instruction to the file storage client through the FUSE module.
[0211] Exemplarily, after the user triggers the attribute setting instruction or the target application sends a setting instruction to Windows, the Windows operating system sends an attribute setting instruction to the FUSE module, so that the FUSE module sends an attribute setting instruction to the file storage client.
[0212] In the embodiments of the present application, the file storage client is configured with a first interface for instructing to set the file extension attribute. On this basis, the Windows operating system can send an attribute setting instruction to the file storage client through the first interface.
[0213] Exemplarily, such as Figure 5As shown in the figure, after the FUSE module receives the attribute setting instruction sent by the operating system, it sends the attribute setting instruction to the file storage client by calling the first interface.
[0214] Exemplarily, the first interface can be win_set_file_attr. Among them, "win" is used to represent the Windows operating system, "set" is used to represent setting, and "file_attr" is used to represent file extended attributes.
[0215] It can be understood that the first interface can be regarded as an interface provided by the file storage client to the operating system, so that the operating system can interact with the file storage client through the first interface. The FUSE module can be regarded as an interface provided by the Windows operating system to the file storage client, so that the file storage client can interact with the Windows operating system through the FUSE module.
[0216] It should be noted that the embodiment of the present application does not limit the manner in which Windows sends the attribute setting instruction to the file storage client, and the above is only an exemplary illustration.
[0217] In this embodiment, by configuring the first interface for the file storage client as an interface for setting file extended attributes, this helps to improve the accuracy of setting file extended attributes, and thus helps to better provide file extended attribute management services.
[0218] Step 302: The file storage client determines an attribute setting request based on the attribute setting instruction and the target interface provided by the object storage service node. The target interface provided by the object storage service node is used to indicate the format of the attribute setting request, and the attribute setting request is used to request to set the target file extended attribute of the target node to the target state.
[0219] Exemplarily, the file storage client can receive the attribute setting instruction through the attribute management module and determine the attribute setting request through the attribute management module.
[0220] In the embodiment of the present application, the target interface provided by the object storage service node can be a REST API interface. That is to say, the attribute setting request indicating the semantics of file extended attributes (i.e., the target node, the target file extended attribute, and the target state, etc.) can be carried through the REST API interface.
[0221] In the embodiment of the present application, the attribute setting request can include message content, request address, operation command, etc. Among them, the formats of the message content, request address, and operation command adopt the formats defined by the REST API interface.
[0222] Exemplarily, the message content defined based on the REST API interface can be recorded in the Xml Body. That is, the message content of the attribute setting request can be recorded in the Xml Body. Based on this, the format of the message content of the attribute setting request adopts the format of the Xml Body.
[0223] Exemplarily, the request address defined based on the REST API interface can be implemented through the uniform resource locator (URL). Based on this, the format of the request address adopts the format of the URL.
[0224] Exemplarily, the operation commands defined based on the REST API interface can include GET, PUT, HEAD, DELETE, POST, etc.
[0225] Among them, the format of the Xml Body and the format of the URL can refer to the descriptions in the related technologies and will not be elaborated here.
[0226] In this embodiment, when the target interface provided by the object storage service node is the REST API interface, the message content of the attribute setting request adopts the format of the Xml Body, the request address adopts the format of the URL, and the operation commands can be GET, PUT, HEAD, DELETE, POST, etc., so that the attribute setting request adopts the format of the REST API interface, which helps the object storage service node accurately identify the content requested by the attribute setting request. In this way, it helps to improve the accuracy of the file extended attribute management operation executed by the object storage service node.
[0227] It should be noted that the type of the target interface provided by the object storage service node in the embodiments of the present application is not limited, and the above is only an exemplary description.
[0228] In the embodiments of the present application, the attribute setting request may include a first field. Among them, the first field is used to indicate the file extended attribute.
[0229] Exemplarily, the first field may be "winmode". "win" in "winmode" is used to indicate the Windows operating system, and "mode" is used to indicate the file extended attribute.
[0230] Exemplarily, the request address may include the first field, and the format of the first field in the request address may be "?winmode". By adding the first field indicating the file extended attribute in the request address, it is thus realized to indicate that the attribute setting request is a request related to the file extended attribute. In this way, it helps to improve the accuracy of the file extended attribute management.
[0231] Exemplarily, the message content may include a first field, and the format of the first field in the message content may be " <winmode>< / winmode> ". By adding a field indicating the file extension attribute to the message content, it helps the object storage node to accurately locate the content requested by the attribute setting request, thereby helping to improve the accuracy and efficiency of file extension attribute management.
[0232] In the embodiments of the present application, the attribute setting request realizes the request to set the target file extension attribute of the target node to the target state by indicating the target node, the target file extension attribute, and the target state. Among them, there are multiple implementation manners for the attribute setting request to indicate the target node, the target file extension attribute, and the target state. Hereinafter, exemplary descriptions will be made through Manner 1 to Manner 2.
[0233] Manner 1: The attribute setting request indicates the target file extension attribute through the message content and indicates the target state through the operation command.
[0234] Exemplarily, the message content of the attribute setting request may include a second field, and the second field is used to indicate the target file extension attribute.
[0235] Optionally, the second field may include the name of the target file extension attribute and the value of the target file extension attribute. Among them, the value of the target file extension attribute is the value of the target file extension attribute in the Windows operating system.
[0236] In this embodiment, by setting the value of the target file extension attribute to the value of the target file extension attribute in the Windows operating system, the value of the target file extension attribute in the semantics of object storage is the same as the value in the Windows operating system, which helps to improve the convenience and accuracy of the file storage client during semantic conversion, and further helps to improve the convenience and accuracy of file extension attribute management.
[0237] Exemplarily, when the target file extension attribute includes a read-only attribute, the second field may include " <fileattributereadonly> 0x00000001< / fileattributereadonly> ". "FileAttribute" in "FileAttributeReadonly" is a prefix used to indicate the file extension attribute, and "Readonly" is used to indicate the name of the file extension attribute, that is, "read-only attribute". "0x00000001" is used to indicate the value of the file extension attribute, that is, the value of the target file extension attribute. "0x" is used to indicate hexadecimal, that is, the hexadecimal value of the read-only attribute is "00000001".
[0238] Exemplarily, when the attribute setting instruction indicates 22 file extension attributes, the attribute setting request also indicates 22 file extension attributes. Based on this, the message content of the attribute setting request can be as follows:
[0239] <winmode>
[0240] <fileattributereadonly> 0x00000001< / fileattributereadonly>
[0241] <fileattributehidden> 0x00000002< / fileattributehidden>
[0242] <fileattributesystem> 0x00000004< / fileattributesystem>
[0243] <fileattributedirectory> 0x00000010< / fileattributedirectory>
[0244] <fileattributearchive> 0x00000020< / fileattributearchive>
[0245] <fileattributedevice> 0x00000040< / fileattributedevice>
[0246] <fileattributenormal> 0x00000080< / fileattributenormal>
[0247] <fileattributetemporary> 0x00000100< / fileattributetemporary>
[0248] <fileattributesparsefile> 0x00000200< / fileattributesparsefile>
[0249] <fileattributereparsepoint> 0x00000400< / fileattributereparsepoint>
[0250] <fileattributecompressed> 0x00000800< / fileattributecompressed>
[0251] <fileattributeoffline> 0x00001000< / fileattributeoffline>
[0252] <fileattributenotcontentindexed> 0x00002000< / fileattributenotcontentindexed>
[0253] <fileattributeencrypted> 0x00004000< / fileattributeencrypted>
[0254] <fileattributeintegritystream> 0x00008000< / fileattributeintegritystream>
[0255] <fileattributevirtual> 0x00010000< / fileattributevirtual>
[0256] <fileattributenoscrubdata> 0x00020000< / fileattributenoscrubdata>
[0257] <fileattributeea> 0x00040000< / fileattributeea>
[0258] <fileattributepinned> 0x00080000< / fileattributepinned>
[0259] <fileattributeunpinned> 0x00100000< / fileattributeunpinned>
[0260] <fileattributerecallonopen> 0x00200000< / fileattributerecallonopen>
[0261] <fileattributerecallondataaccess> 0x00400000< / fileattributerecallondataaccess>
[0262] < / winmode>
[0263] Since the binary value corresponding to "0x00000001" is 1, the binary value corresponding to "0x00000002" is 10, the binary value corresponding to "0x00000004" is 100, the binary value corresponding to "0x00000010" is 10000,......, the binary value corresponding to "0x00400000" is 10 22 . Based on this, the message content can also indicate the above 22 file extension attributes through a 23-bit binary string. Among them, the 1st bit of the 23-bit string indicates the read-only attribute, the 2nd bit indicates the so-and-so attribute, the 3rd bit indicates the system attribute, the 5th bit indicates the directory attribute,......, the 23rd bit indicates the call data access attribute.
[0264] It should be noted that the number of bits of the file extension attribute in the string is the same as the number of bits of the binary value of the file extension attribute. For example: the number of bits of the binary value of the read-only attribute is 1. Therefore, the 1st bit of the string indicates the read-only attribute.
[0265] In the embodiments of the present application, the attribute setting request can indicate different target states through different operation commands.
[0266] Exemplarily, the attribute setting request can indicate the configured state through PUT and indicate the unconfigured state through DELETE. Based on this, when the target state is the configured state, the operation command included in the attribute setting request is PUT, and the attribute setting request can include "PUT / filesystem / dir / file?winmode". When the target state is the unconfigured state, the operation command included in the attribute setting request is DELETE, and the attribute setting request can include "DELETE / filesystem / dir / file?winmode".
[0267] It should be noted that the embodiments of the present application do not limit how the attribute setting request indicates the target state through the operation command. The above is only an exemplary illustration.
[0268] In the embodiments of the present application, the attribute setting request can indicate the target node through the request address.
[0269] Exemplarily, the request address can be filesystem / dir / file?winmode, where "filesystem / dir / file" is used to indicate the target node.
[0270] In this implementation manner, the target file extension attribute is indicated by the message content, the target state is indicated by the operation command, and the target node is indicated by the request address. In this way, it helps to make full use of the functions of different parts supported by the target interface provided by the object storage service node, thereby simplifying the content of the attribute setting request, and further helping to improve the convenience and accuracy of file extension attribute management.
[0271] Method 2: The attribute setting request indicates the target file extension attribute and the target state through the message content.
[0272] In the embodiments of the present application, the message content includes a second field and a third field. The second field is used to indicate the target file extension attribute, and the third field is used to indicate the target state.
[0273] It should be noted that for the relevant description of the second field, reference can be made to the description in Method 1, which will not be elaborated here.
[0274] Exemplarily, when the target state is the configured state, the third field can be "put", and the format of the third field in the message content can be <type>put< / type> , where "Type" is used for the setting type of the file extension attribute, and "put" is used to indicate configuring the target file extension attribute, that is, setting the target file extension attribute to the configured state.
[0275] Exemplarily, when the target state is the unconfigured state, the second field can be "delete", and the format of the third field in the message content can be <type>delete< / type> , where "delete" is used to indicate canceling / deleting the target file extension attribute, that is, setting the target file extension attribute to the unconfigured state.
[0276] Exemplarily, the third field can be stored between " <winmode>”and”< / winmode> ". In this way, the third field can be used to indicate the setting type of the file extension attribute, thereby helping to improve the accuracy of the object storage service node in identifying the content.
[0277] It should be noted that the embodiments of the present application do not limit the specific content of the third field, and the above is only an exemplary description.
[0278] In the embodiments of the present application, when different fields of the message content are used to indicate the target file extension attributes and the target status, the request address of the attribute setting request is used to indicate the target node. Exemplarily, the attribute setting request may include "PUT / filesystem / dir / file?winmode". Among them, "filesystem / dir / file" is used to indicate the target node.
[0279] In this implementation manner, different fields of the message content are used to indicate the target file extension attributes and the target status respectively. On the one hand, the object storage service node can determine the content requested by the attribute setting request by reading the message content, which helps to improve the efficiency of processing the attribute setting request. On the other hand, it improves the diversity of the ways for the attribute setting request to indicate the target file extension attributes and the target status.
[0280] Based on the above, if the target statuses of multiple file extension attributes indicated by the attribute setting instruction are the same, that is, the target statuses of multiple file extension attributes are all in the configured state or all in the unconfigured state, the attribute setting request can indicate the target status by Method 1, that is, indicate the target statuses of multiple file extension attributes by different operation commands. Or, the attribute setting request can also indicate the target status by Method 2, that is, indicate the target statuses of multiple file extension attributes by the third field in the message content.
[0281] If the target statuses of multiple file extension attributes indicated by the attribute setting instruction are different, that is, the target statuses of some file extension attributes among multiple file extension attributes are in the configured state, and the target statuses of the other part of file extension attributes are in the unconfigured state, the attribute setting request can indicate the target status by Method 2, so as to enable the attribute setting request to indicate two different types of target statuses at the same time.
[0282] Step 303: The file storage client sends an attribute setting request to the object storage service node to request to set the target file extension attributes of the target node to the target status.
[0283] In the embodiments of the present application, after determining the attribute setting request, the file storage client sends the attribute setting request to the object storage service node. For example, the attribute setting request can be sent to the object storage service node through the attribute management module.
[0284] Exemplarily, as Figure 5 shown, the file storage client can send an attribute setting request to the object storage service node through the target interface provided by the object storage service node.
[0285] In the above embodiments, after receiving the attribute setting instruction, the file storage client can determine an attribute setting request based on the content indicated by the attribute setting instruction and the target interface provided by the object storage service node, where the attribute setting request is used to request to set the extended attribute of the target file of the target node to the target state. Then, the file storage client sends the attribute setting request to the object storage service node to request the object storage service node to set the extended attribute of the target file of the target node to the target state.
[0286] When it is necessary to manage the extended attributes of files, the file storage client determines the attribute setting request through the attribute setting instruction and the format indicated by the target interface provided by the object storage service node, so as to convert the semantics of the file extended attributes (i.e., the attribute setting instruction) into the semantics of object storage (i.e., the attribute setting request). Furthermore, the attribute setting request can use the semantics of object storage to indicate the content indicated by the attribute setting instruction. In this way, the object storage service node can accurately identify the content requested by the attribute setting request, and thus manage the extended attributes of files based on the content requested by the attribute setting request. Therefore, through the solution of this application, the object storage system can improve the semantics of object storage, so that the semantics of object storage can be compatible with file extended attributes, thereby providing a management service for file extended attributes on the basis of providing file services, and further realizing the provision of more perfect file services, so that object storage can better be compatible with file applications.
[0287] Figure 6 It is a schematic diagram for setting extended attributes of files provided by an embodiment of this application. Hereinafter, an exemplary introduction to the process of setting extended attributes of files will be given in combination with Figure 6 an exemplary introduction to the setting process of extended attributes of files will be given.
[0288] Exemplarily, after the user triggers the attribute setting instruction or the target application sends a setting instruction to the Windows operating system, the Windows operating system calls the first interface of the file storage client through the FUSE module and sends the attribute setting instruction to the file storage client to instruct the file storage client to manage the extended attributes of the files of the target node. For example, the extended attribute of the target file of the target node is set to the target state. Exemplarily, the first interface can be "sfc_win_set_attributes", and the attribute setting instruction can be "fuse_operations::win_set_attributes".
[0289] After receiving an attribute setting instruction through the first interface, the file storage client can generate an attribute setting request based on the attribute setting instruction and the target interface provided by the object storage service node. Then, the file storage client sends the attribute setting request to the Object Storage client (OSC) of the object storage service node to request the management of the file extension attributes of the target node. For example, the target file extension attribute of the target node is set to the target state.
[0290] It should be noted that in the embodiments of the present application, when the OSC performs a certain operation, it can be considered that the object storage service node performs a certain operation during the operation of the OCS, or the object storage service node performs a certain operation through the OSC, which will not be elaborated hereinafter.
[0291] Based on the above embodiments, the file storage client can map the semantics of the file extension attributes to the semantics of object storage, thereby generating requests (such as attribute setting requests, etc.) that can be recognized by the object storage service node. Furthermore, the semantics of the file extension attributes are isolated on the file storage client side, making the semantics of the file extension attributes independent of the object storage service node. That is, the object storage service node does not need to recognize the semantics of the file extension attributes.
[0292] In addition, when the file storage client generates requests that can be recognized by the object storage service node, it makes full use of the scalability of the target interface provided by the object storage service node. For example, the target file extension attributes to be managed are indicated through the message content, and the management method of the file extension attributes is indicated through the operation command, etc., improving the accuracy and reliability of the requests that can be recognized by the object storage service node.
[0293] Figure 7 It is a flowchart of a method for managing file extension attributes shown according to an exemplary embodiment. Exemplarily, the method for managing file extension attributes may include the following steps 701-step 703.
[0294] Step 701: The object storage service node receives an attribute setting request sent by the file storage client.
[0295] It should be noted that for the relevant description of the attribute setting request, reference can be made to the description in step 302, which will not be elaborated here.
[0296] Step 702: The object storage service node parses the attribute setting request through the target interface to obtain the content requested by the attribute setting request.
[0297] In the embodiments of the present application, the object storage service node can determine the content requested by the attribute setting request by parsing the attribute setting request, and thereby manage the file extension attributes based on the content requested by the attribute setting request.
[0298] Exemplarily, the object storage service node may parse the attribute setting request through a parsing module.
[0299] Exemplarily, after receiving the attribute setting request, the object storage service node may determine that the attribute setting request is a request related to file extension attributes through the first field in the request address (such as: winmode).
[0300] Example 1. In combination with Method 1 in Step 302, an exemplary introduction to the implementation process of Step 702 is provided.
[0301] In the embodiments of the present application, the object storage service node may determine the target file extension attributes to be managed by parsing the message content of the attribute setting request.
[0302] Exemplarily, the object storage service node may determine the field indicating the target file extension attributes in the message content through the first field in the message content, such as: " <winmode>”and”< / winmode> " between " <fileattributereadonly> 0x00000001< / fileattributereadonly> " etc., so as to determine the target file extension attributes to be managed.
[0303] In the embodiments of the present application, the object storage service node may determine the management method of the file extension attributes by parsing the operation command of the attribute setting request, such as: setting to the configured state or setting to the unconfigured state.
[0304] Exemplarily, if the operation command in the attribute setting request is "PUT", the management method is to set to the configured state. If the operation command in the attribute setting request is "DELETE", the management method is to set to the unconfigured state.
[0305] Example 2. In combination with Method 2 in Step 302, an exemplary introduction to the implementation process of Step 702 is provided.
[0306] In the embodiments of the present application, the object storage service node may determine the management method of the file extension attributes by parsing the message content of the attribute setting request.
[0307] Exemplarily, the object storage service node may determine the management method of the file extension attributes through the third field in the message content, such as: " <winmode>”and”< / winmode> " between the third fields, so as to determine the to-be-set state (i.e., the target state) of the target file extension attributes. If the message content includes " <type>put< / type> ", that is, the third field is "put", the management method is to set to the configured state, that is, the to-be-set state of the target file extension attributes is the configured state. If the message content includes " <type>delete< / type>That is, when the third field is "delete", the management method is set to the unconfigured state, that is, the to-be-set state of the target file extension attribute is the unconfigured state.
[0308] It should be noted that for other relevant descriptions in Example 2, reference can be made to the descriptions in Example 1, which will not be elaborated here.
[0309] Optionally, the file extension attribute management method may further include the following S1-S4.
[0310] S1: The object storage service node determines the value of the target file extension attribute by parsing the attribute setting request.
[0311] Exemplarily, in the message content, " <fileattributereadonly> 0x00000001< / fileattributereadonly> " is used to indicate the value of the read-only attribute, "Readonly" is used to indicate the read-only attribute, and "0x00000001" is used to indicate the value.
[0312] S2: The object storage service node determines whether the value of the target file extension attribute is the same as the target value.
[0313] Among them, the target value is the value of the target file extension attribute in the Windows operating system.
[0314] In the embodiment of the present application, the object storage service node stores the target value of the target file extension attribute, and the target value is the value of the target file extension attribute in the Windows operating system. After parsing the value of the target file extension attribute from the message content, the object storage service node compares the value of the target file extension attribute with the target value. If they are the same, it is considered that the value of the target file extension attribute passes the verification. Otherwise, if they are different, it is considered that the value of the target file extension attribute fails the verification.
[0315] Exemplarily, the value of the read-only attribute in the Windows operating system is 0x00000001, that is, the target value is 0x00000001. Therefore, if the value of the read-only attribute is <fileattributereadonly> 0x00000001< / fileattributereadonly> , it indicates that the value of the target file extension attribute is the same as the target value of the target file extension attribute. If the value of the read-only attribute is a non-target value, such as: " <fileattributereadonly> 0x00000002< / fileattributereadonly> ", it indicates that the value of the target file extension attribute is different from the target value of the target file extension attribute.
[0316] S3: If the value of the target file extension attribute is the same as the target value, the object storage service node executes step 703.
[0317] In this embodiment, the target file extension attribute is set to the target state only when the value of the target file extension attribute is the same as the target value of the target file extension attribute. In this way, it helps to ensure the accuracy of the managed target file extension attributes.
[0318] S4: If the value of the target file extension attribute is different from the target value, the object storage service node returns a prompt message to the file storage client, and the prompt message is used to indicate that there is an error in the value of the target file extension attribute.
[0319] In this embodiment, when the value of the target file extension attribute is different from the target value of the target file extension attribute, a prompt message is returned to the file storage client to indicate that there is an error in the value of the target file extension attribute. In this way, it helps to correct the error of the file storage client in a timely manner.
[0320] Step 703: The object storage service node sets the target file extension attribute of the target node to the target state based on the content requested by the attribute setting request.
[0321] In the embodiment of the present application, after the object storage service node obtains the content requested by the attribute setting request, it executes the content requested by the attribute setting request, that is, sets the target file extension attribute of the target node to the target state.
[0322] For setting the target file extension attribute of the target node to the target state, there are multiple implementation manners. Hereinafter, an exemplary description will be given through Manner A to Manner B.
[0323] Manner A: When the object storage service node indicates the state of each file extension attribute of the target node through a string (such as: the target string), where different bits of the target string are used to indicate different file extension attributes. Based on this, the object storage service node can set the target file extension attribute of the target node to the target state by modifying the value of the target bit of the target string.
[0324] It should be noted that based on the setting manner of Manner A, when modifying each file extension attribute of the target node simultaneously, it is equivalent to modifying the value of each bit of the target field. Based on this, it can be considered that the new state of the file extension attribute is used to overwrite the historical state of the file extension attribute.
[0325] In the embodiment of the present application, when the target state is the configured state, the object storage service node can set the target bit of the target string to the first value; the target bit is used to indicate the target file extension attribute, and the first value is used to indicate the configured state.
[0326] Exemplarily, the target string is a 23-bit binary string, where the first bit indicates the status of the read-only attribute. If the content requested by the attribute setting request is to set the read-only attribute to the configured state, the object storage service node can set the value of the first bit to 1 (i.e., the first value), so as to indicate that the read-only attribute is in the configured state.
[0327] In the embodiment of the present application, when the target state is the unconfigured state, the object storage service node can set the target bit of the target string to the second value; the second value is used to indicate the unconfigured state.
[0328] Exemplarily, the target string is a 23-bit binary string, where the second bit indicates the status of the hidden attribute. If the content requested by the attribute setting request is to set the hidden attribute to the unconfigured state, the object storage service node can set the value of the second bit to 0 (i.e., the second value), so as to indicate that the hidden attribute is in the unconfigured state.
[0329] In this embodiment, multiple file extension attributes of the target node are indicated by a single string. In this way, it not only helps improve the efficiency in subsequent updating, searching, and deleting of file extension attributes, but also helps reduce the storage space occupied by the fields indicating file extension attributes.
[0330] In the embodiment of the present application, the target string can be associated with the identifier of the target node for storage. For example, the target string can be stored in the metadata of the target object. In this way, when updating the file extension attributes of the target node, it helps improve the convenience and accuracy of determining the target string.
[0331] Method B: The object storage service node indicates multiple file extension attributes of the target node through multiple fields, where one field is used to indicate one file extension attribute. For example, the target field is used to indicate the target file extension attribute. Based on this, the object storage service node can set the target file extension attribute of the target node to the target state by generating the target field or deleting the target field.
[0332] In the embodiment of the present application, when the target state is the configured state, the object storage service node can generate the target field and store the target field. The target field is used to indicate the configured target file extension attribute. That is to say, when the object storage service node stores the target field, it means that the target node has configured the target file extension attribute, that is, the target file extension attribute of the target node is in the configured state.
[0333] Exemplarily, the target file extension attribute is the read-only attribute. That is to say, the message content of the attribute setting request includes <fileattributereadonly> 0x00000001< / fileattributereadonly>, Based on this, the target field generated by the object storage service node can be x-obs-meta-winmode:0x0000001.
[0334] It should be noted that based on the setting method of Method B, when the status of the target file extended attribute is set to the configured status, if it is the first time to set the target file extended attribute, it can be considered as adding a target file extended attribute to the target node. If it is not the first time to set the target file extended attribute, it can be considered as updating the status of the target file extended attribute of the target node.
[0335] Exemplarily, after the object storage service node generates the target field, it can store the target field in the non-volatile storage medium of the object storage service node, so as to achieve the persistent storage of the target field.
[0336] Exemplarily, the object storage service node can store the target field based on the identifier of the target node, that is, associate and store the identifier of the target node with the target field. In this way, when the file storage client queries the file extended attributes of the node later, it can indicate the node to be queried through the node identifier.
[0337] Since the identifier of the target node is the same as the identifier of the target object, based on this, the object storage service node can store the target field in the metadata of the target object based on the identifier of the target node, so as to achieve the associated storage of the target field and the identifier of the target node.
[0338] In the embodiment of the present application, when the target status is the unconfigured status, the object storage service node can delete the target field of the target node. That is to say, when the object storage service node does not store the target field, it means that the target node does not configure the target file extended attribute, that is, the target file extended attribute of the target node is in the unconfigured status.
[0339] It should be noted that based on the setting method of Method B, when the status of the target file extended attribute is set to the unconfigured status, it can be considered as deleting the configured target file extended attribute of the target node.
[0340] Exemplarily, the target file extended attribute is the hidden attribute, and the target field can be x-obs-meta-winmode:0x00000002. The object storage service node can delete x-obs-meta-winmode:0x00000002 to set the target file extended attribute to the unconfigured status.
[0341] In this embodiment, multiple fields are used to indicate multiple file extended attributes of the target node. In this way, it helps to improve the independence of different file extended attributes, and thus helps to improve the accuracy of the indicated file extended attributes.
[0342] In the above embodiments, after the object storage service node receives the attribute setting request sent by the file storage client, it determines the content requested by the attribute setting request by parsing the attribute setting request, and then based on the content requested by the attribute setting request, sets the target file extended attribute of the target node to the target state, thereby completing the management of the file extended attribute.
[0343] Since the attribute setting request is determined according to the interface provided by the object storage service node, the attribute setting request indicates the requested content through the semantics of the object storage. In this way, the object storage service node can accurately identify the content requested by the attribute setting request, thereby ensuring the realization of the management of the file extended attribute. Therefore, through the solution of the present application, the object storage system can improve the semantics of the object storage, so that the semantics of the object storage can be compatible with the file extended attribute, thereby providing the management service of the file extended attribute on the basis of providing the file service, and further providing a more perfect file service, so that the object storage can better be compatible with the file application.
[0344] Based on the above embodiments, the object storage service node of the object storage system can determine the management method of the file extended attribute by parsing the attribute setting request using the object storage semantics, and manage the file extended attribute based on the management method of the file extended attribute indicated by the attribute setting request, thereby realizing the intercommunication between the semantics of the file extended attribute and the object storage semantics.
[0345] In addition, the object storage service node realizes the function implementation of the interface (i.e., the target interface) that supports the management of the file extended attribute by supporting functions such as parsing, management, storage, and query of the content related to the file extended attribute, thereby enabling the object storage system to provide a more perfect file extended attribute management function.
[0346] The above is the first part of the embodiments of the present application. The following Figures 8 to 13 introduces the second part of the embodiments of the present application.
[0347] Figure 8 is a flowchart of a method for managing file extended attributes shown according to an exemplary embodiment. Exemplarily, the method for managing file extended attributes may include the following steps 801-step 803.
[0348] Step 801: The file storage client receives an attribute acquisition instruction, and the attribute acquisition instruction is used to indicate the acquisition of the file extended attribute of the target node.
[0349] In the embodiments of the present application, the attribute acquisition instruction indicates the target node. In this way, it helps to avoid the file storage client from acquiring the file extended attribute of a non-target node, thereby helping to ensure the accuracy of the subsequent operations performed by the file storage client.
[0350] In the embodiments of the present application, the attribute acquisition instruction may be an instruction triggered by a user. For example, when the user views the file extension attribute of a target node through an electronic device, the operating system responds to the user's trigger operation and sends an attribute acquisition instruction to the file storage client to instruct the file storage client to acquire the file extension attribute of the target node.
[0351] Alternatively, the attribute acquisition instruction may be an instruction triggered by a target application. For example, during the process of an electronic device running a target application, if it is necessary to query the file extension attribute of a target node, the target application may send a first query instruction to the operating system to instruct to query the file extension attribute of the target node. After receiving the first query instruction, the operating system sends an attribute acquisition instruction to the file storage client to instruct the file storage client to acquire the file extension attribute of the target node.
[0352] Hereinafter, an exemplary introduction is given to the manner in which the operating system sends an attribute acquisition instruction to the file storage client.
[0353] In the embodiments of the present application, the Windows operating system may send an attribute acquisition instruction to the file storage client through the FUSE module.
[0354] Exemplarily, after the user triggers the attribute acquisition instruction, or the target application sends a first query instruction to Windows, the Windows operating system sends an attribute setting instruction to the FUSE module, so that the FUSE module sends an attribute setting instruction to the file storage client.
[0355] In the embodiments of the present application, the file storage client is configured with a second interface, and the second interface is used to instruct to acquire the file extension attribute. On this basis, the Windows operating system may send an attribute acquisition instruction to the file storage client by calling the second interface.
[0356] Exemplarily, as Figure 9 shown, after the FUSE module receives the attribute acquisition instruction sent by the operating system, it sends an attribute acquisition instruction to the file storage client by calling the second interface.
[0357] Exemplarily, the second interface may be win_get_file_attribute. Among them, "set" is used to represent acquisition.
[0358] It can be understood that the second interface can be regarded as an interface provided by the file storage client to the operating system, so that the operating system can interact with the file storage client through the second interface to query the file extension attribute of the node.
[0359] It should be noted that the embodiments of the present application do not limit the manner in which Windows sends an attribute acquisition instruction to the file storage client, and the above is only an exemplary illustration.
[0360] In this embodiment, by configuring a second interface for the file storage client as the interface for querying file extended attributes, this helps to improve the query accuracy of file extended attributes, and thus helps to better provide file extended attribute management services.
[0361] It should be noted that for other relevant descriptions of step 801, reference can be made to the description of step 301, which will not be elaborated here.
[0362] Step 802: The file storage client obtains the file extended attributes of the target node based on the attribute acquisition instruction.
[0363] In the embodiments of the present application, after receiving the attribute acquisition instruction, the file storage client obtains the file extended attributes of the target node according to the node identifier indicated by the attribute acquisition instruction, that is, the identifier of the target node.
[0364] Exemplarily, the file storage client can obtain the file extended attributes of the target node through the attribute management module.
[0365] There are multiple implementation manners for obtaining the file extended attributes of the target node. Hereinafter, exemplary illustrations will be made through manner a to manner b.
[0366] Manner a: The file storage client can obtain the file extended attributes of the target node from the storage medium of the electronic device.
[0367] In the embodiments of the present application, the electronic device includes a first storage medium (i.e., the local storage medium of the electronic device), and the file extended attributes of at least one node in the directory tree can be stored in the first storage medium. On this basis, after receiving the attribute acquisition instruction, the file storage client can obtain the file extended attributes of the target node from the first storage medium, such as: obtaining the file extended attributes corresponding to the identifier of the target node.
[0368] Exemplarily, the first storage medium can be a cache, memory, etc. It should be noted that the embodiments of the present application do not limit the type of the storage medium, and the above is only an exemplary illustration.
[0369] In this manner, by obtaining the file extended attributes of the target node from the local storage medium of the electronic device, it helps to improve the efficiency of obtaining file extended attributes.
[0370] Manner b: The file storage client can obtain the file extended attributes of the target node from the object storage service node.
[0371] In this method, by obtaining the file extension attributes of the target node from the object storage service node, it helps to improve the accuracy of the obtained file extension attributes.
[0372] Example 1: After the file storage client receives the attribute acquisition instruction, it can first obtain the file extension attributes of the target node from the local storage medium of the electronic device. If the acquisition fails, it obtains the file extension attributes of the target node from the object storage service node. In this way, it helps to improve the efficiency of obtaining file extension attributes.
[0373] Example 2: After the file storage client receives the attribute acquisition instruction, if the file extension attributes of the target node are stored in the local storage medium of the electronic device, the file storage client determines whether the file extension attributes of the target node in the local storage medium meet the target conditions. If they meet, it obtains the file extension attributes of the target node from the local storage medium. If they do not meet, it obtains the file extension attributes of the target node from the object storage service node. In this way, it helps to ensure the accuracy of the obtained file extension attributes.
[0374] Among them, meeting the target conditions means that the value of the file extension attributes in the local storage medium is the same as the value of the file extension attributes in the Windows operating system. Not meeting the target conditions means that the value of the file extension attributes in the local storage medium is different from the value of the file extension attributes in the Windows operating system.
[0375] It should be noted that for other relevant descriptions of Example 2, reference can be made to the descriptions of S1 - S4 above, which will not be elaborated here.
[0376] Example 3: After the file storage client receives the attribute acquisition instruction, it can directly obtain the file extension attributes of the target node from the object storage service node, that is, regardless of whether the target conditions are met, the file storage client obtains the file extension attributes of the target node from the object storage service node. In this way, it helps to ensure the accuracy of the obtained file extension attributes.
[0377] Next, the implementation process of method b will be exemplarily described through S5 - S7.
[0378] S5: Based on the attribute acquisition instruction, the file storage client sends an attribute acquisition request to the object storage service node.
[0379] Among them, the attribute acquisition request is used to request the acquisition of the file extension attributes of the target node.
[0380] In the embodiments of the present application, the attribute acquisition request indicates the target node. Exemplarily, the attribute acquisition request may include the identifier of the target node, which helps to ensure the accuracy of the acquired file extension attributes. In addition, the attribute acquisition request also indicates the file extension attributes, which helps to ensure the accuracy of the acquired information.
[0381] In the embodiments of the present application, the file storage client can determine the attribute acquisition request through the target interface provided by the object storage service node. The attribute acquisition request may include an operation command and a request address. The operation command can be used to acquire file extension attributes, and the request address can be used to indicate the target node.
[0382] Exemplarily, the attribute acquisition request may be "HEAD / filesystem / dir / file?winmode". "?winmode" is used to indicate that the attribute acquisition request is related to file extension attributes. "HEAD" is the operation command used to indicate the acquisition of file extension attributes, and "filesystem / dir / file" is used to indicate the target node.
[0383] Exemplarily, as Figure 9 shown, the file storage client can send an attribute acquisition request to the object storage service node through the target interface provided by the object storage service node.
[0384] It should be noted that for the relevant description of the attribute acquisition request, reference can be made to the description of the attribute setting request, which will not be elaborated here.
[0385] S6: The object storage service node returns the file extension attributes of the target node to the file storage client based on the received attribute acquisition request.
[0386] In the embodiments of the present application, after receiving the attribute acquisition request, the object storage service node acquires the file extension attributes of the target node based on the content requested by the attribute acquisition request, and returns the file extension attributes of the target node to the file storage client.
[0387] Example 1, in combination with Method A in the above step 703, the object storage service node can return the target string of the target node to the file storage client. This helps to improve the data transmission efficiency.
[0388] Example 2, in combination with Method B in the above step 703, the object storage service node can return multiple fields of the target node to the file storage client. This helps to improve the processing efficiency of the file storage client after receiving the file extension attributes of the target node.
[0389] Example 3, in combination with Method B in the above step 703, the object storage service section can merge multiple fields into one field and return the merged single field to the file storage client.
[0390] Exemplarily, the target node is only configured with read-only attributes and hidden attributes. Among them, the field corresponding to the read-only attribute is x-obs-meta-winmode: 0x00000001, and the field corresponding to the hidden attribute is x-obs-meta-winmode: 0x00000002. Based on this, the object storage service node can merge the field corresponding to the read-only attribute and the field corresponding to the hidden attribute into winmode: 0x00000003 and return winmode: 0x00000003 to the file storage client.
[0391] It should be noted that for other relevant descriptions of S6, reference can be made to the description of step 702, which will not be elaborated here.
[0392] S7: The file storage client receives the file extension attributes of the target node sent by the object storage service node.
[0393] In one example, in combination with Example 1 and Example 3 in the above S6, after the file storage client receives the content returned by the object storage service node, it can parse the content returned by the object storage service node. For example, by parsing winmode: 0x00000003, it obtains winmode: 0x00000001, winmode: 0x00000002, etc., and returns the parsed fields to the operating system, that is, returns winmode: 0x00000001, winmode: 0x00000002 to the operating system.
[0394] In another example, in combination with Example 2 in the above S2, after the file storage client receives the fields returned by the object storage service node, it can transfer the fields returned by the object storage service node to the operating system.
[0395] In the above embodiments, the file storage client determines the attribute acquisition request by extending the target interface provided by the object storage service node, so as to realize separately acquiring the file extension attributes of the target node through the attribute acquisition request, thereby enabling the object storage system to provide a more perfect management service for file extension attributes.
[0396] Optionally, the file extension attribute management method may further include: The file storage client writes the file extension attributes of the target node obtained from the object storage service node into the storage medium of the electronic device.
[0397] In this embodiment, by storing the file extended attributes of the target node obtained from the object storage service node in the local storage medium of the electronic device, subsequent acquisition of the file extended attributes of the target node can be directly obtained from this storage medium, which helps to improve the efficiency of data acquisition.
[0398] Step 803: The file storage client returns the file extended attributes of the target node based on the attribute acquisition instruction.
[0399] In the embodiment of the present application, after the file storage client obtains the file extended attributes of the target node, it returns the file extended attributes of the target node to the sender of the attribute acquisition instruction, such as: returning to the operating system.
[0400] In the above embodiment, after receiving the attribute acquisition instruction, the file storage client can obtain the file extended attributes of the target node based on the attribute acquisition instruction and return the file extended attributes of the target node, thereby implementing the query service for providing file extended attributes, and further helping the object storage system to provide a more perfect management service for file extended attributes.
[0401] Figure 10 This is a schematic diagram for obtaining file extended attributes provided by the embodiment of the present application. Hereinafter, Figure 10 An exemplary introduction to the process of obtaining file extended attributes will be given.
[0402] Exemplarily, after the user triggers the attribute acquisition instruction or the target application sends the first query instruction to the Windows operating system, the Windows operating system calls the second interface of the file storage client through the FUSE module and sends the attribute acquisition instruction to the file storage client to instruct the file storage client to query the file extended attributes of the target node. Exemplarily, the second interface can be "sfc_win_get_attributes", and the attribute acquisition instruction can be "fuse_operations::win_get_attributes".
[0403] After receiving the attribute acquisition instruction, the file storage client can obtain the file extended attributes of the target node from the local storage medium of the electronic device. If the acquisition is successful, it returns the file extended attributes of the target node to the Windows operating system. If the acquisition fails, it generates an attribute acquisition request and sends the attribute acquisition request to the object storage service node to obtain the file extended attributes of the target node from the object storage service node. On this basis, the file storage client can write the file extended attributes of the target node obtained from the object storage node into the local storage medium of the electronic device and return the file extended attributes of the target node obtained from the object storage node to the Windows operating system.
[0404] It should be noted that Figure 10 For other descriptions, reference can be made to Figure 6 the description thereof, which will not be elaborated herein.
[0405] In the embodiments of the present application, the file extension attribute management method may further include the following S8 - S10.
[0406] S8: The file storage client receives a metadata acquisition instruction, which is used to indicate acquiring the metadata of a target node.
[0407] S9: The file storage client acquires the target metadata of the target node based on the metadata acquisition instruction. Among them, the target metadata of the target node includes the file extension attribute of the target node.
[0408] The following exemplarily introduces the acquisition of the target metadata of the target node through two implementation manners.
[0409] In one implementation manner, the file storage client may acquire the target metadata of the target node from the storage medium of the electronic device. In this way, it helps to improve the acquisition efficiency of the target metadata.
[0410] Exemplarily, the electronic device includes a second storage medium (i.e., the local storage medium of the electronic device), and the second storage medium stores the target metadata of at least one node on the directory tree. On this basis, after the file storage client receives the metadata acquisition instruction, it can acquire the target metadata of the target node from the second storage medium.
[0411] It should be noted that for the relevant description of the second storage medium, reference can be made to the description of the first storage medium, which will not be elaborated herein.
[0412] Exemplarily, the second storage medium and the first storage medium may be different storage media on the electronic device. In this way, the file extension attributes or target metadata of the nodes can be stored separately through different storage media, which helps to facilitate data search. Or, the second storage medium and the first storage medium may also be the same storage medium on the electronic device. In this way, it helps to avoid occupying too much storage medium.
[0413] In another implementation manner, the file storage client may acquire the target metadata of the target node from the object storage service node. In this way, it helps to improve the accuracy of the acquired target metadata.
[0414] In an embodiment of the present application, after receiving a metadata acquisition instruction, a file storage client may send a metadata acquisition request to an object storage service node. The metadata acquisition request is used to request the metadata of a target node. Exemplarily, the metadata acquisition request may be "HEAD / filesystem / dir / file". After receiving the metadata acquisition request, the object storage service node obtains the target metadata of the target node based on the content requested by the metadata acquisition request, and returns the target metadata of the target node to the file storage client.
[0415] Exemplarily, the target metadata of the target node may further include inode data, Dtree data, etc.
[0416] S10: The file storage client returns the target metadata of the target node based on the metadata acquisition instruction.
[0417] It should be noted that other relevant descriptions of S8 - S10 can refer to the description of step 802 above, which will not be elaborated here.
[0418] In the above embodiment, after receiving the metadata acquisition instruction, the file storage client obtains and returns the target metadata of the target node. The target metadata includes the file extension attributes of the target node, thereby realizing the provision of more comprehensive metadata, and further helping the object storage system to provide a more perfect management service for file extension attributes.
[0419] Figure 11 It is a schematic diagram of obtaining metadata provided by an embodiment of the present application. Next, Figure 11 An exemplary introduction to the metadata acquisition process will be given.
[0420] Exemplarily, after a user triggers a metadata acquisition instruction or a target application sends a second query instruction to the Windows operating system, the Windows operating system calls the third interface of the file storage client through the FUSE module, and sends a metadata acquisition instruction to the file storage client to instruct the file storage client to query the metadata of the target node. Exemplarily, the third interface may be "sfc_get_attributes" / "sfc_getattr_obs", and the metadata acquisition instruction may be "fuse_operations::getattributes".
[0421] After receiving the metadata acquisition instruction, the file storage client can obtain the target metadata of the target node from the local storage medium of the electronic device. If the acquisition is successful, the target metadata of the target node is returned to the Windows operating system. If the acquisition fails, a metadata acquisition request is generated and sent to the object storage service node to obtain the target metadata of the target node from the object storage service node. After receiving the metadata acquisition request, the object storage service node returns the target metadata of the target node to the file storage client based on the metadata acquisition request.
[0422] On this basis, the file storage client can write the target metadata of the target node obtained from the object storage node into the storage medium of the electronic device and return the target metadata of the target node obtained from the object storage node to the Windows operating system.
[0423] It should be noted that Figure 11 For other descriptions, reference can be made to Figure 6 the description herein, which will not be elaborated herein.
[0424] In the embodiments of the present application, the file extension attribute management method may further include the following S11-S13.
[0425] S11: The file storage client receives a directory listing instruction for instructing to list a target directory.
[0426] Among them, listing a directory (i.e., readdir directory) means listing at least one file / subdirectory under the directory when opening the directory, that is, for example, displaying at least one file / subdirectory under the directory to the user.
[0427] Exemplarily, after the user opens the target directory, the operating system will trigger a readdir operation and send a directory listing instruction to the file storage client to instruct the file storage client to list the target directory.
[0428] S12: The file storage client obtains the target metadata of the target directory based on the directory listing instruction; the target metadata of the target directory includes the file extension attributes of at least one file / subdirectory under the target directory.
[0429] Among them, at least one file under the target directory includes files under the first-level directory of the target directory.
[0430] Hereinafter, through two implementation manners, an exemplary introduction to obtaining the target metadata of the target directory is given.
[0431] In one implementation manner, the file storage client can obtain the target metadata of the target directory from the storage medium of the electronic device. In this way, it helps to improve the acquisition efficiency of the target metadata.
[0432] Exemplarily, the electronic device includes a third storage medium (i.e., the local storage medium of the electronic device), and at least one target metadata of a directory on the directory tree is stored in the third storage medium, such as: file extension attributes of files / subdirectories under at least one directory. On this basis, after receiving the directory listing instruction, the file storage client can obtain the target metadata of the target directory from the third storage medium.
[0433] It should be noted that for the relevant description of the third storage medium, reference can be made to the description of the first storage medium, which will not be elaborated here.
[0434] Exemplarily, the third storage medium and the first storage medium / second storage medium can be different storage media on the electronic device. In this way, the file extension attributes / target metadata of the node and the target metadata of the listed directory can be stored in different storage media respectively, which helps to facilitate data search.
[0435] In another implementation, the file storage client can obtain the target metadata of the target directory from the object storage service node. In this way, it helps to improve the accuracy of the obtained target metadata.
[0436] In the embodiment of the present application, after receiving the directory listing instruction, the file storage client can send a directory listing request to the object storage service node. The directory listing request is used to request to obtain the metadata of the listed target directory. Exemplarily, the directory listing request can be "GET / filesystem / dir / file". After receiving the directory listing request, the object storage service node obtains the target metadata of the target directory based on the content requested by the directory listing request, so as to obtain the target metadata of at least one file / subdirectory under the target directory. Among them, the target metadata of at least one file / subdirectory under the target directory includes the file extension attributes of at least one file / subdirectory under the target directory. After that, the object storage service node can return the target metadata of at least one file / subdirectory under the target directory to the file storage client.
[0437] S13: The file storage client returns the target metadata of the target directory based on the directory listing instruction.
[0438] It should be noted that for other relevant descriptions of S11 - S13, reference can be made to the description of step 802 above, which will not be elaborated here.
[0439] In the above embodiments, after receiving a directory listing instruction, the file storage client obtains and returns the target metadata of the target directory, where the target metadata includes the file extension attributes of at least one file / sub-directory under the target directory, so as to provide more comprehensive metadata when listing directories, and further help the object storage system provide a more perfect management service for file extension attributes.
[0440] Figure 12 This is a schematic diagram of listing a directory provided by an embodiment of the present application. Hereinafter, in combination with Figure 12 , an exemplary introduction to the process of listing the target is given.
[0441] Exemplarily, after the user triggers a directory listing instruction or the target application sends a third query instruction to the Windows operating system, as Figure 13 shown, the Windows operating system calls the fourth interface of the file storage client through the FUSE module to send a directory listing instruction to the file storage client to instruct the file storage client to list the target directory. Exemplarily, the fourth interface can be "sfc_readdir_attributes" / "sfc_readdir_obs", and the directory listing instruction can be "fuse_operations::readdir".
[0442] After receiving the directory listing instruction, the file storage client can obtain the target metadata of the target directory from the local storage medium of the electronic device. If the acquisition is successful, the target metadata of the target directory is returned to the Windows operating system. If the acquisition fails, a directory listing request is generated and sent to the object storage service node to obtain the target metadata of the target directory from the object storage service node. After receiving the directory listing request, the object storage service node returns the target metadata of the target directory to the file storage client.
[0443] On this basis, the file storage client can write the target metadata of the target directory obtained from the object storage node into the storage medium of the electronic device and return the target metadata of the target directory obtained from the object storage node to the Windows operating system.
[0444] It should be noted that Figure 12 For other descriptions of Figure 6 , reference can be made to the description of
[0445] In the embodiments of the present application, the file extension attribute management method may further include the following S14-S16.
[0446] S14: The file storage client receives a deletion instruction, and the deletion instruction is used to indicate deleting the target node.
[0447] S15: The file storage client sends a deletion request to the object storage service node based on the deletion instruction. The deletion request is used to request the deletion of the target metadata of the target node.
[0448] In the embodiment of the present application, after receiving the deletion instruction, the file storage client, on the basis of sending a request to the object storage service node to delete the target node, also sends a deletion request to the object storage service to request the deletion of the target metadata of the target node, so as to delete the information related to the target node on the object storage service node and avoid useless data occupying the storage space of the object storage service node.
[0449] S16: The object storage service node deletes the file extended attributes of the target node based on the received deletion request.
[0450] In the embodiment of the present application, after receiving the deletion request, the object storage service node, on the basis of deleting metadata such as inode data and Dtree data of the target node, also deletes the file extended attributes of the target node, so as to comprehensively clear the information related to the target node.
[0451] It should be noted that for the relevant descriptions of S14 - S16, reference can be made to the description of step 802 above, and details will not be elaborated here.
[0452] In the above embodiment, after receiving the deletion instruction for requesting the deletion of the target node, the file storage client sends a deletion request to the object storage service node to request the deletion of the metadata of the target node. After receiving the deletion request, the object storage service deletes the file extended attributes of the target node. In this way, after deleting the target node, it helps to comprehensively clear the data related to the target node, thus helping to avoid useless data occupying the storage space of the object storage service node.
[0453] The above is the second part of the embodiment of the present application. The following Figures 14 to 16 introduces the third part of the embodiment of the present application.
[0454] In the embodiment of the present application, based on the implementation method of file extended attributes, file extended attributes can be divided into the first type of file extended attributes and the second type of file extended attributes. The first type of file extended attributes can be implemented by the file storage client, and the second type of file extended attributes can be implemented by the operating system.
[0455] Exemplarily, the first type of file extended attributes may include read - only attributes, encryption attributes, compression attributes, etc. The second type of file extended attributes may include hidden attributes, system attributes, etc.
[0456] Since the operations performed by the file storage client during the implementation of the first type of file extension attribute are to obtain the file extension attribute and implement the file extension attribute, for the file storage client, the first type of attribute can also be referred to as a function implementation type attribute.
[0457] Since the operations performed by the file storage client during the implementation of the second type of file extension attribute are to obtain the file extension attribute and transmit the file extension attribute to the operating system so that the operating system can implement the file extension attribute, for the file storage client, the second type of attribute can also be referred to as a pass-through type attribute.
[0458] The following Figure 14 and Figure 17 are used to give an exemplary introduction to the implementation process of the first type of file extension attribute.
[0459] The following Figure 14 and Figure 15 are used to give an exemplary introduction to the first implementation solution by taking the target file extension attribute of the target node as an example.
[0460] Figure 14 FIG.
[0461] Step 1401: The file storage client receives a target instruction, where the target instruction is used to indicate to perform a target operation on a target node.
[0462] Among them, the target operation is related to the target file extension attribute.
[0463] In the embodiments of the present application, when a user or a target application requests to perform a target operation on a target node, the operating system may send a target instruction to the file storage client, which is used to indicate the operation requested to be performed by the user or the target application, that is, to perform a target operation on the target node.
[0464] Exemplarily, the target operation may be a write operation. Based on this, the target file extension attribute is a read-only attribute, that is to say, the write operation is related to the read-only attribute.
[0465] Step 1402: The file storage client determines the permission verification result of the target operation based on the status of the target file extension attribute.
[0466] Among them, the permission verification result includes passing the verification or failing the verification.
[0467] In the embodiments of the present application, after receiving a target instruction, the file storage client can obtain the file extension attributes of the target node based on the target instruction to determine the status of the target file extension attributes, and then determine the permission verification result according to the status of the target file extension attributes.
[0468] Exemplarily, the target operation is a write operation, and the target file extension attribute is a read-only attribute. If the read-only attribute is in the configured state, that is, the target node has configured the read-only attribute, the permission verification result is a failed verification. That is to say, the user or the target application does not have the permission to perform a write operation on the target node. If the read-only attribute is in the unconfigured state, that is, the target node has not configured the read-only attribute, the permission verification result is a passed verification. That is to say, the user or the file application has the permission to perform a write operation on the target node.
[0469] Exemplarily, as Figure 15 shown, after receiving the target instruction, the attribute management module can obtain the file extension attributes of the target node. After that, the attribute management module can send the file extension attributes of the target node and the type of the target operation to the attribute implementation module, and the attribute implementation module determines the permission verification result of the target operation. After the attribute implementation module determines the permission verification result, it transmits the permission verification result to the attribute management module.
[0470] It should be noted that the method for obtaining the file extension attributes of the target node can refer to the description of the embodiments shown in Figure 8 and will not be elaborated here.
[0471] Above, the manner in which the file storage client receives the target instruction is only an exemplary illustration, and the embodiments of the present application do not limit this. For example, it can also be that the operating system sends the target instruction to the attribute implementation module. After the attribute implementation module instructs the attribute management to obtain the status of the target file extension attributes, the attribute implementation module then determines the permission verification result of the target operation.
[0472] Step 1403: If the permission verification result is a failed verification, the file storage client returns a response message based on the target instruction.
[0473] The response message is used to indicate a refusal to perform the target operation on the target node.
[0474] In the embodiments of the present application, when the file storage client determines that the permission verification result of the target operation is a failed verification, the file storage client returns a response message to the sender of the target instruction (such as: the operating system) to indicate a refusal to perform the target operation on the target node, thereby implementing instructing the operating system to intercept the user or the target application from performing the target operation on the target node.
[0475] In the above embodiments, after the file storage client receives the target instruction, it performs a target operation on the target node according to the indication of the target instruction, automatically obtains the file extension attributes of the target node to determine the status of the target file extension attributes related to the target operation, and thus determines the permission verification result of the target operation. When the permission verification result of the target operation fails the verification, the file storage client returns response information to indicate that the target operation on the target node is refused, so as to intercept the target operation on the target node, and further implement the target file extension attributes of the target node. For example, when a read-only attribute is configured on the target node, users, target applications, etc. are refused to perform write operations on the target node, that is, only read operations can be performed.
[0476] Optionally, the file extension attribute management method may further include: when the permission verification result passes the verification, the file storage client returns first response information based on the target instruction; the first response information is used to indicate that the target operation on the target node is allowed.
[0477] In the embodiments of the present application, if the permission verification result of the target operation passes the verification, the file storage client may return the first response information to the sender of the target instruction. For example, the first response information is returned to the operating system to indicate that the target operation on the target node is allowed. In this way, it helps the operating system to quickly respond to the operation requests of users or target applications.
[0478] The following, in combination with Figure 16 and Figure 17 , taking the target file extension attributes of the target node as an example, an exemplary introduction to the second implementation solution is given.
[0479] Figure 16 FIG. 16 is a flowchart of another file extension attribute management method shown according to an exemplary embodiment. Exemplarily, the file extension attribute management method may include the following steps 1601-1603.
[0480] When the target file extension attributes are some attributes in the first type of file extension attributes, such as encryption attributes, compression attributes, etc., after the file storage client receives the attribute setting instruction, the target file extension attributes of the target node can be implemented through the following steps 1601-1603.
[0481] The following takes the target node including the first file as an example to give an exemplary description of steps 1601-1603.
[0482] Step 1601: The file storage client obtains the first file based on the attribute setting instruction.
[0483] In the embodiments of the present application, after the file storage client receives an attribute setting instruction, if the target file extension attribute indicated by the attribute setting instruction is some attributes in the first type of file extension attributes, such as: encryption attribute, compression attribute, etc., the file storage client obtains the first file indicated by the attribute setting instruction.
[0484] In one example, the file storage client can obtain the first file from the local storage medium of the electronic device. In another example, the file storage client can send a fetch request to the object storage service node to request to fetch the first file indicated by the attribute setting instruction.
[0485] Step 1602: The file storage client performs the operation indicated by the attribute setting instruction on the first file to obtain a second file.
[0486] In the embodiments of the present application, after the file storage client obtains the first file, it performs the operation indicated by the attribute setting instruction on the first file to obtain a second file.
[0487] Example 1, if the attribute setting instruction indicates that the encryption attribute of the first file is set to the configured state, the operation indicated by the attribute setting instruction is to perform an encryption operation. Based on this, the file storage client performs an encryption operation on the first file to obtain an encrypted file (i.e., the second file).
[0488] Example 2, if the attribute setting instruction indicates that the encryption attribute of the first file is set to the unconfigured state, the operation indicated by the attribute setting instruction is to perform a decryption operation. Based on this, the file storage client performs a decryption operation on the first file to obtain a decrypted file (i.e., the second file).
[0489] Example 3, if the attribute setting instruction indicates that the compression attribute of the first file is set to the configured state, the operation indicated by the attribute setting instruction is to perform a compression operation. Based on this, the file storage client performs a compression operation on the first file to obtain a compressed file (i.e., the second file).
[0490] Example 4, if the attribute setting instruction indicates that the compression attribute of the first file is set to the unconfigured state, the operation indicated by the attribute setting instruction is to perform a decompression operation. Based on this, the file storage client performs a decompression operation on the first file to obtain a decompressed file (i.e., the second file).
[0491] Step 1603: The file storage client sends a first storage request to the object storage service node, and the first storage request is used to request to store the second file. The first storage request includes the second file.
[0492] In the embodiment of the present application, after obtaining the second file, the file storage client can send a first storage request to the object storage service node to request the object storage service node to store the second file. After receiving the first storage request, the object storage service node stores the second file in response to the first storage request. For example, the second file can overwrite the first file.
[0493] It should be noted that steps 1601 - 1603 are exemplarily described by taking the first file included in the target node as an example. In the case where the target node includes a first directory / first sub-directory, the process of the file storage client to implement the target file extended attributes of the first directory / first sub-directory can refer to steps 1601 - 1603, which will not be elaborated here.
[0494] In the above embodiment, after receiving the attribute setting instruction, if the target file extended attribute is a part of the first type of file extended attributes, such as: encryption attribute, compression attribute, etc., the file storage client can obtain the first file indicated by the attribute setting instruction and perform the operation indicated by the attribute setting instruction on the first file, such as: encryption operation, decryption operation, compression operation, decompression operation, etc., so as to implement the target file extended attribute for the first file or cancel the target file extended attribute for the first file, that is, implement / cancel the attributes of the windows file extended attribute, such as: implement / cancel the encryption attribute, compression attribute, etc. After that, when the file storage client sends a first storage request to the object storage service node to request the object storage service node to store the first file, it can provide the object storage service node with the data to be stored (i.e., the second file) that is semantically irrelevant to the windows file extended attribute. In this way, the object storage service node does not need to care about the semantics of the windows file extended attribute of the data to be stored, that is, it does not need the object storage service node to implement / cancel the file extended attribute of the data to be stored, which helps to simplify the software logic of the object storage service node on the basis of providing the file extended attribute management service.
[0495] Figure 17 It is a flowchart of another file extended attribute management method shown according to an exemplary embodiment. Exemplarily, the file extended attribute management method may include the following steps 1701 - 1703.
[0496] Exemplarily, in combination with Figure 3 and Figure 16 the shown embodiment, if the target state is the configured state, the file storage client can also implement the target file extended attributes of the target node through the following steps 1701 - 1703.
[0497] Hereinafter, steps 1701 - 1703 will be exemplarily described by taking the target node including the third file as an example.
[0498] Step 1701: The file storage client receives a storage instruction for instructing to store a third file; the target file extension attribute of the third file is in a configured state.
[0499] In the embodiments of the present application, after the user updates the third file through an electronic device, or after the target application updates the third file, for example, adding new content to the third file, deleting some content in the third file, etc., the Windows operating system sends a storage instruction to the file storage client, and the storage instruction is used to instruct to store the third file. After receiving the storage instruction, the file storage client can obtain the file extension attribute of the third file to determine whether the target file extension attribute of the third file is in a configured state. If the target file extension attribute of the third file is in a configured state, step 1702 is executed; otherwise, a storage request is directly sent to the object storage service node to request the object storage service node to store the third file.
[0500] Exemplarily, the target file extension attribute may include an encryption attribute, a compression attribute, etc., and the encryption attribute, compression attribute, etc. of the third file are in a configured state.
[0501] It should be noted that the third file and the second file may be the same file, or they may be different files, and the embodiments of the present application do not limit this.
[0502] Step 1702: The file storage client performs an operation indicated by the target file extension attribute on the third file to obtain a fourth file.
[0503] In the embodiments of the present application, when it is determined that the target file extension attribute of the third file is in a configured state, the file storage client performs an operation indicated by the target file extension attribute on the third file to obtain a fourth file.
[0504] Combined with Example 1 in step 1602, the target file extension attribute of the third file includes an encryption attribute, and the encryption attribute of the third file is in a configured state. The operation indicated by the configured encryption attribute is an encryption operation. Based on this, the file storage client performs an encryption operation on the second file to obtain an encrypted file (i.e., the fourth file).
[0505] Combined with Example 3 in step 1602, the target file extension attribute of the third file includes a compression attribute, and the compression attribute of the third file is in a configured state. The operation indicated by the configured compression attribute is a compression operation. Based on this, the file storage client performs a compression operation on the second file to obtain a compressed file (i.e., the fourth file).
[0506] Step 1703: The file storage client sends a second storage request to the object storage service node. The second storage request is used to request the object storage service node to store the fourth file. The second storage request includes the fourth file.
[0507] In the embodiment of the present application, after obtaining the fourth file, the file storage client sends a second storage request to the object storage service node to request the object storage service node to store the fourth file. After receiving the second storage request, the object storage service node stores the fourth file in response to the second storage request. For example, the fourth file can overwrite the third file.
[0508] It should be noted that Steps 1701 - 1703 are described by taking the first file included in the target node as an example. In the case where the target node includes the first directory / first sub - directory, the process for the file storage client to implement the target file extended attributes of the first directory / first sub - directory can refer to Steps 1701 - 1703, which will not be elaborated here.
[0509] In the above - mentioned embodiment, after receiving the storage instruction, if the target file extended attribute of the file indicated by the storage instruction is in the configured state, the file storage client first performs the operation indicated by the target file extended attribute on the third file indicated by the storage instruction to obtain the fourth file, so as to implement the target file extended attribute for the updated third file, which helps to ensure the accuracy of the provided file extended attributes.
[0510] Next, in combination with Figure 18 , an exemplary introduction to the implementation method of the second type of file extended attributes is given.
[0511] Exemplarily, taking the hidden attribute of the target node as an example, the implementation process of the second type of file extended attributes is introduced.
[0512] As Figure 18 shown, after the file storage client obtains the file extended attributes (including the hidden attribute) of the target node, it can directly transmit the file extended attributes of the target node to the operating system, that is, pass them through to the operating system. After receiving the file extended attributes of the target node, when the hidden attribute is configured for the target node, the operating system displays the target node according to the current display rule.
[0513] Exemplarily, if the current display rule is "Show hidden items", the operating system displays the target node according to a preset rule. For example, the target node is displayed in grayscale. If the display rule is "Do not show hidden items", the operating system does not display the target node.
[0514] In this embodiment, the operating system implements some file extended attributes, which helps to make full use of the functions of the operating system and simplifies the complexity of the file storage client.
[0515] The above mainly introduced the solution provided by the embodiments of the present application from the perspective of methods. To implement the above functions, the file storage client / file extended attribute management device includes the corresponding hardware structures and / or software modules for executing each function. Those skilled in the art should easily realize that, combining the units and algorithm steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed in the way of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described function for each specific application, but such implementation should not be considered to exceed the scope of the present application.
[0516] The embodiments of the present application can, according to the above method, exemplarily divide the functional modules of the file storage client / file extended attribute management device. For example, the file storage client / file extended attribute management device may include each functional module corresponding to each functional division, or two or more functions may be integrated into one processing module. The above integrated module can be implemented in the form of hardware or in the form of a software functional module. It should be noted that the division of modules in the embodiments of the present application is illustrative, only a logical functional division, and there may be other division methods in actual implementation.
[0517] Exemplarily, Figure 19 FIG. shows a possible schematic diagram of the file storage client (denoted as file storage client 1900) involved in the above embodiments. The actions performed by the file storage client 1900 are implemented by an electronic device or by the electronic device executing corresponding software. The file storage client 1900 includes: a receiving module 1901, an attribute management module 1902, and a sending module 1903. The receiving module 1901 is configured to receive an attribute setting instruction, and the attribute setting instruction indicates to set the target file extended attribute of the target node to a target state, and the target state includes a configured state or an unconfigured state. For example, Figure 3 step 301 shown. The attribute management module 1902 is configured to determine an attribute setting request based on the attribute setting instruction and the target interface provided by the object storage service node; the interface provided by the object storage service node is used to indicate the format of the attribute setting request, and the attribute setting request is used to request to set the target file extended attribute of the target node to the target state. For example, Figure 3 step 302 shown. The sending module 1903 is configured to send the attribute setting request to the object storage service node to request the object storage service node to set the target file extended attribute of the target node to the target state. For example, Figure 3 step 303 shown.
[0518] Optionally, the attribute setting request includes a message content and an operation command. The message content is used to indicate the extended attributes of the target file, and the operation command is used to indicate the target status.
[0519] Optionally, the attribute setting request includes a message content, and the message content is used to indicate the extended attributes of the target file and the target status.
[0520] Optionally, the message content includes the value of the extended attributes of the target file, and the value of the extended attributes of the target file is the same as the value in the Windows operating system.
[0521] Optionally, the file storage client further includes an attribute implementation module 1904. The attribute implementation module 1904 is configured to: receive a target instruction for indicating to perform a target operation on a target node; the target operation is related to the extended attributes of the target file; determine a permission verification result of the target operation based on the status of the extended attributes of the target file; the permission verification result includes passing the verification or failing the verification; in the case where the permission verification result fails the verification, return a response message based on the target instruction; the response message is used to indicate rejecting to perform the target operation on the target node.
[0522] Optionally, the attribute implementation module 1904 is further configured to: in the case where the permission verification result passes the verification, return a first response message based on the target instruction; the first response message is used to indicate allowing to perform the target operation on the target node.
[0523] Optionally, in the case where the target node is a first file, the attribute implementation module 1904 is further configured to: obtain the first file based on an attribute setting instruction; perform an operation indicated by the attribute setting instruction on the first file to obtain a second file; send a first storage request to an object storage service node, where the first storage request is used to request storing the second file; the first storage request includes the second file.
[0524] Optionally, in the case where the target node is a third file, the attribute implementation module 1904 is further configured to: receive a storage instruction for indicating storing the third file; the extended attributes of the third file are in a configured state; perform an operation indicated by the extended attributes of the target file on the third file to obtain a fourth file; send a storage request to the object storage service node to request the object storage service node to store the fourth file; the storage request includes the fourth file.
[0525] Optionally, the attribute management module 1902 is further configured to: receive an attribute acquisition instruction for indicating acquiring the extended attributes of a target node; acquire and return the extended attributes of the target node based on the attribute acquisition instruction.
[0526] Optionally, the attribute management module 1902 is specifically configured to: obtain the file extension attributes of the target node from the storage medium of the electronic device based on the attribute acquisition instruction.
[0527] Optionally, the attribute management module 1902 is specifically configured to: obtain the file extension attributes of the target node from the object storage service node based on the attribute acquisition instruction.
[0528] Optionally, the attribute management module 1902 is further configured to: write the file extension attributes of the target node obtained from the object storage service node into the storage medium of the electronic device.
[0529] Optionally, the attribute management module 1902 is further configured to: receive a metadata acquisition instruction for instructing to acquire the metadata of the target node; acquire and return the target metadata of the target node based on the metadata acquisition instruction; the target metadata of the target node includes the file extension attributes of the target node.
[0530] Optionally, the attribute management module 1902 is specifically configured to: obtain the target metadata of the target node from the storage medium of the electronic device based on the metadata acquisition instruction.
[0531] Optionally, the attribute management module 1902 is specifically configured to: obtain the target metadata of the target node from the object storage service node based on the metadata acquisition instruction.
[0532] Optionally, the attribute management module 1902 is further configured to: receive a directory listing instruction for instructing to list the target directory; acquire and return the target metadata of the target directory based on the directory listing instruction; the target metadata of the target directory includes the file extension attributes of at least one file / sub-directory under the target directory.
[0533] Optionally, the attribute management module 1902 is specifically configured to: obtain the target metadata of the target directory from the storage medium of the electronic device based on the metadata acquisition instruction.
[0534] Optionally, the attribute management module 1902 is specifically configured to: obtain the target metadata of the target directory from the object storage service node based on the metadata acquisition instruction.
[0535] For the specific descriptions of the above optional methods, reference may be made to the foregoing method embodiments, which will not be elaborated herein. In addition, the explanations and beneficial effects of any of the above-provided file storage clients 1900 can be referred to the corresponding method embodiments above, and will not be elaborated.
[0536] Exemplarily, Figure 20FIG. shows a possible schematic structural diagram of the file extended attribute management device (denoted as file extended attribute management device 2000) involved in the above embodiments. The actions performed by the file extended attribute management device 2000 are implemented by an object storage service node (e.g., a computing device) or by a computing device executing corresponding software. The file extended attribute management device 2000 includes a receiving module 2001, a parsing module 2002, and a management module 2003. The receiving module 2001 is configured to receive an attribute setting request sent by a file storage client of an object storage system, where the format of the attribute setting request is determined according to a target interface provided by the object storage service node, and the attribute setting request is used to request setting a target file extended attribute of a target node to a target state, and the target state includes a configured state or an unconfigured state. For example, Figure 7 Step 701 shown. The parsing module 2002 is configured to parse the attribute setting request through the target interface to obtain the content requested by the attribute setting request. For example, Figure 7 Step 702 shown. The management module 2003 is configured to set the target file extended attribute of the target node to the target state based on the content requested by the attribute setting request. For example, Figure 7 Step 703 shown.
[0537] Optionally, when the target state is the configured state, the management module 2003 is specifically configured to: generate a target field of the target node based on the content requested by the attribute setting request; the target field of the target node is used to indicate that the target file extended attribute has been configured; and store the target field of the target node based on the identifier of the target node.
[0538] Optionally, when the target state is the unconfigured state, the management module 2003 is specifically configured to: delete the target field of the target node based on the content requested by the attribute setting request; the target field of the target node is used to indicate that the target file extended attribute has been configured.
[0539] Optionally, the object storage service node stores a target string, and the target string is used to indicate the state of the file extended attribute of the target node; the management module 2003 is specifically configured to: when the target state is the configured state, set a target bit of the target string to a first value based on the content requested by the attribute setting request; the target bit is used to indicate the target file extended attribute, and the first value is used to indicate the configured state; when the target state is the unconfigured state, set the target bit of the target string to a second value based on the content requested by the attribute setting request; the second value is used to indicate the unconfigured state.
[0540] Optionally, the attribute setting request includes a message content and an operation command. The message content is used to indicate the extended attributes of the target file, and the operation command is used to indicate the target status.
[0541] Optionally, the attribute setting request includes a message content, and the message content is used to indicate the extended attributes of the target file and the target status.
[0542] Optionally, the attribute setting request includes the value of the extended attributes of the target file; the management module 2003 is further configured to: based on the attribute setting request, determine the value of the extended attributes of the target file; when the value of the extended attributes of the target file is the same as the target value, based on the content requested by the attribute setting request, set the extended attributes of the target file of the target node to the target status; the target value is the value of the extended attributes of the target file in the Windows operating system.
[0543] Optionally, the management module 2003 is further configured to: when the value of the extended attributes of the target file is different from the target value, return a prompt message to the file storage client, and the prompt message is used to indicate that there is an error in the value of the extended attributes of the target file.
[0544] Optionally, the receiving module 2001 is further configured to: receive an attribute acquisition request sent by the file storage client, and the attribute acquisition request is used to request to acquire the extended attributes of the target node; the management module 2003 is configured to: based on the attribute acquisition request, return the extended attributes of the target node to the file storage client.
[0545] Optionally, the receiving module 2001 is further configured to: the object storage service node receives a metadata acquisition request sent by the file storage client, and the metadata acquisition request is used to request to acquire the metadata of the target node; the management module 200 is further configured to: based on the metadata acquisition request, return the target metadata of the target node to the file storage client; the target metadata of the target node includes the extended attributes of the target file.
[0546] Optionally, when the target node is the target directory, the receiving module 2001 is further configured to: receive a directory listing request sent by the file storage client, and the directory listing request is used to request to acquire the metadata of the target directory; the management module 200 is further configured to: based on the directory listing request, return the target metadata of the target directory to the file storage client; the target metadata of the target directory includes the extended attributes of at least one file / sub-directory under the target directory.
[0547] Optionally, the receiving module 2001 is further configured to: receive a deletion request sent by the file storage client, and the deletion request is used to request to delete the metadata of the target node; the management module 2003 is further configured to: based on the deletion request, delete the extended attributes of the target node.
[0548] For the specific description of the above optional manner, reference may be made to the foregoing method embodiments, which will not be elaborated herein. In addition, the explanations and beneficial effects of any of the above-provided file extension attribute management devices 2000 may be referred to the corresponding method embodiments above and will not be elaborated.
[0549] In the embodiments of the present application, the receiving module 2001, the parsing module 2002, and the management module 2003 can all be implemented by software or by hardware. Exemplarily, next, taking the parsing module 2002 as an example, the implementation manner of the parsing module 2002 will be introduced. Similarly, the implementation manners of the receiving module 2001 and the management module 2003 can refer to the implementation manner of the attribute parsing module 2002.
[0550] As an example of a software functional unit, the parsing module 2002 may include code running on a computing instance. Among them, the computing instance may include at least one of a physical host (computing device), a virtual machine, and a container. Further, the above computing instance may be one or more. For example, the parsing module 2002 may include code running on multiple hosts / virtual machines / containers. It should be noted that the multiple hosts / virtual machines / containers for running the code may be distributed in the same region or in different regions. Further, the multiple hosts / virtual machines / containers for running the code may be distributed in the same availability zone (AZ) or in different AZs, and each AZ includes one data center or multiple geographically close data centers. Among them, generally one region may include multiple AZs.
[0551] Similarly, the multiple hosts / virtual machines / containers for running the code may be distributed in the same virtual private cloud (VPC) or in multiple VPCs. Among them, generally one VPC is set within one region. For cross-region communication between two VPCs within the same region and between VPCs in different regions, a communication gateway needs to be set in each VPC, and the interconnection between VPCs is realized through the communication gateway.
[0552] As an example of a hardware functional unit, the parsing module 2002 may include at least one computing device, such as a server, etc. Alternatively, the parsing module 2002 may also be a device implemented using an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). Among them, the above PLD may be implemented by a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.
[0553] The multiple computing devices included in the parsing module 2002 may be distributed in the same region or in different regions. The multiple computing devices included in the parsing module 2002 may be distributed in the same availability zone (AZ) or in different AZs. Similarly, the multiple computing devices included in the parsing module 2002 may be distributed in the same virtual private cloud (VPC) or in multiple VPCs. Among them, the multiple computing devices may be any combination of computing devices such as servers, ASICs, PLDs, CPLDs, FPGAs, and GALs.
[0554] It should be noted that in other embodiments, the parsing module 2002 may be used to execute any step in the file extended attribute management method, the receiving module 2001 may be used to execute any step in the file extended attribute management method, and the management module 2003 may be used to execute any step in the file extended attribute management method. Alternatively, the steps implemented by the receiving module 2001, the parsing module 2002, and the management module 2003 may be specified as needed. The entire function of the file extended attribute management device is realized by the receiving module 2001, the parsing module 2002, and the management module 2003 respectively implementing different steps in the file extended attribute management method.
[0555] The embodiments of the present application also provide a computing device. As Figure 21 shown, the computing device 210 includes: a bus 212, a processor 214, a memory 216, and a communication interface 218. The processor 214, the memory 216, and the communication interface 218 communicate with each other through the bus 212. The computing device 210 may be a server or a terminal device. It should be understood that the present application does not limit the number of processors and memories in the computing device 210.
[0556] The bus 212 can be a peripheral component interconnect (PCI) bus, an extended industry standard architecture (EISA) bus, or the like. The bus can be divided into an address bus, a data bus, a control bus, etc. For the sake of convenience of representation, Figure 21 only one line is used to represent it in Figure 21 , but it does not mean that there is only one bus or one type of bus. The bus 212 can include a path for transmitting information between various components of the computing device 210 (for example, the memory 216, the processor 214, the communication interface 218).
[0557] The processor 214 can include any one or more of processors such as a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).
[0558] The memory 216 can include volatile memory, such as random access memory (RAM). The memory 216 can also include non-volatile memory, such as read-only memory (ROM), flash memory, a hard disk drive (HDD), or a solid state drive (SSD).
[0559] The executable program code is stored in the memory 216, and the processor 214 executes the executable program code to respectively implement the functions of the foregoing receiving module 2001, parsing module 2002, and management module 2003, thereby implementing the file extended attribute management method. That is, instructions for executing the file extended attribute management method are stored on the memory 216.
[0560] Alternatively, the executable program code is stored in the memory 216, and the processor 214 executes the executable program code to respectively implement the functions of the foregoing receiving module 2001, parsing module 2002, and management module 2003, thereby implementing a file extended attribute management method. That is, instructions for executing a file extended attribute management method are stored on the memory 216.
[0561] The communication interface 218 uses a transceiver module such as, but not limited to, a network interface card or a transceiver to implement communication between the computing device 210 and other devices or a communication network.
[0562] It should be noted that the computing device 210 can be a computing device in an object storage service node (as shown in Figure 1 , Figure 2 ).
[0563] The embodiment of the present application also provides a computing device cluster. The computing device cluster includes at least one computing device. The computing device can be a server, for example, a cloud server, a central server, an edge server, or a local server in a local data center. In some embodiments, the computing device can also be a terminal device such as a desktop computer, a laptop computer, or a smart phone.
[0564] As shown in Figure 22 , the computing device cluster 220 includes at least one computing device 210. The memories 216 in one or more of the computing devices 210 in the computing device cluster 220 can store the same instructions for executing the file extended attribute management method.
[0565] In some possible implementation manners, the memories 216 in one or more of the computing devices 210 in the computing device cluster 220 can also separately store partial instructions for executing the file extended attribute management method. In other words, a combination of one or more computing devices 210 can jointly execute the instructions for executing the file extended attribute management method.
[0566] It should be noted that the memories 216 in different computing devices 210 in the computing device cluster 220 can store different instructions, respectively for executing partial functions of the file extended attribute management apparatus 2000. That is, the instructions stored in the memories 216 in different computing devices 210 can implement the functions of one or more of the receiving module 2001, the parsing module 2002, and the management module 2003.
[0567] It should be noted that the computing device cluster 220 can be an object storage service node (as shown in Figure 1 , Figure 2 ) for providing cloud services for cloud service tenants. Figure 22 For the relevant descriptions of at least one computing device 210 in the shown computing device cluster, reference can be made to the relevant descriptions of the computing device shown in Figure 21 , which will not be elaborated here.
[0568] Next, an exemplary introduction to the connection manner of the computing device cluster will be given.
[0569] In one possible implementation manner, the computing device cluster (such as:Figure 22 One or more computing devices in the computing device cluster shown can be connected via a network. Among them, the network can be a wide area network or a local area network, etc. Figure 23 A possible implementation is shown. As Figure 23 shown, two computing devices (such as: computing device 210A and computing device 210B) are connected via a network. Specifically, they are connected to the network through the communication interfaces of each computing device. In this type of possible implementation, instructions for implementing the functions of the receiving module 2001 and the management module 2003 are stored in the memory 216 of the computing device 210A. At the same time, instructions for implementing the function of the parsing module 2002 are stored in the memory 216 of the computing device 210B.
[0570] Figure 23 The connection method between the computing device clusters shown can be considered that since the file extension attribute management method provided in this application requires high computing resources, it is therefore considered to hand over the functions implemented by the receiving module 2001 and the management module 2003 to the computing device 210A for execution, and hand over the function implemented by the parsing module 2002 to the computing device 210B for execution.
[0571] It should be understood that Figure 23 the functions of the computing device 210A shown can also be completed by multiple computing devices 210. Similarly, the functions of the computing device 210B can also be completed by multiple computing devices 210.
[0572] The embodiments of this application also provide another computing device cluster. The connection relationship between the computing devices in this computing device cluster can be similarly referred to the connection method of the Figure 21 computing device cluster shown. The difference is that the same instructions for implementing the file extension attribute management method can be stored in the memory 216 of one or more computing devices 210 in this computing device cluster.
[0573] In some possible implementation manners, partial instructions for implementing the file extension attribute management method can also be respectively stored in the memory 216 of one or more computing devices 210 in this computing device cluster. In other words, a combination of one or more computing devices 210 can jointly execute the instructions for implementing the file extension attribute management method.
[0574] The embodiments of this application also provide an electronic device. As Figure 24As shown in the figure, the electronic device 240 includes: a bus 242, a processor 244, a memory 246, and a communication interface 248. The processor 244, the memory 246, and the communication interface 248 communicate with each other via the bus 242. The electronic device 240 may be a server or a terminal device. It should be understood that the present application does not limit the number of processors and memories in the electronic device 240.
[0575] The memory 246 stores executable program codes, and the processor 244 executes the executable program codes to respectively implement the functions of the foregoing receiving module 1901, attribute management module 1902, sending module 1903, and attribute implementation module 1904, thereby implementing the file extended attribute management method. That is to say, the memory 246 stores instructions for executing the file extended attribute management method.
[0576] It should be noted that the electronic device 240 may be Figure 1 , Figure 2 the electronic device used by the cloud service tenant shown in the figure. For other relevant descriptions of the bus 242, the processor 244, the memory 246, and the communication interface 248 of the electronic device 240, reference may be made to the relevant descriptions of the computing device shown above Figure 21 and will not be elaborated here.
[0577] The embodiment of the present application further provides a computer program product. The computer program product may be a software or program product that includes computer programs / instructions and can run on an electronic device or be stored in any available medium. When the computer program product runs on at least one electronic device, at least one electronic device is caused to execute the file extended attribute management method.
[0578] The embodiment of the present application further provides a computer program product. The computer program product may be a software or program product that includes computer programs / instructions and can run on a computing device or be stored in any available medium. When the computer program product runs on at least one computing device, at least one computing device is caused to execute the file extended attribute management method.
[0579] The embodiment of the present application further provides a computer-readable storage medium. The computer-readable storage medium may be any available medium that can be stored by an electronic device or a data storage device such as a data center including one or more available media. The computer-readable storage medium includes computer programs / instructions, and the computer programs / instructions direct the electronic device to execute the file extended attribute management method.
[0580] The embodiments of the present application also provide a computer-readable storage medium. The computer-readable storage medium may be any available medium that can be stored by a computing device or a data storage device such as a data center including one or more available media. The computer-readable storage medium includes computer programs / instructions that direct the computing device to execute the file extension attribute management method.
[0581] Among them, the available medium may be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium (for example, a solid-state drive), etc.
[0582] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit them. Although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments or perform equivalent replacements for some of the technical features. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the protection scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for managing file extension attributes, characterized in that: The method is applied to a file storage client, the file storage client runs on a Windows operating system, the Windows operating system also provides a local file system, the directory tree of the local file system includes a target node, the target node is a file or a directory, and the file or directory is stored in an object storage service node; the method includes: receiving an attribute setting instruction, wherein the attribute setting instruction indicates setting a target file extension attribute of the target node to a target state; the target state includes a configured state or an unconfigured state; Determine a property setting request based on the property setting instruction and a target interface provided by the object storage service node; the target interface of the object storage service node is used to indicate a format of the property setting request, and the property setting request is used to request to set the target file extended attribute of the target node to the target state; The attribute setting request is sent to the object storage service node to request the object storage service node to set the target file extension attribute of the target node to the target state.
2. The method according to claim 1, characterized in that The attribute setting request includes a message content and an operation command, wherein the message content is used to indicate the extended attribute of the target file, and the operation command is used to indicate the target state; Alternatively, the attribute setting request includes message content, and the message content is used to indicate the target file extended attribute and the target status.
3. The method according to claim 1 or 2, characterized in that: The method further comprises: receiving a target instruction, wherein the target instruction is used to instruct to perform a target operation on a target node; the target operation is related to an extended attribute of the target file; Determining a permission check result of the target operation based on the state of the target file extension attribute; the permission check result includes passing the check or failing the check; In the case where the permission check result is failure to pass the check, response information is returned based on the target instruction; the response information is used to indicate a refusal to execute the target operation on the target node.
4. The method according to any one of claims 1 to 3, characterized in that In the case where the target node is the first file, the method further includes: Based on the attribute setting instruction, obtaining the first file; Performing the operation indicated by the attribute setting instruction on the first file to obtain a second file; A first storage request is sent to the object storage service node, where the first storage request is used to request storage of the second file; and the first storage request includes the second file.
5. The method according to any one of claims 1 to 4, characterized in that In the case where the target node is a third file, the method further includes: receiving a storage instruction, wherein the storage instruction is used to instruct to store a third file; the target file extension attribute of the third file is in a configured state; Performing the operation indicated by the target file extension attribute on the third file to obtain a fourth file; A second storage request is sent to the object storage service node, where the second storage request is used to request the object storage service node to store the fourth file; and the storage request includes the fourth file.
6. The method according to any one of claims 1 to 5, characterized in that The method further comprises: Receive an attribute acquisition instruction, where the attribute acquisition instruction is used to instruct to acquire a file extended attribute of the target node; Based on the attribute acquisition instruction, the file extended attribute of the target node is acquired and returned.
7. The method according to any one of claims 1 to 6, characterized in that The method further comprises: Receiving a metadata acquisition instruction, wherein the metadata acquisition instruction is used to instruct to acquire metadata of the target node; Based on the metadata acquisition instruction, the target metadata of the target node is acquired and returned; the target metadata of the target node includes the file extension attribute of the target node.
8. A method for managing file extension attributes, characterized in that: The method is applied to an object storage service node, the object storage service node stores a target object, and the object storage service node is used to map the target object to a target node on a directory tree, the target node is a file or a directory; the method includes: Receive a property setting request sent by a file storage client, wherein the format of the property setting request is determined according to a target interface provided by the object storage service node, and the property setting request is used to request setting a target file extended attribute of the target node to a target state, wherein the target state includes a configured state or an unconfigured state; Parsing the property setting request through the target interface to obtain the content requested by the property setting request; The target file extended attribute of the target node is set to the target state based on the content requested by the attribute setting request.
9. The method according to claim 8, characterized in that In a case where the target state is a configured state, setting the target file extended attribute of the target node to the target state based on the content requested by the attribute setting request includes: Generate a target field of the target node based on the content requested by the attribute setting request; the target field of the target node is used to indicate that the target file extended attribute has been configured; Based on the identifier of the target node, a target field of the target node is stored.
10. The method according to claim 8, characterized in that In a case where the target state is an unconfigured state, setting the target file extension attribute of the target node to the target state based on the content requested by the attribute setting request includes: Based on the content requested by the attribute setting request, the target field of the target node is deleted; the target field of the target node is used to indicate that the target file extended attribute has been configured.
11. The method according to claim 8, characterized in that The object storage service node stores a target string, where the target string is used to indicate a state of a file extension attribute of the target node; and setting the target file extension attribute of the target node to the target state based on the content requested by the attribute setting request includes: In the case where the target state is a configured state, based on the content requested by the attribute setting request, the target bit of the target character string is set to a first value; the target bit is used to indicate the target file extended attribute, and the first value is used to indicate the configured state; In the case where the target state is an unconfigured state, the target bit of the target character string is set to a second value based on the content requested by the attribute setting request; the second value is used to indicate an unconfigured state.
12. The method according to any one of claims 8 to 11, characterized in that The method further comprises: Receiving an attribute acquisition request sent by the file storage client, wherein the attribute acquisition request is used to request to acquire a file extended attribute of the target node; Based on the attribute acquisition request, the file extended attributes of the target node are returned to the file storage client.
13. The method according to any one of claims 8 to 12, characterized in that: The method further comprises: Receive a metadata acquisition request sent by the client, where the metadata acquisition request is used to request to acquire metadata of the target node; Based on the metadata acquisition request, target metadata of the target node is returned to the file storage client; the target metadata of the target node includes file extension attributes of the target node.
14. A file storage client, characterized in that: The file storage client comprises: A receiving module, configured to receive an attribute setting instruction, wherein the attribute setting instruction indicates setting a target file extension attribute of a target node to a target state, wherein the target state includes a configured state or an unconfigured state; the target node is a file or a directory, and the file or directory is stored in an object storage service node; an attribute management module, configured to determine an attribute setting request based on the attribute setting instruction and a target interface provided by the object storage service node; the interface provided by the object storage service node is used to indicate a format of the attribute setting request, and the attribute setting request is used to request setting an extended attribute of a target file of the target node to a target state; A sending module is used to send the attribute setting request to the object storage service node to request the object storage service node to set the target file extension attribute of the target node to the target state.
15. A file extension attribute management device, characterized in that: The file extension attribute management device is applied to an object storage service node, and the file extension attribute management device includes: A receiving module, configured to receive a property setting request sent by a file storage client, wherein the format of the property setting request is determined according to a target interface provided by the object storage service node, and the property setting request is used to request setting a target file extension attribute of a target node to a target state, wherein the target state includes a configured state or an unconfigured state; A parsing module, used for parsing the property setting request through the target interface to obtain the content requested by the property setting request; A management module is used to set the target file extension attribute of the target node to the target state based on the content requested by the attribute setting request.
16. A computer program product, characterized in that include: A computer program / instruction, which, when executed by a processor of an electronic device, implements the steps of the method according to any one of claims 1 to 7.
17. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program / instruction, and when the computer program / instruction is executed by a processor of an electronic device, the steps of the method according to any one of claims 1 to 7 are implemented.
18. A computing device cluster, characterized in that: include: at least one computing device, each computing device of the at least one computing device comprising a processor and a memory; Each computing device includes a processor, a memory, and a computer program / instruction stored in the memory; the processor executes the computer program / instruction to enable the computing device cluster to implement the steps of the method as described in any one of claims 8-13.
19. A computer program product, characterized in that include: A computer program / instruction which, when executed by a processor of a computing device, implements the steps of the method according to any one of claims 8 to 13.
20. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program / instruction, which, when executed by a processor of a computing device, implements the steps of the method according to any one of claims 8 to 13.