Network memory integrated snapshot service method, device, equipment and medium
By sending preset snapshot parameters and file handles to the network memory server, fine control of snapshot operations is achieved, and the problem of docking and development of NAS systems when utilizing the back-end file system snapshot function is solved, and the availability and flexibility of snapshot function is improved.
Patent Information
- Application Number
- CN202411744397.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-30
- Publication Date
- 2025-04-15
AI Technical Summary
When using the snapshot function of the backend file system, existing NAS systems need to conduct special docking and development for each backend file system, resulting in huge workload and poor versatility, making it difficult to adapt to the ever-changing and expanding storage environment.
By sending preset snapshot parameters to the network memory server, determining the permission set, identifying and accessing data through file handles, generating snapshot requests, so as to achieve fine control of snapshot operations and data security and compliance.
The integration process with the backend file system snapshot function is simplified, the availability and flexibility of the snapshot function of the NAS system is improved, real-time feedback and state tracking is achieved, and it is highly versatile and scalable.
Smart Images

Figure CN119829518A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of network storage, and in particular to a network storage integrated snapshot service method, device, equipment and medium. Background Art
[0002] With the rapid development of information technology, emerging technology fields such as big data processing and cloud computing services are rising, which has promoted a profound change in the way data is stored. In this technical context, distributed storage architecture is widely favored due to its high efficiency and scalability, and has become the mainstream choice in the field of data storage. In a distributed file storage system, data is organized, stored, and accessed in the form of files, providing users with flexible and convenient data management capabilities.
[0003] In order to further improve the efficiency and reliability of data management, the snapshot function has gradually become an indispensable part of distributed file storage systems. Snapshots can capture the state of the storage system at a specific point in time, allowing users to go back to that state when needed, thereby effectively dealing with risks such as data loss, damage or misoperation. However, due to the differences in snapshot implementation methods and subtle differences in functions of different file systems, it is challenging for NAS (Network Attached Storage) systems to directly use the snapshot function of the backend file system.
[0004] Traditionally, if a NAS system wants to use the snapshot function of the backend file system, it needs to carry out special docking development for each backend file system, such as developing a client to mount the snapshot volume, or building a web interface to implement snapshot management. This process is not only huge in workload, but also has poor versatility and is difficult to adapt to the ever-changing and expanding storage environment. Therefore, a universal NAS snapshot function docking solution is urgently needed to simplify the integration process with the backend file system snapshot function and improve the availability and flexibility of the NAS system snapshot function. Summary of the invention
[0005] In view of the above problems, embodiments of the present invention are proposed to provide a network storage integrated snapshot service method, apparatus, device and medium that overcome the above problems or at least partially solve the above problems.
[0006] In order to solve the above problems, an embodiment of the present invention discloses a network storage integrated snapshot service method, which is applied to a network storage client. The method includes:
[0007] Sending preset snapshot parameters to the network storage server, so that the storage server determines the permission set according to the snapshot parameters;
[0008] Get snapshot operation type; the snapshot operation type includes creating snapshot, deleting snapshot, and viewing snapshot;
[0009] Determining the data to be operated according to the snapshot operation type;
[0010] Generate a snapshot request corresponding to the snapshot operation type according to the snapshot operation type and the data to be operated;
[0011] Determining a file handle according to the snapshot request; the file handle is used to identify and access data;
[0012] Sending the file handle to the network storage server, so that the network storage server completes the corresponding operation and generates an operation receipt;
[0013] The operation receipt sent by the network storage server is received, and the snapshot operation is completed according to the operation receipt.
[0014] Optionally, the operation receipt includes: a success receipt and an error receipt, and the receiving of the operation receipt sent by the network storage server and completing the snapshot operation according to the operation receipt include:
[0015] When the operation receipt is a success receipt, receiving the success receipt sent by the network storage server, and completing the snapshot operation according to the operation receipt;
[0016] When the operation receipt is an error receipt, an error message is output to the user and the snapshot operation is terminated.
[0017] On the other hand, an embodiment of the present invention further discloses a network storage integrated snapshot service method, which is applied to a network storage service end, and the method includes:
[0018] Receiving preset snapshot parameters sent by a network storage client;
[0019] Determine a permission set according to the preset snapshot parameters; the permission set is used to determine whether the sender of the preset snapshot parameters has snapshot operation permission;
[0020] Receive a file handle sent by a network storage client;
[0021] Determine the snapshot operation type and the data to be operated according to the file handle;
[0022] According to the snapshot operation type, the data to be operated and the permission set, the corresponding operation is completed and an operation receipt is generated;
[0023] The operation receipt is sent to the network storage client, so that the network storage client completes the snapshot operation according to the operation receipt.
[0024] Optionally, the operation receipt includes: a success receipt and an error receipt, and the completing the corresponding operation and generating the operation receipt according to the snapshot operation type, the data to be operated and the permission set includes:
[0025] When there is no permission corresponding to the snapshot operation type in the permission set, the snapshot operation is rejected and an error receipt is generated;
[0026] When there is a permission corresponding to the snapshot operation type in the permission set, the snapshot operation is performed and a success receipt is generated.
[0027] On the other hand, the embodiment of the present invention further discloses a system for integrating snapshot services with a network storage, characterized in that the system comprises: a network storage client, a network storage server,
[0028] The network storage client is used to send preset snapshot parameters to the network storage server, so that the storage server determines the permission set according to the snapshot parameters; obtains the snapshot operation type; the snapshot operation type includes creating a snapshot, deleting a snapshot, and viewing a snapshot; determines the data to be operated according to the snapshot operation type; generates a snapshot request corresponding to the snapshot operation type according to the snapshot operation type and the data to be operated; determines a file handle according to the snapshot request; the file handle is used to identify and access data; sends the file handle to the network storage server, so that the network storage server completes the corresponding operation and generates an operation receipt; receives the operation receipt sent by the network storage server, and completes the snapshot operation according to the operation receipt;
[0029] The network storage service end is used to receive preset snapshot parameters sent by the network storage client; determine a permission set according to the preset snapshot parameters; the permission set is used to determine whether the sending of the preset snapshot parameters has snapshot operation permissions; receive a file handle sent by the network storage client; determine a snapshot operation type and data to be operated according to the file handle; complete a corresponding operation and generate an operation receipt according to the snapshot operation type, the data to be operated and the permission set; send the operation receipt to the network storage client, so that the network storage client completes the current snapshot operation according to the operation receipt;
[0030] Optionally, the operation receipt includes a success receipt and an error receipt, and the network storage client is used to receive the success receipt sent by the network storage server when the operation receipt is a success receipt, and complete the snapshot operation according to the operation receipt; when the operation receipt is an error receipt, output an error message to the user and end the snapshot operation;
[0031] The network storage server is used to reject the snapshot operation and generate an error receipt when there is no permission corresponding to the snapshot operation type in the permission set; when there is permission corresponding to the snapshot operation type in the permission set, execute the snapshot operation and generate a success receipt.
[0032] On the other hand, an embodiment of the present invention further discloses a device for integrating a network storage with a snapshot service, which is applied to a network storage client, and the device includes:
[0033] A snapshot parameter sending module, used to send preset snapshot parameters to the network storage server, so that the storage server determines the permission set according to the snapshot parameters;
[0034] A snapshot operation model module is used to obtain snapshot operation types; the snapshot operation types include creating a snapshot, deleting a snapshot, and viewing a snapshot;
[0035] A first to-be-operated data acquisition module, used to determine the to-be-operated data according to the snapshot operation type;
[0036] A snapshot request determination module, configured to generate a snapshot request corresponding to the snapshot operation type according to the snapshot operation type and the data to be operated;
[0037] A file handle determination module, used to determine a file handle according to the snapshot request; the file handle is used to identify and access data;
[0038] A file handle sending module, used for sending the file handle to the network storage server, so that the network storage server completes the corresponding operation and generates an operation receipt;
[0039] The operation receipt receiving module is used to receive the operation receipt sent by the network storage server and complete the snapshot operation according to the operation receipt.
[0040] Optionally, the operation receipt includes: a success receipt and an error receipt, and the operation receipt receiving module includes:
[0041] A successful operation submodule, for receiving a successful receipt sent by the network storage server when the operation receipt is a successful receipt, and completing the snapshot operation according to the operation receipt;
[0042] The error operation submodule is used to output an error message to the user and end the snapshot operation when the operation receipt is an error receipt.
[0043] On the other hand, an embodiment of the present invention further discloses a device for integrating snapshot services with a network storage, which is applied to a network storage service end, and the device includes:
[0044] The snapshot parameter receiving module is used to receive the preset snapshot parameters sent by the network storage client;
[0045] An operation permission determination module, used to determine a permission set according to the preset snapshot parameters; the permission set is used to determine whether the sending of the preset snapshot parameters has snapshot operation permission;
[0046] A file handle receiving module, used for receiving a file handle sent by a network storage client;
[0047] A second module for determining data to be operated, used for determining the snapshot operation type and the data to be operated according to the file handle;
[0048] An operation receipt generation module, used to complete the corresponding operation and generate an operation receipt according to the snapshot operation type, the data to be operated and the permission set;
[0049] The operation receipt sending module is used to send the operation receipt to the network storage client, so that the network storage client completes the snapshot operation according to the operation receipt.
[0050] Optionally, the operation receipt includes: a success receipt and an error receipt, and the operation receipt sending module includes:
[0051] An error receipt generation submodule, used to reject the snapshot operation and generate an error receipt when there is no permission corresponding to the snapshot operation type in the permission set;
[0052] The success receipt generation submodule is used to execute the snapshot operation and generate a success receipt when there is a permission corresponding to the snapshot operation type in the permission set.
[0053] Accordingly, an embodiment of the present invention discloses an electronic device, comprising: a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein the computer program implements the various steps of the above-mentioned network storage integrated snapshot service method embodiment when executed by the processor.
[0054] Accordingly, an embodiment of the present invention discloses a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, each step of the above-mentioned network storage integrated snapshot service method embodiment is implemented;
[0055] The embodiment of the present invention has the following advantages: by sending preset snapshot parameters to the network storage server and determining the permission set based on these parameters, fine control of snapshot operations is achieved, ensuring the security and compliance of data. By obtaining the snapshot operation type and determining the data to be operated according to the operation type, different snapshot management requirements can be flexibly responded to. Further, a corresponding snapshot request is generated according to the snapshot operation type and the data to be operated, and the data is identified and accessed through the file handle, which simplifies the complexity of data operations and improves the efficiency of snapshot operations. After sending the file handle to the network storage server, the server can quickly complete the corresponding operation and generate an operation receipt, realizing instant feedback and status tracking of the snapshot operation. In addition, the embodiment of the present invention also has a high degree of versatility and scalability, and can easily adapt to the snapshot function of different back-end file systems without the need for special docking development for each file system. This not only greatly reduces the workload, but also improves the versatility and ease of use of the snapshot function, so that the NAS system can more efficiently utilize the snapshot capability of the back-end file system and provide users with more stable and reliable data management services. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] Figure 1 It is a flowchart of a method for integrating snapshot services with network storage according to an embodiment of the present invention;
[0057] Figure 2 is a flowchart of another embodiment of a network storage integrated snapshot service method of the present invention;
[0058] Figure 3 It is a functional architecture diagram of an embodiment of a network storage integrated snapshot service method of the present invention;
[0059] Figure 4 It is a data structure diagram of an embodiment of a network storage integrated snapshot service method of the present invention;
[0060] Figure 5 It is a data encoding and decoding schematic diagram of an embodiment of a network storage integrated snapshot service method of the present invention;
[0061] Figure 6 It is a structural block diagram of an embodiment of a device for integrating snapshot service with network storage of the present invention;
[0062] Figure 7 It is a structural block diagram of another embodiment of a device for integrating snapshot services with a network storage according to the present invention. DETAILED DESCRIPTION
[0063] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0064] Snapshot service is a data protection technology that can capture the complete data state on a server or storage device at a specific point in time and save it to form a "snapshot" copy. This snapshot can help quickly restore to the state when the snapshot was created in the event of a system failure or data loss, thereby ensuring data integrity and business continuity. Snapshot services usually have agentless features. Some snapshot services, such as Alibaba Cloud Snapshot Service, use an agentless approach, without the need to install additional software on the target server; incremental snapshots: After creating the first full snapshot, subsequent snapshots usually only back up data blocks that have changed since the last snapshot, thereby saving storage space and improving backup efficiency; regular backup: The automatic snapshot function can be used to regularly back up data and retain it for a certain period of time to meet data recovery and compliance requirements. Snapshots can be used in related technical fields such as data recovery, development and test environment construction, and custom image production.
[0065] NAS (Network Attached Storage) is a network device dedicated to data storage. It is connected to computers or other devices through the network to provide file sharing and data storage services. NAS usually has the characteristics of centralized data management, cross-platform file sharing, plug-and-play, and has the advantages of low cost, high efficiency, high scalability and high security.
[0066] One of the core concepts of the embodiment of the present invention is to use parameterized permission control and the file handle of the network storage to realize the snapshot service integration without writing additional interfaces.
[0067] Reference Figure 1 , shows a flow chart of the steps of an embodiment 1 of the XX method of the present invention, which may specifically include the following steps:
[0068] Step 101, sending preset snapshot parameters to a network storage server, so that the storage server determines a permission set according to the snapshot parameters;
[0069] The client sends a series of preset snapshot parameters to the NAS server, which are used by the server to identify and verify the user's permissions and determine the specific parameters of subsequent snapshot operations.
[0070] In one example, the snapshot parameters may be P = {p1, p2, p3, ..., p n}, p n Indicates a parameter, and n indicates the parameter number. One parameter is the access key, and other parameters may be snapshot names, snapshot descriptions, associated files or directories, etc. The definition of parameters may be adjusted according to business needs, and the embodiment of the present invention does not limit this.
[0071] After receiving the parameters, the server first parses the access key and generates a permission set based on the key. This permission set clearly defines the types of snapshot operations that the client can perform, including creating snapshots, deleting snapshots, reading snapshot lists, and reading snapshot file contents. In particular, the delete snapshot permission only allows the deletion of specific snapshot records, but does not allow the deletion of files or contents under the snapshot, nor does it allow the modification of file contents under the snapshot. All files and directories under the snapshot are read-only.
[0072] Step 102, obtaining a snapshot operation type; the snapshot operation type includes creating a snapshot, deleting a snapshot, and viewing a snapshot;
[0073] Determine the specific snapshot operation type that the user wants to perform. Operation types include creating a snapshot, deleting a snapshot, and viewing a snapshot, which means reading a snapshot list or snapshot file contents;
[0074] Step 103, determining the data to be operated according to the snapshot operation type;
[0075] Depending on the snapshot operation type selected by the user, the client needs to specify which data will be the target of the operation.
[0076] In one example, if the user chooses to create a snapshot, the data to be operated is the file or directory for which the user wants to create a snapshot; if the user chooses to delete the snapshot, the data to be operated is the snapshot ID that the user wants to delete.
[0077] Step 104, generating a snapshot request corresponding to the snapshot operation type according to the snapshot operation type and the data to be operated;
[0078] The client constructs a specific snapshot request based on the previously determined operation type and the data to be operated, so as to send it to the NAS server for execution.
[0079] In one example, the request includes the operation type, a unique identifier of the data to be operated such as a file path, a snapshot ID, and possible other parameters such as a snapshot name, a description, etc. This request is the basis for subsequent server-side operations.
[0080] Step 105, determining a file handle according to the snapshot request; the file handle is used to identify and access data;
[0081] To perform a snapshot operation, the client needs to generate a file handle (NFH), which is a unique identifier for subsequent access and operation of data.
[0082] In one example, the file handle is generated by a specific encoding and decoding technology, which includes snapshot information of the file, such as inode ID, snapshot ID, and private data. This information is encoded into NFH for use in subsequent operations.
[0083] A file handle is a data structure used in the operating system to access files; a file handle is a unique identifier used by the operating system for processes to identify and access files. When a file is opened, the operating system creates a handle for the file and returns it to the program for operations such as reading and writing, and controlling the file pointer. The file handle allows programs to operate files through a simple identifier without knowing the actual location of the file in the storage system or other detailed information. It hides the complexity of file operations and provides effective management of file resources. In most operating systems, a file handle is usually represented as an integer or pointer. This value or pointer is maintained internally by the operating system to identify the open file. The file handle usually contains all the necessary information related to the file, such as the physical location on the disk, permission information, current read and write position, etc. This information is crucial for the operating system to perform file operations.
[0084] Step 106, sending the file handle to the network storage server, so that the network storage server completes the corresponding operation and generates an operation receipt;
[0085] The client sends the generated NFH to the NAS server so that the server can decode and obtain the snapshot information and then perform the requested snapshot operation. After receiving the NFH, the server first decodes the snapshot information and then performs the corresponding snapshot operation based on the information, such as creating, deleting or reading the snapshot and generating the corresponding operation receipt.
[0086] Step 107: receiving the operation receipt sent by the network storage server, and completing the snapshot operation according to the operation receipt.
[0087] The client receives the result returned by the server after performing the operation to understand whether the operation was successful and any errors that may have occurred.
[0088] In one embodiment, the operation receipt includes: a success receipt and an error receipt, and step 108 includes the following sub-steps:
[0089] Sub-step S11, when the operation receipt is a success receipt, receiving the success receipt sent by the network storage server, and completing the snapshot operation according to the operation receipt;
[0090] If the operation receipt is a success receipt, it means that the server has successfully executed the requested snapshot operation. The client can update the local status or display a success message to the user based on the information in the receipt.
[0091] Sub-step S12: when the operation receipt is an error receipt, an error message is output to the user, and the snapshot operation is terminated.
[0092] If the operation receipt is an error receipt, it means that the server encountered an error when performing the operation. The client needs to parse the error information in the receipt and display the corresponding error message to the user.
[0093] The success receipt indicates that the server has successfully executed the client's request. The client can use this to confirm the success of the operation and perform subsequent processing, and provide timely feedback on the operation results to improve user experience and satisfaction.
[0094] When the operation receipt is an error receipt, an error message is output to the user, and the snapshot operation is terminated. The error receipt provides the reason for the operation failure, and the client can perform error processing based on it, such as retrying, prompting the user to check parameters, etc. When the operation fails, the operation is terminated in time to avoid unnecessary waste of resources and time.
[0095] By sending preset snapshot parameters to the network storage server and determining the permission set based on these parameters, fine control of snapshot operations is achieved, ensuring data security and compliance. By obtaining the snapshot operation type and determining the data to be operated according to the operation type, different snapshot management requirements can be flexibly responded to. Furthermore, a corresponding snapshot request is generated according to the snapshot operation type and the data to be operated, and the data is identified and accessed through the file handle, which simplifies the complexity of data operations and improves the efficiency of snapshot operations. After sending the file handle to the network storage server, the server can quickly complete the corresponding operation and generate an operation receipt, realizing instant feedback and status tracking of the snapshot operation. In addition, the embodiment of the present invention also has a high degree of versatility and scalability. It designs a universal NAS snapshot function docking mechanism that can easily adapt to the snapshot functions of different back-end file systems without the need for special docking development for each file system. This not only greatly reduces the workload, but also improves the versatility and ease of use of the snapshot function, so that the NAS system can more efficiently utilize the snapshot capabilities of the back-end file system and provide users with more stable and reliable data management services.
[0096] Reference Figure 2 , shows a flow chart of the steps of Embodiment 2 of a network storage integrated snapshot service method of the present invention, which may specifically include the following steps:
[0097] Step 201, receiving preset snapshot parameters sent by a network storage client;
[0098] The server first receives the preset snapshot parameters from the client. These parameters usually include access keys, user IDs, session IDs, or other information used for identity authentication and permission checks. After receiving them, the server will parse the received parameters and prepare for subsequent identity authentication and permission checks.
[0099] In one example, the snapshot parameters may be P = {p1, p2, p3, ..., p n}, p n Indicates a parameter, and n indicates the parameter number. One parameter is the access key, and other parameters may be snapshot names, snapshot descriptions, associated files or directories, etc. The definition of parameters may be adjusted according to business needs, and the embodiment of the present invention does not limit this.
[0100] Step 202, determining a permission set according to the preset snapshot parameters; the permission set is used to determine whether the sender of the preset snapshot parameters has snapshot operation permissions;
[0101] The server generates a permission set based on the received preset snapshot parameters, especially the access key. This permission set defines the types of snapshot operations that the client can perform, such as creating snapshots, deleting snapshots, reading snapshot lists, reading snapshot file contents, etc. In particular, the delete snapshot permission only allows the deletion of specific snapshot records, but does not allow the modification or deletion of file contents under the snapshot.
[0102] In one example, the server may determine the permission set of the client according to the access key by querying an internal permission database or an access control list.
[0103] Step 203, receiving a file handle sent by the network storage client;
[0104] The server receives the file handle generated by the client after determining the type of snapshot operation to be performed and the data to be operated; after receiving the file handle, the server parses the file handle and prepares for subsequent snapshot operations.
[0105] Step 204, determining the snapshot operation type and the data to be operated according to the file handle;
[0106] The server determines the type of snapshot operation that the client wants to perform and the data to be operated based on the parsed file handle.
[0107] Step 205, completing the corresponding operation and generating an operation receipt according to the snapshot operation type, the data to be operated and the permission set;
[0108] The server performs the corresponding snapshot operation according to the determined operation type, data to be operated and permission set, and generates an operation receipt.
[0109] In one example, the process may be that the server first checks the permission set to ensure that the client has the permission to perform the operation. If the client has the permission, the server performs the corresponding snapshot operation (such as creating a snapshot, deleting a snapshot, etc.). After the operation is completed, the server generates an operation receipt, which includes the operation result and related information.
[0110] Step 206, sending the operation receipt to the network storage client, so that the network storage client completes the snapshot operation according to the operation receipt;
[0111] The server sends the operation receipt to the client so that the client can understand the operation result based on the receipt and complete the snapshot operation.
[0112] In one embodiment, the operation receipt includes: a success receipt and an error receipt, and step 206 includes the following sub-steps:
[0113] Sub-step S21, when there is no permission corresponding to the snapshot operation type in the permission set, rejecting the snapshot operation and generating an error receipt;
[0114] If there is no permission corresponding to the snapshot operation type in the permission set, the server rejects the snapshot operation and generates an error receipt to send to the client. The error receipt contains an error code and error information so that the client can understand the reason for the rejection.
[0115] Sub-step S22: When there is a permission corresponding to the snapshot operation type in the permission set, the snapshot operation is performed and a success receipt is generated.
[0116] If there is a permission corresponding to the snapshot operation type in the permission set, the server performs the snapshot operation and generates a success receipt to send to the client. The success receipt usually contains confirmation information and related data of the successful operation. By rejecting unauthorized operations, the server effectively prevents illegal access and abuse of permissions. The error receipt can provide the client with clear error information to help the client understand the reason for the rejection and make corresponding adjustments. In the case of legal permissions, the server will perform the snapshot operation to ensure that the client's needs are met. The success receipt can provide the client with confirmation information of the successful operation, so that the client can be sure that the operation has been successfully completed.
[0117] By sending preset snapshot parameters to the network storage server and determining the permission set based on these parameters, fine control of snapshot operations is achieved, ensuring data security and compliance. By obtaining the snapshot operation type and determining the data to be operated according to the operation type, different snapshot management requirements can be flexibly responded to. Furthermore, a corresponding snapshot request is generated according to the snapshot operation type and the data to be operated, and the data is identified and accessed through the file handle, which simplifies the complexity of data operations and improves the efficiency of snapshot operations. After sending the file handle to the network storage server, the server can quickly complete the corresponding operation and generate an operation receipt, realizing instant feedback and status tracking of the snapshot operation. In addition, the embodiment of the present invention also has a high degree of versatility and scalability. It designs a universal NAS snapshot function docking mechanism that can easily adapt to the snapshot functions of different back-end file systems without the need for special docking development for each file system. This not only greatly reduces the workload, but also improves the versatility and ease of use of the snapshot function, so that the NAS system can more efficiently utilize the snapshot capabilities of the back-end file system and provide users with more stable and reliable data management services.
[0118] Reference Figure 3 , showing a functional architecture diagram of an embodiment of a network storage integrated snapshot service method of the present invention;
[0119] When the NAS client starts the snapshot function, it first sends a request to the NAS server, indicating its intention to perform a snapshot operation on the stored data. After receiving this request, the NAS server will perform a series of checks and processing.
[0120] First, the server checks whether a file has been specified for the first open;
[0121] If it is the first time to open the specified file, the system may obtain the information carried in the snapshot request, parse the directory items in the information, and generate a NFH based on the directory items to store the key information in the NAS server; if it is not the first time to open the file, check whether there is information indicating the snapshot in the NFH. If so, the snapshot information is processed and forwarded to the NAS server. The server determines whether the initiator of this operation has sufficient authority to operate. If so, the snapshot operation is performed normally; if not, an error is returned to the NAS client that initiated this operation;
[0122] If the NAS client initiates a snapshot request operation, the NAS server will execute the process of forwarding this request to the back-end file system; first, it decodes the NFH information to determine the snapshot operation type and the data to be processed, and further determines whether the initiator of this request has the corresponding snapshot processing authority. If so, the decoded information and request will be forwarded to the back-end file system for corresponding snapshot processing. If there is no corresponding authority, an error will be returned to the NAS client.
[0123] Reference Figure 4 , showing a data structure diagram of an embodiment of a network storage integrated snapshot service method of the present invention;
[0124] In this embodiment, when a user initiates a file operation instruction through the NAS client, if it is the first time to open the file, the NAS server will generate a network file handle (NFH). This NFH is generated by encoding inoid, snapshot and private data. In this way, every time a user accesses a file, the system can quickly obtain the file's inode information, the information of the snapshot to which it belongs, and any additional specific information by parsing the NFH, thereby achieving correct access and management of the file;
[0125] Among them, inoid is the abbreviation of "inode ID", which represents the unique identifier of inode. In the file system, inode is a structure that stores file metadata; snapshot is the abbreviation of "snapshot ID", which represents the unique identifier of snapshot; in the file system, a snapshot is a complete copy of the file system at a certain moment; private data refers to additional information related to a specific file or snapshot, which is not covered by the common metadata of the file system (such as inode information). This mechanism improves the efficiency of file access while ensuring the flexibility and scalability of the file system.
[0126] Reference Figure 5 , showing a schematic diagram of data encoding and decoding of an embodiment of a network storage integrated snapshot service method of the present invention;
[0127] In this embodiment, NFH is used as a form of encoding, which includes file information and snapshot information inoid, snapshot, and private data of the file. The decoding process is the inverse operation of this encoding, which converts NFH back to the original snapshot information. This encoding and decoding technology can be a custom encoding technology based on business requirements, a bit operation combined with hash verification, and other technologies.
[0128] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.
[0129] Reference Figure 6 , shows a structural block diagram of an embodiment of a device for integrating snapshot services with a network storage of the present invention, which may specifically include the following modules:
[0130] The snapshot parameter sending module 301 is used to send preset snapshot parameters to the network storage server, so that the storage server determines the permission set according to the snapshot parameters;
[0131] The snapshot operation model module 302 is used to obtain the snapshot operation type; the snapshot operation type includes creating a snapshot, deleting a snapshot, and viewing a snapshot;
[0132] A first to-be-operated data acquisition module 303, used to determine the to-be-operated data according to the snapshot operation type;
[0133] A snapshot request determination module 304, configured to generate a snapshot request corresponding to the snapshot operation type according to the snapshot operation type and the data to be operated;
[0134] A file handle determination module 305 is used to determine a file handle according to the snapshot request; the file handle is used to identify and access data;
[0135] A file handle sending module 306, configured to send the file handle to the network storage server, so that the network storage server completes the corresponding operation and generates an operation receipt;
[0136] The operation receipt receiving module 307 is used to receive the operation receipt sent by the network storage server and complete the snapshot operation according to the operation receipt.
[0137] In one embodiment, the operation receipt includes: a success receipt and an error receipt, and the operation receipt receiving module includes:
[0138] A successful operation submodule, for receiving a successful receipt sent by the network storage server when the operation receipt is a successful receipt, and completing the snapshot operation according to the operation receipt;
[0139] The error operation submodule is used to output an error message to the user and end the snapshot operation when the operation receipt is an error receipt.
[0140] By sending preset snapshot parameters to the network storage server and determining the permission set based on these parameters, fine control of snapshot operations is achieved, ensuring data security and compliance. By obtaining the snapshot operation type and determining the data to be operated according to the operation type, different snapshot management requirements can be flexibly responded to. Furthermore, a corresponding snapshot request is generated according to the snapshot operation type and the data to be operated, and the data is identified and accessed through the file handle, which simplifies the complexity of data operations and improves the efficiency of snapshot operations. After sending the file handle to the network storage server, the server can quickly complete the corresponding operation and generate an operation receipt, realizing instant feedback and status tracking of the snapshot operation. In addition, the embodiment of the present invention also has a high degree of versatility and scalability. It designs a universal NAS snapshot function docking mechanism that can easily adapt to the snapshot functions of different back-end file systems without the need for special docking development for each file system. This not only greatly reduces the workload, but also improves the versatility and ease of use of the snapshot function, so that the NAS system can more efficiently utilize the snapshot capabilities of the back-end file system and provide users with more stable and reliable data management services.
[0141] Reference Figure 7 , shows a structural block diagram of another embodiment of a device for integrating snapshot services with a network storage of the present invention, which may specifically include the following modules:
[0142] The snapshot parameter receiving module 401 is used to receive the preset snapshot parameters sent by the network storage client;
[0143] An operation permission determination module 402 is used to determine a permission set according to the preset snapshot parameters; the permission set is used to determine whether the sending of the preset snapshot parameters has snapshot operation permission;
[0144] The file handle receiving module 403 is used to receive the file handle sent by the network storage client;
[0145] A second to-be-operated data determining module 404, configured to determine the snapshot operation type and the to-be-operated data according to the file handle;
[0146] An operation receipt generating module 405, configured to complete a corresponding operation and generate an operation receipt according to the snapshot operation type, the data to be operated and the permission set;
[0147] The operation receipt sending module 406 is used to send the operation receipt to the network storage client, so that the network storage client completes the snapshot operation according to the operation receipt.
[0148] In one embodiment, the operation receipt includes: a success receipt and an error receipt, and the operation receipt sending module includes:
[0149] An error receipt generation submodule, used to reject the snapshot operation and generate an error receipt when there is no permission corresponding to the snapshot operation type in the permission set;
[0150] The success receipt generation submodule is used to execute the snapshot operation and generate a success receipt when there is a permission corresponding to the snapshot operation type in the permission set.
[0151] By sending preset snapshot parameters to the network storage server and determining the permission set based on these parameters, fine control of snapshot operations is achieved, ensuring data security and compliance. By obtaining the snapshot operation type and determining the data to be operated according to the operation type, different snapshot management requirements can be flexibly responded to. Furthermore, a corresponding snapshot request is generated according to the snapshot operation type and the data to be operated, and the data is identified and accessed through the file handle, which simplifies the complexity of data operations and improves the efficiency of snapshot operations. After sending the file handle to the network storage server, the server can quickly complete the corresponding operation and generate an operation receipt, realizing instant feedback and status tracking of the snapshot operation. In addition, the embodiment of the present invention also has a high degree of versatility and scalability. It designs a universal NAS snapshot function docking mechanism that can easily adapt to the snapshot functions of different back-end file systems without the need for special docking development for each file system. This not only greatly reduces the workload, but also improves the versatility and ease of use of the snapshot function, so that the NAS system can more efficiently utilize the snapshot capabilities of the back-end file system and provide users with more stable and reliable data management services.
[0152] On the other hand, the present invention also provides a system for integrating snapshot services with a network storage, characterized in that the system comprises: a network storage client, a network storage server,
[0153] The network storage client is used to send preset snapshot parameters to the network storage server, so that the storage server determines the permission set according to the snapshot parameters; obtains the snapshot operation type; the snapshot operation type includes creating a snapshot, deleting a snapshot, and viewing a snapshot; determines the data to be operated according to the snapshot operation type; generates a snapshot request corresponding to the snapshot operation type according to the snapshot operation type and the data to be operated; determines a file handle according to the snapshot request; the file handle is used to identify and access data; sends the file handle to the network storage server, so that the network storage server completes the corresponding operation and generates an operation receipt; receives the operation receipt sent by the network storage server, and completes the snapshot operation according to the operation receipt;
[0154] The network storage service end is used to receive preset snapshot parameters sent by the network storage client; determine a permission set according to the preset snapshot parameters; the permission set is used to determine whether the sending of the preset snapshot parameters has snapshot operation permissions; receive a file handle sent by the network storage client; determine a snapshot operation type and data to be operated according to the file handle; complete a corresponding operation and generate an operation receipt according to the snapshot operation type, the data to be operated and the permission set; send the operation receipt to the network storage client, so that the network storage client completes the current snapshot operation according to the operation receipt;
[0155] In one embodiment, the operation receipt includes a success receipt and an error receipt, and the network storage client is used to receive the success receipt sent by the network storage server when the operation receipt is a success receipt, and complete the current snapshot operation according to the operation receipt; when the operation receipt is an error receipt, output an error message to the user and end the current snapshot operation;
[0156] The network storage server is used to reject the snapshot operation and generate an error receipt when there is no permission corresponding to the snapshot operation type in the permission set; when there is permission corresponding to the snapshot operation type in the permission set, execute the snapshot operation and generate a success receipt.
[0157] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0158] An embodiment of the present invention further provides an electronic device, including:
[0159] The invention comprises a processor, a memory and a computer program stored in the memory and capable of running on the processor. When the computer program is executed by the processor, each process of the above-mentioned network storage integrated snapshot service method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.
[0160] An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, each process of the above-mentioned network storage integrated snapshot service method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0161] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0162] It will be appreciated by those skilled in the art that the embodiments of the present invention may be provided as methods, devices, or computer program products. Therefore, the embodiments of the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0163] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0164] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0165] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0166] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.
[0167] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.
[0168] The above is a detailed introduction to a network storage integrated snapshot service method, device, equipment and medium provided by the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method and core idea of the present invention. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as limiting the present invention.
Claims
1. A network storage integrated snapshot service method, characterized in that: Applied to a network storage client, the method comprises: Sending preset snapshot parameters to the network storage server, so that the storage server determines the permission set according to the snapshot parameters; Get snapshot operation type; the snapshot operation type includes creating snapshot, deleting snapshot, and viewing snapshot; Determining the data to be operated according to the snapshot operation type; Generate a snapshot request corresponding to the snapshot operation type according to the snapshot operation type and the data to be operated; Determining a file handle according to the snapshot request; the file handle is used to identify and access data; Sending the file handle to the network storage server, so that the network storage server completes the corresponding operation and generates an operation receipt; The operation receipt sent by the network storage server is received, and the snapshot operation is completed according to the operation receipt.
2. The method according to claim 1, characterized in that The operation receipt includes: a success receipt and an error receipt, and the receiving of the operation receipt sent by the network storage server and the completion of the snapshot operation according to the operation receipt include: When the operation receipt is a success receipt, receiving the success receipt sent by the network storage server, and completing the snapshot operation according to the operation receipt; When the operation receipt is an error receipt, an error message is output to the user and the snapshot operation is terminated.
3. A network storage integrated snapshot service method, characterized in that: Applied to a network storage server, the method comprises: Receiving preset snapshot parameters sent by a network storage client; Determine a permission set according to the preset snapshot parameters; the permission set is used to determine whether the sender of the preset snapshot parameters has snapshot operation permission; Receive a file handle sent by a network storage client; Determine the snapshot operation type and the data to be operated according to the file handle; According to the snapshot operation type, the data to be operated and the permission set, the corresponding operation is completed and an operation receipt is generated; The operation receipt is sent to the network storage client, so that the network storage client completes the snapshot operation according to the operation receipt.
4. The method according to claim 3, characterized in that The operation receipt includes: a success receipt and an error receipt. The corresponding operation is completed and the operation receipt is generated according to the snapshot operation type, the data to be operated and the permission set, including: When there is no permission corresponding to the snapshot operation type in the permission set, the snapshot operation is rejected and an error receipt is generated; When there is a permission corresponding to the snapshot operation type in the permission set, the snapshot operation is performed and a success receipt is generated.
5. A system for integrating snapshot services with a network storage, characterized in that: The system comprises: a network storage client, a network storage server, The network storage client is used to send preset snapshot parameters to the network storage server, so that the storage server determines the permission set according to the snapshot parameters; obtains the snapshot operation type; the snapshot operation type includes creating a snapshot, deleting a snapshot, and viewing a snapshot; determines the data to be operated according to the snapshot operation type; generates a snapshot request corresponding to the snapshot operation type according to the snapshot operation type and the data to be operated; determines a file handle according to the snapshot request; the file handle is used to identify and access data; sends the file handle to the network storage server, so that the network storage server completes the corresponding operation and generates an operation receipt; receives the operation receipt sent by the network storage server, and completes the snapshot operation according to the operation receipt; The network storage server is used to receive preset snapshot parameters sent by the network storage client; determine a permission set based on the preset snapshot parameters; the permission set is used to determine whether the sending of the preset snapshot parameters has snapshot operation permissions; receive a file handle sent by the network storage client; determine a snapshot operation type and data to be operated based on the file handle; complete a corresponding operation and generate an operation receipt based on the snapshot operation type, the data to be operated and the permission set; send the operation receipt to the network storage client, so that the network storage client completes the snapshot operation according to the operation receipt.
6. The system according to claim 5, characterized in that The operation receipt includes a success receipt and an error receipt. The network storage client is used to receive the success receipt sent by the network storage server when the operation receipt is a success receipt, and complete the current snapshot operation according to the operation receipt; when the operation receipt is an error receipt, output an error message to the user and end the current snapshot operation; The network storage server is used to reject the snapshot operation and generate an error receipt when there is no permission corresponding to the snapshot operation type in the permission set; when there is permission corresponding to the snapshot operation type in the permission set, execute the snapshot operation and generate a success receipt.
7. A device for integrating snapshot service with network storage, characterized in that: Applied to a network storage client, the device comprises: A snapshot parameter sending module, used to send preset snapshot parameters to the network storage server, so that the storage server determines the permission set according to the snapshot parameters; A snapshot operation model module is used to obtain snapshot operation types; the snapshot operation types include creating a snapshot, deleting a snapshot, and viewing a snapshot; A first to-be-operated data acquisition module, used to determine the to-be-operated data according to the snapshot operation type; A snapshot request determination module, configured to generate a snapshot request corresponding to the snapshot operation type according to the snapshot operation type and the data to be operated; A file handle determination module, used to determine a file handle according to the snapshot request; the file handle is used to identify and access data; A file handle sending module, used for sending the file handle to the network storage server, so that the network storage server completes the corresponding operation and generates an operation receipt; The operation receipt receiving module is used to receive the operation receipt sent by the network storage server and complete the snapshot operation according to the operation receipt.
8. A device for integrating snapshot service with network storage, characterized in that: Applied to a network storage server, the device comprises: The snapshot parameter receiving module is used to receive the preset snapshot parameters sent by the network storage client; An operation permission determination module, used to determine a permission set according to the preset snapshot parameters; the permission set is used to determine whether the sending of the preset snapshot parameters has snapshot operation permission; A file handle receiving module, used for receiving a file handle sent by a network storage client; A second module for determining data to be operated, used for determining the snapshot operation type and the data to be operated according to the file handle; An operation receipt generation module, used to complete the corresponding operation and generate an operation receipt according to the snapshot operation type, the data to be operated and the permission set; The operation receipt sending module is used to send the operation receipt to the network storage client, so that the network storage client completes the snapshot operation according to the operation receipt.
9. An electronic device, characterized in that: include: A processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein when the computer program is executed by the processor, the steps of the network storage integrated snapshot service method as described in any one of claims 1-2 or 3-4 are implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the network storage integrated snapshot service method as described in any one of claims 1-2 or 3-4 are implemented.