Data analysis method, equipment and medium
By automating the classification and analysis of controller command data and generating analytical charts, the problem of inconsistent data formats in the UFS protocol analyzer is solved, thus improving data analysis efficiency.
Patent Information
- Application Number
- CN202510365800.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-26
- Publication Date
- 2025-08-01
AI Technical Summary
Different types of UFS protocol analyzers generate data in inconsistent formats, leading to inefficiency in manual data screening and poor analysis results.
A data analysis method is provided, which obtains command data from the controller, generates a worksheet according to a preset format, classifies the command data to generate various categories of command data, performs corresponding data analysis operations, and generates analysis charts.
It enables automated classification and analysis of command data, improving analysis efficiency and resolving the issue of inconsistent data formats among different types of UFS protocol analyzers.
Smart Images

Figure CN120407474A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of data analysis, and in particular to data analysis methods, devices, and media. Background Art
[0002] There are many different controller types available today, each with different operational behaviors for Universal Flash Storage (UFS). When developing UFS, adapting it to as many different controller types as possible requires analyzing how different controllers behave in different scenarios. This requires using a UFS protocol analyzer to collect and capture data on commands executed by different controllers on UFS storage in various scenarios. However, different types of UFS protocol analyzers generate inconsistent data formats, requiring manual data filtering for different data formats, which is inefficient and results in poor analysis. Summary of the Invention
[0003] The following is a summary of the subject matter described in detail herein. This summary is not intended to limit the scope of the claims.
[0004] The purpose of this application is to solve one of the technical problems existing in the related art to at least a certain extent. The embodiments of this application provide a data analysis method, device and medium, which can improve the efficiency of the controller in analyzing the command data of the memory.
[0005] An embodiment of the first aspect of the present application, a data analysis method, includes:
[0006] Get the controller's command data to the memory;
[0007] Classifying the command data to obtain a plurality of different types of category command data;
[0008] A corresponding data analysis operation is performed according to the type of the category command data to generate an analysis chart.
[0009] According to certain embodiments of the first aspect of the present application, after acquiring command data from the controller to the memory, the method includes:
[0010] The command data is written into the original worksheet according to a preset format to generate a worksheet.
[0011] According to certain embodiments of the first aspect of the present application, the command data is classified to obtain a plurality of different categories of category command data, including:
[0012] Reading command data of a row of the work table;
[0013] When the command data of a row in the worksheet is read, read the command data of another row until all the command data in the worksheet is read;
[0014] Classify the command data to obtain category command data of multiple different categories;
[0015] Or,
[0016] Read the command data of a column in the worksheet;
[0017] When the command data of a column in the worksheet is read, read the command data of another column until all the command data in the worksheet is read;
[0018] Classify the command data to obtain category command data of multiple different categories.
[0019] According to some embodiments of the first aspect of the present application, the type of the category command data is a data operation logical address; performing corresponding data analysis operations according to the type of the category command data to generate an analysis chart, including:
[0020] Generate a logical address scatter diagram according to the data operation logical address.
[0021] According to some embodiments of the first aspect of the present application, the type of the category command data is the block size corresponding to a single command operation; performing corresponding data analysis operations according to the type of the category command data to generate an analysis chart, including:
[0022] Generate a pie chart according to the block size.
[0023] According to some embodiments of the first aspect of the present application, the classifying the command data to obtain category command data of multiple different categories includes:
[0024] Obtain the response time corresponding to the command data;
[0025] Classify the category of the command data into a synchronous command or an asynchronous command according to the response time.
[0026] According to some embodiments of the first aspect of the present application, the type of the category command data is a synchronous command or an asynchronous command; performing corresponding data analysis operations according to the type of the category command data to generate an analysis chart, including:
[0027] Generate a timing chart according to the response time.
[0028] According to certain embodiments of the first aspect of the present application, the type of the category command data is sleep state information; performing corresponding data analysis operations according to the type of the category command data to generate an analysis chart, including:
[0029] Counting the number of sleep states according to the sleep state information to generate a statistical table.
[0030] An embodiment of the second aspect of the present application, an electronic device, including: a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein when the processor executes the computer program, the above-mentioned data analysis method is implemented.
[0031] An embodiment of the third aspect of the present application, a computer storage medium, storing computer-executable instructions for executing the above-mentioned data analysis method.
[0032] The above solution has at least the following beneficial effects: By classifying command data, various types of category command data are obtained; performing corresponding data analysis operations according to the type of category command data to generate an analysis chart; solving the problem that the data format types of the command data of the controller captured by different types of UFS protocol analyzers are different, realizing automatic classification of command data and automatic analysis of command data, and improving the analysis efficiency. Description of the Drawings
[0033] The drawings are used to provide a further understanding of the technical solutions of the present application, and constitute a part of the specification. Together with the embodiments of the present application, they are used to explain the technical solutions of the present application, and do not constitute a limitation to the technical solutions of the present application.
[0034] Figure 1 It is a step diagram of the data analysis method provided by the embodiment of the present application;
[0035] Figure 2 It is a step diagram of step S211, step S212, and step S213;
[0036] Figure 3 It is a step diagram of step S221, step S222, and step S223;
[0037] Figure 4 It is a schematic diagram of the data analysis method provided by the embodiment of the present application. Detailed Embodiments
[0038] In order to make the objectives, technical solutions, and advantages of the present application clearer, the present application will be further described in detail below with reference to the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0039] It should be noted that although the functional modules are divided in the device schematic diagram and the logical sequence is shown in the flowchart, in some cases, the steps shown or described can be executed in a different module division from that in the device or a different sequence from that in the flowchart. Terms such as "first" and "second" in the specification, claims or the above-mentioned drawings are used to distinguish similar objects and do not necessarily need to describe a specific order or sequence.
[0040] There are a wide variety of current controllers, and each main controller has differences in the operation behavior of the universal flash storage. When developing UFS, if UFS needs to be adapted to as many types of main controllers as possible, it is necessary to analyze the behavior of different main controllers on UFS in different scenarios, and collect and capture the data of the command operations of different main controllers on UFS storage through a UFS protocol analyzer. However, the data formats generated by different types of UFS protocol analyzers are inconsistent, and different data formats require manual data screening, resulting in low efficiency and poor analysis effect.
[0041] The following further elaborates on the embodiments of the present application in conjunction with the accompanying drawings.
[0042] To solve the above problems, an embodiment of the present application provides a data analysis method.
[0043] Refer to Figure 1 , the data analysis method includes the following steps:
[0044] Step S100, obtaining command data of the controller for the memory;
[0045] Step S200, classifying the command data to obtain various types of classified command data;
[0046] Step S300, performing corresponding data analysis operations according to the types of the classified command data to generate an analysis chart.
[0047] For step S100, when the controller issues command data to the memory, the command data is captured through a UFS protocol analyzer.
[0048] When capturing command data using different types of UFS protocol analyzers, the command data generated by different types of UFS protocol analyzers has different data formats.
[0049] Exemplarily, the data captured by the UFS protocol analyzer includes specific commands, responses, and data transmission content of the UFS protocol. For example, information such as read and write operations and command status of the UFS device. It also includes UniPro layer data, including information such as link initialization, data transmission, and error handling. It also includes MPHY layer data, including data such as signal status, link training, and physical layer events of the MPHY layer.
[0050] Write the command data into the original worksheet in a preset format to generate a worksheet. Specifically, the worksheet is an excel worksheet file.
[0051] For step S200, classify the command data to obtain various types of categorized command data.
[0052] Exemplarily, the data captured by the protocol analyzer contains multiple commands. According to its own needs, find the corresponding command (such as the write data command). After finding the write data command, then find the corresponding field start address and block size from the data of this line of the write command, filter them out, and a write command (including the start address and block size) is obtained. The implementation in Python is to match the write command string, then find the fields of the start address and block size in the corresponding line of the write command, filter them out, create a new excel file, and load the same write commands filtered out line by line into the newly created excel, so as to achieve data filtering. The same classification method is used for other commands.
[0053] In addition, classifying the command data to obtain various types of categorized command data includes the following steps: obtaining the response time corresponding to the command data; classifying the category of the command data into synchronous commands or asynchronous commands according to the response time.
[0054] A synchronous command means that when it is executed in a program, the subsequent code must wait for the command to execute and return the result before it can continue to execute. In the synchronous mode, the program is executed sequentially, and each command runs in turn according to the predefined order until all commands are completed.
[0055] An asynchronous command allows the program to continue executing the subsequent code after issuing the command without waiting for the command to complete. This means that the program will not be blocked by a single command and can handle multiple tasks concurrently.
[0056] Every command data is sent to the host side, and the host side will reply with response information corresponding to the command data for answering. The interval from the moment when the command data is sent to the moment when the response information is received is the time consumed by the command.
[0057] Analyze the command interval according to the task ID. Distinguish between synchronous and asynchronous based on the task ID. If the response information is received immediately after sending the command data, classify the command data as a synchronous command. If the response information for the command data is received after several commands have been sent, classify the command data as an asynchronous command.
[0058] By determining synchronous and asynchronous commands, it is possible to analyze the frequency of the controller using synchronous commands and the frequency of using asynchronous commands for the memory in different scenarios.
[0059] Refer to Figure 2 , in addition, classifying the command data to obtain various types of classified command data includes the following steps:
[0060] Step S211, read the command data of one row of the worksheet;
[0061] Step S212, when the command data of one row of the worksheet is read, read the command data of another row until all the command data of the worksheet is read;
[0062] Step S213, classify the command data to obtain various types of classified command data.
[0063] Refer to Figure 3 , or, classifying the command data to obtain various types of classified command data includes the following steps:
[0064] Step S221, read the command data of one column of the worksheet;
[0065] Step S222, when the command data of one column of the worksheet is read, read the command data of another column until all the command data of the worksheet is read;
[0066] Step S223, classify the command data to obtain various types of classified command data.
[0067] When Excel software opens an excel worksheet file, it will load all the data of the file into memory at once. If the file data volume is very large (such as containing millions of rows of data), it will cause memory shortage, resulting in Excel software being unable to open the file or running slowly.
[0068] Use the openpyxl library of the python language to iteratively read the rows in the worksheet, thus avoiding loading the entire worksheet into memory at once, and thus enabling the opening of large files.
[0069] It is possible to achieve rapid screening and classification of command data, facilitating subsequent data analysis.
[0070] Reference Figure 4 When the type of the category command data is the data operation logical address, corresponding data analysis operations are performed according to the type of the category command data to generate an analysis chart, including the following steps: generating a logical address scatter diagram according to the data operation logical address.
[0071] The data operation logical address includes a write data logical address, a read data logical address, an erase data logical address, etc.
[0072] Exemplarily, the data is plotted into a scatter diagram through the matplotlib library to facilitate the analysis of the data address distribution.
[0073] When the type of the category command data is the block size corresponding to a single command operation, corresponding data analysis operations are performed according to the type of the category command data to generate an analysis chart, including the following steps: generating a pie chart according to the block size.
[0074] The block size corresponding to a single command operation includes a single block size for writing data, a single block size for reading data, a single block size for erasing data, etc.
[0075] Exemplarily, the data is plotted into a pie chart through the matplotlib library to visually view the distribution of single write / read / erase.
[0076] When the type of the category command data is a synchronous command or an asynchronous command, corresponding data analysis operations are performed according to the type of the category command data to generate an analysis chart, including the following steps: generating a timing table according to the response time.
[0077] Specifically, the time interval is obtained according to the time when the command data is sent and the response time when the response information is received, and an excel timing table is generated according to the time interval. The excel timing table can be used for use case timing simulation development.
[0078] The type of the category command data is the sleep state information; corresponding data analysis operations are performed according to the type of the category command data to generate an analysis chart, including the following steps: counting the number of sleep states according to the sleep state information to generate a statistical table.
[0079] Specifically, the sleep state information is auto H8. Count the number of auto H8 (HIBERN8 Hibernate sleep state).
[0080] The auto H8 data is usually related to the sleep state of the UFS device. The relevant data can be obtained through system logs, hardware debugging tools or protocol analyzers. The auto H8 data is usually stored in system log files (such as / var / log or sys file system) or hardware debugging interfaces, etc.
[0081] If the data is stored in a log file, it can be extracted by using the grep command to search for the keywords HIBERN8 or autoH8. If the data is stored in the sys file system, the file content can be directly read.
[0082] Integrate the data analysis method into a Python-based analysis tool. Enable the tool to obtain the command data of the controller for the memory; classify the command data to obtain various types of classified command data; perform corresponding data analysis operations according to the type of the classified command data to generate analysis charts.
[0083] Use the analysis tool to write the command data into the original worksheet in a preset format to generate a worksheet. Read the command data of one row of the worksheet; when the command data of one row of the worksheet is read, read the command data of another row until all the command data of the worksheet is read; classify the command data to obtain various types of classified command data. Or, read the command data of one column of the worksheet; when the command data of one column of the worksheet is read, read the command data of another column until all the command data of the worksheet is read; classify the command data to obtain various types of classified command data.
[0084] Use the analysis tool to obtain the response time corresponding to the command data; distinguish the type of the command data as a synchronous command or an asynchronous command according to the response time.
[0085] When the type of the classified command data is the data operation logical address, use the analysis tool to generate a logical address scatter diagram according to the data operation logical address.
[0086] When the type of the classified command data is the block size corresponding to a single command operation, use the analysis tool to generate a pie chart according to the block size.
[0087] When the type of the classified command data is a synchronous command or an asynchronous command, use the analysis tool to generate a timing chart according to the response time.
[0088] Use the analysis tool to count the number of sleep states.
[0089] Solve the problem that the data format types of the command data of the controller for the memory captured by different types of UFS protocol analyzers are different, realize the automatic classification of command data and the automatic analysis of command data, and improve the analysis efficiency.
[0090] The embodiment of the present application also provides an electronic device. The electronic device includes a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, the above data analysis method is implemented. The electronic device can be any intelligent terminal including a tablet computer, a vehicle-mounted computer, etc.
[0091] The processor can be implemented in the form of a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, etc., and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application; the memory can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM), etc. The memory can store an operating system and other application programs. When implementing the technical solutions provided in the embodiments of this specification through software or firmware, the relevant program codes are stored in the memory and are called by the processor to execute the data analysis method of the embodiments of the present application.
[0092] The input / output interface is used to implement information input and output; the communication interface is used to implement communication interaction between this device and other devices, and can implement communication through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.); the bus transmits information between various components of the device (such as the processor, memory, input / output interface, and communication interface); among them, the processor, memory, input / output interface, and communication interface are communicatively connected to each other inside the device through the bus.
[0093] The embodiments of the present application also provide a computer-readable storage medium, which stores a computer program, and when the computer program is executed by a processor, the above-mentioned data analysis method is implemented.
[0094] As a non-transitory computer-readable storage medium, the memory can be used to store non-transitory software programs and non-transitory computer-executable programs. In addition, the memory can include high-speed random access memory, and can also include non-transitory memory, such as at least one magnetic disk storage device, a flash memory device, or other non-transitory solid-state storage devices. In some embodiments, the memory optionally includes a memory remotely set relative to the processor, and these remote memories can be connected to the processor through a network. Examples of the above-mentioned network include but are not limited to the Internet, an enterprise intranet, a local area network, a mobile communication network, and combinations thereof.
[0095] The embodiments described in the embodiments of the present application are for more clearly explaining the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Those skilled in the art know that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0096] Those skilled in the art can understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than those shown in the figures, or combine certain steps, or different steps.
[0097] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated, that is, they may be located in one place, or may be distributed to multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0098] Those of ordinary skill in the art can understand that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, and their appropriate combinations.
[0099] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and do not have to be used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of the present application described here can be implemented in an order other than those illustrated or described here. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that comprises a series of steps or units does not have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products, or devices.
[0100] It should be understood that in the present application, "at least one (item)" means one or more, and "a plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" may mean: only A exists, only B exists, and both A and B exist at the same time. Among them, A and B can be singular or plural. The character " / " generally means that the associated objects before and after are in an "or" relationship. "At least one (one) of the following" or its similar expression means any combination of these items, including any combination of single item (one) or plural items (ones). For example, at least one (one) of a, b, or c may mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0101] In several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the above-mentioned units is only a logical function division. In actual implementation, there can be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections to each other can be through some interfaces. The indirect couplings or communication connections of devices or units can be in electrical, mechanical or other forms.
[0102] The units described above as separate components may or may not be physically separated. The components displayed as units may or may not be physical units, that is, they can be located in one place, or they can be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0103] In addition, in each embodiment of this application, the functional units can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.
[0104] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes multiple instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods in each embodiment of this application. The aforementioned storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical discs that can store programs.
[0105] The above has specifically described the preferred embodiments of this application, but this application is not limited to the embodiments. Those skilled in the art can make various equivalent deformations or substitutions without departing from the spirit of this application, and these equivalent deformations or substitutions are all included within the scope defined by the claims of this application.
Claims
1. A data analysis method, characterized in that, Including: Obtaining command data of a memory by a controller; Classifying the command data to obtain category command data of multiple different categories; Performing corresponding data analysis operations according to the types of the category command data to generate an analysis chart.
2. The data analysis method according to claim 1, wherein After obtaining the command data of the memory by the controller, the method includes: Writing the command data into an original worksheet in a preset format to generate a worksheet.
3. The data analysis method according to claim 2, wherein The classifying the command data to obtain category command data of multiple different categories includes: Reading the command data of a row of the worksheet; When the command data of a row of the worksheet is read, reading the command data of another row until all the command data of the worksheet is read; Classifying the command data to obtain category command data of multiple different categories; Or, Reading the command data of a column of the worksheet; When the command data of a column of the worksheet is read, reading the command data of another column until all the command data of the worksheet is read; Classifying the command data to obtain category command data of multiple different categories.
4. The data analysis method according to claim 1, wherein The type of the category command data is a data operation logical address; The performing corresponding data analysis operations according to the types of the category command data to generate an analysis chart includes: Generating a logical address scatter diagram according to the data operation logical address.
5. The data analysis method according to claim 1, wherein The type of the category command data is the block size corresponding to a single command operation; The performing corresponding data analysis operations according to the types of the category command data to generate an analysis chart includes: Generating a pie chart according to the block size.
6. The data analysis method according to claim 1, wherein The classifying the command data to obtain category command data of multiple different categories includes: Obtaining the response time corresponding to the command data; Classifying the category of the command data into a synchronous command or an asynchronous command according to the response time.
7. The data analysis method according to claim 6, wherein The type of the category command data is a synchronous command or an asynchronous command; The performing corresponding data analysis operations according to the types of the category command data to generate an analysis chart includes: Generating a timing chart according to the response time.
8. The data analysis method according to claim 1, wherein The type of the category command data is sleep state information; the performing corresponding data analysis operations according to the types of the category command data to generate an analysis chart includes: Counting the number of sleep states according to the sleep state information to generate a statistical table.
9. An electronic device, characterized in that, Including: A memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor implements the data analysis method according to any one of claims 1 to 8 when executing the computer program.
10. A computer storage medium, characterized in that, Storing computer-executable instructions for executing the data analysis method according to any one of claims 1 to 8.