Method of identifying compression algorithm type and test equipment
By acquiring test data writing information with different data characteristics, determining the degree of compression and matching it with the feature library, the problem of identifying the compression algorithm type of storage devices is solved, and the compression effect can be accurately evaluated.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- 合肥康芯威存储技术有限公司
- Filing Date
- 2026-06-25
- Publication Date
- 2026-07-24
AI Technical Summary
Existing technologies make it difficult to identify the type of compression algorithm used inside storage devices, making it difficult to judge the compression effect on specific data and to make quantitative comparisons.
By acquiring test data writing information with different data characteristics, the degree of compression is determined, and it is matched with the compression algorithm feature library to identify the compression algorithm type of the storage device.
This technology enables accurate identification of compression algorithm types and evaluation of their compression effects on specific data without directly reading the internal algorithms of the storage device, thereby improving the accuracy of compression algorithm type identification.
Smart Images

Figure CN122451397A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of storage technology, and more specifically, to a method and testing device for identifying compression algorithm types. Background Technology
[0002] With the increasing demands for data storage capacity and read / write performance from embedded devices, mobile terminals, industrial control equipment, and automotive electronic devices, embedded MultiMediaCards (eMMC) and other storage devices are widely used in scenarios involving the storage of system data, log data, firmware data, and user data. To reduce the amount of data actually written to the storage medium, improve storage space utilization, and enhance write performance, some storage devices are configured with data compression functions in their internal firmware or controllers, compressing the data to be written before it is actually written to the storage medium.
[0003] Testing the compression capabilities of storage devices typically focuses on whether the device has compression capabilities, its overall performance after writing different amounts of data, or changes in the device's lifespan. The compression algorithms used internally by storage devices are usually implemented in the device firmware or controller, making it difficult for testing equipment to directly obtain the specific algorithm type. Without identifying the compression algorithm used by the storage device, it is difficult to further determine whether the device has good compression performance for data with specific characteristics, and it is also difficult to quantitatively compare the compression performance of different storage devices.
[0004] This shows that the problem of difficulty in identifying the compression algorithm type of storage devices still exists. Summary of the Invention
[0005] This application provides a method and testing device for identifying compression algorithm types, which can solve the problem of difficulty in identifying the compression algorithm type of storage devices in related technologies. The technical solutions are as follows:
[0006] According to one aspect of this application, a method for identifying compression algorithm types includes: acquiring first data writing information and second data writing information; the first data writing information is used to indicate parameters related to wear parameter changes of the storage device during the process of writing first test data to the storage device; the second data writing information is used to indicate parameters related to wear parameter changes of the storage device during the process of writing second test data to the storage device; the first test data and the second test data have different data characteristics; determining the degree of compression based on the first data writing information and the second data writing information to obtain compression information; and matching the compression information with a compression algorithm feature library to obtain an identification result.
[0007] According to one aspect of this application, a testing device includes at least one processor and at least one memory, wherein the memory stores a computer program that, when executed by the processor, implements the identification method for the compression algorithm type as described above.
[0008] In the above technical solution, when the first test data and the second test data have different data characteristics, the first data writing information and the second data writing information can respectively characterize the wear changes of the storage device when writing different test data. Based on this, the testing device determines the compression degree according to the first data writing information and the second data writing information, and can obtain compression information that reflects the compression effect of the storage device on the second test data. Furthermore, since different compression algorithm types correspond to different compression performances, by matching the compression information with the compression algorithm feature library, the compression algorithm type that the storage device is closer to can be determined based on the compression performance reflected by the compression information, thereby obtaining the identification result. Therefore, this solution does not need to directly read the compression algorithm implementation method inside the storage device, but instead uses the difference in wear parameter changes generated during the test data writing process to infer the compression algorithm type, thereby effectively solving the problem of difficulty in identifying the compression algorithm type of the storage device in related technologies. Attached Figure Description
[0009] Figure 1 This is a schematic diagram based on the implementation environment involved in this application;
[0010] Figure 2 This is a hardware structure diagram of an electronic device according to an exemplary embodiment;
[0011] Figure 3 This is a flowchart illustrating a method for identifying a compression algorithm type according to an exemplary embodiment;
[0012] Figure 4 yes Figure 3 A flowchart of step 310 in one embodiment corresponds to the following example;
[0013] Figure 5 This is a reference compression performance relationship between the second test data, mathematical features, and candidate compression algorithm types shown in an application scenario;
[0014] Figure 6 It is the correspondence between compression ratio and compression level represented by compression information shown in an application scenario;
[0015] Figure 7 This is a flowchart illustrating how a test device in an application scenario obtains identification results based on first test data, second test data, register information, and a compression algorithm feature library.
[0016] Figure 8 This is a structural block diagram of a test device according to an exemplary embodiment. Detailed Implementation
[0017] The present invention will now be described in further detail with reference to specific embodiments and accompanying drawings. Similar elements in different embodiments are referred to by associated similar element reference numerals. In the following embodiments, many details are described to facilitate a better understanding of this application. However, those skilled in the art will readily recognize that some features may be omitted in different situations, or may be replaced by other elements, materials, or methods. In some cases, certain operations related to this application are not shown or described in the specification. This is to avoid obscuring the core parts of this application with excessive description. For those skilled in the art, detailed description of these related operations is not necessary; they can fully understand the related operations based on the description in the specification and general technical knowledge in the art.
[0018] Furthermore, the features, operations, or characteristics described in the specification can be combined in any suitable manner to form various embodiments. At the same time, the steps or actions in the method description can be rearranged or adjusted in a manner obvious to those skilled in the art. Therefore, the various orders in the specification and drawings are only for the clear description of a particular embodiment and do not imply a necessary order, unless otherwise stated that a particular order must be followed.
[0019] The serial numbers assigned to components in this document, such as "first" and "second," are used only to distinguish the described objects and have no sequential or technical meaning. The terms "connection" and "linkage" used in this application, unless otherwise specified, include both direct and indirect connections (linkages).
[0020] The following is an introduction and explanation of several terms used in this application:
[0021] NAND and NAND flash are non-volatile storage media commonly used in storage devices such as eMMC, UFS, and SSD.
[0022] Run-Length Encoding (RLE): Run-length encoding is a lossless compression method.
[0023] Dictionary compression (LZ-based): Dictionary compression is a type of lossless compression method that compresses repeated strings or segments.
[0024] Differential compression (Delta Encoding): Differential compression is a compression method that uses the differences between adjacent data for encoding.
[0025] Pattern: A pattern can be understood as a data pattern with specific data content regularities. The test pattern in this application can correspond to the second test data, which is used to test the compression performance of the storage device for data with different data characteristics. For example, all-1 data, 0x5A5A repeating data, 0xAA55 alternating data, and increasing sequence data can all be used as examples of test patterns.
[0026] All-1 data: All-1 data refers to data in which all data contents are 1 or the corresponding storage units all show the same value;
[0027] 0x5A5A Repeated Data: 0x5A5A repeated data refers to data formed by repeating the hexadecimal number 0x5A5A as the basic unit.
[0028] 0xAA55 alternating data: 0xAA55 alternating data refers to data formed by alternating hexadecimal data 0xAA55 as the basic unit;
[0029] EXT_CSD (Extended CSD, Expansion Card Specific Data Register): EXT_CSD is the extended register information in the eMMC storage device;
[0030] EXT_CSD
[268] and EXT_CSD
[269] : EXT_CSD
[268] and EXT_CSD
[269] can be used to characterize the lifespan consumption of eMMC storage devices.
[0031] Therefore, the compression algorithm type identification method provided in this application can effectively improve the accuracy of compression algorithm type identification. Accordingly, the compression algorithm type identification method is applicable to compression algorithm type identification device, which can be deployed on test equipment. The electronic equipment can be a computer device configured with a von Neumann architecture, such as a desktop computer, a laptop computer, a server, etc.
[0032] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.
[0033] Figure 1 This is a schematic diagram of an implementation environment involved in a method for identifying a type of compression algorithm. It should be noted that this implementation environment is merely an example adapted to the present invention and should not be considered as providing any limitation on the scope of the invention.
[0034] The implementation environment includes storage device 110 and test device 130.
[0035] Specifically, storage device 110 can also be considered as eMMC storage device, UFS (Universal Flash Storage) storage device, etc., without being specifically limited here.
[0036] The testing equipment 130 can be a desktop computer, laptop computer, server, ATE (Automatic Test Equipment) automated testing equipment, memory testing platform, firmware verification platform, read / write testing device, or other electronic device with data writing, register reading, and data processing capabilities. It can also be a computer cluster composed of multiple servers, or even a cloud computing center composed of multiple servers. The testing equipment 130 is used to provide background services, such as, but not limited to, compression algorithm type identification services.
[0037] The test device 130 and the storage device 110 establish a network communication connection in advance via wired or wireless means, and data transmission between the test device 130 and the storage device 110 is realized through this network communication connection. The transmitted data includes, but is not limited to, first data write information and second data write information, etc.
[0038] In one application scenario, through the interaction between storage device 110 and testing device 130, testing device 130 acquires first data write information and second data write information. The first data write information is used to indicate parameters related to the wear parameter changes of storage device 110 during the process of writing the first test data to storage device 110. The second data write information is used to indicate parameters related to the wear parameter changes of storage device 110 generated by writing the second test data to storage device 110. The first test data and the second test data have different data characteristics. The compression ratio is calculated based on the first data write information and the second data write information to determine the compression information. The compression information is matched with the compression algorithm feature library to obtain the identification result.
[0039] Please see Figure 2 , Figure 2 This is a hardware structure diagram of an electronic device according to an exemplary embodiment. This electronic device is suitable for... Figure 1 The test equipment 130 in the implementation environment is shown.
[0040] It should be noted that this electronic device is merely an example adapted to this application and should not be construed as providing any limitation on the scope of use of this application. Furthermore, this electronic device should not be interpreted as requiring or depending on any specific feature. Figure 2 One or more components of the exemplary electronic device 200 shown.
[0041] The hardware structure of electronic device 200 can vary significantly due to differences in configuration or performance, such as... Figure 2 As shown, the electronic device 200 includes: a power supply 210, an interface 230, at least one memory 250, and at least one central processing unit (CPU) 270.
[0042] Specifically, power supply 210 is used to provide operating voltage for various hardware devices on electronic device 200.
[0043] Interface 230 includes at least one wired or wireless network interface 231 for interacting with external devices. For example, to perform... Figure 1 The interaction between test device 130 and storage device 110 in the implementation environment is shown.
[0044] Of course, in other examples adapted in this application, interface 230 may further include at least one serial-to-parallel conversion interface 233, at least one input / output interface 235, and at least one USB interface 237, etc. Figure 2 As shown, this does not constitute a specific limitation.
[0045] The memory 250 serves as a carrier for resource storage and can be a read-only memory, random access memory, disk, or optical disk, etc. The resources stored on it include the operating system 251, application programs 253, and data 255, etc., and the storage method can be temporary storage or permanent storage.
[0046] The operating system 251 is used to manage and control the various hardware devices and application programs 253 on the electronic device 200, so as to enable the central processing unit 270 to perform calculations and processing on the massive data 255 in the memory 250. It can be Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, etc.
[0047] Application 253 is a computer program formed by computer-readable instructions based on operating system 251 to perform at least one specific task, and may include at least one module ( Figure 2 (Not shown), each module can contain corresponding computer-readable instructions. For example, a recognition device for a compression algorithm type can be considered as an application 253 deployed on electronic device 200.
[0048] Data 255 can be photos, pictures, etc. stored on a disk, or it can be first data write information, second data write information, etc., stored in memory 250.
[0049] The central processing unit 270 may include one or more processors and is configured to communicate with the memory 250 via at least one communication bus to read computer programs stored in the memory 250, thereby performing operations and processing on massive amounts of data 255 stored in the memory 250. For example, the method of identifying compression algorithm types can be implemented by the central processing unit 270 reading the application program 253 stored in the memory 250.
[0050] Furthermore, this application can also be implemented through hardware circuits or a combination of hardware circuits and software. Therefore, the implementation of this application is not limited to any specific hardware circuit, software, or combination thereof.
[0051] Please see Figure 3 This application provides a method for identifying compression algorithm types. This method is applicable to electronic devices, for example, the electronic device may be... Figure 1 The test device 130 shown in the implementation environment has a hardware structure that can be as follows: Figure 2 As shown.
[0052] In the following method embodiments, for ease of description, the execution subject of each step of the method is an electronic device, but this does not constitute a specific limitation.
[0053] like Figure 3 As shown, the method may include the following steps:
[0054] Step 310: Obtain the first data write information and the second data write information.
[0055] The first data write information is used to indicate parameters related to changes in the wear parameters of the storage device during the process of writing the first test data to the storage device. For example, the first data write information may include data related to the writing process, the amount of data written, the number of writes, or changes in wear parameters. The first test data is data used to perform write tests on the storage device.
[0056] The second data write information is used to indicate parameters related to changes in the wear parameters of the storage device during the process of writing the second test data to the storage device. For example, the second data write information may include data related to the writing process of the second test data, the amount of data written, the number of writes, or changes in wear parameters. The second test data is a different type of test data from the first test data, and the second test data has different data characteristics from the first test data.
[0057] It should be understood that since different compression algorithms have different compression effects on test data with different data characteristics, obtaining the first data writing information and the second data writing information can provide a data basis for subsequent determination of compression information and identification of compression algorithm type.
[0058] In one implementation, the first test data can be data generated through randomization, and the second test data can be all 1s, repeated 0x5A5A data, alternating 0xAA55 data, or an increasing sequence of data.
[0059] Changes in wear parameters of storage devices refer to changes in parameters that characterize the wear of the storage medium during the writing of the first or second test data. These changes reflect the wear impact on the storage device caused by the test data writing process. When the storage device supports compression algorithms, test data with different characteristics may correspond to different compression effects; different compression effects affect the actual amount of data written to the storage medium, thus affecting the changes in wear parameters. Therefore, based on the first and second data writing information, compression information can be further calculated, and the compression algorithm type of the storage device can be identified based on this information.
[0060] Step 330: Determine the compression level based on the first data writing information and the second data writing information to obtain compression information.
[0061] The compression level can be used to characterize the compression effect of the storage device on the second test data. Since the first and second test data have different data characteristics, and assuming the storage device supports compression algorithms, the first and second test data may have different compression effects when written to the storage device. Different compression effects will lead to different changes in the wear parameters of the storage device. Therefore, the testing device can determine the compression level of the second test data based on the differences between the first and second data write information.
[0062] Compression information can be used to characterize information based on the degree of compression. Compression information may include the degree of compression itself, or it may include a compression ratio, compression level, compression strength result, or compression effect evaluation result determined based on the degree of compression. For example, when both the first data write information and the second data write information are used to indicate data write status related to changes in wear parameters, the testing equipment can determine the degree of compression of the second test data relative to the first test data based on the difference between the first and second data write information, and use this degree of compression as the compression information.
[0063] In some embodiments, the degree of compression can be characterized by a compression ratio. For example, the testing device can calculate the compression ratio corresponding to the second test data based on the difference between the first data write information and the second data write information, and determine the compression information based on the compression ratio.
[0064] In one embodiment, step 330 may further include the following steps: determining compression information based on the ratio of the difference between the second data writing information and the first data writing information to the second data writing information.
[0065] Specifically, the difference between the second data writing information and the first data writing information can be divided by the second data writing information to obtain compression information used to characterize the degree of compression.
[0066] For example, compressed information can be determined by the following formula: Compressed information = (Second data write information - First data write information) / Second data write information.
[0067] Therefore, the testing device can convert the first data write information and the second data write information into compression information that reflects the compression effect, so that the type of compression algorithm used by the storage device can be identified based on the compression information.
[0068] Step 350: Match the compressed information with the feature library of the compression algorithm to obtain the recognition result.
[0069] The compression algorithm feature library stores the correspondence between compression information and compression algorithm types. In other words, it represents the compression levels that different compression algorithm types may exhibit under different data characteristics. The compression algorithm feature library can be pre-built or configured in the test device before the test device executes the compression algorithm identification method.
[0070] It should be noted that during the research and development process, the applicant discovered that for storage devices with compression capabilities, testing equipment can typically only determine whether a storage device might have compression functionality based on its overall performance before and after writing, but it is difficult to further determine the specific compression algorithm type used internally. Furthermore, data written under different application scenarios has different data characteristics; if the compression algorithm type cannot be identified, it is difficult to determine whether the storage device is suitable for the corresponding application scenario. Based on this, the applicant further realized that different compression algorithms have different compression effects on test data with different data characteristics, and the compression effect affects how the test data is actually written to the storage medium, further reflected in differences in the wear parameters of the storage device. Therefore, the applicant conducted research on how to use externally available information to infer the compression algorithm type. It was found that data writing information related to wear parameter changes during the writing of the first and second test data to the storage device can be obtained separately. Then, based on the first and second data writing information, the compression degree can be determined to obtain compression information. Finally, the compression information is matched with a compression algorithm feature library to obtain an identification result indicating the compression algorithm type of the storage device. Thus, without directly obtaining the internal compression algorithm implementation of the storage device, the compression algorithm type can be identified through the differences in wear parameter changes during the test data writing process.
[0071] Based on this, after determining the compression information, the testing equipment can match the compression information with the pre-stored correspondence in the compression algorithm feature library, thereby determining which compression algorithm type's compression performance the compression information is more consistent with.
[0072] The identification result can be used to indicate the type of compression algorithm used by the storage device. For example, the identification result may include one of run-length encoding, dictionary compression, differential compression, and zero-page compression, and may also include identification information representing the type of compression algorithm. If the compression information matches the compression performance corresponding to a certain compression algorithm type in the compression algorithm feature library, the testing device can determine that compression algorithm type as the identification result.
[0073] In one embodiment, the compression algorithm feature library may include multiple compression algorithm types, and the compression range or compression level corresponding to each compression algorithm type. The testing device can compare the compression information obtained in step 330 with the compression range or compression level corresponding to each of the multiple compression algorithm types, and determine the compression algorithm type with the best matching result as the identification result. Therefore, even if the compression algorithm used inside the storage device cannot be directly read, the compression algorithm type of the storage device can be identified based on the compression information obtained during the test data writing process.
[0074] In one embodiment, step 350 may further include the following steps: determining compression feature information corresponding to the storage device based on compression information; obtaining reference compression feature information corresponding to multiple candidate compression algorithm types from the compression algorithm feature library; determining the degree of matching between the compression feature information and each reference compression feature information; determining the target compression algorithm type from multiple candidate compression algorithm types based on each degree of matching; and obtaining the identification result based on the target compression algorithm type.
[0075] Compression feature information can be used to characterize the compression performance of the storage device when writing second test data. Compression feature information can be determined based on compression information. For example, if the second test data includes multiple test data sets with different data characteristics, the compression feature information can include compression information corresponding to each of the second test data sets. Reference compression feature information can be used to characterize the reference compression performance of candidate compression algorithm types under corresponding data characteristics. Candidate compression algorithm types can be pre-set compression algorithm types. The testing device can match the compression feature information with multiple reference compression feature information sets and determine the target compression algorithm type based on the degree of matching. The target compression algorithm type can be understood as the candidate compression algorithm type that is closest to the actual compression performance of the storage device.
[0076] In one embodiment, the compression level is determined based on the first data writing information and each second data writing sub-information, and the compression sub-information corresponding to each second test data is obtained; the compression information is obtained based on the compression sub-information corresponding to each second test data.
[0077] The second test data may include at least two of the following: all-1 data, 0x5A5A repeating data, 0xAA55 alternating data, and incremental sequence data. The test device can acquire the second data writing sub-information corresponding to the above multiple second test data, and determine the compression information corresponding to each second test data based on the first data writing information and each second data writing sub-information.
[0078] For example, the testing equipment can determine the compression information corresponding to all-1 data based on the second data write sub-information and the first data write information corresponding to all-1 data; determine the compression information corresponding to 0x5A5A repeating data based on the second data write sub-information and the first data write information corresponding to 0xAA55 alternating data; determine the compression information corresponding to 0xAA55 alternating data based on the second data write sub-information and the first data write information corresponding to incrementing sequence data; and determine the compression information corresponding to incrementing sequence data based on the second data write sub-information and the first data write information corresponding to incrementing sequence data.
[0079] In one embodiment, the compression level can be determined based on the compression information. For example, if the compression ratio represented by the compression information is greater than 80%, the compression level can be determined as very high compression; if the compression ratio is greater than or equal to 50% and less than or equal to 80%, the compression level can be determined as high compression; if the compression ratio is greater than or equal to 20% and less than 50%, the compression level can be determined as medium compression; and if the compression ratio is less than 20%, the compression level can be determined as weak compression.
[0080] The compression algorithm feature library can include reference compression information corresponding to multiple candidate compression algorithm types. For example, candidate compression algorithm types can include run-length encoding, dictionary compression, differential compression, and zero-page compression. For run-length encoding, the feature library can record: all-1 data corresponds to extremely high compression, 0x5A5A repeating data corresponds to high compression, 0xAA55 alternating data corresponds to medium compression, and increasing sequence data corresponds to weak compression. For dictionary compression, the feature library can record: all-1 data corresponds to high compression, 0x5A5A repeating data corresponds to extremely high compression, 0xAA55 alternating data corresponds to high compression, and increasing sequence data corresponds to medium compression. For differential compression, the feature library can record: all-1 data corresponds to high compression, 0x5A5A repeating data corresponds to medium compression, 0xAA55 alternating data corresponds to weak compression, and increasing sequence data corresponds to extremely high compression. For zero-page compression, the feature library can record: all-1 data corresponds to extremely high compression, 0x5A5A repeating data corresponds to medium compression, 0xAA55 alternating data corresponds to weak compression, and increasing sequence data corresponds to weak compression.
[0081] After determining the compression information corresponding to each second test data point, the testing device can match multiple compression information points with the reference compression information corresponding to each candidate compression algorithm type in the compression algorithm feature library. For example, when the compression information corresponding to all-1 data points indicates extremely high compression, the compression information corresponding to 0x5A5A repeating data points indicates high compression, the compression information corresponding to 0xAA55 alternating data points indicates medium compression, and the compression information corresponding to incremental sequence data points indicates weak compression, the testing device can determine that this set of compression information points matches the reference compression information corresponding to run-length encoding to a high degree, and determine run-length encoding as the target compression algorithm type, thereby obtaining the identification result used to instruct the storage device to adopt run-length encoding.
[0082] In another example, when the compression information corresponding to all 1 data indicates high compression, the compression information corresponding to 0x5A5A repeating data indicates very high compression, the compression information corresponding to 0xAA55 alternating data indicates high compression, and the compression information corresponding to incremental sequence data indicates medium compression, the test device can determine that the set of compression information matches the reference compression information corresponding to dictionary compression to a high degree, and determine dictionary compression as the target compression algorithm type.
[0083] In another example, when the compression information corresponding to all 1 data indicates high compression, the compression information corresponding to 0x5A5A repeating data indicates medium compression, the compression information corresponding to 0xAA55 alternating data indicates weak compression, and the compression information corresponding to incremental sequence data indicates extremely high compression, the test device can determine that the set of compression information matches the reference compression information corresponding to differential compression to a high degree, and determine differential compression as the target compression algorithm type.
[0084] In another example, when the compression information corresponding to all 1 data indicates extremely high compression, the compression information corresponding to 0x5A5A repeating data indicates medium compression, the compression information corresponding to 0xAA55 alternating data indicates weak compression, and the compression information corresponding to incremental sequence data indicates weak compression, the test device can determine that the set of compression information matches the reference compression information corresponding to zero-page compression to a high degree, and determine zero-page compression as the target compression algorithm type.
[0085] It should be noted that in actual testing, the compression information corresponding to a particular second test data point may deviate from expectations, possibly due to incomplete cache flushing, garbage collection, or other reasons. Therefore, during matching, it is not necessary to require that the compression information corresponding to each second test data point be completely consistent with the reference compression feature information in the compression algorithm feature library. Instead, the target compression algorithm type can be determined based on the overall degree of matching.
[0086] In one example, if the compression information obtained by the test device based on actual testing is as follows: all 1 data corresponds to extremely high compression, 0x5A5A repeating data corresponds to medium compression, 0xAA55 alternating data corresponds to weak compression, and increasing sequence data corresponds to medium compression, then although the compression information corresponding to the increasing sequence data is not completely consistent with the reference compression feature information corresponding to zero-page compression, the compression information corresponding to all 1 data, 0x5A5A repeating data, and 0xAA55 alternating data are all consistent with the reference compression feature information corresponding to zero-page compression. The test device can determine that the overall matching degree between this set of compression information and the reference compression feature information corresponding to zero-page compression is high, and zero-page compression is determined as the target compression algorithm type.
[0087] Furthermore, when determining the matching degree, the testing equipment can determine the matching degree based on the consistency between the compression information corresponding to multiple second test data and the reference compression feature information. For example, a completely consistent compression level can be determined as a high match, adjacent compression levels as a partial match, and compression levels with large differences as a low match. The testing equipment can determine the matching degree between this set of compression information and the reference compression feature information corresponding to multiple candidate compression algorithm types, and determine the candidate compression algorithm type with the highest matching degree and meeting the set matching conditions as the target compression algorithm type.
[0088] In another example, if a set of compressed information differs significantly from the reference compressed feature information corresponding to multiple candidate compression algorithm types, or if the highest matching degree does not meet the set matching conditions, the testing device can determine that the credibility of the current recognition result is low. In this case, the testing device can re-execute the write test of the corresponding second test data, or increase the types of second test data, to redetermine the compressed information and perform matching. In this way, the impact of abnormal test results of a single second test data on the recognition result can be reduced, and the accuracy of compression algorithm type recognition can be improved.
[0089] Using the above method, the testing device does not need to directly read the compression algorithm used internally by the storage device. Instead, it can compare the compression information exhibited by the storage device during data writing with reference compression feature information in a compression algorithm feature library to obtain an identification result indicating the compression algorithm type of the storage device. This method improves the feasibility of compression algorithm type identification and facilitates comparison of the compression performance of different storage devices.
[0090] In the above embodiments, since different compression algorithms have different compression effects on test data with different data characteristics, and the compression effect affects the actual writing of test data to the storage device, and is further reflected in the difference in wear parameters of the storage device, when the first test data and the second test data have different data characteristics, the first data writing information and the second data writing information can respectively characterize the wear changes of the storage device when writing different test data. Based on this, the test device determines the degree of compression according to the first data writing information and the second data writing information, and can obtain compression information that reflects the compression effect of the storage device on the second test data. Furthermore, since different compression algorithm types have different compression performances, by matching the compression information with the compression algorithm feature library, the compression algorithm type that the storage device is closer to can be determined based on the compression performance reflected by the compression information, thereby obtaining the identification result. Thus, this solution does not need to directly read the compression algorithm implementation method inside the storage device, but uses the difference in wear parameters generated during the test data writing process to infer the compression algorithm type, thereby solving the problem that it is difficult to further identify the specific compression algorithm type and evaluate its compression effect on specific data, even if it can only determine whether the storage device has compression function.
[0091] Please see Figure 4 In one exemplary embodiment, step 310 may further include the following steps:
[0092] Step 311: Generate first test data by randomization and obtain the first initial register information of the storage device before the first test data is written.
[0093] First, it should be noted that generating the first test data through randomization ensures its content exhibits significant irregularity, thereby reducing the likelihood of the first test data being significantly compressed due to fixed repetition, continuous variation, or other regular patterns. Therefore, the first test data can serve as comparative data for subsequent compression determination, allowing the testing equipment to determine the compression level of the second test data based on the differences between the data written information corresponding to the first and second test data.
[0094] The first initial register information refers to the register information read from the storage device before the first test data is written to it. This first initial register information characterizes the initial state of the storage device before the first test data is written. During the subsequent writing of the first test data to the storage device, the test device can read the first register information of the storage device and determine the first data write information based on the changes between the first initial register information and the first register information.
[0095] In other words, the testing equipment does not simply acquire the first test data itself, but rather, after generating the first test data, it first acquires the initial register information of the storage device before the first test data is written. This initial register information can then be used as the basis for judging changes in the wear parameters of the storage device. In this way, the first data write information can be correlated with the changes in the wear parameters of the storage device during the first test data write process, thereby providing a data foundation for determining the compression information based on the first and second data write information.
[0096] In one embodiment, the above method may further include the following steps: based on the capacity of the storage device, obtaining third test data with a data volume matching the capacity, and writing the third test data into the storage device; reading the current register information of the storage device to obtain first initial register information.
[0097] The capacity refers to the total amount of data that a storage device can store. Matching the data volume with the capacity means that the third test data can cover the entire logical address space of the storage device. After the third test data is written, subsequent first and second test data can be written to the logical address space of the storage device through overwrite or circular write methods. Therefore, writing the third test data does not affect the continued writing of subsequent test data to the storage device.
[0098] The third test data can be used to write to the storage device before the first test data is written, allowing the storage device to enter a relatively stable test state. In other words, before officially determining the first data write information based on the first test data, the test device can first write third test data matching the capacity of the storage device to reduce the impact of the storage device being in an empty disk state, cached data not being flushed, or inconsistent historical data states on the subsequent test results.
[0099] After the third test data is written to the storage device, the test device reads the current register information of the storage device and uses this register information as the first initial register information. The first initial register information can be used to characterize the register state of the storage device before the first test data is written. Subsequently, during the process of writing the first test data to the storage device, the test device can read the first register information and determine the first data write information based on the changes in the first register information relative to the first initial register information or the previously read first register information. This allows the first data write information to be obtained based on a relatively clear initial register state, thereby improving the accuracy of subsequent determination of compression information.
[0100] In one implementation, after the third test data is written to the storage device, the test device can wait for a set period of time to allow the storage device to write the data in the cache to the storage medium; after waiting for the set period of time, the test device reads the current register information of the storage device and uses the register information as the first initial register information.
[0101] By waiting a set duration after the third test data is written, the impact of data in the storage device cache that has not yet been written to the storage medium on the results of subsequent register information reads can be reduced, allowing the first initial register information to more accurately characterize the state of the storage device before the first test data is written. For example, the set duration can be 20 seconds, or it can be set to other durations according to the storage device's cache capacity, write speed, or test requirements.
[0102] Step 312: Write the first test data to the storage device.
[0103] It is understandable that after the first test data is written to the storage device, the actual data written to the storage medium inside the storage device may affect the wear parameters of the storage device. Therefore, by writing the first test data to the storage device, a test basis can be provided for determining the first data writing information.
[0104] It should be noted that the first test data is written to the storage device, which is not limited to writing all of it at once. It can also be written in multiple parts according to the test requirements.
[0105] Step 313: Based on the first test data being written to the storage device, read the first register information of the storage device, and determine the first data write information based on the first initial register information and the first register information.
[0106] First, it should be noted that the first register information can be register information read from the storage device during or after the first test data is written to the storage device. The first initial register information is register information read from the storage device before the first test data is written to the storage device. Therefore, the first initial register information can be used to characterize the register state of the storage device before the first test data is written, and the first register information can be used to characterize the register state of the storage device during or after the first test data is written.
[0107] After the first test data is written to the storage device, if the information in the first register changes relative to the initial information in the first register, this change can reflect the impact of the first test data writing process on the wear parameters of the storage device. The testing device can determine the first data write information based on the difference between the initial information in the first register and the first register information. The first data write information can be used to characterize parameters related to changes in the wear parameters of the storage device during the process of writing the first test data to the storage device.
[0108] In one embodiment, the above method may further include the following steps: before the first test data is written to the storage device, initialize the first total number of writes and use the first initial register information as the initial first register information; during the process of writing the first test data to the storage device: write the first test data to the storage device according to a set step size; whenever the amount of newly written first test data to the storage device reaches the set step size, read the first register information of the storage device; if the currently read first register information has changed according to a set change compared to the previously read first register information, update the first total number of writes based on the set change; determine the first data write information based on the updated first total number of writes and the set step size.
[0109] The first total number of writes represents the number of writes corresponding to the set change in the first register information during the process of writing the first test data to the storage device. The set step size represents the amount of data that the test device adds to the storage device each time it writes the first test data. That is, the test device does not determine the first data write information after the first test data is written once, but rather, during the process of gradually writing the first test data to the storage device, it reads the first register information once every time the amount of newly written data reaches the set step size, and determines whether the currently read first register information has changed according to the set first register information read last time.
[0110] If the currently read first register information has not changed compared to the previously read first register information, it indicates that the currently written first test data has not yet caused a change in the wear parameters of the storage device to the extent necessary to determine the first data write information. In this case, the first test data can continue to be written to the storage device according to the set step size. If the currently read first register information has changed compared to the previously read first register information, it indicates that the writing of the first test data has caused a corresponding change in the wear parameters of the storage device. In this case, the first total number of writes can be updated based on this change, and the first data write information can be determined based on the updated first total number of writes and the set step size.
[0111] In one implementation, the first data write information can be determined based on the product of the updated total number of first writes and a set step size. Thus, the first data write information reflects the data write situation corresponding to the set changes in the wear parameters of the storage device during the first test data write process, thereby providing a basis for subsequently determining compression information based on the first and second data write information.
[0112] For example, the step size can be set to 1GB. Before the first test data is written to the storage device, the test device can read the register information of the storage device to obtain the first initial register information and initialize the first total number of writes to 0. During the process of writing the first test data to the storage device, the test device reads the first register information of the storage device once for every 1GB of first test data written to the storage device. If the currently read first register information has not changed compared to the previously read first register information, then the next 1GB of first test data is written to the storage device; if the first register information read in the previous N-1 reads has not changed, but the first register information read in the Nth read has changed compared to the previously read first register information, then N is determined as the first total number of writes, and N×1GB is determined as the first data write information. Therefore, the first data write information is not obtained directly under any write volume, but is determined when the first register information changes according to the first total number of writes and the set step size corresponding to the change in setting.
[0113] Step 314: Obtain the second test data and obtain the second initial register information of the storage device before the second test data is written.
[0114] In one exemplary embodiment, the second test data includes a plurality of second test data with different mathematical characteristics; different mathematical characteristics can be used to indicate that the second test data have different regularities in data content.
[0115] In one implementation, the second test data can be at least two of the following: all-1 data, 0x5A5A repeated data, 0xAA55 alternating data, or increasing sequence data. Among these, all-1 data has a single mathematical characteristic, 0x5A5A repeated data has a repeated mathematical characteristic, 0xAA55 alternating data has an alternating mathematical characteristic, and increasing sequence data has a linear change characteristic.
[0116] Since different compression algorithms have different compression effects on data with different mathematical characteristics, by obtaining the second data write sub-information corresponding to multiple second test data respectively, the second data write information can reflect the writing performance of the storage device for data with multiple different mathematical characteristics, rather than just reflecting the writing performance under a single mathematical characteristic.
[0117] The above method may further include the following steps: selecting one second test data from multiple second test data as the current second test data; before the current second test data is written to the storage device, initializing the second total number of writes corresponding to the current second test data, and reading the current register information of the storage device to obtain the second initial register information corresponding to the current second test data.
[0118] Specifically, when testing multiple second test data sets, the testing device can first select one second test data set as the current second test data set. This current second test data set is the second test data set targeted in this round of write testing. Since multiple second test data sets can be written to the storage device sequentially, the register information of the storage device may have changed after the previous second test data set has completed its write test. Therefore, the initial register information corresponding to the previous second test data set cannot be automatically used as the second initial register information corresponding to the current second test data set. Based on this, before the current second test data set is written to the storage device, the testing device can first initialize the second total number of writes corresponding to the current second test data set and read the current register information of the storage device to obtain the second initial register information corresponding to the current second test data set. This second initial register information is used to indicate the register state of the storage device before the current second test data set begins to be written, and can subsequently serve as the basis for determining whether the second register information has changed during the writing process of the current second test data set.
[0119] In one implementation, the test device can select the current second test data from a plurality of second test data in a predetermined order. The predetermined order can represent the order in which the plurality of second test data are written to the storage device. For example, the predetermined order can be the order of all-1 data, repeated 0x5A5A data, alternating 0xAA55 data, or an incrementing sequence of data.
[0120] By writing multiple second test data in a set order, different storage devices can be tested under the same test conditions in a consistent order of second test data. This facilitates the comparison of the second data writing information corresponding to different storage devices, thereby reducing the impact of register state changes on the test results when different second test data are written sequentially.
[0121] It should be noted that the above setting order is only an example and is not intended to limit the actual writing order of multiple second test data.
[0122] Step 315: Write the second test data to the storage device.
[0123] In one embodiment, the above method may further include the following steps: writing current second test data to the storage device according to a set step size;
[0124] Specifically, after obtaining the second initial register information corresponding to the current second test data, the test device can write the current second test data to the storage device. Specifically, the test device can write the current second test data to the storage device according to a set step size. The set step size can be used to represent the amount of data that the test device adds to the storage device each time it writes the current second test data. That is to say, the current second test data is not necessarily written all at once, but can be divided into multiple writes; after each data write corresponding to the set step size is completed, the test device can perform a register information read. In this way, changes in the register information of the storage device can be tracked during the continuous writing of the current second test data, thereby determining the writing situation corresponding to when the register information changes according to a set value.
[0125] Step 316: Based on the second test data being written to the storage device, read the second register information of the storage device, and determine the second data write information based on the second initial register information and the second register information.
[0126] In one embodiment, the above method may further include the following steps: using the second initial register information corresponding to the current second test data as the initial second register information; during the process of writing the current second test data to the storage device: whenever the amount of data of the current second test data newly written to the storage device reaches a set step size, reading the second register information of the storage device; if the currently read second register information has a set change relative to the previously read second register information, updating the second total number of writes corresponding to the current second test data based on the set change; determining the second data write sub-information corresponding to the current second test data based on the updated second total number of writes corresponding to the current second test data and the set step size; returning to the step of selecting one second test data from multiple second test data as the current second test data, until all the second test data is written to the storage device, obtaining the second data write sub-information corresponding to each second test data; obtaining the second data write information based on each second data write sub-information.
[0127] Specifically, during the process of writing the current second test data to the storage device, whenever the amount of the current second test data newly written to the storage device reaches a set step size, the test device can read the second register information of the storage device. The first time the second register information is read, it can be compared with the second initial register information corresponding to the current second test data; in subsequent reads, it can be compared with the previously read second register information. If the currently read second register information has not changed relative to the previously read second register information, it indicates that the current second test data has not yet caused a change in the wear parameters of the storage device to the extent required to determine the second data write sub-information after this write. In this case, the test device can continue writing the current second test data to the storage device according to the set step size, and read the second register information again when the amount of newly written data reaches the set step size next time.
[0128] If the currently read second register information has changed compared to the previously read second register information, it indicates that the writing of the current second test data has caused a corresponding change in the wear parameters of the storage device. In this case, the test device can update the total number of writes corresponding to the current second test data based on this change, and determine the second data write sub-information corresponding to the current second test data based on the updated total number of writes and the set step size. This second data write sub-information can represent the data writing situation corresponding to the current second test data when the second register information changes. For example, with a set step size of 1GB, if the second register information changes compared to the previously read second register information after the current second test data is written for the Mth time according to the set step size, then M can be determined as the total number of writes corresponding to the current second test data, and the second data write sub-information corresponding to the current second test data can be determined based on M × 1GB. The above M is only for illustrative purposes and does not limit the specific representation of the total number of writes.
[0129] After determining the second data write sub-information corresponding to the current second test data, the test device can select another second test data that has not yet completed the write test from among multiple second test data as the new current second test data, and repeat the aforementioned process. That is, for each second test data, the test device can read the corresponding second initial register information before the second test data is written to the storage device, write the data according to a set step size during the writing process, and read the second register information each time the newly written data reaches the set step size, until the second data write sub-information corresponding to the second test data is determined based on the setting changes of the second register information. By performing the above process on multiple second test data respectively, the second data write sub-information corresponding to each second test data can be obtained.
[0130] After obtaining the second data write sub-information, the test device can obtain the second data write information based on each second data write sub-information. The second data write information may include the second data write sub-information corresponding to each second test data, or it may include data organized based on each second data write sub-information.
[0131] Therefore, the second data write information can reflect the data write status corresponding to the second test data with multiple different mathematical characteristics. Subsequently, when determining the compression information based on the first and second data write information, the test device can use the first data write information and each second data write sub-information to determine the compression information corresponding to each second test data, so that the compression information can reflect the compression performance of the storage device for data with multiple different mathematical characteristics.
[0132] In conjunction with the above embodiments, the testing device first generates first test data through randomization and obtains first initial register information before writing the first test data, so that the first data writing information can be determined based on the register state of the storage device before the first test data is written. Based on this, the testing device writes the first test data according to a set step size, and reads the first register information each time the newly written amount reaches the set step size. Therefore, when the first register information changes according to a set setting, the first data writing information can be determined based on the total number of first writes corresponding to the change in setting and the set step size. Furthermore, for multiple second test data with different mathematical characteristics, the testing device does not share the same second initial register information. Instead, before writing each current second test data, it rereads the current register information of the storage device to obtain the second initial register information corresponding to that current second test data, and writes each current second test data separately according to a set step size. When the second register information changes according to a set setting, the second data writing sub-information corresponding to each second test data is determined based on the corresponding total number of second writes and the set step size, thereby obtaining the second data writing information. Because the content of the first test data is highly irregular, and multiple second test data have different mathematical characteristics, different test data will have different effects on the amount of data actually written to the storage medium after being compressed by the storage device, and will be further reflected in the difference in the total number of writes corresponding to the change of wear parameters in the register information. Therefore, the above process can enable the first data write information and the second data write information to more accurately reflect the compression performance of different test data in the storage device.
[0133] Furthermore, by waiting a set time after the third test data is written and reading the first initial register information, and by reading the corresponding second initial register information for each second test data, the impact of empty disk status, cached data not being flushed, inconsistent historical data status, and register status changes caused by sequential writing of different second test data on the test results can be reduced.
[0134] Therefore, the above embodiments can improve the accuracy of the first data write information and the second data write information, so that the compression information determined subsequently based on the first data write information and the second data write information can better reflect the degree of compression of different mathematical feature data by the storage device. This solves the problems that single test data is difficult to distinguish the performance of different compression algorithms, the inconsistency of the initial state of registers in different test stages leads to test result deviation, and it is difficult to accurately obtain the data basis for compression algorithm type identification based on the external test process.
[0135] In one exemplary embodiment, the first register information and the second register information include lifetime parameters read from a target register of the storage device.
[0136] The lifetime parameter can be used to characterize the wear and tear of the storage medium during data writing. The first register information can be the lifetime parameter read from the target register during the first test data writing process, and the second register information can be the lifetime parameter read from the target register during the second test data writing process. In other words, the first register information and the second register information can be the same type of register information read at different test data writing stages.
[0137] The setting change includes: the current read lifetime parameter being increased by a set value compared to the previous read lifetime parameter. In other words, during the process of writing the first or second test data to the storage device, the test equipment can read the lifetime parameter multiple times and compare the currently read lifetime parameter with the previously read lifetime parameter. If the currently read lifetime parameter is increased by a set value compared to the previously read lifetime parameter, it can be considered that the currently read register information has undergone a setting change compared to the previously read register information. Therefore, the total number of writes can be determined based on the change in the lifetime parameter, and the first or second data write information can be determined by combining this with the set step size.
[0138] In one implementation, the storage device may be an eMMC storage device, the target register may include the EXT_CSD register, and the lifetime parameter may include the value of EXT_CSD
[268] and / or EXT_CSD
[269] .
[0139] Among them, EXT_CSD
[268] and EXT_CSD
[269] can be updated by the firmware of the eMMC storage device according to the actual NAND wear condition, and are used to characterize the life consumption of the storage device. Since the actual amount of data written to the NAND flash after the test data is written to the storage device will affect the wear degree of the storage medium, the changes in EXT_CSD
[268] and / or EXT_CSD
[269] can be used to reflect the changes in wear parameters generated during the test data writing process.
[0140] It should be noted that the values of EXT_CSD
[268] and EXT_CSD
[269] do not increase with each write of the set step size. For example, when the set step size is 1GB, reading EXT_CSD
[268] and / or EXT_CSD
[269] after writing 1GB of data is only to determine whether the lifetime parameter has changed according to a fixed detection interval, and does not mean that the values of EXT_CSD
[268] and / or EXT_CSD
[269] will increase with each write of 1GB of data. An increase in the values of EXT_CSD
[268] and / or EXT_CSD
[269] usually indicates that the lifetime consumption of the storage device has reached a certain level. For example, an increase of 1 in the values of EXT_CSD
[268] and / or EXT_CSD
[269] can indicate that the corresponding lifetime consumption has crossed a level.
[0141] During the test, the test device can continuously write test data to the storage device according to a set step size, and read the lifetime parameter after each newly written data volume reaches the set step size. If the lifetime parameter read now increases by a set value compared to the lifetime parameter read last time, it can be considered that the first register information or the second register information has changed. At this time, the test device can determine the first data write information or the second data write information according to the total number of writes corresponding to the setting change and the set step size. For example, if the set step size is 1GB, if the values of EXT_CSD
[268] and / or EXT_CSD
[269] in the first N-1 reads do not increase, but the values of EXT_CSD
[268] and / or EXT_CSD
[269] increase by 1 in the Nth read, then N can be determined as the corresponding total number of writes, and the corresponding data write information can be determined based on N×1GB.
[0142] Since the increments of EXT_CSD
[268] and / or EXT_CSD
[269] are positively correlated with the actual amount of physical data written to the NAND flash, the total number of writes required to achieve the same lifetime parameter change may differ depending on the data characteristics and compression effect of the test data. Therefore, the test device can use the change in lifetime parameter to determine the data write information corresponding to different test data, and further determine the compression information based on the data write information corresponding to different test data. For example, the values of EXT_CSD
[268] and EXT_CSD
[269] can range from 0 to 0xB, where 0xB can represent exceeding the lifetime limit.
[0143] Through the above process, this embodiment further limits the first register information and the second register information to lifetime parameters read from the target register of the storage device, and limits the setting change to the lifetime parameter read now being increased by a set value relative to the lifetime parameter read last time. Since the lifetime parameter is updated by the storage device according to the actual NAND wear condition, and the actual NAND wear condition is related to the physical amount of test data finally written to the NAND flash, the change in lifetime parameter can be used as a basis for judging whether the test data writing process has caused a certain wear change. Furthermore, in the case of the storage device being an eMMC storage device, the lifetime consumption can be characterized by the value of EXT_CSD
[268] and / or EXT_CSD
[269] in the EXT_CSD register; this value does not necessarily increase with each set step, but only increases when the lifetime consumption reaches the corresponding level. Therefore, by reading the lifetime parameter after each set step and determining the corresponding total number of writes when the lifetime parameter increases by a set value, the test device can avoid simply using a fixed write amount as the wear change result, but instead uses the actual feedback of the lifetime parameter change from the storage device to determine the first data write information or the second data write information. Therefore, this embodiment enables the first and second data write information to more accurately reflect the actual wear differences caused by different test data in the storage device. When different test data have different data characteristics and corresponding compression effects, the total number of writes required to achieve the same lifespan parameter variation will differ, thus providing a more reliable data basis for subsequent determination of compression information. The above method solves the problems that relying solely on host-side write volume is insufficient to reflect the actual NAND write situation inside the storage device and makes it difficult to determine the differences in the wear impact of different test data on the storage device, and further improves the accuracy and feasibility of identifying compression algorithm types based on compression information.
[0144] Figures 5 to 7 This is a schematic diagram illustrating a specific implementation of a compression algorithm type identification method in an application scenario. In this scenario, the test device can be used to identify the compression algorithm type of a storage device. Figure 5 The reference compression performance relationship between the second test data, mathematical features, and candidate compression algorithm types is shown; Figure 6 The correspondence between compression ratio and compression level represented by compression information is shown; Figure 7 The process of obtaining the recognition result based on the first test data, the second test data, register information, and the feature library of the compression algorithm is shown.
[0145] In this application scenario, the storage device can be an eMMC storage device. The test equipment can first initialize the storage device and obtain its capacity. To bring the storage device into a relatively stable test state, the test equipment can write third test data to the storage device based on its capacity. The size of the third test data can be matched to the capacity of the storage device.
[0146] After the third test data is written to the storage device, the test device can wait for a set duration to allow the storage device to write the cached third test data back to the storage medium. For example, the set duration can be 20 seconds, but it can also be set to other durations depending on the storage device's cache capacity, write speed, or test requirements. After waiting for the set duration, the test device reads the current register information of the storage device to obtain the first initial register information. The first initial register information can be used to characterize the register state of the storage device before the first test data was written. By waiting for a set duration after the third test data is written, the impact of the cached data not being flushed on the result of reading the first initial register information can be reduced, allowing the first initial register information to more accurately characterize the state of the storage device before the first test data was written.
[0147] In this application scenario, the first register information and the second register information may include lifetime parameters read from the target register of the storage device. The lifetime parameters characterize the lifespan consumption or wear level of the storage medium during data writing. For example, when the storage device is an eMMC storage device, the target register may include an EXT_CSD register, and the lifetime parameters may include the values of EXT_CSD
[268] and / or EXT_CSD
[269] . EXT_CSD
[268] and EXT_CSD
[269] can be updated by the firmware of the eMMC storage device according to the actual NAND wear, and their values can be used to characterize the lifetime consumption of different types of storage areas. The values of EXT_CSD
[268] and EXT_CSD
[269] do not increase with each set step of data written, but only when the lifetime consumption of the storage device reaches the corresponding level. For example, the value range of EXT_CSD
[268] and EXT_CSD
[269] can be 0 to 0xB, where 0xB can represent exceeding the lifetime limit.
[0148] In this application scenario, the set value can be 1. That is, when the test device reads the lifetime parameter, if the currently read EXT_CSD
[268] and / or EXT_CSD
[269] value increases by 1 compared to the previously read value, it can be considered that the lifetime parameter has increased by the set value, that is, the first register information or the second register information has changed. It should be noted that when the step size is set to 1GB, reading the lifetime parameter once after writing 1GB of data only means that the test device judges whether the lifetime parameter has changed according to the 1GB detection interval, and does not mean that the lifetime parameter will increase by 1 every time 1GB of data is written.
[0149] Subsequently, the testing equipment can generate first test data through randomization and write the first test data to the storage device according to a set step size. During the process of writing the first test data to the storage device, the testing equipment can continuously write the first test data according to the set step size, and read the first register information each time the newly written amount reaches the set step size. If the lifetime parameter in the first register information does not increase by the set value, the first test data continues to be written according to the set step size; if the lifetime parameter in the first register information increases by the set value, the first total number of writes is determined, and the first data write information is determined based on the first total number of writes and the set step size.
[0150] Specifically, the step size can be set to 1GB. If the values of EXT_CSD
[268] and / or EXT_CSD
[269] do not increase in the first N-1 reads, but the values of EXT_CSD
[268] and / or EXT_CSD
[269] increase by 1 in the Nth read, then N can be determined as the first total number of writes, and the first data write information can be determined based on N×1GB. The first data write information can be used to indicate the data write situation corresponding to the change in the lifetime parameter caused by the first test data.
[0151] After determining the first data write information, the test device can wait for a set duration to allow the storage device to write the first test data from the cache to the storage medium. For example, the set duration can be 20 seconds, but it can also be set to other durations depending on the storage device's cache capacity, write speed, or test requirements. By waiting for the set duration after the first test data is written, the possibility of the first test data remaining in the cache and affecting subsequent second test data testing can be reduced, allowing the subsequently read second initial register information to more accurately characterize the state of the storage device before the second test data was written.
[0152] After receiving the first data write information, the testing device can sequentially test multiple second test data sets. Combined with... Figure 5As shown, the multiple second test data can include at least two of the following: all-1 data, 0x5A5A repeating data, 0xAA55 alternating data, and increasing sequence data. Different second test data have different mathematical characteristics; therefore, different candidate compression algorithm types will exhibit different reference compression performance for these second test data. For example, RLE can perform extremely high compression for all-1 data and weak compression for increasing sequence data; dictionary compression can perform extremely high compression for 0x5A5A repeating data; differential compression can perform extremely high compression for increasing sequence data; and zero-page compression can perform extremely high compression for all-1 data.
[0153] For any given second test data, the test device can read the corresponding second initial register information before writing the second test data to the storage device. Since multiple second test data can be written to the storage device sequentially, the register states of the storage device may differ before each current second test data begins to be written. By reading the second initial register information corresponding to each current second test data separately, the subsequent second data writing sub-information can be made more accurate.
[0154] During the process of writing the current second test data to the storage device, the test device can write the current second test data according to a set step size and read the second register information. When the lifetime parameter in the second register information does not increase by the set value, the test device continues to write the current second test data; when the lifetime parameter increases by the set value, the test device determines the second total number of writes corresponding to the current second test data, and determines the second data write sub-information corresponding to the current second test data based on the second total number of writes and the set step size.
[0155] After determining the second data write sub-information corresponding to the current second test data, the test device can wait for a set duration to allow the storage device to write the current second test data from the cache to the storage medium. For example, the set duration can be 20 seconds, but it can also be set to other durations depending on the storage device's cache capacity, write speed, or test requirements. After waiting for the set duration, the test device can select the next second test data as the new current second test data and read the second initial register information corresponding to this new current second test data. By waiting for a set duration after each current second test data write, the possibility of the previous second test data remaining in the cache and affecting the testing of the next second test data can be reduced, making the second initial register information and second register information corresponding to each second test data more accurate.
[0156] The testing equipment can perform the above process on multiple second test data sets respectively, thereby obtaining second data write sub-information corresponding to each second test data set, and obtaining second data write information based on each second data write sub-information. Then, the testing equipment can determine compression information based on the first data write information and the second data write information. Specifically, the testing equipment can determine the compression information corresponding to each second test data set based on the first data write information and each second data write sub-information.
[0157] For example, if the first data write information is the first test data write amount R, the second data write sub-information corresponding to all-1 data is A, the second data write sub-information corresponding to 0x5A5A repeated data is B, the second data write sub-information corresponding to 0xAA55 alternating data is C, and the second data write sub-information corresponding to incremental sequence data is D, then the test device can determine the compression information corresponding to each second test data according to (AR) / A, (BR) / B, (CR) / C, and (DR) / D, respectively. Thus, each compression information can characterize the degree of compression of second test data with different mathematical characteristics by the storage device.
[0158] Furthermore, the testing equipment can determine the corresponding compression level based on the compression information. Combined with... Figure 6 As shown, when the compression ratio represented by the compression information is greater than 80%, the corresponding compression level can be determined as extremely high compression; when the compression ratio is 50% to 80%, the corresponding compression level can be determined as high compression; when the compression ratio is 20% to 50%, the corresponding compression level can be determined as medium compression; and when the compression ratio is less than 20%, the corresponding compression level can be determined as weak compression. The above compression levels and compression ratio ranges are only examples. In other embodiments, the compression ratio ranges corresponding to each compression level can also be adjusted according to testing requirements.
[0159] The testing equipment can match the compression information or compression level corresponding to each second test data point with a compression algorithm feature library. The compression algorithm feature library may include... Figure 5 The reference compression performance corresponding to each candidate compression algorithm type is shown. The testing device can compare the compression information or compression level corresponding to multiple second test data with the reference compression performance in the compression algorithm feature library, and determine the candidate compression algorithm type with a higher degree of matching as the target compression algorithm type, thereby obtaining the identification result used to indicate the compression algorithm type of the storage device.
[0160] In the above application scenarios, the testing equipment does not determine whether a storage device has compression capabilities solely based on a single test data set. Instead, it first establishes a comparative basis using the first test data set, and then uses multiple second test data sets with different mathematical characteristics to obtain second data write sub-information. This allows the second data write information to reflect the storage device's write performance under different mathematical characteristics, such as zero redundancy, repeated redundancy, alternating redundancy, and linear redundancy. Since different compression algorithms, such as RLE, dictionary compression, differential compression, and zero-page compression, have different compression effects on data with different mathematical characteristics, and this compression effect affects the actual amount of data written to the NAND flash, further reflected in the difference in the total number of writes when the lifetime parameters change, the testing equipment can determine multiple compression information sets based on the first data write information and each second data write sub-information set. These multiple compression information sets are then matched with the reference compression performance corresponding to each candidate compression algorithm type in the compression algorithm feature library to obtain the identification result.
[0161] In this way, on the one hand, it solves the problem of only being able to determine whether a storage device has compression capabilities, but struggling to further distinguish compression algorithm types such as RLE, dictionary compression, differential compression, and zero-page compression. On the other hand, multiple second test data points correspond to different mathematical characteristics, which can reduce the possibility of misidentification caused by similar performance of different compression algorithms under a single second test data point. Simultaneously, determining compression information based on the first and second data write information allows for the quantification of the compression degree of the storage device, enabling horizontal comparison of compression performance between different storage devices. Therefore, this application scenario can establish the correspondence between compression algorithm type, data characteristics of test data, and changes in wear parameters during the writing process without directly reading the internal compression algorithm implementation of the storage device. This provides a basis for compression algorithm type identification, storage device selection, and data compression effect evaluation in different application scenarios.
[0162] It should be understood that although the steps in the flowcharts of the accompanying figures are shown sequentially as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the accompanying figures may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the sub-steps or stages of other steps.
[0163] Please see Figure 8This application provides a test device 4000, which may include: desktop computer, laptop computer, server, etc.
[0164] exist Figure 8 The test device 4000 includes at least one processor 4001 and at least one memory 4003.
[0165] Data interaction between the processor 4001 and the memory 4003 can be achieved through at least one communication bus 4002. This communication bus 4002 may include a path for transmitting data between the processor 4001 and the memory 4003. The communication bus 4002 can be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. The communication bus 4002 can be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is used to represent it in the figure, but this does not indicate that there is only one bus or one type of bus.
[0166] Optionally, the test device 4000 may further include a transceiver 4004, which can be used for data interaction between the test device and other test devices, such as sending and / or receiving data. It should be noted that in practical applications, the transceiver 4004 is not limited to one unit, and the structure of the test device 4000 does not constitute a limitation on the embodiments of this application.
[0167] Processor 4001 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. Processor 4001 may also be a combination that implements computational functions, such as including one or more microprocessor combinations, a combination of a DSP and a microprocessor, etc.
[0168] The memory 4003 may be a ROM (Read Only Memory) or other type of static storage device capable of storing static information and instructions, RAM (Random Access Memory) or other type of dynamic storage device capable of storing information and instructions, or it may be an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium capable of carrying or storing computer programs having instruction or data structure forms and accessible by the test device 400, but not limited to these.
[0169] The memory 4003 stores a computer program, and the processor 4001 can read the computer program stored in the memory 4003 through the communication bus 4002.
[0170] The computer program is executed by one or more processors 4001 to implement the compression algorithm type identification method in the above embodiments.
[0171] This document describes various exemplary embodiments with reference to them. However, those skilled in the art will recognize that changes and modifications can be made to the exemplary embodiments without departing from the scope of this document. For example, various operational steps and components for performing operational steps can be implemented in different ways depending on the specific application or considering any number of cost functions associated with the operation of the system (e.g., one or more steps can be deleted, modified, or combined with other steps).
[0172] Those skilled in the art will understand that all or part of the functions of the various methods in the above embodiments can be implemented by hardware or by computer programs. When all or part of the functions in the above embodiments are implemented by computer programs, the program can be stored in a computer-readable storage medium, which may include: read-only memory, random access memory, disk, optical disk, hard disk, etc., and the program is executed by a computer to achieve the above functions. For example, the program can be stored in the memory of a device, and when the program in the memory is executed by the processor, all or part of the above functions can be achieved. In addition, when all or part of the functions in the above embodiments are implemented by computer programs, the program can also be stored in a server, another computer, disk, optical disk, flash drive, or external hard drive, etc., and can be downloaded or copied to the memory of a local device, or the system of the local device can be updated. When the program in the memory is executed by the processor, all or part of the functions in the above embodiments can be achieved.
[0173] In the above embodiments, implementation can be achieved, in whole or in part, by software, hardware, firmware, or any combination thereof. Furthermore, as those skilled in the art will understand, the principles herein can be reflected in a computer program product on a computer-readable storage medium pre-loaded with computer-readable program code. Any tangible, non-transitory computer-readable storage medium may be used, including magnetic storage devices (hard disks, floppy disks, etc.), optical storage devices (CD-ROMs, DVDs, Blu-ray discs, etc.), flash memory, and / or the like. These computer program instructions can be loaded onto a general-purpose computer, special-purpose computer, or other programmable data processing apparatus to form a machine, such that instructions executing on the computer or other programmable data processing apparatus can generate means for performing a specified function. These computer program instructions can also be stored in a computer-readable storage medium that can instruct the computer or other programmable data processing apparatus to operate in a particular manner, such that instructions stored in the computer-readable storage medium can form an article of manufacture including means for implementing the specified function. The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to perform a series of operational steps on the computer or other programmable apparatus to produce a computer-implemented process, such that instructions executing on the computer or other programmable apparatus can provide steps for implementing the specified function.
[0174] While the principles herein have been illustrated in various embodiments, numerous modifications to the structure, arrangement, proportions, elements, materials, and components, particularly suited to specific environmental and operational requirements, may be used without departing from the principles and scope of this disclosure. These modifications and other alterations or alterations will be included within the scope of this document.
[0175] The foregoing specific descriptions have been described with reference to various embodiments. However, those skilled in the art will recognize that various modifications and changes can be made without departing from the scope of this disclosure. Therefore, considerations for this disclosure are to be illustrative rather than restrictive, and all such modifications are to be included within its scope. Similarly, advantages, other advantages, and solutions to problems with respect to various embodiments have been described above. However, benefits, advantages, solutions to problems, and any elements that produce these, or make them more explicit, should not be construed as critical, essential, or necessary. The term “comprising” and any other variations thereof as used herein are non-exclusive inclusion, meaning that a process, method, article, or apparatus that includes a list of elements includes not only those elements but also other elements not expressly listed or not part of the process, method, system, article, or apparatus. Furthermore, the term “coupled” and any other variations thereof as used herein refer to physical connections, electrical connections, magnetic connections, optical connections, communication connections, functional connections, and / or any other connections.
[0176] Those skilled in the art will recognize that many changes can be made to the details of the above embodiments without departing from the basic principles of the invention. Therefore, the scope of the invention should be determined only by the claims.
Claims
1. A method for identifying compression algorithm types, characterized in that, include: Obtain the first data write information and the second data write information; The first data writing information is used to indicate parameters related to changes in wear parameters of the storage device during the process of writing the first test data to the storage device; the second data writing information is used to indicate parameters related to changes in wear parameters of the storage device during the process of writing the second test data to the storage device. The first test data and the second test data have different data characteristics; The compression level is determined based on the first data write information and the second data write information to obtain compression information; The recognition result is obtained by matching the compressed information with the feature library of the compression algorithm.
2. The method as described in claim 1, characterized in that, The acquisition of the first data write information and the second data write information includes: The first test data is generated by randomization, and the first initial register information of the storage device before the first test data is written to it is obtained. Write the first test data into the storage device; Based on the first test data being written to the storage device, the first register information of the storage device is read, and the first data writing information is determined based on the first initial register information and the first register information; Obtain the second test data, and obtain the second initial register information of the storage device before the second test data is written; Write the second test data into the storage device; Based on the second test data being written to the storage device, the second register information of the storage device is read, and the second data write information is determined based on the second initial register information and the second register information.
3. The method as described in claim 2, characterized in that, The step of obtaining the first initial register information of the storage device before the first test data is written includes: Based on the capacity of the storage device, obtain third test data with a data volume matching the capacity, and write the third test data into the storage device; Read the current register information of the storage device to obtain the first initial register information.
4. The method as described in claim 2, characterized in that, The step of writing the first test data to the storage device, reading the first register information of the storage device, and determining the first data write information based on the first initial register information and the first register information includes: Before the first test data is written to the storage device, the first total number of writes is initialized, and the first initial register information is used as the initial first register information. During the process of writing the first test data into the storage device: Write the first test data to the storage device according to the set step size; Whenever the amount of the first test data newly written to the storage device reaches the set step size, the first register information of the storage device is read; If the current reading of the first register information has changed relative to the previous reading of the first register information, then the first total number of writes is updated based on the change in setting; The first data write information is determined based on the updated total number of first writes and the set step size.
5. The method as described in claim 2, characterized in that, The second test data includes multiple second test data with different mathematical characteristics; The step of obtaining the second test data and obtaining the second initial register information of the storage device to which the second test data is written includes: Select one second test data from the plurality of second test data as the current second test data; Before the current second test data is written to the storage device, the second total number of writes corresponding to the current second test data is initialized, and the current register information of the storage device is read to obtain the second initial register information corresponding to the current second test data; The step of writing the second test data into the storage device includes: writing the current second test data into the storage device according to a set step size; The process of writing the second test data to the storage device, reading the second register information of the storage device, and determining the second data write information based on the second initial register information and the second register information includes: Use the second initial register information corresponding to the current second test data as the initial second register information; During the process of writing the current second test data to the storage device: Whenever the amount of data newly written to the storage device reaches the set step size, the second register information of the storage device is read; If the second register information currently read has a setting change compared to the second register information read last time, then the second total number of writes corresponding to the current second test data is updated based on the setting change; Based on the updated total number of writes corresponding to the current second test data and the set step size, determine the second data write sub-information corresponding to the current second test data; Return to the step of selecting a second test data from the plurality of second test data as the current second test data, until all the second test data are written to the storage device, and obtain the second data writing sub-information corresponding to each second test data; Based on each of the second data writing sub-informations, the second data writing information is obtained.
6. The method as described in claim 5, characterized in that, The step of determining the compression level based on the first data write information and the second data write information to obtain compression information includes: The compression level is determined based on the first data writing information and each of the second data writing sub-informations, and the compression sub-information corresponding to each of the second test data is obtained. The compression information is obtained based on the compression sub-information corresponding to each of the second test data.
7. The method according to any one of claims 4 to 6, characterized in that, The first register information and the second register information include lifetime parameters read from the target register of the storage device; The setting changes include: increasing the currently read lifetime parameter by a set value compared to the last read lifetime parameter.
8. The method according to any one of claims 1 to 6, characterized in that, The step of determining the compression level based on the first data write information and the second data write information to obtain compression information includes: The compression information is determined based on the ratio of the difference between the second data write information and the first data write information to the second data write information.
9. The method according to any one of claims 1 to 6, characterized in that, The matching of the compressed information with the feature library of the compression algorithm to obtain the recognition result includes: Based on the compression information, the compression feature information corresponding to the storage device is determined; Obtain reference compression feature information corresponding to multiple candidate compression algorithm types from the compression algorithm feature library; The degree of matching between the compressed feature information and each of the reference compressed feature information is determined respectively; Based on the matching degree, the target compression algorithm type is determined from the multiple candidate compression algorithm types; The recognition result is obtained based on the target compression algorithm type.
10. A testing device, characterized in that... include: Memory, used to store computer programs; A processor for implementing the method as described in any one of claims 1-9 by executing the computer program stored in the memory.