Method, apparatus, device, and storage medium for changing redundancy level of storage unit

By receiving redundancy level change instructions and using garbage collection function to extract and aggregate data from storage units, the problem of low redundancy level change in storage systems is solved, efficient and fast redundancy level change is achieved, and the performance and life of the storage system is improved.

CN114116327BActive Publication Date: 2025-07-22NEW H3C BIG DATA TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202111369098.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-18
Publication Date
2025-07-22
Estimated Expiration
2041-11-18

AI Technical Summary

Technical Problem

In the prior art, it is difficult for users to efficiently and quickly change the redundancy level online when deploying storage systems, resulting in additional burdens and performance losses during data migration.

Method used

By receiving redundancy level change instructions, the garbage collection function extracts valid data from the storage unit, clears other data, and aggregates it into the storage unit of the new redundancy level, using the write-on-time redirection and garbage collection functions to reduce hot data migration and improves data processing efficiency.

Benefits of technology

It realizes efficient and fast redundancy-level online changes, reduces computing resource usage, and improves the overall performance and life of the storage system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114116327B_ABST
    Figure CN114116327B_ABST
Patent Text Reader

Abstract

The present application discloses a method, apparatus, device, and storage medium for changing the redundancy level of a storage unit. The method includes: when receiving a redundancy level change instruction, extracting valid data from each storage unit and clearing other data; according to the redundancy level change instruction, setting all vacant storage units as storage units of the new redundancy level; aggregating the extracted valid data and newly input data; and storing the aggregated data in the storage units of the new redundancy level. In the method for changing the redundancy level of a storage unit according to the embodiments of the present application, valid data is extracted from each storage unit and other data is cleared, all vacant storage units are set as storage units of the new redundancy level, the extracted valid data and newly input data are aggregated, and the aggregated data is stored in the storage units of the new redundancy level, thereby achieving efficient and fast online change of the redundancy level, and occupying less computing resources during the execution process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of data storage, and particularly to a method, apparatus, electronic device, and computer-readable storage medium for changing the redundancy level of storage units. Background Art

[0002] Currently, high-performance storage media SSDs (i.e., solid-state drives) have been widely commercialized. In the field of distributed storage, all-flash distributed storage systems based on all SSDs have also been introduced, such as the Fusionstorage 8.0 distributed storage system. In distributed all-flash systems, to prevent data loss caused by single-point failures, replicas or erasure codes (abbreviated as EC) are usually used to perform redundancy protection on data.

[0003] In actual applications, the redundancy levels of replicas or erasure codes are also configurable by users according to their performance, reliability, and cost requirements. For example, EC4+2: It can withstand the simultaneous failure of 2 disks while ensuring that data is not lost, but its available capacity is only 66.7% of the hard disk capacity; while EC4+1: It can only withstand the failure of 1 disk while ensuring that data is not lost, but its available capacity is 80% of the hard disk capacity. Therefore, users with different requirements will choose appropriate redundancy levels according to their cost and reliability requirements; however, some users do not choose the optimal redundancy level when initially deploying the storage system and can only discover the most suitable redundancy level after running for a period of time: For example, some users initially choose EC4+2, but later the demand for stored data volume increases, but they do not want to expand the capacity, and they also feel that they can sacrifice reliability but cannot lose the original data or interrupt the business. At this time, the user hopes to be able to change the redundancy level online. Specifically, how to efficiently and quickly implement online redundancy level change is a technical problem that urgently needs to be solved currently. Summary of the Invention

[0004] The purpose of this application is to provide a method, apparatus, electronic device, and computer-readable storage medium for changing the redundancy level of storage units. To provide a basic understanding of some aspects of the disclosed embodiments, a simple summary is given below. This summary part is not a general review, nor is it intended to identify key / important constituent elements or delineate the protection scope of these embodiments. Its sole purpose is to present some concepts in a simple form as a prelude to the subsequent detailed description.

[0005] According to one aspect of the embodiments of this application, a method for changing the redundancy level of storage units is provided, which is applied to a computing device and includes:

[0006] When receiving a redundancy level change instruction, extract valid data from each storage unit and clear other data;

[0007] According to the redundancy level change instruction, set all vacant storage units as storage units of the new redundancy level;

[0008] Aggregate the extracted valid data and newly input data to obtain aggregated data;

[0009] Store the aggregated data into the storage units of the new redundancy level.

[0010] In some embodiments of the present application, before extracting valid data from each storage unit and clearing other data, the method further includes:

[0011] Set the data processing priority of each storage unit;

[0012] The extracting valid data from each storage unit and clearing other data includes: sequentially extracting valid data from each storage unit according to the data processing priority and clearing other data.

[0013] In some embodiments of the present application, the setting the data processing priority of each storage unit includes:

[0014] Obtain the proportion of garbage data in each storage unit, and divide each storage unit into multiple proportion levels according to the proportion of garbage data; the proportion of garbage data is positively correlated with the proportion level;

[0015] Obtain the data storage duration in each storage unit, and divide each storage unit into multiple duration levels according to the data storage duration; the data storage duration is positively correlated with the duration level;

[0016] Compare the proportion levels of each storage unit, and set the proportion level to be positively correlated with the data processing priority;

[0017] Compare the duration levels of each storage unit with the same proportion level, and set the data processing priority of each storage unit with the same proportion level to be positively correlated with the duration level.

[0018] In some embodiments of the present application, the obtaining the proportion of garbage data in each storage unit and dividing each storage unit into multiple proportion levels according to the proportion of garbage data includes:

[0019] Repeatedly detect the proportion of garbage data in each storage unit, and re-divide each storage unit into multiple proportion levels according to the proportion of garbage data detected most recently.

[0020] In some embodiments of the present application, obtaining the data storage duration in each of the storage units and dividing each of the storage units into multiple duration levels according to the data storage duration includes:

[0021] Repeatedly detecting the data storage duration in each of the storage units and re-dividing each of the storage units into multiple duration levels according to the most recently detected data storage duration.

[0022] In some embodiments of the present application, the repeatedly detecting the data storage duration in each of the storage units includes periodically detecting the data storage duration in each of the storage units.

[0023] In some embodiments of the present application, the redundancy level change instruction includes information for changing a storage unit with an old redundancy level to a new redundancy level; the extracting valid data from each storage unit and clearing other data includes:

[0024] Extracting valid data from each storage unit at a first data processing rate and clearing other data;

[0025] The method further includes: after all the storage units are changed to the new redundancy level, recycling each of the storage units at a second data processing rate;

[0026] wherein the second data processing rate is less than the first data processing rate.

[0027] According to another aspect of the embodiments of the present application, there is provided a redundancy level change device for a storage unit, which is applied to a computing device and includes:

[0028] A data recycling module, configured to extract valid data from each storage unit and clear other data when receiving a redundancy level change instruction;

[0029] A redundancy level setting module, configured to set all vacant storage units as storage units with a new redundancy level according to the redundancy level change instruction;

[0030] A data aggregation module, configured to aggregate the extracted valid data and newly input data to obtain aggregated data;

[0031] A storage operation module, configured to store the aggregated data in the storage units with the new redundancy level.

[0032] According to another aspect of the embodiments of the present application, there is provided an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor executes the program to implement the redundancy level change method for a storage unit as described in any one of the above.

[0033] According to another aspect of the embodiments of the present application, there is provided a computer-readable storage medium, on which a computer program is stored, and the program is executed by a processor to implement the method for changing the redundancy level of the storage unit described in any one of the above.

[0034] The technical solution provided by one aspect of the embodiments of the present application may include the following beneficial effects:

[0035] The method for changing the redundancy level of the storage unit provided by the embodiments of the present application extracts valid data from each storage unit and clears other data, sets all vacant storage units as storage units of the new redundancy level, aggregates the extracted valid data and newly input data, and stores the aggregated data in the storage units of the new redundancy level, realizing efficient and fast online change of the redundancy level, and occupying less computing resources during the execution process.

[0036] Other features and advantages of the present application will be described in the subsequent description, and, in part, will be obvious from the description, or, some features and advantages can be inferred from the description or determined without doubt, or understood by implementing the embodiments of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments recorded in the present application. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.

[0038] Figure 1 Shows a flowchart of a method for changing the redundancy level of a storage unit according to an embodiment and a certain implementation manner;

[0039] Figure 2 Shows a flowchart of a method for changing the redundancy level of a storage unit according to an embodiment and another implementation manner;

[0040] Figure 3 Shows Figure 2 The flowchart of step S00 in

[0041] Figure 4 Shows a block diagram of the structure of a device for changing the redundancy level of a storage unit according to an embodiment and a certain implementation manner;

[0042] Figure 5 Shows a block diagram of the structure of a device for changing the redundancy level of a storage unit according to an embodiment and another implementation manner;

[0043] Figure 6 ShowsFigure 5 The structural block diagram of the setting module in

[0044] Figure 7 shows the structural block diagram of an electronic device according to an embodiment;

[0045] Figure 8 shows a schematic diagram of a computer-readable storage medium according to an embodiment. Detailed implementation manners

[0046] To make the objectives, technical solutions and advantages of the present application clearer, the present application will be further described below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present application without creative efforts shall fall within the protection scope of the present application.

[0047] Those skilled in the art can understand that unless otherwise defined, all terms (including technical terms and scientific terms) used herein have the same meaning as the general understanding of those of ordinary skill in the art in the field to which the present application belongs. It should also be understood that terms such as those defined in a general dictionary should be understood to have a meaning consistent with the meaning in the context of the prior art, and will not be interpreted in an idealized or overly formal sense unless specifically defined as here.

[0048] In a storage system such as a distributed all-flash system, writing data in the way of ROW (REDIRECT-ON-WRITE) can better exert the performance advantages of the SSD disk, and at the same time better support the deduplication and compression capabilities. However, the ROW writing method is a brand-new writing mode, and it must cooperate with GC (GARBAGE COLLECTION) to release space in time to continuously support writing data in ROW.

[0049] Hot data is modified relatively frequently and does not need to be stored in the storage system for a long time, so there is no need for migration. The inventor found that in the existing technologies, some technical solutions do not identify hot data, resulting in unnecessary migration of a lot of hot data; some technical solutions need to use an additional intelligent statistical algorithm to identify hot data, resulting in additional background tasks, additional data reading and data writing operations, and increasing the overall burden of the storage system.

[0050] In an embodiment of the present application, when the computing device receives a redundancy level change instruction, it activates the garbage collection function and the write-time redirection function. Write-time redirection refers to the operation of redirecting the write operation to the original data storage space to another storage space in order to protect the original data. The garbage collection function can be used to complete the data migration for online changing the redundancy level.

[0051] As Figure 1 shown, an embodiment of the present application provides a method for changing the redundancy level of a storage unit, which is applied to a computing device. The method includes steps S10 - S40:

[0052] S10. When receiving a redundancy level change instruction, extract the valid data from each storage unit and clear other data.

[0053] The redundancy level change instruction is an instruction input by the user to the computing device through an input device such as a mouse or a keyboard. When the computing device receives the redundancy level change instruction, it extracts the valid data from each storage unit and clears other data. The computing device can be, for example, a computer or a server.

[0054] In some embodiments, the redundancy level change instruction includes information for changing the storage units of the old redundancy level to the new redundancy level. The extracting the valid data from each storage unit and clearing other data includes: extracting the valid data from each storage unit and clearing other data at a first data processing rate. In order to quickly meet the user's need to switch the data redundancy level, the garbage data recovery will be accelerated during this process, and the garbage data will be recovered at a relatively high first data processing rate. The first data processing rate can be set according to actual needs. When performing garbage collection, the data block with the least valid data in the data table of the old redundancy level is preferentially selected for recovery.

[0055] After extracting the valid data from each storage unit and clearing other data, corresponding empty storage units are obtained, which is the process of garbage collection.

[0056] S20. According to the redundancy level change instruction, set all the empty storage units as storage units of the new redundancy level.

[0057] The redundancy level change instruction includes information for changing the storage units of the old redundancy level to the new redundancy level. According to the information for changing the storage units of the old redundancy level to the new redundancy level, set all the empty storage units as storage units of the new redundancy level.

[0058] S30. Aggregate the extracted valid data and the newly input data to obtain the aggregated data.

[0059] The inventors found that in existing technologies for online changing the redundancy level, usually after a user issues a requirement to change the redundancy level, the newly written data is written into the space of the new redundancy level, and for the old data, it needs to be migrated to the space of the new redundancy level through an online data migration method.

[0060] In this embodiment, during the process of extracting valid data from each storage unit, new data is continuously input. At this time, the extracted valid data and the newly input data are aggregated to obtain aggregated data. It can be to aggregate the valid data and the externally input data based on the new redundancy level to obtain aggregated data. Aggregation can be an operation of integrating the extracted valid data and the newly input data.

[0061] S40: Store the aggregated data in the storage unit of the new redundancy level.

[0062] For example, through the garbage collection function, the originally stored data block information (such as memory information that can be just dozens of bytes) and the newly input data can be stored in different storage units according to the new redundancy level. The storage unit can be, for example, a data table.

[0063] In some embodiments, as Figure 2 shown, before extracting the valid data from each storage unit and clearing other data, the method further includes step S00:

[0064] S00: Set the data processing priorities of each storage unit.

[0065] Specifically, two types of grades, namely the garbage amount grade and the existence duration grade, can be set for each write - time redirection object to be recycled, and the data processing priorities of each storage unit are set according to these two grades.

[0066] After setting the data processing priorities of each storage unit, extracting the valid data from each storage unit and clearing other data includes: sequentially extracting the valid data from each storage unit and clearing other data according to the data processing priorities.

[0067] In some embodiments, as Figure 3 shown, step S00 includes steps S001 - S004:

[0068] S001: Obtain the proportion of garbage data in each storage unit, and divide each storage unit into multiple proportion levels according to the proportion of garbage data; the proportion of garbage data is positively correlated with the proportion level.

[0069] In some embodiments, step S001 includes: repeatedly detecting the proportion of garbage data in each of the storage units, and re-dividing each of the storage units into multiple proportion levels according to the proportion of garbage data detected most recently.

[0070] The proportion levels of the garbage data in the storage units can be divided according to the value of the proportion of garbage data. For example, 10 proportion levels can be correspondingly set according to the values of the proportion of garbage data reaching 90%, 80%,..., 10%, 0% respectively. That is, when the value of the proportion of garbage data is in the interval (90%, 100%], the corresponding proportion level is level 10; when the value of the proportion of garbage data reaches (80%, 90%], the corresponding proportion level is level 9;..., when the value of the proportion of garbage data is greater than [0%, 10%], the corresponding proportion level is level 1. Specifically, an example of the proportion level division method is shown in Table 1 below:

[0071] Table 1 Proportion level division method

[0072]

[0073]

[0074] When new garbage data is generated on the storage unit, the proportion of the garbage data is updated, and it is determined whether the proportion level of the storage unit needs to be readjusted according to the updated proportion of the garbage data. The setting of the proportion levels needs to be reasonable. If there are too many levels, it will cause frequent adjustment of the proportion levels of the storage units and consume more CPU computing resources, while if there are too few proportion levels, it will affect the selection of the storage units to be recycled.

[0075] S002. Obtain the data storage duration in each of the storage units, and divide each of the storage units into multiple duration levels according to the data storage duration; the data storage duration is positively correlated with the duration level.

[0076] In some embodiments, step S002 includes: repeatedly detecting the data storage duration in each of the storage units, and re-dividing each of the storage units into multiple duration levels according to the data storage duration detected most recently.

[0077] Specifically, the repeatedly detecting the data storage duration in each of the storage units includes periodically detecting the data storage duration in each of the storage units and non-periodically detecting the data storage duration in each of the storage units, which can be specifically selected according to actual needs.

[0078] The calculation of the existence duration starts from the completion of data writing by the write-time redirection object. The longer the time, the "colder" the data stored on the storage unit, and the more severe the "cold" degree. The data storage duration of the storage unit can be detected regularly. Each time the data storage duration exceeds the timeout threshold, the duration level is increased by one level. This timeout threshold is adjustable and can be specifically set according to actual needs. For example, the timeout threshold can be set to 1 hour, or it can be set to other durations according to actual needs.

[0079] S003. Compare the proportion levels of the respective storage units, and set that the proportion level is positively correlated with the data processing priority.

[0080] Setting that the proportion level is positively correlated with the data processing priority means that the higher the proportion level, the higher the data processing priority. For example, the data processing priorities corresponding to proportion levels 1 to 10 in Table 1 increase in sequence. The storage unit can be, for example, a data block. Through S003, it is possible to recycle the data blocks in ascending order of the amount of valid data contained in each data block.

[0081] S004. Compare the duration levels of the storage units with the same proportion level, and set that the data processing priorities of the storage units with the same proportion level are positively correlated with the duration levels.

[0082] For the storage units with the same proportion level, the higher the duration level, the higher the data processing priority. For example, there are four storage units, namely A, B, C, and D. Among A, B, C, and D, the values of the proportion of garbage data are 72%, 46%, 48%, and 68% respectively. Then the corresponding proportion levels are 8th level, 5th level, 5th level, and 7th level respectively. The proportion levels of B and C are both 5th level. Then, according to the duration levels of B and C, the priorities of B and C are set. Assuming that the duration level of B is less than that of C, then the priority of B is less than that of C. The corresponding priority relationship of these four storage units is D > A > C > B, that is, the priority of D is greater than the priority of A, the priority of A is greater than the priority of C, and the priority of C is equal to the priority of B.

[0083] The steps S001 - S004 for setting the data processing priorities of the above - mentioned storage units preferentially select the write - time redirection objects (the objects in this embodiment are storage units) with the highest proportion of garbage data, which can ensure that the number of migrations of valid data is small; for the storage units within the same proportion level, the percentage of valid data does not differ much, and the number of migrations is relatively close. Therefore, the priorities of the storage units within the same proportion level can be determined randomly, or the priorities of the storage units can be determined according to the duration level; since the number of proportion levels is limited, and the actual amount of data in practical applications is very large, and there are many write - time redirection objects in each proportion level, the priorities of the storage units can be determined according to the duration level within the same proportion level. For the storage units in the same proportion level, the higher the duration level, the higher the data processing priority, which can ensure that the coldest data is recycled each time.

[0084] For example, if the storage space is 10T (which is relatively small in the current application), each write - time redirection object (the write - time redirection object is the write - time redirection storage unit) is 4M, and the proportion levels are set to 10 levels in the way shown in Table 1, then each proportion level will correspond to an average of 262144 write - time redirection objects. Even if 100 write - time redirection objects are recycled each time, it is only 1 / 2621 of each proportion level. The duration level can be divided into 1000 levels, and the highest - level ones must be cold data. At the same time, the "cold" degree of the data migrated during each recycling is about the same. When it is relocated to the same new write - time redirection object, the modification busy degree of the data on it is basically the same (this will cause the modification time of the data on this new write - time redirection object to be generally the same in the future. Then, this write - time redirection object will not only store cold data for a long time, but also have very little garbage data after the data is modified), which will make the amount of data migrated during subsequent garbage collection less and less, thus greatly improving the garbage data recovery efficiency, and bringing about an improvement in the overall performance and service life of the storage system.

[0085] In some embodiments, the method further includes: S50. After all the storage units are changed to the new redundancy level, each of the storage units is recycled at a second data processing rate; wherein, the second data processing rate is less than the first data processing rate.

[0086] After garbage collection has completely recycled the data at the old redundancy level, the original recycling speed is restored, and the data at the new redundancy level is continued to be recycled, which can save computing resources. The higher the data processing rate, the more computing resources are occupied. The second data processing rate is less than the first data processing rate. Then, when all the storage units are changed to the new redundancy level and the task of changing the redundancy level is completed, the second data processing rate is then adopted, which can save more computing resources than adopting the first data processing rate.

[0087] Since garbage collection itself is a background task, it has no impact on the latency of host input and output; moreover, garbage collection itself also needs to move data, and no additional overhead will be generated during this process. In addition, the write-time redirected storage units selected for garbage collection are themselves storage units with a relatively large proportion of garbage data, and the remaining valid data are cold data that has not been modified for a long time. This will reduce the number of migrations of hot data and the number of writes, thereby improving the overall performance and lifespan of the storage system.

[0088] Online change of redundancy level, using the selection algorithm of garbage collection itself, automatically selects cold data for data migration, reduces the number of migrations of hot data, and reduces the number of data writes, thereby improving the overall performance and lifespan of the storage system. It solves the problem of additional write amplification during data migration when changing the redundancy level online, and solves the problem of redundant migration of hot data.

[0089] As Figure 4 shown, another embodiment of the present application provides a device for changing the redundancy level of a storage unit, including:

[0090] A data recovery module, configured to extract valid data from each storage unit and clear other data when receiving a redundancy level change instruction;

[0091] A redundancy level setting module, configured to set all vacant storage units as storage units at the new redundancy level according to the redundancy level change instruction;

[0092] A data aggregation module, configured to aggregate the extracted valid data and newly input data to obtain aggregated data;

[0093] A storage operation module, configured to store the aggregated data into the storage units at the new redundancy level.

[0094] In some embodiments, as Figure 5 shown, the above redundancy level change device further includes a setting module; the setting module is configured to set the data processing priority of each storage unit before extracting valid data from each storage unit and clearing other data.

[0095] Extracting valid data from each storage unit and clearing other data includes: extracting valid data from each of the storage units in sequence according to the data processing priority and clearing other data.

[0096] In some embodiments, such as Figure 6 shown, the above setting module includes:

[0097] A first partitioning unit, configured to obtain the proportion of garbage data in each of the storage units, and partition each of the storage units into multiple proportion levels according to the proportion of garbage data; the proportion of garbage data is positively correlated with the proportion level;

[0098] A second partitioning unit, configured to obtain the data storage duration in each of the storage units, and partition each of the storage units into multiple duration levels according to the data storage duration; the data storage duration is positively correlated with the duration level;

[0099] A first setting unit, configured to compare the proportion levels of the storage units, and set the proportion level to be positively correlated with the data processing priority;

[0100] A second setting unit, configured to compare the duration levels of the storage units with the same proportion level, and set the data processing priority of the storage units with the same proportion level to be positively correlated with the duration level.

[0101] In some embodiments, the first partitioning unit is further specifically configured to repeatedly detect the proportion of garbage data in each of the storage units, and re-partition each of the storage units into multiple proportion levels according to the proportion of garbage data detected most recently.

[0102] In some embodiments, the second partitioning unit is further specifically configured to repeatedly detect the data storage duration in each of the storage units, and re-partition each of the storage units into multiple duration levels according to the data storage duration detected most recently. The repeatedly detecting the data storage duration in each of the storage units includes periodically detecting the data storage duration in each of the storage units.

[0103] In some embodiments, the redundant level change instruction includes information for changing a storage unit with an old redundant level to a new redundant level; extracting valid data from each storage unit and clearing other data includes:

[0104] Extracting valid data from each storage unit and clearing other data at a first data processing rate;

[0105] In some embodiments, the redundancy level changing device further includes a second recycling module, configured to recycle each of the storage units at a second data processing rate after all the storage units are changed to the new redundancy level; wherein, the second data processing rate is less than the first data processing rate.

[0106] Another embodiment of the present application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. The processor executes the program to implement the method for changing the redundancy level of the storage unit according to any one of the foregoing embodiments.

[0107] As Figure 7 shown, the electronic device 10 may include: a processor 100, a memory 101, a bus 102, and a communication interface 103. The processor 100, the communication interface 103, and the memory 101 are connected through the bus 102; a computer program executable on the processor 100 is stored in the memory 101, and when the processor 100 runs the computer program, it executes the method provided by any one of the foregoing embodiments of the present application.

[0108] Among them, the memory 101 may include a high-speed random access memory (RAM: Random Access Memory), and may also include a non-volatile memory, such as at least one disk memory. Through at least one communication interface 103 (which may be wired or wireless), a communication connection between the system network element and at least one other network element is realized, and the Internet, a wide area network, a local area network, a metropolitan area network, etc. can be used.

[0109] The bus 102 may be an ISA bus, a PCI bus, an EISA bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. Among them, the memory 101 is used to store a program, and after receiving an execution instruction, the processor 100 executes the program. The method disclosed in any one of the foregoing embodiments of the present application may be applied to or implemented by the processor 100.

[0110] The processor 100 may be an integrated circuit chip with the ability to process signals. In the implementation process, each step of the above method can be completed by the integrated logic circuit of the hardware in the processor 100 or the instructions in the form of software. The above-mentioned processor 100 may be a general-purpose processor, which may include a central processing unit (CPU for short), a network processor (NP for short), etc.; it may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. It can implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments of the present application. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The steps of the method disclosed in combination with the embodiments of the present application can be directly embodied as being executed by the hardware decoding processor, or executed by a combination of the hardware and software modules in the decoding processor. The software module may be located in a mature storage medium in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. This storage medium is located in the memory 101, and the processor 100 reads the information in the memory 101 and combines its hardware to complete the steps of the above method.

[0111] The electronic device provided by the embodiments of the present application and the method provided by the embodiments of the present application are based on the same inventive concept and have the same beneficial effects as the method adopted, run, or implemented by it.

[0112] Another embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored, and the program is executed by a processor to implement the method for changing the redundancy level of the storage unit in any of the above embodiments.

[0113] Please refer to Figure 8 , which shows that the computer-readable storage medium is an optical disc 20, on which a computer program (i.e., a program product) is stored. When the computer program is run by a processor, it will execute the method provided in any of the foregoing embodiments.

[0114] It should be noted that examples of the computer-readable storage medium may also include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory, or other optical and magnetic storage media, which will not be elaborated here one by one.

[0115] The computer-readable storage medium provided by the above embodiments of the present application and the method provided by the embodiments of the present application are based on the same inventive concept and have the same beneficial effects as the methods adopted, run, or implemented by the application programs stored therein.

[0116] It should be noted that:

[0117] The term "module" is not intended to be limited to a specific physical form. Depending on the specific application, a module can be implemented as hardware, firmware, software, and / or a combination thereof. In addition, different modules can share common components or even be implemented by the same components. There may or may not be a clear boundary between different modules.

[0118] The algorithms and displays provided herein are not inherently related to any particular computer, virtual device, or other equipment. Various general-purpose devices can also be used in conjunction with the examples based herein. Based on the above description, the structures required to construct such devices are obvious. In addition, the present application is not directed to any particular programming language. It should be understood that the content of the present application described herein can be implemented using various programming languages, and the descriptions of specific languages above are for disclosing the best implementation manners of the present application.

[0119] It should be understood that although the steps in the flowcharts of the accompanying drawings are shown in sequence according to the indication of the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless there is a clear indication in this article, the execution of these steps is not strictly limited in order, and they can be executed in other orders. Moreover, at least a part of the steps in the flowcharts of the accompanying drawings can include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same moment, but can be executed at different moments, and their execution order is not necessarily sequential, but can be executed alternately or in turn with at least a part of other steps or sub-steps or stages of other steps.

[0120] The above-described embodiments only represent the implementation manners of the present application. The description is relatively specific and detailed, but it should not be construed as a limitation on the patent scope of the present application. It should be pointed out that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the appended claims.

Claims

1. A method for changing the redundancy level of a storage unit, applied to a computing device, characterized in that Including: When receiving a redundancy level change instruction, extracting valid data from each storage unit and clearing other data; According to the redundancy level change instruction, setting all vacant storage units as storage units of the new redundancy level; Aggregating the extracted valid data and newly input data to obtain aggregated data; Storing the aggregated data into the storage units of the new redundancy level; Before extracting valid data from each storage unit and clearing other data, the method further includes: Setting the data processing priorities of the storage units; The extracting valid data from each storage unit and clearing other data includes: sequentially extracting valid data from each storage unit and clearing other data according to the data processing priorities; The setting the data processing priorities of the storage units includes: Obtaining the proportion of garbage data in each storage unit, and dividing each storage unit into multiple proportion levels according to the proportion of garbage data; the proportion of garbage data is positively correlated with the proportion level; Obtaining the data storage duration in each storage unit, and dividing each storage unit into multiple duration levels according to the data storage duration; the data storage duration is positively correlated with the duration level; Comparing the proportion levels of the storage units, and setting the proportion level to be positively correlated with the data processing priority; Comparing the duration levels of the storage units in the same proportion level, and setting the data processing priorities of the storage units in the same proportion level to be positively correlated with the duration level.

2. The method according to claim 1, wherein The obtaining the proportion of garbage data in each storage unit and dividing each storage unit into multiple proportion levels according to the proportion of garbage data includes: Repeatedly detecting the proportion of garbage data in each storage unit, and re-dividing each storage unit into multiple proportion levels according to the proportion of garbage data detected most recently.

3. The method according to claim 1, characterized in that, The obtaining the data storage duration in each storage unit and dividing each storage unit into multiple duration levels according to the data storage duration includes: Repeatedly detecting the data storage duration in each storage unit, and re-dividing each storage unit into multiple duration levels according to the data storage duration detected most recently.

4. The method according to claim 3, wherein, The repeatedly detecting the data storage duration in each storage unit includes periodically detecting the data storage duration in each storage unit.

5. The method according to claim 1, wherein The redundancy level change instruction includes information for changing the storage units of the old redundancy level to the new redundancy level; The extracting valid data from each storage unit and clearing other data includes: Extracting valid data from each storage unit and clearing other data at a first data processing rate; The method further includes: after all the storage units are changed to the new redundancy level, recycling each storage unit at a second data processing rate; Wherein, the second data processing rate is less than the first data processing rate.

6. A redundant level changing device for a storage unit, applied to a computing device, characterized in that, Including: A data recycling module, configured to extract valid data from each storage unit and clear other data when receiving a redundancy level change instruction; A redundancy level setting module, configured to set all vacant storage units as storage units of a new redundancy level according to the redundancy level change instruction; A data aggregation module, configured to aggregate the extracted valid data and newly input data to obtain aggregated data; A storage operation module, configured to store the aggregated data into the storage units of the new redundancy level; A setting module, configured to set the data processing priorities of the storage units before the data recovery module extracts valid data from each storage unit and clears other data; Extracting valid data from each storage unit and clearing other data includes: sequentially extracting valid data from each storage unit and clearing other data according to the data processing priorities; The setting module includes: A first partitioning unit, configured to obtain the proportion of garbage data in each storage unit, and partition each storage unit into multiple proportion levels according to the proportion of garbage data; the proportion of garbage data is positively correlated with the proportion level; A second partitioning unit, configured to obtain the data storage duration in each storage unit, and partition each storage unit into multiple duration levels according to the data storage duration; the data storage duration is positively correlated with the duration level; A first setting unit, configured to compare the proportion levels of the storage units, and set the proportion levels to be positively correlated with the data processing priorities; A second setting unit, configured to compare the duration levels of the storage units with the same proportion level, and set the data processing priorities of the storage units with the same proportion level to be positively correlated with the duration levels.

7. An electronic device, characterized in that, It includes a memory, a processor, and a computer program stored on the memory and executable on the processor, and the processor executes the program to implement the method according to any one of claims 1-5.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that, The program is executed by the processor to implement the method according to any one of claims 1-5.

Citation Information

Patent Citations

  • Method and device for processing data, and flash memory device

    CN105335100A

  • Distributed data-storage system

    US20070208790A1

  • Data Redundancy Reconfiguration Using Logical Subunits

    US20200210090A1