CN-122019330-A - Method, system, equipment and medium for optimizing SSD log record
Abstract
The application discloses a method, a system, equipment and a medium for optimizing SSD (solid state disk) log records, and relates to the technical field of solid state disk log management, wherein the method comprises the steps of removing description characters and formatted character strings in an original log printing function, reserving key parameters and adding search fields; the method comprises the steps of printing a simplified log containing search fields and key parameters, establishing a mapping relation among descriptive characters, formatted character strings and the search fields to generate a log search table, analyzing the simplified log through a tool or a script based on the log search table, and restoring real log printing. The application prints only key parameters when printing, and the rest description characters (containing formatted character strings) are omitted, thereby achieving the effect of not compiling the description characters in the compiling stage, reducing the code space of the compiled executable file, reducing the consumption of the log function to the code space, improving the utilization rate of the log space, and realizing compression and restoration of the log without damage.
Inventors
- Lu Songpin
- Chen Sikun
- LI HONGLIANG
- LUO WENJIE
- LV HUI
- MA YI
- XIONG WEI
Assignees
- 芯盛智能科技(湖南)有限公司
Dates
- Publication Date
- 20260512
- Application Date
- 20260409
Claims (7)
- 1. A method of optimizing SSD log records, comprising: removing description characters and formatted character strings in the original log printing function, reserving key parameters, and adding search fields; Printing a simplified log containing the search field and the key parameters; Establishing a mapping relation among the description characters, the formatted character strings and the search fields, and generating a log search table; and analyzing the simplified log through a tool or a script based on the log search table, and restoring the real log printing.
- 2. The method of claim 1, wherein the log search table is used to implement bi-directional search of search fields and description/formatting strings.
- 3. The method of claim 2, wherein the bi-directional searching comprises: Searching a search field according to the description character/formatted character string, and rapidly searching whether the simplified log has some attention log or not, and rapidly delimiting the problem; Searching description characters/formatted character strings according to the search field, searching the description characters in the original log through the search field, and then analyzing the searched formatted character strings to restore the real log printing.
- 4. The method for optimizing SSD log records of claim 1, wherein said parsing the reduced log comprises: searching description characters and formatted character strings in the original log printing function in the log search table according to the search field of the simplified log; analyzing the key parameters based on the format of the formatted character strings to enable the key parameters to accord with the printing format of the real log; and after the key parameters are analyzed according to the formatted character strings, splicing the key parameters with the description characters to ensure that the semantic and real log printing are the same.
- 5. A system for optimizing SSD log records using a method of optimizing SSD log records of any one of claims 1-4, comprising: The log simplifying module is used for optimizing an SSD original log printing function, removing description characters and formatted character strings of the SSD original log printing function, reserving key parameters, and adding search fields to generate a simplified log; The system comprises a search table generation module, a search table generation module and a search module, wherein the search table generation module is used for generating a log search table based on the mapping relation between description character/formatting character strings and search fields of a log in an original code, and the log search table supports bidirectional search of the search fields and the description character/formatting character strings; and the log restoration module is used for analyzing and restoring the simplified log by means of a tool or a script according to the log retrieval table to obtain a real log.
- 6. An electronic device, the electronic device comprising: A memory storing executable instructions; a processor executing the executable instructions in the memory to implement the method of any of claims 1-4.
- 7. A computer storage medium, characterized in that the medium has stored thereon a computer program which is executed by a processor to implement the method of any of claims 1-4.
Description
Method, system, equipment and medium for optimizing SSD log record Technical Field The invention relates to the technical field of solid state disk log management, in particular to a method, a system, equipment and a medium for optimizing SSD log records. Background In an SSD Solid state disk (Solid STATE DRIVE) system, a log is printed at some important processes and abnormal points, especially processes such as abnormal processing. At the same time, journaling is also an important means of analyzing disc problems. However, with the introduction of new characteristics, the complexity of the system is increased, the occupation space of the increased log is multiplied, and as the log is an executable file generated during compiling, especially normally bright characters, including description characters and format character strings, a certain code space needs to be occupied, usually about 15% of the total code space, and the log descriptor can be recorded in the log system by following printing, the normally bright characters occupy about 50% of the total code space, and the log space is squeezed as the system runs for a long time. The method has the problems that firstly constant character strings of a printing function occupy code space, secondly the number of recorded logs is reduced due to the printed constant character strings, log flushing risks exist, and when invalid characters are overlong, the log system limits the length of a single log, and the problem that the printed log is staged is also caused. Description characters are typically shortened by reducing log printing of normally bright strings or limiting the use of log printing functions, but this increases reading difficulty. And limiting log printing, namely, printing is not added in a printing-free process, but whether the printing is reasonably removed cannot be judged, and the log printing containing the positioning information cannot be removed blindly. None of the above methods can fundamentally solve the problems of code space occupation and log space consumption. Disclosure of Invention The invention aims to overcome the defects of the prior art and provides a method, a system, equipment and a medium for optimizing SSD log records. The aim of the invention is realized by the following technical scheme: in a first aspect, the application discloses a method for optimizing SSD log records, comprising: removing description characters and formatted character strings in the original log printing function, reserving key parameters, and adding search fields; Printing a simplified log containing the search field and the key parameters; Establishing a mapping relation among the description characters, the formatted character strings and the search fields, and generating a log search table; and analyzing the simplified log through a tool or a script based on the log search table, and restoring the real log printing. Based on the first aspect, the log search table is used for realizing bidirectional search of search fields and description character/formatting character strings. Based on the first aspect, the bidirectional retrieval includes: Searching a search field according to the description character/formatted character string, and rapidly searching whether the simplified log has some attention log or not, and rapidly delimiting the problem; Searching description characters/formatted character strings according to the search field, searching the description characters in the original log through the search field, and then analyzing the searched formatted character strings to restore the real log printing. Based on the first aspect, the parsing the simplified log specifically includes: searching description characters and formatted character strings in the original log printing function in the log search table according to the search field of the simplified log; analyzing the key parameters based on the format of the formatted character strings to enable the key parameters to accord with the printing format of the real log; and after the key parameters are analyzed according to the formatted character strings, splicing the key parameters with the description characters to ensure that the semantic and real log printing are the same. In a second aspect, the present application discloses a system for optimizing SSD log records, and the method for optimizing SSD log records includes: The log simplifying module is used for optimizing an SSD original log printing function, removing description characters and formatted character strings of the SSD original log printing function, reserving key parameters, and adding search fields to generate a simplified log; The system comprises a search table generation module, a search table generation module and a search module, wherein the search table generation module is used for generating a log search table based on the mapping relation between description character/formatting character strings and search fie