Data processing method, electronic device, medium and product
By exchanging the storage locations of user data and parity data in the solid-state drive, the problems of load imbalance and performance degradation in RAID-5 technology are solved, achieving more efficient load balancing and extending the service life.
Patent Information
- Application Number
- CN202511030462.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-25
- Publication Date
- 2025-10-10
- Estimated Expiration
- 2045-07-25
AI Technical Summary
Traditional RAID-5 technology causes load imbalance and performance degradation in solid-state drives. Frequent updates of parity bit data lead to increased wear and overall performance degradation.
When there is a significant difference in performance quality, the storage locations of the target user data and the check bit data are swapped, and the storage locations are optimized through the evaluation model to achieve load balancing and reduce wear.
Improves the overall performance and lifespan of solid-state drives by optimizing storage locations to reduce extra read and write operations, lowering wear and achieving better load balancing.
Smart Images

Figure CN120540609B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer, and particularly relates to a data processing method, an electronic device, a medium and a product. BACKGROUND
[0002] The solid state disk includes a plurality of storage units, each of which is used to store data, and the security of the data is improved by distributing the storage of user data on different storage units and adding check bit data.
[0003] In the related art, in order to maintain the consistency of the data and the accuracy of the check bit information, the data of the corresponding storage unit needs to be updated every time the data is written in the storage unit, and the corresponding check bit data also needs to be updated. This data processing method can cause the problem of low performance of the solid state disk. SUMMARY
[0004] The present application provides a data processing method, an electronic device, a medium and a product to at least solve the problem of low performance of the solid state disk in the related art.
[0005] The present application provides a data processing method applied to a solid state disk, the solid state disk stores a plurality of strips, each of the plurality of strips includes a plurality of page data, and the plurality of page data includes a plurality of user data and check bit data. The method comprises:
[0006] In the case of detecting a target operation, determining target user data in a target strip to be operated by the target operation, the target strip being a strip in the plurality of strips, and the target user data being one of the plurality of user data included in the target strip;
[0007] Determining the first performance quality of the first target storage unit in which the target user data is located;
[0008] Determining the second performance quality of the second target storage unit in which the first target check bit data included in the target strip is located;
[0009] In the case that the first performance quality is greater than the first quality threshold and the second performance quality is less than the second quality threshold, exchanging the storage positions of the target user data and the first target check bit data.
[0010] The present application also provides a data processing device applied to a solid state disk, the solid state disk stores a plurality of strips, each of the plurality of strips includes a plurality of page data, and the plurality of page data includes a plurality of user data and check bit data. The device comprises:
[0011] The first determining module is configured to determine target user data in a target strip to be operated by the target operation, the target strip being a strip in the plurality of strips, and the target user data being one of the plurality of user data included in the target strip.
[0012] The second determining module is configured to determine a first performance quality of a first target storage unit in which the target user data is located.
[0013] The third determining module is configured to determine a second performance quality of a second target storage unit in which first target check bit data included in the target strip is located.
[0014] The exchanging module is configured to exchange storage positions of the target user data and the first target check bit data when the first performance quality is greater than a first quality threshold and the second performance quality is less than a second quality threshold.
[0015] The present application also provides an electronic device, comprising a memory configured to store a computer program, and a processor configured to execute the computer program to implement the steps of the data processing method.
[0016] The present application also provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the steps of the data processing method.
[0017] The present application also provides a computer program product, which comprises a computer program, and the computer program is executed by a processor to implement the steps of the data processing method.
[0018] In the embodiments of the present application, the storage positions of the target user data and the first target check bit data are exchanged when the first performance quality is greater than a first quality threshold and the second performance quality is less than a second quality threshold, so that the storage positions between the check bit data and the user data in the strip are flexibly adjusted, the wear of the solid state disk at the original storage position of the first target check bit data is reduced, and better load balancing is achieved. BRIEF DESCRIPTION OF DRAWINGS
[0019] In order to more clearly illustrate the embodiments of the present application, the drawings needed in the embodiments will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative effort.
[0020] Figure 1 A schematic diagram of a data processing method provided by the related art;
[0021] Figure 2Another data processing method provided by the related art is shown in the following figure;
[0022] Figure 3 An application scenario of a data processing method provided by the embodiment of the present application is shown in the following figure;
[0023] Figure 4 A flowchart of a data processing method provided by the embodiment of the present application is shown in the following figure;
[0024] Figure 5 An example of a data exchange storage location provided by the embodiment of the present application is shown in the following figure Figure 1 ;
[0025] Figure 6 An example of a data exchange storage location provided by the embodiment of the present application is shown in the following figure Figure 2 ;
[0026] Figure 7 A flowchart of an evaluation model estimating an exchange result provided by the embodiment of the present application is shown in the following figure;
[0027] Figure 8 A structural diagram of a data processing device provided by the embodiment of the present application is shown in the following figure;
[0028] Figure 9 A structural diagram of an electronic device provided by the embodiment of the present application is shown in the following figure. DETAILED DESCRIPTION
[0029] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work fall within the protection scope of the present application.
[0030] It should be noted that, in the description of the present application, the terms “include”, “contain” or any other variants thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such process, method, article or device. The terms “first”, “second” and the like in the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence.
[0031] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use, processing, transmission, provision, disclosure and application of the relevant data comply with the relevant laws, regulations and standards of the relevant countries and regions, take necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0032] Flash-based solid-state drives (SSDs), with their advantages of low power consumption, portability, and fast random access, have gradually replaced traditional mechanical hard drives and become the mainstream storage device. As the demand for data storage continues to grow, the importance of high-density SSDs is becoming increasingly prominent. However, the increasing density of flash memory cells also leads to more serious problems such as read and write interference. In this context, traditional error correction code technology is unable to effectively address these read and write interference issues.
[0033] To improve data reliability, RAID-5 (Redundant Array of Independent Disks Level 5) solid-state drive technology is used. This technology distributes user data across different flash memory chips and calculates parity information. This mechanism effectively prevents data loss caused by a single flash memory chip failure, thereby enhancing data security. However, RAID-5 requires that each time user data is written, the system must not only update the user data being written, but also the corresponding parity bit data to ensure data consistency.
[0034] Among them, the traditional RAID-5 parity bit update mechanism has the following problems:
[0035] (1) Load imbalance, that is, only considering reducing additional read requests without considering the real-time load of each channel inside the SSD, resulting in some channels being highly congested while other channels are idle, and the high concurrency performance advantage of the SSD cannot be fully utilized.
[0036] (2) Write position restriction: To ensure the validity of the tape, updated user data and check bit data must be written back to the original storage unit. This causes a serious imbalance in the workload between the channels corresponding to each storage unit, limiting the parallel processing capability of the solid-state drive.
[0037] Furthermore, RAID-5 technology implements its functionality through a striped data storage mechanism. Each stripe consists of multiple user data and one parity bit. The parity bit is the result of an exclusive OR (XOR) operation on the multiple user data. If one piece of user data is erroneous or missing, the erroneous or missing user data is retrieved by reading the remaining user data in the same stripe and the parity bit data and performing an XOR operation on them.
[0038] To ensure effective data recovery when user data errors occur, the parity bit data within the same stripe must be updated simultaneously with the user data update. Parity bit data can be updated using either a ReadModifyWrite (RMW) or a ReconstructWrite (RCW) method. Both methods require sending additional read requests to obtain the updated user data and parity bit data in the stripe.
[0039] For example, refer to Figure 1 When the user data to be updated is less than 1 / 2 of the data contained in the stripe, you can choose to update the parity data in RMW mode. When the user data to be updated is greater than or equal to 1 / 2 of the data contained in the stripe, you can choose to update the parity data in RMW mode. Figure 1 , stripe T1 includes data a0 to data a4, and parity data P. When data a0 is updated to data a0′, the parity data P is updated to parity data P′ using RMW. Figure 2 When data a0 is updated to data a0′, data a1 is updated to data a1′, and data a2 is updated to data a2′, the check bit data P1 is updated to P′′ using the RCW method.
[0040] It is understandable that both of the above-mentioned methods of updating the check bit data will lead to frequent updates of the check bit data, which will in turn trigger a large number of additional write operations, which will have multiple adverse effects on the operation of the SSD: First, the surge in write operations will directly extend the I / O (Input / Output) response time, resulting in a decline in the overall performance of the SSD; second, frequent write operations will intensify the data migration and garbage collection activities within the SSD, thereby accelerating the wear and aging of the SSD and significantly shortening the service life of the SSD; finally, since the SSD requires that the updated user data and the corresponding check bits must be written back to the original storage unit, this mandatory write strategy further worsens the load imbalance between the channels of the SSD, restricting the parallel processing capabilities of the SSD.
[0041] Based on the above problems, the application can exchange the storage positions of the target user data and the first target check bit data when the first performance quality is greater than the first quality threshold and the second performance quality is less than the second quality threshold, realize flexible adjustment of the storage positions between the check bit data and the user data in the strip, reduce the wear of the solid state disk at the original storage position of the first target check bit data, and realize better load balancing.
[0042] In order for those skilled in the art to better understand the application scheme, the application will be further described in detail below in combination with the drawings and specific embodiments.
[0043] In combination with the specific application environment architecture or the specific hardware architecture on which the execution of the data processing method depends, the specific application environment architecture or the specific hardware architecture is described herein. Reference is made to Figure 3 , Figure 3 For an application scenario example of the data processing method, Figure 3 A structural schematic diagram of a solid state disk is shown, which includes a flash memory, and the flash memory includes a plurality of storage modules, for example, storage module b0, storage module b1, …, and storage module b2. One strip is stored in each storage module, each storage module includes a plurality of storage units, for example, storage module bi includes storage units bi0 to bi5, i takes 0 to 2, each strip includes a plurality of user data and one check bit data, and one user data or one check bit data is stored on each storage unit. For example, a plurality of strips include strip D0 to strip D2, strip D0 is stored in storage module b0, strip D1 is stored in storage module b1, and strip D2 is stored in storage module b2. Further, strip Dr includes user data Dr0 to user data Dr4 and check bit data Pr, n can take 0 to 2, wherein user data Drj is stored in corresponding storage unit brj, j takes 0 to 4, and check bit data Pr is stored in storage unit br5. For each storage module, the storage units of the storage module correspond to channels one by one, for example, storage unit bij corresponds to channel ct, wherein channel ct is used to transmit the user data or check bit data stored on storage unit bij.
[0044] In the embodiment of the application, the number of user data included in different strips can be the same or different, and the plurality of channels corresponding to different storage modules can be the same or not completely the same, for example, including 10 channels, which are channel c0 to channel c9, storage unit b00 to storage unit b05 correspond to channel c0 to channel c5 respectively, and storage unit b10 to storage unit b15 correspond to channel c3 to channel c8 respectively, which is not limited by the application.
[0045] Figure 4A step flowchart of a data processing method is shown, which specifically comprises the following steps:
[0046] S401, in the case of detecting a target operation, determining target user data in a target strip to be operated by the target operation.
[0047] Among them, the solid state disk stores a plurality of strips, each of the plurality of strips includes a plurality of page data, and the plurality of page data includes a plurality of user data and parity data. It can be understood that a user data is a page data, and a parity data is also a page data.
[0048] For example, referring to Figure 3 , the solid state disk stores 3 strips, which are strip D0, strip D1 and strip D2, and strip D0 to strip D2 all include 6 page data, wherein 5 of the 6 page data included in strip Dr are user data, which are user data Dr0 to user data Dr4, and one is parity data Pr.
[0049] It can be understood that the parity data in each strip is calculated based on the user data in the strip, and the specific calculation method can be exclusive or calculation.
[0050] In the embodiments of the present application, the target strip is a strip in the plurality of strips, and the target user data is one of the plurality of user data included in the target strip.
[0051] For example, the target operation is for the user data D00 of the strip D0 in Figure 1 , then the strip D0 is the target strip, and the user data D00 is the target user data.
[0052] In the embodiments of the present application, the target operation is a write operation or a recycling operation. Among them, the write operation is to update the target user data.
[0053] S402, determining the first performance quality of the first target storage unit where the target user data is located.
[0054] Among them, referring to Figure 3 , if the target user data is user data D00, the first target storage unit is storage unit b00.
[0055] In some embodiments, determining the first performance quality of the first target storage unit where the target user data is located comprises: determining the first wear degree of the first target storage unit; determining the first load degree of the first target channel corresponding to the first target storage unit; determining the first performance quality according to the first wear degree and / or the first load degree, the first wear degree and the first performance quality are negatively correlated, and the first load degree and the first performance quality are negatively correlated.
[0056] The first wear degree may be determined based on the total number of historical write operations of the first target storage unit. The total number of historical write operations is positively correlated with the first wear degree, that is, the greater the total number of historical write operations, the more severe the first wear degree.
[0057] For example, the first wear degree can be divided into level 1, level 2, level 3 and level 4, and the higher the level, the heavier the first wear degree. Among them, the first number threshold, the second number threshold and the third number threshold are set, and the first number threshold is less than the second number threshold and less than the third number threshold. If the total number of historical write operations is less than the first number threshold, the first wear degree is level 1. If the total number of historical write operations is greater than or equal to the first number threshold and less than the second number threshold, the first wear degree is level 2. If the total number of historical write operations is greater than or equal to the second number threshold and less than the third number threshold, the first wear degree is level 3. If the total number of historical operations is greater than or equal to the third number threshold, the first wear degree is level 4.
[0058] In an embodiment of the present application, for example, the first target storage unit is storage unit b00, then the first target channel is channel c0, wherein the first load degree of channel c0 can be determined according to the amount of data currently transmitted by channel c0, wherein the more data transmitted by channel c0, the more severe the first load degree.
[0059] In some embodiments, the first load level can be divided into level 1, level 2, level 3 and level 4, and the higher the level, the more severe the first load level. Among them, a first quantity threshold, a second quantity threshold and a third quantity threshold are set, and the first quantity threshold is less than the second quantity threshold and less than the third quantity threshold. If the amount of data transmitted by the first target channel is less than the first quantity threshold, the first load level is level 1. If the amount of data transmitted by the first target channel is greater than or equal to the first quantity threshold and less than the second quantity threshold, the first load level is level 2. If the amount of data transmitted by the first target channel is greater than or equal to the second quantity threshold and less than the third quantity threshold, the first load level is level 3. If the amount of data transmitted by the first target channel is greater than or equal to the third quantity threshold, the first load level is level 4.
[0060] For example, refer to Figure 3, memory cells b00, b10, and b20 all use channel c0 to transmit data. If channel c0 currently does not need to transmit data, the first load level is level 1. If data transmission is required only from one of the memory cells (for example, reading data D00 or writing data to memory cell b00), the first load level is level 2. If data transmission is required for two of the memory cells, the first load level is 3. If data transmission is required for three memory cells, the first load level is level 4.
[0061] In an embodiment of the present application, the first performance quality of the first target storage unit can be determined based on the first wear degree and / or the first load degree. The higher the first performance quality of the first target storage unit (the lower the corresponding first wear degree and / or the lower the first load degree), the more efficient the read and write operations can be performed on the data stored in the first target storage unit. The lower the first performance quality of the first target storage unit (the higher the corresponding first wear degree and / or the higher the first load degree), the lower the efficiency of the read and write operations on the data stored in the first target storage unit, which in turn affects the use of the solid-state drive.
[0062] In some embodiments, the first performance quality of the first target storage unit can be determined according to the first wear degree and / or the first load degree by a preset calculation method. For example, the first performance quality can be expressed as 1 / s1, where s1 is the level of the first wear degree. For example, if s1=4, the first performance quality is 1 / 4, indicating that the first performance quality is relatively low. The first performance quality can also be expressed as 1 / s2, where s2 is the level of the first load degree. For example, if s2=1, the first performance quality is 1, indicating that the first performance quality is relatively high. For example, the first performance quality can be expressed as f / s1+g / s2, for example, s1=4, s2=2, f and g are preset coefficients, f and g are both [0,1], f+g=1, for example, if f is 0.5, g=0.5, then the first performance quality is 3 / 8.
[0063] In the embodiment of the present application, the first performance quality may also be determined by other methods, which are not limited here.
[0064] S403: Determine a second performance quality of a second target storage unit where the first target parity bit data included in the target stripe is located.
[0065] For example, refer to Figure 3 , the target stripe is stripe D0, the target parity bit data is P0, and the second target storage unit is storage unit b05.
[0066] In some embodiments, determining the second performance quality of the second target storage unit where the first target check bit data included in the target stripe is located includes: determining a second degree of wear of the second target storage unit; determining a second degree of load of the second target channel corresponding to the second target storage unit; determining the second performance quality based on the second degree of wear and / or the second degree of load, the second degree of wear being negatively correlated with the second performance quality, and the second degree of load being negatively correlated with the second performance quality.
[0067] In the embodiment of the present application, the method for determining the second performance quality may refer to the first performance quality, which will not be described in detail here.
[0068] S404 : When the first performance quality is greater than a first quality threshold and the second performance quality is less than a second quality threshold, swap storage locations of the target user data and the first target check bit data.
[0069] The first quality threshold is greater than the second quality threshold.
[0070] In some embodiments, the first performance quality can be expressed as [0, 1], and the second performance quality can also be expressed as [0, 1], with larger values indicating higher performance quality. For example, the first quality threshold can be set to 0.7, and the second instruction threshold can be set to 0.3.
[0071] In some embodiments, the first performance quality may also be expressed in other ways, such as a quality level, where a higher quality level indicates a higher first performance quality, and a lower quality level indicates a lower first performance quality, which is not limited in this application.
[0072] It can be understood that the update frequency of the target parity bit data is higher than or equal to that of any user data in the target stripe. Therefore, the storage unit containing the target parity bit data wears out faster, and the channel corresponding to the storage unit containing the target parity bit data is also more likely to experience high load levels. Therefore, when the second performance quality is high, by swapping the storage locations of the target user data and the first target parity bit data, load balancing of the SSD can be achieved, and uneven wear of the storage units can be avoided, which in turn affects the service life of the SSD.
[0073] For example, refer to Figure 3In the initialized solid-state hard drive, the present application stores stripes D0, D1, and D2. For stripe D0, if user data D00 is updated q1 times, user data D01 is updated q2 times, user data D02 is updated q3 times, user data D03 is updated q4 times, and user data D04 is updated q5 times, then the check bit data P0 needs to be updated q1+q2+q3+q4+q5 times. After the check bit data is frequently updated, the degree of wear of the storage unit b05 is high. In this case, the storage position of the check bit data P0 can be exchanged with the user data in the same stripe to avoid failure caused by continued rapid wear of the storage unit b05. In addition, since the update frequency of the check bit data P0 is relatively high, if the channel corresponding to the storage unit b05 is also used to transmit other hot data, it may cause the channel to be seriously loaded. If the channel corresponding to the storage unit b05 is seriously loaded, the check bit data P0 can be exchanged with the user data in the same strip to reduce the load of the storage unit b05 and achieve load balancing of the solid-state hard drive.
[0074] In some embodiments, the target operation is a write operation, and the method further includes: obtaining target write data corresponding to the target user data; updating the first target check bit data according to the target write data and other user data in the target stripe to obtain the second target check bit data.
[0075] Exchanging the storage locations of the target user data and the first target check bit data includes: storing the second target check bit data in the first target storage unit and storing the target write data in the second target storage unit.
[0076] It is understood that the target write data is the updated data of the target user data, and the target write data needs to be rewritten into the target stripe. The second target check bit data is calculated based on the first target check bit data, the target write data and other user data in the target stripe.
[0077] Furthermore, if the storage locations of the exchange target user data and the first target check bit data are determined, during the write operation, the target user data in the first target storage unit is erased, and the first target check bit data in the second target storage unit is erased, and then the second target check bit data is stored in the first target storage unit, and the target write data is stored in the second target storage unit.
[0078] Reference Figure 5 As shown, Figure 5 (1) is the storage status of stripe D0 in storage unit b0 when it is not swapped. Figure 5The middle (2) is the storage condition of the exchanged strip D0 in the storage unit b0. The D00 is target user data, the D00' is target write data, the P0 is the first target check bit data, and the P0' is the second target check bit data. After the second target check bit data P0' is stored in the first target storage unit, the read and write of the second target check bit data P0' is through the first target storage unit, which is the wear of the first target storage unit, thereby reducing the wear of the second target storage unit. And reading and writing the second target check bit data P0' is through the channel corresponding to the first target storage unit, thereby reducing the load of the channel corresponding to the second target storage unit.
[0079] In summary, the application can exchange the storage positions of the target user data and the first target check bit data in the write operation process, can avoid the additional read and write operations caused by the exchange of the storage positions, and can improve the data exchange efficiency.
[0080] In some embodiments, the target operation is a recycling operation, and the target user data is valid data. The method for exchanging the storage positions of the target user data and the first target check bit data comprises the following steps: determining whether the target user data is valid data; if yes, storing the first target check bit data in the first target storage unit; and storing the target user data in the second target storage unit.
[0081] In the embodiments of the application, a plurality of data blocks are stored in the solid state disk, each data block comprises a plurality of page data, and the page data can be Figure 3 user data or check bit data. Since the access frequencies of the page data in the same data block are different, for example, the access frequencies of a part of the page data are high, and the access frequencies of a part of the page data are low, the page data with high access frequencies can be valid page data, and the page data with low access frequencies can be invalid page data. Further, in order to ensure the safety of the valid page data in the recycling operation process of the data block, it is usually necessary to migrate the valid page data first.
[0082] Referring to Figure 6 In the recycling operation, Figure 6 The middle (1) is the storage condition of the strip D0 in the storage unit b0 before exchange, Figure 6(2) shows the storage status of stripe D0 in storage unit b0 after the swap. D00 is the target user data, and P0 is the first target parity bit data. After the first target parity bit data P0 is stored in the first target storage unit, the reading and writing of the first target parity bit data P0 passes through the first target storage unit, which wears out the first target storage unit and reduces the wear on the second target storage unit. In addition, the reading and writing of the first target parity bit data P0 passes through the channel corresponding to the first target storage unit, which can reduce the load of the channel corresponding to the second target storage unit.
[0083] It can be understood that the recycling operation of this application is for the data block containing the target user data. Since the target user data is valid data, the target user data needs to be migrated to avoid the target user data being recycled. Therefore, the target user data needs to be migrated.
[0084] In an embodiment of the present application, the storage locations of the target user data and the first target check bit data can be exchanged when migrating the target user data, so as to avoid additional read and write operations caused by exchanging the storage locations, thereby further enhancing the overall efficiency and response speed of the solid-state drive without affecting the performance of the solid-state drive.
[0085] In some embodiments, when the first performance quality is greater than the first quality threshold and the second performance quality is less than the second quality threshold, the storage locations of the target user data and the first target check bit data are exchanged, including: when the first performance quality is greater than the first quality threshold and the second performance quality is less than the second quality threshold, using a preset evaluation model to evaluate the exchange result, the exchange result is used to indicate whether to exchange the storage locations of the target user data and the first target check bit data; when the exchange result indicates to exchange, exchanging the storage locations of the target user data and the first target check bit data.
[0086] In an embodiment of the present application, an evaluation model may be preset to evaluate whether exchanging the target user data with the first target check digit data will improve the performance of the solid-state drive. If the evaluation model's exchange result indicates that the exchange is to be performed, it can be understood that exchanging the target user data with the first target check digit data will improve the performance of the solid-state drive, and further steps may be performed to exchange the storage locations of the target user data and the first target check digit data.
[0087] In some embodiments, the target operation is a write operation, and the method further includes: when the exchange result indicates that no exchange is to be performed, storing the target write data corresponding to the target user data in the first target storage unit, and storing the second target check bit data in the second target storage unit, the second target check bit data being obtained after updating based on the first target check bit data.
[0088] It can be understood that if the exchange result of the evaluation model indicates not to exchange, it can be understood that the target user data and the first target check bit data will not improve the performance of the solid state disk after being exchanged, and the exchange step is not performed.
[0089] In some embodiments, the target operation is a write operation, and the method further comprises: in the case where the exchange result indicates not to exchange, storing the target write data in the first target storage unit and storing the second target check bit data in the second target storage unit.
[0090] It can be understood that if no exchange is performed, the update mechanism of the relevant RAID-5 is followed, that is, the updated target write data is written to the first target storage unit, and the corresponding updated second target check bit data is written to the second target storage unit.
[0091] In some embodiments, the evaluation model comprises a first module and a second module, and the evaluation model is constructed in the following manner: the first module is constructed, the first module is used to determine a plurality of state variables and a plurality of decision variables based on a target function, the plurality of state variables and the plurality of decision variables are one-to-one corresponding, and the plurality of state variables and the plurality of decision variables are used to minimize the target value of the determined target function, each state variable represents the state of one page data of one stripe in the corresponding channel, and each decision variable represents the exchange possibility of one page data of one stripe in the corresponding channel; the second module is constructed, and the second module is used to determine the exchange result based on the state variable corresponding to the target user data and the decision variable corresponding to the target user data.
[0092] In the embodiments of the present application, the evaluation model is constructed based on the total number of accesses of a plurality of page data and the channel load condition, and the specific construction manner is as follows:
[0093] (1) Construct the first module:
[0094] First, define a plurality of state variables C rst , wherein the plurality of state variables C rst are used to represent the state of the solid state disk, and C rst takes a value of 0 or 1, wherein C rst represents the state of the s-th page data in the r-th stripe belonging to the t-th channel, and C rst takes a value of 1 indicating that the s-th page data in the r-th stripe needs to be exchanged to achieve wear leveling and / or load balancing, and C rstThe value of 0 indicates that the s-th page data in the r-th strip does not need to be exchanged. Wherein, if R+1 strips are stored in the solid state disk, r takes 0 to R, the r-th strip includes S+1 page data, s takes 0 to S, wherein the s-th page data belongs to the t-th channel, it can be understood that the s-th page data is stored in the storage unit corresponding to the t-th channel.
[0095] For example, referring to Figure 3 , R is 2, r can take 0, 1, 2, the r-th strip includes 6 page data, s can take 0 to 5.
[0096] In the embodiments of the present application, s can be the same as t, or different, the channels corresponding to each page data in the same strip are different. In the case where s and t are not the same, for example, refer to the following table 1:
[0097] Table 1
[0098]
[0099] In table 1, the solid state disk includes 6 channels, which are channel c0, channel c1, channel c2, channel c3, channel c4 and channel c5. For strip D0, user data D01 belongs to channel c0, user data D00 belongs to channel c1, parity data P0 belongs to channel c2, user data D03 belongs to channel c3, user data D04 belongs to channel c4, and user data D02 belongs to channel c5. For strip D1, user data D12 belongs to channel c0, user data D11 belongs to channel c1, user data D10 belongs to channel c2, parity data P1 belongs to channel c3, user data D14 belongs to channel c4, and user data D13 belongs to channel c5. For strip D2, user data D20 belongs to channel c0, parity data P2 belongs to channel c1, user data D24 belongs to channel c2, user data D22 belongs to channel c3, user data D21 belongs to channel c4, and user data D23 belongs to channel c5.
[0100] It can be understood that based on table 1, a plurality of state variables can be obtained, which are C 010 , C 001 , C 052 , C 033 , C 044 , C 025 , C 120 , C 111 , C 102 , C 153 , C 144 , C 135、 C 200 , C 251 , C 242 , C 223 , C214 、C 235 .
[0101] Next, define multiple decision variables X rst , where multiple decision variables X rst The decision variable used to indicate whether to exchange, where X rst The value is 0 or 1, where X rs The value of 1 indicates that the sth page data in the rth stripe needs to be exchanged to alleviate wear and / or achieve load balancing. rs A value of 0 indicates that the sth page data in the rth stripe does not need to be swapped.
[0102] For example, referring to Table 1, we can get multiple decision variables, namely X 010 、X 001 、X 052 、X 033 、X 044 、X 025 、X 120 、X 111 、X 102 、X 153 、X 144 、X 135、 X 200 、X 251 、X 242 、X 223 、X 214 、X 235 .
[0103] In some embodiments, the objective value of the objective function is the sum of a plurality of first difference values, each of which is the absolute value of the difference between one of the state variables and the corresponding decision variable.
[0104] For example, the objective function can be expressed as the following expression (1):
[0105] (1)
[0106] In expression (1), Z is the target value of the objective function, is the first difference. Wherein, the objective function is used to determine multiple state variables C rst and multiple decision variables X rst The value of is chosen so that Z reaches the minimum value.
[0107] In some embodiments, the objective value of the objective function is the sum of a plurality of first products, each of the plurality of first products being the product of one of the state variables and the corresponding decision variable.
[0108] For example, the objective function can be expressed as expression (2) as follows:
[0109] (2)
[0110] In expression (2), V is a target value of the objective function, is a first product. Wherein, the objective function is used to determine values of a plurality of state variables C rst and a plurality of decision variables X rst so that V reaches a minimum value.
[0111] In some embodiments, based on expression (1) and expression (2), the objective function includes at least one of the following constraint conditions:
[0112] Constraint condition 1: the sum of decision variables corresponding to different page data belonging to different channels in the same strip is 1;
[0113] Constraint condition 2: the sum of decision variables corresponding to different page data of the same channel is equal to the sum of state variables;
[0114] Constraint condition 3: the wear difference of the storage unit to which the data for exchange belongs is less than or equal to a wear threshold;
[0115] Constraint condition 4: the load difference of the channel to which the data for exchange belongs is less than or equal to a load threshold.
[0116] Specifically, constraint condition 1 is expressed as where t takes 0, 1, …, N-1, N is the total number of channels, and constraint condition 1 indicates that the sum of X rst corresponding to different page data belonging to different channels in the same strip is 1, for example: for strip D0, X 010 +X 001 +X 052 +X 033 +X 044 +X 025 =1, that is, only one of X 010 , X 001 , X 052 , X 033 , X 044 , X 025 has a value of 1, and the others have a value of 0. For strip D1, X 120 +X 111 +X 102 +X 153 +X 144 +X 135 =1, that is, X 111 , X 102 , X 153 , X 144and X 135 Only one of them has a value of 1, and the others are 0. For strip D2, X 200 +X 251 +X 242 +X 223 +X 214 +X 235 =1, that is, X 200 、X 251 、X 242 、X 223 、X 214 、X 235 Only one of them has a value of 1, and the others have a value of 0.
[0117] Constraint 2 is expressed as , s takes 0, 1, ..., S, it can be understood that for the X corresponding to different page data of the same channel rst The sum of C rst The same as.
[0118] Constraint 3 is expressed as ,in, Used to indicate wear differences, Used to represent the wear threshold, in an embodiment of the present application, the i-th channel may be the channel corresponding to the first target storage unit for storing target user data, and the j-th channel may be the channel corresponding to the second target storage unit for storing first target check bit data. is the preset wear balance constraint coefficient, and its value is [0,1]. Indicates the average wear of the storage cells corresponding to N channels.
[0119] in, , I can understand, Indicates the total number of writes to the sth page of the rth stripe, and the total number of reads for each page of each stripe. , determine its relationship with the channel to which it belongs The product of the sum and the ratio of the number of channels N is .
[0120] Constraint 4 is expressed as , Used to indicate load differences, Used to indicate the load threshold. Indicates the total number of reads of the sth page data of the rth stripe belonging to the i-th channel, represents the total number of reads for the sth page of the rth stripe belonging to the jth channel. β is the preset load balancing constraint coefficient, which is in the range [0,1]. Used to indicate the average load of N channels.
[0121] wherein, It can be understood that, represents the total read times of the s-th page data of the r-th stripe.
[0122] In the above constraint conditions, constraint condition 1 and constraint condition 2 are constraints related to exchange, which are used to ensure that after the page data is exchanged in a stripe, the channel to which the page data belongs is still the channel corresponding to the stripe of the page data, for example, the stripe D0 corresponds to the channels c0 to c5, then after the user data D00 is exchanged with the first target parity data P0, the channel to which the first target parity data P0 after the exchange belongs is contained in the channels c0 to c5 corresponding to the stripe D0, and the channel to which the user data D00 after the exchange belongs is also contained in the channels c0 to c5 corresponding to the stripe D0, and any two page data in the same stripe cannot belong to the same channel, i.e., belong to different channels.
[0123] The above constraint condition (3) is a balancing constraint for wear, i.e., the wear difference between each storage unit is as small as possible, i.e., the wear tends to be an average value wherein the smaller the α is, the greater the constraint is, and the wear balance is achieved.
[0124] The above constraint condition (4) is a balancing constraint for load, i.e., the load difference between each channel is as small as possible, i.e., the load tends to be an average value and the load balance is achieved.
[0125] Through the above expression (1) or expression (2), based on each constraint condition, the first target value X uzi and the second target value C uzi wherein u represents the stripe to which the target user data belongs, z represents the target user data, and i represents the channel to which the target user data belongs.
[0126] (II) Constructing a second module:
[0127] wherein the second module can determine the exchange result by using the following expression (3):
[0128] (3)
[0129] wherein, represents the exchange result, when the exchange result is greater than or equal to a result threshold (such as 0.5), i.e., tends to 1 or is 1, it is used to indicate the storage position of the exchanged target user data and the first target parity data, and when the exchange result is less than the result threshold, i.e., tends to 1 or is 0, it is used to indicate that the exchange operation is not performed.
[0130] In an embodiment of the present application, the evaluation model is used to evaluate whether the wear of the solid-state drive is alleviated and whether the load imbalance problem of the solid-state drive is solved after exchanging the target user data and the first target check bit data.
[0131] Reference Figure 7 , using the preset evaluation model to evaluate the exchange results, specifically including the following steps:
[0132] S701 , obtaining the total number of writes and reads for each page of data in a plurality of stripes.
[0133] Based on Table 1, the total number of writes and reads corresponding to each page data is shown in Table 2:
[0134] Table 2
[0135]
[0136] S702: Obtain a mapping relationship between each page data in a plurality of stripes and a plurality of channels.
[0137] The mapping relationship is used to indicate the channel to which each page data of each stripe belongs.
[0138] In the embodiment of the present application, the mapping relationship is shown in Table 1, which represents the mapping relationship between stripes, page data, and channels.
[0139] S703 , obtaining a first channel to which the target user data belongs and a second channel to which the first target check bit data belongs.
[0140] Referring to Table 1, if the target user data is D01, the first channel is channel c0, the first target check bit data is P0, and the second channel is channel c2. These data are input into the evaluation model. The evaluation model can execute the objective function based on the first module and the second module to execute expression (3) to obtain the exchange result.
[0141] S704: The total number of writes, the total number of reads, the mapping relationship, and the first channel and the second channel are input into an evaluation model for evaluation to obtain an exchange result.
[0142] In the evaluation model, the representation of multiple decision variables and multiple state variables can be determined according to the input mapping relationship. For example, based on Table 1, multiple state variables can be obtained as C 010 、C 001 、C 052 、C 033 、C 044 、C 025 、C 120 、C 111 、C 102 、C 153 、C144 , C 135、 C 200 , C 251 , C 242 , C 223 , C 214 , C 235 . A plurality of decision variables X 010 , X 001 , X 052 , X 033 , X 044 , X 025 , X 120 , X 111 , X 102 , X 153 , X 144 , X 135、 X 200 , X 251 , X 242 , X 223 , X 214 , X 235 .
[0143] Further, if the objective function is expression (1), based on expression (1), it is determined that:
[0144] .
[0145] If the objective function is expression (2), based on expression (1), it is determined that:
[0146] .
[0147] Further, based on the constraint condition 1 to the constraint condition 4, the values of the state variables and the decision variables are determined when the objective value of the objective function is the minimum.
[0148] For example, based on the constraint condition 1, for the strip D0, there exists X 010 + X 001 + X 052 + X 033 + X 044 + X 025 = 1; for the strip D1, there exists X 120 + X 111 + X 102 + X 153 + X 144 + X 135 = 1; for the strip D2, there exists X 200 + X 251 + X 242 + X 223 + X 214 + X 235= 1.
[0149] Based on constraint 2, referring to Table 1, for channel c0, X 010 + X 120 + X 200 = C 010 + C 120 + C 200 . For channel cl, X 001 + X 111 + X 251 = C 001 + C 111 + C 251 . For channel c2, X 052 + X 102 + X 242 = C 052 + C 102 + C 241 . For channel 3, X 033 + X 153 + X 223 = C 033 + C 153 + C 223 . For channel c4, X 044 + X 144 + X 214 = C 044 + C 144 + C 214 . For channel c5, X 025 + X 135 + X 235 = C 025 + C 135 + C 235 .
[0150] Based on constraint 3, the target user data is D01, the first target check bit data is P0, based on Table 1, i is 0, j is 2, there exists .
[0151] wherein,
[0152] .
[0153] Based on constraint 4, there exists:
[0154] .
[0155] wherein,
[0156] .
[0157] Based on the above manner, the value of each state variable and decision variable can be determined, and further, the and determining the exchange result based on the expression .
[0158] In summary, the application balances the I / O workloads of all channels in the solid state disk by optimizing the physical storage locations of the user data and the parity data. In addition, the application builds an evaluation model to analyze and measure the wear of the storage units and the balancing degree of the I / O workloads. In order to improve the load balancing, the application exchanges the storage locations of the user data and the parity data in the same stripe. The application can solve the problem of unbalanced I / O workloads in the RAID-5 solid state disk. By redistributing the physical storage locations of the data, the application makes the I / O workloads of the entire solid state disk more evenly distributed. In addition, the application solves the performance problem caused by the excessive load of the channels that bear too much hot parity data, maximizes the high parallel processing capability of the solid state disk, and improves the performance of the solid state disk.
[0159] Through the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be realized by means of software and the necessary general hardware platform, of course, it can also be realized by hardware, but in many cases the former is a better embodiment.
[0160] Figure 8 The structure schematic diagram of the data processing apparatus provided by the embodiment of the application is shown in FIG. 1. As shown in FIG. 1, the embodiment of the application further provides a data processing apparatus 80, which can include a first determining module 81, a second determining module 82, a third determining module 83, and an exchanging module 84, wherein, Figure 8
[0161] The first determining module 81 is configured to determine target user data in a target stripe to be operated by a target operation in a case where the target operation is detected, the target stripe being a stripe in a plurality of stripes, and the target user data being one of a plurality of user data included in the target stripe.
[0162] The second determining module 82 is configured to determine a first performance quality of a first target storage unit in which the target user data is located.
[0163] The third determining module 83 is configured to determine a second performance quality of a second target storage unit in which first target parity data included in the target stripe is located.
[0164] The exchanging module 84 is configured to exchange the storage locations of the target user data and the first target parity data in a case where the first performance quality is greater than a first quality threshold and the second performance quality is less than a second quality threshold.
[0165] Optionally, the target operation is a write operation, and the apparatus further includes:
[0166] An acquisition module (not shown in the figure) is used to acquire target write data corresponding to target user data;
[0167] An update module (not shown in the figure) is used to update the first target parity bit data according to the target write data and other user data in the target stripe to obtain the second target parity bit data;
[0168] The exchange module 84 is specifically configured to store the second target check bit data in the first target storage unit, and store the target write data in the second target storage unit.
[0169] Optionally, the target operation is a recycling operation, the target user data is valid data, and the exchange module 84 is specifically used to determine whether the target user data is valid data;
[0170] If so, storing the first target check bit data in the first target storage unit;
[0171] The target user data is stored in the second target storage unit.
[0172] Optionally, the exchange module 84 is specifically used to evaluate the exchange result using a preset evaluation model when the first performance quality is greater than the first quality threshold and the second performance quality is less than the second quality threshold, and the exchange result is used to indicate whether to exchange the storage locations of the target user data and the first target check bit data; when the exchange result indicates an exchange, the storage locations of the target user data and the first target check bit data are exchanged.
[0173] Optionally, the evaluation model includes a first module and a second module, and the device further includes a construction module (not shown in the figure) for constructing the evaluation model in the following manner:
[0174] Constructing a first module, the first module is used to determine a plurality of state variables and a plurality of decision variables based on the objective function, the plurality of state variables and the plurality of decision variables having a one-to-one correspondence, the plurality of state variables and the plurality of decision variables being used to minimize a target value of the determined objective function, each state variable representing a state of a page of data of a stripe in a corresponding channel, and each decision variable representing a swap possibility of a page of data of a stripe in a corresponding channel;
[0175] A second module is constructed, and the second module is used to determine an exchange result based on the state variable corresponding to the target user data and the decision variable corresponding to the target user data.
[0176] Optionally, the target value of the objective function is the sum of multiple first difference values, and each first difference value in the multiple first difference values is the absolute value of the difference between one of the state variables and the corresponding decision variable.
[0177] Optionally, the target value of the target function is a sum of a plurality of first products, each of the plurality of first products is a product of one of the state variables and a corresponding decision variable.
[0178] Optionally, the target function comprises at least one constraint condition as follows:
[0179] The sum of the decision variables corresponding to the different page data belonging to different channels in the same strip is 1.
[0180] The sum of the decision variables corresponding to the different page data of the same channel is equal to the sum of the state variables.
[0181] The wear difference of the storage unit to which the data for exchange belongs is less than or equal to a wear threshold.
[0182] The load difference of the channel to which the data for exchange belongs is less than or equal to a load threshold.
[0183] Optionally, the exchange module 84, when evaluating the exchange result by using the preset evaluation model, is specifically configured to:
[0184] Obtain the total write times and the total read times of each page data in the plurality of strips;
[0185] Obtain a mapping relationship between each page data in the plurality of strips and the plurality of channels, the mapping relationship being used to represent the channel to which each page data of each strip belongs.
[0186] Obtain a first channel to which the target user data belongs and a second channel to which the first target check bit data belongs;
[0187] Input the total write times, the total read times, the mapping relationship, and the first channel and the second channel into the evaluation model to obtain the exchange result.
[0188] Optionally, the second determination module 82 is specifically configured to:
[0189] Determine a first wear degree of the first target storage unit;
[0190] Determine a first load degree of a first target channel corresponding to the first target storage unit;
[0191] According to the first wear degree and / or the first load degree, determine a first performance quality, the first wear degree and the first performance quality being in a negative correlation relationship, and the first load degree and the first performance quality being in a negative correlation relationship.
[0192] Optionally, the third determination module 83 is specifically configured to:
[0193] Determine a second wear degree of the second target storage unit;
[0194] determine a second load degree of a second target channel corresponding to the second target storage unit;
[0195] determine a second performance quality according to the second wear degree and / or the second load degree, the second wear degree being negatively correlated with the second performance quality, and the second load degree being negatively correlated with the second performance quality.
[0196] Optionally, the target operation is a write operation, and the device further comprises:
[0197] a storage module (not shown in the figure) configured to, in a case where the exchange result indicates that no exchange is to be performed, store target write data corresponding to the target user data in the first target storage unit, and store second target check bit data in the second target storage unit, the second target check bit data being obtained based on the first target check bit data after being updated.
[0198] It should be noted that the data processing device shown in the embodiments of the present application can execute the technical solutions shown in the above method embodiments, and the implementation principles and beneficial effects are similar, which will not be described here in detail.
[0199] Figure 9 The structure schematic diagram of the electronic device provided by the present application is shown in the figure. Figure 9 As shown in the figure, the electronic device 90 provided by the present application comprises at least one processor 91 and a memory 92. Optionally, the electronic device 90 further comprises a communication component 93. Wherein, the processor 91, the memory 92 and the communication component 93 are connected through a bus.
[0200] In the specific implementation process, the at least one processor 91 executes the computer execution instructions stored in the memory 92, so that the at least one processor 91 executes the above-mentioned data processing method embodiments.
[0201] The specific implementation process of the processor 91 can be referred to the above-mentioned method embodiments, and the implementation principles and technical effects are similar, which will not be described here in detail.
[0202] In the above-mentioned embodiments, it should be understood that the processor can be a central processing unit (CPU), and can also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC) and the like. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor and the like. The steps of the method disclosed in the application can be directly embodied as hardware processor execution, or executed by hardware and software module combination in the processor.
[0203] The memory may include a high-speed memory (Random Access Memory, RAM), and may also include a non-volatile memory (NVM), exemplarily at least one disk storage.
[0204] A bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus. Buses can be categorized as address buses, data buses, and control buses. For ease of illustration, the buses in the drawings of this application are not limited to just one bus or just one type of bus.
[0205] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above-mentioned data processing method embodiments when run.
[0206] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disk.
[0207] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps in any one of the above data processing method embodiments are implemented.
[0208] An embodiment of the present application further provides another computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in any of the above-mentioned data processing method embodiments are implemented.
[0209] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0210] The above is a detailed introduction to a data processing method provided by the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only intended to help understand the method and core ideas of the present application. It should be pointed out that, for those skilled in the art, without departing from the principles of the present application, several improvements and modifications may be made to the present application, and such improvements and modifications also fall within the scope of protection of the claims of the present application.
Claims
1. A data processing method, characterized in that: Applied to a solid-state drive, the solid-state drive stores multiple stripes, each of the multiple stripes includes multiple pages of data, and the multiple pages of data include: multiple user data and one check bit data, the method includes: In a case where a target operation is detected, determining target user data in a target stripe to be operated by the target operation, the target stripe being a stripe among the plurality of stripes, and the target user data being one of the plurality of user data included in the target stripe; Determine a first performance quality of a first target storage unit where the target user data is located, where the first performance quality includes: a first wear level of the first target storage unit and a first load level of a first target channel corresponding to the first target storage unit; Determining a second performance quality of a second target storage unit where the first target parity bit data included in the target stripe is located, where the second performance quality includes: a second wear level of the second target storage unit and a second load level of a second target channel corresponding to the second target storage unit; When the first performance quality is greater than a first quality threshold and the second performance quality is less than a second quality threshold, the data stored in the first target storage unit and the data stored in the second target storage unit are exchanged.
2. The data processing method according to claim 1, wherein: The target operation is a write operation, and the method further includes: Obtaining target write data corresponding to the target user data; updating the first target parity bit data according to the target write data and other user data in the target stripe to obtain second target parity bit data; The data stored in the first target storage unit and the data stored in the second target storage unit include: The second target parity bit data is stored in the first target storage unit, and the target write data is stored in the second target storage unit.
3. The data processing method according to claim 1, wherein: The target operation is a recycling operation, the target user data is valid data, and the data stored in the first target storage unit and the data stored in the second target storage unit include: Determining whether the target user data is valid data; If so, storing the first target check bit data in the first target storage unit; The target user data is stored in the second target storage unit.
4. The data processing method according to any one of claims 1 to 3, characterized in that: In the case where the first performance quality is greater than a first quality threshold and the second performance quality is less than a second quality threshold, the data stored in the first target storage unit and the data stored in the second target storage unit include: When the first performance quality is greater than a first quality threshold and the second performance quality is less than a second quality threshold, evaluating an exchange result using a preset evaluation model, the exchange result being used to indicate whether the data stored in the first target storage unit and the data stored in the second target storage unit are equal; In a case where the exchange result indicates to exchange the data stored in the first target storage unit and the data stored in the second target storage unit.
5. The data processing method according to claim 4, characterized in that: The evaluation model includes a first module and a second module, and is constructed in the following manner: Constructing a first module, the first module being configured to determine a plurality of state variables and a plurality of decision variables based on an objective function, the plurality of state variables and the plurality of decision variables being in one-to-one correspondence, the plurality of state variables and the plurality of decision variables being configured to minimize a target value of the determined objective function, each state variable representing a state of a page of data of a stripe in a corresponding channel, and each decision variable representing a swap probability of a page of data of a stripe in a corresponding channel; A second module is constructed, where the second module is used to determine the exchange result based on the state variable corresponding to the target user data and the decision variable corresponding to the target user data.
6. The data processing method according to claim 5, characterized in that: The objective value of the objective function is the sum of a plurality of first difference values, each of which is the absolute value of a difference between one of the state variables and the corresponding decision variable.
7. The data processing method according to claim 5, characterized in that: The objective value of the objective function is a sum of a plurality of first products, each of which is a product of one of the state variables and a corresponding decision variable.
8. The data processing method according to claim 5, characterized in that: The objective function includes at least one of the following constraints: The sum of the decision variables corresponding to different page data belonging to different channels in the same stripe is 1; The sum of the decision variables corresponding to different pages of data in the same channel is equal to the sum of the state variables; The wear difference of the storage unit to which the data to be exchanged belongs is less than or equal to the wear threshold; The load difference of the channels to which the data to be exchanged belongs is less than or equal to the load threshold.
9. The data processing method according to claim 8, characterized in that: The use of a preset evaluation model to evaluate the exchange result includes: Obtaining a total number of writes and a total number of reads for each page of data in the plurality of stripes; Obtaining a mapping relationship between each page data in the plurality of stripes and a plurality of channels, wherein the mapping relationship is used to indicate the channel to which each page data in each stripe belongs; Acquire a first channel to which the target user data belongs and a second channel to which the first target check bit data belongs; The total number of write times, the total number of read times, the mapping relationship, the first channel, and the second channel are input into the evaluation model for evaluation to obtain the exchange result.
10. The data processing method according to any one of claims 1 to 3, characterized in that: The determining a first performance quality of the first target storage unit where the target user data is located includes: determining a first wear level of the first target storage unit; determining a first load level of a first target channel corresponding to the first target storage unit; The first performance quality is determined according to the first wear degree and / or the first load degree, wherein the first wear degree is negatively correlated with the first performance quality, and the first load degree is negatively correlated with the first performance quality.
11. The data processing method according to any one of claims 1 to 3, characterized in that: The determining the second performance quality of the second target storage unit where the first target parity bit data included in the target stripe is located includes: determining a second wear level of the second target storage unit; determining a second load level of a second target channel corresponding to the second target storage unit; The second performance quality is determined according to the second wear degree and / or the second load degree, the second wear degree is negatively correlated with the second performance quality, and the second load degree is negatively correlated with the second performance quality.
12. The data processing method according to claim 4, characterized in that: The target operation is a write operation, and the method further includes: When the exchange result indicates that no exchange is to be performed, the target write data corresponding to the target user data is stored in the first target storage unit, and the second target check bit data is stored in the second target storage unit, where the second target check bit data is obtained after updating based on the first target check bit data.
13. An electronic device, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the steps of the data processing method according to any one of claims 1 to 12 when executing the computer program.
14. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, wherein the computer program implements the steps of the data processing method according to any one of claims 1 to 12 when executed by a processor.
15. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the data processing method according to any one of claims 1 to 12 are implemented.
Citation Information
Patent Citations
Physical hard disk wear leveling method, device and system
CN108205423A
Wear leveling method for data strip reconstruction in RAID5 (redundant array of independent disks 5)
CN114924691A