Data access method, computing device and storage medium
By utilizing the access time difference between the first and second storage media in cloud storage to dynamically migrate data to reduce storage costs and improve user experience, the problems of high storage costs and user experience in cloud storage are solved.
Patent Information
- Application Number
- CN202110231751.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-03-02
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2041-03-02
AI Technical Summary
In cloud storage, users face high storage costs and user experience problems when storing large amounts of data. It is difficult for existing technologies to effectively reduce storage costs and maintain user-free access experience.
By implementing data access, migration, reading and writing methods in the computing device, the different access time characteristics of the first and second storage media are used to dynamically determine the storage location of the data, and migrate data with low access frequency to a more cost-effective location. On a low-cost storage medium, access and write operations can be performed without the user being aware of it.
It effectively reduces storage costs, improves user experience, reduces the operations and operation and maintenance costs that users need to perform, and avoids the transformation costs and operation and maintenance costs caused by the data migration process.
Smart Images

Figure CN113296696B
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a data access method, a reading method, a writing method, a migration method, a computing device, and a storage medium. Background Art
[0002] Cloud storage is an online storage model that allows data to be stored on multiple virtual servers rather than dedicated servers. Users who need data storage can meet their data storage needs by purchasing or renting storage space on virtual servers. However, the more data a user stores on a virtual server, the greater the storage cost. Therefore, how to provide users with a better experience when storing large amounts of data and reduce storage costs is an important issue. Summary of the invention
[0003] Multiple aspects of the present application provide a data access method, a reading method, a writing method, a migration method, a computing device and a storage medium, so as to reduce storage costs and realize user-imperceptible access.
[0004] An embodiment of the present application provides a data access method, including: obtaining an access request, the access request carrying information about access data; determining, based on the information, whether the access data is migrated data, the migrated data being migrated from a first storage medium to a second storage medium, and the time of accessing the data corresponding to the first storage medium being less than the time of accessing the data corresponding to the second storage medium; if the access data is migrated data, determining, based on the information, a storage location of the access data in the second storage medium, obtaining the access data, and performing access processing on the access data according to the access request.
[0005] An embodiment of the present application provides a data migration method, including: scanning data stored in a first storage medium; when there is data to be migrated that meets a preset migration condition in the data, migrating the data to be migrated to a second storage medium, and the time for reading and writing data corresponding to the first storage medium is less than the time for reading and writing data corresponding to the second storage medium; when there is data to be retained that does not meet the preset migration condition in the data, retaining the data to be retained in the first storage medium.
[0006] An embodiment of the present application also provides a method for reading data, including: receiving a read request, the read request carrying read data information; determining whether the read data is migrated data based on the read data information, the migrated data is migrated from a first storage medium to a second storage medium, and the read data time corresponding to the first storage medium is less than the read data time corresponding to the second storage medium; if the read data is migrated data, determining the storage location of the read data in the second storage medium based on the read data information, obtaining the read data, and returning it.
[0007] An embodiment of the present application also provides a method for writing data, including: receiving a write request, the write request carrying write data information; determining, based on the write data information, whether the written data is migrated data, the migrated data is migrated from a first storage medium to a second storage medium, and the write data time corresponding to the first storage medium is less than the write data time corresponding to the second storage medium; if the written data is migrated data, determining the storage location of the written data in the second storage medium based on the write data information, obtaining the written data, writing data according to the data to be written corresponding to the write data information and the written data, and storing the write result in the corresponding file of the first storage medium.
[0008] An embodiment of the present application also provides a computing device, including: a memory and a processor; the memory is used to store computer programs; the processor is used to scan data stored in a first storage medium; when there is data to be migrated that meets the preset migration conditions in the data, the data to be migrated is migrated to a second storage medium, and the time for reading and writing data corresponding to the first storage medium is less than the time for reading and writing data corresponding to the second storage medium; when there is data to be retained that does not meet the preset migration conditions in the data, the data to be retained is retained in the first storage medium.
[0009] An embodiment of the present application also provides a computing device, including: a memory, a processor and a communication component; the memory is used to store a computer program; the communication component is used to receive a read request, the read request carries read data information; the processor is used to execute the computer program to: determine whether the read data is migrated data based on the read data information, the migrated data is migrated from a first storage medium to a second storage medium, and the read data time corresponding to the first storage medium is less than the read data time corresponding to the second storage medium; if the read data is migrated data, then based on the read data information, determine the storage location of the read data in the second storage medium, obtain the read data, and return it.
[0010] An embodiment of the present application also provides a computing device, including: a memory, a processor and a communication component; the memory is used to store a computer program; the communication component is used to receive a write request, the write request carries write data information; the processor is used to execute the computer program to: determine whether the written data is migrated data based on the write data information, the migrated data is migrated from a first storage medium to a second storage medium, and the write data time corresponding to the first storage medium is less than the write data time corresponding to the second storage medium; if the written data is migrated data, then based on the write data information, determine the storage location of the written data in the second storage medium, obtain the written data, write data according to the data to be written corresponding to the write data information and the written data, and store the write result in the corresponding file of the first storage medium.
[0011] An embodiment of the present application also provides a computing device, including: a memory, a processor and a communication component; the memory is used to store a computer program; the communication component is used to obtain an access request, the access request carries information about access data; the processor is used to execute the computer program to: determine, based on the information, whether the access data is migrated data, the migrated data is migrated from a first storage medium to a second storage medium, and the time of accessing the data corresponding to the first storage medium is less than the time of accessing the data corresponding to the second storage medium; if the access data is migrated data, then based on the information, determine the storage location of the access data in the second storage medium, obtain the access data, and perform access processing on the access data according to the access request.
[0012] An embodiment of the present application also provides a computer-readable storage medium storing a computer program. When the computer program is executed by one or more processors, the one or more processors implement the steps in the above method.
[0013] In an embodiment of the present application, an access request is obtained, the access request carrying information about access data; based on the information, it is determined whether the access data is migrated data, the migrated data is migrated from a first storage medium to a second storage medium, and the time of the access data corresponding to the first storage medium is less than the time of the access data corresponding to the second storage medium; if the access data is migrated data, then based on the information, the storage location of the access data in the second storage medium is determined, the access data is obtained, and access processing is performed on the access data according to the access request.
[0014] Among them, although the data is stored in the first storage medium and the second storage medium, for the user, since the access time corresponding to the first storage medium is less than the access time corresponding to the second storage medium, the cost of the second storage medium is lower than the cost of the first storage medium, thereby reducing the storage cost. In this regard, the user does not need to delete the stored data to reduce the storage cost, thereby improving the user experience. At the same time, although the data is stored in the first storage medium and the second storage medium, the user does not need to perform additional operations, and there is no need to add any additional operation and maintenance operations. That is, the access data of the second storage medium can be accessed by sending an access request as usual. It is the same as the data operation for accessing the first storage medium. The user is unaware of the separate storage of the data, thereby improving the user experience. At the same time, a lot of transformation costs and operation and maintenance costs can also be saved.
[0015] Accordingly, the data stored in the first storage medium is scanned; when there is data to be migrated that meets the preset migration conditions, the data to be migrated is migrated to the second storage medium, and the time for reading and writing data corresponding to the first storage medium is less than the time for reading and writing data corresponding to the second storage medium; when there is data to be retained that does not meet the preset migration conditions, the data to be retained is retained in the first storage medium. Storage costs can be reduced. In this way, users do not need to delete stored data to reduce storage costs, which improves user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0017] Figure 1 A schematic diagram of the structure of a data access system of an exemplary embodiment of the present application;
[0018] Figure 2 A flowchart of a method for accessing data according to an exemplary embodiment of the present application is provided;
[0019] Figure 3 A schematic diagram of data migration of an exemplary embodiment of the present application;
[0020] Figure 4 A schematic diagram of reading data according to an exemplary embodiment of the present application;
[0021] Figure 5 A schematic diagram of writing data according to an exemplary embodiment of the present application;
[0022] Figure 6 A schematic diagram of data writing for an exemplary embodiment of the present application;
[0023] Figure 7 A schematic flow chart of a method for reading data according to an exemplary embodiment of the present application;
[0024] Figure 8 A schematic flow chart of a method for writing data according to an exemplary embodiment of the present application;
[0025] Fig. 9 A flowchart of a data migration method according to an exemplary embodiment of the present application;
[0026] Fig.10 A schematic diagram of the structure of a data access device provided by an exemplary embodiment of the present application;
[0027] Fig.11 A schematic diagram of the structure of a data reading device provided by an exemplary embodiment of the present application;
[0028] Fig.12 A schematic diagram of the structure of a data writing device provided by an exemplary embodiment of the present application;
[0029] Fig.13 A schematic diagram of the structure of a computing device provided for an exemplary embodiment of the present application;
[0030] Fig.14 A schematic diagram of the structure of a computing device provided for an exemplary embodiment of the present application;
[0031] Fig.15 A schematic diagram of the structure of a computing device provided for an exemplary embodiment of the present application. DETAILED DESCRIPTION
[0032] In order to make the purpose, technical solution and advantages of the present application clearer, the technical solution of the present application will be clearly and completely described below in combination with the specific embodiments of the present application and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application.
[0033] Users of cloud services are paying more and more attention to cost control when using file storage resources. When we follow up with many users, we found that the starting point for users to delete existing data, migrate data to other cloud products, etc. is mostly to control the total storage cost.
[0034] Therefore, the embodiment of the present application provides a data lifecycle management function and management of hot and cold data, and the access methods of the cold and hot data are the same, and no additional operation and maintenance operations are required, which saves a lot of transformation costs and operation and maintenance costs to reduce storage costs.
[0035] Figure 1 The structure diagram of a data access system provided by an exemplary embodiment of the present application is as follows. Figure 1 As shown, the system 100 may include: a first device 101 , a second device 102 , and the system 100 may also include a third device 103 .
[0036] Among them, the first device 101 can be a device with certain computing capabilities, which can realize the function of sending a request to the second device 102 and can receive data sent by the second device 102. The basic structure of the first device 101 may include: at least one processor. The number of processors may depend on the configuration and type of the device with certain computing capabilities. The device with certain computing capabilities may also include a memory, which may be volatile, such as RAM, or non-volatile, such as read-only memory (ROM), flash memory, etc., or may include both types at the same time. The memory usually stores an operating system (OS), one or more application programs, and may also store program data, etc. In addition to the processing unit and the memory, the device with certain computing capabilities also includes some basic configurations, such as a network card chip, an IO bus, a display component, and some peripheral devices, etc. Optionally, some peripheral devices may include, for example, a keyboard, an input pen, etc. Other peripheral devices are well known in the art and will not be described in detail here. Optionally, the first device 101 may be an intelligent terminal, such as a mobile phone, a desktop computer, a notebook, a tablet computer, etc.
[0037] The second device 102 refers to a device that can provide computing and processing services in a network virtual environment, and can refer to a device that uses the network to access data search and access processing. In physical implementation, the second device 102 can be any device that can provide computing services, respond to service requests, and perform data processing, such as a cloud server, cloud host, virtual center, conventional server, etc. The second device 102 mainly includes a processor, a hard disk, a memory, a system bus, etc., which is similar to a general computer architecture. The first storage medium and the second storage medium can be deployed on the device.
[0038] Specifically, the first device 101 sends an access request, and the second device 102 obtains the access request, which carries information about the access data; based on the information, it is determined whether the access data is migrated data, which is data that has been migrated from the first storage medium to the second storage medium, and the time of the access data corresponding to the first storage medium is less than the time of the access data corresponding to the second storage medium; if the access data is migrated data, the storage location of the access data in the second storage medium is determined based on the information, and the access data is obtained, and access processing is performed on the access data according to the access request. Finally, the second device 102 sends the access result to the first device 101.
[0039] In addition, the second device 102 scans the data stored in the first storage medium; when there is data to be migrated that meets the preset migration conditions, the data to be migrated is migrated to the second storage medium; when there is data to be retained that does not meet the preset migration conditions, the data to be retained is retained in the first storage medium.
[0040] Specifically, the first device 101 may send a read request to the second device 102, and the read request carries the read data information. The second device 102 receives the read request, and the read request carries the read data information; according to the read data information, it determines whether the read data is migrated data, and if the read data is migrated data, it determines the storage location of the read data in the second storage medium based on the read data information, obtains the read data, and returns it. The read data, which may also be referred to as the read result, is sent to the first device 101. After receiving the read result, the first device 101 displays it.
[0041] In addition, the first device 101 sends a write request to the second device 102, and the write request carries write data information. The second device 102 receives the write request, and the write request carries write data information; according to the write data information, it determines whether the written data is migrated data, and if the written data is migrated data, it determines the storage location of the written data in the second storage medium based on the write data information, obtains the written data, writes data according to the data to be written and the written data corresponding to the write data information, and stores the write result in the corresponding file of the first storage medium. The second device 102 can send a successful write message and the write result to the first device 101.
[0042] It should be understood that during the above data migration, the same second device 102 may have a first storage medium or a second storage medium. Figure 1As shown, the data to be migrated can be sent to the third device 103, on which the second storage medium is deployed, so as to complete the data migration, which will not be described in detail here.
[0043] The third device 103 refers to a device that can provide computing and processing services in a network virtual environment, and can refer to a device that uses a network to store data. In terms of physical implementation, the third device 103 can be any device that can provide computing services, respond to service requests, and store data, such as a cloud server, cloud host, virtual center, conventional server, etc. The third device 103 mainly includes a processor, a hard disk, a memory, a system bus, etc., which is similar to a general computer architecture.
[0044] It should be noted that, for reading data, the second device 102 can obtain the read data from the third device 103, and the third device 103 can send the read data in the migrated data to the second device 102, and then the second device 102 sends the read result to the first device 101.
[0045] For writing data, the second device 102 may also obtain the written data from the third device 103, and the third device 103 may send the written data in the migrated data to the second device 102, and then the second device 102 writes the data to obtain the writing result, and stores the writing result in the corresponding file of the first storage medium. The second device 102 may send a message of successful writing and the writing result to the first device 101 for display.
[0046] In the data access scenario of the embodiment of the present application, the second device 102, such as a cloud server, periodically scans the data in the first hard disk deployed thereon, and the data may be data in units of files. That is, the files in the first hard disk may be scanned. And according to the migration conditions, such as files or data that have not been accessed for 14 days, these files or data are used as data to be migrated, or files to be migrated. And the data to be migrated, or the files to be migrated, may be migrated to the second hard disk on the cloud server, wherein the time for reading and writing data of the second hard disk is greater than the time for reading and writing data of the first hard disk. In addition, the second hard disk may also be set on other servers.
[0047] After the migration is completed, the cloud server may receive a read request sent by the user through the first device 101, such as a computer. The read request may carry read data information, which has a file identifier, such as a file name. The cloud server may search for the data meta information of the corresponding file based on the file name. The meta information may include information indicating whether the data (or file) is stored in the second storage medium. If so, the migrated data in the corresponding migrated file may be found from the second hard disk according to the read position information of the read data information carried by the read request, that is, the data is read. Or the migrated data may be directly found from the data meta information, read, and then returned to the user's computer.
[0048] The cloud server can receive a write request sent by a user through a first device 101, such as a computer. The write request can carry write data information, which has a file identifier, such as a file name. The cloud server can search for data metadata of the corresponding file based on the file name. The metadata may include information indicating whether the data (or file) is stored in the second storage medium. If so, the written data in the migrated data is obtained from the second storage medium according to the storage location of the corresponding migrated data in the second storage medium; data is written according to the data to be written carried by the write request and the acquired written data, such as data merging, and the write result is stored in the corresponding file of the first storage medium.
[0049] It should be noted that, for application scenarios, all scenarios that meet the requirements of data storage can be applied.
[0050] In the above embodiment, the first device 101, the second device 102, and the third device 103 are connected to a network, and the network connection may be a wireless connection. If the first device 101, the second device 102, and the third device 103 are connected for communication, the network standard of the mobile network may be any one of 2G (GSM), 2.5G (GPRS), 3G (WCDMA, TD-SCDMA, CDMA2000, UTMS), 4G (LTE), 4G+ (LTE+), WiMax, 5G, etc.
[0051] The data access process is described in detail below in conjunction with the method embodiment.
[0052] Figure 2 This is a flowchart of a data access method according to an exemplary embodiment of the present application. The method 200 provided in the embodiment of the present application is executed by a computing device, such as a cloud server. The method 200 includes the following steps:
[0053] 201: Get access request, which carries information about access data.
[0054] 202: Determine whether the accessed data is migrated data according to the information.
[0055] The migrated data is migrated from the first storage medium to the second storage medium, and the access time of the data corresponding to the first storage medium is shorter than the access time of the data corresponding to the second storage medium.
[0056] 203: If the access data is migrated data, determine the storage location of the access data in the second storage medium based on the information, obtain the access data, and perform access processing on the access data according to the access request.
[0057] The following is a detailed description of the above steps:
[0058] 201: Get access request, which carries information about access data.
[0059] The access request may include a read request and a write request. The access data information may include read data information and write data information.
[0060] For example, a user accesses a cloud server through a web page on a computer, such as Figure 4 As shown, users can access the cloud server through website 306 ( Figure 4 The cloud server is not shown in the figure, but it should be understood that it is accessing the cloud server). The computer responds to the user's read operation and sends a read request to the cloud server, which can carry read data information. Or,
[0061] Users access the cloud server through the web page of the computer, such as Figure 5 As shown, users can access the cloud server through website 306 ( Figure 5 The cloud server is not shown in the figure, but it should be understood that the cloud server is accessed). The computer responds to the user's write operation and sends a write request to the cloud server, and the write request can carry write data information.
[0062] 202: Determine whether the accessed data is migrated data according to the information.
[0063] The migrated data is migrated from the first storage medium to the second storage medium, and the access time of the data corresponding to the first storage medium is less than the access time of the data corresponding to the second storage medium. Accessing data may refer to reading data or writing data. It should be understood that this time comparison is based on the reference premise of accessing data of the same scale.
[0064] The first storage medium may be a storage medium with better performance, such as a hard disk with better performance. The first storage medium is better than the second storage medium, which can be reflected in the time of reading and writing data, such as the time of reading and writing data by the first storage medium is less than the time of reading data by the second storage medium. It should be understood that since the performance of the first storage medium is better than that of the second storage medium, the storage cost of the first storage medium is higher than the storage cost of the second storage medium.
[0065] It should be noted that, in the first storage medium, the stored data may be stored in file units. That is, the data is scanned in file units and migrated in units. Of course, the data may be stored in other storage units, such as directly in storage data or in other storage area blocks, and the corresponding scanning and migration are also performed in corresponding units.
[0066] For direct storage of data, the cloud server directly scans all stored data in the first storage medium, such as the first hard disk.
[0067] For files that are stored in units, the cloud server can directly scan the files.
[0068] The following describes the specific implementation process from the perspective of enabling users to access hot and cold data without being aware of the data and saving a lot of transformation and operation and maintenance costs.
[0069] For the reading process:
[0070] Specifically, determining whether the accessed data is migrated data according to the information includes: searching for information indicating that the migrated data is stored in the second storage medium and corresponding to the read file identifier.
[0071] The read data information may include a read data identifier of the read data (which may be a file identifier) or may include a read file identifier of the read data, i.e., a file identifier of the read data. In addition, the read data information may include a storage location in the file where the read data is located (i.e., a read location of the data in the file), such as an offset in the offset file, i.e., a start read position, and a length of the read data.
[0072] For example, as described above, the cloud server can determine the metadata information of the corresponding file based on the read file identifier (or read data identifier, which can also be a read file identifier) in the information, such as the file name, and determine whether it is migrated data or a migrated file (i.e., hot or cold data) from the metadata information in the first storage medium 302.
[0073] For the write process:
[0074] The written data information includes a write file identifier of the data to be written; determining whether the accessed data is migrated data according to the information includes: searching for information corresponding to the write file identifier indicating that the migrated data is stored in the second storage medium;
[0075] The written data information may include the write file identifier of the data to be written, or the written data identifier (which may be the write file identifier of the written data), or the write file identifier of the written data. In addition, it may also include the storage location in the write file where the written data is located (i.e., the write location information of the written data in the write file, which can also be understood as the write location information required for the data to be written), such as the offset in the offset file, i.e., the starting write position, and the length of the written data.
[0076] For example, as described above, the cloud server can determine the metadata information of the corresponding write file based on the write file identifier (the data identifier can also be the write file identifier) in the information, such as the file name, and determine whether it is migrated data or a migrated file (i.e., hot or cold data) from the metadata information in the first storage medium 302.
[0077] 203: If the access data is migrated data, determine the storage location of the access data in the second storage medium based on the information, obtain the access data, and perform access processing on the access data according to the access request.
[0078] For the reading process:
[0079] Specifically, determining the storage location of the access data in the second storage medium based on the information includes: searching for the storage location of the read data in the second storage medium corresponding to the read file identifier.
[0080] When the access request includes a read request, access processing is performed on the access data according to the access request, including: returning the acquired access data as read data.
[0081] For example, according to the above, if Figure 4 As shown, if it is not (i.e., hot data), the corresponding read data can be directly found according to the storage location in the first storage medium 302 recorded in the metadata information 401. Alternatively, the corresponding file is found according to the storage location, and the corresponding read data is obtained according to the storage location of the data in the file.
[0082] If yes, that is, cold data, has been migrated. Then, the cloud server can find the corresponding migrated data or migrated files in the second storage medium 305 according to the storage location in the metadata information 402, that is, read the data or read the file. The corresponding migrated data can be directly read, that is, read the data. Alternatively, the corresponding file is found according to the storage location, that is, read the file, and the corresponding read data is obtained according to the storage location of the data in the file, that is, read the cold data.
[0083] After the cloud server obtains the read data, it returns it to the user's computer for display.
[0084] For the write process:
[0085] Specifically, determining the storage location of the access data in the second storage medium based on the information includes: searching for the storage location of the written data corresponding to the write file identifier in the second storage medium.
[0086] When the access request includes a write request, access processing is performed on the access data according to the access request, including: writing data according to the data to be written and the data to be written corresponding to the write data information, and storing the write result in the corresponding file of the first storage medium, and the data to be written is the access data.
[0087] For example, according to the above, if Figure 4 As shown, if it is not (i.e., hot data), the corresponding written data can be directly found according to the storage position in the first storage medium 302 recorded in the metadata information 401. Alternatively, the corresponding write file is found according to the storage position, and the storage position of the written data in the write file, i.e., the write position, such as the offset in the offset file, i.e., the start write position, and the length of the written data, are obtained to write the data.
[0088] If yes, that is, cold data, has been migrated. Then, the cloud server can find the corresponding migrated data or migrated files in the second storage medium 305 according to the storage location in the metadata information 402, that is, written data or written files, which can also be called written files. The corresponding migrated data, that is, written data, can be directly obtained. Alternatively, the corresponding written file is found according to the storage location, and the corresponding written data is obtained according to the storage location of the written data in the written file, that is, the corresponding cold data is obtained.
[0089] After the cloud server obtains the data to be written, it writes the data to be written into the data to be written, which can be written in a manner such as adding, modifying, and overwriting, and obtains the writing result, which can be stored in the first storage medium or the second storage medium. At the same time, the final writing success or failure result can be returned to the user's computer for display.
[0090] It should be noted that when the writing result is stored in the second storage medium, it can still be stored in the location where the previously written data is located. When the writing result is stored in the first storage medium, the writing result can be stored in the form of a file.
[0091] Specifically, if the access data is migrated data, then based on the information, the storage location of the access data in the second storage medium is determined, and the migrated data is obtained, including: if the written data in the write file corresponding to the write data information belongs to the migrated data, then based on the information, the storage location of the write file in the second storage medium is determined, and the written data in the write file is obtained from the second storage medium.
[0092] Since this has been explained in the previous article, I will not repeat it here.
[0093] The write data information also includes: write position information of the data to be written in the corresponding write file; obtaining access data includes: finding the write file according to the storage position; and obtaining the written data in the write file according to the write position information.
[0094] Since it has been explained above, it will not be repeated here. It is only explained that in order to better implement the writing process, the data can be written by recalling the corresponding migrated data from the second storage medium. In order to better recall and write data, the data blocks corresponding to the cold data can be recalled.
[0095] Specifically, obtaining the written data in the write file according to the write position information includes: obtaining the long block corresponding to the written data in the write file according to the write position information, so as to write the data with the data to be written.
[0096] Among them, the long block can refer to the extent long block. The layout of the file stored on the storage medium can be in the form of variable length blocks (variable extent), that is, multiple long blocks can form a file. Small files can use several small-sized extents to store all user data, while large files need to use a larger number of extents to store complete user data. In order to clarify the efficiency of storage space use, the larger the extent long block number in a file, the larger the size will be.
[0097] For example, according to the above description, when the cloud server finds the data to be written from the second storage medium, it directly obtains the corresponding long block, in which the data to be written is contained, so that the data to be written is written into the long block.
[0098] The data layout of the above files may cause obvious write amplification and bandwidth waste of data flow between the two types of storage media when the user uses low-frequency storage and the user-unaware write process occurs. For example, when the user writes new data of length length at a certain offset in the file, and the written new data is logically located in the block of ExtentN. At this time, if the data in ExtentN is recalled from the NAS low-frequency storage according to the Extent granularity, it will cause serious write amplification and bandwidth waste, because the size of ExtentN may be very large, and the length of the new data written by the user this time may be very small. In order to solve this problem, the imperceptible write process can be optimized in a targeted manner. When the user imperceptibly writes a file that has been migrated to the NAS low-frequency storage, and the write offset is logically located in a large-size Extent, the segment recall method is adopted.
[0099] Specifically, when the starting write bit of the data to be written in the write position information in the write file is greater than the bit threshold, the method 200 also includes: determining the long block corresponding to the written data in the write file according to the write position information; determining the corresponding written data from the long block according to the write position information, and dividing the long block according to the written data to obtain sub-blocks corresponding to the written data; writing data according to the data to be written and the sub-blocks, and storing the writing results in the corresponding file of the first storage medium based on the sub-blocks.
[0100] For example, according to the above, when the bit of offset is greater than the bit threshold, the cloud server finds the corresponding extentN according to the above method, and then determines the corresponding data to be written therein. At this time, the extentN can be divided into multiple sub-block segments, and then the cloud server obtains the sub-block segment corresponding to the data to be written, and the sub-block has the corresponding data to be written. The cloud server writes the data to be written into the sub-block segment and stores it in the corresponding file of the first storage medium.
[0101] like Figure 6As shown, the file 602 in the second storage medium stores user data, wherein the sub-block segment to which the data is written is obtained by the cloud server, and the data to be written is written to the sub-block segment to obtain a writing result, and the writing result is stored in extentN in the file 601 in the first storage medium, that is, in long block N. The long block N does not contain unrecalled data or writing results corresponding to unrecalled data.
[0102] It should be noted that when the bit of the offset is less than or equal to the bit threshold, data can be written through a sub-block or through the long block mentioned above.
[0103] Since the writing result is finally stored in the first storage medium, the user can easily find it when writing or reading the writing result next time to perform the reading and writing process.
[0104] It should also be noted that, during the reading process, after the cloud server obtains the corresponding read data, it can transfer the read data from the second storage medium to the first storage medium for subsequent reading and writing by the user. The transfer process can be similar to the process of storing the write result to the first storage medium described above, but there is no data writing process, but the obtained read data is directly transferred to the corresponding file in the first storage medium.
[0105] Since the write result is stored in the first storage medium, in order to facilitate the search for corresponding data in the subsequent reading and writing process, the recall of the data can be recorded, or which sub-block segments are recalled can be recorded.
[0106] Specifically, the method 200 also includes: recording the obtained sub-block, and the sub-block points to the corresponding write result; when a read request is received, and the read data corresponding to the read data information carried by the read request exists in the recorded sub-block, the corresponding read data is obtained from the corresponding sub-block for return; or when a write request is received, and the written data corresponding to the write data information carried by the write request exists in the recorded sub-block, data is written according to the data to be written and the corresponding sub-block, and the write result is stored in the corresponding file of the first storage medium based on the sub-block.
[0107] For example, Figure 6As shown, according to the foregoing, the cloud server records the recalled sub-block segment, which can be recorded in the bitmap 603, and this bitmap 603 can be set in the corresponding metadata information. So that in the subsequent reading and writing process, after finding the corresponding metadata information, it can be determined whether the data has been recalled based on whether there is bitmap 603 and whether there is a corresponding sub-block in bitmap 603. It should be understood that the sub-block here corresponds to the above-mentioned writing result, but its storage location in the file is the same as the storage location of the recalled data. Therefore, the sub-block can record its storage location and writing result. The subsequent reading and writing process can be implemented based on the storage location or the writing result. Thereby improving the efficiency of subsequent data processing and access.
[0108] In addition, the method 200 further includes: if the access data is unmigrated data, obtaining the access data from the first storage medium based on the information and performing access processing.
[0109] Since this has been explained in the previous article, I will not repeat it here.
[0110] In addition, the specific implementation of the above data migration process is as follows:
[0111] Specifically, the method 200 also includes: scanning the data stored in the first storage medium; when there is data to be migrated that meets the preset migration conditions in the data, migrating the data to be migrated to the second storage medium; when there is data to be retained that does not meet the preset migration conditions in the data, retaining the data to be retained in the first storage medium.
[0112] Among them, scanning the data stored in the first storage medium includes: scanning the files stored in the first storage medium; when the data in the files meet the preset migration conditions of the data to be migrated, performing the step of migrating the data to be migrated to the second storage medium in the form of files.
[0113] For example, according to the above, the cloud server scans the first storage medium of the NAS (Network Attached Storage) storage system, such as all files in the first hard disk, and if the data in the file meets the preset migration conditions for the data to be migrated (such as data that has not been accessed within 14 days), or the file meets the preset migration conditions for the file (such as a file that has not been accessed within 14 days), the data migration step is performed. Alternatively, the file to be migrated is migrated to the second storage medium.
[0114] In addition, the scan can be triggered by time, such as timing triggering, which can be triggered by a user-defined time. The timing trigger can also be user-defined timing, or it can be automatically set by the cloud server, such as scanning once every 2 hours. For user-defined timing, the user can set the timing through the computer web page and send the timing time to the cloud server. After the cloud server obtains it, it can trigger the scan according to the timing time.
[0115] It should also be noted that the first scan can be triggered based on the migration conditions. For example, after the user provides the migration conditions to the cloud server, the cloud server starts scanning within a preset time after receiving the migration conditions, such as 2 hours or immediately after receiving the migration conditions. The preset time can be provided by the user or determined by the cloud server itself.
[0116] Specifically, the method 200 further includes: acquiring migration conditions provided by a user as preset migration conditions; determining corresponding migration tasks according to the preset migration conditions; executing the migration tasks, and scanning the data stored in the first storage medium based on the migration tasks.
[0117] The migration condition (also called life cycle management policy) is used to manage the user's data life cycle, which can be expressed as data that has not been accessed within a preset time, such as data or files that have not been accessed within 14 days.
[0118] Among them, the way in which the user provides the migration conditions may include providing them through an interface API (Application Programming Interface) or console configuration. For example, the user can send the migration conditions through the provided Open API interface, which can send the migration conditions to the cloud server. For the console configuration, the user can pull the console configuration page of the cloud server through the web page of the computer, and then configure the migration conditions on the page, and send a configuration request or configuration information to the cloud server through the page. The cloud server receives the configuration request or configuration information, and then can obtain the migration conditions.
[0119] For example, according to the above, if Figure 3 As shown, after user 301 sends the lifecycle management policy to the cloud server through the interface API or console configuration, the cloud server generates a corresponding migration task based on the policy. After the task is generated, the task can be executed according to the trigger time (i.e., the trigger time of the above scan). The data in the first storage medium 302 is scanned according to the lifecycle management policy.
[0120] The cloud server scans the data to be migrated or the corresponding files according to the lifecycle management policy. The data or files that meet the lifecycle management policy are migrated to the second storage medium of the cloud server as the corresponding data to be migrated or files to be migrated. Figure 3 As shown, the cloud server can use the data to be migrated that complies with the lifecycle management policy as cold data 304, and the data that does not comply with the lifecycle management policy as hot data 303. It should be understood that the division of the cold and hot data is based on the lifecycle management policy, that is, based on the user's access frequency. The cloud server migrates the cold data 304 to the second storage medium 305.
[0121] It should be noted that the second storage medium can be deployed on other server devices, based on which the data to be migrated or the files to be migrated can be migrated to the second storage medium on other servers. Figure 3 As shown, the data stored in the first storage medium may be data from the container orchestration engine K8S (kubernetes) 309, the remote dictionary service redis 308, the artificial intelligence AI (Artificial Intelligence) 307, and the website 306. The cloud server may support the data storage of the user's container orchestration engine K8S (kubernetes) 309, the remote dictionary service redis 308, the artificial intelligence AI (Artificial Intelligence) 307, and the website 306.
[0122] It should also be noted that the data migration process can be performed according to the migration conditions provided by the user, and the migration conditions can determine which storage area in the user's first storage medium is scanned for data, such as the A directory disk in the first hard disk. Then the cloud server can only migrate data for the A directory disk, and the user's other disks may not be migrated.
[0123] When users enable the data lifecycle management policy function, the price of the same storage volume is significantly reduced compared to storage that does not currently have lifecycle management policies enabled (that is, storage that has not undergone data migration).
[0124] After data migration, in order to facilitate the user's subsequent reading and writing of data, the migrated data can be marked or described so that in the subsequent reading and writing process, it can be determined whether it belongs to the migrated data, and thus determine which storage medium to perform the reading and writing operation from.
[0125] Specifically, after migrating the data to be migrated to the second storage medium, the data to be migrated is used as migrated data in the second storage medium. The method 200 also includes: recording the storage location of the migrated data in the second storage medium, and the storage location has a corresponding relationship with the information of accessing the data, so that the storage location is determined based on the information.
[0126] Among them, the recording method can be recorded in the metadata information of the migrated data. Metadata information is used to describe data. Since the embodiment of the present application can also scan and migrate data in units of files, metadata information can also be used to describe files. The metadata information is associated with the corresponding data identifier (which can be a file identifier, where the file identifier can be a write file identifier and a read file identifier according to the different access requests) or file identifier, such as file name association. According to the foregoing, it can be known that the file identifier can be carried by the information of the access data in the access request. Therefore, the metadata information can be determined by the corresponding identifier. In addition to including the storage location of the migrated data or the migrated file (the location can clearly indicate the second storage medium), the metadata information can also include the iNode (index node) number of the file, the user identifier, the data permissions and the access time, etc. Among them, the iNode (index node) number of the file can be associated with the file identifier or the data identifier, and have a corresponding relationship, so that the metadata information is associated with the corresponding data identifier (which can be the file identifier) or the file identifier.
[0127] When reading and writing are performed subsequently, the corresponding metadata information can be determined according to the file identifier (i.e., the corresponding read file identifier, the corresponding write file identifier) or data identifier carried in the read and write request, and whether it is migrated data or migrated files can be determined according to the storage location. It should be understood that for non-migrated data or non-migrated files, i.e., hot data, the corresponding metadata information will also record its storage location in the first storage medium.
[0128] However, in order to more directly determine whether it is migrated data or migrated files, information indicating whether it is migrated data or migrated files can be directly recorded, such as cold data or hot data. However, it should be understood that whether it is cold data or hot data, or information, it can be represented by specific symbols or data. For example, cold data, that is, migrated data or migrated files, can be "1". Hot data, that is, non-migrated data or non-migrated files, can be "0", etc. The above information can also be recorded in the metadata information, and the storage location of the migrated data or migrated files can also be recorded. Therefore, according to the foregoing, the subsequent reading and writing process can be carried out.
[0129] Specifically, after migrating the data to be migrated to the second storage medium, the data to be migrated is used as migrated data in the second storage medium. The method 200 also includes: recording information indicating that the migrated data is stored in the second storage medium, and the information represented has a corresponding relationship with the information of the access data, so as to determine whether the access data is migrated data based on the information.
[0130] Since it has been explained in the previous text, it will not be repeated here. It is only explained that the above information can be stored through the above metadata information, or can be directly recorded, recorded through other recording forms, and associated with the corresponding data or files, that is, the subsequent reading and writing process can be realized.
[0131] Based on this, on the basis of effectively reducing storage costs for users, after users configure lifecycle management policies and some data has been automatically migrated to low-frequency storage (i.e., second storage medium storage) to become cold data, there is no difference in the way they access cold and hot data. They only need to continue to access based on standard preset interfaces, and there is no need to add any additional operation and maintenance operations, achieving the goal of zero transformation of user services and saving a lot of transformation and operation and maintenance costs. It caters to users' needs for cost reduction and efficiency improvement in scenarios such as audit archiving, database backup, and disaster recovery backup.
[0132] As mentioned above, if the user no longer accesses the above write results within a period of time in the future, they will be migrated back to the NAS low-frequency storage by the configured lifecycle management policy.
[0133] Specifically, the method 200 further includes: scanning a corresponding file stored in the first storage medium; when the data in the file meets the preset migration conditions of the data to be migrated, performing a step of migrating the data to be migrated to the second storage medium in the form of a file.
[0134] For example, according to the above, the cloud server can continue to trigger the task of the lifecycle management policy regularly, and scan the corresponding data according to the task. If the file where the above-mentioned writing result is located or the writing result directly complies with the lifecycle management policy, the writing result can be migrated to the second storage medium in units of files. The writing result can also be directly migrated to the second storage medium. Otherwise, it will remain in the first storage medium.
[0135] Based on the above similar inventive concept, Figure 7 A flow chart of a method for reading data provided by another exemplary embodiment of the present application is shown. The method 700 provided by the embodiment of the present application is executed by a cloud server, and the method 700 includes the following steps:
[0136] 701: Receive a read request, where the read request carries read data information.
[0137] 702: Determine whether the read data is migrated data according to the read data information.
[0138] The migrated data is migrated from the first storage medium to the second storage medium, and the time for reading the data corresponding to the first storage medium is shorter than the time for reading the data corresponding to the second storage medium.
[0139] 703: If the read data is migrated data, determine the storage location of the read data in the second storage medium based on the read data information, obtain the read data, and return it.
[0140] Since the specific implementation of steps 701-703 has been described in detail above, they will not be repeated here.
[0141] In addition, for the contents not described in detail in the method 700, reference may also be made to the various steps in the above method 200.
[0142] Based on the above similar inventive concept, Figure 8 A schematic diagram of a data writing method provided by another exemplary embodiment of the present application is shown. The method 800 provided by the embodiment of the present application is executed by a cloud server, and the method 800 includes the following steps:
[0143] 801: Receive a write request, where the write request carries write data information.
[0144] 802: Determine whether the written data is migrated data according to the written data information.
[0145] The migrated data is migrated from the first storage medium to the second storage medium, and the time for writing the data corresponding to the first storage medium is shorter than the time for writing the data corresponding to the second storage medium.
[0146] 803: If the written data is migrated data, based on the written data information, determine the storage location of the written data in the second storage medium, obtain the written data, write data according to the data to be written corresponding to the written data information and the written data, and store the writing result in the corresponding file of the first storage medium.
[0147] Since the specific implementation of steps 801-803 has been described in detail above, they will not be repeated here.
[0148] In addition, for the contents not described in detail in the method 800 , reference can also be made to the various steps in the above method 200 .
[0149] Based on the above similar inventive concept, Fig. 9A flow chart of a data migration method provided by another exemplary embodiment of the present application is shown. The method 900 provided by the embodiment of the present application is executed by a cloud server, and the method 900 includes the following steps:
[0150] 901: Scanning data stored in a first storage medium;
[0151] 902: When there is data to be migrated that meets the preset migration condition, the data to be migrated is migrated to the second storage medium.
[0152] The time for reading and writing data corresponding to the first storage medium is shorter than the time for reading and writing data corresponding to the second storage medium.
[0153] 903: When there is data to be retained that does not meet the preset migration condition, retain the data to be retained in the first storage medium.
[0154] Since the specific implementation of steps 901-903 has been described in detail above, they will not be repeated here.
[0155] In addition, the method 900 further includes: acquiring migration conditions provided by a user as preset migration conditions; determining corresponding migration tasks according to the preset migration conditions; executing the migration tasks, and scanning data stored in the first storage medium based on the migration tasks.
[0156] The migration condition is represented by data that has not been accessed within a preset time.
[0157] In addition, after migrating the data to be migrated to the second storage medium, the data to be migrated is used as the migrated data in the second storage medium. The method 900 also includes: recording the storage location of the migrated data in the second storage medium, and the storage location has a corresponding relationship with the information of accessing the data, so that the storage location can be determined based on the information.
[0158] In addition, after migrating the data to be migrated to the second storage medium, the data to be migrated is used as migrated data in the second storage medium. The method 900 also includes: recording information indicating that the migrated data is stored in the second storage medium, and the information represented has a corresponding relationship with the information of the access data, so as to determine whether the access data is migrated data based on the information.
[0159] Specifically, scanning the data stored in the first storage medium includes: scanning the files stored in the first storage medium; when the data in the files meet the preset migration conditions of the data to be migrated, performing the step of migrating the data to be migrated to the second storage medium in the form of files.
[0160] In addition, for the contents not described in detail in the method 900, reference may also be made to the various steps in the above method 200.
[0161] Fig.10 A schematic diagram of a structural framework of a data access device provided for an exemplary embodiment of the present application. The device 1000 can be applied to a cloud server. The device 1000 includes: an acquisition module 1001, a determination module 1002, and a processing module 1003; the functions of each module are described in detail below:
[0162] The acquisition module 1001 is used to acquire an access request, where the access request carries information about access data.
[0163] The determination module 1002 is used to determine whether the access data is migrated data according to the information. The migrated data is migrated from the first storage medium to the second storage medium, and the access time of the first storage medium is less than the access time of the second storage medium.
[0164] The processing module 1003 is used to determine the storage location of the access data in the second storage medium based on the information if the access data is migrated data, obtain the access data, and perform access processing on the access data according to the access request.
[0165] In addition, the acquisition module 1001 is further used for: if the access data is unmigrated data, acquiring the access data from the first storage medium based on the information to perform access processing.
[0166] In addition, the device 1000 further includes: a scanning module for scanning data stored in the first storage medium; a migration module for migrating the data to be migrated to the second storage medium when there is data to be migrated that meets the preset migration conditions in the data; and a retention module for retaining the data to be retained in the first storage medium when there is data to be retained that does not meet the preset migration conditions in the data.
[0167] In addition, the acquisition module 1001 is also used to obtain the migration conditions provided by the user as preset migration conditions; the determination module 1002 is also used to determine the corresponding migration task based on the preset migration conditions; the device 1000 also includes: an execution module, which is used to execute the migration task and scan the data stored in the first storage medium based on the migration task.
[0168] The migration condition is represented by data that has not been accessed within a preset time.
[0169] In addition, after migrating the data to be migrated to the second storage medium, the data to be migrated serves as migrated data in the second storage medium. The device 1000 also includes: a recording module for recording the storage location of the migrated data in the second storage medium, and the storage location has a corresponding relationship with the information of accessing the data, so that the storage location can be determined based on the information.
[0170] In addition, after the data to be migrated is migrated to the second storage medium, the data to be migrated is used as the migrated data in the second storage medium, and the recording module is also used to record information indicating that the migrated data is stored in the second storage medium, and the information represented has a corresponding relationship with the information of the access data, so that based on the information, it is determined whether the access data is the migrated data.
[0171] Specifically, the scanning module includes: a scanning unit for scanning files stored in a first storage medium; an execution unit for executing the step of migrating the data to be migrated to a second storage medium in the form of a file when the data in the file meets the preset migration conditions for the data to be migrated.
[0172] In addition, the access request includes a read request, and the access data information includes read data information; the processing module 1003 is used to return the acquired access data as read data.
[0173] In addition, the read data information includes a read file identifier of the read data; a determination module 1002 is used to find information corresponding to the read file identifier indicating that the migrated data is stored in the second storage medium; a processing module 1003 is used to find the storage location of the read data corresponding to the read file identifier in the second storage medium.
[0174] In addition, the access request includes a write request, and the access data information includes write data information; the processing module 1003 is used to write data according to the data to be written and the data to be written corresponding to the write data information, and store the write result in the corresponding file of the first storage medium, and the data to be written is the access data.
[0175] In addition, the write data information includes a write file identifier of the data to be written; a determination module 1002 is used to: search for information corresponding to the write file identifier indicating that the migrated data is stored in the second storage medium; a processing module 1003 is used to search for the storage location of the written data corresponding to the write file identifier in the second storage medium.
[0176] In addition, the processing module 1003 is used to: if the written data in the write file corresponding to the write data information belongs to the migrated data, then based on the information, determine the storage location of the write file in the second storage medium, and obtain the written data in the write file from the second storage medium.
[0177] Specifically, the write data information also includes: the write position information of the data to be written in the corresponding write file; the acquisition module 1001 includes: a search unit, used to find the write file according to the storage position; an acquisition unit, used to obtain the written data in the write file according to the write position information.
[0178] Specifically, the acquisition unit is used to acquire the long block corresponding to the data to be written in the write file according to the write position information, so as to write the data with the data to be written.
[0179] In addition, when the starting write bit of the data to be written in the write position information in the write file is greater than the bit threshold, the determination module 1002 is also used to: determine the long block corresponding to the written data in the write file according to the write position information; the device 1000 also includes: a division module, which is used to determine the corresponding written data from the long block according to the write position information, and divide the long block according to the written data to obtain sub-blocks corresponding to the written data; a writing module, which is used to write data according to the data to be written and the sub-blocks, and store the writing results in the corresponding file of the first storage medium based on the sub-blocks.
[0180] In addition, the recording module is also used to: record the obtained sub-block, and the sub-block points to the corresponding write result; the acquisition module is also used to, when a read request is received, and the read data corresponding to the read data information carried by the read request exists in the recorded sub-block, obtain the corresponding read data from the corresponding sub-block for return; or, the writing module is also used to, when a write request is received, and the written data corresponding to the write data information carried by the write request exists in the recorded sub-block, write data according to the data to be written and the corresponding sub-block, and store the write result in the corresponding file of the first storage medium based on the sub-block.
[0181] In addition, the scanning module is also used to: scan the corresponding files stored in the first storage medium; the migration module is also used to, when the data in the file meets the preset migration conditions for the data to be migrated, execute the step of migrating the data to be migrated to the second storage medium in the form of a file.
[0182] Fig.11 A schematic diagram of the structure framework of a data reading device provided by another exemplary embodiment of the present application is shown. The device 1100 can be applied to a cloud server. The device 1100 includes: a receiving module 1101 and a determining module 1102. The functions of each module are described in detail below:
[0183] The receiving module 1001 is used to receive a read request, where the read request carries read data information.
[0184] The determination module 1102 is used to determine whether the read data is migrated data according to the read data information.
[0185] The migrated data is migrated from the first storage medium to the second storage medium, and the time for reading the data corresponding to the first storage medium is shorter than the time for reading the data corresponding to the second storage medium.
[0186] The determination module 1102 is used to determine the storage location of the read data in the second storage medium based on the read data information if the read data is migrated data, obtain the read data, and return it.
[0187] It should be noted that for some contents not mentioned in the apparatus 1100 , reference may be made to the contents of the above-mentioned apparatus 1000 .
[0188] Fig.12 A schematic diagram of the structural framework of a data writing device provided by another exemplary embodiment of the present application is shown. The device 1200 can be applied to a cloud server. The device 1200 includes: a receiving module 1201, a determining module 1202 and a writing module 1203. The functions of each module are described in detail below:
[0189] The receiving module 1201 is used to receive a write request, where the write request carries write data information.
[0190] The determination module 1202 is used to determine whether the written data is migrated data according to the written data information.
[0191] The migrated data is migrated from the first storage medium to the second storage medium, and the time for writing the data corresponding to the first storage medium is shorter than the time for writing the data corresponding to the second storage medium.
[0192] The writing module 1203 is used to determine the storage location of the written data in the second storage medium based on the write data information if the written data is migrated data, and obtain the written data, write data according to the data to be written and the written data corresponding to the write data information, and store the writing result in the corresponding file of the first storage medium.
[0193] It should be noted that for some contents not mentioned in the apparatus 1200 , reference may be made to the contents of the above-mentioned apparatus 1000 .
[0194] The above describes Fig.10 The internal functions and structure of the device 1000 shown, in one possible design, Fig.10 The structure of the device 1000 shown can be implemented as a computing device, such as a cloud server. Fig.13 As shown, the device 1300 may include: a memory 1301, a processor 1302, and a communication component 1303;
[0195] The memory 1301 is used to store computer programs.
[0196] The communication component 1303 is used to obtain an access request, where the access request carries information about access data.
[0197] Processor 1302 is used to execute a computer program to: determine whether the access data is migrated data based on the information, the migrated data is migrated from the first storage medium to the second storage medium, and the time of the access data corresponding to the first storage medium is less than the time of the access data corresponding to the second storage medium; if the access data is migrated data, determine the storage location of the access data in the second storage medium based on the information, obtain the access data, and perform access processing on the access data according to the access request.
[0198] In addition, the processor 1302 is further configured to: if the access data is unmigrated data, obtain the access data from the first storage medium based on the information and perform access processing.
[0199] In addition, the processor 1302 is also used to: scan the data stored in the first storage medium; when there is data to be migrated that meets the preset migration conditions in the data, migrate the data to be migrated to the second storage medium; when there is data to be retained that does not meet the preset migration conditions in the data, retain the data to be retained in the first storage medium.
[0200] In addition, the processor 1302 is further configured to: obtain a migration condition provided by a user as a preset migration condition; determine a corresponding migration task according to the preset migration condition; and execute the migration task, and scan the data stored in the first storage medium based on the migration task.
[0201] The migration condition is represented by data that has not been accessed within a preset time.
[0202] In addition, after migrating the data to be migrated to the second storage medium, the data to be migrated is used as the migrated data in the second storage medium, and the processor 1302 is also used to: record the storage location of the migrated data in the second storage medium, and the storage location has a corresponding relationship with the information of accessing the data, so that the storage location can be determined based on the information.
[0203] In addition, after migrating the data to be migrated to the second storage medium, the data to be migrated is used as migrated data in the second storage medium, and the processor 1302 is also used to: record information indicating that the migrated data is stored in the second storage medium, and the information represented has a corresponding relationship with the information of the access data, so as to determine whether the access data is migrated data based on the information.
[0204] Specifically, the processor 1302 is specifically configured to: scan a file stored in the first storage medium; and when the data in the file meets the preset migration conditions of the data to be migrated, perform the step of migrating the data to be migrated to the second storage medium in the form of a file.
[0205] In addition, the access request includes a read request, and the access data information includes read data information; the processor 1302 is specifically configured to return the acquired access data as read data.
[0206] In addition, the read data information includes a read file identifier of the read data; the processor 1302 is specifically used to: search for information corresponding to the read file identifier indicating that the migrated data is stored in the second storage medium; and search for a storage location of the read data corresponding to the read file identifier in the second storage medium.
[0207] In addition, the access request includes a write request, and the access data information includes write data information; the processor 1302 is specifically used to: write data according to the data to be written and the data to be written corresponding to the write data information, and store the write result in the corresponding file of the first storage medium, and the data to be written is the access data.
[0208] In addition, the write data information includes a write file identifier of the data to be written; the processor 1302 is specifically used to: search for information corresponding to the write file identifier indicating that the migrated data is stored in the second storage medium; and search for the storage location of the written data corresponding to the write file identifier in the second storage medium.
[0209] In addition, the processor 1302 is specifically used to: if the written data in the write file corresponding to the write data information belongs to the migrated data, then based on the information, determine the storage location of the write file in the second storage medium, and obtain the written data in the write file from the second storage medium.
[0210] Specifically, the write data information also includes: write position information of the data to be written in the corresponding write file; the processor 1302 is specifically used to: find the write file according to the storage position; and obtain the written data in the write file according to the write position information.
[0211] Specifically, the processor 1302 is specifically configured to: obtain, according to the write position information, a long block corresponding to the data to be written in the write file, so as to write the data with the data to be written.
[0212] In addition, when the starting write bit of the data to be written in the write position information in the write file is greater than the bit threshold, the processor 1302 is specifically used to: determine the long block corresponding to the written data in the write file according to the write position information; determine the corresponding written data from the long block according to the write position information, and divide the long block according to the written data to obtain sub-blocks corresponding to the written data; write data according to the data to be written and the sub-blocks, and store the writing results in the corresponding file of the first storage medium based on the sub-blocks.
[0213] In addition, the processor 1302 is specifically used to: record the obtained sub-block, and the sub-block points to the corresponding write result; when a read request is received, and the read data corresponding to the read data information carried by the read request exists in the recorded sub-block, the corresponding read data is obtained from the corresponding sub-block for return; or, when a write request is received, and the written data corresponding to the write data information carried by the write request exists in the recorded sub-block, data is written according to the data to be written and the corresponding sub-block, and the write result is stored in the corresponding file of the first storage medium based on the sub-block.
[0214] In addition, the processor 1302 is specifically configured to: scan a corresponding file stored in the first storage medium; and when the data in the file meets the preset migration conditions of the data to be migrated, perform a step of migrating the data to be migrated to the second storage medium in the form of a file.
[0215] In addition, an embodiment of the present invention provides a computer storage medium, when the computer program is executed by one or more processors, causing the one or more processors to implement Figure 2-Figure 6 The present invention provides steps of a method for accessing data in a method embodiment.
[0216] The above describes Fig.11 The internal functions and structure of the device 1100 shown, in one possible design, Fig.11 The structure of the device 1100 shown can be implemented as a computing device, such as a cloud server. Fig.14 As shown, the device 1400 may include: a memory 1401, a processor 1402, and a communication component 1403;
[0217] The memory 1401 is used to store computer programs.
[0218] The communication component 1403 is used to receive a read request, where the read request carries read data information.
[0219] Processor 1402 is used to execute the computer program to: determine whether the read data is migrated data based on the read data information, the migrated data is migrated from the first storage medium to the second storage medium, and the time of reading the data corresponding to the first storage medium is less than the time of reading the data corresponding to the second storage medium; if the read data is migrated data, determine the storage location of the read data in the second storage medium based on the read data information, obtain the read data, and return it.
[0220] It should be noted that for some contents not mentioned in the device 1400 , reference may be made to the contents of the above-mentioned device 1300 .
[0221] In addition, an embodiment of the present invention provides a computer storage medium, when the computer program is executed by one or more processors, causing the one or more processors to implement Figure 7 The present invention provides steps of a method for reading data in a method embodiment.
[0222] The above describes Fig.12 The internal functions and structure of the device 1200 shown, in one possible design, Fig.12 The structure of the device 1200 shown can be implemented as a computing device, such as a cloud server. Fig.15 As shown, the device 1500 may include: a memory 1501, a processor 1502, and a communication component 1503;
[0223] The memory 1501 is used to store computer programs.
[0224] The communication component 1503 is used to receive a write request, which carries write data information.
[0225] Processor 1502 is used to execute the computer program to: determine whether the written data is migrated data based on the write data information, the migrated data is migrated from the first storage medium to the second storage medium, and the time for reading the data corresponding to the first storage medium is less than the time for reading the data corresponding to the second storage medium; if the written data is migrated data, determine the storage location of the written data in the second storage medium based on the write data information, obtain the written data, write data according to the data to be written corresponding to the write data information and the written data, and store the write result in the corresponding file of the first storage medium.
[0226] It should be noted that for some contents not mentioned in the device 1500 , reference may be made to the contents of the above-mentioned device 1300 .
[0227] In addition, an embodiment of the present invention provides a computer storage medium, when the computer program is executed by one or more processors, causing the one or more processors to implement Figure 8 The steps of a method for writing data in a method embodiment.
[0228] Another exemplary embodiment of the present application provides a data migration device. The device 1600 can be applied to a cloud server. The device 1600 includes: a scanning module 1601, a determination module 1602 and a processing module 1603. The functions of each module are described in detail below:
[0229] The scanning module 1601 is used to scan the data stored in the first storage medium.
[0230] The determination module 1602 is configured to migrate the data to be migrated to the second storage medium when there is data to be migrated that meets the preset migration condition.
[0231] The time for reading and writing data corresponding to the first storage medium is shorter than the time for reading and writing data corresponding to the second storage medium.
[0232] The processing module 1603 is configured to retain the data to be retained in the first storage medium when there is data to be retained that does not meet the preset migration condition.
[0233] In addition, the method 1600 also includes: an acquisition module, used to acquire the migration conditions provided by the user as preset migration conditions; a determination module, used to determine the corresponding migration tasks according to the preset migration conditions; and an execution module, used to execute the migration task and scan the data stored in the first storage medium based on the migration task.
[0234] The migration condition is represented by data that has not been accessed within a preset time.
[0235] In addition, after migrating the data to be migrated to the second storage medium, the data to be migrated serves as migrated data in the second storage medium. The device 1600 also includes: a recording module for recording the storage location of the migrated data in the second storage medium, and the storage location has a corresponding relationship with the information of accessing the data so that the storage location can be determined based on the information.
[0236] In addition, after the data to be migrated is migrated to the second storage medium, the data to be migrated is used as the migrated data in the second storage medium, and the recording module is also used to: record information indicating that the migrated data is stored in the second storage medium, and the information represented has a corresponding relationship with the information of the access data, so as to determine whether the access data is the migrated data based on the information.
[0237] Specifically, the scanning module 1601 includes: a scanning unit for scanning files stored in the first storage medium; an execution unit for executing the step of migrating the data to be migrated to the second storage medium in the form of a file when the data in the file meets the preset migration conditions for the data to be migrated.
[0238] It should be noted that for some contents not mentioned in the apparatus 1600 , reference may be made to the contents of the above-mentioned apparatus 1000 .
[0239] The internal functions and structure of the device 1600 are described above. In a possible design, the structure of the device 1600 can be implemented as a computing device, such as a cloud server. The device 1700 may include: a memory 1701, a processor 1702;
[0240] The memory 1701 is used to store computer programs.
[0241] Processor 1702 is used to scan the data stored in the first storage medium; when there is data to be migrated that meets the preset migration conditions in the data, the data to be migrated is migrated to the second storage medium, and the time of reading and writing data corresponding to the first storage medium is less than the time of reading and writing data corresponding to the second storage medium; when there is data to be retained that does not meet the preset migration conditions in the data, the data to be retained is retained in the first storage medium.
[0242] In addition, the processor 1702 is further configured to: obtain a migration condition provided by a user as a preset migration condition; determine a corresponding migration task according to the preset migration condition; and execute the migration task, and scan the data stored in the first storage medium based on the migration task.
[0243] The migration condition is represented by data that has not been accessed within a preset time.
[0244] In addition, after migrating the data to be migrated to the second storage medium, the data to be migrated is used as the migrated data in the second storage medium, and the processor 1702 is also used to: record the storage location of the migrated data in the second storage medium, and the storage location has a corresponding relationship with the information of accessing the data, so that the storage location can be determined based on the information.
[0245] In addition, after migrating the data to be migrated to the second storage medium, the data to be migrated is used as migrated data in the second storage medium, and the processor 1702 is also used to: record information indicating that the migrated data is stored in the second storage medium, and the information represented has a corresponding relationship with the information of the access data, so as to determine whether the access data is migrated data based on the information.
[0246] Specifically, the processor 1702 is specifically configured to: scan a file stored in the first storage medium; and when the data in the file meets the preset migration conditions of the data to be migrated, perform the step of migrating the data to be migrated to the second storage medium in the form of a file.
[0247] It should be noted that for some contents not mentioned in the device 1700 , reference may be made to the contents of the above-mentioned device 1300 .
[0248] In addition, an embodiment of the present invention provides a computer storage medium, and when a computer program is executed by one or more processors, the one or more processors are caused to implement the steps of a data migration method in the embodiment of method 900 .
[0249] In addition, in some of the processes described in the above embodiments and the accompanying drawings, multiple operations that appear in a specific order are included, but it should be clearly understood that these operations may not be executed in the order in which they appear in this article or executed in parallel, and the sequence numbers of the operations, such as 201, 202, 203, etc., are only used to distinguish between different operations, and the sequence numbers themselves do not represent any execution order. In addition, these processes may include more or fewer operations, and these operations may be executed in sequence or in parallel. It should be noted that the descriptions of "first", "second", etc. in this article are used to distinguish different messages, devices, modules, etc., do not represent the order of precedence, and do not limit the "first" and "second" to be different types.
[0250] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0251] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by adding a necessary general hardware platform, and of course can also be implemented by combining hardware and software. Based on such an understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a computer product, and the present invention can be in the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0252] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable multimedia data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable multimedia data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0253] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable multimedia data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0254] These computer program instructions may also be loaded onto a computer or other programmable multimedia data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0255] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0256] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0257] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules 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 disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0258] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for accessing data, characterized in that: A data access system, the access system comprising a first device and a second device, the second device being capable of migrating a file stored in a first storage medium and meeting a preset migration condition to a second storage medium, and correspondingly updating metadata information of the file stored in the first storage medium, so that information included in the metadata information and used to indicate whether the file is a migrated file is updated from indicating that the file is not a migrated file to indicating that the file is a migrated file, and the storage location of the metadata information record is updated from the storage location of the file in the first storage medium to the storage location of the file in the second storage medium, and the access time of the data corresponding to the first storage medium is less than the access time of the data corresponding to the second storage medium; The method is performed by the second device, including: Acquire an access request sent by the first device, where the access request carries information about accessing data, and the information includes a file identifier; Reading metadata information of the file identified by the file identifier from the first storage medium, and determining whether the file is a migrated file according to the metadata information; If the file is a migrated file, determining the storage location of the access data in the second storage medium based on the metadata information, acquiring the access data, and performing access processing on the access data according to the access request; If the file is a non-migrated file, the storage location of the access data in the first storage medium is determined based on the metadata information, the access data is acquired, and access processing is performed on the access data according to the access request.
2. The method according to claim 1, characterized in that: The method further comprises: Scanning files stored in a first storage medium; When the file meets the preset migration condition, the file is migrated to the second storage medium, and metadata information of the file stored in the first storage medium is updated accordingly; When the file does not meet the preset migration condition, the file is retained in the first storage medium.
3. The method according to claim 2, characterized in that The method further comprises: Acquiring a migration condition provided by a user as the preset migration condition; Determine a corresponding migration task according to the preset migration condition; The migration task is executed, and files stored in the first storage medium are scanned based on the migration task.
4. The method according to claim 2, characterized in that: The migration condition is represented by a file that has not been accessed within a preset time.
5. The method according to claim 1, characterized in that The access request includes a read request, and the access data information includes read data information; Access processing is performed on the access data according to the access request, including: returning the acquired access data as read data.
6. The method according to claim 1, characterized in that The access request includes a write request, and the access data information includes write data information; Performing access processing on the access data according to the access request includes: Data is written according to the data to be written and the data to be written corresponding to the write data information, and the writing result is stored in the corresponding file of the first storage medium, and the data to be written is the access data.
7. The method according to claim 6, characterized in that If the file corresponding to the access data is a migrated file, determining the storage location of the access data in the second storage medium based on the metadata information, and acquiring the migrated file, includes: If the written file corresponding to the written data information is a migrated file, the storage location of the written file in the second storage medium is determined based on the metadata information, and the written data in the written file is obtained from the second storage medium.
8. The method according to claim 7, characterized in that The written data information also includes: writing position information of the data to be written in the corresponding writing file; The obtaining of the access data comprises: According to the storage location, find the write file; According to the write position information, the written data in the write file is obtained.
9. The method according to claim 8, characterized in that The step of obtaining the written data in the write file according to the write position information includes: According to the write position information, a long block corresponding to the data to be written in the write file is obtained so as to write data with the data to be written.
10. The method according to claim 9, characterized in that When the starting write position of the data to be written in the write file in the write position information is greater than the bit threshold, the method further includes: Determining, according to the write position information, a long block corresponding to the written data in the write file; Determining corresponding written data from the long block according to the write position information, and dividing the long block according to the written data to obtain sub-blocks corresponding to the written data; Data is written according to the data to be written and the sub-blocks, and the writing result is stored in a corresponding file of the first storage medium based on the sub-blocks.
11. The method according to claim 10, characterized in that The method further comprises: Recording the obtained sub-block, and the sub-block points to the corresponding writing result; When a read request is received, and the read data corresponding to the read data information carried in the read request exists in the recorded sub-block, the corresponding read data is obtained from the corresponding sub-block for return; or When a write request is received, and the data to be written corresponding to the write data information carried by the write request exists in the recorded sub-block, data is written according to the data to be written and the corresponding sub-block, and the write result is stored in the corresponding file of the first storage medium based on the sub-block.
12. A method for reading data, characterized in that: A data access system, the access system comprising a first device and a second device, the second device being capable of migrating a file stored in a first storage medium and meeting a preset migration condition to a second storage medium, and correspondingly updating metadata information of the file stored in the first storage medium, so that information included in the metadata information and used to indicate whether the file is a migrated file is updated from indicating that the file is not a migrated file to indicating that the file is a migrated file, and the storage location of the metadata information record is updated from the storage location of the file in the first storage medium to the storage location of the file in the second storage medium, and the access time of the data corresponding to the first storage medium is less than the access time of the data corresponding to the second storage medium; The method is performed by the second device, including: receiving a read request sent by the first device, wherein the read request carries read data information, and the read data information includes a file identifier; Reading metadata information of the file identified by the file identifier from the first storage medium, the metadata information including information of whether the file is a migrated file, and determining whether the file is a migrated file according to the metadata information; If the file is a migrated file, then based on the metadata information, determine the storage location of the read data in the second storage medium, obtain the read data, and return it; If the file is a non-migrated file, the storage location of the read data in the first storage medium is determined based on the metadata information, the read data is acquired, and returned.
13. A method for writing data, characterized in that: A data access system, the access system comprising a first device and a second device, the second device being capable of migrating a file stored in a first storage medium and meeting a preset migration condition to a second storage medium, and correspondingly updating metadata information of the file stored in the first storage medium, so that information included in the metadata information and used to indicate whether the file is a migrated file is updated from indicating that the file is not a migrated file to indicating that the file is a migrated file, and the storage location of the metadata information record is updated from the storage location of the file in the first storage medium to the storage location of the file in the second storage medium, and the access time of the data corresponding to the first storage medium is less than the access time of the data corresponding to the second storage medium; The method is performed by the second device, including: receiving a write request sent by the first device, wherein the write request carries write data information, and the write data information includes a file identifier; Reading metadata information of the file identified by the file identifier from the first storage medium, the metadata information including information of whether the file is a migrated file, and determining whether the file is a migrated file according to the metadata information; If the file is a migrated file, the storage location of the written data in the second storage medium is determined based on the metadata information, the written data is obtained, data is written according to the data to be written corresponding to the written data information and the written data, and the writing result is stored in the corresponding file of the first storage medium; If the file is a non-migrated file, based on the metadata information, the storage location of the written data in the first storage medium is determined, and the written data is obtained, data is written according to the data to be written corresponding to the write data information and the written data, and the writing result is stored in the corresponding file of the first storage medium.
14. A data migration method, characterized in that: include: Scanning files stored in a first storage medium; When the file meets the preset migration condition, the file is migrated to the second storage medium, and the metadata information of the file stored in the first storage medium is correspondingly updated, so that the information included in the metadata information and used to indicate whether the file is a migrated file is updated from indicating that the file is not a migrated file to indicating that the file is a migrated file, and the storage location recorded in the metadata information is updated from the storage location of the file in the first storage medium to the storage location of the file in the second storage medium; The time for reading and writing data corresponding to the first storage medium is shorter than the time for reading and writing data corresponding to the second storage medium; When the file does not meet the preset migration condition, the file is retained in the first storage medium.
15. The method according to claim 14, characterized in that The method further comprises: Acquiring a migration condition provided by a user as the preset migration condition; Determine a corresponding migration task according to the preset migration condition; The migration task is executed, and data stored in the first storage medium is scanned based on the migration task.
16. The method according to claim 15, characterized in that The migration condition is represented by a file that has not been accessed within a preset time.
17. A computing device comprising: Memory, processor; The memory is used to store computer programs; The processor is used to scan the file stored in the first storage medium; When the file meets the preset migration condition, the file is migrated to the second storage medium, and the metadata information of the file stored in the first storage medium is correspondingly updated, so that the information included in the metadata information and used to indicate whether the file is a migrated file is updated from indicating that the file is not a migrated file to indicating that the file is a migrated file, and the storage location recorded in the metadata information is updated from the storage location of the file in the first storage medium to the storage location of the file in the second storage medium; The time for reading and writing data corresponding to the first storage medium is shorter than the time for reading and writing data corresponding to the second storage medium; When the file does not meet the preset migration condition, the file is retained in the first storage medium.
18. A computing device, applied to a data access system, the access system comprising a first device and a second device, the second device being capable of migrating a file stored in a first storage medium that meets a preset migration condition to a second storage medium, and correspondingly updating metadata information of the file stored in the first storage medium, so as to update information included in the metadata information for indicating whether the file is a migrated file from indicating that the file is not a migrated file to indicating that the file is a migrated file, and updating the storage location of the metadata information record from the storage location of the file in the first storage medium to the storage location of the file in the second storage medium, wherein the access time of the data corresponding to the first storage medium is less than the access time of the data corresponding to the second storage medium; The computing device is specifically the second device, including: a memory, a processor, and a communication component; The memory is used to store computer programs; The communication component is used to receive a read request, wherein the read request carries read data information, and the read data information includes a file identifier; The processor is configured to execute the computer program to: Reading metadata information of the file identified by the file identifier from the first storage medium, the metadata information including information of whether the file is a migrated file, and determining whether the file is a migrated file according to the metadata information; If the file is a migrated file, then based on the metadata information, determine the storage location of the read data in the second storage medium, obtain the read data, and return it; If the file is a non-migrated file, the storage location of the read data in the first storage medium is determined based on the metadata information, the read data is acquired, and returned.
19. A computing device, applied to a data access system, the access system comprising a first device and a second device, the second device being capable of migrating a file stored in a first storage medium that meets a preset migration condition to a second storage medium, and correspondingly updating metadata information of the file stored in the first storage medium, so as to update information included in the metadata information for indicating whether the file is a migrated file from indicating that the file is not a migrated file to indicating that the file is a migrated file, and updating a storage location recorded in the metadata information from a storage location of the file in the first storage medium to a storage location of the file in the second storage medium, wherein a time for accessing the data corresponding to the first storage medium is less than a time for accessing the data corresponding to the second storage medium; The computing device is specifically the second device, including: a memory, a processor, and a communication component; The memory is used to store computer programs; The communication component is used to receive a write request, the write request carries write data information, and the write data information includes a file identifier; The processor is configured to execute the computer program to: Reading metadata information of the file identified by the file identifier from the first storage medium, the metadata information including information of whether the file is a migrated file, and determining whether the file is a migrated file according to the metadata information; If the file is a migrated file, determining the storage location of the written data corresponding to the written data information in the second storage medium based on the metadata information, obtaining the written data, writing data according to the data to be written corresponding to the written data information and the written data, and storing the writing result in the corresponding file of the first storage medium; If the file is a non-migrated file, based on the metadata information, the storage location of the written data in the first storage medium is determined, and the written data is obtained, data is written according to the data to be written corresponding to the write data information and the written data, and the writing result is stored in the corresponding file of the first storage medium.
20. A computing device, applied to a data access system, the access system comprising a first device and a second device, the second device being capable of migrating a file stored in a first storage medium that meets a preset migration condition to a second storage medium, and correspondingly updating metadata information of the file stored in the first storage medium, so as to update information included in the metadata information for indicating whether the file is a migrated file from indicating that the file is not a migrated file to indicating that the file is a migrated file, and updating a storage location recorded in the metadata information from a storage location of the file in the first storage medium to a storage location of the file in the second storage medium, wherein a time for accessing data corresponding to the first storage medium is less than a time for accessing data corresponding to the second storage medium; The computing device is specifically the second device, including: a memory, a processor, and a communication component; The memory is used to store computer programs; The communication component is used to obtain an access request, the access request carries information about access data, and the information includes a file identifier; The processor is configured to execute the computer program to: Reading metadata information of the file identified by the file identifier from the first storage medium, the metadata information including information of whether the file is a migrated file, and determining whether the file is a migrated file according to the metadata information; If the file is a migrated file, determining the storage location of the access data in the second storage medium based on the metadata information, acquiring the access data, and performing access processing on the access data according to the access request; If the file is a non-migrated file, the access data is obtained from the first storage medium based on the metadata information to perform access processing.
21. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by one or more processors, the one or more processors are caused to implement the steps of the method according to any one of claims 1 to 16.
Citation Information
Patent Citations
Hierarchical storage realization method and system
CN102521419A
Method, device and storage equipment for hierarchically storing data
CN103558991A
Level-to-level data management method and device and electronic equipment
CN105183389A
Hybrid cloud storage data migration method and system
CN107172168A
File hierarchical storage-oriented data migration system and method
CN111427844A
