Verification method, platform, device and storage medium for garbage collection strategy of universal flash storage

By dividing UFS into multiple target storage areas and writing them synchronously, the problems of insufficient verification efficiency and reliability in existing technologies are solved, achieving efficient and reliable garbage collection strategy verification and improving the performance and lifespan of UFS.

CN120610667BActive Publication Date: 2025-10-28ARTMEM TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511113981.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-08-11
Publication Date
2025-10-28
Estimated Expiration
2045-08-11

AI Technical Summary

Technical Problem

Existing garbage collection strategies cannot balance verification efficiency and verification result reliability, leading to UFS firmware crashes and performance impacts, thus affecting UFS lifespan.

Method used

The reliability of the verification results is ensured by dividing the target UFS into multiple target storage areas and synchronously writing the same single write data to each area until the maximum garbage collection intensity is reached, and then performing performance tests.

Benefits of technology

It improves verification efficiency, ensures the reliability of verification results, reduces the risk of UFS firmware crashes, and enhances the performance and lifespan of UFS.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120610667B_ABST
    Figure CN120610667B_ABST
Patent Text Reader

Abstract

This application provides a method, platform, device, and storage medium for verifying garbage collection strategies in general-purpose flash memory storage, belonging to the field of memory technology. The method includes: dividing a target UFS into equal partitions based on basic garbage collection units to obtain multiple target storage areas; acquiring single write data and using the starting address of each target storage area as the target write address; a UFS preprocessing step: synchronously writing the single write data to each target storage area according to each target write address and reading the garbage collection intensity status of the target UFS; when the garbage collection intensity status indicates that the maximum garbage collection intensity has not been reached, updating each target write address according to the length of the single write data and jumping to the UFS preprocessing step; when the garbage collection intensity status indicates that the maximum garbage collection intensity has been reached, performing a performance test on the target UFS. This application embodiment can simultaneously consider verification efficiency and the reliability of verification results.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of memory technology, and in particular to a verification method, platform, device and storage medium for a garbage collection strategy of general flash memory. Background Technology

[0002] With the widespread use of Universal Flash Storage (UFS), UFS lifespan has become a major concern. One of the key factors affecting UFS lifespan is the garbage collection strategy. Improper garbage collection can lead to UFS firmware crashes and even affect UFS performance, thus impacting UFS lifespan. Therefore, the garbage collection strategy of UFS is often verified during the performance testing phase. However, existing garbage collection strategy verification methods often fail to balance verification efficiency and the reliability of verification results. Therefore, there is an urgent need for a garbage collection strategy verification method that can simultaneously ensure verification efficiency and the reliability of verification results. Summary of the Invention

[0003] The main objective of this application is to propose a verification method, platform, device, and storage medium for a general flash memory garbage collection strategy, which can simultaneously ensure verification efficiency and the reliability of verification results.

[0004] To achieve the above objectives, a first aspect of this application proposes a method for verifying a garbage collection strategy for general-purpose flash memory, the method comprising:

[0005] Define the basic unit of garbage collection; the basic unit of garbage collection represents the minimum amount of data migration required for garbage collection when the corresponding target general-purpose flash storage UFS adopts a garbage collection strategy;

[0006] The target UFS is divided into multiple target storage areas based on the basic garbage collection unit; the capacity of each target storage area is a multiple of the basic garbage collection unit.

[0007] Acquire single write data and use the starting address of each target storage area as the target write address;

[0008] UFS preprocessing steps: Based on each target write address, the single write data is synchronously written to each target storage area and the garbage collection status of the target UFS is read;

[0009] When the garbage collection intensity status indicator has not reached the maximum garbage collection intensity, update each of the target write addresses according to the length of the single write data and jump to the UFS preprocessing step;

[0010] When the garbage collection intensity status indicator has reached the maximum garbage collection intensity, a performance test is performed on the target UFS to verify the garbage collection strategy based on the performance test results.

[0011] To achieve the above objectives, a second aspect of this application proposes a verification platform for a garbage collection strategy of general-purpose flash memory, comprising:

[0012] The determination module is used to determine the basic unit of garbage collection; the basic unit of garbage collection represents the minimum amount of data migration required for the corresponding target UFS to perform garbage collection using a garbage collection strategy;

[0013] The partitioning module is used to divide the target UFS into equal partitions according to the garbage collection basic unit to obtain multiple target storage areas; the capacity of each target storage area is a multiple of the garbage collection basic unit;

[0014] The preprocessing module is used to obtain single write data and use the starting address of each target storage area as the target write address; UFS preprocessing steps: according to each target write address, the single write data is synchronously written to each target storage area and the garbage collection intensity status of the target UFS is read; when the garbage collection intensity status indicates that the maximum garbage collection intensity has not been reached, each target write address is updated according to the length of the single write data and the process jumps to the UFS preprocessing step;

[0015] The performance testing module is used to perform performance testing on the target UFS when the garbage collection intensity status characterization has reached the maximum garbage collection intensity, so as to verify the garbage collection strategy based on the performance test results.

[0016] To achieve the above objectives, a third aspect of this application provides an electronic device, including: a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor executes the computer program to implement a verification method for a garbage collection strategy of general flash memory as described in any of the first aspects.

[0017] To achieve the above objectives, a fourth aspect of the present application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements a verification method for a garbage collection strategy of general-purpose flash memory as described in any of the first aspects.

[0018] The verification method, platform, device, and storage medium for a general-purpose flash memory storage garbage collection strategy proposed in this application first divide the target UFS into multiple target storage areas based on the basic unit of garbage collection. Then, the same single write data is synchronously written to multiple target storage areas multiple times. In this case, the written single write data is distributed in different locations, and since each write targets the same data in the same location in each target storage area, the target storage area is more likely to be filled. Therefore, the target UFS enters the garbage collection process more efficiently than with random or sequential writes. When the maximum garbage collection intensity is reached, performance testing of the target UFS can more accurately reflect its performance. Therefore, compared with related technologies, the embodiments of this application can ensure the reliability of the verification results while maintaining verification efficiency. Attached Figure Description

[0019] Figure 1 This is a flowchart illustrating the verification method for a garbage collection strategy of general flash memory provided in an embodiment of this application;

[0020] Figure 2 This is a schematic diagram of the execution flow of an embodiment of the verification method for the garbage collection strategy of general flash storage provided in this application;

[0021] Figure 3 This is a schematic diagram of the module of the verification platform for the garbage collection strategy of general flash storage provided in the embodiments of this application;

[0022] Figure 4 This is a schematic diagram of the system structure of an embodiment of the verification platform for the garbage collection strategy of general flash storage provided in this application.

[0023] Figure 5 This is a schematic diagram of the hardware structure corresponding to the verification method provided in the embodiments of this application. Detailed Implementation

[0024] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0025] It should be noted that although the device schematics illustrate functional module divisions and the flowcharts illustrate logical sequences, in certain circumstances, the steps shown or described may be performed in a sequence that differs from the module divisions in the device or the sequence in the flowcharts. The terms "first," "second," and so on, in the specification, claims, and drawings, are used to distinguish similar items and are not necessarily used to describe a specific sequence or precedence.

[0026] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.

[0027] The following is a description of the terminology used in the embodiments of this application:

[0028] SLC stands for Single-Level Cell, which means that each storage unit stores only 1 bit of data.

[0029] TLC, short for Tri-Level Cell, is a storage type where each cell can store 3 bits of data. It is different from SLC and has the advantages of large capacity and low cost.

[0030] With the widespread adoption of Universal Flash Storage (UFS), UFS lifespan has become a major concern. One of the key factors affecting UFS lifespan is its garbage collection strategy. Improper garbage collection can lead to UFS firmware crashes and even impact UFS performance, thus affecting its lifespan. Therefore, performance testing of UFS often requires verifying its garbage collection strategy. However, current garbage collection strategy verification methods often fail to balance verification efficiency and reliability. For example, existing technologies typically employ both random and sequential data writing to trigger maximum garbage collection. However, in practice, sequential data writing has a lower probability of triggering garbage collection during the writing process, and the time to reach maximum garbage collection often takes several days, increasing with UFS capacity. Similarly, random data writing, while having a higher probability of triggering garbage collection compared to sequential writing due to the randomness of the data write location, is also prone to data inconsistency, further extending the time to reach maximum garbage collection. Therefore, there is an urgent need for a method to verify garbage collection strategies that can simultaneously ensure verification efficiency and the reliability of verification results. Based on this, embodiments of this application provide a method, platform, device, and storage medium for verifying garbage collection strategies in general-purpose flash memory storage, which can simultaneously ensure verification efficiency and the reliability of verification results.

[0031] Understandably, referring to Figure 1 As shown, the verification method for a garbage collection strategy of general flash memory provided in the embodiments of this application includes:

[0032] Step S100: Determine the basic unit of garbage collection; the basic unit of garbage collection represents the minimum amount of data migration required for the corresponding target general-purpose flash storage UFS to perform garbage collection using a garbage collection strategy;

[0033] Step S200: Divide the target UFS into equal partitions according to the garbage collection basic unit to obtain multiple target storage areas; the capacity of each target storage area is a multiple of the garbage collection basic unit.

[0034] Step S300: Obtain the single write data and use the starting address of each target storage area as the target write address;

[0035] Step S400, UFS preprocessing step: Based on the write address of each target, synchronously write the single write data to each target storage area and read the garbage collection intensity status of the target UFS;

[0036] Step S500: When the garbage collection intensity status indicator has not reached the maximum garbage collection intensity, update the write addresses of each target according to the length of a single write data and jump to the UFS preprocessing step.

[0037] Step S600: When the garbage collection intensity status indicator has reached the maximum garbage collection intensity, perform performance testing on the target UFS to verify the garbage collection strategy based on the performance test results.

[0038] Therefore, by first dividing the target UFS into multiple target storage areas based on the basic unit of garbage collection, and then synchronously writing the same single write data to these multiple target storage areas multiple times, the written single write data is distributed in different locations. Since each write targets the same location in each target storage area, the target storage areas are more likely to fill up. In this case, the target UFS enters garbage collection more efficiently compared to random or sequential writes. When the maximum garbage collection intensity is reached, performance testing of the target UFS provides more accurate feedback on its performance. Therefore, this embodiment of the application can balance verification efficiency with ensuring the reliability of the verification results.

[0039] If the performance test meets the preset performance requirements, it means that the garbage collection strategy has been verified; otherwise, the garbage collection strategy needs to be optimized.

[0040] This application does not limit the specific value of the target storage area's capacity as a multiple of the basic unit of waste recycling. Those skilled in the art can selectively set it according to the actual situation.

[0041] Steps S400 and S500 enable sequential writing to each target storage area. Furthermore, since each write operation involves simultaneous writing to multiple target storage areas, the data written in a single operation is distributed intermittently within the target UFS. This makes it easier to trigger garbage collection strategies. Additionally, because the data written each time is identical, command issuance is simpler.

[0042] For step S400, a synchronous command can be used to simultaneously write the same single write data to each target storage area.

[0043] This application embodiment does not limit the length of a single written data entry, and it can be set with reference to the capacity of the target UFS and the basic unit of garbage collection.

[0044] Reaching maximum garbage collection intensity means that the remaining SLC free blocks in the UFS firmware are at their minimum. Here, SLC free blocks refer to "unused blank blocks" operating in SLC mode.

[0045] If continuous data is written when the maximum garbage collection intensity has been reached, UFS needs to move the SLC data to the TLC, which triggers the garbage collection process. If the garbage collection takes too long, it will affect command response and directly cause the host command to time out. Therefore, performing performance tests when the maximum garbage collection intensity has been reached can ensure the reliability of UFS verification results.

[0046] The performance test in step S600 may include performance under read operations and performance indicators under write operations. Performance indicators may include response time, read / write rate and device lifespan. This application embodiment does not limit these performance indicators, and those skilled in the art may selectively set them according to actual needs.

[0047] For example, assuming the target UFS capacity is M, the basic unit of garbage collection is k, and the capacity of a single target storage region is set to nk (n≥1), then the number of target storage regions is M / nk. Assuming M / nk=3, meaning it's divided into three target storage regions, with the first target storage region starting at addr1, the second at addr2, and the third at addr3, and a single write length of 6, then the first single write operation starts from addr1, addr2, and addr3. The second single write operation starts from addr1+6, addr2+6, and addr3+6. The third single write operation starts from addr1+12, addr2+12, and addr3+12. Once the third write operation is completed and the garbage collection progress status indicates that the maximum garbage collection progress has been reached, then writing single data entries to each target storage area will stop. Otherwise, writing will continue from addr1+18, addr2+18, and addr3+18, and so on, until the maximum garbage collection progress is reached.

[0048] Understandably, performance testing of the target UFS includes:

[0049] According to the preset performance operation issuance conditions, the corresponding performance operation instructions are issued to the target UFS. The performance operation instructions include at least one of the following: read data operation instructions, write data instructions, and read lifetime operation instructions.

[0050] Based on the performance metrics of the performance operation instructions, determine whether the target UFS meets the preset performance requirements.

[0051] The conditions for issuing performance operations are set in a one-to-one correspondence with the performance operation commands, which are used to define the timing, frequency, and command parameters carried by the performance operation commands. For example, for read data operation commands, this can include the timing for issuing the read data operation command, the number of times it is issued (or the conditions for stopping reading), and the amount of data read in a single operation.

[0052] The read data operation command indicates issuing a read command to the target UFS. The write data operation command indicates issuing a write command to the target UFS. The read lifetime operation command indicates issuing a lifetime read command after issuing a write command to the target UFS. The lifetime read command is used to obtain the device lifetime of the target UFS.

[0053] The performance metrics are obtained by detecting the corresponding performance operations based on preset performance metrics. For example, if the performance metric is read / write rate, then for a read operation data instruction, the corresponding performance metric is the read rate when performing the read operation.

[0054] The preset performance requirements characterize whether they meet expectations. These requirements can represent specifications or the UFS performance of competing products. This application does not limit the scope of these requirements, and those skilled in the art can selectively set them according to actual circumstances.

[0055] Understandably, performance testing of the target UFS includes:

[0056] Send a read data operation command to the target UFS to read data from the beginning address of the target UFS and end at the end address of the target UFS.

[0057] Obtain the read rate corresponding to each preset number of address data read by the read data operation command;

[0058] Based on the read rate, determine whether the target UFS meets the preset performance requirements.

[0059] By performing a full data read of the target UFS under maximum garbage collection conditions, the performance of the UFS under extreme circumstances can be tested. This further ensures the accuracy of the garbage collection strategy validation results.

[0060] The preset number can be selectively set according to actual needs. This application embodiment does not limit this, such as determining the read rate every 500 data points.

[0061] If the performance requirements are met, the garbage collection strategy has been validated; otherwise, the garbage collection strategy needs to be optimized.

[0062] Understandably, based on the read rate, it is determined whether the target UFS meets the preset performance requirements, including:

[0063] By plotting each read rate on the vertical axis and the number of data read at each read rate on the horizontal axis, a performance curve is obtained.

[0064] Determine the read rate fluctuation trend based on the performance curve;

[0065] Based on the rate fluctuation trend, determine whether the target UFS meets the preset performance requirements.

[0066] In some embodiments, the performance curves are displayed visually.

[0067] The read rate fluctuation trend indicates how the read rate fluctuates with the amount of data read. Greater fluctuations indicate more unstable performance. In some embodiments, read data analysis can be performed on regions with large read rate fluctuations, such as examining data in these regions and performing reads on them individually, to further analyze whether the issue is due to excessive garbage collection or other reasons. This allows for the determination of the cause of performance fluctuations based on the read rate fluctuation trend, and subsequent optimization of garbage collection strategies or other UFS strategies.

[0068] For example, if 50GB of data is written to the target UFS, the average write speed is obtained for every 100MB read. For 50GB, there are 500 write speeds of 100MB each. At this time, 500 data points can be obtained (each data point corresponds to a set of (read speed, read data volume)). Plotting the 500 data points in sequence into a line graph can yield the performance curve.

[0069] Understandably, performance testing of the target UFS includes:

[0070] Obtain performance data blocks and generate write data operation instructions based on the performance data blocks;

[0071] Send write data operation instructions to the target UFS and obtain the first command timeout of the write data operation instructions;

[0072] The performance data blocks are incremented and new write data operation instructions are generated. The new write data operation instructions are then reissued to the target UFS until the timeout time of the first command meets the preset timeout change conditions.

[0073] Based on the timeout of each first command, determine whether the target UFS meets the preset performance requirements.

[0074] By increasing the instruction parameters of write data operation instructions through multiple incrementing performance data blocks, the minimum performance limit can be tested.

[0075] Using the first command timeout as a performance metric can be used to more intuitively evaluate the performance of a target UFS under conditions of maximum garbage collection.

[0076] The timeout variation condition indicates that the timeout of the first command will not change as the number of performance data blocks carried in the write data operation instruction increases.

[0077] This application does not limit the initial data length of the performance data block, nor does it limit the amount of data added in each incremental processing. For example, in some embodiments, the data length is set as a multiple based on the capacity of the remaining SLC free blocks when the maximum garbage collection effort is reached. In some embodiments, the initial performance data block is selected from a preset mapping table based on the target UFS model. The mapping table is a set of performance data blocks obtained from simulation tests that meet performance analysis criteria for different UFS models (e.g., multiple writes may cause significant changes in the performance curve).

[0078] This application's embodiments address how to determine whether preset performance requirements are met based on the timeout times of each first command. In some embodiments, the mean squared error (MSE) of each first command's timeout time can be calculated to obtain the MSE. This MSE is then compared to a preset timeout threshold. If the MSE is less than the threshold, the performance requirements are met, and the garbage collection strategy is verified. Otherwise, the performance requirements are not met, and the garbage collection strategy needs optimization. In other embodiments, abnormal timeout times can be filtered out first, and then the mean of the filtered timeout times can be calculated to obtain the mean timeout MSE. This mean timeout MSE is compared to the timeout threshold; if it is less than the threshold, the garbage collection strategy is verified. In still other embodiments, a timeout performance curve can be constructed based on each first command's timeout time, and the curve spacing between the timeout performance curve and the baseline performance curve can be calculated. The MSE is then calculated based on the curve spacing. If the MSE is greater than the timeout threshold, the garbage collection strategy verification fails.

[0079] Understandably, the method also includes:

[0080] Obtain the second command timeout for the benchmark UFS under the condition of reaching maximum garbage collection intensity;

[0081] Based on the timeout of the first command and the timeout of the second command, determine whether to optimize the target UFS.

[0082] The benchmark UFS is the UFS with the lowest performance standard, which can be a competing product or a historical product. Those skilled in the art can selectively configure it according to actual needs.

[0083] The second command timeout is the timeout obtained by performing a write data operation command under the same test conditions as the target UFS. In some embodiments, the second command timeout can be obtained by performing the same steps as obtaining the first command timeout on the benchmark UFS with reference to the target UFS.

[0084] This application describes how to determine whether to not optimize a target UFS based on a first command timeout and a second command timeout. In some embodiments, the determination of whether to optimize the target UFS can be based on the percentage of times the first command timeout is lower than the second command timeout, or on the changing trend of the time difference between the first and second command timeouts, and the percentage of positive and negative trends. Those skilled in the art can selectively set these parameters according to the actual situation.

[0085] Understandably, performance testing of the target UFS includes:

[0086] The device lifetime of the target UFS, determined when maximum waste collection has been achieved, will be used as the first initial device lifetime.

[0087] Write preset lifetime prediction data to the target UFS at multiple intervals;

[0088] After each time preset lifetime prediction data is written to the target UFS, the device lifetime of the target UFS is obtained as the remaining lifetime of the device.

[0089] Based on the initial lifespan and remaining lifespan of the first device, determine whether the target UFS meets the preset performance requirements.

[0090] Lifetime prediction data refers to data whose lifespan changes after being written. Different data lengths have different impacts on lifespan. The length of the data used for lifespan prediction can be determined through simulation or human experience, thus obtaining the lifespan prediction data. By comparing the initial lifespan of the first device with the remaining lifespan obtained each time, the impact of written data on the lifespan of the target UFS can be determined under conditions of maximum garbage collection. Therefore, by using device lifespan as a performance indicator, a more comprehensive evaluation can be made of whether the performance of the target UFS meets the performance requirements.

[0091] In some embodiments, the device lifetime of the target UFS is also obtained before UFS preprocessing begins. This allows observation of the performance impact on the target UFS when garbage collection is at its peak.

[0092] This application does not limit how the initial lifespan and remaining lifespan of the first device are used to determine whether performance requirements are met. In some embodiments, the determination can be based on whether the lifespan change trend meets the requirements. In other embodiments, the rate of change between two adjacent device lifespans can be evaluated, and the total rate of change and the interval rate of change can be used to determine whether they match the expected change relationship, thereby determining whether performance requirements are met.

[0093] For example, for a brand new target UFS, before testing, the device health descriptor is obtained using a query command to obtain the device lifetime. If initially the device lifetime is between 0-10%, after UFS preprocessing to reach maximum garbage collection intensity, the device lifetime is obtained again using a query command. If the device lifetime obtained after UFS preprocessing is significantly larger than before testing (e.g., 30%), wear level can be calculated based on the actual write volume to determine if the wear level is less than a preset wear threshold. This serves as a basis for judging the rationality of the garbage collection strategy. When the garbage collection intensity is at its maximum, the garbage collection strategy is verified to be successful. Then, lifetime prediction data is written, and the device lifetime is obtained after each write until writing becomes impossible or the expected number of writes is reached. At this point, wear level is calculated based on each obtained device lifetime, thereby evaluating the rationality of the garbage collection strategy. If the calculated wear level consistently meets the wear threshold corresponding to the amount of written data, the garbage collection strategy is considered verified to be successful.

[0094] In summary, the garbage collection strategy verification method of the above embodiments of this application can quickly verify whether the garbage collection strategy is reasonable, improve testing efficiency, and accelerate UFS development. Furthermore, by adding verification steps for device lifespan and command timeout, it can be ensured that garbage collection anomalies reduce the impact on lifespan and normal use, and reasonably improve user performance experience when garbage collection is at its maximum.

[0095] In some embodiments, the garbage collection strategy can be verified by selecting one or more of the read rate performance metrics, command timeout performance metrics, and device lifetime performance metrics through a visual interface. Alternatively, the number of times the read rate performance metrics, command timeout performance metrics, and device lifetime performance metrics are acquired can be configured through a visual interface.

[0096] For example, taking the need to simultaneously verify the target UFS's read rate performance, command timeout performance, and device lifetime performance as part of the garbage collection strategy, then... Figure 2 As shown, the specific steps are as follows:

[0097] S1. Initialize the target UFS and bring it to maximum GC (garbage collection) intensity. The process is as follows: Divide the capacity of the target UFS into n roughly equal regions to obtain multiple target storage regions. The size of each target storage region is determined by the garbage collection unit based on the capacity of the different UFS, and a different value m is selected. Then, write data step by step in each target storage region (only one write command is sent each time, using synchronous commands) until each target storage region is filled with a region of size m. The block size of a single write operation is determined by the capacity of different storage devices, which can be 4KB or other values. When a read data operation command is tested, jump to S2. When a write data operation command is tested, jump to S3. When a read lifetime operation command is tested, jump to S4.

[0098] S2. When the UFS storage device's GC intensity is at its maximum, a full disk read can be performed. Performance curves are then plotted to analyze their reasonableness (e.g., using data lengths of 50MB, 100MB, etc., as data points to obtain read rates). Performance curves are then plotted for each data point and read rate, and compared with the performance curve of a benchmark UFS to determine if the requirements are met. If they are met, the garbage collection verification strategy has passed. If further performance testing is needed, proceed to S1.

[0099] S3. When the target UFS is under maximum GC intensity, multiple write data operation commands are sent, each carrying a different performance data block size. The size of the performance data block carried by different write data operation commands increases incrementally (e.g., the first performance data block is 4KB, the second is 8KB, etc.) to test the minimum performance limit of write commands. The timeout time of the first command of each write data operation command is used to analyze whether the GC strategy meets the expected requirements. If further performance testing is needed, proceed to S1.

[0100] S4. Upon entering maximum GC intensity, obtain the first initial device lifetime. Evaluate whether the performance requirements are met based on the first initial device lifetime under maximum GC intensity and the second initial device lifetime before testing. If further performance testing is required, proceed to S1.

[0101] If any one of the following is set multiple times: the read rate performance metric, the command timeout performance metric, or the device lifetime performance metric, then S1 is re-executed. In other embodiments, S4 can also continue writing data and obtaining the device lifetime as the remaining device lifetime after entering the maximum GC intensity state. This allows for the evaluation of the garbage collection strategy based on the remaining device lifetime, the first initial device lifetime, and the second initial device lifetime.

[0102] Understandably, referring to Figure 3 As shown, the verification platform for the garbage collection strategy of general flash storage provided according to the embodiments of this application includes:

[0103] Module 100 is used to determine the basic unit of garbage collection; the basic unit of garbage collection represents the minimum amount of data migration required for the corresponding target UFS to perform garbage collection using the garbage collection strategy;

[0104] The partitioning module 200 is used to equally divide the target UFS into multiple target storage areas based on the garbage collection basic unit; the capacity of each target storage area is a multiple of the garbage collection basic unit.

[0105] The preprocessing module 300 is used to obtain single write data and use the starting address of each target storage area as the target write address; UFS preprocessing steps: according to each target write address, the single write data is synchronously written to each target storage area and the garbage collection intensity status of the target UFS is read; when the garbage collection intensity status indicates that the maximum garbage collection intensity has not been reached, the target write addresses are updated according to the length of the single write data and the process jumps to the UFS preprocessing step.

[0106] The performance testing module 400 is used to perform performance testing on the target UFS when the garbage collection intensity status indicator has reached the maximum garbage collection intensity.

[0107] Therefore, the verification platform for the garbage collection strategy of the general flash storage in this application embodiment can verify the garbage collection strategy based on the read rate performance index by allowing the target UFS storage to quickly enter the maximum GC intensity and selecting to perform a full-disk read performance test when the target UFS enters the maximum GC intensity. Alternatively, it can select to perform multiple single-transaction performance database writes when the target UFS enters the maximum GC intensity, and by increasing the size of the performance data block written each time, it can test the extreme timeout time to analyze whether the garbage collection strategy is reasonable. Alternatively, it can select to obtain the device lifespan through UFS protocol commands when the target UFS enters the maximum GC intensity, and analyze whether the garbage collection strategy is reasonable based on the lifespan loss.

[0108] In some embodiments, such as Figure 4 As shown, the verification platform for the garbage collection strategy of general flash storage is integrated into the UFS test board. The UFS test board and the target UFS are pluggable. The UFS test board sends relevant instructions to the target UFS and obtains information about the target UFS, thereby verifying the garbage collection strategy of the target UFS.

[0109] Please see Figure 5 , Figure 5The hardware structure of an electronic device according to another embodiment is illustrated. The electronic device includes:

[0110] The processor 501 can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this application.

[0111] The memory 502 can be a NAND flash memory. The relevant program code is stored in the memory 502 and is called by the processor 501 to execute the verification method of the garbage collection strategy of the general flash memory storage in this application embodiment.

[0112] The input / output interface 503 is used to implement information input and output;

[0113] The communication interface 504 is used to enable communication and interaction between this device and other devices. Communication can be achieved through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).

[0114] Bus 505 transmits information between various components of the device (e.g., processor 501, memory 502, input / output interface 503, and communication interface 504);

[0115] The processor 501, memory 502, input / output interface 503, and communication interface 504 are connected to each other within the device via bus 505.

[0116] This application also provides a computer-readable storage medium that stores a computer program. When the computer program is executed by a processor, it implements the verification method for the garbage collection strategy of the general flash memory described above.

[0117] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

[0118] The embodiments described in this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided by the embodiments of this application. As those skilled in the art will know, with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of this application are also applicable to similar technical problems.

[0119] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of this application, and may include more or fewer steps than shown, or combine certain steps, or different steps.

[0120] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0121] Those skilled in the art will understand that all or some of the steps in the methods disclosed above, as well as the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, or suitable combinations thereof.

[0122] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0123] It should be understood that in this application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following items" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.

[0124] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the above-mentioned units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0125] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0126] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0127] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes multiple instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing programs, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0128] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but are not intended to limit the scope of the present invention. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and essence of the present invention should be within the scope of the present invention.

Claims

1. A method for verifying a garbage collection strategy for general-purpose flash memory storage, characterized in that, The method includes: Define the basic unit of garbage collection; the basic unit of garbage collection represents the minimum amount of data migration required for garbage collection when the corresponding target general-purpose flash storage UFS adopts a garbage collection strategy; The target UFS is divided into multiple target storage areas based on the basic garbage collection unit; the capacity of each target storage area is a multiple of the basic garbage collection unit. Acquire single write data and use the starting address of each target storage area as the target write address; UFS preprocessing steps: Based on each target write address, the single write data is synchronously written to each target storage area and the garbage collection status of the target UFS is read; When the garbage collection intensity status indicator has not reached the maximum garbage collection intensity, update each of the target write addresses according to the length of the single write data and jump to the UFS preprocessing step; When the garbage collection intensity status indicator has reached the maximum garbage collection intensity, a performance test is performed on the target UFS to verify the garbage collection strategy based on the performance test results.

2. The verification method for the garbage collection strategy of general flash memory storage according to claim 1, characterized in that, The performance test of the target UFS includes: According to the preset performance operation issuance conditions, the corresponding performance operation instructions are issued to the target UFS. The performance operation instructions include at least one of read data operation instructions, write data instructions, and read lifetime operation instructions. Based on the performance metrics of the performance operation instructions, determine whether the target UFS meets the preset performance requirements.

3. The verification method for the garbage collection strategy of general flash memory storage according to claim 1, characterized in that, The performance test of the target UFS includes: A read data operation instruction is issued to the target UFS to read data from the start address of the target UFS and end at the end address of the target UFS. Obtain the read rate corresponding to each preset number of address data read by the read data operation instruction; Based on the read rate, determine whether the target UFS meets the preset performance requirements.

4. The verification method for the garbage collection strategy of general flash memory storage according to claim 3, characterized in that, The step of determining whether the target UFS meets the preset performance requirements based on the read rate includes: A performance curve is obtained by using the read rate as the vertical axis and the number of data read at each read rate as the horizontal axis. Based on the performance curve, determine the read rate fluctuation trend; Based on the rate fluctuation trend, determine whether the target UFS meets the preset performance requirements.

5. The verification method for the garbage collection strategy of general flash memory storage according to claim 1, characterized in that, The performance test of the target UFS includes: Acquire performance data blocks and generate write data operation instructions based on the performance data blocks; Send the write data operation instruction to the target UFS and obtain the first command timeout of the write data operation instruction; The performance data block is incremented and a new write data operation instruction is generated. The new write data operation instruction is then reissued to the target UFS until the timeout time of the first command meets the preset timeout change condition. Based on the timeout period of each of the first commands, determine whether the target UFS meets the preset performance requirements.

6. The verification method for the garbage collection strategy of general-purpose flash memory storage according to claim 5, characterized in that, The method further includes: Obtain the second command timeout for the benchmark UFS under the condition of reaching maximum garbage collection intensity; Based on the timeout time of the first command and the timeout time of the second command, determine whether to optimize the target UFS.

7. The verification method for the garbage collection strategy of general-purpose flash memory storage according to claim 1, characterized in that, The performance test of the target UFS includes: The device lifetime of the target UFS, determined when maximum garbage collection intensity has been achieved, will be used as the first initial device lifetime. Preset lifetime prediction data is written to the target UFS at multiple intervals; After each time preset lifetime prediction data is written to the target UFS, the device lifetime of the target UFS is obtained as the remaining lifetime of the device. Based on the initial lifespan of the first device and the remaining lifespan of the device, determine whether the target UFS meets the preset performance requirements.

8. A verification platform for a garbage collection strategy of general-purpose flash memory storage, characterized in that, include: The determination module is used to determine the basic unit of waste recycling; The basic unit of garbage collection represents the minimum amount of data migration required for garbage collection in the target UFS using the garbage collection strategy. The partitioning module is used to divide the target UFS into equal partitions based on the basic garbage collection unit to obtain multiple target storage areas; The capacity of each target storage area is a multiple of the basic unit of waste recycling; The preprocessing module is used to obtain single write data and use the starting address of each target storage area as the target write address; UFS preprocessing steps: Based on each target write address, the single write data is synchronously written to each target storage area and the garbage collection intensity status of the target UFS is read; when the garbage collection intensity status indicates that the maximum garbage collection intensity has not been reached, each target write address is updated according to the length of the single write data and the process jumps to the UFS preprocessing steps. The performance testing module is used to perform performance testing on the target UFS when the garbage collection intensity status characterization has reached the maximum garbage collection intensity, so as to verify the garbage collection strategy based on the performance test results.

9. An electronic device, comprising: A memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, when the processor executes the computer program, it implements a verification method for a garbage collection strategy of a general-purpose flash memory as described in any one of claims 1 to 7.

10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements a verification method for the garbage collection strategy of the general-purpose flash memory storage as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • ZNS-SSD storage system-oriented garbage collection method

    CN119473143A

  • Memory recovery method and device, electronic equipment and storage medium

    CN120233934A