Verification method, platform and equipment for garbage collection strategy stored by universal flash memory and storage medium

By dividing UFS into multiple storage areas for synchronous writing, the problems of insufficient verification efficiency and reliability in existing technologies are solved, efficient and reliable garbage collection strategy verification is achieved, and the performance and life of UFS are improved.

CN120610667AActive Publication Date: 2025-09-09ARTMEM TECHNOLOGY CO LTD

Patent Information

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

AI Technical Summary

Technical Problem

The existing garbage collection strategy verification method cannot balance verification efficiency and reliability of verification results, resulting in UFS firmware crashes and performance impacts.

Method used

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, performance testing is then performed to ensure the reliability of the verification results.

Benefits of technology

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

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120610667A_ABST
    Figure CN120610667A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a verification method, platform and equipment for a garbage collection strategy stored by a universal flash memory and a storage medium, and belongs to the technical field of memories. The method comprises the following steps: equally partitioning a target UFS according to a garbage collection basic unit to obtain a plurality of target storage regions; obtaining single writing data and taking the initial address of each target storage area as a target writing address; a UFS preprocessing step: according to each target writing address, synchronously writing single writing data into each target storage area, and reading a garbage collection strength state of a target UFS; when the garbage collection strength state characterizes that the maximum garbage collection strength is not reached, updating each target writing address according to the length of the single writing data, and skipping to the UFS preprocessing step; and when the garbage collection strength state characterizes that the maximum garbage collection strength is reached, performing a performance test on the target UFS. The verification efficiency and the reliability of the verification result can be considered at the same time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present 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 universal flash memory storage. Background Art

[0002] With the widespread use of Universal Flash Storage (UFS), the lifespan of UFS has attracted widespread attention. One of the key factors in UFS's lifespan is its garbage collection strategy. Improper handling of the garbage collection strategy may cause UFS firmware crashes and even affect UFS performance, thereby affecting the lifespan of UFS. Based on this, it is often necessary to verify the UFS garbage collection strategy during the performance testing phase of UFS. However, the verification methods of garbage collection strategies in existing technologies often cannot balance verification efficiency and reliability of verification results. Therefore, a garbage collection strategy verification method that can simultaneously balance verification efficiency and reliability of verification results is urgently needed. Summary of the Invention

[0003] The main purpose of the embodiments of the present application is to propose a verification method, platform, device and storage medium for a garbage collection strategy of universal flash memory storage, which can take into account both verification efficiency and reliability of verification results.

[0004] To achieve the above-mentioned objectives, a first aspect of an embodiment of the present application provides a method for verifying a garbage collection policy of a universal flash memory storage, the method comprising: Determine a garbage collection basic unit; the garbage collection basic unit represents the minimum data migration amount for garbage collection by the corresponding target universal flash storage UFS using the garbage collection strategy; The target UFS is equally partitioned according to the garbage collection basic unit to obtain a plurality of target storage areas; the capacity of each target storage area is a multiple of the garbage collection basic unit; Acquire single write data and use the starting address of each target storage area as the target write address; UFS pre-processing step: synchronously writing the single write data into each of the target storage areas according to each of the target write addresses and reading the garbage collection strength status of the target UFS; When the garbage collection intensity status representation does not reach the maximum garbage collection intensity, updating each of the target write addresses 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, a performance test is performed on the target UFS to verify the garbage collection strategy based on the performance test result.

[0005] To achieve the above objectives, a second aspect of an embodiment of the present application provides a verification platform for a garbage collection strategy of a universal flash storage, including: A determination module, configured to determine a garbage collection basic unit; the garbage collection basic unit represents a minimum amount of data migration for garbage collection by a corresponding target UFS using a garbage collection strategy; a partitioning module, configured to equally partition the target UFS according to the garbage collection basic unit to obtain a plurality of target storage areas; the capacity of each target storage area is a multiple of the garbage collection basic unit; A preprocessing module is configured to obtain single write data and use the starting address of each target storage area as a target write address; a UFS preprocessing step is configured to synchronously write the single write data to each target storage area according to each target write address and read 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, update each target write address according to the length of the single write data and jump to the UFS preprocessing step; The performance testing module is configured to perform a performance test on the target UFS when the garbage collection intensity status indicates that the maximum garbage collection intensity has been reached, so as to verify the garbage collection strategy based on the performance test result.

[0006] To achieve the above-mentioned purpose, the third aspect of an embodiment of the present application proposes an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and runnable on the processor, wherein when the processor executes the computer program, a verification method for the garbage collection strategy of the universal flash memory storage as described in any one of the first aspects is implemented.

[0007] To achieve the above-mentioned purpose, the fourth aspect of an embodiment of the present application proposes a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the verification method of the garbage collection strategy of the universal flash memory storage described in any one of the first aspects.

[0008] The verification method, platform, device and storage medium of the garbage collection strategy of universal flash storage proposed in this application first divide the target UFS into multiple target storage areas according to the basic unit of garbage collection, and write the same single write data to the multiple target storage areas synchronously for multiple times. At this time, the written single write data is distributed in different locations, and since each write is to the same location of each target storage area for the same data, the target storage area is more likely to be filled. At this time, the speed at which the target UFS enters the garbage collection intensity is more efficient than that of random writing or sequential writing. At this time, when the maximum garbage collection intensity is reached, the performance test of the target UFS can more accurately feedback the performance of the target UFS. Therefore, compared with the related technology, the embodiment of the present application can take into account the verification efficiency while ensuring the reliability of the verification results. BRIEF DESCRIPTION OF THE DRAWINGS

[0009] Figure 1 This is a flow chart of a method for verifying a garbage collection strategy for universal flash storage provided by an embodiment of the present application; Figure 2 This is a schematic diagram of an execution flow of an embodiment of a method for verifying a garbage collection policy for universal flash storage provided by an embodiment of the present application; Figure 3 This is a module diagram of a verification platform for a garbage collection strategy for universal flash storage provided by an embodiment of the present application; Figure 4 This is a schematic diagram of the system structure of an embodiment of a verification platform for a garbage collection strategy of universal flash storage provided by an embodiment of the present application; Figure 5 It is a structural diagram of the hardware structure corresponding to the verification method provided in the embodiment of the present application. DETAILED DESCRIPTION

[0010] In order to make the purpose, technical solutions and advantages of this application more clearly understood, the present application is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.

[0011] 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.

[0012] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this application pertains. The terms used herein are for the purpose of describing the embodiments of this application only and are not intended to limit this application.

[0013] The following is an explanation of the terms involved in the embodiments of this application: SLC, also known as Single-Level Cell, is abbreviated as single-layer cell in Chinese. Each storage cell stores only 1 bit of data.

[0014] TLC, which is the abbreviation of Tri-Level Cell, is abbreviated as three-layer cell in Chinese. Each storage cell can store 3 bits of data. It is a storage type different from SLC and has the advantages of large capacity and low cost.

[0015] With the widespread adoption of Universal Flash Storage (UFS), the lifespan of UFS has attracted widespread attention. One of the key factors in UFS lifespan is its garbage collection strategy. Improper garbage collection can cause UFS firmware crashes and even affect UFS performance, ultimately impacting UFS lifespan. Therefore, verification of the UFS garbage collection strategy is often required during UFS performance testing. However, existing methods for verifying garbage collection strategies often fail to balance efficiency and reliability. For example, existing methods typically use both random and sequential data writes to trigger UFS to enter maximum garbage collection intensity. However, in actual operation, sequential writes have a low probability of triggering garbage collection during the write process, and the duration of reaching maximum garbage collection intensity often takes several days. This duration increases with increasing UFS capacity. Furthermore, random writes, due to the randomness of data write locations, are more likely to trigger garbage collection than sequential writes, but are also prone to data discontinuity, resulting in a longer duration of reaching maximum garbage collection intensity. Therefore, there is an urgent need for a garbage collection strategy verification method that can balance verification efficiency and reliability of verification results. Based on this, the embodiments of the present application provide a universal flash memory storage garbage collection strategy verification method, platform, device, and storage medium that can balance verification efficiency and reliability of verification results.

[0016] It is understandable that referring to Figure 1 As shown, according to the embodiment of the present application, a method for verifying a garbage collection policy for universal flash storage is provided, the method comprising: Step S100: determining a garbage collection basic unit; the garbage collection basic unit represents the minimum amount of data migration for garbage collection by the corresponding target universal flash storage UFS using a garbage collection strategy; Step S200: partition the target UFS into equal parts 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; Step S300: Acquire single write data and use the starting address of each target storage area as the target write address; Step S400, UFS pre-processing step: synchronously write the single write data to each target storage area according to each target write address and read the garbage collection strength status of the target UFS; Step S500: 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 a single write data and the process jumps to the UFS pre-processing step; Step S600: When the garbage collection intensity status indicates that the maximum garbage collection intensity has been reached, a performance test is performed on the target UFS to verify the garbage collection strategy based on the performance test result.

[0017] Therefore, by first dividing the target UFS into multiple target storage areas based on the basic unit of garbage collection, and then writing the same single write data to the multiple target storage areas in multiple times, the written single write data is distributed in different locations. Since each write is to the same location of each target storage area, the target storage area is more likely to be filled. At this time, the speed at which the target UFS enters the garbage collection intensity is more efficient than that of random writing or sequential writing. At this time, when the maximum garbage collection intensity is reached, the performance test of the target UFS can provide more accurate feedback on the performance of the target UFS. Therefore, the embodiment of the present application can take into account the verification efficiency while ensuring the reliability of the verification results.

[0018] If the performance test meets the preset performance requirements, the garbage collection strategy is verified to be successful. Otherwise, the garbage collection strategy needs to be optimized.

[0019] The embodiment of the present application does not limit the specific value of the capacity of the target storage area as a multiple of the garbage collection basic unit, and those skilled in the art can selectively set it according to actual conditions.

[0020] Steps S400 and S500 enable sequential writing to each target storage area. Furthermore, since each data write is performed simultaneously to multiple target storage areas, the data written is distributed at intervals within the target UFS. This makes it easier to trigger garbage collection strategies. Furthermore, since the data written each time is identical, command issuance is simpler.

[0021] For step S400 , a synchronization command may be used to write the same single write data into each target storage area simultaneously.

[0022] The embodiment of the present application does not limit the length of a single write data, and it can also be set with reference to the capacity of the target UFS and the basic unit of garbage collection.

[0023] Reaching maximum garbage collection strength means that the number of free SLC blocks remaining in the UFS firmware is at a minimum. Free SLC blocks refer to "unused blank blocks" operating in SLC mode.

[0024] When the maximum garbage collection intensity has been reached, if there is continuous data writing, UFS needs to move the SLC data to the TLC, which is to trigger the garbage collection process. If the garbage collection time is too long, it will affect the command response and directly cause the host command to time out. Therefore, performance testing under the condition of reaching the maximum garbage collection intensity can ensure the reliability of the UFS verification results.

[0025] The performance test in step S600 may include performance indicators under read operations and performance indicators under write operations, such as response time, read and write rates, and device life. The embodiments of the present application do not limit this, and those skilled in the art can selectively set them according to actual needs.

[0026] For example, assuming that the capacity of the target UFS is M, the basic unit of garbage collection is k, and the capacity of a single target storage area is set to nk (n ≥ 1), the number of target storage areas is M / nk. Assuming M / nk = 3, that is, it is divided into three target storage areas, when the starting address of the first target storage area is addr1; the starting address of the second target storage area is addr2, and the starting address of the third target storage area is addr3; the length of a single write data is 6; then the first writing of a single write data starts from addr1, addr2 and addr3. The second writing of a single write data starts from addr1+6, addr2+6 and addr3+6. The third writing of a single write data starts from addr1+12, addr2+12 and addr3+12. When the garbage collection intensity status read after the third write is completed indicates that the maximum garbage collection intensity has been reached, the writing of single write data to each target storage area is stopped. Otherwise, writing is continued from addr1+18, addr2+18 and addr3+18, and so on until the maximum garbage collection intensity is reached.

[0027] It is understandable that the target UFS is subjected to performance testing, including: According to the preset performance operation issuing conditions, the corresponding performance operation instruction is issued to the target UFS, where the performance operation instruction includes at least one of a read data operation instruction, a write data operation instruction, and a read lifespan operation instruction; Determine whether the target UFS meets the preset performance requirements based on the performance indicators of the performance operation instructions.

[0028] Performance operation conditions are set in a one-to-one correspondence with performance operation instructions. They define the timing and frequency of performance operation instruction issuance, as well as the instruction parameters carried by the performance operation instruction. For example, for a read data instruction, this includes the timing of the instruction issuance, the frequency of issuance (or the conditions for stopping the read), and the amount of data read in a single operation.

[0029] A read data operation instruction indicates issuing a read instruction to the target UFS. A write data operation instruction indicates issuing a write instruction to the target UFS. A read lifespan operation instruction indicates issuing a read lifespan instruction after issuing a write instruction to the target UFS. The read lifespan instruction is used to obtain the device lifespan of the target UFS.

[0030] The performance indicator is obtained by detecting the corresponding performance operation based on the preset performance indicator item. For example, if the performance indicator item is the read and write rate, then for a read operation data instruction, the corresponding performance indicator is the read rate during the read operation.

[0031] The preset performance requirements represent whether they meet expectations. They can represent specification parameters or the UFS performance of competing products. This embodiment of the present application does not limit this, and those skilled in the art can selectively set them according to actual circumstances.

[0032] It is understandable that the target UFS is subjected to performance testing, including: Sending a read data operation instruction to the target UFS, so as to start reading from the start address of the target UFS and end reading at the end address of the target UFS through the read data operation instruction; Obtaining a read rate corresponding to each read of a preset number of address data through a read data operation instruction; Based on the read rate, determine whether the target UFS meets the preset performance requirements.

[0033] By performing a full disk read of the target UFS at maximum garbage collection intensity, the UFS performance under extreme conditions can be tested, thereby further ensuring the accuracy of the garbage collection strategy verification results.

[0034] The preset number can be selectively set according to actual needs, and the embodiment of the present application does not impose any restrictions on this. For example, the reading rate is determined once every 500 data.

[0035] If the performance requirements are met, the garbage collection strategy is verified to be successful. Otherwise, the garbage collection strategy needs to be optimized.

[0036] It is understood that, based on the read rate, determining whether the target UFS meets the preset performance requirements includes: The performance curve is obtained by taking each reading rate as the vertical axis and the amount of read data corresponding to each reading rate as the horizontal axis; Determine the reading rate fluctuation trend based on the performance curve; Based on the rate fluctuation trend, determine whether the target UFS meets the preset performance requirements.

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

[0038] The read rate fluctuation trend indicates how the rate fluctuates with the amount of data read. The greater the fluctuation, the more unstable the performance. In some embodiments, read data analysis can be performed on areas with large read rate fluctuation trends. For example, data from areas with large read rate fluctuation trends can be viewed and read separately to further analyze whether it is due to excessive garbage collection (GC) or other reasons. Based on the read rate fluctuation trend, the cause of the performance fluctuation can be determined, and the garbage collection strategy or other UFS strategies can be optimized based on the cause of the performance fluctuation.

[0039] For example, taking the target UFS as an example where 50GB of data is written, an average value of the write rate is obtained for every 100MB read. 500 write rates of 100MB can be obtained for 50GB. At this time, 500 data can be obtained (where each data corresponds to a set of (read rate, read data volume)). The 500 data are plotted in sequence into a line graph to obtain a performance curve.

[0040] It is understandable that the target UFS is subjected to performance testing, including: Obtaining a performance data block and generating a write data operation instruction based on the performance data block; Send a write data operation instruction to the target UFS and obtain the first command timeout of the write data operation instruction; Incrementally process the performance data block and generate a new write data operation instruction, and re-issue the new write data operation instruction to the target UFS until the first command timeout period meets the preset timeout change condition; According to the timeout period of each first command, it is determined whether the target UFS meets the preset performance requirement.

[0041] By increasing the performance data block multiple times to increase the instruction parameter content of the write data operation instruction, the minimum performance with the limit written can be tested.

[0042] The first command timeout period can be used as a performance indicator to more intuitively evaluate the performance of the target UFS when the garbage collection is at its maximum intensity.

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

[0044] The embodiments of the present application do not restrict the initial data length of the performance data block, nor do they restrict the amount of data added for each incremental processing. For example, in some embodiments, a multiple is set based on the capacity of the remaining SLC free blocks when the maximum garbage collection intensity is reached. For example, in some embodiments, an initial performance data block is selected from a preset mapping table based on the model of the target UFS. The mapping table is based on performance data blocks obtained from simulation tests for different UFSs that meet performance analysis (e.g., multiple writes will cause significant changes in the performance curve, etc.).

[0045] The embodiments of the present application discuss how to determine whether the preset performance requirements are met based on the timeout period of each first command. For example, in some embodiments, the mean square deviation of each first command timeout can be calculated to obtain the timeout mean square deviation, and the excess mean square deviation is compared with the preset timeout threshold. If it is less than the timeout 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 to be optimized. In other embodiments, the first command timeout can be filtered out to remove abnormal timeouts, and then the mean of the filtered first command timeout can be calculated to obtain the mean time mean square deviation. The mean time mean square deviation is compared with the timeout threshold. When it is less than the timeout threshold, it indicates that the garbage collection strategy is verified. In other embodiments, a timeout performance curve can be constructed based on the timeout period of each first command, and the curve spacing between the timeout performance curve and the benchmark performance curve is calculated. The mean square deviation is calculated based on the curve spacing to obtain the timeout mean square deviation. When the timeout mean square deviation is greater than the timeout threshold, it indicates that the garbage collection strategy is verified.

[0046] It is understood that the method further comprises: Get the second command timeout of the benchmark UFS when the maximum garbage collection intensity is reached; Whether to optimize the target UFS is determined according to the first command timeout period and the second command timeout period.

[0047] The baseline UFS is a UFS with the lowest performance standard, which can be a competitive product or a historical product. Those skilled in the art can selectively set it according to actual needs.

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

[0049] The present application embodiments describe how to determine whether to not optimize the target UFS based on the first command timeout and the 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 based on the changing trend of the time difference between the first command timeout and the second command timeout, as well as the percentage of times the trend is positive or negative. Those skilled in the art can selectively set this based on actual circumstances.

[0050] It is understandable that the target UFS is subjected to performance testing, including: The device life of the target UFS obtained when it is determined that the maximum garbage collection intensity has been reached is used as the initial life of the first device: Writing preset life prediction data to the target UFS at multiple intervals; After each time the preset life prediction data is written to the target UFS, the device life of the target UFS is obtained as the remaining life of the device; It is determined whether the target UFS meets a preset performance requirement according to the initial lifespan of the first device and the remaining lifespan of the device.

[0051] Lifespan prediction data is data that, when written, will cause a change in lifespan. Data of varying lengths has varying effects on lifespan. The length of data used for lifespan prediction can be determined through simulation or empirical experience, thereby generating lifespan prediction data. By combining the initial lifespan of the first device with the remaining lifespan of the device obtained each time, we can determine the impact of written data on the lifespan of the target UFS, assuming maximum garbage collection activity is achieved. Therefore, using device lifespan as a performance indicator allows for a more comprehensive assessment of whether the target UFS's performance meets performance requirements.

[0052] In some embodiments, the device life of the target UFS is obtained before UFS pre-processing is started, so as to observe the performance impact of the target UFS when the garbage collection intensity is the highest.

[0053] The embodiments of the present application do not limit how the initial lifespan and the 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 trend meets the requirements. In other embodiments, the rate of change between two consecutive device lifespans can be evaluated, and based on the total rate of change and the interval rate of change, whether it matches the expected change relationship can be determined to determine whether performance requirements are met.

[0054] For example, for a new target UFS, before testing, the device health descriptor is obtained through the query command to obtain the device life. If the device life is between 0-10% at the beginning, the maximum garbage collection intensity is reached after UFS preprocessing, and the device life is obtained through the query command. If the device life after UFS preprocessing is much larger than before the test (for example, 30%), the wear balance can be calculated based on the actual write volume to determine whether the wear balance is less than the preset wear threshold, which serves as the basis for judging whether the garbage collection strategy is reasonable. When the garbage collection intensity is at its maximum, the garbage collection strategy is verified to be passed, and the life prediction data is written, and the device life is obtained after each write until it cannot be written or the number of writes reaches the expected number. At this time, the wear balance is calculated based on the device life obtained each time, so that the garbage collection strategy can be evaluated whether it is reasonable. When the wear balance calculated each time meets the wear threshold corresponding to the amount of written data, the garbage collection strategy is determined to have been verified.

[0055] In summary, the garbage collection policy verification method of the above-mentioned embodiment of the present application can quickly verify the rationality of the garbage collection policy, improve testing efficiency, and accelerate UFS development. Furthermore, by adding verification steps for device lifespan and command timeout, it can ensure that garbage collection anomalies reduce the impact on lifespan and normal use, and reasonably improve the user performance experience when garbage collection is at its most active.

[0056] In some embodiments, the garbage collection policy verification can be selected based on any one or more of the read rate performance indicator, the command timeout performance indicator, and the device life performance indicator through the visual interface, and the number of times the read rate performance indicator, the command timeout performance indicator, and the device life performance indicator are obtained can also be configured through the visual interface.

[0057] For example, taking the need to simultaneously perform read rate performance indicators, command timeout performance indicators, and device life performance indicators on the target UFS as verification of the garbage collection strategy as an example, Figure 2 The specific steps are as follows: S1. Initialize the target UFS and let the target UFS enter the maximum GC (garbage collection) intensity. The implementation process is as follows: divide the capacity of the target UFS into n equal areas to obtain multiple target storage areas. The size of each target storage area is determined according to the basic unit of garbage collection determined by the capacity of different UFS, so as to select a different value m. Then, write data in each target storage area step by step (only one write command is sent at a time, using a synchronous command) until each target storage area is filled with an area of ​​m size. The block size of a single write data is determined according to the capacity of different storage devices. It can be 4KB or other values. When performing a read data operation instruction test, jump to S2, when performing a write data operation instruction test, jump to S3, and when performing a read life operation instruction, jump to S4.

[0058] S2: When the UFS storage device's GC is at its peak, perform a full disk read and plot a performance curve to analyze whether it's reasonable (for example, using a data length of 50MB, 100MB, and so on as a data point to obtain the read rate). Then, plot a performance curve against each acquired data point and the read rate, comparing it to the benchmark UFS performance curve to determine whether it meets the requirements. If it does, the garbage collection verification strategy passes. If further performance testing is required, jump to S1.

[0059] S3: When the target UFS is experiencing maximum GC activity, multiple write commands are sent, each with a different performance data block size. The performance data block sizes of different write commands are increased incrementally (for example, the first performance data block sent is 4KB, the second is 8KB, and so on). This tests the minimum performance limit of write commands. The timeout of the first command of each write command is used to determine whether the GC strategy meets expectations. If further performance testing is required, jump to S1.

[0060] S4. When the GC intensity reaches the maximum, a first initial device life is obtained. Based on the first initial device life when the GC intensity reaches the maximum and the second initial device life before the test, whether the performance requirements are met is evaluated. If further performance testing is required, the process proceeds to S1.

[0061] If any of the following settings are set multiple times: the number of read rate performance indicators, the number of command timeout performance indicators, or the number of device life performance indicators, S1 is re-executed. In other embodiments, after entering the maximum GC intensity state, S4 can continue to write data and obtain the device life as the remaining device life. Thus, the garbage collection strategy can be evaluated based on the remaining device life, the first initial device life, and the second initial device life.

[0062] It is understandable that referring to Figure 3 As shown, a verification platform for a garbage collection strategy for universal flash storage provided in an embodiment of the present application includes: The determination module 100 is configured to determine a garbage collection basic unit; the garbage collection basic unit represents the minimum amount of data migration required for garbage collection by the corresponding target UFS using the garbage collection strategy; A partitioning module 200 is configured to equally partition the target UFS according to the garbage collection basic unit to obtain a plurality of target storage areas; the capacity of each target storage area is a multiple of the garbage collection basic unit; A preprocessing module 300 is configured to obtain a single write data entry and use the starting address of each target storage area as the target write address. A UFS preprocessing step includes synchronously writing the single write data entry to each target storage area based on the 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, the target write addresses are updated based on the length of the single write data entry and the process proceeds to the UFS preprocessing step. The performance testing module 400 is configured to perform a performance test on the target UFS when the garbage collection intensity status indicates that the maximum garbage collection intensity has been reached.

[0063] Therefore, the verification platform of the garbage collection strategy of the universal flash storage in the embodiment of the present application can allow the target UFS to quickly enter the maximum GC intensity, and can choose to perform a full disk read performance test when the target UFS enters the maximum GC intensity, thereby verifying the garbage collection strategy based on the read rate performance indicator. It can also choose to perform multiple single performance database writes when the target UFS enters the maximum GC intensity. By increasing the size of the performance data block written each time, the maximum timeout time can be tested to analyze whether the garbage collection strategy is reasonable; it can also choose to obtain the device life through the UFS protocol command when the target UFS enters the maximum GC intensity, and analyze whether the garbage collection strategy is reasonable based on the life loss situation.

[0064] In some embodiments, as Figure 4 As shown, the verification platform of the garbage collection policy of the universal flash storage is integrated in the UFS test board. The UFS test board and the target UFS are pluggable and connected. The UFS test board sends relevant instructions to the target UFS and obtains information about the target UFS, so that the garbage collection policy of the target UFS can be verified.

[0065] See also Figure 5 , Figure 5 The hardware structure of an electronic device according to another embodiment is shown. The electronic device includes: The processor 501 may be implemented as a general-purpose CPU (Central Processing Unit), a microprocessor, an 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 the present application. The memory 502 may be a NAND flash. The relevant program code is stored in the memory 502, and the processor 501 calls and executes the verification method of the garbage collection policy of the universal flash memory storage according to the embodiment of the present application; Input / output interface 503, used to implement information input and output; Communication interface 504, used to implement communication interaction between this device and other devices, which can be achieved through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WiFi, Bluetooth, etc.); Bus 505 , which transmits information between various components of the device (e.g., processor 501 , memory 502 , input / output interface 503 , and communication interface 504 ); The processor 501 , the memory 502 , the input / output interface 503 and the communication interface 504 are connected to each other in communication within the device via a bus 505 .

[0066] An embodiment of the present application also provides a computer-readable storage medium, which is a computer-readable storage medium that stores a computer program. When the computer program is executed by a processor, it implements a verification method for the garbage collection strategy of the above-mentioned universal flash memory storage.

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

[0068] The embodiments described in the embodiments of this application are intended to more clearly illustrate 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. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of this application are also applicable to similar technical problems.

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

[0070] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, i.e., they may be located in one place or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of this embodiment.

[0071] Those skilled in the art will appreciate that all or some of the steps in the methods, systems, and functional modules / units in the devices disclosed above may be implemented as software, firmware, hardware, or appropriate combinations thereof.

[0072] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0073] 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.

[0074] 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.

[0075] The units described above as separate components may or may not be physically separate, and 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 these units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0076] 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.

[0077] If the integrated unit is implemented in the form of 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 the present application, 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, which is stored in a storage medium and includes multiple instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: various media that can store programs, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0078] 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 flash storage, characterized in that: The method comprises: Determine a garbage collection basic unit; the garbage collection basic unit represents the minimum data migration amount for garbage collection by the corresponding target universal flash storage UFS using the garbage collection strategy; The target UFS is equally partitioned according to the garbage collection basic unit to obtain a plurality of target storage areas; the capacity of each target storage area is a multiple of the garbage collection basic unit; Acquire single write data and use the starting address of each target storage area as the target write address; UFS pre-processing step: synchronously writing the single write data into each of the target storage areas according to each of the target write addresses and reading the garbage collection strength status of the target UFS; When the garbage collection intensity status representation does not reach the maximum garbage collection intensity, updating each of the target write addresses 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, a performance test is performed on the target UFS to verify the garbage collection strategy based on the performance test result.

2. The method for verifying a garbage collection strategy for universal flash storage according to claim 1, wherein: The performing performance testing on the target UFS includes: issuing a corresponding performance operation instruction to the target UFS according to a preset performance operation issuing condition, wherein the performance operation instruction includes at least one of a read data operation instruction, a write data operation instruction, and a read lifespan operation instruction; Determine whether the target UFS meets a preset performance requirement based on the performance indicator of the performance operation instruction.

3. The method for verifying the garbage collection strategy of universal flash storage according to claim 1, characterized in that: The performing performance testing on the target UFS includes: issuing a read data operation instruction to the target UFS, so as to start reading from a start address of the target UFS and end reading at an end address of the target UFS according to the read data operation instruction; Obtaining a read rate corresponding to each reading of a preset number of address data by the read data operation instruction; According to the read rate, it is determined whether the target UFS meets a preset performance requirement.

4. The method for verifying a garbage collection strategy for universal flash storage according to claim 3, wherein: The determining, based on the read rate, whether the target UFS meets a preset performance requirement includes: A performance curve is obtained by taking each of the read rates as the ordinate and the amount of read data corresponding to each of the read rates as the abscissa; Determining a reading rate fluctuation trend based on the performance curve; According to the rate fluctuation trend, it is determined whether the target UFS meets the preset performance requirement.

5. The method for verifying garbage collection strategy of universal flash storage according to claim 1, characterized in that: The performing performance testing on the target UFS includes: Acquire a performance data block, and generate a write data operation instruction according to the performance data block; Sending the write data operation instruction to the target UFS and obtaining a first command timeout period of the write data operation instruction; Incrementally processing the performance data block and generating a new write data operation instruction, and reissuing the new write data operation instruction to the target UFS until the first command timeout period meets a preset timeout change condition; Determine whether the target UFS meets a preset performance requirement based on the timeout period of each first command.

6. The method for verifying a garbage collection strategy for universal flash storage according to claim 5, wherein: The method further comprises: Get the second command timeout of the benchmark UFS when the maximum garbage collection intensity is reached; Determine whether to optimize the target UFS according to the first command timeout and the second command timeout.

7. The method for verifying a garbage collection strategy for universal flash storage according to claim 1, wherein: The performing performance testing on the target UFS includes: The device life of the target UFS obtained when it is determined that the maximum garbage collection intensity has been reached is used as the first device initial life: Writing preset life prediction data to the target UFS at multiple intervals; After each time the preset life prediction data is written to the target UFS, the device life of the target UFS is obtained as the remaining device life; Determine whether the target UFS meets a preset performance requirement according to the initial life of the first device and the remaining life of the device.

8. A verification platform for garbage collection strategy of universal flash storage, characterized in that: include: A determination module is used to determine the basic unit of garbage collection; The garbage collection basic unit represents the minimum data migration amount for garbage collection by the corresponding target UFS using the garbage collection strategy; a partitioning module, configured to equally partition the target UFS according to the garbage collection basic unit to obtain a plurality of target storage areas; The capacity of each target storage area is a multiple of the garbage collection basic unit; A pre-processing module, configured to obtain single write data and use the starting address of each target storage area as a target write address; A UFS preprocessing step: synchronously writing the single write data to each of the target storage areas 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 of the target write addresses according to the length of the single write data and jumping to the UFS preprocessing step; The performance testing module is configured to perform a performance test on the target UFS when the garbage collection intensity status indicates that the maximum garbage collection intensity has been reached, so as to verify the garbage collection strategy based on the performance test result.

9. An electronic device comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method for verifying the garbage collection strategy of the universal flash memory storage as described in any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method for verifying the garbage collection policy of the universal flash storage according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Solid state disk configuration method, garbage collection method and related equipment

    CN117909250A

  • ZNS SSD garbage collection sensing method based on MLP

    CN119473142A

  • ZNS-SSD storage system-oriented garbage collection method

    CN119473143A

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

    CN120233934A

  • Performing a media management operation based on changing a write mode of a data block in a cache

    US20210209016A1

Cited By

  • Memory control method, storage device, medium and computer equipment

    CN121411709A