Method, electronic device and computer program product for compressing data
By dynamically adjusting the access and access thresholds of multiple storage areas in the storage space and selecting the target storage area for compression, the problem of frequent compression and decompression increases the burden on the system is solved, and efficient operation and performance balance of the storage system is achieved.
Patent Information
- Application Number
- CN202311414834.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-27
- Publication Date
- 2025-04-29
AI Technical Summary
In storage systems, frequent compression and decompression operations increase the system burden, especially when users need to access the compressed data multiple times, the time and operational costs of decompression, data block movement, recompression, and metadata update will increase significantly.
By determining the access level of multiple storage areas in the storage space and dynamically determining the access level threshold based on the usage of the storage space, selecting the target storage area in multiple storage areas, and compressing its multiple pages, thereby adjusting the number of merged compressed pages to adapt to the current usage of the storage system.
It realizes that while ensuring that the storage space meets the usage needs, it reduces the burden on the system, avoids unnecessary compression/decompression operations, and balances the capacity and overall performance of the storage system.
Smart Images

Figure CN119906432A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present disclosure relate to the field of data storage, and more particularly, to a method, an electronic device, and a computer program product for compressing data. Background Art
[0002] Compression is a widely used technology in the storage and data protection industry to reduce the allocated data. Usually, data is compressed independently by a single data block (for example, 4KB in size) during the flushing process. However, with the development of storage technology, the storage space provided is getting larger and larger, and the allocated data is also increasing. In response to this, a merging compression technology (Cumulative Compression) has been developed. In this technology, in order to obtain a better compression ratio, multiple data blocks will be merged and compressed together.
[0003] Usually, the data blocks to be merged are pages. After merging and compression, multiple pages are compressed into a new data block. At this time, if the compressed page is to be accessed again, the user needs to decompress the data block generated by compression, and then may need to perform data block movement, reorganization, recompression, and metadata update. Summary of the invention
[0004] Embodiments of the present disclosure provide a solution for compressing page data in a storage space.
[0005] In a first aspect of the present disclosure, a method for compressing data is provided. The method includes determining multiple access degrees of multiple storage areas in a storage space based on multiple input and output (IO) counts of multiple storage areas in a historical time period. The method also includes determining an access degree threshold based on the usage rate of the storage space. The method also includes selecting at least one target storage area from the multiple storage areas based on the multiple access degrees and the access degree threshold. The method also includes compressing multiple pages in the at least one target storage area.
[0006] In a second aspect of the present disclosure, an electronic device is provided. The electronic device includes a processor; and a memory coupled to the processor, the memory having instructions stored therein, which, when executed by the processor, cause the device to perform an action. The action includes determining multiple access degrees of multiple storage areas based on multiple input and output IO counts of multiple storage areas in the storage space within a historical time period. The action also includes determining an access degree threshold based on the utilization rate of the storage space. The action also includes selecting at least one target storage area among the multiple storage areas based on the multiple access degrees and the access degree threshold. The action also includes compressing multiple pages in at least one target storage area.
[0007] In a third aspect of the present disclosure, a computer program product is provided, which is tangibly stored on a computer-readable medium and includes machine executable instructions, which cause the machine to perform actions when executed. The actions include determining multiple access degrees of multiple storage areas in a storage space based on multiple input and output IO counts of the multiple storage areas in a historical time period. The actions also include determining an access degree threshold based on the usage rate of the storage space. The actions also include selecting at least one target storage area among the multiple storage areas based on the multiple access degrees and the access degree threshold. The actions also include compressing multiple pages in the at least one target storage area.
[0008] The Summary of the Invention storage area is provided to introduce a selection of concepts in a simplified form, which will be further described in the Detailed Description below. The Summary of the Invention storage area is not intended to identify key features or essential features of the present disclosure, nor is it intended to limit the scope of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] The above and other purposes, features and advantages of the present disclosure will become more apparent by describing the exemplary embodiments of the present disclosure in more detail in conjunction with the accompanying drawings, wherein the same reference numerals generally represent the same components in the exemplary embodiments of the present disclosure. In the accompanying drawings:
[0010] Figure 1 A schematic diagram showing a storage system in which embodiments of the present disclosure may be implemented;
[0011] Figure 2 A flowchart illustrating an example method for compressing data according to an embodiment of the present disclosure is shown;
[0012] Figure 3A-3B A flowchart showing an example method of determining access according to an embodiment of the present disclosure;
[0013] Figure 4 A schematic diagram showing historical IO count statistics according to some embodiments of the present disclosure is shown;
[0014] Figure 5 A flowchart showing an example method for determining a visit threshold according to an embodiment of the present disclosure is shown;
[0015] Figure 6 A schematic diagram showing an example mapping relationship according to an embodiment of the present disclosure; and
[0016] Figure 7 A block diagram of an example device that may be used to implement embodiments of the present disclosure is shown. DETAILED DESCRIPTION
[0017] The principles of the present disclosure will be described below with reference to several example embodiments shown in the accompanying drawings. Although preferred embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that these embodiments are described only to enable those skilled in the art to better understand and implement the present disclosure, and are not intended to limit the scope of the present disclosure in any way.
[0018] The term "including" and its variations used in this document represent open inclusion, that is, "including but not limited to". Unless otherwise stated, the term "or" means "and / or". The term "based on" means "based on at least the storage area". The terms "an example embodiment" and "an embodiment" mean "at least one example embodiment". The term "another embodiment" means "at least one other embodiment". The terms "first", "second", etc. may refer to different or the same objects. Other explicit and implicit definitions may also be included below.
[0019] As discussed above, when a user wants to read the merged and compressed data, the compressed data block needs to be decompressed again. If the user needs to access the compressed data multiple times in a short period of time, the time and operation cost of decompression, data block movement, reorganization, recompression and metadata update will increase exponentially. As a result, it will bring a great burden to the system. In other words, although merge compression brings further savings in storage space, if the compression-decompression-recompression process is too frequent, it will increase the overhead of the storage system.
[0020] In view of this, an embodiment of the present disclosure proposes a scheme for compressing data. In this scheme, the "heat" of multiple storage areas in the storage space being accessed is determined, and the access threshold is dynamically selected based on the current capacity of the storage space. Therefore, by allocating the "heat" of the access and combining the dynamic "heat" threshold, the number of pages merged and compressed can be adjusted in real time, so that it can adapt to the current usage of the storage system, and minimize the burden on the system while ensuring that the storage space meets the usage requirements.
[0021] Figure 1 Schematic diagram of a storage system 100 in which embodiments of the present disclosure may be implemented is shown. Figure 1 As shown, the system 100 includes a computing device 110, which is used to manage a logical storage space 120. The system 100 also includes a virtual load balancer (VLB) 130, and a physical server 140 connected to the logical storage space 120 via the VLB 130. Here, the VLB 130 stores a mapping between a logical space in the logical storage space 120 and a physical space in the physical server 140.
[0022] In the illustrated embodiment, the logical storage space 120 is divided into a plurality of storage areas, including a storage area 150-1, a storage area 150-2, a storage area 150-3, a storage area 150-4, a storage area 150-5, a storage area 150-6, a storage area 150-7, and a storage area 150-8 (hereinafter, may be individually or collectively referred to as storage areas 150), etc. For example, the size of the logical storage space 120 may be 1 PB or more PB. Accordingly, each storage area 150 may have the same size, and its size may be 2 GB.
[0023] In each storage area 150, a plurality of pages are stored. Figure 1 As shown, storage area 150-1 includes 6 pages; storage area 150-2 includes 3 pages; storage area 150-3 includes 5 pages; storage area 150-4 includes 5 pages; storage area 150-5 includes 3 pages; storage area 150-6 includes 4 pages; storage area 150-7 includes 3 pages; and storage area 150-8 includes 4 pages. The data in the page is written by the user and can also be read later.
[0024] For example, in a time period, the computing device 110 receives an access instruction from the user for page 151-1 in the storage area 150-1, namely, an input / output IO instruction 160-1, an IO instruction 160-2 for page 151-2, and an IO instruction 160-3 for page 151-3. In the same time period, the computing device 110 receives an IO instruction 160-4 from the user for page 151-4 in the storage area 150-4, and an IO instruction 160-5 for page 151-5. In addition, in the same time period, the computing device 110 does not receive any IO instruction from the user for pages in the storage area 150-2. At this time, the computing device 110 can determine that in the time period, the IO count of the storage area 150-1 is 3, the IO count of the storage area 150-4 is 2, and the IO count of the storage area 150-2 is 0. Based on this, computing device 110 can determine that the user has a higher access to the data in storage area 150-1 than to the data in storage area 150-4 and storage area 150-2. Therefore, computing device 110 can infer that the probability of the user accessing storage area 150-1 in the future is greater than the probability of accessing storage area 150-4, and can infer that the user is unlikely to access the data in storage area 150-2. Based on these inferences, computing device 110 merges and compresses pages 151-6, 151-7, and 151-8 of storage area 150-2 to obtain a smaller data block 152.
[0025] It should be understood that Figure 1The illustrated embodiment only generally illustrates a scheme for compressing data according to an embodiment of the present disclosure. Here, the access degree of the storage area and the criteria for selecting the data to be compressed are only exemplary. Figures 2 to 6 A scheme for compressing data according to an embodiment of the present disclosure is described in detail.
[0026] Figure 2 FIG. 2 is a flowchart of an exemplary method 200 for compressing data according to an embodiment of the present disclosure. Figure 1 To describe the method 200. For example, the method 200 may be Figure 1 The computing device 110 in the system is used for execution.
[0027] like Figure 2 As shown, at 202, multiple access degrees of multiple storage areas are determined based on multiple input and output IO counts of multiple storage areas in the storage space within a historical time period. Figure 1 In the illustrated embodiment, the computing device 110 may determine multiple access degrees of the multiple storage areas 150 based on multiple input and output IO counts of the multiple storage areas 150 in the logical storage space 120 in a historical time period. Here, the access degree indicates the frequency with which the storage area is accessed within a period of time. The access degree may be an indicator of the probability that the storage area will be accessed in the future time not far from the current time. In some embodiments, the access degree may be an IO count for the storage area per unit time. This will be described later with reference to the attached Figure 3A-3B An example for determining the access degree is described in detail.
[0028] At 204, based on the usage rate of the storage space, an access threshold is determined. Figure 1 In the illustrated embodiment, the computing device 110 may determine an access threshold based on the usage of the logical storage space 120. The access threshold is used to distinguish between storage areas that should be compressed and storage areas that should not be compressed. The access threshold may be associated with the current usage of the logical storage space 120. For example, when the usage of the logical storage space 120 is high, that is, when the storage space that has been used is large, the access threshold may be selected to be close to the maximum access. Conversely, when the usage of the logical storage space 120 is low, that is, when the storage space that has been used is small, the access threshold may be selected to be close to the minimum access.
[0029] In some embodiments, the data compression strategy according to the embodiments of the present disclosure may include a capacity mode and a performance model. For example, the computing device 110 may select a capacity mode or a performance mode based on the free capacity of the system, i.e., the system water mark (SWM). The SWM may describe the state of the available space of the system and is the ratio of the used space of the located storage space to the total capacity of the system.
[0030] In this embodiment, when SWM is lower than the low water mark (LWM), it means that there is sufficient available space in the storage space and there is no need to merge and compress a large number of pages. At this time, the computing device can select the performance mode, that is, only pages with very low access will be merged and compressed. In this way, it is possible to avoid merging and compressing pages with high access, thereby reducing the negative impact on the performance of the storage system. When SWM exceeds LWM but is lower than the high water mark (HWM), it means that the available space of the storage space begins to decrease. The computing device 110 will select the capacity mode. As SWM increases, more low-access pages will be merged and compressed. When SWM is higher than HWM, it means that the available space of the storage space tends to be exhausted, that is, the customer is more concerned about the size of the available space at this time. At this time, except for the individual pages with the highest access, the remaining pages will be merged and compressed.
[0031] At 206, at least one target storage area among the plurality of storage areas is selected based on the plurality of access degrees and the access degree thresholds. Figure 1 In the illustrated embodiment, the computing device 110 may select at least one target storage area from the plurality of storage areas 150 based on a plurality of access degrees and the access degree threshold. After the computing device 110 selects an access degree threshold adapted to the current operating state of the storage space according to the usage rate, the computing device 110 may select a storage area 150 having an access degree greater than the access degree threshold as the target storage area to compress the pages stored therein.
[0032] At 208, a plurality of pages in the at least one target storage area are compressed. Figure 1 In the illustrated embodiment, computing device 110 may compress multiple pages in at least one target storage area into multiple data blocks. Figure 2 In the illustrated embodiment, the access degree of the storage area is determined based on the number of IOs, so that the storage areas are sorted according to the access degree. At the same time, the data to be compressed is dynamically selected in combination with the current operating status of the storage space. In this way, unnecessary compression / decompression operations can be avoided and as much free space as possible can be maintained, thereby balancing the capacity and overall performance of the storage system.
[0033] In some embodiments, the storage system may be a log-type system. In this system, when a user deletes existing data and writes new data, the stored data blocks are usually not overwritten, but new data blocks are allocated to store the new data. At this point, the original data blocks will become invalid, that is, holes. In this regard, a background program (e.g., a garbage collection program) is provided for processing these holes to free up the fragmented space of the system. In this program, a specific process is performed on the merged and compressed data blocks, that is, the merged and compressed data blocks are decompressed, and the invalid parts (i.e., data that should be deleted) in the data blocks are removed, and then the remaining parts are connected and compressed again. Compared with a single compressed block, the overhead of data removal and splicing is increased. After long-term use, the storage system will have more fragments (i.e., a large number of holes). Especially when there is insufficient available space in the system, this process causes performance loss of the system due to the need for more data and metadata operations.
[0034] In this regard, in some embodiments of the present disclosure, the computing device further selects pages to be combined and compressed according to the storage locations of the pages in the target storage area. For example, when the computing device 110 compresses multiple pages in at least one target storage area, the computing device 110 may group the multiple pages into multiple groups of pages to be compressed based on the storage relationship between the storage locations of the multiple pages. Afterwards, the computing device 110 may compress each group of pages to be compressed in the multiple groups into a data block.
[0035] When the pages in the target storage area satisfy a predetermined storage relationship, the pages will be grouped together. For example, the storage relationship may be that the logical storage locations of the pages to be compressed are continuous. The storage relationship may also be that the pages to be compressed are located in the same storage area. The storage relationship may also be that the pages to be compressed are associated with the same write operation. Here, the pages to be compressed are included in an IO instruction of the user. The storage relationship may also be that the pages to be compressed are located in the same intermediate transfer area, i.e., Figure 1 Thus, pages with closer storage address offsets can be merged and compressed together to avoid the overhead caused by the user deleting individual pages in the compressed block.
[0036] Figure 3A FIG. 3 is a flowchart showing an exemplary method 300 for determining accessibility according to an embodiment of the present disclosure. Figure 1 To describe the method 200. For example, the method 200 may be Figure 1 The computing device 110 in the system is used for execution.
[0037] like Figure 3AAs shown, at 302, the computing device 110 divides the historical time period into a plurality of segments. In some embodiments, the historical time period may be a time period from a specific historical time point to the current time. Here, the computing device 110 may divide the time period according to a fixed duration from the starting time point. Thus, the last time segment may have a different length from the previous time segment. In some embodiments, the computing device 110 may automatically and periodically perform the determination of the access degree at the end of the time segment according to the fixed duration, thereby avoiding the different lengths of the time segments.
[0038] At 304, the computing device 110 determines a plurality of segment IO counts for a first storage area of the plurality of storage areas within the plurality of segments. The computing device 110 may associate the recorded IO count statistics with corresponding time segments.
[0039] At 306, the computing device 110 determines a first access degree of the first storage area based on the plurality of segmented IO counts. In some embodiments, the computing device 110 may determine to weight all segmented IO counts. Here, the weight of each segmented IO count may be determined by looking at the historical distribution of the IO counts. In this way, by analyzing the historical IO counts segment by segment, a more realistic access degree may be inferred.
[0040] The following will refer to Figure 4 To describe the historical IO count distribution in detail. Figure 4 Schematic diagram of historical IO count statistics 400 according to some embodiments of the present disclosure is shown. The historical IO count statistics 400 includes information about, for example, Figure 1 The historical IO count distribution 410 of the storage area 150 - 1 in FIG. Figure 1 The historical IO count distribution 420 of the storage area 150 - 2 in FIG. Figure 1 The historical IO count distribution 430 of the storage area 150 - 3 in FIG.
[0041] like Figure 4 As shown, the historical IO count distribution 410 starts from the historical time point T10 to the current time point T16, and includes the time segment [T10, T11], the time segment [T11, T12], the time segment [T12, T13], the time segment [T13, T14], the time segment [T14, T15] and the time segment [T15, T16]. The segment IO count in the time segment [T10, T11] is I 11 The segment IO count in the time segment [T11, T12] is I 12 The segment IO count in the time segment [T12, T13] is I 13The segment IO count in the time segment [T13, T14] is I 14 The segment IO count in the time segment [T14, T15] is I 15 The segment IO count in the time segment [T15, T16] is I 16 .
[0042] As can be seen from the figure, the segment IO count I 11 , Segment IO count I 13 , Segment IO count I 15 The values are similar, and the segment IO count I 12 , Segment IO count I 14 , Segment IO count I 16 . Therefore, the computing device can infer that the access degree of the storage area changes periodically. For example, the storage area may be accessed many times during the day, while the access will decrease at night. Therefore, when determining the weight, the computing device can set the weight of the historical segment corresponding to the current time to be higher than the weight of the historical segment not corresponding to the current time. For example, when calculating the access degree of the time segment [T15, T16], the weights of the time segment [T11, T12] and the time segment [T13, T14] can be set to be higher than the weights of other time segments.
[0043] like Figure 4 As shown, the historical IO count distribution 420 starts from the historical time point T20 to the current time point T26, and includes the time segment [T20, T21], the time segment [T21, T22], the time segment [T22, T23], the time segment [T23, T24], the time segment [T24, T25] and the time segment [T25, T26]. The segment IO count in the time segment [T20, T21] is I 21 The segment IO count in the time segment [T21, T22] is I 22 The segment IO count in the time segment [T22, T23] is I 23 The segment IO count in the time segment [T23, T24] is I 24 The segment IO count in the time segment [T24, T25] is 1 25 The segment IO count in the time segment [T25, T26] is 1 26 .
[0044] As can be seen from the figure, the segment IO count I 22 , Segment IO count I 23The value of is much higher than that of other time segments. Therefore, the computing device can infer that the data in the storage area becomes obsolete after time point T23, and is unlikely to be accessed. Therefore, when determining the weight, the computing device can set the weight of the historical segment farther from the current time to be lower than the weight of the historical segment closer to the current time. For example, when calculating the access degree of time segment [T25, T26], the weights of time segment [T21, T22] and time segment [T22, T23] can be set lower than the weights of time segment [T23, T24], time segment [T24, T25] and time segment [T25, T26].
[0045] like Figure 4 As shown, the historical IO count distribution 430 starts from the historical time point T30 to the current time point T36, and includes the time segment [T30, T31], the time segment [T31, T32], the time segment [T32, T33], the time segment [T33, T34], the time segment [T34, T35] and the time segment [T35, T36]. The segment IO count in the time segment [T30, T31] is I 31 The segment IO count in the time segment [T31, T32] is I 32 The segment IO count in the time segment [T32, T33] is 1 33 The segment IO count in the time segment [T33, T34] is I 34 The segment IO count in the time segment [T34, T35] is 1 35 The segment IO count in the time segment [T35, T36] is 1 36 .
[0046] As can be seen from the figure, the distribution of the segmented IO counts of the storage area is relatively random and has no fixed rules. It should be understood that due to the characteristics of the stored data, the earlier the stored data is, the lower the probability of its access. That is, the I / O at the current time has the greatest impact on the blade temperature, while the I / O with a longer history has a smaller and smaller impact on the blade temperature calculation. Therefore, when determining the weight, the computing device can generally set the weight of the historical segment that is farther away from the current time to be lower than the weight of the historical segment that is closer to the current time.
[0047] The following will be combined Figure 3B Let's introduce in detail how to calculate the general access degree. Figure 3B FIG. 3 is a flow chart showing an example method 306 for determining accessibility according to an embodiment of the present disclosure. Figure 1 Method 306 can be described as follows. For example, method 306 can correspond to step 306 of method 300 and be represented by Figure 1The computing device 110 in the system is used for execution.
[0048] like Figure 3B As shown, at 3061, the computing device 110 performs initialization. Here, the computing device 110 sets i, the initial IO cardinality I0, and the access degree T0 of the initial time segment to 0. At 3062, the computing device 110 determines a first segment and a second segment that are consecutive among the plurality of segments, the second segment being after the first segment. At 3063, the computing device 110 determines a first segment count I of the first segment. i and the second segment count I of the second segment i+1 At this time, i=0, then the first segment count is I0 and the second segment count is I1. At 3064, the computing device 110 obtains the first segment access degree T of the first segment. i , i.e., T0. At 3065, the computing device 110 determines the second segment access degree of the second segment based on the second segment count and the first segment access degree. After calculating the access degree of the second segment, at 3066, the computing device 110 determines whether the current i is n, and whether there are other segments to be calculated. If the computing device 110 determines that the current i is n, then the method 306 ends at 3068. If the computing device 110 determines that the current i is not n, then the method proceeds to 3067. At 3067, the computing device 110 increases i by 1. At this point, the method 306 returns to 3062.
[0049] In some embodiments, when determining the second segment access degree of the second segment, the computing device may determine the second segment access degree by calculating a weighted sum of the first segment access degree and the second segment count.
[0050] In some embodiments, for general situations, the computing device can calculate the access degree based on a moving average algorithm. In such an embodiment, the IO count value at the current time point can be given a higher weight, while the weight of the historical time segment decreases exponentially with the increase of time, as shown, for example:
[0051] T n =α×I n +(1-α)×T n-1 (1)
[0052] Where α is the weight, which is a value between 0 and 1, I n Indicates the IO count of the current time segment. n-1 is the visit degree of the previous time segment. n The visit rate of the current time segment.
[0053] It can be seen from the formula that (1-α)×T n-1It can be regarded as the attenuation of access degree, so 1-α can be obtained by using the following prime number attenuation:
[0054] 1-α=e -λΔt (2)
[0055] Where λ is the attenuation factor, which can be set by statistics or experience.
[0056] From this, we can get
[0057] α=1-e -λΔt (3)
[0058] Substituting (3) into (1), we can obtain the following access degree:
[0059] T n =I n ×(1-e -λΔt )+T n-1 ×(e -λΔt ) (4)
[0060] In this way, an access degree that meets the characteristics of the stored data can be obtained, thereby improving compression performance.
[0061] Figure 5 FIG. 5 is a flowchart showing an exemplary method 500 for determining a visit threshold according to an embodiment of the present disclosure. Figure 1 To describe the method 500. For example, the method 500 may be Figure 1 The computing device 110 in the system is used for execution.
[0062] At 501, the computing device 110 obtains a predetermined low usage threshold and a high usage threshold of the storage space. At 502, the computing device 110 determines the current usage of the storage space based on the currently used capacity and the total capacity of the storage space. At 503, the computing device 110 determines a set of mapping relationships between the access threshold and the current usage. At 504, the computing device 110 compares the current usage with the low usage threshold and the high usage threshold to obtain a comparison result. At 505, the computing device 110 determines a mapping relationship in a set of mapping relationships that corresponds to the comparison result. At 506, the computing device 110 determines the access threshold based on the determined mapping relationship and the current usage.
[0063] After obtaining the access degree, the operating mode of the storage system can be determined by dynamically selecting an access degree threshold. The access degree threshold is between 0 and 1, which indicates the percentage of the number of all storage areas of the storage system. In some embodiments, there are multiple different mapping relationships between the access degree threshold and the current usage of the storage system. For example, these mapping relationships may include a first mapping relationship, a second mapping relationship, and a third mapping relationship. Here, in the case where the access degree threshold is less than the low usage threshold, the access degree threshold and the current usage have a first mapping relationship. In the case where the access degree threshold is greater than the low usage threshold and less than the high usage threshold, the access degree threshold and the current usage have a second mapping relationship. In the case where the access degree threshold is greater than the high usage threshold, the access degree threshold and the current usage have a third mapping relationship. The second mapping relationship indicates that the increase in the access degree threshold with the increase in the current usage is greater than the increase indicated by the first mapping relationship and the second mapping relationship. The following will be combined with Figure 6 To describe a mapping relationship.
[0064] Figure 6 FIG. 6 is a schematic diagram showing an example mapping relationship 600 between the usage rate SWM and the access threshold Ct according to an embodiment of the present disclosure. Figure 6 As shown, the horizontal axis of the mapping relationship 600 is the usage rate SWM of the storage space, and the vertical axis is the access threshold Ct. Here, the mapping relationship 600 between the usage rate SWM and the access threshold Ct satisfies the following equation:
[0065]
[0066] Where L is the maximum value of the access threshold, usually 1. K is an adjustable predetermined coefficient, for example, 10. x0 is the midpoint and specifically satisfies:
[0067]
[0068] Where LWM is the low usage threshold and HWM is the high usage threshold
[0069] In this embodiment, LWM is the usage degree S1, and HWM is the usage degree S2. The access degree threshold Ct corresponding to S1 is Ct1, and the access degree threshold Ct corresponding to S2 is Ct2. Figure 6As shown, when 0 < SWM < LWM, there is a large amount of available system space, the Ct value will become smaller and increase slowly. Very few storage areas are considered to have low access. When LWM < SWM < HWM, the available space of the system is getting less and less. The Ct value will increase rapidly to select more storage areas for merge compression, that is, save more space. When HWM < SWM, the available space of the system is limited. The Ct value is close to 1, which means that most storage areas will perform merge compression except for those with extremely high access. In this way, the access threshold beneficial to the operation of the storage space can be dynamically determined through the prime number mapping relationship.
[0070] Figure 7 FIG. shows a schematic block diagram of an example device 700 that can be used to implement embodiments of the present disclosure. As Figure 7 shown, the device 700 includes a central processing unit (CPU) 701, which can perform various appropriate actions and processes according to computer program instructions stored in a read-only memory (ROM) 702 or computer program instructions loaded from a storage unit 708 into a random access memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the device 700 can also be stored. The CPU 701, ROM 702, and RAM 703 are connected to each other through a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.
[0071] A plurality of components in the device 700 are connected to the I / O interface 705, including: an input unit 706, such as a keyboard, a mouse, etc.; an output unit 707, such as various types of displays, speakers, etc.; a storage unit 708, such as a magnetic disk, an optical disk, etc.; and a communication unit 709, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 709 allows the device 700 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0072] The various processes and processes described above, such as methods 200, 300, 306, and 500, can be executed by the processing unit 701. For example, in some embodiments, methods 200, 300, 306, and 500 can be implemented as computer software programs, which are tangibly included in a machine-readable medium, such as the storage unit 708. In some embodiments, all or part of the storage area of the computer program can be loaded and / or installed onto the device 700 via the ROM 702 and / or the communication unit 709. When the computer program is loaded into the RAM 703 and executed by the CPU 701, one or more actions of the methods 200, 300, 306, and 500 described above can be executed.
[0073] The present disclosure may be a method, an apparatus, a system and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for executing various aspects of the present disclosure.
[0074] Computer readable storage medium can be a tangible device that can hold and store instructions used by an instruction execution device. Computer readable storage medium can be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the above. More specific examples (non-exhaustive list) of computer readable storage medium include: portable computer disk, hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static random access memory (SRAM), portable compact disk read-only memory (CD-ROM), digital versatile disk (DVD), memory stick, floppy disk, mechanical encoding device, such as a punch card or a convex structure in a groove on which instructions are stored, and any suitable combination of the above. The computer readable storage medium used here is not interpreted as a transient signal itself, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagated by a waveguide or other transmission medium (e.g., a light pulse by an optical fiber cable), or an electrical signal transmitted by a wire.
[0075] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.
[0076] The computer program instructions for performing the operation of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. Computer-readable program instructions may be executed entirely on a user's computer, stored in a region on a user's computer, executed as an independent software package, stored in a region on a user's computer, stored in a region on a remote computer, or executed entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), may be personalized by utilizing the state information of the computer-readable program instructions, and the electronic circuit may execute the computer-readable program instructions, thereby realizing various aspects of the present disclosure.
[0077] Various aspects of the present disclosure are described herein with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer-readable program instructions.
[0078] These computer-readable program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processing unit of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0079] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0080] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to multiple embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a storage area of a module, program segment or instruction, and a storage area of the module, program segment or instruction contains one or more executable instructions for realizing the specified logical function. In some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0081] The embodiments of the present disclosure have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or improvements to the technology in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.
Claims
1. A method for compressing data, comprising: Determining multiple access degrees of the multiple storage areas based on multiple input and output IO counts of the multiple storage areas in the storage space within a historical time period; Determining an access degree threshold based on the usage rate of the storage space; selecting at least one target storage area among the plurality of storage areas based on the plurality of access degrees and the access degree threshold; as well as A plurality of pages in the at least one target storage area are compressed.
2. The method according to claim 1, wherein determining a plurality of access degrees of the plurality of storage regions comprises: dividing the historical time period into a plurality of segments; determining a plurality of segment IO counts within the plurality of segments for a first storage area of the plurality of storage areas; as well as Based on the plurality of segment IO counts, a first access degree of the first storage region is determined.
3. The method according to claim 2, wherein determining the first access degree of the first storage area comprises: determining a first segment and a second segment that are consecutive among the plurality of segments, the second segment being subsequent to the first segment; determining a second segment count corresponding to the second segment among the plurality of segment counts; Obtaining a first segment access degree of the first segment; as well as A second segment access degree of the second segment is determined based on the second segment count and the first segment access degree.
4. The method of claim 3, wherein determining the second segment accessibility of the second segment comprises: Determining a first weight for the first segment accessibility; determining a second weight for the second segment count; as well as The second segment access degree is determined based on the first weight, the first segment access degree, the second weight, and the second segment count.
5. The method according to claim 1, wherein determining the access threshold comprises: Obtaining a predetermined low usage threshold and a high usage threshold of the storage space; Determining a current usage of the storage space based on the currently used capacity and the total capacity of the storage space; as well as The access threshold is determined based on the low usage threshold, the high usage threshold, and the current usage.
6. The method according to claim 5, wherein determining the access threshold comprises: Determine a set of mapping relationships between the access degree threshold and the current usage degree; Comparing the current usage with the low usage threshold and the high usage threshold to obtain a comparison result; Determine a mapping relationship in the set of mapping relationships that corresponds to the comparison result; as well as The access degree threshold is determined based on the determined mapping relationship and the current usage degree.
7. The method according to claim 6, wherein the set of mapping relationships includes a first mapping relationship, a second mapping relationship, and a third mapping relationship, Wherein, when the access threshold is less than the low usage threshold, the access threshold has a first mapping relationship with the current usage, when the access threshold is greater than the low usage threshold and less than the high usage threshold, the access threshold has a second mapping relationship with the current usage, and when the access threshold is greater than the high usage threshold, the access threshold has a third mapping relationship with the current usage, and The second mapping relationship indicates that the increase range of the access degree threshold as the current usage degree increases is greater than the increase ranges indicated by the first mapping relationship and the second mapping relationship.
8. The method according to claim 1, wherein compressing the plurality of pages in the at least one target storage area comprises: Based on the storage relationship between the storage locations of the multiple pages, grouping the multiple pages into multiple groups of pages to be compressed; as well as Each group of pages to be compressed in the plurality of groups of pages to be compressed is compressed into a data block.
9. The method according to claim 8, wherein the storage relationship comprises at least one of the following: The logical storage locations of the pages to be compressed are continuous; The pages to be compressed are located in the same storage area; The pages to be compressed are associated with the same write operation; or The pages to be compressed are located in the same intermediate dump area.
10. An electronic device, comprising: processor; as well as a memory coupled to the processor, the memory having instructions stored therein, the instructions, when executed by the processor, causing the device to perform actions, the actions comprising: Determining multiple access degrees of the multiple storage areas based on multiple input and output IO counts of the multiple storage areas in the storage space within a historical time period; Determining an access degree threshold based on the usage rate of the storage space; selecting at least one target storage area among the plurality of storage areas based on the plurality of access degrees and the access degree threshold; and A plurality of pages in the at least one target storage area are compressed.
11. The electronic device of claim 10, wherein determining a plurality of access degrees of the plurality of storage areas comprises: dividing the historical time period into a plurality of segments; determining a plurality of segment IO counts within the plurality of segments for a first storage area of the plurality of storage areas; as well as Based on the plurality of segment IO counts, a first access degree of the first storage region is determined.
12. The electronic device of claim 11, wherein determining the first access level of the first storage area comprises: determining a first segment and a second segment that are consecutive among the plurality of segments, the second segment being subsequent to the first segment; determining a second segment count corresponding to the second segment among the plurality of segment counts; Obtaining a first segment access degree of the first segment; as well as A second segment access degree of the second segment is determined based on the second segment count and the first segment access degree.
13. The electronic device of claim 12, wherein determining the second segment accessibility of the second segment comprises: Determining a first weight for the first segment accessibility; determining a second weight for the second segment count; as well as The second segment access degree is determined based on the first weight, the first segment access degree, the second weight, and the second segment count.
14. The electronic device of claim 10, wherein determining the access threshold comprises: Obtaining a predetermined low usage threshold and a high usage threshold of the storage space; Determining a current usage of the storage space based on the currently used capacity and the total capacity of the storage space; as well as The access threshold is determined based on the low usage threshold, the high usage threshold, and the current usage.
15. The electronic device of claim 14, wherein determining the access threshold comprises: Determine a set of mapping relationships between the access degree threshold and the current usage degree; Comparing the current usage with the low usage threshold and the high usage threshold to obtain a comparison result; Determine a mapping relationship in the set of mapping relationships that corresponds to the comparison result; as well as The access degree threshold is determined based on the determined mapping relationship and the current usage degree.
16. The electronic device according to claim 15, wherein the set of mapping relationships comprises a first mapping relationship, a second mapping relationship and a third mapping relationship, Wherein, when the access threshold is less than the low usage threshold, the access threshold has a first mapping relationship with the current usage, when the access threshold is greater than the low usage threshold and less than the high usage threshold, the access threshold has a second mapping relationship with the current usage, and when the access threshold is greater than the high usage threshold, the access threshold has a third mapping relationship with the current usage, and The second mapping relationship indicates that the increase range of the access degree threshold as the current usage degree increases is greater than the increase ranges indicated by the first mapping relationship and the second mapping relationship.
17. The electronic device according to claim 10, wherein compressing the plurality of pages in the at least one target storage area comprises: Based on the storage relationship between the storage locations of the multiple pages, grouping the multiple pages into multiple groups of pages to be compressed; as well as Each group of pages to be compressed in the plurality of groups of pages to be compressed is compressed into a data block.
18. The electronic device according to claim 17, wherein the storage relationship comprises at least one of the following: The logical storage locations of the pages to be compressed are continuous; The pages to be compressed are located in the same storage area; The pages to be compressed are associated with the same write operation; or The pages to be compressed are located in the same intermediate dump area.
19. A computer program product tangibly stored on a computer readable medium and comprising machine executable instructions which, when executed, cause a machine to perform the following actions: Determining multiple access degrees of the multiple storage areas based on multiple input and output IO counts of the multiple storage areas in the storage space within a historical time period; Determining an access degree threshold based on the usage rate of the storage space; selecting at least one target storage area among the plurality of storage areas based on the plurality of access degrees and the access degree threshold; as well as A plurality of pages in the at least one target storage area are compressed.
20. The computer program product of claim 19, wherein determining a plurality of access degrees of the plurality of storage regions comprises: dividing the historical time period into a plurality of segments; determining a plurality of segment IO counts within the plurality of segments for a first storage area of the plurality of storage areas; as well as Based on the plurality of segment IO counts, a first access degree of the first storage region is determined.