Disk space distribution method and device

Dynamically adjusting disk space through virtual logical space and real-time monitoring, solving the waste problem caused by inaccurate pre-allocation of disk space, and improving resource utilization and storage system efficiency.

CN119148939APending Publication Date: 2024-12-17SHANDONG LANGCHAO YUNTOU INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411274971.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-12
Publication Date
2024-12-17

AI Technical Summary

Technical Problem

In the prior art, the pre-allocation of disk space is often inaccurate, resulting in waste of resources, accounting for about 30% of the total disk storage space, and it is difficult to adjust dynamically.

Method used

The virtual logical space allocation method is adopted to allocate relatively small physical space when data is first written, and the disk space is dynamically expanded according to real-time monitoring and increase in actual occupation.

Benefits of technology

Significantly reduces waste of storage space, improves resource utilization, allows for increased disk capacity on demand, reduces workload for IT managers, and saves space and bandwidth when mirroring remotely.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119148939A_ABST
    Figure CN119148939A_ABST
Patent Text Reader

Abstract

The invention provides a disk space distribution method and device. The method comprises the following steps: when a disk space needs to be allocated for an application system, allocating a virtual logic space with M capacity in a disk for the application system; wherein M is a positive number greater than 0; when data, needing to be written into the virtual logic space, of the application system is received for the first time, a physical space with N capacity in a disk is distributed for the application system; wherein N is a positive number greater than 0; m is greater than N; writing the data, received each time, of the application system into the physical space currently allocated for the application system; and monitoring whether the occupation of the physical space exceeds a preset threshold value or not in real time according to the physical space in the disk allocated for the application system at present, and if so, increasing the physical space allocated for the application system in the disk according to a preset increment. The utilization rate of the disk space can be improved, and waste of the disk space is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] One or more embodiments of the present invention relate to computer technology, and more particularly, to a method and device for allocating disk space. Background Art

[0002] During computer application, disk space needs to be allocated.

[0003] In the existing technology, the method of allocating disk space is: the user predicts the current and future business development scale, plans the disk space resources in advance, and allocates the disk space in advance. For example, if the user predicts that an application system should require 5TB of disk space, then the physical space of 5TB of disk is allocated to the application system in advance.

[0004] However, in practice, users' predictions are often inaccurate. There is a large gap between the physical space in the disk allocated based on the prediction and the physical space occupied by the actual business volume of the application system, resulting in a waste of disk space allocation. For example, 5TB of disk space is pre-allocated for an application system, but the application system only occupies 1TB of capacity, which results in a waste of 4TB of disk space. Moreover, after the 4TB capacity is allocated, it is difficult for other application systems to use it. According to statistics, the waste of disk space resources caused by pre-allocating too much storage space accounts for about 30% of the total disk storage space. Summary of the invention

[0005] One or more embodiments of the present invention describe a method and device for allocating disk space, which can reduce the waste of disk space resources.

[0006] According to a first aspect, a method for allocating disk space is provided, the method comprising:

[0007] When a disk space needs to be allocated for an application system, a virtual logical space of M capacity in the disk is allocated for the application system; where M is a positive number greater than 0;

[0008] When data that needs to be written into the virtual logical space is received for the first time from the application system, a physical space of N capacity in the disk is allocated to the application system; wherein N is a positive number greater than 0; and M is greater than N;

[0009] Writing the data of the application system received each time into the physical space currently allocated for the application system;

[0010] Based on the physical space currently allocated to the application system, whether the occupancy of the physical space exceeds a preset threshold is monitored in real time. If so, the physical space allocated to the application system on the disk is increased by a preset increment.

[0011] The unit of the capacity is TB.

[0012] The method further comprises: creating at least one volume in the disk, each volume corresponding to an application system;

[0013] The allocating a virtual logical space of M capacity in the disk to the application system includes: allocating a virtual logical space of M capacity to a volume corresponding to the application system;

[0014] Allocating N physical spaces in the disk to the application system, including: allocating N physical spaces to the volume corresponding to the application system;

[0015] The step of increasing the physical space allocated to the application system in the disk according to a preset increment includes: increasing the physical space allocated to the volume corresponding to the application system according to the preset increment.

[0016] The method further comprises:

[0017] When deploying block-level remote mirroring, data in the physical space that is actually used in the transfer volume is transferred.

[0018] According to a second aspect, there is provided a disk space allocation device, the device comprising:

[0019] The logic space allocation module is configured to allocate a virtual logic space of M capacity in the disk to an application system when a disk space needs to be allocated to the application system; wherein M is a positive number greater than 0;

[0020] The running space allocation module is configured to allocate N physical spaces in the disk for the application system when receiving data that needs to be written into the virtual logical space for the first time; wherein N is a positive number greater than 0; and M is greater than N; based on the physical space in the disk currently allocated to the application system, monitor in real time whether the occupancy of the physical space exceeds a preset threshold, and if so, increase the physical space allocated to the application system in the disk according to a preset increment;

[0021] The data writing module is configured to write the data of the application system received each time into the physical space currently allocated to the application system.

[0022] The unit of the capacity is TB.

[0023] The device further comprises: a creation module configured to create at least one volume in the disk, each volume corresponding to an application system;

[0024] The runspace allocation module is configured to execute:

[0025] When it is necessary to allocate a virtual logical space of M capacity in the disk for the application system, execute the allocation of the virtual logical space of M capacity to the volume corresponding to the application system;

[0026] When it is necessary to allocate N physical spaces in the disk to the application system, allocate N physical spaces to the volume corresponding to the application system;

[0027] When the physical space allocated to the application system in the disk needs to be increased according to a preset increment, the physical space allocated to the volume corresponding to the application system is increased according to the preset increment.

[0028] The device further comprises:

[0029] The mirror processing module is configured to transfer data in the space actually used in the volume when deploying block-level remote mirroring.

[0030] According to a third aspect, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed in a computer, the computer is caused to execute the method described in any embodiment of the present invention.

[0031] According to a fourth aspect, a computing device is provided, including a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, the method described in any embodiment of the present invention is implemented.

[0032] The disk space allocation method and device provided by various embodiments of the present invention have at least the following beneficial effects:

[0033] 1. The embodiment of the present invention does not pre-allocate physical space in the disk for the application system. What is pre-allocated to the application system is a relatively large virtual logical space, not a physical space, let alone a fixed physical space. The embodiment of the present invention provides a "runtime space", that is, only when the application system receives data that needs to be written into the virtual logical space, will the relatively small physical space in the disk be allocated to the application system. Therefore, the method of the embodiment of the present invention can provide an ultra-large capacity virtual storage space for the operating system with a small physical capacity. The allocation of "runtime space" can significantly reduce the allocated but unused storage space. Improve resource utilization.

[0034] 2. According to the embodiment of the present invention, as the amount of application data increases, the actual physical space occupied by the disk can be expanded in time without manual expansion.

[0035] 3. In the embodiment of the present invention, more volumes can be created, the space of a single volume can be larger, and the size of each volume can be dynamically managed;

[0036] 4. Users can purchase less disk storage media at the initial purchase and then increase disk capacity as needed;

[0037] 5. No in-depth capacity planning is required when creating volumes, which reduces the workload of IT managers in storage configuration and avoids storage space waste caused by improper estimation or subsequent business interruption due to insufficient storage space for capacity expansion and upgrade;

[0038] 6. The utilization rate of disk storage space is significantly improved. Accordingly, more application servers can be supported under the same storage space, thus improving the utilization rate of storage system.

[0039] 7. When combined with remote mirroring, it can save mirroring space and bandwidth. With traditional mirroring methods, when block-level remote mirroring is initially deployed, the entire volume is transmitted over the WAN. With thin provisioning, administrators can only transmit the space that is used. This can greatly reduce the time to establish a mirror. Similarly, thin provisioning can also use low-cost communication lines to transmit data, and because the transmitted data space is reduced, the bandwidth usage is also reduced. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0041] Figure 1 It is a flow chart of a method for allocating disk space in one embodiment of the present invention.

[0042] Figure 2 It is a flow chart of a method for allocating disk space in another embodiment of the present invention.

[0043] Figure 3 It is a schematic diagram comparing the disk space allocation method of the prior art in one embodiment of the present invention and the disk space allocation method of the embodiment of the present invention.

[0044] Figure 4 It is a schematic diagram of the structure of a disk space allocation device in one embodiment of the present invention. DETAILED DESCRIPTION

[0045] The solution provided by the present invention is described below in conjunction with the accompanying drawings.

[0046] First of all, it should be noted that the terms used in the embodiments of the present invention are only for the purpose of describing specific embodiments, and are not intended to limit the present invention. The singular forms "a", "the" and "the" used in the embodiments of the present invention and the appended claims are also intended to include plural forms, unless the context clearly indicates otherwise.

[0047] It should be understood that the term "and / or" used in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.

[0048] Figure 1 FIG. 1 is a flow chart of a method for allocating disk space in one embodiment of the present invention. Figure 1 , the method comprising:

[0049] Step 101: when it is necessary to allocate disk space for an application system, a virtual logical space of M capacity in the disk is allocated to the application system; wherein M is a positive number greater than 0.

[0050] Step 103: When data that needs to be written into the virtual logical space is received for the first time from the application system, a physical space of N capacity in the disk is allocated to the application system; wherein N is a positive number greater than 0; and M is greater than N.

[0051] Step 105: Write the data of the application system received each time into the physical space currently allocated to the application system.

[0052] Step 107: Based on the physical space in the disk currently allocated to the application system, monitor in real time whether the occupancy of the physical space exceeds a preset threshold. If so, increase the physical space allocated to the application system in the disk by a preset increment.

[0053] according to Figure 1 The method of the embodiment of the present invention shown in the figure does not pre-allocate physical space in the disk for the application system. What is pre-allocated to the application system is a relatively large virtual logical space, not a physical space, let alone a fixed physical space. The embodiment of the present invention provides a "runtime space", that is, only when the application system receives data that needs to be written into the virtual logical space, will the relatively small physical space in the disk be allocated to the application system. Therefore, the method of the embodiment of the present invention can provide an ultra-large capacity virtual storage space for the operating system with a small physical capacity.

[0054] Further, according to Figure 1The method of the embodiment of the present invention shown in the figure can timely expand the actual physical space occupied by the disk as the amount of application data increases, without manual expansion.

[0055] Combine the following Figure 1 Each step shown illustrates the method for allocating disk space in the embodiment of the present invention.

[0056] See also Figure 1 and Figure 2 The method for allocating disk space in the embodiment of the present invention includes:

[0057] Step 201: when it is necessary to allocate disk space for an application system, a virtual logical space of M capacity in the disk is allocated to the application system; wherein M is a positive number greater than 0.

[0058] The purpose of allocating virtual logical space of M capacity in the disk to the application system is to "cheat" the operating system and make it think that there is a large storage space in the disk, while in fact each logical resource is for future use.

[0059] In the embodiment of the present invention, the unit of capacity may be TB. In step 101, for example, if M is 5, 5 TB of virtual logical space may be allocated in advance to the application system.

[0060] Next, step 203 is executed: when data that needs to be written into the virtual logical space is received for the first time from the application system, a physical space of N capacity in the disk is allocated to the application system; wherein N is a positive number greater than 0; and M is greater than N.

[0061] As mentioned above, the embodiment of the present invention provides a kind of "runtime space", that is, physical space in the disk is allocated to the application system only when data that needs to be written into the virtual logical space is received from the application system.

[0062] Because M is greater than N, for example, M is 5 and N is 1, the operating system thinks that a relatively large MTB, such as 5TB, physical disk space is allocated to the application system, but in fact a relatively small NTB, such as 1TB, physical disk space is allocated. The remaining (MN)TB, such as 4TB, physical disk space can be used for the future data of the application system or other application systems. Therefore, the utilization rate of the disk space is improved and unnecessary idleness and waste of the disk space are avoided.

[0063] Step 205: Write the data of the application system received for the first time into the physical space of N capacity currently allocated to the application system.

[0064] For example, when 20 GB of data that needs to be written into the virtual logical space is received for the first time from the application system, the 20 GB of data is written into the physical space of the 1 TB disk currently allocated to the application system.

[0065] Step 207: Based on the physical space in the disk currently allocated to the application system, monitor in real time whether the occupancy of the physical space is close to or exceeds a preset threshold. If so, execute step 209; otherwise, directly execute step 211.

[0066] The monitoring process of step 207 is performed in real time. For example, the preset threshold may be 90% of the physical space in the disk currently allocated to the application system, that is, if the amount of data currently written to the physical space of the disk of the application system exceeds 90% of the physical space in the disk currently allocated to the application system, then it is considered that the occupation of the physical space exceeds the preset threshold, and step 209 is executed.

[0067] Step 209: Increase the physical space allocated to the application system in the disk according to a preset increment.

[0068] For example, the preset increment is 1TB, which means that the physical disk space is increased by 1TB each time.

[0069] See also Figure 3In the prior art, 5TB of physical disk space is allocated to the application system in advance, and it will not change dynamically over time. In the embodiment of the present invention, after 1TB of physical disk space is allocated to the application system for the first time, as time goes by, only when the actual capacity of the application (i.e., the amount of data written into the physical disk space of the application system) approaches or exceeds the 1TB of physical disk space currently allocated to the application system, for example, the amount of data written into the physical disk space of the application system occupies 0.92TB, i.e., exceeds 90% of the physical disk space currently allocated to the application system, will a part of new physical space be allocated to the application system according to a pre-set strategy, such as increasing 1TB of disk space each time, i.e., allocating another 1TB, so that the actual physical disk space allocated to the application system reaches 2TB. By analogy, as time goes by, the next time the actual capacity of the application (i.e. the amount of data written to the physical space of the application system's disk) approaches or exceeds the 2TB of physical disk space currently allocated to the application system, for example, the amount of data written to the physical space of the application system's disk occupies 2.1TB, which exceeds 90% of the physical space currently allocated to the application system. Therefore, according to a pre-set strategy, such as increasing the disk space by 1TB each time, a part of the new physical space will be allocated to the application system, that is, 1TB will be allocated again, so that the actual physical disk space allocated to the application system reaches 3TB.

[0070] Step 211: Receive the data of the application system, write the data of the application system into the physical space currently allocated to the application system, and return to step 207.

[0071] In one embodiment of the present invention, the method for allocating disk space may further include: Step 200: creating at least one volume in the disk, each volume corresponding to an application system;

[0072] Thus, in step 201, the process of allocating a virtual logical space of M capacity in the disk for the application system includes: allocating a virtual logical space of M capacity to the volume corresponding to the application system;

[0073] In step 203, the process of allocating N physical spaces in the disk for the application system includes: allocating N physical spaces for the volume corresponding to the application system;

[0074] In step 209, the process of increasing the physical space allocated to the application system in the disk according to the preset increment includes: increasing the allocated physical space for the volume corresponding to the application system according to the preset increment.

[0075] The method of the prior art and the method of the embodiment of the present invention are compared with each other by using examples:

[0076] In the prior art method, three volumes are created in the disk, and only 2TB of available storage space is left on the entire disk. Specifically, the size of volume 1 corresponding to application system 1 is 500GB of disk physical space, of which 100GB stores actual data, and the other 400GB is allocated but unused disk physical space; the size of volume 2 corresponding to application system 2 is 800GB of disk physical space, of which 200GB stores actual data; the other 600GB is allocated but unused disk physical space; the size of volume 3 corresponding to application system 3 is 550GB of disk physical space, of which 50GB stores actual data, and the other 500GB is allocated but unused disk physical space. The entire disk stores 350GB of actual data, wasting 1.5TB of allocated but unused physical space, and only 150GB of available physical space is left for other applications.

[0077] Using the method of the embodiment of the present invention, three volumes are created in the disk. Since the physical space of the disk is dynamically allocated during the data writing process, there is no allocated but unused space. Because there is 350GB of actual data, after using the method of the embodiment of the present invention, the entire disk space also stores 350GB of data. The 1.5TB of disk space wasted in the prior art can be used in the embodiment of the present invention, that is, there is 1.65TB of available space. Compared with the 150GB of available space in the prior art, the available disk space in the embodiment of the present invention has increased by 11 times.

[0078] It can be seen that the disk space allocation method of the embodiment of the present invention can improve the utilization rate of the storage space to nearly 100%. In addition, the method of the embodiment of the present invention can not only improve the utilization rate of the disk space, but also reduce the complexity of disk management for managers, and can also greatly reduce the scale of disk expansion and increase the number of application servers supported by the storage system.

[0079] In one embodiment of the present invention, when deploying block-level remote mirroring, only the data in the physical space actually used in the volume is transmitted, without transmitting the entire volume.

[0080] An embodiment of the present invention further provides a disk space allocation device, see Figure 4 , the device comprises:

[0081] The logical space allocation module 401 is configured to allocate a virtual logical space of M capacity in the disk to an application system when a disk space needs to be allocated to the application system; wherein M is a positive number greater than 0;

[0082] The running space allocation module 402 is configured to allocate N physical spaces in the disk to the application system when receiving data that needs to be written into the virtual logical space for the first time; wherein N is a positive number greater than 0; and M is greater than N; based on the physical space in the disk currently allocated to the application system, monitor in real time whether the occupancy of the physical space exceeds a preset threshold, and if so, increase the physical space allocated to the application system in the disk according to a preset increment;

[0083] The data writing module 403 is configured to write the data of the application system received each time into the physical space currently allocated to the application system.

[0084] In the embodiment of the apparatus of the present invention, the unit of capacity is TB.

[0085] In one embodiment of the apparatus of the present invention, the apparatus further comprises: a creation module configured to create at least one volume in the disk, each volume corresponding to an application system;

[0086] The run space allocation module 402 is configured to execute:

[0087] When it is necessary to allocate a virtual logical space of M capacity in the disk for the application system, execute the allocation of the virtual logical space of M capacity to the volume corresponding to the application system;

[0088] When it is necessary to allocate N physical spaces in the disk to the application system, allocate N physical spaces to the volume corresponding to the application system;

[0089] When the physical space allocated to the application system in the disk needs to be increased according to a preset increment, the physical space allocated to the volume corresponding to the application system is increased according to the preset increment.

[0090] In one embodiment of the device of the present invention, the device further comprises:

[0091] The mirror processing module is configured to transfer data in the physical space actually used in the volume when deploying block-level remote mirroring.

[0092] It should be noted that the above-mentioned devices are usually implemented on the server side, and can be set on independent servers respectively, or some or all of the devices can be combined and set on the same server. The server can be a single server or a server cluster composed of multiple servers. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system. The above-mentioned devices can also be implemented on a computer terminal with strong computing power.

[0093] An embodiment of the present invention provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed in a computer, the computer is caused to execute a method in any one of the embodiments in the specification.

[0094] An embodiment of the present invention provides a computing device, including a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, the method in any embodiment of the specification is implemented.

[0095] It is to be understood that the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the device of the embodiment of the present invention. In other embodiments of the specification, the above-mentioned device may include more or fewer components than those shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0096] The various embodiments of the present invention are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0097] Those skilled in the art should be aware that in one or more of the above examples, the functions described in the present invention can be implemented by hardware, software, widgets, or any combination thereof. When implemented by software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium.

[0098] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made on the basis of the technical solution of the present invention should be included in the scope of protection of the present invention.

Claims

1. A method for allocating disk space, characterized in that: The method includes: When a disk space needs to be allocated for an application system, a virtual logical space of M capacity in the disk is allocated for the application system; where M is a positive number greater than 0; When data that needs to be written into the virtual logical space is received for the first time from the application system, a physical space of N capacity in the disk is allocated to the application system; wherein N is a positive number greater than 0; and M is greater than N; Writing the data of the application system received each time into the physical space currently allocated for the application system; Based on the physical space currently allocated to the application system, whether the occupancy of the physical space exceeds a preset threshold is monitored in real time. If so, the physical space allocated to the application system on the disk is increased by a preset increment.

2. The method according to claim 1, characterized in that The unit of the capacity is TB.

3. The method according to claim 1, characterized in that The method further comprises: creating at least one volume in the disk, each volume corresponding to an application system; The allocating a virtual logical space of M capacity in the disk to the application system includes: allocating a virtual logical space of M capacity to a volume corresponding to the application system; Allocating N physical spaces in the disk to the application system, including: allocating N physical spaces to the volume corresponding to the application system; The step of increasing the physical space allocated to the application system in the disk according to a preset increment includes: increasing the physical space allocated to the volume corresponding to the application system according to the preset increment.

4. The method according to claim 3, characterized in that The method further comprises: When deploying block-level remote mirroring, data in the physical space actually used in the transfer volume is transferred.

5. A disk space allocation device, characterized in that: The device includes: The logic space allocation module is configured to allocate virtual logic space of M capacity in the disk to an application system when it is necessary to allocate disk space to the application system; wherein M is a positive number greater than 0; The running space allocation module is configured to allocate N physical spaces in the disk for the application system when receiving data that needs to be written into the virtual logical space for the first time; wherein N is a positive number greater than 0; and M is greater than N; based on the physical space in the disk currently allocated to the application system, monitor in real time whether the occupancy of the physical space exceeds a preset threshold, and if so, increase the physical space allocated to the application system in the disk according to a preset increment; The data writing module is configured to write the data of the application system received each time into the physical space currently allocated to the application system.

6. The device according to claim 5, characterized in that The unit of the capacity is TB.

7. The device according to claim 5, characterized in that The device further comprises: a creation module configured to create at least one volume in the disk, each volume corresponding to an application system; The runspace allocation module is configured to execute: When it is necessary to allocate a virtual logical space of M capacity in the disk for the application system, execute the allocation of the virtual logical space of M capacity to the volume corresponding to the application system; When it is necessary to allocate N physical spaces in the disk to the application system, allocate N physical spaces to the volume corresponding to the application system; When the physical space allocated to the application system in the disk needs to be increased according to a preset increment, the physical space allocated to the volume corresponding to the application system is increased according to the preset increment.

8. The device according to claim 5, characterized in that The device further comprises: The mirror processing module is configured to transfer data in the physical space actually used in the volume when deploying block-level remote mirroring.

9. A computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to execute the method according to any one of claims 1 to 4.

10. A computing device, comprising a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, the method according to any one of claims 1 to 4 is implemented.