Thin provisioning method and system for memory disk, and device and computer-readable storage medium

By matching block operation requests and block recycling requests, memory page information is released, which solves the problem that memory pages cannot be released after traditional memory disk data is deleted, and improves memory usage.

WO2024174878A1PCT designated stage expired Publication Date: 2024-08-29ZTE CORP
View PDF 9 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/076148
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-02-24
Filing Date
2024-02-05
Publication Date
2024-08-29

AI Technical Summary

Technical Problem

Traditional memory disks lack the thin provisioning function when data is deleted, resulting in memory pages that cannot be released, resulting in low memory usage.

Method used

By receiving block operation requests and matching them with preset block recycling requests, the release memory page information is determined and the target memory page is released, thereby improving the memory usage of the memory disk.

Benefits of technology

It realizes the release of memory pages after the memory disk data is deleted, improves the memory usage and avoids the problem of excessive memory usage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024076148_29082024_PF_FP_ABST
    Figure CN2024076148_29082024_PF_FP_ABST
Patent Text Reader

Abstract

A thin provisioning method and system for a memory disk, and a device and a computer-readable storage medium. The thin provisioning method for a memory disk comprises: receiving a block operation request, and after the block operation request matches a preset block recycling request, determining released memory page information corresponding to the block operation request (S10); and determining, on the basis of the released memory page information, a target memory page to be released, and releasing the target memory page (S20). In this way, the memory utilization rate of memory disks is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Thin provisioning method, system, device and computer-readable storage medium for memory disk

[0001] Related applications

[0002] This application claims priority to Chinese patent application No. 202310160275.0 filed on February 24, 2023, the entire contents of which are incorporated by reference into this application. Technical Field

[0003] The present application relates to the field of operating system storage technology, and in particular to a thin provisioning method, system, device, and computer-readable storage medium for a memory disk. Background Art

[0004] In the operating system, data needs to be written and deleted on the memory disk in the system. Therefore, while ensuring the normal writing and deletion of data, it also puts higher requirements on the storage technology of the memory disk.

[0005] The traditional memory disk storage method is that when data is written to the memory disk, the memory occupied by the memory disk will continue to increase. However, when data is deleted from the memory disk, the memory pages corresponding to the deleted data will not be released because the memory disk does not have a thin provisioning function. In other words, this memory disk storage method will result in low memory utilization because the memory pages corresponding to the deleted data will not be released.

[0006] Summary of the Invention

[0007] The main purpose of this application is to provide a thin provisioning method, system, device and computer-readable storage medium for a memory disk, aiming to solve the technical problem of how to improve the memory utilization rate of the memory disk.

[0008] The present application provides a thin provisioning method for a memory disk, comprising:

[0009] receiving a block operation request, and after the block operation request matches a preset block reclaim request, determining released memory page information corresponding to the block operation request;

[0010] A target memory page to be released is determined based on the released memory page information, and the target memory page is released.

[0011] In addition, to achieve the above objectives, the present application also provides a thin provisioning system for a memory disk, comprising:

[0012] a request determination module configured to receive a block operation request, and after the block operation request matches a preset block reclaim request, determine released memory page information corresponding to the block operation request;

[0013] The memory release module is configured to determine a target memory page to be released based on the released memory page information and release the target memory page.

[0014] In addition, to achieve the above-mentioned purpose, the present application also provides a thin provisioning device for a memory disk, comprising: a processor; and a memory arranged to store computer-executable instructions, wherein when the executable instructions are executed, the processor executes the steps of the thin provisioning method for the memory disk as described above.

[0015] In addition, to achieve the above-mentioned purpose, the present application also provides a computer-readable storage medium, which stores one or more programs. When the one or more programs are executed by an electronic device including multiple applications, the electronic device performs the steps of the thin provisioning method of the memory disk as described above. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] FIG1 is a flow chart of a first embodiment of a thin provisioning method for a memory disk according to the present invention;

[0017] FIG2 is a schematic diagram of the structure of the memory disk block device driver in the operating system of the present application;

[0018] FIG3 is a schematic diagram of a processing flow of reclaiming a memory page request in the thin provisioning method of the memory disk of the present application;

[0019] FIG4 is a schematic diagram of the thin provisioning process in the thin provisioning method of the memory disk of the present application;

[0020] FIG5 is a schematic diagram of a thin provisioning system for a memory disk according to the present application;

[0021] FIG6 is a flow chart of memory operation in the thin provisioning method of the memory disk of the present application.

[0022] The purpose, features and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0023] It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application.

[0024] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments of this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0025] It should be noted that all directional indications in the embodiments of the present application (such as up, down, left, right, front, back, etc.) are only used to explain the relative position relationship, movement status, etc. between the various components under a certain specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indication will also change accordingly.

[0026] In this application, unless otherwise specified or limited, the terms "connection" and "fixation" should be understood in a broad sense. For example, "fixation" can mean fixed connection, detachable connection, or integration; mechanical connection or electrical connection; direct connection or indirect connection through an intermediate medium; internal communication between two elements or interaction between two elements, unless otherwise specified. For those skilled in the art, the specific meanings of the above terms in this application can be understood according to specific circumstances.

[0027] In addition, the descriptions of "first" and "second" in this application are for descriptive purposes only and should not be understood as indicating or implying their relative importance or implicitly indicating the number of the technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of such features. In addition, the technical solutions between the various embodiments can be combined with each other, but this must be based on the fact that they can be implemented by ordinary technicians in this field. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such combination of technical solutions does not exist and is not within the scope of protection required by this application.

[0028] The embodiments of the present application primarily relate to thin provisioning of ramdisks, specifically to improving the utilization of internal storage resources through thin provisioning of ramdisks. A ramdisk is a memory-based storage device created through software virtualization. Compared to traditional disk devices, a ramdisk offers faster storage speeds and can effectively improve data access speeds. Conventional techniques for storing data on ramdisks are as follows: when data is written to the ramdisk, the memory occupied by the ramdisk continuously increases due to the data being written. However, when data is deleted from the ramdisk, the memory occupied by the ramdisk does not decrease, as only the data in the ramdisk is deleted, not the corresponding memory pages storing the data. Consequently, the number of memory pages in the entire ramdisk continuously increases. The memory pages in the ramdisk may be data pages or empty memory pages for storing data. Because the ramdisk lacks thin provisioning, after data is deleted from the ramdisk, the corresponding memory pages are not released and remain occupied by the ramdisk, unable to be reclaimed and reallocated by the host, impacting the memory utilization of the host system.

[0029] Therefore, to solve the problem of memory page usage in the memory disk, after receiving a block operation request, the block operation request is detected to see if it matches the preset block recovery request. When the block operation request matches the preset block recovery request, the released memory page information corresponding to the block operation request is determined. Then, based on the released memory page information, the target memory page to be released is determined and the target memory page is released. In other words, when data needs to be deleted from the memory disk, the kernel driver layer corresponding to the memory disk receives the recovery request and releases the corresponding memory page. The memory occupied by the memory disk is then reduced, and the host memory utilization rate is improved by releasing the memory page of the deleted data in the memory disk.

[0030] The embodiments of the present application are further described below with reference to the accompanying drawings.

[0031] This application proposes a thin provisioning method for a memory disk. In a first embodiment of the thin provisioning method for a memory disk of this application, referring to FIG1 , the thin provisioning method for a memory disk includes:

[0032] Step S10: receiving a block operation request, and after the block operation request matches a preset block reclaim request, determining released memory page information corresponding to the block operation request;

[0033] Exemplarily, the thin provisioning of the memory disk in the embodiment of the present application can be applied to products of the Linux operating system or the Windows operating system, as shown in FIG2 , FIG2 is a structural diagram of the memory disk block device driver in the operating system, the controller of this embodiment is the memory disk block device driver, FIG2 takes the Linux operating system as an example, and there are two ways to enter the memory disk block device driver, one is directly through the VFS (Virtual File System) directly through instructions to the memory disk block device driver, and another way is to enter the disk file system through the VFS, and enter the Page / Buffer Cache through the disk file system, and then enter the Generic Block Layer through the Page / Buffer Cache, and finally enter the memory disk block device driver in the Generic Block Layer. Finally, the thin provisioning of the memory disk can be realized in the memory disk block device driver, or it can be directly controlled in the Linux operating system or the Windows operating system, thereby realizing that the memory disk in the operating system deletes idle or non-data-storing memory pages in a timely manner, thereby improving the memory utilization rate of the memory disk.

[0034] Exemplarily, after the memory disk block device driver receives a block operation request, it will detect whether the block operation request matches a preset block recovery request, that is, detect whether the block operation request is a memory page recovery request. Among them, a block operation request refers to a request for operating the memory disk, for example, reading memory disk data, deleting memory disk data, writing memory disk data, or performing an instruction operation on the memory disk. The preset block recovery request refers to an instruction to delete the memory page storing the deleted data from the memory disk after deleting the memory disk data. Block operation requests and other requests can also be judged, which is not limited in this embodiment. In this embodiment, the memory utilization rate of the memory disk is increased based on whether the memory page is deleted, and then this embodiment detects whether the block operation request matches the preset block recovery request. By determining whether the block operation request is a preset block recovery request, a basis is provided for executing the deletion of the memory page of the deleted data in the memory disk.

[0035] For example, after a block operation request matches a preset block reclaim request, the released memory page information corresponding to the block operation request is determined. Based on the released memory page information, the target memory page to be released is determined, and the target memory page is finally released to achieve thin provisioning of the memory disk. The released memory page information refers to the relevant information about the released memory page in the block operation request, which may include at least information such as the memory page starting position and memory page size. The target memory page refers to the memory page to be released.

[0036] Exemplarily, the block operation request includes a memory page reclaim request, a data read request, or a data write request. After receiving the block operation request, the following steps are performed:

[0037] Exemplarily, block operation requests include at least memory page reclaim requests, data read requests, data write requests, and other requests for operating the memory disk. A memory page reclaim request refers to a request to delete the memory page corresponding to the stored data after deleting the stored data in the memory disk. A data read request refers to a request to read a specific location or all data in the memory disk. A data write request refers to a request to write data in the memory disk. Other requests for operating the memory disk may refer to requests for program partition control, data duplication detection, or deletion of cached data on the memory disk.

[0038] Step m: if a preset reclaim instruction is triggered, determining that the block operation request is a memory page reclaim request corresponding to the reclaim instruction;

[0039] In step n, the block operation request is matched with the preset block reclaim request, including matching the memory page reclaim request with the preset block reclaim request.

[0040] Exemplarily, after receiving a block operation instruction, different triggered instructions will be collected. When the memory disk block device driver receives a trigger preset recycling instruction, it will determine that the block operation request is a memory page recycling request corresponding to the recycling instruction. The block operation request matches the preset block recycling request and at least includes a situation where the memory page recycling request matches the preset block recycling request. Whether the block operation request is a memory page recycling request can be determined based on triggering different instructions, and then whether the block operation request matches the preset block recycling request can be determined. Among them, the preset recycling instruction refers to a trigger instruction that requires deleting the stored data in the memory page. For example, when the memory disk block device driver detects that the stored data is deleted, the preset recycling instruction will be triggered. In this embodiment, the preset recycling instruction can refer to two high-level signals or other level signals, which are not limited in this embodiment and can be other different signals. In this embodiment, taking two high-level signals as an example, when the memory disk block device driver detects data deletion from the memory disk, two high-level signals will be triggered. The two internally defined high-level signals are preset recycling instructions, and the recycling memory page request corresponding to the recycling instruction will be determined as a block operation request. In other words, the recycling memory page request corresponding to the instruction when the recycling instruction is triggered is determined, and the recycling memory page request is used as a block operation request. For example, when the preset recycling instruction with two high-level signals is triggered when the storage data of memory page A and memory page B is deleted, the deletion of memory page A and memory page B will be used as a block operation request. Among them, the triggering process of triggering two high-level signals when deleting the storage data of memory page A and memory page B can be directly triggered when the deletion of storage data is detected, or it can be triggered by prompting the user when the user deletes the storage data, which is not limited in this embodiment. By triggering the preset recycling instruction and then using the recycling memory page request as a block operation request, the accuracy of the request source and the accuracy of various subsequent memory disk operations are guaranteed.

[0041] For example, if a preset read instruction is triggered, the block operation request will be determined as the read data request corresponding to the read instruction; if a preset write instruction is triggered, the block operation request will be determined as the write data request corresponding to the write instruction; or when other instructions are triggered, the request corresponding to the other instructions will be determined as the block operation instruction. The preset read instruction refers to a trigger instruction that requires reading data stored in a memory page, the preset read instruction refers to a trigger instruction that requires writing data stored in a memory page, and the other instructions refer to trigger instructions that require performing other operations on the data stored in the memory page or on the memory disk. The other operations include at least detecting duplicate data in memory page data, partitioning the memory disk, and other operations. For example, when it is detected that the preset read instruction of two low-level signals is triggered when reading the storage data of memory page A and memory page B, the reading of memory page A and memory page B will be treated as a block operation request. Conversely, when it is detected that the storage data C is written to memory page A and memory page B, a preset write instruction of a low-level signal and a high-level signal is triggered, and the storage data C will be written to memory page A and memory page B as a block operation request. A low-level signal and a high-level signal mean that a low level is displayed first and then a high level is displayed; when it is detected that other instructions of partitioning the storage data of memory page A and memory page B are triggered by a high-level signal and a low-level signal, the storage data of memory page A and memory page B will be partitioned as a block operation instruction. A high-level signal and a low-level signal mean that a high level is displayed first and then a low level is displayed. The corresponding trigger basis can be determined according to the number of different categories of instructions that need to be triggered. For example, if the number of different categories of trigger instructions is 16, a four-bit binary number can be used for trigger control, or other trigger control methods can be used. Through the above trigger control method, different block operation requests can be determined according to different trigger instructions, and thin provisioning processing can be performed on the memory disk according to the block operation requests, thereby improving the memory utilization rate of the memory disk.

[0042] Triggering preset recycling instructions, including:

[0043] Step p: If data deletion is detected in the memory disk, the preset recycling instruction is triggered.

[0044] Or, if data deletion is detected in the memory disk, a prompt instruction is triggered, and a preset recycling instruction is triggered based on the prompt instruction.

[0045] Exemplarily, there are at least two triggering methods for various preset trigger instructions. Taking the preset recycling instruction as an example, when the memory disk block device driver detects that data has been deleted from the memory disk, it will directly trigger the preset recycling instruction. Alternatively, after detecting that data has been deleted from the memory disk, it will trigger a prompt instruction and trigger the preset recycling instruction based on the prompt instruction. Among them, the prompt instruction refers to an instruction that prompts the user whether to trigger the preset recycling instruction. For example, when the user deletes data or after deleting data, a pop-up window is generated to prompt the user whether to trigger the preset recycling instruction. Alternatively, after the user deletes the data, a user can perform a custom operation to generate an instruction corresponding to the triggering of the preset recycling instruction. The user can directly trigger the preset recycling instruction after deleting the stored data, or enter a specifically defined instruction to trigger it. Therefore, if the triggering operation is similar to the triggering operation of the preset recycling instruction before triggering the preset read instruction or before triggering the preset write instruction, both can be divided into at least the above two triggering methods. It can also be triggered after the user performs the operation as above. There is no limitation on the triggering method for this. The above triggering method can provide a basis for the memory processing of the memory disk, enriching the function of the memory disk, so that the memory disk is not limited to the simple data storage and deletion functions, but links data storage and deletion with memory disk memory optimization. Then, by enriching the memory disk function, simple operations can be linked with memory disk optimized storage operations, thereby improving the memory utilization rate of the memory disk.

[0046] Step S20: determining a target memory page to be released based on the released memory page information, and releasing the target memory page.

[0047] Exemplarily, when there is a difference between a block operation request and a preset block recovery request, the operation instruction corresponding to the block operation request is determined, and different operation processing is performed on the memory disk based on the operation instruction, wherein the difference at least includes the phenomenon of mismatch between the two. The operation instruction refers to the instruction for operating the memory disk, which can be an instruction for partitioning the memory disk, detecting duplication, etc. Furthermore, through the above thin provisioning of the memory disk, when data is written to the memory disk, the memory disk block device driver allocates the corresponding memory pages on demand to save the data, and the memory occupied by the memory disk increases accordingly, and the memory disk realizes on-demand memory occupation. When data is deleted from the memory disk, the memory disk block device driver deletes the saved data of the corresponding memory page and releases the corresponding memory page, thereby reducing the memory occupied by the memory disk. The released memory page can be reallocated through the system or host, and the memory utilization rate of the entire host or system can be improved by increasing the memory utilization rate of the memory in the memory disk. Referring to Figure 3, Figure 3 is a schematic diagram of the processing flow of reclaiming a memory page request in the thin provisioning method of the memory disk. After receiving the memory page reclaiming request, that is, after detecting that the block operation request matches the preset block reclaiming request, it can be determined that the block operation request is a memory page reclaiming request. The memory page reclaiming request here can also refer to a block reclaiming request. The memory page release information is obtained by parsing the memory page reclaiming request message, and then the memory page of the memory page reclaiming request is searched in the memory disk based on the released memory page information. The memory page here refers to the memory page to be released by deleting the data stored in the page. Finally, the memory page is released to realize the thin provisioning of the memory disk, and the memory utilization rate of the memory disk is improved by releasing the memory page of the deleted data in the memory disk.

[0048] For example, as shown in FIG4 , a schematic diagram of the thin provisioning process in the thin provisioning method of a memory disk is provided. The thin provisioning of the memory disk of this embodiment is applicable to all Linux operating systems and Windows operating system products. This embodiment takes the Linux 4.18 kernel version as an example. The steps implemented in the memory disk driver layer are as follows: In the memory disk kernel driver layer, after receiving an IO request from the general block layer, the request processing function determines whether the currently received IO request is a block operation request, and then determines the memory page to be released by parsing the memory page recovery request. The request processing function can be a judgment program or a function that processes IO requests, which is not limited here. An IO request refers to a request received by an input / output port. For example, a preset block recovery request is judged through the interface bio_op(bio). The method of judging whether the currently received block operation request is a memory page recovery request can be judged through the interface bio_op(bio), where bio_op(bio) is a judgment instruction. If bio_op(bio) equals REQ_OP_DISCARD, the block operation request is a memory page reclaim request, and the memory page reclaim request parsing step is executed. Otherwise, it is a read request, a write request, or some other request. Based on the above determination, the read / write request processing flow is executed on the memory disk. The above determination method can also be used for other determination methods, such as high / low level determination, and is not limited here. By parsing the memory page reclaim request message, the starting sector location of the memory page to be released on the memory disk can be obtained by parsing bio->bi_iter.bi_sector in the memory page reclaim request message. The size of the memory page to be released can be obtained by parsing bio->bi_iter.bi_size in the memory page reclaim request message. Finally, the corresponding memory page is searched based on the above parsing results. Memory pages on the memory disk are managed using a radix tree. Using the starting sector location of the memory page on the memory disk as an index, the address of the corresponding memory page can be queried. Then, based on the memory page address and the size of the memory page to be deleted, the corresponding memory page is found and deleted from the radix tree, thereby releasing the corresponding memory page. Furthermore, by deleting the data, the memory page corresponding to the data can be released from the memory disk, so that the memory page can be reallocated again by the entire system host, thereby improving the host memory utilization rate.

[0049] In this embodiment, after receiving a block operation request and the block operation request matches a preset block recycling request, the memory disk is thinly provisioned by recycling a memory page request, and the released memory page information corresponding to the block operation request is determined, and the target memory page to be released is determined based on the released memory page information, and finally the target memory page is released to achieve memory disk thin provisioning, thereby avoiding the phenomenon that when data is deleted from the memory disk, the memory page of the memory disk corresponding to the deleted data will not be released because the memory disk does not have a thin provisioning function. By determining the released memory page information corresponding to the block operation request, and then determining the target memory page to be released based on the released memory page information, the target memory page is finally released, thereby improving the memory utilization rate of the memory disk.

[0050] Furthermore, based on the first embodiment of the thin provisioning method for a memory disk, a second embodiment of the thin provisioning method for a memory disk is proposed. In the second embodiment, step S20, determining the released memory page information corresponding to the block operation request, includes:

[0051] Step a, determining the starting sector location information in the block operation request, and determining the memory page size information in the block operation request;

[0052] Step b: determining the starting sector position information and the memory page size information as the released memory page information.

[0053] For example, when determining the memory page release information corresponding to a block operation request, the starting sector location information and memory page size information in the block operation request are determined, and the obtained starting sector location information and memory page size information are used as the memory page release information. The starting sector location information refers to the starting location information on the memory disk corresponding to the memory page to be released, where the deleted data has been deleted, and the memory page size information refers to the memory size information of the memory page to be released. Ultimately, the memory page to be released can be released based on the starting sector location information and memory page size information.

[0054] In this embodiment, by determining the starting sector position information in the block operation request and determining the memory page size information in the block operation request, and then determining the starting sector position information and the memory page size information as the memory page release information, and then using the starting sector position information and the memory page size information as the basis for releasing the memory page, the accuracy of the released memory page is guaranteed.

[0055] In one embodiment, determining a target memory page to be released based on the released memory page information includes:

[0056] Step c, performing indexing based on the starting sector position information in the released memory page information to obtain memory page address information, and determining the memory page information corresponding to the memory page address information;

[0057] Step d: searching the memory page information based on the memory page size information in the released memory page information to obtain the target memory page to be released.

[0058] For example, because the memory pages in the memory disk are managed through a radix tree, it is necessary to release the starting sector position information in the memory page information for indexing to obtain the memory page address information, and at the same time determine the memory page information corresponding to the memory page address information. Among them, the memory page address information refers to the memory page address obtained by indexing based on the starting sector position information, and the memory page information refers to the address information of each memory obtained according to the address. Then, based on the memory page size information in the released memory page information, the memory page information is searched to obtain the target memory page to be released. That is to say, after obtaining the address information of each memory page, the target memory page to be released is found by searching based on the memory page size information. In other words, the accurate search of the target memory page to be released is achieved, thereby ensuring the accuracy of the released memory.

[0059] In this embodiment, memory page address information is obtained by indexing based on the starting sector position information in the released memory page information, and the memory page information corresponding to the memory page address information is determined, and the memory page information is searched based on the memory page size information in the released memory page information to obtain the target memory page to be released. By accurately locating and searching the target memory page to be released, the accuracy of the target memory page can be achieved, and the memory utilization rate of the memory disk can be improved by accurately releasing the target memory page.

[0060] In one embodiment, after receiving a block operation request and the block operation request matches a preset block reclaim request, determining released memory page information corresponding to the block operation request includes:

[0061] Step e: determining an operation request characteristic corresponding to the block operation request, and determining a recycling request characteristic corresponding to the preset block recycling request;

[0062] Step f: after the operation request feature matches the reclaim request feature, determining the released memory page information corresponding to the block operation request.

[0063] Exemplarily, when detecting a block operation request, the operation request feature corresponding to the block operation request is determined, and the recovery request feature corresponding to the preset block recovery request is determined. The operation request feature refers to the feature corresponding to the block operation request, such as the feature with bio_op (bio) equal to REQ_OP_DISCARD or other level features, and the recovery request feature refers to the feature defined by the recovery request, which can be the feature with bio_op (bio) equal to REQ_OP_DISCARD or two high-level features, etc., by detecting whether the operation request feature matches the recovery request feature. After the operation request feature matches the recovery request feature, the step of determining the released memory page information corresponding to the block operation request will be executed. If the operation request feature matches the recovery request feature, that is, the block operation request matches the preset block recovery request, the step of determining the released memory page information corresponding to the block operation request will be executed.

[0064] In this embodiment, by determining the operation request characteristics corresponding to the block operation request and determining the recovery request characteristics corresponding to the preset block recovery request, and after the operation request characteristics match the recovery request characteristics, the step of determining the released memory page information corresponding to the block operation request is executed. Through the judgment of the block operation request, the operation of the memory page recovery request can be accurately executed, thereby realizing the release of idle memory pages or memory pages that do not store data in the memory disk, thereby improving the memory utilization rate of the memory disk.

[0065] In one embodiment, after determining the recycling request characteristics corresponding to the preset block recycling request, the following steps are included:

[0066] Step g: if the operation request feature and the reclaim request feature have distinguishing features, determining storage information corresponding to the block operation request;

[0067] Step h: determining data required space information in the storage information, and writing the storage data in the storage information into the memory disk based on the data required space information and preset memory page space information.

[0068] Exemplarily, if the operation request characteristics and the reclaim request characteristics have distinguishing features, the storage information corresponding to the block operation request is determined. The distinguishing features include at least a mismatch between the operation request characteristics and the reclaim request characteristics. Storage information refers to information about stored data. Alternatively, read information may be determined, where read information refers to information about reading data, or other information may be determined, where other information refers to information about performing other operations on a memory disk or memory page. Data space requirements information in the storage information is then determined, and the stored data in the storage information is written to the memory disk based on the data space requirements information and preset memory page space information. The data space requirements information refers to information about the space required for storing the data, the preset memory page space information refers to information about the actual storage space of the memory page, and the stored data refers to data in the storage information to be stored on the memory disk. When writing the stored data in the storage information to the memory disk based on the data space requirements information and the preset memory page space information, the stored data is stored on the memory disk based on first space size information in the data space requirements information and second space size information in the preset memory page space information. Alternatively, the stored data may be partitioned and stored on the memory disk. Among them, the partition basis is that the quotient of the first space size information and the second space size information is the maximum partition value of the stored data, and then the stored data can be partitioned to realize data classification storage, and the data to be searched or read can be quickly located when searching or reading data. Correspondingly, the stored data will also be stored in the memory disk according to the storage rules of the stored data. When the reading information is determined, the data storage characteristics corresponding to the read information are determined, and the data storage characteristics are searched in the memory disk to obtain the data to be read. Among them, the data storage characteristics refer to the characteristics of the read data or the characteristics of the storage location, and the data to be read refers to the data that the user needs to read.

[0069] In this embodiment, if there are distinguishing features between the operation request feature and the recovery request feature, the storage information corresponding to the block operation request is determined, and the data requirement space information in the storage information is determined. Based on the data requirement space information and the preset memory page space information, the storage data in the storage information is written to the memory disk. The storage data is written by processing the data requirement space information and the preset memory page space information, thereby ensuring the accuracy of data writing and writing data on demand, thereby improving the memory utilization rate of the memory disk.

[0070] In addition, referring to FIG5 , the present application also provides a thin provisioning system for a memory disk, including:

[0071] The request determination module A10 is configured to receive a block operation request, and after the block operation request matches a preset block reclaim request, determine the released memory page information corresponding to the block operation request;

[0072] The memory release module A20 is configured to determine a target memory page to be released based on the released memory page information and release the target memory page.

[0073] The specific implementation of the thin provisioning system of the memory disk of the present application is basically the same as the various embodiments of the thin provisioning method of the memory disk described above, and will not be repeated here.

[0074] In addition, the present application also provides a thin provisioning device for a memory disk, which includes a memory, a processor, and a thin provisioning program for the memory disk stored in the memory and runnable on the processor. When the thin provisioning program for the memory disk is executed by the processor, the steps of the thin provisioning method for the memory disk as described above are implemented.

[0075] Furthermore, in one embodiment, FIG6 is a schematic diagram of the structure of a thin provisioning device for a ramdisk according to one embodiment of the present application. As shown in FIG6 , at the hardware level, the thin provisioning device for the ramdisk includes a processor, an internal bus, a network interface, and memory. The memory may include internal memory, such as high-speed random-access memory (RAM), or non-volatile memory, such as at least one disk storage device. Of course, the thin provisioning device for the ramdisk may also include hardware required for other services. The processor, network interface, and memory may be interconnected via an internal bus, such as an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus. Such buses may be classified as address buses, data buses, control buses, and the like. For ease of illustration, FIG6 uses only one bidirectional arrow, but this does not imply that there is only one bus or only one type of bus. The memory is used to store programs. Programs may include program code, which includes computer operating instructions. The processor reads the corresponding computer program from the non-volatile memory and executes it in the memory, forming a shared resource access control device at the logical level. The processor executes the program stored in the memory and is specifically used to perform the steps of the anti-channeling control method described above.

[0076] The specific implementation of the thin provisioning device of the memory disk in the present application is basically the same as the various embodiments of the thin provisioning method of the memory disk described above, and will not be repeated here.

[0077] In addition, the present application also provides a computer-readable storage medium, which can be a computer-readable storage medium, wherein the computer-readable storage medium stores one or more programs, and the one or more programs can also be executed by one or more processors to implement the steps of each embodiment of the above-mentioned memory access method.

[0078] The specific implementation of the computer-readable storage medium of the present application is basically the same as the embodiments of the above-mentioned memory access method, and will not be repeated here.

[0079] It should be noted that, in this document, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or system comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or system. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or system comprising the element.

[0080] The serial numbers of the above embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0081] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus the necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to some situations can be embodied in the form of a software product, which is stored in a computer-readable storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present application.

[0082] The above are only some embodiments of the present application and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the description and drawings of this application, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.

Claims

1. A thin provisioning method for a memory disk, wherein: The method comprises: receiving a block operation request, and after the block operation request matches a preset block recovery request, determining released memory page information corresponding to the block operation request; A target memory page to be released is determined based on the released memory page information, and the target memory page is released.

2. The thin provisioning method of a memory disk as claimed in claim 1, wherein: The determining the released memory page information corresponding to the block operation request includes: Determine the starting sector position information in the block operation request, and determine the memory page size information in the block operation request; The starting sector position information and the memory page size information are determined as released memory page information.

3. The thin provisioning method of a memory disk as claimed in claim 1, wherein: The determining the target memory page to be released based on the released memory page information includes: Performing indexing based on the starting sector position information in the released memory page information to obtain memory page address information, and determining memory page information corresponding to the memory page address information; The memory page information is searched based on the memory page size information in the released memory page information to obtain a target memory page to be released.

4. The thin provisioning method of a memory disk as claimed in claim 1, wherein: The receiving of the block operation request, and after the block operation request matches the preset block recovery request, determining the released memory page information corresponding to the block operation request, includes: Determine an operation request characteristic corresponding to the block operation request, and determine a recycling request characteristic corresponding to the preset block recycling request; After the operation request feature matches the reclaim request feature, released memory page information corresponding to the block operation request is determined.

5. The thin provisioning method of a memory disk as claimed in claim 4, wherein: After determining the recycling request characteristics corresponding to the preset block recycling request, including: If there are distinguishing features between the operation request feature and the reclaim request feature, determining storage information corresponding to the block operation request; Determine the data demand space information in the storage information, based on the data demand space information and preset memory page space information to write the storage data in the storage information into the memory disk.

6. The thin provisioning method of a memory disk as claimed in claim 1, wherein: The block operation request includes a memory page recovery request, a data read request or a data write request. After receiving the block operation request, the method further comprises: If a preset recycling instruction is triggered, it is determined that the block operation request is the recycling memory page request corresponding to the recycling instruction, The matching of the block operation request with the preset block reclaim request includes that the memory page reclaim request matches the preset block reclaim request.

7. The thin provisioning method of a memory disk as claimed in claim 6, wherein: The triggering of the preset recycling instruction includes: If data deletion is detected in the memory disk, a preset recovery instruction is triggered. Or, if data deletion is detected in the memory disk, a prompt instruction is triggered, and a preset recycling instruction is triggered based on the prompt instruction.

8. A thin provisioning system for a memory disk, wherein: The system comprises: A request determination module is configured to receive a block operation request, and after the block operation request matches a preset block recovery request, determine the released memory page information corresponding to the block operation request; The memory release module is configured to determine a target memory page to be released based on the released memory page information, and release the target memory page.

9. A thin provisioning device for a memory disk, wherein: The device comprises: a processor; and a memory arranged to store computer executable instructions, wherein when the executable instructions are executed, the processor executes the steps of the thin provisioning method of the memory disk as claimed in any one of claims 1 to 7.

10. A computer-readable storage medium storing one or more programs, which, when executed by an electronic device including a plurality of application programs, enables the electronic device to perform the steps of the thin provisioning method of a memory disk as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Systems and methods for enabling replication targets to reclaim unused storage space on thin-provisioned storage systems

    CN102782639A

  • Physical memory release system, apparatus and method

    CN108021442A

  • Virtual machine disk space recycling method and system

    CN108363552A

  • Disk space release method and device

    CN109857343A

  • Memory block recovery method and device

    CN111108488A