Storage space monitoring method and device, and electronic device
Patent Information
- Application Number
- CN202610894576.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-18
- Publication Date
- 2026-08-28
- Estimated Expiration
- 2046-06-18
AI Technical Summary
[0004]然而,上述LBA地址-PBA地址映射表中仅能记录LUN中曾写入数据的地址占用情况,而对于写入后又被删除的数据,存储设备无法感知并更新该LBA地址-PBA地址映射表,这样易导致上述LUN的空间使用率计算失真,降低存储空间监控的准确性和可靠性,从而引发诸如误告警或者应告警却未触发等问题,进而影响业务的正常运行
[0012]As can be seen from the above technical solutions, in this embodiment of the application, by adding a LUN target bitmap on the storage device side to record whether each logical block in the LUN stores data, and cooperating with the client server associated with the storage device, the server's ability to perceive the actual data storage status of each logical block in the LUN is utilized to adjust the data storage status of each logical block recorded by the LUN target bitmap on the storage device side. This can further correct the bitmap deviation where the LUN target bitmap can only record whether a logical block has stored data, but cannot identify whether the data in the storage block has been deleted after storage, i.e., whether it is valid data. This ensures the authenticity and accuracy of the data storage status of each logical block recorded by the LUN target bitmap on the storage device side, thereby effectively improving the statistical accuracy of LUN storage space usage, avoiding problems such as false alarms or alarms that should have been triggered but were not, and thus improving the accuracy and reliability of storage space monitoring, ensuring the normal operation of business.
Smart Images

Figure CN122412246B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of storage technology, and in particular to storage space monitoring methods, devices and electronic devices. Background Technology
[0002] With the rapid development of big data technology, the amount of data generated by various businesses continues to grow. This data is typically stored in dedicated storage devices such as storage servers. To ensure the normal operation of these businesses, it is necessary to accurately monitor the storage space usage of Logical Unit Numbers (LUNs) on the storage devices, and to promptly identify and address issues affecting business operations, such as insufficient space.
[0003] Currently, in practical applications, the space utilization of a LUN is typically calculated using an LBA address-PBA address mapping table corresponding to the LUN on the storage device side. When the LUN's space utilization reaches a preset alarm threshold, an insufficient space alarm is triggered to prompt administrators to manually expand the capacity, ensuring normal business operation. Here, LBA is an abbreviation for Logical Block Address, and PBA is an abbreviation for Physical Block Address.
[0004] However, the LBA address-PBA address mapping table mentioned above can only record the address occupancy of data that has been written to the LUN. For data that has been written and then deleted, the storage device cannot detect and update the LBA address-PBA address mapping table. This can easily lead to distortion in the calculation of the space utilization of the LUN, reduce the accuracy and reliability of storage space monitoring, and cause problems such as false alarms or alarms that should be triggered but are not triggered, thus affecting the normal operation of the business. Summary of the Invention
[0005] In view of this, this application provides a storage space monitoring method, apparatus, and electronic device to improve the accuracy and reliability of storage space monitoring.
[0006] This application provides a storage space monitoring method, which is applied to a storage device, and the method includes: When the usage of any LUN is detected to meet the set requirements, the local LUN target bitmap corresponding to the LUN is locked; the LUN target bitmap records whether each logical block in the LUN stores data; Create a new temporary bitmap for the LUN, so that when the LUN target bitmap is locked, the temporary bitmap can be used to record the data storage status of each logical block in the LUN. The LUN target bitmap is sent to the server so that the server adjusts the LUN target bitmap based on the data currently stored in each logical block of the LUN. The system receives the adjusted LUN target bitmap returned by the server, updates the local LUN target bitmap based on the adjusted LUN target bitmap and the data storage status of each logical block in the LUN recorded in the LUN temporary bitmap, and monitors the LUN based on the local LUN target bitmap to monitor whether the LUN is running out of space.
[0007] This application embodiment also provides a storage space monitoring method, which is applied to a server, and the method includes: Receive a LUN target bitmap of any LUN sent by the storage device; the LUN target bitmap records whether each logical block in the LUN stores data; The LUN target bitmap is adjusted based on the data currently stored in each logical block of the LUN, and the adjusted LUN target bitmap is returned to the storage device. The storage device updates its local LUN target bitmap based on the received adjusted LUN target bitmap and the data storage status of each logical block in the LUN recorded in the LUN temporary bitmap, and monitors the LUN based on the local LUN target bitmap to monitor whether the LUN is running out of space. The LUN temporary bitmap is created by the storage device after locking the local LUN target bitmap corresponding to the LUN when it detects that the usage of the LUN meets the set requirements. This temporary bitmap is used to record the data storage status of each logical block in the LUN when the LUN target bitmap is locked. The LUN target bitmap is sent to the server by the storage device after creating the temporary bitmap.
[0008] This application embodiment also provides a storage space monitoring device, which is applied to a storage device, and the device includes: The locking module is used to lock the local LUN target bitmap corresponding to any LUN when the usage of any LUN is detected to meet the set requirements; the LUN target bitmap records whether each logical block in the LUN stores data. A new module is created to create a temporary bitmap for the LUN corresponding to the LUN, so that when the LUN target bitmap is locked, the temporary bitmap can be used to record the data storage status of each logical block in the LUN. A sending module is used to send the LUN target bitmap to a server so that the server can adjust the LUN target bitmap based on the data currently stored in each logical block of the LUN. The monitoring module is used to receive the adjusted LUN target bitmap returned by the server, update the local LUN target bitmap based on the adjusted LUN target bitmap and the data storage status of each logical block in the LUN recorded in the LUN temporary bitmap, and monitor the LUN based on the local LUN target bitmap to monitor whether the LUN is running out of space.
[0009] This application embodiment also provides another storage space monitoring device, which is applied to a server, and the device includes: The receiving module is used to receive the LUN target bitmap of any LUN sent by the storage device; the LUN target bitmap records whether each logical block in the LUN stores data; An adjustment module is used to adjust the LUN target bitmap based on the data currently stored in each logical block of the LUN, and return the adjusted LUN target bitmap to the storage device. This allows the storage device to update its local LUN target bitmap based on the received adjusted LUN target bitmap and the data storage status of each logical block in the LUN recorded in the LUN temporary bitmap. The storage device also monitors the LUN based on its local LUN target bitmap to check if the LUN is experiencing insufficient space. The LUN temporary bitmap is created by the storage device after locking the local LUN target bitmap corresponding to the LUN when it detects that the usage of the LUN meets the set requirements. This temporary bitmap is used to record the data storage status of each logical block in the LUN when the LUN target bitmap is locked. The LUN target bitmap is sent to the server by the storage device after creating the temporary bitmap.
[0010] This application also provides an electronic device, which includes: Processor; and A computer-readable storage medium storing computer program instructions that, when executed by a processor, cause the processor to perform the steps of the method described above.
[0011] This application also provides a computer-readable storage medium storing computer program instructions that, when executed by a processor, cause the processor to perform the steps in the above method.
[0012] As can be seen from the above technical solutions, in this embodiment of the application, by adding a LUN target bitmap on the storage device side to record whether each logical block in the LUN stores data, and cooperating with the client server associated with the storage device, the server's ability to perceive the actual data storage status of each logical block in the LUN is utilized to adjust the data storage status of each logical block recorded by the LUN target bitmap on the storage device side. This can further correct the bitmap deviation where the LUN target bitmap can only record whether a logical block has stored data, but cannot identify whether the data in the storage block has been deleted after storage, i.e., whether it is valid data. This ensures the authenticity and accuracy of the data storage status of each logical block recorded by the LUN target bitmap on the storage device side, thereby effectively improving the statistical accuracy of LUN storage space usage, avoiding problems such as false alarms or alarms that should have been triggered but were not, and thus improving the accuracy and reliability of storage space monitoring, ensuring the normal operation of business.
[0013] Furthermore, in this embodiment, by locking the local LUN target bitmap before updating it, interference from new write I / O operations during the bitmap update process can be avoided. Additionally, a new temporary LUN bitmap is created specifically to record the data storage status of each logical block in the LUN caused by new write I / O operations while the LUN target bitmap is locked. This ensures complete retention of the data storage status of new write I / O operations during the LUN target bitmap lock period. Based on this, combined with updating the local LUN target bitmap using the temporary LUN bitmap, the continuity and integrity of LUN storage space usage records can be effectively guaranteed, thereby further improving the statistical accuracy of LUN storage space usage. Attached Figure Description
[0014] Figure 1 This is a flowchart illustrating a storage space monitoring method provided in an embodiment of this application.
[0015] Figure 2 This is a schematic diagram illustrating the implementation of a bitmap provided in an embodiment of this application.
[0016] Figure 3 This is a flowchart illustrating another storage space monitoring method provided in an embodiment of this application.
[0017] Figure 4 This is a schematic diagram of a storage space monitoring device provided in an embodiment of this application.
[0018] Figure 5 This is a schematic diagram of another storage space monitoring device provided in an embodiment of this application.
[0019] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0020] In this embodiment, the storage device may include at least one LUN. The storage space of the LUN can refer to an independent and usable storage space created based on a Redundant Arrays of Independent Disks (RAID). To avoid insufficient available storage space of the LUN affecting the normal operation of services, it is usually necessary to monitor the space usage of the LUN and issue an alarm in a timely manner when insufficient available storage space of the LUN is detected, so as to prompt relevant administrators to manually expand the capacity in a timely manner. Currently, as described above, the accuracy and reliability of traditional storage space monitoring methods are low, which can easily lead to problems such as false alarms or alarms that should be triggered but are not triggered. This can result in situations such as untimely capacity expansion leading to full disk space, which in turn affects the normal operation of services, such as causing service interruptions.
[0021] Therefore, to address the aforementioned problems, this application proposes a storage space monitoring method. To make the method provided by this application easier to understand, the method will be described in detail below with reference to the accompanying drawings and embodiments.
[0022] See Figure 1 , Figure 1 This is a flowchart illustrating a method provided in an embodiment of this application. In this embodiment, the method can be applied to a storage device; optionally, the storage device can be a storage server or similar device, and is not specifically limited here.
[0023] like Figure 1 As shown, the process may include the following steps: Step 101: When the usage of any LUN is detected to meet the set requirements, lock the local LUN target bitmap corresponding to the LUN; the LUN target bitmap records whether each logical block in the LUN stores data.
[0024] In this embodiment, the storage space usage of each LUN in the storage device can be periodically detected. When the usage of any LUN meets the set requirements, the local LUN target bitmap corresponding to the LUN is locked for subsequent LUN target bitmap updates.
[0025] Optionally, in this embodiment, the space usage of a LUN can be characterized by its space utilization rate or its remaining space. Based on this, for any LUN to meet the set requirements, its space utilization rate can reach a preset utilization rate threshold, or its remaining space is less than or equal to a preset space threshold. The specific settings for the preset utilization rate threshold and the preset space threshold are not limited here.
[0026] The space utilization rate of the LUN can be determined, for example, based on the number of logical blocks storing data in the LUN and the total number of logical blocks recorded in the LUN target bitmap. Specifically, the ratio of the number of logical blocks storing data in the LUN to the total number of logical blocks recorded in the LUN target bitmap can be used as the space utilization rate of the LUN.
[0027] The remaining space of the LUN can be determined, for example, based on the number and size of the logical blocks in the LUN that do not store data, as recorded in the LUN target bitmap. Specifically, the remaining space of the LUN can be the product of the number and size of the logical blocks in the LUN, as recorded in the LUN target bitmap.
[0028] In this embodiment, the aforementioned logical block can refer to a subspace obtained by dividing the storage space of a LUN. Each subspace corresponding to any LUN has the same size, meaning that each logical block within any LUN has the same size.
[0029] Optionally, in this embodiment, each bit in the LUN target bitmap corresponding to any LUN corresponds one-to-one with each logical block in the LUN, and different bits correspond to different logical blocks. Each bit in the LUN target bitmap is used to mark whether the logical block corresponding to that bit is used (i.e., whether data is stored). For example, for any bit in the LUN target bitmap, when the value of that bit is a first value such as 1, it indicates that the logical block corresponding to that bit stores data (i.e., data has been written to it), and when the value of that bit is a second value such as 0, it indicates that the logical block corresponding to that bit does not store data (i.e., data has not been written to it). Initially, the value of each bit in the LUN target bitmap is the second value.
[0030] For example, see Figure 2 The LUN target bitmap shown includes N bits, meaning the LUN is divided into N logical blocks, where N is greater than 1. Assuming the size of a logical block is 16KB, the first bit in the LUN target bitmap corresponds to the first 16KB block of the LUN starting from the start address, the second bit corresponds to the second 16KB block of the LUN starting from the start address, and so on, with the Nth bit in the LUN target bitmap corresponding to the Nth 16KB block of the LUN starting from the start address.
[0031] Step 102: Create a new temporary bitmap for the LUN corresponding to the LUN, so that when the target bitmap of the LUN is locked, the temporary bitmap can be used to record the data storage of each logical block in the LUN.
[0032] In this embodiment, the LUN temporary bitmap is similar to the LUN target bitmap described above. The number of bits in the LUN temporary bitmap is the same as the number of bits in the LUN target bitmap, and each bit in the LUN temporary bitmap corresponds one-to-one with each logical block in the LUN. For other related descriptions of the LUN temporary bitmap, please refer to the related descriptions of LUN usage bitmaps described above, which will not be repeated here.
[0033] In this embodiment, any write IO request received by the storage device may include a LUN identifier, and the LUN targeted by the write IO request can be determined based on the LUN identifier.
[0034] Based on this, as an example, when a write input / output (IO) request is received for the LUN, the target logical block to which the data to be written indicated by the write IO request in the LUN is to be written is first determined.
[0035] If the LUN target bitmap corresponding to the current LUN is not locked, then the value of the bit corresponding to the target logic block in the LUN target bitmap is adjusted to the first value.
[0036] If the LUN target bitmap corresponding to the current LUN is locked, then the value of the bit corresponding to the target logic block in the LUN temporary bitmap corresponding to the LUN is adjusted to the first value.
[0037] Optionally, in this embodiment, the target logical block to which the write IO request indicates the write data to be written in the LUN can be, for example, determined as follows: First, based on the length of the data to be written indicated by the write IO request and the starting LBA to which the data to be written is to be written, the target address segment to which the data to be written is to be written in the storage space of the LUN is determined; then, based on the address segments corresponding to each logical block in the LUN, at least one logical block that matches the target address segment is determined as the target logical block.
[0038] Specifically, based on the address ranges corresponding to each logical block in the LUN, at least one logical block that matches the target address range can be a logical block whose corresponding address range is partially or entirely contained within the target address range.
[0039] For example, assuming that the address ranges corresponding to each logical block in the LUN are 0-1, 1-2, 2-3, ..., and so on, and the target address range is 1.5-2.5, then address ranges 1-2 and 2-3 are partially included in the target address range. At this time, the logical blocks corresponding to address ranges 1-2 and 2-3 are the second and third logical blocks, which are the target logical blocks that match the target address range.
[0040] Step 103: Send the above LUN target bitmap to the server so that the server can adjust the LUN target bitmap based on the data currently stored in each logical block of the LUN.
[0041] In this embodiment, the server can refer to the client server associated with the LUN (or the front-end application server), that is, the storage space of the LUN in the storage device is provided to the client server to store the corresponding business data. For example, the mapping relationship between each LUN and the client server can be pre-configured on the storage device side to determine the client server associated with each LUN based on the mapping relationship.
[0042] The server can perceive the actual data storage status of each logical block in the LUN. Therefore, in this embodiment, when the usage of any LUN meets the set requirements, it does not directly calculate the storage space usage of the LUN, such as space utilization or remaining space, based on the LUN target bitmap of the LUN in the local machine. Instead, it sends the LUN target bitmap of the LUN in the local machine to the server, so as to adjust the LUN target bitmap with the help of the actual data storage status of each logical block in the LUN perceived by the server. That is, the server adjusts the LUN target bitmap based on the data currently stored in each logical block in the LUN, thereby improving the statistical accuracy of LUN storage space usage.
[0043] As for how the server adjusts the target bitmap of the LUN based on the data currently stored in each logical block of the LUN, an example will be given below, and will not be elaborated here.
[0044] Step 104: Receive the adjusted LUN target bitmap returned by the server. Based on the adjusted LUN target bitmap and the data storage status of each logical block in the LUN recorded in the LUN temporary bitmap, update the local LUN target bitmap and monitor the LUN based on the local LUN target bitmap to monitor whether the LUN is running out of space.
[0045] In this embodiment, as one example, updating the local LUN target bitmap based on the adjusted LUN target bitmap and the data storage information of each logical block in the LUN recorded in the LUN temporary bitmap can, in specific implementations, include, for example, the following: First, iterate through each bit in the local LUN target bitmap that has the first value. Then, update the value of the bit that was iterated through according to the value of the corresponding bit in the adjusted LUN target bitmap. For example, update the value of the bit that was iterated through to the value of the corresponding bit in the adjusted LUN target bitmap.
[0046] Next, unlock the local LUN target bitmap and iterate through each bit in the aforementioned LUN temporary bitmap that has the first value. Update the value of the bit in the local LUN target bitmap corresponding to the iterated bit according to the value of the iterated bit. For example, update the value of the bit in the local LUN target bitmap corresponding to the iterated bit to the value of the iterated bit.
[0047] Furthermore, in this embodiment, after updating the local LUN target bitmap, the aforementioned LUN temporary bitmap is deleted.
[0048] In this embodiment, as one example, the above-mentioned monitoring of the LUN based on the local LUN target bitmap can be implemented as follows: First, determine the space usage of the LUN, such as the space utilization rate or remaining space, based on the local LUN target bitmap; then, if the space utilization rate of the LUN reaches a first alarm threshold, such as 80% or 90%, or if the remaining space of the LUN is less than or equal to a second alarm threshold, such as 50GB or 100GB, it is determined that the LUN is experiencing insufficient space. At this time, an alarm can be issued to prompt relevant administrators to expand the capacity of the LUN.
[0049] This concludes the process. Figure 1 The process is shown below.
[0050] pass Figure 1 As can be seen from the process shown, in this embodiment of the application, by adding a LUN target bitmap on the storage device side to record whether each logical block in the LUN stores data, and cooperating with the client server associated with the storage device, the server's ability to perceive the actual data storage status of each logical block in the LUN is used to adjust the data storage status of each logical block recorded by the LUN target bitmap on the storage device side. This can further correct the bitmap deviation where the LUN target bitmap can only record whether a logical block has stored data, but cannot identify whether the data in the storage block has been deleted after storage, i.e., whether it is valid data. This ensures the authenticity and accuracy of the data storage status of each logical block recorded by the LUN target bitmap on the storage device side, thereby effectively improving the statistical accuracy of LUN storage space usage, avoiding existing problems such as false alarms or alarms that should have been triggered but were not, and thus improving the accuracy and reliability of storage space monitoring, ensuring the normal operation of business.
[0051] Furthermore, in this embodiment, by locking the local LUN target bitmap before updating it, interference from new write I / O operations during the bitmap update process can be avoided. Additionally, a new temporary LUN bitmap is created specifically to record the data storage status of each logical block in the LUN caused by new write I / O operations while the LUN target bitmap is locked. This ensures complete retention of the data storage status of new write I / O operations during the LUN target bitmap lock period. Based on this, combined with updating the local LUN target bitmap using the temporary LUN bitmap, the continuity and integrity of LUN storage space usage records can be effectively guaranteed, thereby further improving the statistical accuracy of LUN storage space usage.
[0052] The storage space monitoring method provided in this application embodiment is described below from the server's perspective: See Figure 3 , Figure 3 This is a flowchart illustrating another storage space monitoring method provided in an embodiment of this application. In this embodiment, the method can be applied to a server, which can be a front-end application server (i.e., the aforementioned client server). Figure 3 As shown, the process may include the following steps: Step 301: Receive the LUN target bitmap of any LUN sent by the storage device; the LUN target bitmap records whether each logical block in the LUN stores data.
[0053] Step 302: Adjust the LUN target bitmap based on the data currently stored in each logical block of the LUN, and return the adjusted LUN target bitmap to the storage device. This allows the storage device to update its local LUN target bitmap based on the received adjusted LUN target bitmap and the data storage status of each logical block in the LUN recorded in the LUN temporary bitmap. The storage device also monitors the LUN based on its local LUN target bitmap to check for insufficient space.
[0054] In this embodiment, the LUN temporary bitmap is created by the storage device after locking the local LUN target bitmap corresponding to the LUN when it detects that the usage of the LUN meets the set requirements. This temporary bitmap is used to record the data storage status of each logical block in the LUN while the local LUN target bitmap is locked. The LUN target bitmap is sent to the server by the storage device after creating the temporary bitmap. The specific implementation of the steps performed on the storage device side can be found above. Figure 1 The relevant descriptions of the process shown will not be repeated here.
[0055] In this embodiment, as one example, the above-mentioned adjustment of the LUN target bitmap based on the data currently stored in each logical block of the LUN may, in specific implementation, include: Iterate through each bit in the LUN target bitmap with the first value, and check if the logical block corresponding to the bit being iterated over currently stores data. If it does, continue to maintain the first value of the bit being iterated over; otherwise, adjust the value of the bit being iterated over to the second value.
[0056] In this LUN target bitmap, each bit corresponds one-to-one with each logical block in the LUN, and different bits correspond to different logical blocks. For any bit in the LUN target bitmap, when the value of the bit is the first value, it means that the logical block corresponding to the bit stores data; when the value of the bit is the second value, it means that the logical block corresponding to the bit does not store data.
[0057] This concludes the process. Figure 3 The process is shown below.
[0058] pass Figure 3 As can be seen from the process shown, in this embodiment of the application, by adding a LUN target bitmap on the storage device side to record whether each logical block in the LUN stores data, and cooperating with the client server associated with the storage device, the server's ability to perceive the actual data storage status of each logical block in the LUN is used to adjust the data storage status of each logical block recorded by the LUN target bitmap on the storage device side. This can further correct the bitmap deviation where the LUN target bitmap can only record whether a logical block has stored data, but cannot identify whether the data in the storage block has been deleted after storage, i.e., whether it is valid data. This ensures the authenticity and accuracy of the data storage status of each logical block recorded by the LUN target bitmap on the storage device side, thereby effectively improving the statistical accuracy of LUN storage space usage, avoiding existing problems such as false alarms or alarms that should have been triggered but were not, and thus improving the accuracy and reliability of storage space monitoring, ensuring the normal operation of business.
[0059] Furthermore, in this embodiment, by locking the local LUN target bitmap before updating it, interference from new write I / O operations during the bitmap update process can be avoided. Additionally, a new temporary LUN bitmap is created specifically to record the data storage status of each logical block in the LUN caused by new write I / O operations while the LUN target bitmap is locked. This ensures complete retention of the data storage status of new write I / O operations during the LUN target bitmap lock period. Based on this, combined with updating the local LUN target bitmap using the temporary LUN bitmap, the continuity and integrity of LUN storage space usage records can be effectively guaranteed, thereby further improving the statistical accuracy of LUN storage space usage.
[0060] To facilitate understanding of the specific implementation process of the above storage space monitoring method, specific embodiments are described below.
[0061] In this embodiment, as an example, the specific implementation process of the above-mentioned storage space monitoring method is as follows: First, on the storage device side: When a storage device creates a LUN, it creates a corresponding LUN target bitmap. This LUN target bitmap records whether each logical block in the LUN stores data. Initially, the value of each bit in the LUN target bitmap is the second value, such as 0, indicating that no data is stored in the logical block corresponding to that bit. When the value of a bit in the LUN target bitmap is the first value, such as 1, it indicates that data is stored in the logical block corresponding to that bit.
[0062] The storage device periodically monitors the space usage of each LUN, such as space utilization or remaining space. Specifically, the space utilization of each LUN is calculated as the number of bits with a value of 1 in the LUN target bitmap of that LUN divided by the total number of bits; the remaining space of each LUN is calculated as the number of bits with a value of 1 in the LUN target bitmap of that LUN multiplied by the size of the logical block.
[0063] When a storage device detects that the space utilization rate of any LUN has reached a preset utilization threshold, such as 85% or 90%, or that the remaining space of the LUN is less than or equal to a preset space threshold, such as 60GB or 80GB: First, the storage device locks the LUN target bitmap corresponding to the LUN and creates a temporary LUN bitmap for that LUN. This temporary bitmap is used to record the data storage status of each logical block in the LUN while the target bitmap is locked. Then, a check notification is sent to the server associated with the LUN. This notification includes at least the storage device's IP address, the LUN WWN, the size of the logical blocks in the LUN, and the LUN usage bitmap (denoted as the first bitmap).
[0064] In this context, IP stands for Internet Protocol; the IP address of the storage device is used for communication between the storage device and the server. WWN stands for World Wide Name; the LUN WWN is used to uniquely identify the LUN so that the server can accurately identify the LUN. The size of the logical block is used by the server to obtain the correspondence between each logical block in the LUN and the LUN target bitmap.
[0065] When a storage device receives a write I / O request for a LUN, it first determines the target address segment in the storage space of the LUN to be written, based on the length of the data to be written indicated by the write I / O request and the starting LBA to which the data to be written is to be written. Then, based on the address segments corresponding to each logical block in the LUN, it determines at least one logical block that matches the target address segment, serving as the target logical block for the data to be written in the LUN. Subsequently, if the LUN target bitmap corresponding to the current LUN is not locked, the value of the bit corresponding to the target logical block in the LUN target bitmap is adjusted to a first value; if the LUN target bitmap corresponding to the current LUN is locked, the value of the bit corresponding to the target logical block in the LUN temporary bitmap corresponding to the current LUN is adjusted to the first value.
[0066] Then, on the server side: After receiving the check notification from the storage device, the server will locate the corresponding LUN based on the LUN WWN indicated in the check notification, and check one by one, based on the logical block size indicated in the check notification, whether the logical block corresponding to the bit with a value of 1 in the first bit of the LUN target bitmap indicated in the check notification stores data, so as to adjust the LUN target bitmap. For example, if yes, the value of the bit in the LUN target bitmap is maintained at 1; if no, the value of the bit in the LUN target bitmap is updated from 1 to 0.
[0067] After completing the above operations, the server will send a check completion notification to the storage device. This check completion notification will at least contain the LUN WWN and the adjusted LUN target bitmap (denoted as the second bitmap).
[0068] Optionally, in this embodiment, the server can determine whether data is stored in each logical block of the LUN based on the local file system. As for how to determine this based on the local file system, this embodiment does not specifically limit it, but can refer to the specific implementation in related technologies.
[0069] Then, on the storage device side: After receiving the check completion notification from the server, the storage device updates its local first bit map according to the second bit map carried in the check completion notification. Specifically, it checks each bit with a value of 1 in the first bit map one by one. If the value of the corresponding bit in the second bit map is 1, the value of the bit in the first bit map is maintained at 1. If the value of the corresponding bit in the second bit map is 0, the value of the bit in the first bit map is updated from 1 to 0.
[0070] After updating its local first bitmap, the storage device unlocks the first bitmap and merges the LUN temporary bitmap of the LUN into it. Specifically, it checks each bit with a value of 1 in the LUN temporary bitmap of the LUN and updates the value of the corresponding bit in the first bitmap from 0 to 1. Then, the storage device deletes the LUN temporary bitmap of the LUN.
[0071] Based on this, the storage device recalculates the space utilization or remaining space of the LUN based on the local first-order graph. If the space utilization of the LUN reaches the first alarm threshold, such as 80% or 90%, or if the remaining space of the LUN is less than or equal to the second alarm threshold, such as 50GB or 100GB, it is determined that the LUN is experiencing insufficient space. At this time, an alarm can be triggered to prompt relevant administrators to expand the capacity of the LUN, thereby avoiding affecting the normal operation of the business.
[0072] This concludes the description of the method provided in the embodiments of this application. The apparatus provided in the embodiments of this application will now be described: As an example, this embodiment also provides a storage space monitoring device, which corresponds to... Figure 1 The process is shown below. For example, see [link to relevant documentation]. Figure 4 As shown, the storage space monitoring device 400 is applied to a storage device, and the storage space monitoring device 400 includes: The locking module 401 is used to lock the local LUN target bitmap corresponding to the LUN when the usage of any LUN is detected to meet the set requirements; the LUN target bitmap records whether each logical block in the LUN stores data. A new module 402 is used to create a temporary bitmap of the LUN corresponding to the LUN, so as to record the data storage status of each logical block in the LUN when the LUN target bitmap is locked. Sending module 403 is used to send the LUN target bitmap to the server so that the server can adjust the LUN target bitmap based on the data currently stored in each logical block of the LUN; The monitoring module 404 is used to receive the adjusted LUN target bitmap returned by the server, update the local LUN target bitmap based on the adjusted LUN target bitmap and the data storage status of each logical block in the LUN recorded in the LUN temporary bitmap, and monitor the LUN based on the local LUN target bitmap to monitor whether the LUN is running out of space.
[0073] As an example, the usage of any LUN meets the set requirements when the space utilization rate of the LUN reaches a preset utilization rate threshold, or the remaining space of the LUN is less than or equal to a preset space threshold. The space utilization rate of the LUN is determined based on the number of logical blocks storing data in the LUN and the total number of logical blocks as recorded in the LUN target bitmap; the remaining space of the LUN is determined based on the number of logical blocks without stored data in the LUN and the size of the logical blocks as recorded in the LUN target bitmap.
[0074] As an example, each bit in the LUN target bitmap or the LUN temporary bitmap corresponds one-to-one with each logical block in the LUN, and different bits correspond to different logical blocks; For any bit in the LUN target bitmap or the LUN temporary bitmap, if the value of the bit is the first value, it means that the logical block corresponding to the bit stores data; if the value of the bit is the second value, it means that the logical block corresponding to the bit does not store data.
[0075] As one embodiment, the device further includes: The determination module is used to determine the target logic block in the LUN to which the data to be written indicated by the write I / O request is to be written when a write I / O request for the LUN is received. The update module is used to adjust the value of the bit corresponding to the target logic block in the LUN target bitmap to the first value if the LUN target bitmap corresponding to the current LUN is not locked. If the LUN target bitmap corresponding to the current LUN is locked, then the value of the bit corresponding to the target logic block in the LUN temporary bitmap corresponding to the LUN is adjusted to the first value.
[0076] As one embodiment, updating the local LUN target bitmap based on the adjusted LUN target bitmap and the data storage information of each logical block in the LUN recorded in the LUN temporary bitmap includes: Iterate through each bit in the local LUN target bitmap that has the first value, and update the value of the bit that has been iterated over according to the value of the bit corresponding to the bit in the adjusted LUN target bitmap. Unlock the local LUN target bitmap and iterate through each bit in the LUN temporary bitmap that has a value of the first value, so as to update the value of the bit in the local LUN target bitmap corresponding to the iterated bit according to the value of the iterated bit.
[0077] The device further includes a deletion module for deleting the LUN temporary bitmap after updating the local LUN target bitmap.
[0078] This concludes the process. Figure 4 Structural description of the device shown.
[0079] As an example, this embodiment also provides a storage space monitoring device, which corresponds to... Figure 3 The process is shown below. For example, see [link to relevant documentation]. Figure 5 As shown, the storage space monitoring device 500 is applied to a server, and the storage space monitoring device 500 includes: The receiving module 501 is used to receive the LUN target bitmap of any LUN sent by the storage device; the LUN target bitmap records whether each logical block in the LUN stores data; The adjustment module 502 is used to adjust the LUN target bitmap based on the data currently stored in each logical block of the LUN, and return the adjusted LUN target bitmap to the storage device, so that the storage device updates its local LUN target bitmap based on the received adjusted LUN target bitmap and the data storage status of each logical block in the LUN recorded in the LUN temporary bitmap, and monitors the LUN based on the local LUN target bitmap to monitor whether the LUN is running out of space; The LUN temporary bitmap is created by the storage device after locking the local LUN target bitmap corresponding to the LUN when it detects that the usage of the LUN meets the set requirements. This temporary bitmap is used to record the data storage status of each logical block in the LUN when the LUN target bitmap is locked. The LUN target bitmap is sent to the server by the storage device after creating the temporary bitmap.
[0080] As one embodiment, adjusting the LUN target bitmap based on the data currently stored in each logical block of the LUN includes: Iterate through each bit in the LUN target bitmap with a value of the first value, and check whether the logical block corresponding to the traversed bit currently stores data. If so, continue to maintain the value of the traversed bit as the first value; otherwise, adjust the value of the traversed bit to the second value. In this LUN target bitmap, each bit corresponds one-to-one with each logical block in the LUN, and different bits correspond to different logical blocks. For any bit in the LUN target bitmap, when the value of the bit is the first value, it means that the logical block corresponding to the bit stores data, and when the value of the bit is the second value, it means that the logical block corresponding to the bit does not store data.
[0081] This concludes the process. Figure 5 Structural description of the device shown.
[0082] The specific implementation process of the functions and roles of each module in the above device can be found in the implementation process of the corresponding steps in the above method, and will not be repeated here.
[0083] Please see Figure 6 This is a schematic diagram of the hardware structure of an electronic device provided as an exemplary embodiment of this application. The electronic device includes a processor and a computer-readable storage medium; the computer-readable storage medium stores a plurality of computer program instructions, which, when executed by the processor, implement the method disclosed in the above example of this application. Depending on the actual function of the electronic device, other hardware may also be included, which will not be elaborated further.
[0084] Based on the same concept as the above method, this application also provides a computer-readable storage medium storing a plurality of computer program instructions, which, when executed by a processor, can implement the method disclosed in the above examples of this application.
[0085] For example, the aforementioned computer-readable storage medium can be any electronic, magnetic, optical, or other physical storage device that can contain or store information such as executable instructions, messages, etc. For instance, computer-readable storage media can be: RAM (Random Access Memory), volatile memory, non-volatile memory, flash memory, storage drives (such as hard disk drives), solid-state drives, any type of storage disk (such as optical discs, DVDs, etc.), or similar storage media, or combinations thereof.
[0086] The above are merely preferred embodiments of this application and are not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.
Claims
1. A method for monitoring storage space, characterized in that, This method is applied to a storage device, and the method includes: When the usage of any logical unit number (LUN) meets the set requirements, the local LUN target bitmap corresponding to the LUN is locked; the LUN target bitmap records whether each logical block in the LUN stores data; while the target bitmap is locked, write IO requests for the LUN do not change the target bitmap. Create a new temporary bitmap for the LUN, so that when the LUN target bitmap is locked, the temporary bitmap can be used to record the data storage status of each logical block in the LUN. The LUN target bitmap is sent to the server so that the server adjusts the LUN target bitmap based on the data currently stored in each logical block of the LUN. The system receives the adjusted LUN target bitmap returned by the server, updates the local LUN target bitmap based on the adjusted LUN target bitmap and the data storage status of each logical block in the LUN recorded in the LUN temporary bitmap, and monitors the LUN based on the local LUN target bitmap to monitor whether the LUN is running out of space.
2. The method according to claim 1, characterized in that, The usage of any LUN meets the set requirements when the space utilization rate of the LUN reaches a preset utilization rate threshold, or the remaining space of the LUN is less than or equal to a preset space threshold. The space utilization rate of the LUN is determined based on the number of logical blocks storing data in the LUN and the total number of logical blocks as recorded in the LUN target bitmap; the remaining space of the LUN is determined based on the number of logical blocks without stored data in the LUN and the size of the logical blocks as recorded in the LUN target bitmap.
3. The method according to claim 1, characterized in that, Each bit in the LUN target bitmap or the LUN temporary bitmap corresponds one-to-one with each logical block in the LUN, and different bits correspond to different logical blocks. For any bit in the LUN target bitmap or the LUN temporary bitmap, if the value of the bit is the first value, it means that the logical block corresponding to the bit stores data; if the value of the bit is the second value, it means that the logical block corresponding to the bit does not store data.
4. The method according to claim 3, characterized in that, The method further includes: When a write IO request is received for the LUN, the target logical block in the LUN to which the data to be written indicated by the write IO request is to be written is determined. If the LUN target bitmap corresponding to the current LUN is not locked, then the value of the bit corresponding to the target logic block in the LUN target bitmap is adjusted to the first value; If the LUN target bitmap corresponding to the current LUN is locked, then the value of the bit corresponding to the target logic block in the LUN temporary bitmap corresponding to the LUN is adjusted to the first value.
5. The method according to claim 3, characterized in that, The process of updating the local LUN target bitmap based on the adjusted LUN target bitmap and the data storage information of each logical block in the LUN recorded in the LUN temporary bitmap includes: Iterate through each bit in the local LUN target bitmap that has the first value, and update the value of the bit that has been iterated over according to the value of the bit corresponding to the bit in the adjusted LUN target bitmap. Unlock the local LUN target bitmap and iterate through each bit in the LUN temporary bitmap that has the first value, so as to update the value of the bit in the local LUN target bitmap corresponding to the traversed bit according to the value of the traversed bit. The method further includes: deleting the LUN temporary bitmap after updating the local LUN target bitmap.
6. A method for monitoring storage space, characterized in that, This method is applied to a server, and the method includes: Receive a LUN target bitmap for any logical unit number (LUN) sent by the storage device; the LUN target bitmap records whether each logical block in the LUN stores data; The LUN target bitmap is adjusted based on the data currently stored in each logical block of the LUN, and the adjusted LUN target bitmap is returned to the storage device. The storage device updates its local LUN target bitmap based on the received adjusted LUN target bitmap and the data storage status of each logical block in the LUN recorded in the LUN temporary bitmap, and monitors the LUN based on the local LUN target bitmap to monitor whether the LUN is running out of space. The LUN temporary bitmap is created by the storage device after locking the local LUN target bitmap corresponding to the LUN when it detects that the usage of the LUN meets the set requirements. This temporary bitmap is used to record the data storage status of each logical block in the LUN when the target bitmap is locked. The LUN target bitmap is sent to the server by the storage device after it is created. During the period when the target bitmap is locked, write IO requests for the LUN do not change the target bitmap.
7. The method according to claim 6, characterized in that, The step of adjusting the LUN target bitmap based on the data currently stored in each logical block of the LUN includes: Iterate through each bit in the LUN target bitmap with a value of the first value, and check whether the logical block corresponding to the traversed bit currently stores data. If so, continue to maintain the value of the traversed bit as the first value; otherwise, adjust the value of the traversed bit to the second value. In this LUN target bitmap, each bit corresponds one-to-one with each logical block in the LUN, and different bits correspond to different logical blocks. For any bit in the LUN target bitmap, when the value of the bit is the first value, it means that the logical block corresponding to the bit stores data, and when the value of the bit is the second value, it means that the logical block corresponding to the bit does not store data.
8. A storage space monitoring device, characterized in that, This device is used in a storage device and includes: The locking module is used to lock the local LUN target bitmap corresponding to any logical unit number LUN when the usage of any LUN meets the set requirements. The LUN target bitmap records whether each logical block in the LUN stores data. During the period when the target bitmap is locked, write IO requests for the LUN do not change the target bitmap. A new module is created to create a temporary bitmap for the LUN corresponding to the LUN, so that when the LUN target bitmap is locked, the temporary bitmap can be used to record the data storage status of each logical block in the LUN. A sending module is used to send the LUN target bitmap to a server so that the server can adjust the LUN target bitmap based on the data currently stored in each logical block of the LUN. The monitoring module is used to receive the adjusted LUN target bitmap returned by the server, update the local LUN target bitmap based on the adjusted LUN target bitmap and the data storage status of each logical block in the LUN recorded in the LUN temporary bitmap, and monitor the LUN based on the local LUN target bitmap to monitor whether the LUN is running out of space.
9. A storage space monitoring device, characterized in that, This device is used in servers and includes: The receiving module is used to receive a LUN target bitmap for any logical unit number (LUN) sent by the storage device; the LUN target bitmap records whether each logical block in the LUN stores data; An adjustment module is used to adjust the LUN target bitmap based on the data currently stored in each logical block of the LUN, and return the adjusted LUN target bitmap to the storage device. This allows the storage device to update its local LUN target bitmap based on the received adjusted LUN target bitmap and the data storage status of each logical block in the LUN recorded in the LUN temporary bitmap. The storage device also monitors the LUN based on its local LUN target bitmap to check if the LUN is experiencing insufficient space. The LUN temporary bitmap is created by the storage device after locking the local LUN target bitmap corresponding to the LUN when it detects that the usage of the LUN meets the set requirements. This temporary bitmap is used to record the data storage status of each logical block in the LUN when the target bitmap is locked. The LUN target bitmap is sent to the server by the storage device after it is created. During the period when the target bitmap is locked, write IO requests for the LUN do not change the target bitmap.
10. An electronic device, characterized in that, The electronic device includes: Processor; and A computer-readable storage medium storing computer program instructions that, when executed by the processor, cause the processor to perform the steps of the method of any one of claims 1 to 5 or 6 to 7.
Citation Information
Patent Citations
Data protection method and storage device
CN107329859A
Data replication method and device
CN114185712A