Thin supply method, system and equipment of memory disk and computer readable storage medium
By matching block operation requests and block recycling requests, memory page information is released to achieve thin supply of memory disks, which solves the problem of low memory usage of traditional memory disks and improves the memory usage efficiency of memory disks.
Patent Information
- Application Number
- CN202310160275.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-24
- Publication Date
- 2024-08-27
AI Technical Summary
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.
By receiving block operation requests and matching them with preset block recycling requests, the release memory page information is determined to release the target memory page, thereby achieving thin provision of the memory disk.
It improves the memory usage of the memory disk, avoids the problem that memory pages cannot be released after deleting data from the memory disk, and ensures efficient utilization of memory resources.
Smart Images

Figure CN118550843A
Abstract
Description
Technical Field
[0001] The present invention 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
[0002] In the operating system, it is necessary to perform data writing and data deletion operations on the memory disk in the system. Therefore, while ensuring the normal writing and deletion of data, it also puts forward higher requirements on the storage technology of the memory disk.
[0003] The traditional storage method of the memory disk is that when data is written to the memory disk, the memory occupied by the memory disk will continue to increase. When data is deleted from the memory disk, the memory page corresponding to the deleted data will not be released because the memory disk does not have a thin provisioning function. That is, this storage method of the memory disk will cause the memory utilization rate of the memory disk to be low because the memory page corresponding to the deleted data will not be released. Summary of the invention
[0004] The main purpose of the present 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.
[0005] To achieve the above objectives, the present application provides a thin provisioning method for a memory disk, comprising: 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.
[0006] In addition, to achieve the above purpose, the present application also provides a thin provisioning system for a memory disk, including: 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.
[0007] 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.
[0008] 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 executes the steps of the thin provision method of the memory disk as described above.
[0009] The present application receives a block operation request, and after the block operation request matches a preset block recovery request, the memory disk is thinly provisioned by reclaiming 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 the thin provision of the memory disk, thereby avoiding the phenomenon that when data is deleted from the memory disk, the memory page corresponding to the deleted data of the memory disk will not be released because the memory disk does not have the thin provision function. The released memory page information corresponding to the block operation request is determined, and then the target memory page to be released is determined based on the released memory page information, and finally the target memory page is released, thereby improving the memory utilization rate of the memory disk. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] Figure 1 It is a flow chart of the first embodiment of the thin provision method of the memory disk of the present application; Figure 2 It is a schematic diagram of the structure of the memory disk block device driver in the operating system of this application; Figure 3 It is a schematic diagram of the processing flow of reclaiming a memory page request in the thin provision method of the memory disk of the present application; Figure 4 It is a schematic diagram of the thin provisioning process in the thin provisioning method of the memory disk of the present application; Figure 5 is a schematic diagram of a thin provisioning system for a memory disk of the present application; Figure 6 It is a flowchart of the memory operation in the thin provision method of the memory disk of the present application.
[0011] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0012] It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0013] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. 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 creative work are within the scope of protection of this application.
[0014] 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 components under a certain specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indication will also change accordingly.
[0015] In this application, unless otherwise clearly specified and limited, the terms "connection", "fixation", etc. should be understood in a broad sense. For example, "fixation" can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, it can be the internal connection of two elements or the interaction relationship between two elements, unless otherwise clearly defined. For ordinary technicians in this field, the specific meanings of the above terms in this application can be understood according to specific circumstances.
[0016] In addition, in this application, descriptions such as "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in this field to implement them. 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.
[0017] The embodiments of the present application mainly relate to the thin provision of a ramdisk, and relate to the utilization rate of the internal storage resources of the ramdisk through the thin provision of the ramdisk. The ramdisk is a storage device based on memory and formed by software virtualization. Compared with traditional disk devices, the ramdisk has a fast storage speed and can effectively improve the data access speed. The conventional technology for storage processing of the ramdisk is: when writing data to the ramdisk, the memory occupied by the ramdisk will continue to increase due to the data writing, and when deleting data from the ramdisk, the memory occupied by the ramdisk will not decrease, because only the data in the ramdisk is deleted but the memory page corresponding to the storage data is not deleted, so the entire ramdisk will only increase the number of memory pages. Among them, the memory page in the ramdisk may be a memory page for storing data, or it may be an empty memory page for storing data. Because the ramdisk does not have a thin provisioning function, the corresponding memory page will not be released after the data is deleted from the ramdisk, and will be occupied by the ramdisk all the time, and cannot be recycled and reallocated by the host, affecting the memory utilization rate of the host system.
[0018] Therefore, in order to solve the problem of memory page usage in the memory disk, after receiving the block operation request, it is detected whether the block operation request 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 the target memory page to be released is determined based on the released memory page information, and the target memory page is released. That is, when data needs to be deleted from the memory disk, the kernel driver layer corresponding to the memory disk releases the corresponding memory page after receiving the recovery request, and the memory occupied by the memory disk is reduced accordingly, and then the host memory usage is improved by releasing the memory page of the deleted data in the memory disk.
[0019] The embodiments of the present application are further described below in conjunction with the accompanying drawings.
[0020] The present application proposes a thin provisioning method for a memory disk. In the first embodiment of the thin provisioning method for a memory disk of the present application, referring to Figure 1 , the thin provisioning methods of memory disk include: Step S10, 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; For example, the thin provisioning of the memory disk in the embodiment of the present application can be applied to products of Linux operating system or Windows operating system, such as Figure 2 As shown, Figure 2 Schematic diagram of the structure of the memory disk block device driver in the operating system. The controller of this embodiment is the memory disk block device driver. Figure 2Taking the Linux operating system as an example, there are two ways to enter the memory disk block device driver. One is to directly use VFS (Virtual File System) and then directly use instructions to enter the memory disk block device driver. Another way is to enter the disk file system through VFS, and then enter the Page / BufferCache through the disk file system, and then enter the Generic Block Layer through Page / BufferCache, and finally enter the memory disk block device driver in the Generic Block Layer. Finally, the thin supply of the memory disk can be realized in the memory disk block device driver, and it can also be directly controlled in the Linux operating system or Windows operating system, so as to realize the memory disk in the operating system to delete the idle or non-data-storing memory pages in time, and improve the memory utilization rate of the memory disk.
[0021] Exemplarily, after the memory disk block device driver receives a block operation request, it will detect whether the block operation request matches the preset block recovery request, that is, whether the block operation request is a request to recover a memory page. Among them, the block operation request refers to a request to perform an operation on the memory disk, for example, reading the data of the memory disk, deleting the data of the memory disk, writing the data of the memory disk, 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 in 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 improved 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.
[0022] Exemplarily, after the block operation request matches the preset block recovery request, 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 realize the thin supply of the memory disk. Among them, the released memory page information refers to the relevant information of the released memory page in the block operation request, which can at least include the starting position of the memory page, the size of the memory page, and other information, and the target memory page refers to the memory page that needs to be released.
[0023] Exemplarily, 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 following steps are performed: Exemplarily, block operation requests include at least memory page reclaiming requests, data reading requests, data writing requests, and other requests for operating the memory disk. A memory page reclaiming 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 reading request refers to a request to read a specific location or all data in the memory disk. A data writing 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.
[0024] Step m, if a preset recycling instruction is triggered, determining that the block operation request is a recycling memory page request corresponding to the recycling instruction; Step n, matching the block operation request with the preset block recycling request includes matching the memory page recycling request with the preset block recycling request.
[0025] Exemplarily, after receiving a block operation instruction, different triggered instructions will be collected. When the memory disk block device driver receives a trigger preset recovery instruction, it will determine that the block operation request is a memory page recovery request corresponding to the recovery instruction. The block operation request matches the preset block recovery request and at least includes a situation where the memory page recovery request matches the preset block recovery request. It can be determined whether the block operation request is a memory page recovery request based on triggering different instructions, and then it can be determined whether the block operation request matches the preset block recovery request. Among them, the preset recovery 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, it will trigger the preset recovery instruction. In this embodiment, the preset recovery instruction may refer to two high-level signals or other level signals, which are not limited in this embodiment and may be other different signals. In this embodiment, two high-level signals are taken as an example. When the memory disk block device driver detects that data is deleted in the memory disk, two high-level signals will be triggered. The two high-level signals defined internally are preset recycling instructions. The recycling memory page request corresponding to the recycling instruction will be determined as a block operation request, that is, 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 of 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 two high-level signals triggered when the storage data of memory page A and memory page B is deleted can be directly triggered when the storage data is deleted, or it can be prompted to trigger 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 operations of the memory disk can be guaranteed.
[0026] For example, if a preset read instruction is triggered, the block operation request will be determined as a read data request corresponding to the read instruction; if a preset write instruction is triggered, the block operation request will be determined as a write data request corresponding to the write instruction; or when other instructions are triggered, the request corresponding to other instructions is determined as a block operation instruction. Among them, the preset read instruction refers to a trigger instruction that needs to read the storage data in the memory page, the preset read instruction refers to a trigger instruction that needs to write the storage data in the memory page, and other instructions refer to trigger instructions that need to perform other operations on the storage data in the memory page or trigger instructions that perform other operations on the memory disk, and other operations at least include memory page data detection duplicate data, memory disk partitioning and other operations. For example, when it is detected that a 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 used as a block operation request. Conversely, when it is detected that a preset write instruction of a low-level signal and a high-level signal is triggered when writing storage data C to memory page A and memory page B, 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 supply processing is performed on the memory disk according to the block operation request, thereby improving the memory utilization rate of the memory disk.
[0027] Trigger preset recycling instructions, including: Step p: if data deletion is detected in the memory disk, the 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.
[0028] Exemplarily, there are at least two triggering methods for the triggering methods of various preset triggering instructions. Taking the preset recycling instruction as an example, when the memory disk block device driver detects that data has been deleted in the memory disk, it will directly trigger the preset recycling instruction, or, after detecting that data has been deleted in the memory disk, trigger the 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 the data or after deleting the data, a pop-up window is generated to prompt the user whether to trigger the preset recycling instruction. It can also be that the user performs a custom operation after deleting the data to generate an instruction corresponding to the triggering preset recycling instruction, and it can be that the user directly operates to trigger the preset recycling instruction after deleting the stored data, or inputs a specific defined instruction to trigger it. Therefore, if before triggering the preset read instruction or before triggering the preset write instruction, its triggering operation is similar to the triggering operation of the preset recycling instruction, and can be divided into at least the above two triggering methods, or it can 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 combines data storage and deletion with memory disk memory optimization. Then, by enriching the memory disk function, simple operations can be combined with memory disk optimized storage operations, thereby improving the memory utilization rate of the memory disk.
[0029] Step S20, determining a target memory page to be released based on the released memory page information, and releasing the target memory page.
[0030] Exemplarily, when there is a difference between a block operation request and a preset block recovery request, an 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 a mismatch between the two, and the operation instruction refers to an instruction for operating the memory disk, which may be an instruction for partitioning the memory disk, detecting duplicates, and the like. Furthermore, through the above thin supply of the memory disk, when data is written to the memory disk, the memory disk block device driver allocates corresponding memory pages on demand to save data, and the memory occupied by the memory disk increases accordingly, and the memory disk occupies memory on demand. 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, and the released memory page can be reallocated through the system or host, thereby improving the memory utilization of the entire host or system by increasing the memory utilization of the memory in the memory disk. Reference Figure 3 , Figure 3The present invention is a schematic diagram of the processing flow of memory page recovery request in the thin provisioning method of the memory disk. After receiving the memory page recovery request, that is, after detecting that the block operation request matches the preset block recovery request, it can be determined that the block operation request is a memory page recovery request. The memory page recovery request here can also refer to a block recovery request. The memory page release information is obtained by parsing the memory page recovery request message, and then the memory page of the memory page recovery request is searched in the memory disk based on the memory page release information. The memory page here refers to the memory page to be released after the data stored in the page is deleted. Finally, the memory page is released to realize the thin provisioning of the memory disk, and then the memory utilization rate of the memory disk is improved by releasing the memory page of the deleted data in the memory disk.
[0031] For example, Figure 4As shown, the schematic diagram of the thin provisioning process in the thin provisioning method of the memory disk, the thin provisioning of the memory disk of this embodiment can be applied to all products of Linux operating system and Windows operating system, this embodiment takes the Linux 4.18 kernel version as an example, and the steps implemented in the memory disk driver layer are as follows: in the memory disk kernel driver layer, after the request processing function receives the IO request from the general block layer, it 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, wherein the request processing function can be a judgment program or a function for processing IO requests, which is not limited here, and the IO request refers to the request received by the input and output port. For example, the preset block recovery request is judged through the interface bio_op(bio), and 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), wherein bio_op(bio) is a judgment instruction. When it is determined that bio_op(bio) is equal to REQ_OP_DISCARD, the block operation request is a request to recycle memory pages, and the step of parsing the request to recycle memory pages is executed. Otherwise, it is a read request, a write request, or other request. Based on the above judgment, the processing flow of the read and write request will be executed on the memory disk. The above judgment method can also be other judgment methods, such as high and low level judgment methods, which are not limited here. By parsing the request message to recycle memory pages, the position of the starting sector of the memory page to be released in the memory disk can be obtained by parsing bio->bi_iter.bi_sector in the request message to recycle memory pages, and the size of the memory page to be released can be obtained by parsing bio->bi_iter.bi_size in the request message to recycle memory pages. Finally, the corresponding memory page is found based on the above parsing results. In the memory disk, the memory page is managed by a radix tree. The position of the starting sector of the memory page in the memory disk is used as an index to query the address of the corresponding memory page, and then the corresponding memory page to be released is found according to the address of the memory page and the size of the memory page to be deleted. After the memory page to be released is obtained, the memory page is deleted from the radix tree, and the corresponding memory page is released. Furthermore, after 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.
[0032] In this embodiment, after receiving a block operation request and the block operation request matches a preset block recovery request, the memory disk is thinly provisioned by recovering 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 thin provision of the memory disk, 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.
[0033] In addition, based on the first embodiment of the thin provisioning method of the memory disk, a second embodiment of the thin provisioning method based on the memory disk is proposed. In the second embodiment, step S20, determining the released memory page information corresponding to the block operation request, includes: Step a, determining the starting sector position information in the block operation request, and determining the memory page size information in the block operation request; Step b, determining the starting sector position information and the memory page size information as the released memory page information.
[0034] Exemplarily, when it is necessary to determine the released memory page information corresponding to the block operation request, the starting sector position information and the memory page size information in the block operation request are determined, and then the obtained starting sector position information and the memory page size information are used as the released memory page information. The starting sector position information refers to the starting position information of the memory page to be released corresponding to the deleted data in the memory disk, and the memory page size information refers to the memory size information of the memory page to be released. Finally, the memory page to be released can be released based on the starting sector position information and the memory page size information.
[0035] 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, the starting sector position information and the memory page size information are determined as the memory page release information, and the starting sector position information and the memory page size information are used as the basis for releasing the memory page, thereby ensuring the accuracy of releasing the memory page.
[0036] In one embodiment, determining a target memory page to be released based on the released memory page information includes: Step c, indexing based on the starting sector position information in the released memory page information, obtaining the memory page address information, and determining the memory page information corresponding to the memory page address information; 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.
[0037] Exemplarily, since 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, obtain the memory page address information, and 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 based on the memory page size information. In other words, accurate search of the target memory page to be released is achieved, thereby ensuring the accuracy of released memory.
[0038] 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 releasing the target memory page can be improved, and the memory utilization rate of the memory disk can be improved by accurately releasing the target memory page.
[0039] In one embodiment, after receiving a block operation request and the block operation request matches a preset block recovery request, determining released memory page information corresponding to the block operation request includes: Step e, determining an operation request feature corresponding to the block operation request, and determining a recycling request feature corresponding to the preset block recycling request; Step f: after the operation request feature matches the recovery request feature, determine the released memory page information corresponding to the block operation request.
[0040] 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. Wherein, 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, etc., and the recovery request feature refers to the feature defined by the recovery request, which can be the feature of 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 release 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 release memory page information corresponding to the block operation request will be executed.
[0041] In this embodiment, by determining the operation request feature corresponding to the block operation request and determining the recovery request feature corresponding to the preset block recovery request, and 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 is executed. Through the judgment of the block operation request, the operation of recovering the memory page request can be accurately executed, so that the memory pages that are idle or do not store data in the memory disk are released, thereby improving the memory utilization rate of the memory disk.
[0042] In one embodiment, after determining the recycling request feature corresponding to the preset block recycling request, the following steps are included: Step g, if there are distinguishing features between the operation request feature and the recovery request feature, determining storage information corresponding to the block operation request; Step h: determining the data demand space information in the storage information, and writing the storage data in the storage information into the memory disk based on the data demand space information and the preset memory page space information.
[0043] Exemplarily, if there are distinguishing features between the operation request feature and the recovery request feature, the storage information corresponding to the block operation request will be determined. The distinguishing features at least include the phenomenon that the operation request feature does not match the recovery request feature, and the storage information refers to the information of the storage data. It can also be to determine the read information, which refers to the information of reading data, or to determine other information, which refers to the information of other operations performed on the memory disk or memory page. Then, by determining the data demand space information in the storage information, the storage data in the storage information is written to the memory disk based on the data demand space information and the preset memory page space information. The data demand space information refers to the information of the space required for the storage data, the preset memory page space information refers to the actual storage space information of the memory page, and the storage data refers to the data to be stored in the memory disk in the storage information. When the storage data in the storage information is written to the memory disk based on the data demand space information and the preset memory page space information, the storage data will be stored in the memory disk according to the first space size information of the data demand space information and the second space size information of the preset memory page space information, or the storage data can be partitioned and then stored in 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 read 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.
[0044] 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 demand space information in the storage information is determined. Based on the data demand 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 demand 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.
[0045] In addition, refer to Figure 5 The present application also provides a thin provisioning system for a memory disk, comprising: The request determination module A10 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 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.
[0046] The specific implementation of the thin provision system of the memory disk of the present application is basically the same as the various embodiments of the thin provision method of the memory disk mentioned above, and will not be repeated here.
[0047] 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 executable 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.
[0048] Furthermore, in one embodiment, Figure 6 FIG. 1 is a schematic diagram of a thin provision device for a memory disk according to an embodiment of the present invention. Figure 6 As shown, at the hardware level, the thin provisioning device of the memory disk includes a processor, and optionally also includes an internal bus, a network interface, and a memory. Among them, the memory may include a memory, such as a high-speed random access memory (Random-Access Memory, RAM), and may also include a non-volatile memory (non-volatile memory), such as at least one disk storage, etc. Of course, the thin provisioning device of the memory disk may also include hardware required for other services. The processor, network interface and memory can be interconnected through an internal bus, and the internal bus can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 6 Only one bidirectional arrow is used in the diagram, but it does not mean that there is only one bus or one type of bus. The memory is used to store programs. Specifically, the program may include a program code, and the program code includes computer operation instructions. The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it, 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 execute the steps of the above-mentioned anti-channelling control method.
[0049] The specific implementation of the thin provision device of the memory disk in the present application is basically the same as the various embodiments of the thin provision method of the memory disk mentioned above, and will not be repeated here.
[0050] In addition, the present application also provides a computer-readable storage medium, which may be a computer-readable storage medium, wherein the computer-readable storage medium stores one or more programs, and the one or more programs may also be executed by one or more processors to implement the steps of each embodiment of the above-mentioned memory access method.
[0051] The specific implementation of the computer-readable storage medium of the present application is basically the same as the above-mentioned embodiments of the memory access method, and will not be repeated here.
[0052] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.
[0053] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0054] 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 a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art 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 invention.
[0055] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A thin provisioning method for a memory disk, characterized in that: include: 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, characterized in that: 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, characterized in that: 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, characterized in that: 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, characterized in that: 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 required space information in the storage information, and write the storage data in the storage information into the memory disk based on the data required space information and preset memory page space information.
6. The thin provisioning method of a memory disk as claimed in claim 1, characterized in that: 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, characterized in that: 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, characterized in that: include: 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, comprising: processor; And a memory arranged to store computer executable instructions, which, when executed, cause the processor to perform the steps of the thin provisioning method for the memory disk as described in any one of claims 1-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 execute the steps of the thin provisioning method of the memory disk as described in any one of claims 1-7.
