CN109144403B - Method and equipment for switching cloud disk modes - Google Patents

Method and equipment for switching cloud disk modes Download PDF

Info

Publication number
CN109144403B
CN109144403B CN201710466579.4A CN201710466579A CN109144403B CN 109144403 B CN109144403 B CN 109144403B CN 201710466579 A CN201710466579 A CN 201710466579A CN 109144403 B CN109144403 B CN 109144403B
Authority
CN
China
Prior art keywords
mode
request
cloud disk
disk
data block
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
Application number
CN201710466579.4A
Other languages
Chinese (zh)
Other versions
CN109144403A (en
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.)
Alibaba Group Holding Ltd
Original Assignee
Alibaba Group Holding 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 Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201710466579.4A priority Critical patent/CN109144403B/en
Publication of CN109144403A publication Critical patent/CN109144403A/en
Application granted granted Critical
Publication of CN109144403B publication Critical patent/CN109144403B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input 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/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0614Improving the reliability of storage systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input 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/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0646Horizontal data movement in storage systems, i.e. moving data in between storage devices or systems
    • G06F3/0647Migration mechanisms
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input 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/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/067Distributed or networked storage systems, e.g. storage area networks [SAN], network attached storage [NAS]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1097Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]

Abstract

The application aims to provide a method and equipment for switching cloud disk modes; acquiring a cloud disk mode switching request of a target cloud disk; and based on the cloud disk mode switching request, re-matching the corresponding hard disk for each data block of the target cloud disk. Compared with the prior art, the switching of the cloud disk mode can be based on the existing hard disk deployment of the target cloud disk, so that the storage resource can be effectively saved; meanwhile, the cloud disk mode is switched by re-matching the hard disk for each data block, so that partial data is not needed or only needs to be dumped, the whole switching time is greatly shortened compared with the whole cloud disk migration in the prior art; in addition, after the cloud disk mode is switched, the cloud disk does not need to be mounted again, so that the continuity of the service can be effectively guaranteed.

Description

Method and equipment for switching cloud disk modes
Technical Field
The present application relates to the field of computers, and in particular, to a technique for cloud disk mode switching.
Background
Generally, a cloud computing market provides a user with available high-efficiency cloud disks and common cloud disks, but the user can only select one cloud disk mode at a time, namely, the high-efficiency cloud disk or the common cloud disk. In the prior art, if a user purchases a high-efficiency cloud disk, but the user wants to change the high-efficiency cloud disk into a common cloud disk because of business requirements, only a common cloud disk can be newly built, data on the high-efficiency cloud disk is transferred to the common cloud disk, and then the original high-efficiency cloud disk is deleted; on the contrary, if a user purchases a common cloud disk and wants to change the common cloud disk into a high-efficiency cloud disk, only a new high-efficiency cloud disk can be created, data on the common cloud disk is migrated to the high-efficiency cloud disk, and then the original common cloud disk is deleted. However, the data migration method of the cloud disk has the following disadvantages:
firstly, the prior art needs to occupy storage space which is twice as large as the original cloud disk for data migration, which causes great waste on storage resources;
secondly, the prior art needs a long time to realize the whole data migration, and the whole migration process has a great influence on the service;
thirdly, in the prior art, the new cloud disk needs to be mounted again after the cloud disk is migrated, and therefore, the continuity of the original service cannot be ensured in the cloud disk migration process.
Disclosure of Invention
The application aims to provide a method and equipment for switching cloud disk modes, so as to solve the technical problem that efficient switching of different cloud disk modes cannot be realized in the prior art.
According to an aspect of the present application, there is provided a method for cloud disk mode switching, including:
acquiring a cloud disk mode switching request of a target cloud disk, wherein the target cloud disk corresponds to one or more data blocks, the cloud disk mode comprises a first cloud disk mode or a second cloud disk mode, in the first cloud disk mode, data corresponding to each data block of the target cloud disk is always stored in a corresponding mechanical hard disk, and in the second cloud disk mode, data corresponding to each data block of the target cloud disk is stored in a corresponding mechanical hard disk or a corresponding solid state hard disk;
and based on the cloud disk mode switching request, re-matching the corresponding hard disk for each data block of the target cloud disk.
According to yet another aspect of the present application, there is provided a method for memory space mode switching, including:
acquiring a storage space mode switching request of a target storage space, wherein the target storage space corresponds to one or more data blocks, the storage space mode comprises a first storage space mode or a second storage space mode, under the first storage space mode, data corresponding to the data blocks of the target storage space are stored in a corresponding first type of storage medium, and under the second storage space mode, data corresponding to the data blocks of the target storage space are stored in a corresponding first type of storage medium or a corresponding second type of storage medium;
and based on the target storage space mode switching request, re-matching the corresponding storage medium for the data block of the target storage space.
According to another aspect of the present application, there is also provided a network device for cloud disk mode switching, including:
the switching request acquisition device is used for acquiring a cloud disk mode switching request of a target cloud disk, wherein the target cloud disk corresponds to one or more data blocks, the cloud disk mode comprises a first cloud disk mode or a second cloud disk mode, under the first cloud disk mode, data corresponding to each data block of the target cloud disk is always stored in a corresponding mechanical hard disk, and under the second cloud disk mode, data corresponding to each data block of the target cloud disk is stored in a corresponding mechanical hard disk or a corresponding solid state hard disk;
and the switching device is used for re-matching each data block of the target cloud disk with the corresponding hard disk based on the cloud disk mode switching request.
According to yet another aspect of the present application, there is provided a network device for storage space mode switching, comprising:
a switching request obtaining device, configured to obtain a storage space mode switching request of a target storage space, where the target storage space corresponds to one or more data blocks, and the storage space mode includes a first storage space mode or a second storage space mode, where in the first storage space mode, data corresponding to a data block of the target storage space is stored in a corresponding first type of storage medium, and in the second storage space mode, data corresponding to a data block of the target storage space is stored in a corresponding first type of storage medium or a corresponding second type of storage medium;
and the switching device is used for re-matching the corresponding storage medium for the data block of the target storage space based on the target storage space mode switching request.
According to another aspect of the present application, there is also provided an apparatus for cloud disk mode switching, including:
a processor; and
a memory arranged to store computer executable instructions that, when executed, cause the processor to:
acquiring a cloud disk mode switching request of a target cloud disk, wherein the target cloud disk corresponds to one or more data blocks, the cloud disk mode comprises a first cloud disk mode or a second cloud disk mode, in the first cloud disk mode, data corresponding to each data block of the target cloud disk is always stored in a corresponding mechanical hard disk, and in the second cloud disk mode, data corresponding to each data block of the target cloud disk is stored in a corresponding mechanical hard disk or a corresponding solid state hard disk;
and based on the cloud disk mode switching request, re-matching the corresponding hard disk for each data block of the target cloud disk.
According to another aspect of the present application, there is also provided an apparatus for memory space mode switching, wherein the apparatus includes:
a processor; and
a memory arranged to store computer executable instructions that, when executed, cause the processor to:
acquiring a storage space mode switching request of a target storage space, wherein the target storage space corresponds to one or more data blocks, the storage space mode comprises a first storage space mode or a second storage space mode, under the first storage space mode, data corresponding to the data blocks of the target storage space are stored in a corresponding first type of storage medium, and under the second storage space mode, data corresponding to the data blocks of the target storage space are stored in a corresponding first type of storage medium or a corresponding second type of storage medium;
and based on the target storage space mode switching request, re-matching the corresponding storage medium for the data block of the target storage space.
Compared with the prior art, the cloud disk mode switching method and the cloud disk mode switching device can realize the random switching of the cloud disk modes between the first cloud disk mode and the second cloud disk mode of the target cloud disk based on one cloud disk mode switching request, namely, the cloud disk mode is quickly changed by means of re-matching each data block of the target cloud disk with the corresponding hard disk. The switching of the cloud disk mode can be based on the existing hard disk deployment of the target cloud disk, and a new hard disk does not need to be re-deployed outside the existing hard disk corresponding to the target cloud disk for cloud disk migration, so that the storage resource can be effectively saved; meanwhile, the cloud disk mode is switched by re-matching the hard disk for each data block, so that partial data is not needed or only needs to be dumped, the whole switching time is greatly shortened compared with the whole cloud disk migration in the prior art; in addition, after the cloud disk mode is switched, the cloud disk does not need to be mounted again, so that the continuity of the service can be effectively guaranteed. Further, the switching of the cloud disk modes in the application can be performed in a bidirectional and repeated manner between the first cloud disk mode and the second cloud disk mode, and the switching operation is simple and the resource loss is low, so that the application can help a user to realize the configuration of one cloud disk, namely, the service requirements of the two cloud disk modes can be obtained, and the switching requirement of the cloud disk modes of the user at any time and any place can be effectively met.
Drawings
Other features, objects and advantages of the present application will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings in which:
FIG. 1 illustrates a flow diagram of a method for cloud disk mode switching, according to an aspect of the subject application;
FIG. 2 illustrates a device diagram of a network device for cloud disk mode switching, according to an aspect of the subject application;
fig. 3 illustrates an exemplary diagram of a scenario for cloud disk mode switching in accordance with an aspect of the subject application.
The same or similar reference numbers in the drawings identify the same or similar elements.
Detailed Description
The present application is described in further detail below with reference to the attached figures.
In a typical configuration of the present application, the terminal, the device serving the network, and the trusted party each include one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include non-transitory computer readable media (transient media), such as modulated data signals and carrier waves.
The embodiment of the present application further provides a network device for cloud disk mode switching, where the network device includes, but is not limited to, a computer, a network host, a single network server, multiple network server sets, or a cloud server, where the cloud server is a virtual supercomputer operating in a distributed system and composed of a group of loosely coupled computer sets, and is used to implement a simple, efficient, safe, reliable, and computing service with elastically scalable processing capability. In one implementation, the network device may include a device cluster composed of a plurality of network servers, where the network device may correspond to a data storage system for implementing data storage, where the plurality of network servers corresponding to the network device may include one or more storage servers. In one implementation, each storage server may include one or more solid state disks and one or more mechanical hard disks. In one implementation, the cloud disk file may be decomposed into data blocks, and corresponding data of the data blocks is to be stored in hard disks corresponding to one or more storage servers. Further, in an implementation manner, the plurality of corresponding network servers of the network device may further include one or more management servers to perform operations of creating a data block for cloud disk creation, matching a response storage server, traversing a cloud disk file, and the like. In this application, the network device may be referred to as network device 1 in fig. 2.
Fig. 2 shows a device schematic diagram of a network device 1 for cloud disk mode switching according to an aspect of the present application. The network device 1 may include a handover request obtaining means 201 and a handover means 202.
Specifically, the switching request obtaining device 201 may obtain a cloud disk mode switching request of a target cloud disk, where the target cloud disk corresponds to one or more data blocks, and the cloud disk mode includes a first cloud disk mode or a second cloud disk mode, where in the first cloud disk mode, data corresponding to the data blocks of the target cloud disk is stored in a corresponding mechanical hard disk, and in the second cloud disk mode, data corresponding to the data blocks of the target cloud disk is stored in a corresponding mechanical hard disk or a corresponding solid state hard disk.
In one implementation, the first cloud disk mode may correspond to a common cloud disk, for example, the common cloud disk may store a data block corresponding to the common cloud disk by using a storage server or a storage server cluster in which only a mechanical hard disk is deployed, in the first cloud disk mode, a write operation on the data block may be directly written into the corresponding mechanical hard disk, and a read operation on the data block may also be directly read from the mechanical hard disk; the second cloud disk mode may correspond to a high-efficiency cloud disk, for example, the high-efficiency cloud disk may be a data block corresponding to the high-efficiency cloud disk stored by using a storage server or a storage server cluster in which a mechanical hard disk and a solid-state hard disk are simultaneously deployed, in the second cloud disk mode, a write operation on the data block may be directly written into the corresponding solid-state hard disk, a background thread may transfer data corresponding to the data block of the cloud disk file in the solid-state hard disk to the corresponding mechanical hard disk, accordingly, when a read operation is performed on data of the data block, it may be determined whether the data has been transferred from the solid-state hard disk to the corresponding mechanical hard disk, if not, the data is read from the solid-state hard disk, and if so, the data is read from the mechanical hard disk. In one implementation, the mechanical hard disk may correspond to various interfaces, for example, the mechanical hard disk may be a SATA hard disk corresponding to a SATA interface, and here, the solid state hard disk is also referred to as an SSD hard disk. Because the performance of the solid state disk is better than that of a mechanical hard disk, and the data read-write speed is higher, in practical application, the second cloud disk mode based on the hybrid hard disk can better cope with application scenes with high requirements on frequent user access and high database delay, and in comparison, the first cloud disk mode based on the mechanical hard disk is higher in cost performance applicable to common scenes with general access volumes, so that the two cloud disk modes respectively have suitable application scenes, and the same user can have requirements on the two cloud disk modes under different scenes. Therefore, the user can conveniently and rapidly switch the two cloud disk modes at any time, namely the technical effect which can be realized by the technical scheme of the application.
Here, the handover request acquiring means 201 may acquire a cloud disk mode handover request of the target cloud disk. In one implementation, the cloud disk mode switch request includes any one of: a request to switch from the second cloud disk mode to the first cloud disk mode; a request to switch from a first cloud disk mode to a second cloud disk mode. Here, the purpose of the cloud disk mode switching request is to switch a target cloud disk from a current cloud disk mode to another cloud disk mode, and the cloud disk mode can be switched quickly and efficiently based on the technical solution of the present application. Here, in an implementation manner, the acquisition of the cloud disk mode switching request may be that a target cloud disk corresponds to a user who actively submits the cloud disk mode switching request, for example, on a user device of the user, there is an operation button or an operation area corresponding to the cloud disk mode switching request. In another implementation, the cloud disk mode switching request may be obtained, after a preset triggering condition for cloud disk mode switching is reached, the cloud disk mode switching request may be automatically initiated to the network device by a user device corresponding to the user, for example, if a current target cloud disk corresponds to the first cloud disk mode, the triggering condition may be set such that, when a current access data volume of the target cloud disk reaches a preset access volume threshold, the user device automatically submits a request for switching from the first cloud disk mode to the second cloud disk mode, so as to better meet a current demand of the user through efficient data storage and access service of the second cloud disk mode; for another example, if the current target cloud disk corresponds to the second cloud disk mode, the triggering condition may be set to be that, if the storage data of the data block corresponding to the target cloud disk is lower than a preset storage threshold, the user equipment automatically submits a request for switching from the second cloud disk mode to the first cloud disk mode, so as to better save hard disk resources. It should be understood by those skilled in the art that the triggering condition corresponding to the above-mentioned user equipment automatically initiating the cloud disk mode switching request to the network device is only an example, and other triggering conditions that may occur now or in the future are also included in the scope of the present application and are included by reference if it is possible to implement that the user equipment automatically initiates the cloud disk mode switching request to the network device.
In an implementation manner of the present application, the network device 1 further includes a creation request obtaining device, a data block determining device, a disk selection device, and a data block meta information storage device. Specifically, the creation request obtaining device may obtain a creation request of a target cloud disk, where the creation request includes a first cloud disk mode creation request or a second cloud disk mode creation request corresponding to the target cloud disk; the data block determining device may determine one or more data blocks corresponding to the target cloud disk to be created, based on file size information corresponding to the target cloud disk, where in an implementation manner, the data blocks may be allocated to one or more storage servers by a management server in a network device, and each storage server may include one or more solid state disks and one or more mechanical hard disks thereon; if the creation request is a first cloud disk mode creation request, the disk selection device may match a mechanical hard disk for each data block, and if the creation request is a second cloud disk mode creation request, the disk selection device may match a mechanical hard disk and a solid state hard disk for each data block, and in one implementation manner, the mechanical hard disk and the solid state hard disk of each data block may correspond to the same storage server; the data block meta-information storage device may record and store data block meta-information corresponding to each data block after the disk selection device matches a corresponding hard disk for each data block, where the data block meta-information may include mechanical hard disk meta-information if the created target cloud disk is the first cloud disk mode; if the created target cloud disk is in the second cloud disk mode, the data block meta-information may include mechanical hard disk meta-information and solid state hard disk meta-information. Here, the hard disk cloud information may include identification information of each hard disk for distinguishing each hard disk, for example, ID information of the hard disk, such as SsdDiskId or satadiiskid, which refer to a solid state disk ID and a mechanical hard disk ID, respectively.
Then, the switching device 202 may re-match the data blocks of the target cloud disk with the corresponding hard disk based on the cloud disk mode switching request. In one implementation, the mechanical hard disk corresponding to the data block remains unchanged. In the present application, two modes of the same target cloud disk, that is, a first cloud disk mode and a second cloud disk mode have different configuration requirements for a hard disk, on the basis of a cloud disk mode before switching, a hard disk corresponding to each data block of the target cloud disk is reconfigured, and because both the first cloud disk mode and the second cloud disk mode need to be matched with a corresponding mechanical hard disk, in the present application, a matching relationship between each data block of the target cloud disk and a corresponding mechanical hard disk is maintained, and further, when the cloud disk mode switching request is received, if the cloud disk mode switching request is a request for switching from the second cloud disk mode to the first cloud disk mode, only the solid state hard disk corresponding to each data block in the first cloud disk mode needs to be reduced; if the cloud disk mode switching request is a request for switching from a first cloud disk mode to a second cloud disk mode, only the solid state disk corresponding to each data block needs to be added to the target cloud disk, and the hard disk configuration needs of the switched cloud disk mode can be met, so that the successful switching of the target cloud disk is realized. In an implementation manner, each storage server may include one or more solid state disks and one or more mechanical hard disks, so that in a scenario where a corresponding solid state disk is added to a data block of a target cloud disk, one solid state disk may be selected from the storage server where the mechanical hard disk corresponding to each data block is located to match the corresponding data block, and therefore, in the present application, it is not necessary to deploy an alternative storage space corresponding to the current size of the target cloud disk to implement overall migration of the cloud disk; in the scenario of reducing the corresponding solid state disk for the data block of the target cloud disk, only the re-matching of the corresponding hard disk needs to be realized without adding a new hard disk, for example, the data block meta information of each stored data block is updated, and in this scenario, the occupation of the storage space is reduced rather than before the switching. In an implementation manner, the re-matching of the corresponding hard disk for each data block of the target cloud disk may include a dumping operation of specific data in the hard disk with which the data block is matched, and may further include an update of a matching relationship between the data block and the hard disk, for example, an update of meta information of each data block of the target cloud disk. Based on this, the method and the device can realize that after the operation of re-matching the corresponding hard disk based on each data block, when the corresponding user accesses the target cloud disk again, the corresponding user enters a new cloud disk mode after switching. In addition, in an implementation manner, switching of the cloud disk mode of the target cloud disk in the present application may be performed in two directions and any number of times based on the needs of the user.
Here, the cloud disk mode can be switched between the first cloud disk mode and the second cloud disk mode of the target cloud disk based on one cloud disk mode switching request, that is, the cloud disk mode can be changed quickly by re-matching each data block of the target cloud disk with the corresponding hard disk. The switching of the cloud disk mode can be based on the existing hard disk deployment of the target cloud disk, and a new hard disk does not need to be re-deployed outside the existing hard disk corresponding to the target cloud disk for cloud disk migration, so that the storage resource can be effectively saved; meanwhile, the cloud disk mode is switched by re-matching the hard disk for each data block, so that partial data is not needed or only needs to be dumped, the whole switching time is greatly shortened compared with the whole cloud disk migration in the prior art; in addition, after the cloud disk mode is switched, the cloud disk does not need to be mounted again, so that the continuity of the service can be effectively guaranteed. Further, the switching of the cloud disk modes in the application can be performed in a bidirectional and repeated manner between the first cloud disk mode and the second cloud disk mode, and the switching operation is simple and the resource loss is low, so that the application can help a user to realize the configuration of one cloud disk, namely, the service requirements of the two cloud disk modes can be obtained, and the switching requirement of the cloud disk modes of the user at any time and any place can be effectively met.
In an implementation manner of the present application, if the cloud disk mode switching request includes a request for switching from the second cloud disk mode to the first cloud disk mode, the switching device 202 may dump the data blocks of the target cloud disk stored in the corresponding solid state disk into the mechanical hard disk corresponding to the solid state disk based on the request for switching from the second cloud disk mode to the first cloud disk mode. The switching device 202 may further update data block meta-information corresponding to each data block, where the data block meta-information includes at least any one of: solid state disk meta information; and mechanical hard disk meta information.
In this implementation manner, the second cloud disk mode is used before switching, in this cloud disk mode, data corresponding to the data blocks can be directly written into the corresponding solid state disk, the background thread can periodically transfer the data in the solid state disk to the corresponding mechanical hard disk, and at this time, if the cloud disk mode needs to be switched to the first cloud disk mode, all data that have not been transferred to the corresponding mechanical hard disk in the current solid state disk need to be completely transferred, so that the original matching relationship between each data block and the corresponding solid state disk is cancelled. In one implementation manner, all data blocks corresponding to the cloud disk file may be traversed, an operation of completely dumping data from the solid state disk to the mechanical hard disk may be performed on each data block, and data block meta information corresponding to each data block may be updated. In one implementation, the updating the data block meta information corresponding to each data block includes: deleting the solid state disk meta-information corresponding to the data block, wherein the mechanical hard disk meta-information corresponding to the data block is reserved; then, the data block meta-information is persisted. Here, in an implementation manner, the meta-information of the data block before switching includes solid state disk meta-information corresponding to the data block, for example, SsdDiskId corresponding to the data block, and mechanical disk meta-information, for example, sataddiskid corresponding to the same data block. And after all the data are dumped to the mechanical hard disk, deleting the SsdDiskId corresponding to the data block, reserving the SatadDiskId corresponding to the data block, then, persisting the metadata of the data block, and storing the metadata of the data block in the hard disk.
Further, in an implementation manner, the network device 1 further includes a first access request obtaining device and a first access request processing device, where the first access request obtaining device may obtain an access request of a user to a target cloud disk, where the access request is a write data request or a read data request; if the access request is a write data request, the first access request processing device may write data corresponding to the write data request into the corresponding mechanical hard disk based on the updated data block meta information, and if the access request is a read data request, the first access request processing device may read data corresponding to the read data request from the corresponding mechanical hard disk based on the updated data block meta information. Here, after the operation of re-matching the corresponding hard disk based on each data block, the cloud disk mode corresponding to the target cloud disk has been changed, and when a corresponding user accesses the target cloud disk again at this time, the corresponding user enters a new cloud disk mode after switching, and based on the updated data block meta information corresponding to the accessed data block, the read-write operation corresponding to the user access request is executed based on the new cloud disk mode, that is, the first cloud disk mode.
In an implementation manner of the present application, if the cloud disk mode switching request includes a request for switching from a first cloud disk mode to a second cloud disk mode, the switching device 202 may match a solid state disk for each data block of the target cloud disk based on the request for switching from the first cloud disk mode to the second cloud disk mode; the switching device 202 may further update data block meta-information corresponding to each data block, where the data block meta-information includes at least any one of: solid state disk meta information; and mechanical hard disk meta information.
In this implementation, the switching is preceded by a first cloud disk mode, in which data corresponding to the data block is directly written into a corresponding mechanical hard disk, but a solid-state hard disk corresponding to the mechanical hard disk is required for a second cloud disk mode to which switching is required. In an implementation manner, all data blocks corresponding to the cloud disk file may be traversed, one solid state disk is selected from a storage server where the mechanical hard disk corresponding to each data block is located and is matched with the corresponding data block, and the data block meta information corresponding to each data block is updated based on the allocated solid state disk. In one implementation, the updating the data block meta information corresponding to the data block includes: adding solid state disk meta-information corresponding to each data block, wherein the mechanical hard disk meta-information corresponding to each data block remains unchanged; then, the data block meta-information is persisted. Here, in an implementation manner, the meta-information of the data block before switching includes meta-information of a mechanical hard disk corresponding to the data block, for example, a satadik id corresponding to the same data block. After a solid state disk corresponding to the data block is determined, adding the added meta-information of the solid state disk, such as the SsdDiskId corresponding to the data block, to the original meta-information of the data block, then persisting the meta-information of the data block, and storing the meta-information of the data block in the hard disk.
Further, in an implementation manner, the network device 1 further includes a second access request obtaining device and a second access request processing device, where the second access request obtaining device may obtain an access request of a user to a target cloud disk, where the access request is a write data request or a read data request; if the access request is a write data request, the second access request processing device may write data corresponding to the write data request into the corresponding solid state disk based on the updated data block meta information, and if the access request is a read data request, the second access request processing device may read data corresponding to the read data request from the corresponding solid state disk or mechanical hard disk based on the updated data block meta information. Here, after the operation of re-matching the corresponding hard disk based on each data block, the cloud disk mode corresponding to the target cloud disk has been changed, and when a corresponding user accesses the target cloud disk again at this time, the corresponding user enters a new cloud disk mode after switching, and based on the updated data block meta information corresponding to the accessed data block, the read-write operation corresponding to the user access request is executed based on the new cloud disk mode, that is, the second cloud disk mode.
Here, fig. 3 illustrates an exemplary diagram of a scenario for cloud disk mode switching according to an aspect of the present application. The first cloud disk mode and the second cloud disk mode are two cloud disk modes corresponding to the same target cloud disk. The cloud disk file corresponds to one or more data blocks, and the file corresponding to the data block is stored in a corresponding mechanical hard disk or a corresponding solid state hard disk. Here, the mechanical hard disk or the solid-state hard disk corresponding to the same data block is deployed in the same storage server, and the network device corresponding to the present application includes one or more storage servers having similar or identical functions. In the first cloud disk mode, writing operation on the data block can be directly written into the corresponding mechanical hard disk, and reading operation on the data block is also directly read from the mechanical hard disk; in the second cloud disk mode, writing operation on the data blocks can be directly written into the corresponding solid state disk, the background thread can transfer data corresponding to the data blocks of the cloud disk file in the solid state disk to the corresponding mechanical hard disk, correspondingly, when reading operation is performed on the data of the data blocks, whether the data are transferred from the solid state disk to the corresponding mechanical hard disk or not can be judged, if the data are not transferred, the data are read from the solid state disk, and if the data are transferred, the data are read from the mechanical hard disk. In this application, based on the cloud disk mode switching request, a corresponding hard disk is re-matched for each data block of the target cloud disk, so that mutual switching between the first cloud disk mode and the second cloud disk mode is realized. The mechanical hard disk corresponding to each data block in two different cloud disk modes corresponding to the same target cloud disk is kept unchanged, and based on the re-matching of the hard disk corresponding to each data block, the data block meta-information corresponding to the data block is updated accordingly, so that after the cloud disk mode is switched, a new read request or write request is processed based on the updated data block meta-information, for example, if the data block meta-information corresponds to the SsdDiskId and the satadiiskid, the processing of the data access request at this time corresponds to the second cloud disk mode, and if the data block meta-information corresponds to the satadiiskid, the processing of the data access request at this time corresponds to the first cloud disk mode.
Here, the cloud disk mode can be switched between the first cloud disk mode and the second cloud disk mode of the target cloud disk based on one cloud disk mode switching request, that is, the cloud disk mode can be changed quickly by re-matching each data block of the target cloud disk with the corresponding hard disk. The switching of the cloud disk mode can be based on the existing hard disk deployment of the target cloud disk, and a new hard disk does not need to be re-deployed outside the existing hard disk corresponding to the target cloud disk for cloud disk migration, so that the storage resource can be effectively saved; meanwhile, the cloud disk mode is switched by re-matching the hard disk for each data block, so that partial data is not needed or only needs to be dumped, the whole switching time is greatly shortened compared with the whole cloud disk migration in the prior art; in addition, after the cloud disk mode is switched, the cloud disk does not need to be mounted again, so that the continuity of the service can be effectively guaranteed. Further, the switching of the cloud disk modes in the application can be performed in a bidirectional and repeated manner between the first cloud disk mode and the second cloud disk mode, and the switching operation is simple and the resource loss is low, so that the application can help a user to realize the configuration of one cloud disk, namely, the service requirements of the two cloud disk modes can be obtained, and the switching requirement of the cloud disk modes of the user at any time and any place can be effectively met.
The embodiment of the application also provides a method for switching the cloud disk mode, and the method can be realized at a corresponding network equipment end. The network device includes, but is not limited to, a computer, a network host, a single network server, multiple network server sets, or a cloud server, where the cloud server may be a virtual supercomputer operating in a distributed system and composed of a group of loosely coupled computer sets, and is used to implement a simple, efficient, secure, reliable, and processing-capacity scalable computing service. In one implementation, the network device may include a device cluster composed of a plurality of network servers, where the network device may correspond to a data storage system for implementing data storage, where the plurality of network servers corresponding to the network device may include one or more storage servers. In one implementation, each storage server may include one or more solid state disks and one or more mechanical hard disks. In one implementation, the cloud disk file may be decomposed into data blocks, and corresponding data of the data blocks is to be stored in hard disks corresponding to one or more storage servers. Further, in an implementation manner, the plurality of corresponding network servers of the network device may further include one or more management servers to perform operations of creating a data block for cloud disk creation, matching a response storage server, traversing a cloud disk file, and the like. In this application, the network device may be referred to as network device 1 in fig. 2.
In addition, the embodiment of the present application further provides a network device for storage space mode switching, where the network device may include a switching request obtaining device 301 (not shown) and a switching device 302 (not shown).
Specifically, the switching request obtaining device 301 may obtain a storage space mode switching request of a target storage space, where the target storage space corresponds to one or more data blocks, and the storage space mode includes a first storage space mode or a second storage space mode, where in the first storage space mode, data corresponding to the data block of the target storage space is stored in a corresponding first type of storage medium, and in the second storage space mode, data corresponding to the data block of the target storage space is stored in a corresponding first type of storage medium or a corresponding second type of storage medium.
In one implementation, the storage space may include, but is not limited to, a cloud disk, a network disk, or other network storage space, etc. In one implementation, the storage medium may include, but is not limited to, various types of storage media that may be suitable for use in the present application, such as a hard disk, and further, the first type of storage medium may include a mechanical hard disk, and the second type of storage medium may include a solid state hard disk.
In one implementation, the first storage space mode may correspond to a common storage space, such as a common cloud disk, for example, the common storage space may be a storage server or a storage server cluster that is only deployed with a first type of storage medium to store a data block corresponding to the common storage space, in the first storage space mode, a write operation on the data block may be directly written to the corresponding first type of storage medium, and a read operation on the data block is also directly read from the first type of storage medium; the second storage space pattern may correspond to an efficient storage space, e.g., the efficient storage space may be a storage space that stores data blocks corresponding to the efficient storage space using a storage server or a cluster of storage servers that have a mix of a first type of storage media and a second type of storage media deployed simultaneously, in the second storage space pattern, the write operation to the data block can be directly written into the corresponding second type storage medium, the background thread can transfer the data corresponding to the data block of the storage space file in the second type storage medium into the corresponding first type storage medium, correspondingly, when reading the data of the data block, it will be determined whether the data has been transferred to the corresponding first type storage medium from the second type storage medium, if not, reading data from the second type of storage medium, and if the data is unloaded, reading the data from the first type of storage medium. In one implementation, the first type of storage medium may correspond to various interfaces, for example, the first type of storage medium may be a SATA hard disk corresponding to a SATA interface, and here, the second type of storage medium is also referred to as an SSD hard disk. Because the performance of the second storage medium is better than that of the first storage medium, and the data read-write speed is faster, in practical application, the second storage space mode based on the hybrid hard disk can better cope with application scenarios with high requirements on database delay when users access frequently, and in contrast, the first storage space mode based on the first storage medium is higher in cost performance when being applied to a common scenario with a general access amount, so that the two storage space modes have suitable application scenarios, and the same user may have requirements on the two storage space modes in different scenarios. Therefore, the user can conveniently and conveniently switch the two storage space modes at any time, namely the technical effect which can be realized by the technical scheme of the application.
Here, the switching request acquiring means 301 may acquire a memory space mode switching request of the target memory space. In one implementation, the memory space mode switch request includes any one of: a request to switch from the second memory space mode to the first memory space mode; a request to switch from a first memory space mode to a second memory space mode. Here, the purpose of the storage space mode switching request is to switch the target storage space from a current storage space mode to another storage space mode, and the storage space mode can be switched quickly and efficiently based on the technical solution of the present application. Here, in an implementation manner, the obtaining of the storage space mode switching request may be that the target storage space corresponds to an active submission of the storage space mode switching request by a user, for example, on a user device of the user, there is an operation button or an operation area corresponding to the storage space mode switching request. In another implementation, the obtaining of the storage space mode switching request may also be that after a preset trigger condition for switching the storage space mode is reached, the user equipment corresponding to the user automatically initiates the storage space mode switching request to the network equipment, for example, if the current target storage space corresponds to the first storage space mode, the trigger condition may be set such that, when the current access data volume of the target storage space reaches a preset access volume threshold, the user equipment automatically submits a request for switching from the first storage space mode to the second storage space mode, so as to better meet the current demand of the user through efficient data storage and access service of the second storage space mode; for another example, if the current target storage space corresponds to the second storage space mode, the triggering condition may be set to that, if the storage data of the data block corresponding to the target storage space is lower than a preset storage threshold, the user equipment automatically submits a request for switching from the second storage space mode to the first storage space mode, so as to better save hard disk resources. It should be understood by those skilled in the art that the triggering condition corresponding to the above-mentioned ue automatically initiating the storage space mode switching request to the network device is only an example, and other triggering conditions that may occur now or in the future are also included in the scope of the present application and are included by reference if it is possible to implement that the ue automatically initiates the storage space mode switching request to the network device.
Then, the switching device 302 may re-match the corresponding storage medium for the data block of the target storage space based on the storage space mode switching request. In one implementation, the first type of storage medium to which the data block corresponds remains unchanged. In one implementation, the storage medium may include a hard disk. In the present application, two modes of the same target storage space, namely the first storage space mode and the second storage space mode, can be utilized to meet different configuration requirements of the hard disk, on the basis of the storage space mode before switching, the hard disk corresponding to each data block of the target storage space can be reconfigured, since either the first storage space pattern or the second storage space pattern needs to match the corresponding first type of storage medium, in the present application, the matching relationship between each data block of the target storage space and the corresponding first type storage medium is kept unchanged, and further, when the storage space mode switching request is received, if the storage space mode switching request is a request for switching from a second storage space mode to a first storage space mode, only the second type of storage medium corresponding to each data block in the first storage space mode needs to be reduced; if the storage space mode switching request is a request for switching from a first storage space mode to a second storage space mode, the hard disk configuration requirements of the switched storage space mode can be met only by adding a second type of storage medium corresponding to each data block to the target storage space, and therefore successful switching of the target storage space is achieved. In an implementation manner, each storage server itself may include one or more second-type storage media and one or more first-type storage media, so that, in a scenario where a corresponding second-type storage medium is added to a data block of a target storage space, a second-type storage medium may be selected from the storage server where the first-type storage medium corresponding to each data block is located to match the corresponding data block, and therefore, in the present application, it is not necessary to deploy an alternative storage space corresponding to the current size of the target storage space for realizing overall migration of the storage space; in the second type of storage medium scene corresponding to the reduction of the data blocks of the target storage space, a new hard disk does not need to be added at all, but only the re-matching of the corresponding hard disk needs to be realized, for example, the data block meta information of each stored data block is updated, and in this scene, the occupation of the storage space is reduced compared with that before switching. In an implementation, the re-matching of each data block of the target storage space to the corresponding hard disk may include a dumping operation of specific data in the hard disk with which the data block is matched, and may further include an update of a matching relationship between the data block and the hard disk, for example, an update of meta information of each data block of the target storage space. Based on this, the method and the device can realize that after the operation of re-matching the corresponding hard disk based on each data block, when the corresponding user accesses the target storage space again, the corresponding user enters a new storage space mode after switching. In addition, in one implementation manner, the switching of the storage space mode of the target storage space in the present application can be performed in two directions and at any time based on the needs of the user.
Here, the present application may implement any switching of the storage space mode between the first storage space mode and the second storage space mode of the target storage space based on one storage space mode switching request, that is, implement the change of the storage space mode quickly by re-matching the corresponding hard disk for each data block of the target storage space. The switching of the storage space mode can be based on the existing hard disk deployment of the target storage space, and a new hard disk does not need to be deployed outside the existing hard disk corresponding to the target storage space again for carrying out storage space migration, so that the storage resources can be effectively saved; meanwhile, the storage space mode is switched by re-matching the hard disk for each data block, so that partial data is not needed or only needs to be dumped, the whole switching time is greatly shortened compared with the whole migration of the storage space in the prior art; in addition, after the storage space mode is switched, the storage space does not need to be mounted again, so that the continuity of the service can be effectively ensured. Furthermore, because the switching of the storage space mode in the application can be carried out bidirectionally and repeatedly between the first storage space mode and the second storage space mode, and because the switching operation is simple and the resource loss is less, the application can help a user to realize the service requirement of configuring one storage space, namely acquiring two storage space modes, and effectively meet the storage space mode switching requirement of the user anytime and anywhere.
Fig. 1 illustrates a flow diagram of a method for cloud disk mode switching, according to an aspect of the subject application. Wherein the method comprises step S101 and step S102.
In step S101, the network device 1 may obtain a cloud disk mode switching request of a target cloud disk, where the target cloud disk corresponds to one or more data blocks, and the cloud disk mode includes a first cloud disk mode or a second cloud disk mode, where in the first cloud disk mode, data corresponding to the data block of the target cloud disk is stored in a corresponding mechanical hard disk, and in the second cloud disk mode, data corresponding to the data block of the target cloud disk is stored in a corresponding mechanical hard disk or a corresponding solid state hard disk.
In one implementation, the first cloud disk mode may correspond to a common cloud disk, for example, the common cloud disk may store a data block corresponding to the common cloud disk by using a storage server or a storage server cluster in which only a mechanical hard disk is deployed, in the first cloud disk mode, a write operation on the data block may be directly written into the corresponding mechanical hard disk, and a read operation on the data block may also be directly read from the mechanical hard disk; the second cloud disk mode may correspond to a high-efficiency cloud disk, for example, the high-efficiency cloud disk may be a data block corresponding to the high-efficiency cloud disk stored by using a storage server or a storage server cluster in which a mechanical hard disk and a solid-state hard disk are simultaneously deployed, in the second cloud disk mode, a write operation on the data block may be directly written into the corresponding solid-state hard disk, a background thread may transfer data corresponding to the data block of the cloud disk file in the solid-state hard disk to the corresponding mechanical hard disk, accordingly, when a read operation is performed on data of the data block, it may be determined whether the data has been transferred from the solid-state hard disk to the corresponding mechanical hard disk, if not, the data is read from the solid-state hard disk, and if so, the data is read from the mechanical hard disk. In one implementation, the mechanical hard disk may correspond to various interfaces, for example, the mechanical hard disk may be a SATA hard disk corresponding to a SATA interface, and here, the solid state hard disk is also referred to as an SSD hard disk. Because the performance of the solid state disk is better than that of a mechanical hard disk, and the data read-write speed is higher, in practical application, the second cloud disk mode based on the hybrid hard disk can better cope with application scenes with high requirements on frequent user access and high database delay, and in comparison, the first cloud disk mode based on the mechanical hard disk is higher in cost performance applicable to common scenes with general access volumes, so that the two cloud disk modes respectively have suitable application scenes, and the same user can have requirements on the two cloud disk modes under different scenes. Therefore, the user can conveniently and rapidly switch the two cloud disk modes at any time, namely the technical effect which can be realized by the technical scheme of the application.
Here, the network device 1 may acquire a cloud disk mode switching request of the target cloud disk. In one implementation, the cloud disk mode switch request includes any one of: a request to switch from the second cloud disk mode to the first cloud disk mode; a request to switch from a first cloud disk mode to a second cloud disk mode. Here, the purpose of the cloud disk mode switching request is to switch a target cloud disk from a current cloud disk mode to another cloud disk mode, and the cloud disk mode can be switched quickly and efficiently based on the technical solution of the present application. Here, in an implementation manner, the acquisition of the cloud disk mode switching request may be that a target cloud disk corresponds to a user who actively submits the cloud disk mode switching request, for example, on a user device of the user, there is an operation button or an operation area corresponding to the cloud disk mode switching request. In another implementation, the cloud disk mode switching request may be obtained, after a preset triggering condition for cloud disk mode switching is reached, the cloud disk mode switching request may be automatically initiated to the network device by a user device corresponding to the user, for example, if a current target cloud disk corresponds to the first cloud disk mode, the triggering condition may be set such that, when a current access data volume of the target cloud disk reaches a preset access volume threshold, the user device automatically submits a request for switching from the first cloud disk mode to the second cloud disk mode, so as to better meet a current demand of the user through efficient data storage and access service of the second cloud disk mode; for another example, if the current target cloud disk corresponds to the second cloud disk mode, the triggering condition may be set to be that, if the storage data of the data block corresponding to the target cloud disk is lower than a preset storage threshold, the user equipment automatically submits a request for switching from the second cloud disk mode to the first cloud disk mode, so as to better save hard disk resources. It should be understood by those skilled in the art that the triggering condition corresponding to the above-mentioned user equipment automatically initiating the cloud disk mode switching request to the network device is only an example, and other triggering conditions that may occur now or in the future are also included in the scope of the present application and are included by reference if it is possible to implement that the user equipment automatically initiates the cloud disk mode switching request to the network device.
In one implementation of the present application, the method further includes step S107 (not shown), step S108 (not shown), step S109 (not shown), and step S110 (not shown). Specifically, in step S107, the network device 1 may obtain a creation request of a target cloud disk, where the creation request includes a first cloud disk mode creation request or a second cloud disk mode creation request corresponding to the target cloud disk; in step S108, the network device 1 may determine one or more data blocks corresponding to the target cloud disk to be created based on file size information corresponding to the target cloud disk, and in an implementation manner, the data blocks may be allocated to one or more storage servers by a management server in the network device, where each storage server may include one or more solid state disks and one or more mechanical hard disks; in step S109, if the creation request is a first cloud disk mode creation request, the network device 1 may match a mechanical hard disk for each data block, and if the creation request is a second cloud disk mode creation request, the network device 1 may match a mechanical hard disk and a solid state hard disk for each data block, and in an implementation manner, the mechanical hard disk and the solid state hard disk of each data block may correspond to the same storage server; after matching the corresponding hard disk for each data block, in step S110, the network device 1 may record and store data block meta information corresponding to each data block, where the data block meta information may include mechanical hard disk meta information if the created target cloud disk is the first cloud disk mode; if the created target cloud disk is in the second cloud disk mode, the data block meta-information may include mechanical hard disk meta-information and solid state hard disk meta-information. Here, the hard disk cloud information may include identification information of each hard disk for distinguishing each hard disk, for example, ID information of the hard disk, such as SsdDiskId or satadiiskid, which refer to a solid state disk ID and a mechanical hard disk ID, respectively.
Next, in step S102, the network device 1 may re-match the data blocks of the target cloud disk with the corresponding hard disk based on the cloud disk mode switching request. In one implementation, the mechanical hard disk corresponding to the data block remains unchanged. In the present application, two modes of the same target cloud disk, that is, a first cloud disk mode and a second cloud disk mode have different configuration requirements for a hard disk, on the basis of a cloud disk mode before switching, a hard disk corresponding to each data block of the target cloud disk is reconfigured, and because both the first cloud disk mode and the second cloud disk mode need to be matched with a corresponding mechanical hard disk, in the present application, a matching relationship between each data block of the target cloud disk and a corresponding mechanical hard disk is maintained, and further, when the cloud disk mode switching request is received, if the cloud disk mode switching request is a request for switching from the second cloud disk mode to the first cloud disk mode, only the solid state hard disk corresponding to each data block in the first cloud disk mode needs to be reduced; if the cloud disk mode switching request is a request for switching from a first cloud disk mode to a second cloud disk mode, only the solid state disk corresponding to each data block needs to be added to the target cloud disk, and the hard disk configuration needs of the switched cloud disk mode can be met, so that the successful switching of the target cloud disk is realized. In an implementation manner, each storage server may include one or more solid state disks and one or more mechanical hard disks, so that in a scenario where a corresponding solid state disk is added to a data block of a target cloud disk, one solid state disk may be selected from the storage server where the mechanical hard disk corresponding to each data block is located to match the corresponding data block, and therefore, in the present application, it is not necessary to deploy an alternative storage space corresponding to the current size of the target cloud disk to implement overall migration of the cloud disk; in the scenario of reducing the corresponding solid state disk for the data block of the target cloud disk, only the re-matching of the corresponding hard disk needs to be realized without adding a new hard disk, for example, the data block meta information of each stored data block is updated, and in this scenario, the occupation of the storage space is reduced rather than before the switching. In an implementation manner, the re-matching of the corresponding hard disk for each data block of the target cloud disk may include a dumping operation of specific data in the hard disk with which the data block is matched, and may further include an update of a matching relationship between the data block and the hard disk, for example, an update of meta information of each data block of the target cloud disk. Based on this, the method and the device can realize that after the operation of re-matching the corresponding hard disk based on each data block, when the corresponding user accesses the target cloud disk again, the corresponding user enters a new cloud disk mode after switching. In addition, in an implementation manner, switching of the cloud disk mode of the target cloud disk in the present application may be performed in two directions and any number of times based on the needs of the user.
Here, the cloud disk mode can be switched between the first cloud disk mode and the second cloud disk mode of the target cloud disk based on one cloud disk mode switching request, that is, the cloud disk mode can be changed quickly by re-matching each data block of the target cloud disk with the corresponding hard disk. The switching of the cloud disk mode can be based on the existing hard disk deployment of the target cloud disk, and a new hard disk does not need to be re-deployed outside the existing hard disk corresponding to the target cloud disk for cloud disk migration, so that the storage resource can be effectively saved; meanwhile, the cloud disk mode is switched by re-matching the hard disk for each data block, so that partial data is not needed or only needs to be dumped, the whole switching time is greatly shortened compared with the whole cloud disk migration in the prior art; in addition, after the cloud disk mode is switched, the cloud disk does not need to be mounted again, so that the continuity of the service can be effectively guaranteed. Further, the switching of the cloud disk modes in the application can be performed in a bidirectional and repeated manner between the first cloud disk mode and the second cloud disk mode, and the switching operation is simple and the resource loss is low, so that the application can help a user to realize the configuration of one cloud disk, namely, the service requirements of the two cloud disk modes can be obtained, and the switching requirement of the cloud disk modes of the user at any time and any place can be effectively met.
In an implementation manner of the present application, if the cloud disk mode switching request includes a request for switching from the second cloud disk mode to the first cloud disk mode, in step S102, the network device 1 may store, based on the request for switching from the second cloud disk mode to the first cloud disk mode, data of a data block of a target cloud disk in a corresponding solid state disk, and dump all the data in the mechanical hard disk corresponding to the solid state disk. The network device 1 may further update data block meta information corresponding to the data block, where the data block meta information includes at least any one of: solid state disk meta information; and mechanical hard disk meta information.
In this implementation manner, the second cloud disk mode is used before switching, in this cloud disk mode, data corresponding to the data blocks can be directly written into the corresponding solid state disk, the background thread can periodically transfer the data in the solid state disk to the corresponding mechanical hard disk, and at this time, if the cloud disk mode needs to be switched to the first cloud disk mode, all data that have not been transferred to the corresponding mechanical hard disk in the current solid state disk need to be completely transferred, so that the original matching relationship between each data block and the corresponding solid state disk is cancelled. In one implementation manner, all data blocks corresponding to the cloud disk file may be traversed, an operation of completely dumping data from the solid state disk to the mechanical hard disk may be performed on each data block, and data block meta information corresponding to each data block may be updated. In one implementation, the updating the data block meta information corresponding to the data block includes: deleting the solid state disk meta-information corresponding to the data blocks, wherein the mechanical hard disk meta-information corresponding to each data block is reserved; then, the data block meta-information is persisted. Here, in an implementation manner, the meta-information of the data block before switching includes solid state disk meta-information corresponding to the data block, for example, SsdDiskId corresponding to the data block, and mechanical disk meta-information, for example, sataddiskid corresponding to the same data block. And after all the data are dumped to the mechanical hard disk, deleting the SsdDiskId corresponding to the data block, reserving the SatadDiskId corresponding to the data block, then, persisting the metadata of the data block, and storing the metadata of the data block in the hard disk.
Further, in one implementation, the method further includes step S103 (not shown) and step S104 (not shown). In step S103, the network device 1 may obtain an access request of a user to a target cloud disk, where the access request is a write data request or a read data request; in step S104, if the access request is a write data request, the network device 1 may write data corresponding to the write data request into the corresponding mechanical hard disk based on the updated data block meta information, and if the access request is a read data request, the network device 1 may read data corresponding to the read data request from the corresponding mechanical hard disk based on the updated data block meta information. Here, after the operation of re-matching the corresponding hard disk based on each data block, the cloud disk mode corresponding to the target cloud disk has been changed, and when a corresponding user accesses the target cloud disk again at this time, the corresponding user enters a new cloud disk mode after switching, and based on the updated data block meta information corresponding to the accessed data block, the read-write operation corresponding to the user access request is executed based on the new cloud disk mode, that is, the first cloud disk mode.
In an implementation manner of the present application, if the cloud disk mode switching request includes a request for switching from a first cloud disk mode to a second cloud disk mode, the network device 1 may match a solid state disk for each data block of a target cloud disk based on the request for switching from the first cloud disk mode to the second cloud disk mode; the network device 1 may further update data block meta information corresponding to each data block, where the data block meta information includes at least any one of: solid state disk meta information; and mechanical hard disk meta information.
In this implementation, the switching is preceded by a first cloud disk mode, in which data corresponding to the data block is directly written into a corresponding mechanical hard disk, but a solid-state hard disk corresponding to the mechanical hard disk is required for a second cloud disk mode to which switching is required. In an implementation manner, all data blocks corresponding to the cloud disk file may be traversed, one solid state disk is selected from a storage server where the mechanical hard disk corresponding to each data block is located and is matched with the corresponding data block, and the data block meta information corresponding to each data block is updated based on the allocated solid state disk. In one implementation, the updating the data block meta information corresponding to the data block includes: adding solid state disk meta-information corresponding to each data block, wherein the mechanical hard disk meta-information corresponding to each data block remains unchanged; then, the data block meta-information is persisted. Here, in an implementation manner, the meta-information of the data block before switching includes meta-information of a mechanical hard disk corresponding to the data block, for example, a satadik id corresponding to the same data block. After a solid state disk corresponding to the data block is determined, adding the added meta-information of the solid state disk, such as the SsdDiskId corresponding to the data block, to the original meta-information of the data block, then persisting the meta-information of the data block, and storing the meta-information of the data block in the hard disk.
Further, in an implementation manner, the method further includes step S105 and step S106, where in step S105, the network device 1 may obtain an access request of a user to the target cloud disk, where the access request is a write data request or a read data request; in step S105, if the access request is a write data request, the network device 1 may write data corresponding to the write data request into the corresponding solid state disk based on the updated data block meta information, and if the access request is a read data request, the network device 1 may read data corresponding to the read data request from the corresponding solid state disk or mechanical hard disk based on the updated data block meta information. Here, after the operation of re-matching the corresponding hard disk based on each data block, the cloud disk mode corresponding to the target cloud disk has been changed, and when a corresponding user accesses the target cloud disk again at this time, the corresponding user enters a new cloud disk mode after switching, and based on the updated data block meta information corresponding to the accessed data block, the read-write operation corresponding to the user access request is executed based on the new cloud disk mode, that is, the second cloud disk mode.
In addition, the embodiment of the present application also provides a method for switching a storage space mode, where the method may include step S401 (not shown) and step S402 (not shown).
Specifically, in step S401, the network device may obtain a storage space mode switching request of a target storage space, where the target storage space corresponds to one or more data blocks, and the storage space mode includes a first storage space mode or a second storage space mode, where in the first storage space mode, data corresponding to a data block of the target storage space is stored in a corresponding first type of storage medium, and in the second storage space mode, data corresponding to a data block of the target storage space is stored in a corresponding first type of storage medium or a corresponding second type of storage medium.
In one implementation, the storage space may include, but is not limited to, a cloud disk, a network disk, or other network storage space, etc. In one implementation, the storage medium may include, but is not limited to, various types of storage media that may be suitable for use in the present application, such as a hard disk, and further, the first type of storage medium may include a mechanical hard disk, and the second type of storage medium may include a solid state hard disk.
In one implementation, the first storage space mode may correspond to a common storage space, such as a common cloud disk, for example, the common storage space may be a storage server or a storage server cluster that is only deployed with a first type of storage medium to store a data block corresponding to the common storage space, in the first storage space mode, a write operation on the data block may be directly written to the corresponding first type of storage medium, and a read operation on the data block is also directly read from the first type of storage medium; the second storage space pattern may correspond to an efficient storage space, e.g., the efficient storage space may be a storage space that stores data blocks corresponding to the efficient storage space using a storage server or a cluster of storage servers that have a mix of a first type of storage media and a second type of storage media deployed simultaneously, in the second storage space pattern, the write operation to the data block can be directly written into the corresponding second type storage medium, the background thread can transfer the data corresponding to the data block of the storage space file in the second type storage medium into the corresponding first type storage medium, correspondingly, when reading the data of the data block, it will be determined whether the data has been transferred to the corresponding first type storage medium from the second type storage medium, if not, reading data from the second type of storage medium, and if the data is unloaded, reading the data from the first type of storage medium. In one implementation, the first type of storage medium may correspond to various interfaces, for example, the first type of storage medium may be a SATA hard disk corresponding to a SATA interface, and here, the second type of storage medium is also referred to as an SSD hard disk. Because the performance of the second storage medium is better than that of the first storage medium, and the data read-write speed is faster, in practical application, the second storage space mode based on the hybrid hard disk can better cope with application scenarios with high requirements on database delay when users access frequently, and in contrast, the first storage space mode based on the first storage medium is higher in cost performance when being applied to a common scenario with a general access amount, so that the two storage space modes have suitable application scenarios, and the same user may have requirements on the two storage space modes in different scenarios. Therefore, the user can conveniently and conveniently switch the two storage space modes at any time, namely the technical effect which can be realized by the technical scheme of the application.
Here, in step S401, the network device may acquire a storage space mode switching request of the target storage space. In one implementation, the memory space mode switch request includes any one of: a request to switch from the second memory space mode to the first memory space mode; a request to switch from a first memory space mode to a second memory space mode. Here, the purpose of the storage space mode switching request is to switch the target storage space from a current storage space mode to another storage space mode, and the storage space mode can be switched quickly and efficiently based on the technical solution of the present application. Here, in an implementation manner, the obtaining of the storage space mode switching request may be that the target storage space corresponds to an active submission of the storage space mode switching request by a user, for example, on a user device of the user, there is an operation button or an operation area corresponding to the storage space mode switching request. In another implementation, the obtaining of the storage space mode switching request may also be that after a preset trigger condition for switching the storage space mode is reached, the user equipment corresponding to the user automatically initiates the storage space mode switching request to the network equipment, for example, if the current target storage space corresponds to the first storage space mode, the trigger condition may be set such that, when the current access data volume of the target storage space reaches a preset access volume threshold, the user equipment automatically submits a request for switching from the first storage space mode to the second storage space mode, so as to better meet the current demand of the user through efficient data storage and access service of the second storage space mode; for another example, if the current target storage space corresponds to the second storage space mode, the triggering condition may be set to that, if the storage data of the data block corresponding to the target storage space is lower than a preset storage threshold, the user equipment automatically submits a request for switching from the second storage space mode to the first storage space mode, so as to better save hard disk resources. It should be understood by those skilled in the art that the triggering condition corresponding to the above-mentioned ue automatically initiating the storage space mode switching request to the network device is only an example, and other triggering conditions that may occur now or in the future are also included in the scope of the present application and are included by reference if it is possible to implement that the ue automatically initiates the storage space mode switching request to the network device.
Next, in step S402, the network device may re-match the corresponding storage medium for the data block of the target storage space based on the storage space mode switching request. In one implementation, the first type of storage medium to which the data block corresponds remains unchanged. In one implementation, the storage medium may include a hard disk. In the present application, two modes of the same target storage space, namely the first storage space mode and the second storage space mode, can be utilized to meet different configuration requirements of the hard disk, on the basis of the storage space mode before switching, the hard disk corresponding to each data block of the target storage space can be reconfigured, since either the first storage space pattern or the second storage space pattern needs to match the corresponding first type of storage medium, in the present application, the matching relationship between each data block of the target storage space and the corresponding first type storage medium is kept unchanged, and further, when the storage space mode switching request is received, if the storage space mode switching request is a request for switching from a second storage space mode to a first storage space mode, only the second type of storage medium corresponding to each data block in the first storage space mode needs to be reduced; if the storage space mode switching request is a request for switching from a first storage space mode to a second storage space mode, the hard disk configuration requirements of the switched storage space mode can be met only by adding a second type of storage medium corresponding to each data block to the target storage space, and therefore successful switching of the target storage space is achieved. In an implementation manner, each storage server itself may include one or more second-type storage media and one or more first-type storage media, so that, in a scenario where a corresponding second-type storage medium is added to a data block of a target storage space, a second-type storage medium may be selected from the storage server where the first-type storage medium corresponding to each data block is located to match the corresponding data block, and therefore, in the present application, it is not necessary to deploy an alternative storage space corresponding to the current size of the target storage space for realizing overall migration of the storage space; in the second type of storage medium scene corresponding to the reduction of the data blocks of the target storage space, a new hard disk does not need to be added at all, but only the re-matching of the corresponding hard disk needs to be realized, for example, the data block meta information of each stored data block is updated, and in this scene, the occupation of the storage space is reduced compared with that before switching. In an implementation, the re-matching of each data block of the target storage space to the corresponding hard disk may include a dumping operation of specific data in the hard disk with which the data block is matched, and may further include an update of a matching relationship between the data block and the hard disk, for example, an update of meta information of each data block of the target storage space. Based on this, the method and the device can realize that after the operation of re-matching the corresponding hard disk based on each data block, when the corresponding user accesses the target storage space again, the corresponding user enters a new storage space mode after switching. In addition, in one implementation manner, the switching of the storage space mode of the target storage space in the present application can be performed in two directions and at any time based on the needs of the user.
Here, the present application may implement any switching of the storage space mode between the first storage space mode and the second storage space mode of the target storage space based on one storage space mode switching request, that is, implement the change of the storage space mode quickly by re-matching the corresponding hard disk for each data block of the target storage space. The switching of the storage space mode can be based on the existing hard disk deployment of the target storage space, and a new hard disk does not need to be deployed outside the existing hard disk corresponding to the target storage space again for carrying out storage space migration, so that the storage resources can be effectively saved; meanwhile, the storage space mode is switched by re-matching the hard disk for each data block, so that partial data is not needed or only needs to be dumped, the whole switching time is greatly shortened compared with the whole migration of the storage space in the prior art; in addition, after the storage space mode is switched, the storage space does not need to be mounted again, so that the continuity of the service can be effectively ensured. Furthermore, because the switching of the storage space mode in the application can be carried out bidirectionally and repeatedly between the first storage space mode and the second storage space mode, and because the switching operation is simple and the resource loss is less, the application can help a user to realize the service requirement of configuring one storage space, namely acquiring two storage space modes, and effectively meet the storage space mode switching requirement of the user anytime and anywhere.
In addition, an embodiment of the present application further provides an apparatus for switching a cloud disk mode, where the apparatus includes:
a processor; and
a memory arranged to store computer executable instructions that, when executed, cause the processor to:
acquiring a cloud disk mode switching request of a target cloud disk, wherein the target cloud disk corresponds to one or more data blocks, the cloud disk mode comprises a first cloud disk mode or a second cloud disk mode, in the first cloud disk mode, data corresponding to each data block of the target cloud disk is always stored in a corresponding mechanical hard disk, and in the second cloud disk mode, data corresponding to each data block of the target cloud disk is stored in a corresponding mechanical hard disk or a corresponding solid state hard disk;
and based on the cloud disk mode switching request, re-matching the corresponding hard disk for each data block of the target cloud disk.
In addition, an embodiment of the present application further provides an apparatus for switching storage space modes, where the apparatus includes:
a processor; and
a memory arranged to store computer executable instructions that, when executed, cause the processor to:
acquiring a storage space mode switching request of a target storage space, wherein the target storage space corresponds to one or more data blocks, the storage space mode comprises a first storage space mode or a second storage space mode, under the first storage space mode, data corresponding to the data blocks of the target storage space are stored in a corresponding first type of storage medium, and under the second storage space mode, data corresponding to the data blocks of the target storage space are stored in a corresponding first type of storage medium or a corresponding second type of storage medium;
and based on the target storage space mode switching request, re-matching the corresponding storage medium for the data block of the target storage space.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present application without departing from the spirit and scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include such modifications and variations as well.
It should be noted that the present invention may be implemented in software and/or in a combination of software and hardware, for example, as an Application Specific Integrated Circuit (ASIC), a general purpose computer or any other similar hardware device. In one embodiment, the software program of the present invention may be executed by a processor to implement the steps or functions described above. Also, the software programs (including associated data structures) of the present invention can be stored in a computer readable recording medium, such as RAM memory, magnetic or optical drive or diskette and the like. Further, some of the steps or functions of the present invention may be implemented in hardware, for example, as circuitry that cooperates with the processor to perform various steps or functions.
In addition, some of the present invention can be applied as a computer program product, such as computer program instructions, which when executed by a computer, can invoke or provide the method and/or technical solution according to the present invention through the operation of the computer. Program instructions which invoke the methods of the present invention may be stored on a fixed or removable recording medium and/or transmitted via a data stream on a broadcast or other signal-bearing medium and/or stored within a working memory of a computer device operating in accordance with the program instructions. An embodiment according to the invention herein comprises an apparatus comprising a memory for storing computer program instructions and a processor for executing the program instructions, wherein the computer program instructions, when executed by the processor, trigger the apparatus to perform a method and/or solution according to embodiments of the invention as described above.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential attributes thereof. The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference sign in a claim should not be construed as limiting the claim concerned. Furthermore, it is obvious that the word "comprising" does not exclude other elements or steps, and the singular does not exclude the plural. A plurality of units or means recited in the apparatus claims may also be implemented by one unit or means in software or hardware. The terms first, second, etc. are used to denote names, but not any particular order.

Claims (24)

1. A method for cloud disk mode switching, wherein the method comprises:
acquiring a cloud disk mode switching request of a target cloud disk, wherein the target cloud disk corresponds to one or more data blocks, the cloud disk mode comprises a first cloud disk mode or a second cloud disk mode, in the first cloud disk mode, data corresponding to the data blocks of the target cloud disk are stored in a corresponding mechanical hard disk, and in the second cloud disk mode, data corresponding to the data blocks of the target cloud disk are stored in a corresponding mechanical hard disk or a corresponding solid state hard disk;
based on the cloud disk mode switching request, re-matching the data blocks of the target cloud disk with the corresponding hard disks;
if the cloud disk mode switching request is a request for switching from the second cloud disk mode to the first cloud disk mode, reducing the solid state disk corresponding to each data block in the first cloud disk mode; if the cloud disk mode switching request is a request for switching from the first cloud disk mode to the second cloud disk mode, adding a solid state disk corresponding to each data block to the target cloud disk;
re-matching the data blocks of the target cloud disk with the corresponding hard disks comprises: the method comprises the following steps of dumping specific data in a hard disk matched with a data block, and/or updating the matching relation between the data block and the hard disk.
2. The method of claim 1, wherein the cloud disk mode switch request comprises any one of:
a request to switch from the second cloud disk mode to the first cloud disk mode;
a request to switch from a first cloud disk mode to a second cloud disk mode.
3. The method of claim 2, wherein if the cloud disk mode switch request comprises a request to switch from a second cloud disk mode to a first cloud disk mode, the re-matching the corresponding hard disk for the data chunk of the target cloud disk based on the cloud disk mode switch request, wherein the keeping the corresponding mechanical hard disk unchanged for the data chunk comprises:
storing data blocks of a target cloud disk in a corresponding solid state disk and completely dumping the data blocks into a mechanical hard disk corresponding to the solid state disk based on a request for switching from a second cloud disk mode to a first cloud disk mode;
updating data block meta-information corresponding to the data block, wherein the data block meta-information includes at least any one of:
solid state disk meta information;
and mechanical hard disk meta information.
4. The method of claim 3, wherein the updating the data block meta information corresponding to the data block comprises:
deleting the solid state disk meta-information corresponding to the data block, wherein the mechanical hard disk meta-information corresponding to the data block is reserved;
and persisting the data block meta-information.
5. The method of claim 4, wherein after re-matching data blocks of a target cloud disk to corresponding hard disks based on the cloud disk mode switch request, the method further comprises:
acquiring an access request of a user to a target cloud disk, wherein the access request is a data writing request or a data reading request;
if the access request is a data writing request, writing the writing data corresponding to the data writing request into the corresponding mechanical hard disk based on the updated data block meta information;
and if the access request is a data reading request, reading the read data corresponding to the data reading request from the corresponding mechanical hard disk based on the updated data block meta information.
6. The method of claim 2, wherein if the cloud disk mode switch request comprises a request to switch from a first cloud disk mode to a second cloud disk mode, the re-matching the corresponding hard disk for the data chunk of the target cloud disk based on the cloud disk mode switch request, wherein the keeping the corresponding mechanical hard disk unchanged for the data chunk comprises:
matching one solid state disk for each data block of the target cloud disk based on a request for switching from a first cloud disk mode to a second cloud disk mode;
updating data block meta-information corresponding to the data block, wherein the data block meta-information includes at least any one of:
solid state disk meta information;
and mechanical hard disk meta information.
7. The method of claim 6, wherein the updating the data block meta information corresponding to the data block comprises:
adding solid state disk meta-information corresponding to the data block, wherein the mechanical hard disk meta-information corresponding to the data block remains unchanged;
and persisting the data block meta-information.
8. The method of claim 7, wherein after re-matching data blocks of a target cloud disk to corresponding hard disks based on the cloud disk mode switch request, the method further comprises:
acquiring an access request of a user to a target cloud disk, wherein the access request is a data writing request or a data reading request;
if the access request is a data writing request, writing the writing data corresponding to the data writing request into the corresponding solid state disk based on the updated data block meta information;
and if the access request is a data reading request, reading the read data corresponding to the data reading request from the corresponding solid state disk or mechanical hard disk based on the updated data block meta information.
9. The method of any of claims 1-8, wherein the method further comprises:
acquiring a creation request of a target cloud disk, wherein the creation request comprises a first cloud disk mode creation request or a second cloud disk mode creation request corresponding to the target cloud disk;
determining one or more data blocks corresponding to the target cloud disk based on file size information corresponding to the target cloud disk to be created;
if the creation request is a first cloud disk mode creation request, each data block is matched with a mechanical hard disk, and if the creation request is a second cloud disk mode creation request, each data block is matched with a mechanical hard disk and a solid state hard disk;
storing data block meta-information corresponding to the data block, wherein the data block meta-information includes at least any one of:
solid state disk meta information;
and mechanical hard disk meta information.
10. A method for memory space mode switching, wherein the method comprises:
acquiring a storage space mode switching request of a target storage space, wherein the target storage space corresponds to one or more data blocks, the storage space mode comprises a first storage space mode or a second storage space mode, under the first storage space mode, data corresponding to the data blocks of the target storage space are stored in a corresponding first type of storage medium, and under the second storage space mode, data corresponding to the data blocks of the target storage space are stored in a corresponding first type of storage medium or a corresponding second type of storage medium;
based on the target storage space mode switching request, re-matching the corresponding storage medium for the data block of the target storage space;
if the storage space mode switching request is a request for switching from the second storage space mode to the first storage space mode, reducing a second type of storage medium corresponding to each data block in the first storage space mode; if the storage space mode switching request is a request for switching from the first storage space mode to the second storage space mode, adding a second type of storage medium corresponding to each data block to the target storage space;
the process of re-matching the data blocks of the target storage space with the corresponding hard disk comprises the following steps: the method comprises the following steps of dumping specific data in a hard disk matched with a data block, and/or updating the matching relation between the data block and the hard disk.
11. The method of claim 10, wherein the memory space mode switch request comprises any one of:
a request to switch from the second memory space mode to the first memory space mode;
a request to switch from a first memory space mode to a second memory space mode.
12. A network device for cloud disk mode switching, wherein the device comprises:
the switching request acquisition device is used for acquiring a cloud disk mode switching request of a target cloud disk, wherein the target cloud disk corresponds to one or more data blocks, the cloud disk mode comprises a first cloud disk mode or a second cloud disk mode, in the first cloud disk mode, data corresponding to the data blocks of the target cloud disk are stored in corresponding mechanical hard disks, and in the second cloud disk mode, data corresponding to the data blocks of the target cloud disk are stored in corresponding mechanical hard disks or corresponding solid state hard disks;
the switching device is used for re-matching the data blocks of the target cloud disk with the corresponding hard disks based on the cloud disk mode switching request;
if the cloud disk mode switching request is a request for switching from the second cloud disk mode to the first cloud disk mode, reducing the solid state disk corresponding to each data block in the first cloud disk mode; if the cloud disk mode switching request is a request for switching from the first cloud disk mode to the second cloud disk mode, adding a solid state disk corresponding to each data block to the target cloud disk;
re-matching the data blocks of the target cloud disk with the corresponding hard disks comprises: the method comprises the following steps of dumping specific data in a hard disk matched with a data block, and/or updating the matching relation between the data block and the hard disk.
13. The device of claim 12, wherein the cloud disk mode switch request comprises any one of:
a request to switch from the second cloud disk mode to the first cloud disk mode;
a request to switch from a first cloud disk mode to a second cloud disk mode.
14. The apparatus of claim 13, wherein if the cloud disk mode switch request comprises a request to switch from a second cloud disk mode to a first cloud disk mode, the switching means is to:
storing data blocks of a target cloud disk in a corresponding solid state disk and completely dumping the data blocks into a mechanical hard disk corresponding to the solid state disk based on a request for switching from a second cloud disk mode to a first cloud disk mode;
updating data block meta-information corresponding to the data block, wherein the data block meta-information includes at least any one of:
solid state disk meta information;
and mechanical hard disk meta information.
15. The apparatus of claim 14, wherein the updating of data block meta information corresponding to the data block comprises:
deleting the solid state disk meta-information corresponding to the data block, wherein the mechanical hard disk meta-information corresponding to the data block is reserved;
and persisting the data block meta-information.
16. The apparatus of claim 15, wherein the apparatus further comprises:
the first access request acquisition device is used for acquiring an access request of a user to a target cloud disk, wherein the access request is a write data request or a read data request;
and the first access request processing device is used for writing the write data corresponding to the write data request into the corresponding mechanical hard disk based on the updated data block meta information if the access request is the write data request, and reading the read data corresponding to the read data request from the corresponding mechanical hard disk based on the updated data block meta information if the access request is the read data request.
17. The apparatus of claim 13, wherein if the cloud disk mode switch request comprises a request to switch from a first cloud disk mode to a second cloud disk mode, the switching means is to:
matching one solid state disk for each data block of the target cloud disk based on a request for switching from a first cloud disk mode to a second cloud disk mode;
updating data block meta-information corresponding to the data block, wherein the data block meta-information includes at least any one of:
solid state disk meta information;
and mechanical hard disk meta information.
18. The apparatus of claim 17, wherein the updating of data block meta information corresponding to the data block comprises:
adding solid state disk meta-information corresponding to the data block, wherein the mechanical hard disk meta-information corresponding to the data block remains unchanged;
and persisting the data block meta-information.
19. The apparatus of claim 18, wherein the apparatus further comprises:
the second access request acquisition device is used for acquiring an access request of a user to the target cloud disk, wherein the access request is a write data request or a read data request;
and the second access request processing device is used for writing the write data corresponding to the write data request into the corresponding solid state disk based on the updated data block meta information if the access request is the write data request, and reading the read data corresponding to the read data request from the corresponding solid state disk or mechanical hard disk based on the updated data block meta information if the access request is the read data request.
20. The apparatus of any of claims 12 to 19, wherein the apparatus further comprises:
the cloud disk creating device comprises a creating request acquiring device and a creating request acquiring device, wherein the creating request acquiring device is used for acquiring a creating request of a target cloud disk, and the creating request comprises a first cloud disk mode creating request or a second cloud disk mode creating request corresponding to the target cloud disk;
the data block determining device is used for determining one or more data blocks corresponding to the target cloud disk based on the file size information corresponding to the target cloud disk to be created;
the disk selecting device is used for matching each data block with a mechanical hard disk if the creating request is a first cloud disk mode creating request, and matching each data block with a mechanical hard disk and a solid state hard disk if the creating request is a second cloud disk mode creating request;
data block meta-information storage means for storing data block meta-information corresponding to the data block, wherein the data block meta-information includes at least any one of:
solid state disk meta information;
and mechanical hard disk meta information.
21. A network device for storage space mode switching, wherein the device comprises:
a switching request obtaining device, configured to obtain a storage space mode switching request of a target storage space, where the target storage space corresponds to one or more data blocks, and the storage space mode includes a first storage space mode or a second storage space mode, where in the first storage space mode, data corresponding to a data block of the target storage space is stored in a corresponding first type of storage medium, and in the second storage space mode, data corresponding to a data block of the target storage space is stored in a corresponding first type of storage medium or a corresponding second type of storage medium;
switching means for re-matching the data blocks of the target storage space with the corresponding storage media based on the target storage space mode switching request;
if the storage space mode switching request is a request for switching from the second storage space mode to the first storage space mode, reducing a second type of storage medium corresponding to each data block in the first storage space mode; if the storage space mode switching request is a request for switching from the first storage space mode to the second storage space mode, adding a second type of storage medium corresponding to each data block to the target storage space;
the process of re-matching the data blocks of the target storage space with the corresponding hard disk comprises the following steps: the method comprises the following steps of dumping specific data in a hard disk matched with a data block, and/or updating the matching relation between the data block and the hard disk.
22. The device of claim 21, wherein the memory space mode switch request comprises any one of:
a request to switch from the second memory space mode to the first memory space mode;
a request to switch from a first memory space mode to a second memory space mode.
23. An apparatus for cloud disk mode switching, wherein the apparatus comprises:
a processor; and
a memory arranged to store computer executable instructions that, when executed, cause the processor to:
acquiring a cloud disk mode switching request of a target cloud disk, wherein the target cloud disk corresponds to one or more data blocks, the cloud disk mode comprises a first cloud disk mode or a second cloud disk mode, in the first cloud disk mode, data corresponding to the data blocks of the target cloud disk are stored in a corresponding mechanical hard disk, and in the second cloud disk mode, data corresponding to the data blocks of the target cloud disk are stored in a corresponding mechanical hard disk or a corresponding solid state hard disk;
based on the cloud disk mode switching request, re-matching the data blocks of the target cloud disk with the corresponding hard disks;
if the cloud disk mode switching request is a request for switching from the second cloud disk mode to the first cloud disk mode, reducing the solid state disk corresponding to each data block in the first cloud disk mode; if the cloud disk mode switching request is a request for switching from the first cloud disk mode to the second cloud disk mode, adding a solid state disk corresponding to each data block to the target cloud disk;
re-matching the data blocks of the target cloud disk with the corresponding hard disks comprises: the method comprises the following steps of dumping specific data in a hard disk matched with a data block, and/or updating the matching relation between the data block and the hard disk.
24. An apparatus for memory space mode switching, wherein the apparatus comprises:
a processor; and
a memory arranged to store computer executable instructions that, when executed, cause the processor to:
acquiring a storage space mode switching request of a target storage space, wherein the target storage space corresponds to one or more data blocks, the storage space mode comprises a first storage space mode or a second storage space mode, under the first storage space mode, data corresponding to the data blocks of the target storage space are stored in a corresponding first type of storage medium, and under the second storage space mode, data corresponding to the data blocks of the target storage space are stored in a corresponding first type of storage medium or a corresponding second type of storage medium;
based on the target storage space mode switching request, re-matching the corresponding storage medium for the data block of the target storage space;
if the storage space mode switching request is a request for switching from the second storage space mode to the first storage space mode, reducing a second type of storage medium corresponding to each data block in the first storage space mode; if the storage space mode switching request is a request for switching from the first storage space mode to the second storage space mode, adding a second type of storage medium corresponding to each data block to the target storage space;
the process of re-matching the data blocks of the target storage space with the corresponding hard disk comprises the following steps: the method comprises the following steps of dumping specific data in a hard disk matched with a data block, and/or updating the matching relation between the data block and the hard disk.
CN201710466579.4A 2017-06-19 2017-06-19 Method and equipment for switching cloud disk modes Active CN109144403B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710466579.4A CN109144403B (en) 2017-06-19 2017-06-19 Method and equipment for switching cloud disk modes

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710466579.4A CN109144403B (en) 2017-06-19 2017-06-19 Method and equipment for switching cloud disk modes

Publications (2)

Publication Number Publication Date
CN109144403A CN109144403A (en) 2019-01-04
CN109144403B true CN109144403B (en) 2021-10-01

Family

ID=64804518

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710466579.4A Active CN109144403B (en) 2017-06-19 2017-06-19 Method and equipment for switching cloud disk modes

Country Status (1)

Country Link
CN (1) CN109144403B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109918952B (en) * 2019-03-08 2019-10-18 中融科创信息技术河北有限公司 A kind of safer cloud computing platform system and processing method
CN110333974B (en) * 2019-06-03 2022-04-15 腾讯科技(深圳)有限公司 Switching method and device of cloud storage service
CN113093995B (en) * 2021-04-12 2023-05-26 深圳软通动力信息技术有限公司 Cloud disk data migration method and system

Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102591593A (en) * 2011-12-28 2012-07-18 华为技术有限公司 Method for switching hybrid storage modes, device and system
CN102662459A (en) * 2012-04-22 2012-09-12 复旦大学 Method for reducing energy consumption of server by using mixed storage of solid-state drive and mechanical hard disk
CN102955675A (en) * 2011-08-19 2013-03-06 株式会社日立制作所 Method and apparatus to improve efficiency in the use of resources in data center
CN103081441A (en) * 2010-07-29 2013-05-01 苹果公司 Dynamic migration within a network storage system
CN103377152A (en) * 2012-04-26 2013-10-30 深圳市朗科科技股份有限公司 Write operation control method and write operation device for solid state disk
CN103399713A (en) * 2013-08-02 2013-11-20 浙江大学 Data buffering method for balancing multistage memory property and solid-state disk service life
US8788763B2 (en) * 2011-10-13 2014-07-22 International Business Machines Corporation Protecting memory of a virtual guest
WO2014199506A1 (en) * 2013-06-14 2014-12-18 株式会社日立製作所 Storage management calculator, and storage management method
CN104679661A (en) * 2013-11-27 2015-06-03 阿里巴巴集团控股有限公司 Hybrid memory control method and hybrid memory system
CN105138276A (en) * 2015-07-14 2015-12-09 苏州科达科技股份有限公司 Data storage method and data storage system
CN105516242A (en) * 2015-11-23 2016-04-20 华为技术有限公司 Storage resource distribution method and storage resource distribution system
CN105745622A (en) * 2013-11-15 2016-07-06 微软技术许可有限责任公司 Computing system architecture that facilitates forming of customized virtual disks
CN106227578A (en) * 2016-07-12 2016-12-14 腾讯科技(深圳)有限公司 A kind of method of live migration of virtual machine, equipment and system

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150293699A1 (en) * 2014-04-11 2015-10-15 Graham Bromley Network-attached storage enhancement appliance

Patent Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103081441A (en) * 2010-07-29 2013-05-01 苹果公司 Dynamic migration within a network storage system
CN102955675A (en) * 2011-08-19 2013-03-06 株式会社日立制作所 Method and apparatus to improve efficiency in the use of resources in data center
US8788763B2 (en) * 2011-10-13 2014-07-22 International Business Machines Corporation Protecting memory of a virtual guest
CN102591593A (en) * 2011-12-28 2012-07-18 华为技术有限公司 Method for switching hybrid storage modes, device and system
CN102662459A (en) * 2012-04-22 2012-09-12 复旦大学 Method for reducing energy consumption of server by using mixed storage of solid-state drive and mechanical hard disk
CN103377152A (en) * 2012-04-26 2013-10-30 深圳市朗科科技股份有限公司 Write operation control method and write operation device for solid state disk
WO2014199506A1 (en) * 2013-06-14 2014-12-18 株式会社日立製作所 Storage management calculator, and storage management method
CN103399713A (en) * 2013-08-02 2013-11-20 浙江大学 Data buffering method for balancing multistage memory property and solid-state disk service life
CN105745622A (en) * 2013-11-15 2016-07-06 微软技术许可有限责任公司 Computing system architecture that facilitates forming of customized virtual disks
CN104679661A (en) * 2013-11-27 2015-06-03 阿里巴巴集团控股有限公司 Hybrid memory control method and hybrid memory system
CN105138276A (en) * 2015-07-14 2015-12-09 苏州科达科技股份有限公司 Data storage method and data storage system
CN105516242A (en) * 2015-11-23 2016-04-20 华为技术有限公司 Storage resource distribution method and storage resource distribution system
CN106227578A (en) * 2016-07-12 2016-12-14 腾讯科技(深圳)有限公司 A kind of method of live migration of virtual machine, equipment and system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
"内存云分级混合存储架构数据迁移策略";郭刚;《中国优秀硕士学位论文全文数据库 信息科技辑》;20170215(第02期);I137-150 *

Also Published As

Publication number Publication date
CN109144403A (en) 2019-01-04

Similar Documents

Publication Publication Date Title
US11853549B2 (en) Index storage in shingled magnetic recording (SMR) storage system with non-shingled region
US8990529B2 (en) Method for optimizing cleaning of maps in flashcopy cascades containing incremental maps
US9891830B2 (en) Tier based data file management
EP3076307A1 (en) Method and device for responding to a request, and distributed file system
US20150113218A1 (en) Distributed Data Processing Method and Apparatus
US11262916B2 (en) Distributed storage system, data processing method, and storage node
US10552089B2 (en) Data processing for managing local and distributed storage systems by scheduling information corresponding to data write requests
US8572338B1 (en) Systems and methods for creating space-saving snapshots
CN109144403B (en) Method and equipment for switching cloud disk modes
US20170153909A1 (en) Methods and Devices for Acquiring Data Using Virtual Machine and Host Machine
CN110597762A (en) File processing method, device, equipment and storage medium
US20220164316A1 (en) Deduplication method and apparatus
WO2014153931A1 (en) File storage method and device, access client and metadata server system
CN104035728A (en) Hard disk hot plug handling method, device and node
CN111382011A (en) File data access method and device and computer readable storage medium
EP3436990B1 (en) Systems and methods for enabling modifications of multiple data objects within a file system volume
CN114237489B (en) Method and device for writing logic resources into SMR disk, electronic equipment and storage medium
US10803109B2 (en) Method and device for reading and writing video data in NAS device
CN114089912A (en) Data processing method and device based on message middleware and storage medium
CN111352590A (en) File storage method and equipment
CN111625500A (en) File snapshot method and device, electronic equipment and storage medium
CN113127415A (en) Method, device, medium and electronic equipment for processing real-time stream file
CN109753228B (en) Snapshot deleting method, device and system
CN110381121B (en) Data processing method and device
CN114116641A (en) Method and device for synchronizing metadata

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