CN114385091B - Method and device for realizing network disk drive character, network disk and storage medium - Google Patents
Method and device for realizing network disk drive character, network disk and storage medium Download PDFInfo
- Publication number
- CN114385091B CN114385091B CN202210292529.XA CN202210292529A CN114385091B CN 114385091 B CN114385091 B CN 114385091B CN 202210292529 A CN202210292529 A CN 202210292529A CN 114385091 B CN114385091 B CN 114385091B
- Authority
- CN
- China
- Prior art keywords
- file
- client
- handle
- network disk
- request
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0628—Interfaces specially adapted for storage systems making use of a particular technique
- G06F3/0662—Virtualisation aspects
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0602—Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0602—Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
- G06F3/0608—Saving storage space on storage systems
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0628—Interfaces specially adapted for storage systems making use of a particular technique
- G06F3/0638—Organizing or formatting or addressing of data
- G06F3/0643—Management of files
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0668—Interfaces specially adapted for storage systems adopting a particular infrastructure
- G06F3/067—Distributed or networked storage systems, e.g. storage area networks [SAN], network attached storage [NAS]
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Human Computer Interaction (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The embodiment of the invention discloses a method, a device, a terminal and a storage medium for realizing a network disk drive letter. Wherein the method comprises the following steps: providing a mount port to a client, and receiving a network disk mount directory request from the mount port, where the mount directory request includes: a file directory path; reading a folder corresponding to the file directory path from a storage system, and reading all files in the folder into an internal memory; and returning a handle corresponding to the folder to a client so that the client associates the handle label with the created virtual drive letter. The folder designated by the user in the network disk can be mounted as the local virtual disk identifier of the user. The network disk system does not need to process the files stored in the distributed storage system aiming at different file sharing protocols supported by the client, so that the consumption of network disk resources is reduced.
Description
Technical Field
The embodiment of the invention relates to the technical field of network disks, in particular to a method and a device for realizing a network disk signature, a network disk and a storage medium.
Background
The network disk is an online storage service released by internet companies. The network disk system machine room divides a certain disk space for users, provides file management functions such as storage, access, backup and sharing of files for the users free or charged, and has high-level disaster recovery backup in all parts of the world. The user can see the network disk as a hard disk or a U disk placed on a network, whether in home, a unit or anywhere else, and can realize management and editing of files in the network disk as long as the network disk is connected to the Internet. The device is not required to be carried about and is not afraid of loss.
Usually, the network disk provides network disk services for users by adopting a web page login mode. And part of users also obtain the network disk service by using a mode of mounting the file directory shared by the network disk by using the local virtual disk identifier. Compared with a web page mode, the method is more flexible and closer to a user using mode. Is widely popular among users.
In the process of implementing the invention, the inventor finds the following technical problems: since the mounted directory is seen in the operating system after mounting without distinction from the ordinary directory, the business system uses the directory to access the file, and the actual operation is the file in the network disk. Different operating systems correspond to different network protocols, for example: SMB (Server Message Block), NFS (Network File System), CIFS (Common Internet File System), and the like. Correspondingly, the network disk needs to set a corresponding storage system for each network protocol to support service systems corresponding to different network protocols. However, for the distributed storage system generally adopted at present, it is difficult for the file storage management system adopted at present to support all network protocols, and the adaptability of using the drive letter as a network drive entry is affected.
Disclosure of Invention
Embodiments of the present invention provide a method and an apparatus for implementing a network disk drive letter, a network disk, and a storage medium, so as to solve the technical problem in the prior art that a large amount of system resources are consumed because the network disk drive letter needs to be configured with multiple storage systems.
In a first aspect, an embodiment of the present invention provides a method for implementing a network disk drive, including:
providing a mount port to a client, and receiving a network disk mount directory request from the mount port, where the mount directory request includes: file directory path and file;
reading a file corresponding to the file directory path from a storage system, and reading the file into an internal memory;
and returning a handle corresponding to the file to a client so that the client associates the handle label with the created virtual drive letter.
In a second aspect, an embodiment of the present invention further provides an apparatus for implementing a network disk drive, including:
a providing module, configured to provide a mount port to a client, and receive a network disk mount directory request from the mount port, where the mount directory request includes: a file directory path;
the reading module reads the file corresponding to the file directory path from the storage system, and reads all the files in the folder into the memory;
and the returning module is used for returning the handle corresponding to the file to the client so that the client associates the handle mark with the created virtual drive.
In a third aspect, an embodiment of the present invention further provides a network disk, including:
one or more processors;
storage means for storing one or more programs;
when the one or more programs are executed by the one or more processors, the one or more processors are enabled to implement the method for implementing the network drive provided by the above embodiment.
In a fourth aspect, the embodiment of the present invention further provides a storage medium containing computer executable instructions, which when executed by a computer processor, are used to execute the implementation method of the network disk drive provided in the above embodiment.
The method, the device, the network disk and the storage medium for realizing the network disk drive letter provided by the embodiment of the invention provide a mount port for a client and receive a network disk mount directory request from the mount port, wherein the mount directory request comprises: a file directory path; reading a file corresponding to the file directory path from a storage system, and reading the file into an internal memory; and returning a handle corresponding to the file to the client so that the client associates the handle label with the created virtual drive. The files stored in the distributed storage system are separated from the original storage format, and the folder designated by the user in the network disk can be mounted as the local virtual disk identifier of the user. The network disk system does not need to process the files stored in the distributed storage system aiming at different file sharing protocols supported by the client, so that the consumption of network disk resources is reduced.
Drawings
Other features, objects and advantages of the invention will become more apparent upon reading of the detailed description of non-limiting embodiments thereof, made with reference to the following drawings:
fig. 1 is a flowchart of an implementation method of a network disk drive provided in an embodiment of the present invention;
fig. 2 is a flowchart of an implementation method of a network disk drive according to a second embodiment of the present invention;
fig. 3 is a flowchart of an implementation method of a network disk drive provided by a third embodiment of the present invention;
fig. 4 is a flowchart of an implementation method of a network disk drive according to a fourth embodiment of the present invention;
fig. 5 is a flowchart of an implementation method of a network disk drive according to a fifth embodiment of the present invention;
fig. 6 is a structural diagram of an apparatus for implementing a network disk drive provided in a sixth embodiment of the present invention;
fig. 7 is a structural diagram of a network disk according to a seventh embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not to be construed as limiting the invention. It should be further noted that, for the convenience of description, only some structures related to the present invention are shown in the drawings, not all of them.
Example one
Fig. 1 is a flowchart of a method for implementing a network disk drive identifier according to an embodiment of the present invention, where this embodiment is applicable to a situation where a client implements a mount of a network disk specific file on a local system virtual disk drive identifier, and the method can be executed by an implementation apparatus for a network disk drive identifier, and specifically includes the following steps:
In this embodiment, at the user's terminal, for example: the personal PC, the tablet or the mobile phone can be provided with a client, and the client can be suitable for various operating systems and can identify the operating system corresponding to the current terminal. And is responsible for communicating with the network disk system.
In this embodiment, the client may send a mount (mount) port query request to the network disk, and the network disk provides the mount port to the client. The client side can send a network disk mounting catalog request through the mounting port according to the received mounting port. The mount directory request may include: file directory path and file sharing protocol type. The file directory path may be a specific storage location provided by the network disk. And the network disk can conveniently acquire the corresponding file according to the file storage address.
And step 120, reading the folder corresponding to the file directory path from the storage system, and reading all files in the folder into a memory.
In this embodiment, since the file format adopted by the distributed storage system may not be consistent with the file sharing protocol type supported by the operating system corresponding to the client, and the purpose of mounting the disk identifier cannot be achieved, in this embodiment, the file corresponding to the file directory path is read from the storage system. And reading the file into the memory. After the files are read into the memory, the files corresponding to the file directory path can be decoupled from the limitation of the original storage relationship, so that the corresponding folders can be mounted by using the disk identifiers conveniently.
And step 130, returning a handle corresponding to the folder to the client, so that the client associates the handle label with the created virtual drive.
A Handle (Handle) is an identifier used to identify an object or item. Since the address of the data needs to be changed and the change needs to be recorded and managed after the change, the change of the data address can be described by a handle. Therefore, in this embodiment, the handle may be used as an identifier, so as to associate the user drive letter with the corresponding file memory address. The network disk can determine the handle of the file by reading the memory and send the handle to the client.
The client may create one or more virtual drives in advance in the user's terminal. The method can be implemented by adopting the existing mode, and is not described in detail herein. After the virtual drive is created, a handle may be associated with the created virtual drive. Corresponding to the address in the network disk memory. The mounting of the network disk appointed directory on the user terminal disk identifier is realized.
In this embodiment, a mount port is provided for a client, and a network disk mount directory request is received from the mount port, where the mount directory request includes: a file directory path; reading a file corresponding to the file directory path from a storage system, and reading the file into an internal memory; and returning a handle corresponding to the file to a client so that the client associates the handle label with the created virtual drive letter. The files stored in the distributed storage system are separated from the original storage format, and the folder designated by the user in the network disk can be mounted as the local virtual disk identifier of the user. The network disk system does not need to process the files stored in the distributed storage system aiming at different file sharing protocols supported by the client, so that the consumption of network disk resources is reduced.
In a preferred embodiment of this embodiment, before providing the mount port to the client, the method may further add the following steps: and receiving a file system connection request sent by a client through a file service port, and providing network file service corresponding to the service port for the client. Before providing a mount port for a client, the client needs to send a file system connection request through a file service port, and when the network disk system judges whether the request is a legal request or not, and when the request is determined to be the legal request, the network disk system provides corresponding network file service for the client, so that a malicious network disk mount request is prevented.
In another preferred implementation manner of this embodiment, before receiving a file system connection request sent by a client through a file service port, the method may further add the following steps: receiving a port mapping request sent by a client, determining a corresponding file service port number according to a file sharing protocol type in the port mapping request, and sending the file service port number to the client. Because the types of the file sharing protocols corresponding to the terminals corresponding to the clients are different, the network disk server needs to set a corresponding network port for the file sharing protocol adopted in each client. When the client proposes the network file service, the client should acquire the network file service port corresponding to the network disk server in advance. Optionally, the client may send a port mapping request to the network disk first, and the network disk receives the port mapping request, determines a corresponding service port number according to a file sharing protocol type included in the port mapping request, and sends the service port number to the client. And records the corresponding file sharing protocol. So that the client can send the network file service request according to the corresponding port number, and the network disk can provide corresponding file service for mounting the network disk according to the network file sharing protocol.
Example two
Fig. 2 is a flowchart of a method for implementing a network disk drive according to a second embodiment of the present invention. In this embodiment, the method may further include the following steps: receiving an attribute viewing request sent by a client, wherein the attribute viewing request comprises: a handle corresponding to the file; determining the storage information of the file according to the handle; acquiring attribute information of the file from a memory according to the handle; calling an application layer corresponding to a file sharing protocol to generate file attribute information from the attribute information and the storage information of the file; and sending the file attribute information to a client.
Correspondingly, the method for implementing the network disk drive provided by the embodiment specifically includes:
And step 230, returning a handle corresponding to the folder to the client, so that the client associates the handle label with the created virtual drive.
After the network disk and the virtual disk signature of the terminal are mounted, the user can operate the network disk file through the operation of the virtual disk signature. In this embodiment, the user can view the attribute of the file through the right key operation in the mounted virtual drive.
For example, the attribute checking operation may be consistent with the attribute checking operation of a conventional local hard disk, and after receiving a file checking operation of a user, a client may send an attribute checking request to a network disk, and since corresponding content of a folder has been read into a memory, when sending the checking request, the attribute checking request does not refer to a specific folder, but corresponds to a corresponding storage address in the memory, and therefore, the attribute checking request includes: and the handle corresponds to the file. The network disk finds out the corresponding memory address according to the handle, and correspondingly reads out the attribute of the file, such as the basic attribute information of the size and the space utilization rate. In addition, management attribute information of the user, the group and the authority of the corresponding file can be searched through a network disk system.
And step 250, acquiring the attribute information of the file from the memory according to the handle.
And the network disk finds out the corresponding memory address according to the handle, and correspondingly reads out the attribute of the file, such as the basic attribute information of the size and the space utilization rate. In addition, management attribute information of the user, the group and the authority of the corresponding file can be searched through a network disk system.
And step 260, calling an application layer corresponding to the file sharing protocol to generate file attribute information from the attribute information and the storage information of the file.
The attribute information should meet the requirements of the file sharing protocol currently adopted by the user terminal, and therefore, in this embodiment, the application program corresponding to the file sharing protocol adopted by the terminal currently viewing the attribute may be used to generate the attribute information that can be viewed by the user terminal, from the attribute information acquired by the above method.
And step 270, sending the file attribute information to the client.
The present embodiment adds the following steps: receiving an attribute viewing request sent by a client, wherein the attribute viewing request comprises: a handle corresponding to the file; determining the storage information of the file according to the handle; acquiring attribute information of the file from a memory according to the handle; calling an application layer corresponding to a file sharing protocol to generate file attribute information from the attribute information and the storage information of the file; and sending the file attribute information to a client. The specific position of a viewed file in the memory can be determined by utilizing the handle, the file attribute is obtained according to the specific position, the file attribute information is sent to the client by utilizing the application layer corresponding to the file sharing protocol, and the viewing of the file attribute by the drive-mounted network disk can be realized.
EXAMPLE III
Fig. 3 is a flowchart of a method for implementing a network disk drive provided by the third embodiment of the present invention. In this embodiment, the method may further include the following steps: receiving a file viewing request sent by a client, wherein the file viewing request comprises: the handle file name corresponding to the folder where the file is located; determining whether a file corresponding to the file name exists or not according to the handle corresponding to the folder where the file is located; when determining that the file corresponding to the file name exists, judging whether the client has the authority to the file, acquiring the information of the file when the client has the authority, and calling an application layer corresponding to a file sharing protocol to generate file information of the sharing protocol; sending the sharing protocol file information to a client; receiving a file reading request sent by a client, wherein the reading request comprises: file handles and corresponding read offset bits; and determining a corresponding memory initial position according to the file handle, reading an application layer corresponding to a file sharing protocol, and sending data from the initial position to the offset position to the client.
Correspondingly, the method for implementing the network disk drive provided by the embodiment specifically includes:
step 310, providing a mount port to a client, and receiving a network disk mount directory request from the mount port, where the mount directory request includes: a file directory path.
After the network disk and the virtual disk identifier of the terminal are mounted, the user can operate the network disk file through the operation of the virtual disk identifier. In this embodiment, the user can view the file by viewing the file in the virtual drive.
Exemplarily, the method may be consistent with a conventional local hard disk attribute viewing operation, after receiving a file viewing operation of a user, a client may send a file viewing request to a network disk, and since corresponding content of a folder has been read into a memory, when sending the viewing request, a corresponding storage address in the memory needs to be corresponded, so that the attribute viewing request includes: handles and file names corresponding to the folders. And the network disk finds the corresponding memory location according to the handle.
And step 350, determining whether the file corresponding to the file name exists according to the handle corresponding to the folder where the file is located.
And the network disk finds out the corresponding memory address according to the handle, determines whether the memory address comprises the file consistent with the file name or not, and returns an error prompt if the memory address does not comprise the file consistent with the file name.
And step 360, when determining that the file corresponding to the file name exists, judging whether the client has the authority on the file, and when the authority exists, acquiring the information of the file, calling an application layer corresponding to a file sharing protocol, and generating file information of the sharing protocol.
Since the web disk file has the authority, it needs to first determine whether the current user has the authority for the file, and for example, whether the current user has the authority may be determined by a login account of the client. When the file is read, the file information is firstly acquired, and the file information is utilized to determine the size of the file, so that a basis is provided for judging whether the content of the file is complete. And when the file has the right, acquiring the information of the file, calling an application layer corresponding to a file sharing protocol, and generating file information of the sharing protocol.
Usually subject to network limitations, a corresponding read size criterion may be preset so that the user may view a portion of the contents of the file in a short time. The criteria may be determined according to network conditions and hardware conditions of the user terminal. After the read size criteria are determined, the corresponding conversion may be to a corresponding read offset bit. And sends the file handle and the corresponding read offset bit to the network disk.
The network disk can determine the initial position of the memory according to the handle and determine the range of the read file according to the offset. And converting the contents read from the memory by using the application layer corresponding to the file sharing protocol, sending the converted data to the client to read part of the contents of the file, sequentially continuing to read downwards until all the files are read, and sequentially sending the contents to the client by using the application layer corresponding to the file sharing protocol to finish the complete selection of reading.
The present embodiment adds the following steps: receiving a file viewing request sent by a client, wherein the file viewing request comprises: the handle file name corresponding to the folder where the file is located; determining whether a file corresponding to the file name exists or not according to the handle corresponding to the folder where the file is located; when determining that the file corresponding to the file name exists, judging whether the client has the authority on the file, acquiring the information of the file when the client has the authority, calling an application layer corresponding to a file sharing protocol, and generating file information of the sharing protocol; sending the sharing protocol file information to a client; receiving a file reading request sent by a client, wherein the reading request comprises: file handles and corresponding read offset bits; and determining a corresponding memory initial position according to the file handle, taking an application layer corresponding to a file sharing protocol, and sending data from the initial position to the offset bit to the client. The address range of the file in the memory is determined by the offset bit and the handle, corresponding file content is read from the address range and is sent to the client, and the file content can be viewed by the disk-character mounting network disk.
Example four
Fig. 4 is a flowchart of a method for implementing a network drive letter provided in the fourth embodiment of the present invention. In this embodiment, the method may further include the following steps: receiving a file creation request sent by a client, wherein the file creation request comprises: file name and file storage path; and determining a handle of the created file according to the storage path of the file, and returning the handle of the file to the client.
Correspondingly, the method for implementing the network disk drive provided by this embodiment specifically includes:
And 430, returning a handle corresponding to the folder to the client, so that the client associates the handle label with the created virtual drive.
After the network disk and the virtual disk signature of the terminal are mounted, the user can operate the network disk file by operating the virtual disk signature. In this embodiment, the user may implement, through a new operation in the mounted virtual drive, that a new file is correspondingly created in the network drive. The client can determine the corresponding storage path by acquiring the folder hierarchy where the new operation is located. And sending the name and the storage path of the new file to the network disk system. The network disk system receives the file creation request.
And step 450, determining to create a handle of the file according to the storage path of the file, and returning the handle of the file to the client.
After receiving the file creation request, the network disk creates a corresponding file in the memory according to the storage path, and acquires a handle of the file. And correspondingly sends the handle to the client. The client records the corresponding storage path, the file name and the corresponding handle. And when the attribute of the file is checked and modified in the later period, the content is sent to the network disk system, so that the network disk correspondingly performs various operations on the new file.
This embodiment adds the following steps: receiving a file creation request sent by a client, wherein the file creation request comprises: file name and file storage path; and determining a handle of the created file according to the storage path of the file, and returning the handle of the file to the client. The operation of mounting the new file of the network disk on the disk drive can be realized.
EXAMPLE five
Fig. 5 is a flowchart of a method for implementing a network disk drive according to a fifth embodiment of the present invention. In this embodiment, the method may further include the following steps: receiving a file writing request sent by a client; analyzing a file writing request by utilizing an application layer corresponding to a file sharing protocol to obtain a file handle, a corresponding writing offset bit and corresponding data; and storing corresponding data according to the file handle and the corresponding write offset.
Correspondingly, the method for implementing the network disk drive provided by this embodiment specifically includes:
The user may write to the network disk file by using the disk identifier, and the writing may include: addition and modification. And the client generates a file writing request by the handle corresponding to the acquired file, the writing offset corresponding to the written content and the corresponding written content and sends the file writing request to the network disk, so that the network disk executes corresponding file writing according to the file creating request comprising the content.
After receiving the file writing request, the network disk can analyze the file writing request according to the application layer corresponding to the file sharing protocol, and analyze the file writing request to obtain a file handle, a corresponding writing offset bit and corresponding data.
And step 560, storing the corresponding data according to the file handle and the corresponding write offset.
The network disk can determine the initial position of the written content according to the handle, determine the memory range corresponding to the written data according to the offset, and write the data into the corresponding memory range to realize the writing of the file content.
This embodiment adds the following steps: receiving a file writing request sent by a client; analyzing the file writing request by using an application layer corresponding to a file sharing protocol to obtain a file handle, a corresponding writing offset bit and corresponding data; and storing corresponding data according to the file handle and the corresponding write offset. The requirement that the file content is written into the network disk by mounting the disk identifier can be met.
In a preferred implementation of this embodiment, the method may further include: and performing persistent storage on the written and created data in the memory. The operation of the network disk file in the drive letter is carried out in the memory. Once power off or the like occurs, data is lost, and therefore, in this embodiment, the data written and created in the memory can be persistently stored according to the original storage mode in a preset time or after receiving the storage operation sent by the client. And ensuring that the network disk data operated on the disk drive is not lost.
EXAMPLE six
Fig. 6 is a structural diagram of an apparatus for implementing a network drive letter provided by a sixth embodiment of the present invention, as shown in fig. 6, the apparatus includes:
a providing module 610, configured to provide a mount port to a client, and receive a network disk mount directory request from the mount port, where the mount directory request includes: a file directory path;
a reading module 620, configured to read a file corresponding to the file directory path from a storage system, and write the file into a memory according to the file sharing protocol type;
a returning module 630, configured to return a handle corresponding to the file to the client, so that the client associates the handle label with the created virtual drive.
The device for implementing a network disk drive letter provided by this embodiment provides a mount port to a client, and receives a network disk mount directory request from the mount port, where the mount directory request includes: a file directory path; reading the file corresponding to the file directory path from the storage system, and writing the file into a memory according to the file sharing protocol type; and returning a handle corresponding to the file to the client so that the client associates the handle label with the created virtual drive. The corresponding file content is written into the memory by the folder needing to be mounted by the client according to the sharing protocol type of the port, and the handle corresponding to the file is sent to the client. And enabling the client to associate the locally established virtual network disk drive letter with the memory address in the network disk memory by using the handle. Based on the consistency of the network disk memory and the file sharing protocol type adopted by the client, the method can mount the folder designated by the user in the network disk as the local virtual disk character of the user in a cross-implementation manner. The network disk system does not need to set the files supporting the file sharing protocol for the stored files respectively aiming at different file sharing protocols supported by the client, thereby reducing the resource consumption of the network disk.
On the basis of the above embodiments, the apparatus further includes:
and the port mapping request receiving module is used for receiving a port mapping request sent by the client, determining a corresponding file service port number according to the service type in the port mapping request, and sending the file service port number to the client.
On the basis of the above embodiments, the apparatus further includes:
an attribute viewing receiving module, configured to receive an attribute viewing request sent by a client, where the attribute viewing request includes: a handle corresponding to the file;
the storage information determining module is used for determining the storage information of the file according to the handle;
the attribute information acquisition module is used for acquiring the attribute information of the file from the memory according to the handle;
the attribute information generating module is used for generating the attribute information and the storage information of the file into file attribute information according to the type of the file sharing protocol;
and the attribute information sending module is used for sending the file attribute information to the client.
On the basis of the above embodiments, the apparatus further includes:
a file viewing request receiving module, configured to receive a file viewing request sent by a client, where the file viewing request includes: the handle file name corresponding to the folder where the file is located;
the file determining module is used for determining whether a file corresponding to the file name exists or not according to the handle corresponding to the folder where the file is located;
the authority judgment module is used for judging whether the client has authority to the file when determining that the file corresponding to the file name exists, acquiring information of the file when the client has the authority, and generating sharing protocol file information according to the file sharing protocol type;
the sharing protocol file information sending module is used for sending the sharing protocol file information to a client;
a reading request receiving module, configured to receive a file reading request sent by a client, where the reading request includes: a file handle and a corresponding read offset bit;
and the data sending module is used for determining the corresponding memory starting position according to the file handle and sending the data from the starting position to the offset bit to the client.
On the basis of the above embodiments, the apparatus further includes:
a file creation request receiving module, configured to receive a file creation request sent by a client, where the file creation request includes: file name and file storage path;
and the handle creating module is used for determining a handle for creating the file according to the storage path of the file and returning the handle of the file to the client.
On the basis of the above embodiments, the apparatus includes:
a write request receiving module, configured to receive a file write request sent by a client, where the file write request includes: file handles and corresponding write offsets and corresponding data;
and the storage module is used for storing corresponding data according to the file handle and the corresponding suction offset.
On the basis of the above embodiments, the apparatus further includes:
and the persistent storage module is used for performing disk-falling persistent storage on the written and created data in the memory.
The device for implementing the network disk drive letter provided by the embodiment of the invention can execute the method for implementing the network disk drive letter provided by any embodiment of the invention, and has corresponding functional modules and beneficial effects of the execution method.
EXAMPLE seven
Fig. 7 is a structural diagram of a network disk according to a seventh embodiment of the present invention. Fig. 7 shows a block diagram of an exemplary mesh disk 12 suitable for use in implementing embodiments of the present invention. The mesh disc 12 shown in fig. 7 is only an example, and should not bring any limitation to the function and the use range of the embodiment of the present invention.
As shown in fig. 7, the network disk 12 is in the form of a general purpose computing device. The components of the mesh tray 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 that couples various system components including the system memory 28 and the processing unit 16.
The mesh tray 12 typically includes a variety of computer system readable media. Such media may be any available media that is accessible by the network disk 12 and includes both volatile and nonvolatile media, removable and non-removable media.
The system memory 28 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM) 30 and/or cache 32. The network disk 12 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 34 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 7 and commonly referred to as a "hard drive"). Although not shown in FIG. 7, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 18 by one or more data media interfaces. System memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the invention.
A program/utility 40 having a set (at least one) of program modules 42 may be stored, for example, in system memory 28, such program modules 42 including but not limited to an operating system, one or more application programs, other program modules, and program data, each of which or some combination of which may comprise an implementation of a network environment. Program modules 42 generally carry out the functions and/or methodologies of embodiments of the invention as described.
The network disk 12 may also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), with one or more devices that enable a user to interact with the network disk 12, and/or with any devices (e.g., network card, modem, etc.) that enable the network disk 12 to communicate with one or more other computing devices. Such communication may be through an input/output (I/O) interface 22. Also, the network disk 12 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network such as the Internet) via the network adapter 20. As shown, the network adapter 20 communicates with the other modules of the network disk 12 via the bus 18. It should be understood that although not shown in the figures, other hardware and/or software modules may be used in conjunction with the network disk 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, to name a few.
The processing unit 16 executes various functional applications and data processing by executing programs stored in the system memory 28, for example, implementing a method for implementing a network drive provided by the embodiment of the present invention.
Example eight
An eighth embodiment of the present invention further provides a storage medium containing computer-executable instructions, where the computer-executable instructions, when executed by a computer processor, are configured to perform the method for implementing a network disk drive according to any one of the foregoing embodiments.
Computer storage media for embodiments of the present invention may take the form of any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. Those skilled in the art will appreciate that the present invention is not limited to the particular embodiments described herein, and that various obvious changes, rearrangements and substitutions will now be apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.
Claims (9)
1. A method for realizing a network disk drive letter is characterized by comprising the following steps:
receiving a port mapping request sent by a client, determining a corresponding file service port number according to a file sharing protocol type in the port mapping request, and sending the file service port number to the client;
receiving a file system connection request sent by a client through a file service port, and providing network file service corresponding to the service port number to the client;
providing a mount port to a client, and receiving a network disk mount directory request from the mount port, where the mount directory request includes: a file directory path;
reading a folder corresponding to the file directory path from a storage system, and reading all files in the folder into an internal memory;
and returning a handle corresponding to the folder to a client so that the client associates the handle label with the created virtual drive letter.
2. The method of claim 1, further comprising:
receiving an attribute viewing request sent by a client, wherein the attribute viewing request comprises: a handle corresponding to the file;
determining the storage information of the file according to the handle;
acquiring attribute information of the file from a memory according to the handle;
calling an application layer corresponding to a file sharing protocol to generate file attribute information from the attribute information and the storage information of the file;
and sending the file attribute information to a client.
3. The method of claim 1, further comprising:
receiving a file viewing request sent by a client, wherein the file viewing request comprises: the handle and the file name corresponding to the folder where the file is located;
determining whether a file corresponding to the file name exists or not according to the handle corresponding to the folder where the file is located;
when determining that the file corresponding to the file name exists, judging whether the client has the authority to the file, acquiring the information of the file when the client has the authority, and calling an application layer corresponding to a file sharing protocol to generate file information of the sharing protocol;
sending the sharing protocol file information to a client;
receiving a file reading request sent by a client, wherein the reading request comprises: a file handle and a corresponding read offset bit;
and determining a corresponding memory initial position according to the file handle, and sending data from the initial position to the offset bit to the client by taking an application layer corresponding to a file sharing protocol.
4. The method of claim 1, further comprising:
receiving a file creation request sent by a client, wherein the file creation request comprises: file name and file storage path;
and determining a handle for creating the file according to the storage path of the file, and returning the handle of the file to the client.
5. The method of claim 1, further comprising:
receiving a file writing request sent by a client;
analyzing the file writing request by utilizing an application layer corresponding to a file sharing protocol to obtain a file handle, a corresponding writing offset and corresponding data;
and storing corresponding data according to the file handle and the corresponding write offset.
6. The method of any of claims 3, 4 or 5, further comprising:
and performing persistent storage on the written and created data in the memory.
7. An apparatus for implementing a network disk drive letter, comprising:
the port mapping request receiving module is used for receiving a port mapping request sent by a client, determining a corresponding file service port number according to a service type in the port mapping request and sending the file service port number to the client;
the file system connection request receiving module is used for receiving a file system connection request sent by a client through a file service port and providing network file service corresponding to the service port number for the client;
a providing module, configured to provide a mount port to a client, and receive a network disk mount directory request from the mount port, where the mount directory request includes: a file directory path;
the reading module is used for reading the file corresponding to the file directory path from the storage system and reading all the files in the folder into the memory;
and the returning module is used for returning the handle corresponding to the file to the client so that the client associates the handle label with the created virtual drive.
8. A mesh tray, characterized in that it comprises:
one or more processors;
storage means for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement the method for implementing a network drive according to any one of claims 1-6.
9. A storage medium containing computer-executable instructions for performing a method of implementing a webcam as claimed in any one of claims 1 to 6 when executed by a computer processor.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210292529.XA CN114385091B (en) | 2022-03-24 | 2022-03-24 | Method and device for realizing network disk drive character, network disk and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210292529.XA CN114385091B (en) | 2022-03-24 | 2022-03-24 | Method and device for realizing network disk drive character, network disk and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114385091A CN114385091A (en) | 2022-04-22 |
CN114385091B true CN114385091B (en) | 2022-07-26 |
Family
ID=81204854
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210292529.XA Active CN114385091B (en) | 2022-03-24 | 2022-03-24 | Method and device for realizing network disk drive character, network disk and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114385091B (en) |
Families Citing this family (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114676093B (en) * | 2022-05-25 | 2022-09-02 | 天津联想协同科技有限公司 | File management method and device, electronic equipment and storage medium |
CN115314257B (en) * | 2022-07-12 | 2024-03-12 | 天翼云科技有限公司 | File system authentication method and device, electronic equipment and computer storage medium |
CN114979125B (en) * | 2022-08-02 | 2023-01-06 | 天津联想协同科技有限公司 | Method, device, terminal and storage medium for rapidly uploading files to network disk |
CN116070201B (en) * | 2022-12-22 | 2024-07-05 | 北京握奇数据股份有限公司 | Data management method, system, electronic equipment and medium |
CN116909992B (en) * | 2023-09-12 | 2023-11-24 | 创云融达信息技术(天津)股份有限公司 | Method for realizing communication between system and object storage through NTFS symbol link |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112800014A (en) * | 2021-01-29 | 2021-05-14 | 中国工商银行股份有限公司 | File system creation method and device |
CN113238997A (en) * | 2021-07-13 | 2021-08-10 | 云宏信息科技股份有限公司 | Cloud data operation method for terminal equipment, storage medium and terminal equipment |
CN113448688A (en) * | 2021-06-29 | 2021-09-28 | 华云数据控股集团有限公司 | Method, system and computer medium for automatically correcting network configuration in cloud migration scene |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20120246226A1 (en) * | 2011-03-23 | 2012-09-27 | Tappin Inc. | System and method for sharing data from a local network to a remote device |
US10536523B2 (en) * | 2014-05-11 | 2020-01-14 | Microsoft Technology Licensing, Llc | File service using a shared file access-rest interface |
CN113190181A (en) * | 2021-05-28 | 2021-07-30 | 北京鼎普科技股份有限公司 | Virtual disk mounting method and system |
-
2022
- 2022-03-24 CN CN202210292529.XA patent/CN114385091B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112800014A (en) * | 2021-01-29 | 2021-05-14 | 中国工商银行股份有限公司 | File system creation method and device |
CN113448688A (en) * | 2021-06-29 | 2021-09-28 | 华云数据控股集团有限公司 | Method, system and computer medium for automatically correcting network configuration in cloud migration scene |
CN113238997A (en) * | 2021-07-13 | 2021-08-10 | 云宏信息科技股份有限公司 | Cloud data operation method for terminal equipment, storage medium and terminal equipment |
Also Published As
Publication number | Publication date |
---|---|
CN114385091A (en) | 2022-04-22 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN114385091B (en) | Method and device for realizing network disk drive character, network disk and storage medium | |
CN108737325B (en) | Multi-tenant data isolation method, device and system | |
US8914856B1 (en) | Synchronization of networked storage systems and third party systems | |
US7801847B2 (en) | Media file conversion using plug-ins | |
US8370910B2 (en) | File server for translating user identifier | |
CN104020961B (en) | Distributed data storage method, apparatus and system | |
US10437787B2 (en) | Comparison of file system snapshots stored in a remote storage system using a network file system command | |
CN110389935B (en) | Method, equipment and computer storage medium for starting small program | |
US20020138653A1 (en) | Workstation system, computer, data transfer method, data editing method, computer program generation method, computer program and storage medium | |
EP2788886B1 (en) | Access to supplemental data based on identifier derived from corresponding primary application data | |
US9146813B2 (en) | Presenting a file system for a file containing items | |
CN109597640B (en) | Account management method, device, equipment and medium for application program | |
CN111831618A (en) | Data writing method, data reading method, device, equipment and storage medium | |
CN114817969B (en) | Method, device, terminal and storage medium for previewing network disk drive letter file | |
US20170153909A1 (en) | Methods and Devices for Acquiring Data Using Virtual Machine and Host Machine | |
CN107862035B (en) | Network reading method and device for conference record, intelligent tablet and storage medium | |
US8826026B2 (en) | Systems and methods for tracking electronic files in computer networks using electronic signatures | |
CN113992382A (en) | Service data processing method and device, electronic equipment and storage medium | |
CN111245944A (en) | Domain name resolution method and device, electronic equipment and storage medium | |
CN115238314B (en) | Network disk file display method and device, network disk and storage medium | |
CN114297495A (en) | Service data searching method and device, electronic equipment and storage medium | |
CN109857719B (en) | Distributed file processing method, device, computer equipment and storage medium | |
CN113986995A (en) | Request distribution method and device, storage medium and electronic equipment | |
CN114238391A (en) | Data paging query method and device, electronic equipment and storage medium | |
CN107749892B (en) | Network reading method and device for conference record, intelligent tablet and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |