CN112667172A - Disk operation method, device, system, storage medium and computing equipment - Google Patents

Disk operation method, device, system, storage medium and computing equipment Download PDF

Info

Publication number
CN112667172A
CN112667172A CN202110066919.0A CN202110066919A CN112667172A CN 112667172 A CN112667172 A CN 112667172A CN 202110066919 A CN202110066919 A CN 202110066919A CN 112667172 A CN112667172 A CN 112667172A
Authority
CN
China
Prior art keywords
server
disk
background thread
client
operation function
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.)
Pending
Application number
CN202110066919.0A
Other languages
Chinese (zh)
Inventor
匡晓云
黄开天
杨祎巍
于杨
姚浩
弓羽箭
闫佳伟
韩辉
徐贵洲
焦进星
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Acoinfo Technology Co ltd
CSG Electric Power Research Institute
Southern Power Grid Digital Grid Research Institute Co Ltd
Research Institute of Southern Power Grid Co Ltd
Original Assignee
Beijing Acoinfo Technology Co ltd
Southern Power Grid Digital Grid Research Institute Co Ltd
Research Institute of Southern Power Grid Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Beijing Acoinfo Technology Co ltd, Southern Power Grid Digital Grid Research Institute Co Ltd, Research Institute of Southern Power Grid Co Ltd filed Critical Beijing Acoinfo Technology Co ltd
Priority to CN202110066919.0A priority Critical patent/CN112667172A/en
Publication of CN112667172A publication Critical patent/CN112667172A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Stored Programmes (AREA)

Abstract

The application discloses a disk operation method, a device, a system, a storage medium and a computing device, wherein the method comprises the following steps: calling a background thread to mount a server disk partition, and hanging an operation function of the server disk partition; mapping the server disk partitions to the client through a network so as to form corresponding virtual disks at the client; receiving an operation instruction executed by a client to a virtual disk, and determining an operation function corresponding to the operation instruction; and the background thread executes an operation function on the server disk partition and returns an execution result to the client. The method and the device solve the technical problem that the disk reading is complex in the prior art.

Description

Disk operation method, device, system, storage medium and computing equipment
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method, an apparatus, a system, a storage medium, and a computing device for operating a disk.
Background
The prior art, namely network file system NFS, is based on the application of UDP/IP protocol, and is implemented mainly by using a remote procedure call RPC mechanism, which provides a set of operations for accessing remote files that are independent of the machine, operating system, and underlying transport protocol. RPC employs support from XDR, which is a machine-independent data description coding protocol to encode and decode data transmitted over the network independently of each view of any machine architecture.
At present, aiming at remote access of data stored on a storage device among heterogeneous multiple systems, the method of the general NFS has major defects and shortcomings:
excessive dependent components and great transplanting difficulty
Currently, the existing general technology needs a virtual file system switching (VFS) technology relying on Linux, and the requirements are transferred to the NFS instance in the kernel through the VFS. While relying on the SUN's RPC component. The client relies on the mount protocol for connection. The three components have larger code amount, so that the transplantation and use difficulty is high.
② the application code is complex and the maintenance difficulty is large
The RPC-based interoperability layer XDR is performed when a user accesses a storage device remotely over a network to ensure that all remote network connection participants use the same language when data types are involved, which represent data types on target hosts that may differ from those meeting requirements when a given architecture executes a request. XDR is responsible for converting types to common representations. The whole process is complex, the problem of poor positioning is caused when the transmission problem occurs, and the maintenance difficulty is high.
And the use method is complex and inconvenient to operate.
All configuration and operation relies on configuration files, requiring manual filling and pre-fetching of the file system directories of the remote storage hosts.
In view of the above technical problem of complicated disk reading in the prior art, no effective solution has been proposed at present.
Disclosure of Invention
The embodiment of the application provides a disk operation method, a device, a system, a storage medium and a computing device, so as to at least solve the technical problem of complex disk reading in the prior art.
According to an aspect of an embodiment of the present application, there is provided a disk operating method, including: calling a background thread to mount a server disk partition, and hanging an operation function of the server disk partition; mapping the server disk partitions to the client through a network so as to form corresponding virtual disks at the client; receiving an operation instruction executed by a client to a virtual disk, and determining an operation function corresponding to the operation instruction; and the background thread executes an operation function on the server disk partition and returns an execution result to the client.
According to another aspect of the embodiments of the present application, there is also provided a disk mapping method, including: calling a background thread to mount a server disk partition; an operation function of the server disk partition is hooked in the background thread, so that the background thread can operate the server disk partition by calling the operation function; configuring a background thread to convert an operation instruction into an operation function; and mapping the server disk partition to the client through the network, so that the client can execute operation instructions aiming at the mapping disk partition.
According to another aspect of the embodiments of the present application, there is also provided a disk operating apparatus, including: the calling module is used for calling the background thread to mount the server disk partition and hanging the operation function of the server disk partition; the mapping module is used for mapping the server disk partitions to the client through a network so as to form corresponding virtual disks at the client; the receiving module is used for receiving an operation instruction executed by the client to the virtual disk and determining an operation function corresponding to the operation instruction; and the execution module is used for executing the operation function on the server disk partition by the background thread and returning the execution result to the client.
According to another aspect of the embodiments of the present application, there is also provided a disk mapping apparatus, including: the mounting module is used for calling a background thread to mount the server disk partition; the hooking module is used for hooking the operation function of the server disk partition in the background thread so that the background thread can operate the server disk partition by calling the operation function; the configuration module is used for configuring the background thread to convert the operation instruction into an operation function; and the network mapping module is used for mapping the server disk partition to the client through the network so as to execute the operation instruction aiming at the mapping disk partition at the client.
According to another aspect of the embodiment of the present application, there is also provided a disk operating system, including a server and a client, where a background thread is called at the server to mount a server disk partition, and an operation function of the server disk partition is mounted, so that the background thread can operate the server disk partition by calling the operation function; configuring a background thread to convert an operation instruction into an operation function; mapping the server disk partitions to the client through a network so as to form corresponding virtual disks at the client; and executing an operation instruction on the virtual disk at the client, sending the operation instruction to the server through the network, and receiving an execution result of the server aiming at the operation instruction.
On the basis of any one of the above embodiments, the calling the operation function of hooking the disk partition of the server by the background thread includes: registering an operation function of the server disk partition in the background thread, so that the background thread can operate the server disk partition by calling the operation function; and establishing a corresponding relation between the operation function and the operation instruction in the background thread so as to convert the operation instruction executed aiming at the virtual disk into the corresponding operation function executed aiming at the server disk partition.
On the basis of any of the above embodiments, the operation function comprises a read function, a write function, and/or an erase function.
On the basis of any embodiment, the server establishes socket connection with the client, and transmits an operation instruction or an operation result through a UDP/IP protocol.
According to another aspect of the embodiments of the present application, there is provided a storage medium including a stored program, wherein when the program runs, a device on which the storage medium is located is controlled to execute the method of any of the above embodiments.
According to another aspect of embodiments of the present application, there is provided a computing device comprising a processor for executing a program, wherein the program executes to perform the method of any of the above embodiments.
In the embodiment of the application, a server disk partition is mounted by calling a background thread, and an operation function of the server disk partition is mounted; mapping the server disk partitions to the client through a network so as to form corresponding virtual disks at the client; receiving an operation instruction executed by a client to a virtual disk, and determining an operation function corresponding to the operation instruction; the background thread executes the operation function on the server disk partition and returns the execution result to the client, so that the mapping and remote operation transmission of the disk can be completed through the background thread without depending on other third-party middleware, and the technical problem of complex disk reading in the prior art is solved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
fig. 1 is a block diagram of a hardware structure of a computer terminal (or a mobile device) for implementing a disk operation method according to an embodiment of the present application;
FIG. 2 is a flow chart of a method of operating a disk according to an embodiment of the present application;
FIG. 3 is a flow chart of yet another method of disk operation according to an embodiment of the present application;
FIG. 4 is a flow chart of a disk mapping method according to an embodiment of the present application;
FIG. 5 is a block diagram of a disk operating system according to an embodiment of the present application;
FIG. 6 is a schematic structural diagram of a disk handling device according to an embodiment of the present application; and
fig. 7 is a schematic structural diagram of a disk mapping apparatus according to an embodiment of the present application.
Detailed Description
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only partial embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and claims of this application and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the application described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Example 1
There is also provided, in accordance with an embodiment of the present application, a method of disk operation, an embodiment of which is illustrated in the flowchart of the figure as being executable by a computer system, such as a set of computer-executable instructions, and where a logical order is illustrated in the flowchart, in some cases the steps shown or described may be executed out of order from that shown.
The method provided by the first embodiment of the present application may be executed in a mobile terminal, a computer terminal, or a similar computing device. Fig. 1 shows a hardware configuration block diagram of a computer terminal (or mobile device) for implementing a disk operation method. As shown in fig. 1, the computer terminal 10 (or mobile device 10) may include one or more (shown as 102a, 102b, … …, 102 n) processors 102 (the processors 102 may include, but are not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA, etc.), a memory 104 for storing data, and a transmission device 106 for communication functions. Besides, the method can also comprise the following steps: a display, an input/output interface (I/O interface), a Universal Serial Bus (USB) port (which may be included as one of the ports of the I/O interface), a network interface, a power source, and/or a camera. It will be understood by those skilled in the art that the structure shown in fig. 1 is only an illustration and is not intended to limit the structure of the electronic device. For example, the computer terminal 10 may also include more or fewer components than shown in FIG. 1, or have a different configuration than shown in FIG. 1.
It should be noted that the one or more processors 102 and/or other data processing circuitry described above may be referred to generally herein as "data processing circuitry". The data processing circuitry may be embodied in whole or in part in software, hardware, firmware, or any combination thereof. Further, the data processing circuit may be a single stand-alone processing module, or incorporated in whole or in part into any of the other elements in the computer terminal 10 (or mobile device). As referred to in the embodiments of the application, the data processing circuit acts as a processor control (e.g. selection of a variable resistance termination path connected to the interface).
The memory 104 may be used to store software programs and modules of application software, such as program instructions/data storage devices corresponding to the disk operating method in the embodiment of the present application, and the processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, implementing the disk operating method described above. The memory 104 may include high speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include memory located remotely from the processor 102, which may be connected to the computer terminal 10 via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission device 106 is used for receiving or transmitting data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider of the computer terminal 10. In one example, the transmission device 106 includes a Network adapter (NIC) that can be connected to other Network devices through a base station to communicate with the internet. In one example, the transmission device 106 can be a Radio Frequency (RF) module, which is used to communicate with the internet in a wireless manner.
The display may be, for example, a touch screen type Liquid Crystal Display (LCD) that may enable a user to interact with a user interface of the computer terminal 10 (or mobile device).
Here, it should be noted that in some alternative embodiments, the computer device (or mobile device) shown in fig. 1 described above may include hardware elements (including circuitry), software elements (including computer code stored on a computer-readable medium), or a combination of both hardware and software elements. It should be noted that fig. 1 is only one example of a particular specific example and is intended to illustrate the types of components that may be present in the computer device (or mobile device) described above.
The present application operates a method of operating a disk as shown in fig. 2 in the above-described operating environment. Fig. 2 is a flowchart of a disk operating method according to an embodiment of the present application, where the method is applied to a server side, and the server may be implemented based on the computer terminal described in fig. 1.
Referring to fig. 2, a disk operating method may include:
step S202: calling a background thread to mount a server disk partition, and hanging an operation function of the server disk partition;
in an alternative scenario, the server side runs, for example, the Sylix OS operating system, and the background thread is created by default for the module. The server disk partition may be mounted by mount command. In the background thread, for example, the following operational functions of the disk partition are mounted: the operation functions such as vBlkRd, vBlkWrt, vBlkIoctl, vBlkReset, vBlkStatus and the like are all disk operation related functions. The method comprises the following steps of obtaining a disk state check function, a disk read function, a disk write function, a disk ioctl correlation function, a disk reset function, a disk state check function and the like, wherein vBlkRd is a disk read function, vBlkWrt is a disk write function, vBlkIoctl is a disk ioctl correlation function, vBlkReset is a disk reset function, and vBlkStatus is a disk state check function and the like. The specific mode of hooking the operation function of the disk partition is to call a built-in API function API _ OemDiskMount in a SylixOS system, mount all partitions of one disk, and perform operations such as partition table scanning, partition number recording, partition logic device obtaining, volume serial number determining and the like.
Step S204: mapping the server disk partitions to the client through a network so as to form corresponding virtual disks at the client;
in an optional scheme, the server establishes a UDP/IP connection with the client to transmit disk operation instructions and operation data to implement mapping of disk partitions and disk operations without creating other third-party proxy components.
Step S206: receiving an operation instruction executed by a client to a virtual disk, and determining an operation function corresponding to the operation instruction;
in an alternative, instructions such as read operations, write operations, erase operations, etc. may be performed on the virtual disk at the client. The client transmits the operation instruction to the server through the network, and after receiving the operation instruction transmitted by the client, the server calls the operation function corresponding to the instruction according to the corresponding relation between the operation instruction and the operation function, so that corresponding operation can be performed on the local disk. In one embodiment, the corresponding relation between the operation function and the operation instruction is established in the background thread, so that the operation instruction executed aiming at the virtual disk is converted into the corresponding operation function executed aiming at the server disk partition. And a configuration file can also be established to store the corresponding relation between the operation function and the operation instruction, after the operation instruction is received, the conversion process is started, and the operation instruction is converted into the corresponding operation function by the conversion process and returned to the background thread. Through the mode that the two threads operate independently, the corresponding relation between the operation instruction and the operation function is convenient to change, and the operation method has better adaptability and flexibility.
Step S208: and the background thread executes an operation function on the server disk partition and returns an execution result to the client.
In an optional scheme, the server updates the execution result of the operation instruction to the client through the network, so as to implement the operation of the client on the virtual disk.
Through the steps S202-S208, the server disk partition is mounted by calling the background thread, and the operation function of the server disk partition is mounted; mapping the server disk partitions to the client through a network so as to form corresponding virtual disks at the client; receiving an operation instruction executed by a client to a virtual disk, and determining an operation function corresponding to the operation instruction; the background thread executes the operation function on the server disk partition and returns the execution result to the client, so that the mapping and remote operation transmission of the disk can be completed through the background thread without depending on other third-party middleware, and the technical problem of complex disk reading in the prior art is solved.
According to the scheme, the code is simple, the interface is simple, the third-party middleware is not required to be relied on, the background thread is directly connected with the disk operation function in an articulated mode, the operation is not required to be carried out through the VFS virtual file system, the transmission protocol only needs to encapsulate the operation command, and other RPC communication libraries are not required to be relied on.
The scheme of the application is simple to implement, and the codes are flexible and convenient to debug. The whole assembly consists of two main threads, namely a server background thread and a client operation thread. The background thread work flow of the server is clear, the problem can be positioned quickly, and a debugging log in the transmission process is provided, so that the correctness of the transmission command can be analyzed conveniently.
The application method of the scheme is simple, does not depend on other configuration files, does not need excessive setting, and can be realized by loading the client and the server program.
Optionally, the invoking an operation function of hooking the server disk partition by the background thread includes:
registering an operation function of the server disk partition in the background thread, so that the background thread can operate the server disk partition by calling the operation function;
and establishing a corresponding relation between the operation function and the operation instruction in the background thread so as to convert the operation instruction executed aiming at the virtual disk into the corresponding operation function executed aiming at the server disk partition.
Optionally, the operation function includes a read function, a write function, and/or an erase function.
Optionally, the server establishes a socket connection with the client, and transmits the operation instruction or the operation result through a UDP/IP protocol.
FIG. 3 is a flow chart of yet another method of disk operation according to an embodiment of the present application; as shown in figure 3 of the drawings,
the background thread of the server side realizes the whole mounting of the disk partition, and the identification of disk operation functions such as reading, writing, erasing and other commands is connected.
The client mainly reads the disk operation command in a circulating way and interacts with the server through the network.
After receiving the disk operation command transmitted by the client, the server end can perform read-write operation on the disk corresponding to the corresponding hooked operation function, and then updates the disk state to the client through network communication, so that the whole process is simple and clear.
The disk operation method provided by the application not only reduces the complexity of the program and the complexity of use, but also provides a shared disk directory which is directly connected and used based on the network UDP/IP.
It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present application is not limited by the order of acts described, as some steps may occur in other orders or concurrently depending on the application. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required in this application.
Through the above description of the embodiments, those skilled in the art can clearly understand that the disk operating method according to the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but the former is a better implementation mode in many cases. Based on such understanding, the technical solutions of the present application may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, or a network device) to execute the method of the embodiments of the present application.
Example 2
According to an embodiment of the present application, there is further provided an embodiment of a disk mapping method, where fig. 4 shows a flowchart of the disk mapping method, and referring to fig. 4, the method includes:
step S402: calling a background thread to mount a server disk partition;
step S404: an operation function of the server disk partition is hooked in the background thread, so that the background thread can operate the server disk partition by calling the operation function;
step S406: configuring a background thread to convert an operation instruction into an operation function;
step S408: and mapping the server disk partition to the client through the network, so that the client can execute operation instructions aiming at the mapping disk partition.
Through the steps S402-S408, the server disk partition is mounted by calling the background thread; an operation function of the server disk partition is hooked in the background thread, so that the background thread can operate the server disk partition by calling the operation function; configuring a background thread to convert an operation instruction into an operation function; mapping the server disk partition to the client through the network so that the client can execute an operation instruction aiming at the mapping disk partition; the mapping and remote operation transmission of the disk can be completed through the background thread without depending on other third-party middleware, and the technical problem that the disk is complex to read in the prior art is solved.
Optionally, the invoking an operation function of hooking the server disk partition by the background thread includes:
registering an operation function of the server disk partition in the background thread, so that the background thread can operate the server disk partition by calling the operation function;
and establishing a corresponding relation between the operation function and the operation instruction in the background thread so as to convert the operation instruction executed aiming at the virtual disk into the corresponding operation function executed aiming at the server disk partition.
Optionally, the operation function includes a read function, a write function, and/or an erase function.
Optionally, the server establishes a socket connection with the client, and transmits the operation instruction or the operation result through a UDP/IP protocol.
It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present application is not limited by the order of acts described, as some steps may occur in other orders or concurrently depending on the application. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required in this application.
Through the above description of the embodiments, those skilled in the art can clearly understand that the disk mapping method according to the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but the former is a better implementation mode in many cases. Based on such understanding, the technical solutions of the present application may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, or a network device) to execute the method of the embodiments of the present application.
Example 3
According to an embodiment of the present application, there is further provided a disk operating system, which can execute the disk operating method or the disk mapping method provided in embodiment 1 or 2, as shown in fig. 5, the system includes: a client and a server.
Calling a background thread at a server end to mount a server disk partition, and hanging an operation function of the server disk partition, so that the background thread can operate the server disk partition by calling the operation function; configuring a background thread to convert an operation instruction into an operation function; mapping the server disk partitions to the client through a network so as to form corresponding virtual disks at the client;
and executing an operation instruction on the virtual disk at the client, sending the operation instruction to the server through the network, and receiving an execution result of the server aiming at the operation instruction.
The CPU runs SylixOS, provides a whole set of software, firstly establishes UDP/IP connection, the remote server hooks a hook function of an operation disk by an agent thread, carries out integral partition mounting on a hardware disk, and transmits the hardware disk to a client through UDP/IP connection. The method is simple to implement, the mapping and remote transmission of the disk can be completed by the agent thread, and other third-party middleware is not relied on.
Optionally, the invoking an operation function of hooking the server disk partition by the background thread includes:
registering an operation function of the server disk partition in the background thread, so that the background thread can operate the server disk partition by calling the operation function;
and establishing a corresponding relation between the operation function and the operation instruction in the background thread so as to convert the operation instruction executed aiming at the virtual disk into the corresponding operation function executed aiming at the server disk partition.
Optionally, the operation function includes a read function, a write function, and/or an erase function.
Optionally, the server establishes a socket connection with the client, and transmits the operation instruction or the operation result through a UDP/IP protocol.
Example 4
According to an embodiment of the present application, there is also provided a disk operating apparatus for implementing the disk operating method, where the apparatus is implemented on a server side in a software or hardware manner, and the server may be implemented based on the computer terminal described in fig. 1.
FIG. 6 is a schematic structural diagram of a disk handling device according to an embodiment of the present application; as shown in fig. 6, the disk handling device 600 includes: a calling module 6002, a mapping module 6004, a receiving module 6006, and an executing module 6008. Wherein:
the calling module 6002 is configured to call a background thread to mount a server disk partition, and to attach an operation function of the server disk partition;
the mapping module 6004 is configured to map the server disk partition to the client through the network, so as to form a corresponding virtual disk at the client;
a receiving module 6006, configured to receive an operation instruction executed by a client on a virtual disk, and determine an operation function corresponding to the operation instruction;
and the executing module 6008 is configured to execute, by the background thread, an operation function on the server disk partition, and return an execution result to the client.
Here, it should be noted that the invoking module 6002, the mapping module 6004, the receiving module 6006, and the executing module 6008 correspond to steps S202 to S208 in embodiment 1, and the four modules are the same as the corresponding steps in the implementation example and the application scenario, but are not limited to the disclosure in embodiment 1. It should be noted that the above modules may be operated in the computer terminal 10 provided in embodiment 1 as a part of the apparatus.
Optionally, the invoking an operation function of hooking the server disk partition by the background thread includes:
registering an operation function of the server disk partition in the background thread, so that the background thread can operate the server disk partition by calling the operation function;
and establishing a corresponding relation between the operation function and the operation instruction in the background thread so as to convert the operation instruction executed aiming at the virtual disk into the corresponding operation function executed aiming at the server disk partition.
Optionally, the operation function includes a read function, a write function, and/or an erase function.
Optionally, the server establishes a socket connection with the client, and transmits the operation instruction or the operation result through a UDP/IP protocol.
Example 5
According to an embodiment of the present application, there is also provided a disk mapping apparatus for implementing the disk mapping method, where the apparatus is implemented on a server side in a software or hardware manner, and the server may be implemented based on the computer terminal described in fig. 1.
Fig. 7 is a schematic structural diagram of a disk mapping apparatus according to an embodiment of the present application. As shown in fig. 7, the disk mapping apparatus 700 includes: a mount module 7002, a mount module 7004, a configuration module 7006, and a network mapping module 7008. Wherein:
the mounting module 7002 is used for calling a background thread to mount the server disk partition;
the hooking module 7004 is used for hooking the operation function of the server disk partition in the background thread, so that the background thread can operate the server disk partition by calling the operation function;
a configuration module 7006, configured to configure a background thread so that the background thread can convert an operation instruction into an operation function;
and a network mapping module 7008, configured to map the server disk partition to the client through the network, so that the client may execute an operation instruction for the mapped disk partition.
Here, it should be noted that the above mounting module 7002, mounting module 7004, configuration module 7006, and network mapping module 7008 correspond to steps S402 to S408 in embodiment 2, and the above four modules are the same as the corresponding steps in the implementation example and application scenario, but are not limited to the disclosure in embodiment 1. It should be noted that the above modules may be operated in the computer terminal 10 provided in embodiment 1 as a part of the apparatus.
Optionally, the invoking an operation function of hooking the server disk partition by the background thread includes:
registering an operation function of the server disk partition in the background thread, so that the background thread can operate the server disk partition by calling the operation function;
and establishing a corresponding relation between the operation function and the operation instruction in the background thread so as to convert the operation instruction executed aiming at the virtual disk into the corresponding operation function executed aiming at the server disk partition.
Optionally, the operation function includes a read function, a write function, and/or an erase function.
Optionally, the server establishes a socket connection with the client, and transmits the operation instruction or the operation result through a UDP/IP protocol.
Example 6
Embodiments of the present application may provide a computing device, which may be any one of computer terminal devices in a computer terminal group. Optionally, in this embodiment, the computing device may also be replaced with a terminal device such as a mobile terminal.
Optionally, in this embodiment, the computing device may be located in at least one network device of a plurality of network devices of a computer network.
Optionally, in this embodiment, the above-mentioned computing device includes one or more processors, a memory, and a transmission device. The memory may be used to store software programs and modules, such as program instructions/modules corresponding to the disk operating method, the disk mapping method, and the apparatus in the embodiments of the present application. The processor executes various functional applications and data processing by running software programs and modules stored in the memory, that is, the above-described disk operation method and disk mapping method are realized.
Alternatively, the memory may include high speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory may further include memory located remotely from the processor, which may be connected to the computing device 120 over a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
In this embodiment, when the processor in the above-mentioned computing device runs the stored program code, the following method steps may be executed: calling a background thread to mount a server disk partition, and hanging an operation function of the server disk partition; mapping the server disk partitions to the client through a network so as to form corresponding virtual disks at the client; receiving an operation instruction executed by a client to a virtual disk, and determining an operation function corresponding to the operation instruction; and the background thread executes an operation function on the server disk partition and returns an execution result to the client.
In this embodiment, when the processor in the above-mentioned computing device runs the stored program code, the following method steps may be executed: calling a background thread to mount a server disk partition; an operation function of the server disk partition is hooked in the background thread, so that the background thread can operate the server disk partition by calling the operation function; configuring a background thread to convert an operation instruction into an operation function; and mapping the server disk partition to the client through the network, so that the client can execute operation instructions aiming at the mapping disk partition.
Further, in this embodiment, when the processor in the computing device runs the stored program code, any method step recited in embodiment 1 or embodiment 2 may be executed, which is not described in detail herein for brevity.
Example 7
Embodiments of the present application also provide a storage medium. Optionally, in this embodiment, the storage medium may be configured to store program codes executed by the disk operating method.
Optionally, in this embodiment, the storage medium may be located in any one of computer terminals in a computer terminal group in a computer network, or in any one of mobile terminals in a mobile terminal group.
Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: calling a background thread to mount a server disk partition, and hanging an operation function of the server disk partition; mapping the server disk partitions to the client through a network so as to form corresponding virtual disks at the client; receiving an operation instruction executed by a client to a virtual disk, and determining an operation function corresponding to the operation instruction; and the background thread executes an operation function on the server disk partition and returns an execution result to the client.
Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: calling a background thread to mount a server disk partition; an operation function of the server disk partition is hooked in the background thread, so that the background thread can operate the server disk partition by calling the operation function; configuring a background thread to convert an operation instruction into an operation function; and mapping the server disk partition to the client through the network, so that the client can execute operation instructions aiming at the mapping disk partition.
Further, in this embodiment, the storage medium is configured to store the program code for executing any one of the method steps listed in embodiment 1 or embodiment 2, which is not described in detail for the sake of brevity.
The above-mentioned serial numbers of the embodiments of the present application are merely for description and do not represent the merits of the embodiments.
In the above embodiments of the present application, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the embodiments provided in the present application, it should be understood that the disclosed technology can be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, a division of a unit is merely a division of a logic function, and an actual implementation may have another division, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, units or modules, and may be in an electrical or other form.
Units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed to by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
The foregoing is only a preferred embodiment of the present application and it should be noted that those skilled in the art can make several improvements and modifications without departing from the principle of the present application, and these improvements and modifications should also be considered as the protection scope of the present application.

Claims (10)

1. A method of operating a disk, comprising:
calling a background thread to mount a server disk partition, and hanging an operation function of the server disk partition;
mapping the server disk partitions to clients through a network to form corresponding virtual disks at the clients;
receiving an operation instruction executed by a client to the virtual disk, and determining an operation function corresponding to the operation instruction;
and the background thread executes the operation function on the server disk partition and returns an execution result to the client.
2. The method of claim 1, wherein invoking a background thread to hook an operation function of the server disk partition comprises:
registering an operation function of a server disk partition in the background thread, so that the background thread can operate the server disk partition by calling the operation function;
and establishing a corresponding relation between the operation function and the operation instruction in the background thread so as to convert the operation instruction executed aiming at the virtual disk into a corresponding operation function executed aiming at the server disk partition.
3. The method of claim 1, wherein the operation function comprises a read function, a write function, and/or an erase function.
4. The method according to claim 1, wherein the server establishes a socket connection with the client, and transmits the operation instruction or the operation result through a UDP/IP protocol.
5. A disk mapping method, comprising:
calling a background thread to mount a server disk partition;
hooking an operation function of the server disk partition in the background thread, so that the background thread can operate the server disk partition by calling the operation function;
configuring the background thread to convert the operation instruction into the operation function;
and mapping the server disk partition to the client through the network so that the client can execute operation instructions aiming at the mapping disk partition.
6. A disk handling device, comprising:
the calling module is used for calling a background thread to mount a server disk partition and hanging an operation function of the server disk partition;
the mapping module is used for mapping the server disk partitions to the client through a network so as to form corresponding virtual disks at the client;
the receiving module is used for receiving an operation instruction executed by a client to the virtual disk and determining an operation function corresponding to the operation instruction;
and the execution module is used for executing the operation function on the server disk partition by the background thread and returning an execution result to the client.
7. A disk mapping apparatus, comprising:
the mounting module is used for calling a background thread to mount the server disk partition;
the hooking module is used for hooking the operation function of the server disk partition in the background thread so that the background thread can operate the server disk partition by calling the operation function;
the configuration module is used for configuring the background thread to convert the operation instruction into the operation function;
and the network mapping module is used for mapping the server disk partition to the client through a network so as to execute an operation instruction on the mapping disk partition at the client.
8. A disk operating system is characterized in that it comprises a server end and a client end, wherein,
calling a background thread at a server end to mount a server disk partition, and hanging an operation function of the server disk partition, so that the background thread can operate the server disk partition by calling the operation function; configuring the background thread to convert the operation instruction into the operation function; mapping the server disk partitions to clients through a network to form corresponding virtual disks at the clients;
and executing an operation instruction on the virtual disk at the client, sending the operation instruction to a server through a network, and receiving an execution result of the server aiming at the operation instruction.
9. A storage medium, characterized in that the storage medium comprises a stored program, wherein the device on which the storage medium is located is controlled to perform the method according to any of claims 1-5 when the program is run.
10. A computing device comprising a processor, wherein the processor is configured to execute a program, wherein the program when executed performs the method of any of claims 1-5.
CN202110066919.0A 2021-01-19 2021-01-19 Disk operation method, device, system, storage medium and computing equipment Pending CN112667172A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110066919.0A CN112667172A (en) 2021-01-19 2021-01-19 Disk operation method, device, system, storage medium and computing equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110066919.0A CN112667172A (en) 2021-01-19 2021-01-19 Disk operation method, device, system, storage medium and computing equipment

Publications (1)

Publication Number Publication Date
CN112667172A true CN112667172A (en) 2021-04-16

Family

ID=75415635

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110066919.0A Pending CN112667172A (en) 2021-01-19 2021-01-19 Disk operation method, device, system, storage medium and computing equipment

Country Status (1)

Country Link
CN (1) CN112667172A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113190181A (en) * 2021-05-28 2021-07-30 北京鼎普科技股份有限公司 Virtual disk mounting method and system

Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH088957A (en) * 1994-06-24 1996-01-12 Hitachi Ltd Transmission line connector and distributed remote file system
US5838910A (en) * 1996-03-14 1998-11-17 Domenikos; Steven D. Systems and methods for executing application programs from a memory device linked to a server at an internet site
US7606868B1 (en) * 2006-03-30 2009-10-20 Wmware, Inc. Universal file access architecture for a heterogeneous computing environment
CN102385486A (en) * 2010-09-03 2012-03-21 深圳市拾三意强者科技有限公司 Method and device for penetrating and reducing disk and equipment
CN103841113A (en) * 2014-03-20 2014-06-04 武汉理工大学 Safe network file system based on user mode file system
CN104391657A (en) * 2014-11-24 2015-03-04 上海盈方微电子有限公司 Method for mounting multi-partition storage device in Android system
CN105138281A (en) * 2015-08-05 2015-12-09 华为技术有限公司 Physical disk sharing method and apparatus
US20160134702A1 (en) * 1999-01-22 2016-05-12 Ilya Gertner Data sharing using distributed cache in a network of heterogeneous computers
CN106559392A (en) * 2015-09-28 2017-04-05 北京神州泰岳软件股份有限公司 A kind of file sharing method, device and system
CN109189342A (en) * 2018-08-30 2019-01-11 郑州云海信息技术有限公司 A kind of disk hanging method, device, equipment and storage medium
CN110109765A (en) * 2019-05-15 2019-08-09 深圳市网心科技有限公司 Storage device recognition methods, electronic equipment, system and medium
CN110196839A (en) * 2019-05-05 2019-09-03 视联动力信息技术股份有限公司 A kind of shared file method and apparatus based on view networking
CN111881104A (en) * 2020-07-29 2020-11-03 苏州浪潮智能科技有限公司 NFS server, data writing method and device thereof, and storage medium
CN112000635A (en) * 2020-08-20 2020-11-27 苏州浪潮智能科技有限公司 Data request method, device and medium

Patent Citations (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH088957A (en) * 1994-06-24 1996-01-12 Hitachi Ltd Transmission line connector and distributed remote file system
US5838910A (en) * 1996-03-14 1998-11-17 Domenikos; Steven D. Systems and methods for executing application programs from a memory device linked to a server at an internet site
US20160134702A1 (en) * 1999-01-22 2016-05-12 Ilya Gertner Data sharing using distributed cache in a network of heterogeneous computers
US7606868B1 (en) * 2006-03-30 2009-10-20 Wmware, Inc. Universal file access architecture for a heterogeneous computing environment
CN102385486A (en) * 2010-09-03 2012-03-21 深圳市拾三意强者科技有限公司 Method and device for penetrating and reducing disk and equipment
CN103841113A (en) * 2014-03-20 2014-06-04 武汉理工大学 Safe network file system based on user mode file system
CN104391657A (en) * 2014-11-24 2015-03-04 上海盈方微电子有限公司 Method for mounting multi-partition storage device in Android system
CN105138281A (en) * 2015-08-05 2015-12-09 华为技术有限公司 Physical disk sharing method and apparatus
WO2017020668A1 (en) * 2015-08-05 2017-02-09 华为技术有限公司 Physical disk sharing method and apparatus
CN106559392A (en) * 2015-09-28 2017-04-05 北京神州泰岳软件股份有限公司 A kind of file sharing method, device and system
CN109189342A (en) * 2018-08-30 2019-01-11 郑州云海信息技术有限公司 A kind of disk hanging method, device, equipment and storage medium
CN110196839A (en) * 2019-05-05 2019-09-03 视联动力信息技术股份有限公司 A kind of shared file method and apparatus based on view networking
CN110109765A (en) * 2019-05-15 2019-08-09 深圳市网心科技有限公司 Storage device recognition methods, electronic equipment, system and medium
CN111881104A (en) * 2020-07-29 2020-11-03 苏州浪潮智能科技有限公司 NFS server, data writing method and device thereof, and storage medium
CN112000635A (en) * 2020-08-20 2020-11-27 苏州浪潮智能科技有限公司 Data request method, device and medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113190181A (en) * 2021-05-28 2021-07-30 北京鼎普科技股份有限公司 Virtual disk mounting method and system

Similar Documents

Publication Publication Date Title
CN104360883A (en) Method and system for configuring Raid (Redundant array of independent disks)
US20160246510A1 (en) Platform non-volatile storage management and platform configuration
US8498633B2 (en) Method, system and device for initializing internet device
CN110275775A (en) Resource allocation method, system and the storage medium of container application
US20170249165A1 (en) Usb wireless network card configuration methods, host, usb wireless network card and communication system
RU2431235C2 (en) Method of identifying devices in working environments of mobile communication and desktop computers
CN111367685B (en) Interface calling method and device, computer equipment and storage medium
CN112667172A (en) Disk operation method, device, system, storage medium and computing equipment
CN114637549A (en) Data processing method, system and storage medium for service grid-based application
CN114691390A (en) User mode program processing method and device, storage medium and processor
CN112463035B (en) Method, system, device and medium for using storage device based on cloud platform
EP3499365A1 (en) Method and device for use in accessing container
CN210006026U (en) Cloud technology service system
CN112416617A (en) Control method and device of Bluetooth equipment, storage medium and electronic device
CN106648805A (en) Intelligent device, intelligent system, and method for intelligently installing application
CN110737502A (en) Method, device and system for processing mirror image file
CN112818336A (en) Data access method, data access device and computer readable storage medium
KR101412310B1 (en) Virtual device cloud network system and method for providing applications on heterogeneous device platform
CN109426571B (en) Method, system, storage medium, processor and apparatus for function call and data access
CN107231244B (en) System, method and device for initializing encryption machine
CN113703676B (en) Calling method, device, equipment and medium for double live volumes
CN112367656B (en) ZigBee gateway control method and device, storage medium and gateway
CN114327748B (en) Virtual machine interaction method and device, nonvolatile storage medium and processor
CN114980038A (en) Robot system, method and device for data communication
CN109426573B (en) Communication method, device, equipment and gateway adapter between incompatible objects

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