Data processing method and device

By comprehensively considering the space usage rate of the partition namespace SSD and the storage partition usage rate, the data recovery speed is reasonably determined, which solves the problem of controlling the data recovery speed of the recycle bin, avoids idleness and waste of hard disk storage space, and improves the utilization of storage space. Rate.

CN114741326BActive Publication Date: 2024-09-24ALIBABA (CHINA) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210278389.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-21
Publication Date
2024-09-24
Estimated Expiration
2042-03-21

AI Technical Summary

Technical Problem

Existing partition namespace solid-state drives have problems in controlling the speed of data recovery in the recycle bin, resulting in idle and wasted hard drive storage space.

Method used

By determining the space usage of the target storage space and the storage partition usage, the data recycling speed is comprehensively determined, and the usage status of the storage partition is adjusted based on the recycling results to ensure that the data recycling speed is reasonable and to avoid the storage partition being idle.

Benefits of technology

It effectively avoids idleness and waste of storage partitions, improves storage space utilization, and ensures the timeliness and efficiency of data recovery.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114741326B
    Figure CN114741326B
Patent Text Reader

Abstract

Embodiments of the present specification provide a data processing method and device, wherein the data processing method includes: determining at least two storage partitions of a target storage space, and the amount of data stored in the at least two storage partitions, and determining the space utilization rate of the target storage space based on the amount of data, determining the storage partition utilization rate of the target storage space based on the usage status of the at least two storage partitions, determining a data recovery speed of a first type of data in the target storage partition based on the space utilization rate and the storage partition utilization rate, and recovering the first type of data according to the data recovery speed, wherein the target storage partition is one of the at least two storage partitions, and adjusting the usage status of the target storage partition based on the recovery result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present specification relate to the field of computer technology, and in particular, to a data processing method. Background Art

[0002] As a new type of NVME (NVM Express) SSD, the Zoned Namespace Solid State Disk (ZNS SSD) has been adapted and applied by major Internet manufacturers with its efficient protocol interaction and good performance. The biggest advantage of the Zoned Namespace SSD is that it standardizes the interaction protocol with upper-layer applications, divides the SSD into partitions, opens the partition information to upper-layer applications, and allows applications to perform partition storage based on their own projects. Project data with the same life cycle is written to the same partition, and an end-to-end integrated garbage collection strategy is used to achieve high performance and low cost of the storage system.

[0003] Partition namespace solid state drives provide a recycle bin function, which helps to recover some data in emergency situations such as when users accidentally delete data or when software vulnerabilities appear, thereby improving the system's disaster recovery capabilities. When users do not need to recover data in the recycle bin, the system can recycle data in the recycle bin to ensure the availability of different partitions in the hard disk. However, if the recycling speed of the recycle bin data cannot be reasonably controlled, it may cause idle and wasteful hard disk storage space. Therefore, an effective method is urgently needed to solve this problem. Summary of the invention

[0004] In view of this, an embodiment of this specification provides a data processing method. One or more embodiments of this specification also relate to a data processing device, a computing device, a computer-readable storage medium and a computer program to solve the technical defects existing in the prior art.

[0005] According to a first aspect of an embodiment of this specification, a data processing method is provided, including:

[0006] Determine at least two storage partitions of the target storage space and the amount of data stored in the at least two storage partitions, and determine the space usage rate of the target storage space according to the amount of data;

[0007] Determining a storage partition usage rate of the target storage space according to the usage status of the at least two storage partitions;

[0008] Determine, according to the space usage rate and the storage partition usage rate, a data recovery speed of the first type of data in the target storage partition, and perform recovery processing on the first type of data according to the data recovery speed, wherein the target storage partition is one of the at least two storage partitions;

[0009] The usage status of the target storage partition is adjusted according to the recovery result.

[0010] Optionally, the determining of at least two storage partitions of the target storage space and the amount of data stored in the at least two storage partitions includes:

[0011] Determine at least two storage partitions of the target storage space;

[0012] A first data volume of the first type of data and a second data volume of the second type of data stored in the at least two storage partitions are determined.

[0013] Optionally, determining the space usage rate of the target storage space according to the data volume includes:

[0014] Adding a first data amount of the first type of data and a second data amount of the second type of data stored in the at least two storage partitions;

[0015] A ratio of the sum processing result to the space capacity of the target storage space is determined, and the ratio is determined as the space utilization rate of the target storage space.

[0016] Optionally, determining a first data volume of the first type of data and a second data volume of the second type of data stored in the at least two storage partitions includes:

[0017] Scanning the storage partition table of the target storage space to obtain a first data length of the first type of data and a second data length of the second type of data in different storage partitions;

[0018] A first data volume of the first type of data and a second data volume of the second type of data stored in the at least two storage partitions are determined according to the first data length and the second data length.

[0019] Optionally, determining the storage partition usage rate of the target storage space according to the usage status of the at least two storage partitions includes:

[0020] Determine a first number of storage partitions in an idle state and a second number of storage partitions in a reclaimable state among the at least two storage partitions;

[0021] The storage partition usage rate of the target storage space is determined according to the first number, the second number, and the total number of storage partitions included in the target storage space.

[0022] Optionally, determining the storage partition usage rate of the target storage space according to the first number, the second number, and the total number of storage partitions included in the target storage space includes:

[0023] performing a summation process on the first quantity and the second quantity;

[0024] The storage partition usage rate of the target storage space is determined according to the ratio of the sum processing result to the total number of storage partitions included in the target storage space.

[0025] Optionally, determining the data recovery speed of the first type of data in the target storage partition according to the space usage rate and the storage partition usage rate includes:

[0026] If the space usage rate is greater than or equal to a first preset threshold, determining that the data recovery speed of the first type of data in the target storage partition is a first recovery speed;

[0027] If the space usage rate is less than the first preset threshold and greater than or equal to the second preset threshold, the data recovery speed of the first type of data in the target storage partition is determined to be the second recovery speed, wherein the first recovery speed is greater than the second recovery speed.

[0028] Optionally, the data processing method further includes:

[0029] If the space usage is less than the second preset threshold, determining whether the storage partition usage is greater than or equal to the first preset threshold;

[0030] If so, determining that the data recovery speed of the first type of data in the target storage partition is a first recovery speed;

[0031] If not, the data recovery speed of the first type of data in the target storage partition is determined to be the second recovery speed.

[0032] Optionally, the first type of data is recycle bin data;

[0033] Accordingly, the recycling of the first type of data according to the data recycling speed includes:

[0034] According to the data recovery speed, the first type of data in the target storage partition is converted into a third type of data, wherein the third type of data is invalid data.

[0035] Optionally, adjusting the usage state of the target storage partition according to the recycling result includes:

[0036] When it is determined that the data contained in the target storage partition is the third type of data, erasing the data in the target storage partition;

[0037] When erasing is completed, the usage state of the target storage partition is adjusted to an idle state.

[0038] According to a second aspect of an embodiment of this specification, there is provided a data processing device, including:

[0039] A first determining module is configured to determine at least two storage partitions of the target storage space and the amount of data stored in the at least two storage partitions, and determine the space usage rate of the target storage space according to the amount of data;

[0040] A second determining module is configured to determine a storage partition usage rate of the target storage space according to the usage status of the at least two storage partitions;

[0041] a recycling module configured to determine a data recycling speed of the first type of data in a target storage partition according to the space utilization rate and the storage partition utilization rate, and to recycle the first type of data according to the data recycling speed, wherein the target storage partition is one of the at least two storage partitions;

[0042] The adjustment module is configured to adjust the usage status of the target storage partition according to the recovery result.

[0043] According to a third aspect of an embodiment of this specification, a computing device is provided, including:

[0044] Memory and processor;

[0045] The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement any step of the data processing method.

[0046] According to a fourth aspect of the embodiments of this specification, a computer-readable storage medium is provided, which stores computer-executable instructions, and when the instructions are executed by a processor, the steps of any one of the data processing methods are implemented.

[0047] According to a fifth aspect of the embodiments of this specification, a computer program is provided, wherein when the computer program is executed in a computer, the computer is caused to execute the steps of the above-mentioned data processing method.

[0048] An embodiment of the present specification determines at least two storage partitions of a target storage space and the amount of data stored in the at least two storage partitions, determines the space utilization rate of the target storage space based on the amount of data, determines the storage partition utilization rate of the target storage space based on the usage status of the at least two storage partitions, determines the data recovery speed of a first type of data in the target storage partition based on the space utilization rate and the storage partition utilization rate, and recovers the first type of data according to the data recovery speed, wherein the target storage partition is one of the at least two storage partitions, and the usage status of the target storage partition is adjusted according to the recovery result.

[0049] The embodiments of this specification comprehensively determine the data recovery speed of the first type of data in the target storage partition through the space utilization rate and the storage partition utilization rate, and then recover the first type of data in the target storage partition according to the data recovery speed. This is beneficial for recovering the first type of data in the target storage partition at a reasonable data recovery speed to ensure that the target storage partition can be released in time, thereby ensuring the utilization rate of the storage partition in the target storage space. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] Figure 1 is a flow chart of a data processing method provided by an embodiment of this specification;

[0051] Figure 2a is a schematic diagram of a storage partition table provided by an embodiment of this specification;

[0052] Figure 2b is a schematic diagram of a statistical process provided by an embodiment of this specification;

[0053] Figure 3a It is a schematic diagram of a data storage ratio of a first target storage space provided by an embodiment of this specification;

[0054] Figure 3b is a schematic diagram of a data storage ratio of a second target storage space provided by an embodiment of the present specification;

[0055] Figure 4 is a processing flow chart of a data processing method provided by an embodiment of this specification;

[0056] Figure 5 is a structural schematic diagram of a data processing device provided by an embodiment of this specification;

[0057] Figure 6 It is a structural block diagram of a computing device provided by an embodiment of this specification. DETAILED DESCRIPTION

[0058] Many specific details are described in the following description to facilitate a full understanding of this specification. However, this specification can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of this specification, so this specification is not limited to the specific implementation disclosed below.

[0059] The terms used in one or more embodiments of this specification are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of this specification. The singular forms of "a", "said" and "the" used in one or more embodiments of this specification and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in one or more embodiments of this specification refers to and includes any or all possible combinations of one or more associated listed items.

[0060] It should be understood that although the terms first, second, etc. may be used to describe various information in one or more embodiments of this specification, this information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of this specification, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0061] First, the terms involved in one or more embodiments of this specification are explained.

[0062] Standalone storage engine: In a distributed storage system, a functional node responsible for managing the storage of user data on storage media. Generally, a storage server has one storage node process, which is responsible for managing multiple disks on the server.

[0063] ZNS disk: A disk that provides the standard Zoned Namespaces (ZNS) protocol. The characteristic of the ZNS protocol is that the logical address space of the Namespace is divided into multiple zones, providing users with read, write and zone management interfaces.

[0064] Zone: The smallest management unit on a ZNS disk, which supports operations such as append writing and random reading. It does not require overall erasure and cannot be partially erased or overwritten.

[0065] Recycle Bin: After users delete data, the data will be retained for a period of time if there is sufficient storage space. In the event of accidental deletion by the user or software bug, the data can be restored for the user.

[0066] Data types: valid data, recycle bin data, invalid data.

[0067] In this specification, a data processing method is provided. This specification also relates to a data processing apparatus, a computing device, a computer-readable storage medium, and a computer program, which are described in detail one by one in the following embodiments.

[0068] Figure 1 A flow chart of a data processing method provided according to an embodiment of the present specification is shown, which specifically includes the following steps.

[0069] Step 102: determine at least two storage partitions of the target storage space and the amount of data stored in the at least two storage partitions, and determine the space usage rate of the target storage space according to the amount of data.

[0070] Specifically, the target storage space is a Zoned Namespace SolidState Disk (ZNS SSD). Storage partitions are Zones; data in a Zoned Namespace SSD is stored in the form of partitions. Specifically, the Zoned Namespace SSD can be divided into multiple storage partitions (Zones), and the partition information is opened to upper-layer applications. The upper-layer applications can partition and store data according to their own needs, and data with the same life cycle is written to the same storage partition.

[0071] Since storage partitions support operations such as append writes and random reads, but the data in the storage partitions needs to be erased as a whole, and partial erase and overwrite are not allowed. Therefore, if there is recyclable data in the storage partition, if it is not recycled, the data in the storage partition cannot be erased, and the storage partition cannot be released, that is, the storage partition cannot be reused, which will cause idle and wasteful space.

[0072] Based on this, the embodiments of this specification can determine the space utilization rate of the target storage space according to the amount of data stored in different storage partitions in the target storage space, and determine the recovery speed of recyclable data in each storage partition according to the space utilization rate, thereby preventing the available Zone resources in the target storage space from being exhausted.

[0073] In a specific implementation, determining at least two storage partitions of the target storage space and the amount of data stored in the at least two storage partitions includes:

[0074] Determine at least two storage partitions of the target storage space;

[0075] A first data volume of the first type of data and a second data volume of the second type of data stored in the at least two storage partitions are determined.

[0076] Further, determining the space usage rate of the target storage space according to the data volume includes:

[0077] Adding a first data amount of the first type of data and a second data amount of the second type of data stored in the at least two storage partitions;

[0078] A ratio of the sum processing result to the space capacity of the target storage space is determined, and the ratio is determined as the space utilization rate of the target storage space.

[0079] Specifically, since each storage partition in the target storage space can store three types of data, namely valid data, recycle bin data and invalid data, after the user deletes the valid data, the valid data is converted to recycle bin data, and the recycle bin data is recycled and converted to invalid data.

[0080] The first type of data is the recycle bin data, and the second type of data is the valid data.

[0081] In practical applications, a data water level driven strategy can be used to determine the recovery speed of Recycle Bin data. The data water level consists of two parts: valid data and Recycle Bin data. Specifically, the ratio of the sum of the two parts of data to the entire capacity of the SSD of the partition namespace can be determined to determine whether to trigger the recovery of Recycle Bin data and the recovery speed.

[0082] Therefore, at least two storage partitions of the target storage space can be determined first, and then the amount of recycle bin data and the amount of valid data stored in each storage partition in the at least two storage partitions can be determined. Then, the sum of the amount of recycle bin data and the amount of valid data in each storage partition can be calculated to obtain the first summation result corresponding to each storage partition. Then, the sum of the first summation result corresponding to each storage partition in the target storage space can be calculated to obtain the second summation result. Finally, the ratio of the second summation result to the space capacity of the target storage space can be calculated to obtain the space utilization rate of the target storage space.

[0083] In a specific implementation, determining a first data volume of the first type of data and a second data volume of the second type of data stored in the at least two storage partitions includes:

[0084] Scanning the storage partition table of the target storage space to obtain a first data length of the first type of data and a second data length of the second type of data in different storage partitions;

[0085] A first data volume of the first type of data and a second data volume of the second type of data stored in the at least two storage partitions are determined according to the first data length and the second data length.

[0086] Specifically, the storage partition table is called Chunk Table.

[0087] The schematic diagram of the storage partition table provided in the embodiment of this specification is as follows Figure 2a As shown in the figure. Since each storage partition contains multiple storage blocks, namely Chunks, and the storage partition table contains the storage partitions in the target storage space, as well as the data type and data length stored in each storage block in each storage partition. Therefore, the data length of the valid data stored in different storage partitions in the target storage space, as well as the data length of the recycle bin data, can be obtained by scanning and counting the storage partition table. The schematic diagram of the specific statistical process is shown in the figure. Figure 2b As shown, first, the background statistical task is received, the storage partition table is traversed, and it is determined whether the data obtained by the traversal is valid data. If it is valid data, the data length of the valid data is accumulated; if it is not valid data, it is determined whether it is recycle bin data. If it is recycle bin data, the data length of the recycle bin data is accumulated. If it is not recycle bin data, or after accumulating the data lengths of the valid data and the recycle bin data, it can be determined whether the traversal is completed. If it is completed, the total length of the valid data and / or the total length of the recycle bin data is output to determine the data volume of the valid data in the target storage space and the data volume of the recycle bin data according to the total length.

[0088] In practical applications, the data volume can be determined based on the storage type of the data in the storage partition and the data length. For example, the int type represents 4 bytes, 1 byte = 8 bits, that is, 1B = 8b.

[0089] Step 104: Determine the storage partition usage rate of the target storage space according to the usage status of the at least two storage partitions.

[0090] Specifically, after determining the space utilization rate of the target storage space through the aforementioned process, the recovery speed of the Recycle Bin data can be determined based on the space utilization rate. However, if only the space utilization rate is used as the judgment criterion for driving the recovery of the Recycle Bin data, the proportion of invalid data will be too high while the proportion of valid data and Recycle Bin data will be low, resulting in the storage partition being unable to be recovered in time, thereby causing a waste of the storage partition.

[0091] Therefore, the embodiments of the present specification further determine the usage status of each storage partition in the target storage space, so as to determine the storage partition usage rate of the target storage space according to the usage status, and comprehensively determine the recovery speed of the recycle bin data according to the storage partition usage rate, i.e., the aforementioned space usage rate, so that the recycle bin data of each storage partition can be recovered in time, and data can be erased and space can be released for some storage partitions based on the recovery results, which is conducive to ensuring the utilization rate of the storage partitions in the target storage space.

[0092] In actual applications, the usage status of a storage partition includes but is not limited to an idle state, an open state, a closed state, an offline state, a reclaimable state, a reserved state, etc.

[0093] Among them, the idle state, that is, the unused state, can be opened for writing; the open state, that is, the Zone in the open state, can be written to additionally; the closed state, that is, after the Zone is full, it can be closed. After closing, it can provide random reading but not writing; the offline state, that is, after the Zone is damaged, it can enter the offline state and cannot be used anymore; the recyclable state, that is, the data stored in the storage partition are all invalid data and can be erased as a whole, that is, recyclable; the reserved state, that is, the storage partition is in a standby state and can only be used when the preset conditions are met, and it is currently unavailable.

[0094] It can be seen that if the storage partition is in the idle state, open state or reclaimable state, it means that the storage partition is available; if the storage partition is in the closed state, offline state or reserved state, it means that the storage partition is not available.

[0095] Therefore, the storage partition usage rate of the target storage space is determined according to the usage status of each storage partition in the target storage space, which can be specifically achieved in the following ways:

[0096] Determine a first number of storage partitions in an idle state and a second number of storage partitions in a reclaimable state among the at least two storage partitions;

[0097] The storage partition usage rate of the target storage space is determined according to the first number, the second number, and the total number of storage partitions included in the target storage space.

[0098] Further, determining the storage partition usage rate of the target storage space according to the first number, the second number, and the total number of storage partitions included in the target storage space includes:

[0099] performing a summation process on the first quantity and the second quantity;

[0100] The storage partition usage rate of the target storage space is determined according to the ratio of the sum processing result to the total number of storage partitions included in the target storage space.

[0101] Specifically, to calculate the storage partition usage rate of the target storage space, that is, to calculate the ratio of the number of used (unusable) storage partitions in the target storage space to the total number of storage partitions in the target storage space. In the embodiment of this specification, the number of storage partitions in the target storage space that are in a usable state is first determined, and then the ratio of the number to the total number of storage partitions in the target storage space is calculated, and the difference between 1 and the ratio is used as the storage partition usage rate of the target storage space.

[0102] In actual applications, as mentioned above, if a storage partition is in an idle state or a reclaimable state, it means that the storage partition can be used, that is, it is in a usable state; and if the storage partition is in a closed state, an offline state, or a reserved state, it means that the storage partition is not available, that is, it is in an unusable state.

[0103] Therefore, the number of storage partitions in the target storage space that are in a usable state is determined, specifically, the first number of storage partitions in the target storage space that are in an idle state and the second number of storage partitions in a reclaimable state are determined, and then the storage partition utilization rate of the target storage space can be determined by formula (1).

[0104] Storage partition usage = 1-(first quantity + second quantity) / total storage partitions Formula (1)

[0105] The total number of storage partitions is the total number of storage partitions in the target storage space.

[0106] Alternatively, if there is a storage partition in the target storage space that is in an open state, then the storage partition is also in a usable state. Therefore, when determining the number of storage partitions in the target storage space that are in a usable state, in addition to determining the first number of storage partitions in the target storage space that are in an idle state and the second number of storage partitions in a recyclable state, the third number of storage partitions in an open state can also be determined, and then the first number, the second number, and the third number are summed, and then the ratio of the summed result to the total number of storage partitions in the target storage space is determined, and the difference between 1 and the ratio is used as the storage partition usage rate of the target storage space.

[0107] Alternatively, when a storage partition is in a closed state, offline state, or reserved state, it means that the storage partition is unavailable. Therefore, to determine the storage partition usage rate of the target storage space, the fourth number of storage partitions in the closed state, the fifth number of storage partitions in the offline state, and the sixth number of storage partitions in the reserved state in the target storage space can also be determined first, and then the fourth number, the fifth number, and the sixth number are summed, and then the ratio of the summed result to the total number of storage partitions in the target storage space is determined, and the ratio is determined as the storage partition usage rate of the target storage space.

[0108] Step 106, determining a data recovery speed of the first type of data in the target storage partition according to the space utilization rate and the storage partition utilization rate, and recovering the first type of data according to the data recovery speed, wherein the target storage partition is one of the at least two storage partitions.

[0109] Specifically, after determining the space utilization and storage partition utilization, the data recovery speed of the recycle bin data in each storage partition can be comprehensively determined based on the space utilization and storage partition utilization to ensure the accuracy of the determination result of the data recovery speed.

[0110] After determining the data recovery speed of the recycle bin data, the recycle bin data in each storage partition can be recovered according to the data recovery speed, so as to timely erase the data in some storage partitions as a whole according to the recovery results, thereby releasing these storage partitions and improving the utilization rate of the storage partitions in the target storage space.

[0111] In a specific implementation, determining the data recovery speed of the first type of data in the target storage partition according to the space utilization rate and the storage partition utilization rate includes:

[0112] If the space usage rate is greater than or equal to a first preset threshold, determining that the data recovery speed of the first type of data in the target storage partition is a first recovery speed;

[0113] If the space usage rate is less than the first preset threshold and greater than or equal to the second preset threshold, determining that the data recovery speed of the first type of data in the target storage partition is the second recovery speed, wherein the first recovery speed is greater than the second recovery speed;

[0114] If the space usage is less than the second preset threshold, determining whether the storage partition usage is greater than or equal to the first preset threshold;

[0115] If so, determining that the data recovery speed of the first type of data in the target storage partition is a first recovery speed;

[0116] If not, the data recovery speed of the first type of data in the target storage partition is determined to be the second recovery speed.

[0117] Specifically, the first type of data is the recycle bin data.

[0118] Since the storage partitions in the target storage space store data in the form of storage blocks, and the data recovery speed indicates the number of storage blocks recovered per unit time, for example, if the data recovery speed is 3, it means that the recycle bin data stored in 3 storage blocks need to be recovered per unit time. In addition, since the recycle bin data is recovered, that is, the recycle bin data is converted into invalid data, therefore, if the data recovery speed is 3, it means that the recycle bin data stored in 3 storage blocks need to be converted into invalid data per unit time.

[0119] Since storage partitions only support overall erasure, that is, when all the data stored in a storage partition are invalid data, the data in the storage partition can be erased as a whole to release the storage partition so that the storage partition can be reused to improve the storage partition utilization rate of the target storage space. The speed of data recovery in the recycle bin determines whether the storage partition can be released and reused in time.

[0120] Therefore, after determining the space utilization rate and storage partition utilization rate, the embodiments of this specification can comprehensively determine the data recovery speed of the recycle bin data in the target storage partition based on these two parameters. Among them, the space utilization rate represents the ratio of the amount of data stored in the target storage space to the space capacity of the target storage space. The larger the space utilization rate, the more data is stored in the target storage space, which represents the available storage space in the target storage space, that is, the fewer storage partitions. In this case, it is necessary to release some storage partitions in time for data storage; the storage partition utilization rate represents the ratio of the number of unusable storage partitions in the target storage space to the total number of storage partitions. The larger the storage partition utilization rate, the fewer storage partitions are available in the target storage space. In this case, it is also necessary to release some storage partitions in time.

[0121] Based on this, the embodiments of this specification may first compare the space utilization rate with the first preset threshold value to determine the size relationship between the space utilization rate and the first preset threshold value. If it is determined that the space utilization rate is greater than or equal to the first preset threshold value, it indicates that the space utilization rate is large, and some storage partitions need to be released in time. The condition for the storage partition to be released is that the data stored in the storage partition are all invalid data. Therefore, in the case of storing recycle bin data in the storage partition, it is necessary to speed up the recovery speed of the recycle bin data, specifically, to speed up the speed of converting the recycle bin data into invalid data (fast recovery). The embodiments of this specification name the speed of accelerated recovery as the first recovery speed.

[0122] If it is determined that the space utilization rate is less than the first preset threshold, it can be further determined whether the space utilization rate is greater than or equal to the second preset threshold. If so, it can be determined that the space utilization rate in the target storage space is small, that is, there are enough storage partitions in the target storage space that are in a usable state. In this case, there is no need to quickly release the used storage partitions. Therefore, the recycle bin data can be converted into invalid data (slow recovery) according to the second recovery speed, where the first recovery speed is greater than the second recovery speed.

[0123] If it is determined that the space utilization rate is less than the second preset threshold, it is necessary to further determine whether the storage partition utilization rate is greater than or equal to the first preset threshold. If so, it indicates that the storage partition utilization rate is large and some storage partitions need to be released in time. Therefore, the recycling bin data can be converted into invalid data at the first recycling speed (fast recycling).

[0124] If it is determined that the storage partition usage rate is less than the first preset threshold, it can be determined that the storage partition usage rate in the target storage space is small, that is, there are enough storage partitions in the target storage space that are in a usable state. In this case, there is no need to quickly release the used storage partitions. Therefore, the recycle bin data can be converted into invalid data (slow recycling) according to the second recycling speed.

[0125] In the embodiments of the present specification, the recovery speed of the recycle bin data in the target storage partition is comprehensively determined by the space utilization rate and the storage partition utilization rate, which is beneficial to the accuracy of the determination result of the recovery speed.

[0126] In a specific implementation, the first type of data is recycle bin data; the first type of data is recycled according to the data recycling speed, specifically, according to the data recycling speed, the first type of data in the target storage partition is converted into third type of data, wherein the third type of data is invalid data.

[0127] Specifically, the first type of data is recycle bin data, and the third type of data is invalid data.

[0128] The recycle bin data is recycled according to the data recycling speed, specifically, the recycle bin data is converted into invalid data according to the data recycling speed.

[0129] After all the recycle bin data in the target storage partition is converted into invalid data, if there is still valid data in the target storage partition, this part of valid data can be moved to other storage partitions to achieve overall erasure of the invalid data in the target storage partition, thereby releasing the target storage partition in time.

[0130] Step 108: Adjust the usage status of the target storage partition according to the recovery result.

[0131] In specific implementation, adjusting the usage status of the target storage partition according to the recovery result includes:

[0132] When it is determined that the data contained in the target storage partition is the third type of data, erasing the data in the target storage partition;

[0133] When erasing is completed, the usage state of the target storage partition is adjusted to an idle state.

[0134] Specifically, as mentioned above, when the data in the target storage partition are all invalid data, the data in the target storage partition can be erased as a whole. After erasure, since no data is stored in the target storage partition, the target storage partition can be released and its state can be adjusted to an idle state to indicate that the target storage partition can be used.

[0135] The schematic diagram of the data storage ratio of the first target storage space provided in the embodiment of this specification is as follows Figure 3a As shown, Figure 3a In the target storage space, invalid data accounts for 10% of the total space, recycle bin data accounts for 60% of the total space, valid data accounts for 20% of the total space, and the storage partition usage rate of the target storage space is 90%.

[0136] The schematic diagram of the data storage ratio of the second target storage space provided in the embodiment of this specification is as follows Figure 3b As shown, Figure 3b The storage partition usage and the ratio of different types of data to the total space shown in Figure 3a The total space occupied by the recycle bin data has changed to 55%, the total space occupied by the invalid data has changed to 5%, and the storage partition usage has changed to 80%. The reason for the change is that the invalid data in some storage partitions has been completely erased and released, so that the storage partition usage, invalid data, and the amount of recycle bin data in the entire target storage space have all decreased.

[0137] In the embodiments of this specification, if only the space utilization rate is referred to determine the recovery speed of the recycle bin data, there may be invalid data holes in the storage partition, resulting in the inability to release the storage partition. Therefore, the embodiments of this specification not only consider the factor of space utilization rate, but also use the storage partition utilization rate as one of the factors driving the recovery of the recycle bin data. Since the difference between the storage partition utilization rate and the space utilization rate reflects the proportion of invalid data, considering the storage partition utilization rate can be considered to be taking the proportion of invalid data as one of the factors driving the recovery of the recycle bin data, which more truly reflects the space utilization rate of the target storage space, and can solve the problem that the storage partition cannot be released in time when there are too many invalid data and invalid data occupies a large number of storage partitions.

[0138] An embodiment of the present specification determines at least two storage partitions of a target storage space and the amount of data stored in the at least two storage partitions, determines the space utilization rate of the target storage space based on the amount of data, determines the storage partition utilization rate of the target storage space based on the usage status of the at least two storage partitions, determines the data recovery speed of a first type of data in the target storage partition based on the space utilization rate and the storage partition utilization rate, and recovers the first type of data according to the data recovery speed, wherein the target storage partition is one of the at least two storage partitions, and the usage status of the target storage partition is adjusted according to the recovery result.

[0139] The embodiments of this specification comprehensively determine the data recovery speed of the first type of data in the target storage partition through the space utilization rate and the storage partition utilization rate, and then recover the first type of data in the target storage partition according to the data recovery speed. This is beneficial for recovering the first type of data in the target storage partition at a reasonable data recovery speed to ensure that the target storage partition can be released in time, thereby ensuring the utilization rate of the storage partition in the target storage space.

[0140] The following combination Figure 4 , taking the application of the data processing method provided in this specification in a practical scenario as an example, the data processing method is further explained. Figure 4 A processing flow chart of a data processing method provided by an embodiment of the present specification is shown, which specifically includes the following steps.

[0141] Step 402: determine at least two storage partitions of the target storage space.

[0142] Step 404: determine a first data volume of valid data stored in at least two storage partitions and a second data volume of recycle bin data.

[0143] Step 406: Add the first data volume of the valid data stored in at least two storage partitions and the second data volume of the recycle bin data.

[0144] Step 408, determining a ratio of the sum processing result to the space capacity of the target storage space, and determining the ratio as the space utilization rate of the target storage space.

[0145] Step 410: Determine a first number of storage partitions in an idle state and a second number of storage partitions in a reclaimable state among at least two storage partitions.

[0146] Step 412, adding the first quantity and the second quantity.

[0147] Step 414: Determine the storage partition usage rate of the target storage space according to the ratio of the sum processing result to the total number of storage partitions included in the target storage space.

[0148] Step 416, determining whether the space usage rate is greater than or equal to a first preset threshold.

[0149] If yes, execute step 418; if no, execute step 420.

[0150] Step 418: determine that the data recovery speed of the recycle bin data in the target storage partition is a first recovery speed.

[0151] Step 420, determining whether the space usage rate is greater than or equal to a second preset threshold.

[0152] If yes, execute step 422; if no, execute step 424.

[0153] Step 422: determine that the data recovery speed of the recycle bin data in the target storage partition is a second recovery speed, wherein the first recovery speed is greater than the second recovery speed.

[0154] Step 424, determining whether the storage partition usage is greater than or equal to a third preset threshold.

[0155] If yes, execute step 418 ; if no, execute step 422 .

[0156] Step 426: Convert the recycle bin data in the target storage partition into invalid data according to the first recycling speed or the second recycling speed.

[0157] Step 428: When it is determined that the data in the target storage partition is invalid data, the data in the target storage partition is erased.

[0158] Step 430: When the erasure is completed, the use state of the target storage partition is adjusted to an idle state.

[0159] The embodiments of this specification comprehensively determine the data recovery speed of the recycle bin data in the target storage partition through the space utilization rate and the storage partition utilization rate, and then recover the recycle bin data in the target storage partition according to the data recovery speed. This is beneficial for recovering the recycle bin data in the target storage partition at a reasonable data recovery speed to ensure that the target storage partition can be released in time, thereby ensuring the utilization rate of the storage partition in the target storage space.

[0160] Corresponding to the above method embodiment, this specification also provides a data processing device embodiment, Figure 5 FIG. 1 is a schematic diagram showing the structure of a data processing device provided by an embodiment of the present specification. Figure 5As shown, the device comprises:

[0161] A first determining module 502 is configured to determine at least two storage partitions of a target storage space and the amount of data stored in the at least two storage partitions, and determine a space usage rate of the target storage space according to the amount of data;

[0162] A second determining module 504 is configured to determine a storage partition usage rate of the target storage space according to the usage status of the at least two storage partitions;

[0163] a recycling module 506, configured to determine a data recycling speed of the first type of data in a target storage partition according to the space utilization rate and the storage partition utilization rate, and to recycle the first type of data according to the data recycling speed, wherein the target storage partition is one of the at least two storage partitions;

[0164] The adjustment module 508 is configured to adjust the usage status of the target storage partition according to the recycling result.

[0165] Optionally, the first determining module 502 is further configured to:

[0166] Determine at least two storage partitions of the target storage space;

[0167] A first data volume of the first type of data and a second data volume of the second type of data stored in the at least two storage partitions are determined.

[0168] Optionally, the first determining module 502 is further configured to:

[0169] Adding a first data amount of the first type of data and a second data amount of the second type of data stored in the at least two storage partitions;

[0170] A ratio of the sum processing result to the space capacity of the target storage space is determined, and the ratio is determined as the space utilization rate of the target storage space.

[0171] Optionally, the first determining module 502 is further configured to:

[0172] Scanning the storage partition table of the target storage space to obtain a first data length of the first type of data and a second data length of the second type of data in different storage partitions;

[0173] A first data volume of the first type of data and a second data volume of the second type of data stored in the at least two storage partitions are determined according to the first data length and the second data length.

[0174] Optionally, the second determining module 504 is further configured to:

[0175] Determine a first number of storage partitions in an idle state and a second number of storage partitions in a reclaimable state among the at least two storage partitions;

[0176] The storage partition usage rate of the target storage space is determined according to the first number, the second number, and the total number of storage partitions included in the target storage space.

[0177] Optionally, the second determining module 504 is further configured to:

[0178] performing a summation process on the first quantity and the second quantity;

[0179] The storage partition usage rate of the target storage space is determined according to the ratio of the sum processing result to the total number of storage partitions included in the target storage space.

[0180] Optionally, the recycling module 506 is further configured to:

[0181] If the space usage rate is greater than or equal to a first preset threshold, determining that the data recovery speed of the first type of data in the target storage partition is a first recovery speed;

[0182] If the space usage rate is less than the first preset threshold and greater than or equal to the second preset threshold, the data recovery speed of the first type of data in the target storage partition is determined to be the second recovery speed, wherein the first recovery speed is greater than the second recovery speed.

[0183] Optionally, the recycling module 506 is further configured to:

[0184] If the space usage is less than the second preset threshold, determining whether the storage partition usage is greater than or equal to the first preset threshold;

[0185] If so, determining that the data recovery speed of the first type of data in the target storage partition is a first recovery speed;

[0186] If not, the data recovery speed of the first type of data in the target storage partition is determined to be the second recovery speed.

[0187] Optionally, the first type of data is recycle bin data;

[0188] Accordingly, the recycling module 506 is further configured to:

[0189] According to the data recovery speed, the first type of data in the target storage partition is converted into a third type of data, wherein the third type of data is invalid data.

[0190] Optionally, the adjustment module 508 is further configured to:

[0191] When it is determined that the data contained in the target storage partition is the third type of data, erasing the data in the target storage partition;

[0192] When erasing is completed, the usage state of the target storage partition is adjusted to an idle state.

[0193] The above is a schematic scheme of a data processing device of this embodiment. It should be noted that the technical scheme of the data processing device and the technical scheme of the above data processing method belong to the same concept, and the details of the technical scheme of the data processing device that are not described in detail can be referred to the description of the technical scheme of the above data processing method.

[0194] Figure 6 The block diagram of a computing device 600 according to an embodiment of the present specification is shown. The components of the computing device 600 include but are not limited to a memory 610 and a processor 620. The processor 620 is connected to the memory 610 via a bus 630, and the database 650 is used to store data.

[0195] The computing device 600 also includes an access device 640 that enables the computing device 600 to communicate via one or more networks 660. Examples of these networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 640 may include one or more of any type of network interface (e.g., a network interface card (NIC)) whether wired or wireless, such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a World Wide Interoperability for Microwave Access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, a near field communication (NFC) interface, and the like.

[0196] In one embodiment of the present specification, the above components of the computing device 600 and Figure 6 Other components not shown in the figure may also be connected to each other, for example, via a bus. It should be understood that Figure 6 The computing device structure block diagram shown is only for the purpose of illustration, and is not intended to limit the scope of this specification. Those skilled in the art can add or replace other components as needed.

[0197] The computing device 600 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smart phone), a wearable computing device (e.g., a smart watch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or PC. The computing device 600 may also be a mobile or stationary server.

[0198] The processor 620 is used to execute the following computer executable instructions, which implement the steps of the above data processing method when executed by the processor.

[0199] The above is a schematic scheme of a computing device of this embodiment. It should be noted that the technical scheme of the computing device and the technical scheme of the above data processing method belong to the same concept, and the details not described in detail in the technical scheme of the computing device can be referred to the description of the technical scheme of the above data processing method.

[0200] An embodiment of the present specification further provides a computer-readable storage medium storing computer-executable instructions, which can implement the steps of the above-mentioned data processing method when executed by a processor.

[0201] The above is a schematic scheme of a computer-readable storage medium of this embodiment. It should be noted that the technical scheme of the storage medium and the technical scheme of the above data processing method belong to the same concept, and the details not described in detail in the technical scheme of the storage medium can be referred to the description of the technical scheme of the above data processing method.

[0202] An embodiment of the present specification further provides a computer program, wherein when the computer program is executed in a computer, the computer is caused to execute the steps of the above-mentioned data processing method.

[0203] The above is a schematic scheme of a computer program of this embodiment. It should be noted that the technical scheme of the computer program and the technical scheme of the above data processing method belong to the same concept, and the details not described in detail in the technical scheme of the computer program can be referred to the description of the technical scheme of the above data processing method.

[0204] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0205] The computer instructions include computer program codes, which may be in source code form, object code form, executable files or some intermediate forms, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium may be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.

[0206] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the embodiments of this specification are not limited by the order of the actions described, because according to the embodiments of this specification, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the embodiments of this specification.

[0207] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0208] The preferred embodiments of this specification disclosed above are only used to help explain this specification. The optional embodiments do not describe all the details in detail, nor do they limit the invention to only the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of the embodiments of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the embodiments of this specification, so that technicians in the relevant technical field can well understand and use this specification. This specification is only limited by the claims and their full scope and equivalents.

Claims

1. A data processing method, comprising: Determine at least two storage partitions of the target storage space and the amount of data stored in the at least two storage partitions, and determine the space usage rate of the target storage space according to the amount of data; Determining the storage partition usage rate of the target storage space according to the usage status of the at least two storage partitions, wherein determining the storage partition usage rate of the target storage space according to the usage status of the at least two storage partitions includes: Determine the number of storage partitions in the target storage space that are in a usable state, and determine the storage partition usage rate of the target storage space according to the number of storage partitions in a usable state and the total number of storage partitions included in the target storage space, wherein the usable state includes an idle state, an open state and / or a recyclable state, or Determine the number of storage partitions in the target storage space that are in an unusable state, and determine the storage partition usage rate of the target storage space according to the number of storage partitions in the unusable state and the total number of storage partitions included in the target storage space, wherein the unusable state includes a closed state, an offline state and / or a reserved state; Determine, according to the space usage rate and the storage partition usage rate, a data recovery speed of the first type of data in the target storage partition, and perform recovery processing on the first type of data according to the data recovery speed, wherein the target storage partition is one of the at least two storage partitions, and the first type of data is recycle bin data; The usage status of the target storage partition is adjusted according to the recovery result.

2. The data processing method according to claim 1, wherein determining at least two storage partitions of the target storage space and the amount of data stored in the at least two storage partitions comprises: Determine at least two storage partitions of the target storage space; Determine a first data amount of first type data and a second data amount of second type data stored in the at least two storage partitions, wherein the second type data is valid data.

3. The data processing method according to claim 2, wherein determining the space usage rate of the target storage space according to the data volume comprises: Adding a first data amount of the first type of data and a second data amount of the second type of data stored in the at least two storage partitions; A ratio of the sum processing result to the space capacity of the target storage space is determined, and the ratio is determined as the space utilization rate of the target storage space.

4. The data processing method according to claim 2, wherein determining a first data volume of the first type of data and a second data volume of the second type of data stored in the at least two storage partitions comprises: Scanning the storage partition table of the target storage space to obtain a first data length of the first type of data and a second data length of the second type of data in different storage partitions; A first data volume of the first type of data and a second data volume of the second type of data stored in the at least two storage partitions are determined according to the first data length and the second data length.

5. The data processing method according to claim 1, wherein determining the storage partition usage rate of the target storage space according to the usage status of the at least two storage partitions comprises: Determine a first number of storage partitions in an idle state and a second number of storage partitions in a reclaimable state among the at least two storage partitions; The storage partition usage rate of the target storage space is determined according to the first number, the second number, and the total number of storage partitions included in the target storage space.

6. The data processing method according to claim 5, wherein determining the storage partition usage rate of the target storage space according to the first number, the second number, and the total number of storage partitions included in the target storage space comprises: performing a summation process on the first quantity and the second quantity; The storage partition usage rate of the target storage space is determined according to the ratio of the sum processing result to the total number of storage partitions included in the target storage space.

7. The data processing method according to claim 1, wherein determining the data recovery speed of the first type of data in the target storage partition according to the space utilization rate and the storage partition utilization rate comprises: If the space usage rate is greater than or equal to a first preset threshold, determining that the data recovery speed of the first type of data in the target storage partition is a first recovery speed; If the space usage rate is less than the first preset threshold and greater than or equal to the second preset threshold, the data recovery speed of the first type of data in the target storage partition is determined to be the second recovery speed, wherein the first recovery speed is greater than the second recovery speed.

8. The data processing method according to claim 7, further comprising: If the space usage is less than the second preset threshold, determining whether the storage partition usage is greater than or equal to the first preset threshold; If so, determining that the data recovery speed of the first type of data in the target storage partition is a first recovery speed; If not, the data recovery speed of the first type of data in the target storage partition is determined to be the second recovery speed.

9. The data processing method according to claim 1, wherein the first type of data is recycle bin data; Accordingly, the recycling of the first type of data according to the data recycling speed includes: According to the data recovery speed, the first type of data in the target storage partition is converted into a third type of data, wherein the third type of data is invalid data.

10. The data processing method according to claim 1 or 9, wherein adjusting the usage status of the target storage partition according to the recycling result comprises: In the case where it is determined that the data contained in the target storage partition is the third type of data, erasing the data in the target storage partition, wherein the third type of data is invalid data; When erasing is completed, the usage state of the target storage partition is adjusted to an idle state.

11. A data processing device, comprising: A first determining module is configured to determine at least two storage partitions of the target storage space and the amount of data stored in the at least two storage partitions, and determine the space usage rate of the target storage space according to the amount of data; The second determination module is configured to determine the storage partition usage rate of the target storage space according to the usage status of the at least two storage partitions, wherein the determining the storage partition usage rate of the target storage space according to the usage status of the at least two storage partitions includes: Determine the number of storage partitions in the target storage space that are in a usable state, and determine the storage partition usage rate of the target storage space according to the number of storage partitions in a usable state and the total number of storage partitions included in the target storage space, wherein the usable state includes an idle state, an open state and / or a recyclable state, or Determine the number of storage partitions in the target storage space that are in an unusable state, and determine the storage partition usage rate of the target storage space according to the number of storage partitions in the unusable state and the total number of storage partitions included in the target storage space, wherein the unusable state includes a closed state, an offline state and / or a reserved state; a recycling module configured to determine a data recycling speed of first-type data in a target storage partition according to the space utilization rate and the storage partition utilization rate, and to recycle the first-type data according to the data recycling speed, wherein the target storage partition is one of the at least two storage partitions, and the first-type data is recycle bin data; The adjustment module is configured to adjust the usage status of the target storage partition according to the recovery result.

12. A computing device comprising: Memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions. When the computer-executable instructions are executed by the processor, the steps of the data processing method according to any one of claims 1 to 10 are implemented.

13. A computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the steps of the data processing method according to any one of claims 1 to 10.