Log output method, device and equipment for storage firmware of universal flash memory and medium

By replacing the output string with unique identifiers in the general flash storage firmware, the problem of insufficient memory is solved, and more detailed logging and higher performance are achieved, which facilitates the location of later problems.

CN119917374APending Publication Date: 2025-05-02CHENGDU BIWIN STORAGE TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411996235.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2025-05-02

AI Technical Summary

Technical Problem

When locating the problem of universal flash storage firmware, the existing technology needs to occupy a large amount of memory records and output logs, resulting in insufficient memory and can only output very little information, hindering the location of the problem.

Method used

Replace the original output string by generating the corresponding unique identifiers, and record these unique identifiers and the corresponding output strings to form a log record file. After reading the unique identifier, query the corresponding output string in the log record file to obtain the target log, thereby determining the log output content.

Benefits of technology

Use less memory to record more detailed log content, which improves firmware performance and facilitates later problem location and resolution.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119917374A_ABST
    Figure CN119917374A_ABST
Patent Text Reader

Abstract

The invention discloses a log output method, device and equipment for storage firmware of a universal flash memory and a medium, and relates to the technical field of computer information processing. The method comprises the following steps: generating a corresponding unique identifier according to each log content of storage firmware of a universal flash memory; each log content comprises an output character string; the memory occupied by the unique identifier is smaller than that occupied by the output character string; replacing each output character string in the universal flash memory storage firmware with the corresponding unique identifier; recording the output character string and the unique identifier corresponding to the output character string to obtain a log record file; reading each unique identifier in the universal flash memory storage firmware, and querying a corresponding output character string in a log recording file according to the unique identifier to obtain a target log; and determining the log output content of the general flash memory storage firmware according to the target log. In this way, memory overhead can be saved, more detailed logs can be recorded, and later positioning and problem solving are facilitated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of computer information processing, and in particular to a log output method, device, equipment and medium of universal flash memory storage firmware. Background Art

[0002] When locating Universal Flash Storage (UFS) firmware problems, it is necessary to record and output logs, which requires a large amount of firmware memory, resulting in insufficient memory, so that the firmware can only output very little information when printing logs, hindering the location of firmware problems. Summary of the invention

[0003] In view of this, the purpose of the present invention is to overcome the deficiencies in the prior art and to provide a log output method, device, equipment and medium for universal flash storage firmware, which are used to record more detailed log content using less memory to facilitate later problem location.

[0004] The present invention provides the following technical solutions:

[0005] In a first aspect, the present invention provides a log output method of a universal flash storage firmware, the method comprising:

[0006] Generate a corresponding unique identifier according to each log content of the universal flash memory storage firmware; each log content includes an output string; the memory occupied by the unique identifier is less than the memory occupied by the output string;

[0007] Replacing each of the output strings in the universal flash storage firmware with a corresponding unique identifier; and recording the output string and its corresponding unique identifier to obtain a log record file;

[0008] Read each of the unique identifiers in the universal flash storage firmware, and query the corresponding output string in the log record file according to the unique identifier to obtain a target log;

[0009] The log output content of the universal flash storage firmware is determined according to the target log.

[0010] In one embodiment, the log content includes an original log, the output string includes an original string, the unique identifier includes a first identifier, and the target log includes a first log;

[0011] Generating a corresponding unique identifier according to the log content of the universal flash storage firmware includes: generating a corresponding first identifier according to each original log of the universal flash storage firmware; each original log includes the original character string;

[0012] The step of replacing each of the output strings in the universal flash storage firmware with a corresponding unique identifier; and recording the output string and its corresponding unique identifier to obtain a log record file includes: replacing each of the original strings in the universal flash storage firmware with a corresponding first identifier; and recording the original string and its corresponding first identifier to obtain the log record file;

[0013] The reading of each unique identifier in the universal flash storage firmware, and searching for a corresponding output string in the log record file according to the unique identifier to obtain a target log, includes: reading each first identifier in the universal flash storage firmware, and searching for a corresponding original string in the log record file according to the first identifier to obtain a corresponding first log;

[0014] The determining the log output content of the universal flash storage firmware according to the target log includes: determining all first logs as the log output content of the universal flash storage firmware.

[0015] In one embodiment, the log content further includes a special log, the output string further includes a special string, the unique identifier further includes a second identifier, and the target log further includes a second log;

[0016] The generating of the corresponding unique identifier according to each log content of the universal flash storage firmware includes: when the universal flash storage firmware generates the original log, adding a special character to the original log to obtain the special log, the special log including the special character string; and generating a second identifier corresponding to the special character string;

[0017] The step of replacing each of the output strings in the universal flash storage firmware with a corresponding unique identifier; and recording the output string and its corresponding unique identifier to obtain a log record file includes: replacing each of the special strings in the universal flash storage firmware with a corresponding second identifier; and recording the special string and its corresponding second identifier to obtain the log record file;

[0018] The reading of each unique identifier in the universal flash storage firmware, and searching for a corresponding output string in the log record file according to the unique identifier to obtain a target log, includes: reading each second identifier in the universal flash storage firmware, and searching for a corresponding special string in the log record file according to each second identifier to obtain a corresponding target string, and splicing each target string into the second log;

[0019] The determining the log output content of the universal flash storage firmware according to the target log includes: determining the second log as the log output content of the universal flash storage firmware.

[0020] In one implementation, the step of concatenating the target character strings into the second log includes:

[0021] Determine whether the current target character string includes the special character;

[0022] If the current target character string includes the special character, the target character string is saved, and the step of reading each second identifier in the universal flash memory storage firmware is re-executed;

[0023] If the current target character string does not include the special character, all target character strings are concatenated into the second log.

[0024] In one embodiment, the method further comprises:

[0025] Determining a first file name of the log record file according to a version number of the universal flash storage firmware;

[0026] A second file name of the log record file is determined according to the version number of the universal flash storage firmware.

[0027] In one implementation, searching the log record file for a corresponding original string according to the first identifier to obtain a corresponding first log includes:

[0028] Searching among the plurality of first file names according to the version number of the universal flash storage firmware to determine the log record file to be queried;

[0029] The corresponding original character string is searched in the log record file to be queried according to the first identifier to obtain the first log.

[0030] In one implementation, searching the log record file for a corresponding special character string according to the second identifier to obtain a corresponding target character string includes:

[0031] Searching among the plurality of second file names according to the version number of the universal flash storage firmware to determine the log record file to be queried;

[0032] The corresponding special character string is searched in the log record file to be queried according to the second identifier to obtain the corresponding target character string.

[0033] In a second aspect, the present invention provides a log output device for a universal flash memory storage firmware, the device comprising:

[0034] A generating module, used for generating a corresponding unique identifier according to each log content of the universal flash memory storage firmware; each log content includes an output string; the memory occupied by the unique identifier is less than the memory occupied by the output string;

[0035] A replacement module, used to replace each of the output strings in the universal flash storage firmware with a corresponding unique identifier; and record the output string and its corresponding unique identifier to obtain a log record file;

[0036] A reading module, used for reading each of the unique identifiers in the universal flash storage firmware, and searching for a corresponding output string in the log record file according to the unique identifier to obtain a corresponding target log;

[0037] The determination module is used to determine all target logs as log output contents of the universal flash storage firmware.

[0038] In a third aspect, the present invention proposes a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the steps of the log output method of the universal flash storage firmware as described in the first aspect are implemented.

[0039] In a fourth aspect, the present invention provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the log output method of the universal flash storage firmware as described in the first aspect.

[0040] The log output method, device, equipment and medium of the universal flash storage firmware proposed in the present invention generate corresponding unique identifiers according to the log contents of the universal flash storage firmware; each log content includes an output string; the memory occupied by the unique identifier is less than the memory occupied by the output string; each output string in the universal flash storage firmware is replaced with a corresponding unique identifier; and the output string and its corresponding unique identifier are recorded to obtain a log record file; each unique identifier in the universal flash storage firmware is read, and the corresponding output string is searched in the log record file according to the unique identifier to obtain a target log; the log output content of the universal flash storage firmware is determined according to the target log. In this way, the output string that occupies a larger memory in the universal flash storage firmware is replaced with a unique identifier that occupies a smaller memory, so as to save memory overhead and improve the performance of the universal flash storage firmware. At the same time, more detailed logs can be recorded in more places during operation, which is convenient for later location and problem solving. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] In order to more clearly illustrate the technical solution of the present invention, the following is a brief introduction to the drawings required for use in the embodiments. It should be understood that the following drawings only illustrate certain embodiments of the present invention and should not be regarded as limiting the scope of protection of the present invention. In each of the drawings, similar components are numbered similarly.

[0042] Figure 1 A schematic diagram of a flow chart of a log output method of a universal flash memory storage firmware proposed in this embodiment is shown;

[0043] Figure 2 Another schematic diagram of the flow chart of the log output method of the universal flash memory storage firmware proposed in this embodiment is shown;

[0044] Figure 3 Another schematic diagram of a flow chart of a log output method of a universal flash memory storage firmware proposed in this embodiment is shown;

[0045] Figure 4 Another schematic flow chart of the log output method of the universal flash memory storage firmware proposed in this embodiment is shown;

[0046] Figure 5 A structural schematic diagram of a log output device for universal flash memory storage firmware proposed in this embodiment is shown.

[0047] Description of main component symbols:

[0048] 500 - log output device of universal flash storage firmware; 501 - generation module; 502 - replacement module; 503 - reading module; 504 - determination module. DETAILED DESCRIPTION

[0049] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments.

[0050] The components of the embodiments of the present invention generally described and shown in the drawings herein may be arranged and designed in a variety of different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the drawings is not intended to limit the scope of the claimed invention, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0051] Hereinafter, the terms "including", "having" and their cognates, which may be used in various embodiments of the present invention, are intended only to indicate specific features, numbers, steps, operations, elements, components or combinations of the foregoing items, and should not be understood as first excluding the existence of one or more other features, numbers, steps, operations, elements, components or combinations of the foregoing items or adding the possibility of one or more features, numbers, steps, operations, elements, components or combinations of the foregoing items.

[0052] Furthermore, the terms “first”, “second”, “third”, etc. are merely used for distinguishing descriptions and are not to be understood as indicating or implying relative importance.

[0053] Unless otherwise defined, all terms (including technical terms and scientific terms) used herein have the same meanings as those generally understood by those skilled in the art to which the various embodiments of the present invention belong. The terms (such as those defined in generally used dictionaries) will be interpreted as having the same meanings as the contextual meanings in the relevant technical field and will not be interpreted as having idealized meanings or overly formal meanings unless clearly defined in the various embodiments of the present invention.

[0054] Example 1

[0055] The disclosed embodiment provides a log output method for a universal flash memory storage firmware, which is used to record more detailed log content using less memory, thereby facilitating later problem location.

[0056] See also Figure 1 The log output method of the universal flash storage firmware includes steps S101 to S104, and each step is described in detail below.

[0057] Step S101, generating a corresponding unique identifier according to each log content of the universal flash memory storage firmware; each log content includes an output string; the memory occupied by the unique identifier is smaller than the memory occupied by the output string.

[0058] In this embodiment, when compiling, the universal flash storage firmware first calls the Gentrace.exe program to record all log contents of the universal flash storage firmware. The Gentrace.exe program will traverse all files with the suffix .c in the universal flash storage firmware, and generate a corresponding unique identifier (Identity document, ID) for each log content in the firmware. Among them, each log content includes a corresponding output string, which often contains information related to the log entry; the data type of the unique identifier is unsigned 64 bits, and the unique identifier can be expressed as "c7b70031". Therefore, the memory occupied by the unique identifier is smaller than the memory occupied by the output string.

[0059] Step S102, replacing each output string in the universal flash storage firmware with a corresponding unique identifier; and recording the output string and its corresponding unique identifier to obtain a log record file.

[0060] In this embodiment, each output string in the universal flash storage firmware is replaced with a corresponding unique identifier. In this way, the original long log content in the universal flash storage firmware is replaced with an unsigned 64-bit unique identifier, thereby saving the memory overhead of the universal flash storage firmware.

[0061] Furthermore, the output string and its corresponding unique identifier are recorded in a log file, which can be stored in a database. In this way, the original output string can be found by searching the unique identifier in the log file, thereby restoring the log content of the universal flash storage firmware, thereby saving memory space.

[0062] Step S103, reading each unique identifier in the universal flash storage firmware, and searching for a corresponding output string in the log record file according to the unique identifier to obtain a target log.

[0063] In this embodiment, after the universal flash storage firmware is connected to the computer, the computer sends a command to obtain the log through the serial port, and the universal flash storage firmware will output the log stored during the operation through the serial port. At this time, the original string in the log of the universal flash storage firmware has been replaced by the corresponding unique identifier, so each unique identifier in the universal flash storage firmware is read; each time a unique identifier is read, the corresponding output string is searched in the log record file according to the read unique identifier; and the target log is obtained according to the queried output string.

[0064] Step S104: determining the log output content of the universal flash storage firmware according to the target log.

[0065] In this embodiment, after all unique identifiers in the universal flash storage firmware have been read and the target log is obtained based on the corresponding output string queried based on the unique identifier, the target log is output as the log output content of the universal flash storage firmware, so that the backend personnel can locate the firmware problem based on the log output content.

[0066] In a specific embodiment, the log content includes the original log, the output string includes the original string, the unique identifier includes the first identifier, and the target log includes the first log; see Figure 2 , each step is described in detail below.

[0067] Step S201, generating a corresponding first identifier according to each original log of the universal flash memory storage firmware; each original log includes the original character string.

[0068] In this embodiment, the universal flash storage firmware calls a program during compilation to conventionally record the content of the original log of the universal flash storage firmware. At this time, the original log includes an original string. The original string can be expressed as "growndefect rebuild done%d\r\n". Further, a first identifier corresponding to the original string is generated.

[0069] Step S202: replace each original character string in the universal flash storage firmware with a corresponding first identifier; and record the original character string and its corresponding first identifier to obtain the log record file.

[0070] In this embodiment, each original character string in the universal flash memory storage firmware is replaced with a corresponding first identifier, so that the long original character string is replaced with a first identifier that occupies less memory, which greatly saves the memory of the universal flash memory storage firmware.

[0071] Furthermore, the original character string and its corresponding first identifier are recorded to obtain a log record file, so that the original log can be restored according to the first identifier later.

[0072] Step S203, reading each of the first identifiers in the universal flash memory storage firmware, and searching the log record file for a corresponding original character string according to the first identifier to obtain a corresponding first log.

[0073] In this embodiment, each first identifier in the universal flash storage firmware is read; each time the first identifier is read, the corresponding original string is queried in the log record file according to the read first identifier; each time an original string is queried, the parameters that should be filled in the original string are then obtained from the serial port, so that the original string and its corresponding parameters are restored into a first log; when all the first identifiers in the universal flash storage firmware are read, multiple corresponding first logs will be obtained.

[0074] Step S204: determine all first logs as log output contents of the universal flash memory storage firmware.

[0075] In this embodiment, all first logs are used as log output contents of the universal flash storage firmware. In this way, the original character string in each original log of the universal flash storage firmware is replaced with a unique identifier, and then restored to the corresponding first log according to each first identifier, and all first logs are used as log output contents of the universal flash storage firmware, that is, the log output contents at this time include multiple first logs, so that detailed log contents can be obtained through the limited memory of the universal flash storage firmware, which makes it easier for back-end personnel to locate problems with the universal flash storage firmware.

[0076] In a specific embodiment, the log content also includes a special log, the output string also includes a special string, the unique identifier also includes a second identifier, and the target log also includes a second log; see Figure 3 , each step is described in detail below.

[0077] Step S301, when the universal flash storage firmware generates the original log, special characters are added to the original log to obtain the special log, the special log includes the special character string; and a second identifier corresponding to the special character string is generated.

[0078] In this embodiment, when the universal flash storage firmware is compiled, special characters are added to the original log while recording the content of the original log of the universal flash storage firmware. At this time, a special log containing special characters is obtained, that is, the special log includes a special string containing special characters. The special character can be "$", and the special string can be expressed as "growndefect rebuild done$%d\r\n". Further, a second identifier corresponding to the special string is generated.

[0079] Step S302, replacing each of the special character strings in the universal flash storage firmware with a corresponding second identifier; and recording the special character string and its corresponding second identifier to obtain the log record file.

[0080] In this embodiment, each special character string in the universal flash storage firmware is replaced with a corresponding second identifier. At this time, the memory space occupied by the special log in the universal flash storage firmware can be reduced by using the second identifier that occupies less memory.

[0081] Furthermore, the special character string and its corresponding second identifier are recorded in the log record file, so that the corresponding special character string can be searched in the log record file according to the second identifier later.

[0082] Step S303, reading each of the second identifiers in the universal flash storage firmware, and searching for a corresponding special character string in the log record file according to each of the second identifiers to obtain a corresponding target character string, and concatenating each of the target character strings into the second log.

[0083] In this embodiment, each second identifier in the universal flash storage firmware is read; each time the second identifier is read, the corresponding special character string is queried in the log record file according to the read second identifier to obtain the corresponding target character string; when all the second identifiers in the universal flash storage firmware are read, all the target character strings are spliced ​​into a second log, thereby further saving memory overhead, improving the performance of the universal flash storage firmware, and being able to record more detailed logs in more places during operation, which is convenient for later location and problem solving.

[0084] Step S304: determine the second log as the log output content of the universal flash storage firmware.

[0085] In this embodiment, the second log is used as the log output content of the universal flash storage firmware. At this time, the log output content only includes one second log, but the second log splices the contents of multiple special logs. In this way, the backstage personnel can locate the problem according to the complete log output content.

[0086] See also Figure 4 In a specific embodiment, the step of concatenating the target character strings into the second log includes steps S3031 to S3033, and each step is described in detail below.

[0087] Step S3031, determining whether the current target character string includes the special character.

[0088] Step S3032: If the current target character string includes the special character, the target character string is saved, and the step of reading each second identifier in the universal flash memory storage firmware is re-executed.

[0089] Step S3033: If the current target character string does not include the special character, all target character strings are concatenated into the second log.

[0090] In this embodiment, it is determined whether the currently queried target string includes special characters; if the target string includes special characters, then the parameters that should be filled in the target string are obtained from the serial port, and the step of reading each of the second identifiers in the universal flash storage firmware is re-executed to continue to obtain the special string corresponding to the next second identifier. When the special string corresponding to the next second identifier is obtained, the special string is used as the target string, and its corresponding parameters are spliced ​​to the parameters corresponding to the previous target string; if the current target string does not include special characters, the splicing of all current target strings is completed to obtain a second log. At this time, the contents of multiple special logs are spliced ​​into one second log, which further saves memory.

[0091] In a specific embodiment, the first file name of the log record file is determined according to the version number of the universal flash storage firmware; and the second file name of the log record file is determined according to the version number of the universal flash storage firmware.

[0092] In this embodiment, when the original string and its corresponding first identifier are recorded to the log recording file, the version number of the current universal flash storage firmware is obtained, and the first file name of the log recording file is determined according to the version number of the current universal flash storage firmware. The first file name is, for example, ELogRecord_cefea908.txt, so that the corresponding log recording file can be quickly found later.

[0093] Correspondingly, when the original string and its corresponding second identifier are recorded in the log recording file, the version number of the current universal flash storage firmware is obtained, and the second file name of the log recording file is determined according to the version number of the current universal flash storage firmware, so as to quickly find the corresponding log recording file later.

[0094] In a specific implementation, the method of searching the log record file for a corresponding original string according to the first identifier to obtain a corresponding first log includes: searching among multiple first file names according to the version number of the universal flash storage firmware to determine the log record file to be queried; searching the log record file to be queried for a corresponding original string according to the first identifier to obtain the first log.

[0095] In this embodiment, when the host computer tool reads the first identifier in the universal flash storage firmware, it searches for the log record file to be queried in multiple first file names according to the version number of the read universal flash storage firmware; then searches for the corresponding original string in the log record file to be queried according to the first identifier, thereby obtaining the first log. In this way, naming and querying according to the version number of the universal flash storage firmware can speed up the query.

[0096] In a specific embodiment, the step of searching the log record file for a corresponding special string based on the second identifier to obtain a corresponding target string includes: searching among multiple second file names based on the version number of the universal flash storage firmware to determine the log record file to be queried; searching the log record file to be queried for a corresponding special string based on the second identifier to obtain a corresponding target string.

[0097] In this embodiment, when the host computer tool reads the second identifier in the universal flash storage firmware, it searches for the corresponding log record file to be queried in multiple second file names according to the version number of the read universal flash storage firmware; and then searches for the corresponding special string in the log record file to be queried according to the second identifier, thereby obtaining the target string. In this way, naming and querying according to the version number of the universal flash storage firmware can speed up the query.

[0098] The log output method of the universal flash storage firmware proposed in this embodiment generates a corresponding unique identifier according to each log content of the universal flash storage firmware; each log content includes an output string; the memory occupied by the unique identifier is less than the memory occupied by the output string; each output string in the universal flash storage firmware is replaced with a corresponding unique identifier; and the output string and its corresponding unique identifier are recorded to obtain a log record file; each unique identifier in the universal flash storage firmware is read, and the corresponding output string is searched in the log record file according to the unique identifier to obtain a target log; the log output content of the universal flash storage firmware is determined according to the target log. In this way, the output string that occupies a larger memory in the universal flash storage firmware is replaced with a unique identifier that occupies a smaller memory, so as to save memory overhead and improve the performance of the universal flash storage firmware. At the same time, more detailed logs can be recorded in more places during operation, which is convenient for locating and solving problems later.

[0099] Example 2

[0100] In addition, the present disclosure provides a log output device 500 for general flash memory storage firmware, see Figure 5 , the device comprises:

[0101] Generating module 501, generating a corresponding unique identifier according to each log content of the universal flash storage firmware; each log content includes an output string; the memory occupied by the unique identifier is less than the memory occupied by the output string;

[0102] A replacement module 502 is used to replace each of the output strings in the universal flash storage firmware with a corresponding unique identifier; and record the output string and its corresponding unique identifier to obtain a log record file;

[0103] The reading module 503 is used to read each unique identifier in the universal flash storage firmware, and query the corresponding output string in the log record file according to the unique identifier to obtain the corresponding target log;

[0104] The determination module 504 is used to determine all target logs as log output contents of the universal flash storage firmware.

[0105] Preferably, the log content includes the original log, the output string includes the original string, the unique identifier includes the first identifier, the log record file includes the log record file, and the target log includes the first log;

[0106] The generating module 501 is further configured to generate a corresponding first identifier according to each original log of the universal flash storage firmware; each original log includes the original character string;

[0107] The replacement module 502 is further used to replace each original string in the universal flash storage firmware with a corresponding first identifier; and record the original string and its corresponding first identifier to obtain the log record file;

[0108] The reading module 503 is further configured to read each of the first identifiers in the universal flash memory storage firmware, and query the corresponding original character string in the log record file according to the first identifier to obtain the corresponding first log;

[0109] The determining module 504 is further configured to determine all first logs as log output contents of the universal flash memory storage firmware.

[0110] Preferably, the log content further includes a special log, the output string further includes a special string, the unique identifier further includes a second identifier, and the target log further includes a second log;

[0111] The generating module 501 is further configured to add special characters to the original log to obtain the special log when the universal flash storage firmware generates the original log, wherein the special log includes the special character string; and generate a second identifier corresponding to the special character string;

[0112] The replacement module 502 is further used to replace each of the special character strings in the universal flash storage firmware with a corresponding second identifier; and record the special character string and its corresponding second identifier to obtain the log record file;

[0113] The reading module 503 is further used to read each second identifier in the universal flash storage firmware, and query the corresponding special character string in the log record file according to each second identifier to obtain the corresponding target character string, and splice each target character string into the second log;

[0114] The determination module 504 is further configured to determine the log output content of the universal flash storage firmware according to the target log, including: determining the second log as the log output content of the universal flash storage firmware.

[0115] Preferably, the reading module 503 is also used to determine whether the current target string includes the special character; if the current target string includes the special character, the target string is saved, and the step of reading each second identifier in the universal flash storage firmware is re-executed; if the current target string does not include the special character, all target strings are spliced ​​into the second log.

[0116] Preferably, the replacement module 502 is further used to determine the first file name of the log record file according to the version number of the universal flash storage firmware;

[0117] The replacement module 502 is further configured to determine a second file name of the log record file according to a version number of the universal flash storage firmware.

[0118] Preferably, the reading module 503 is also used to search among multiple first file names according to the version number of the universal flash storage firmware to determine the log record file to be queried; and to search for the corresponding original character string in the log record file to be queried according to the first identifier to obtain the first log.

[0119] Preferably, the reading module 503 is also used to search among multiple second file names according to the version number of the universal flash storage firmware to determine the log record file to be queried; and to search for the corresponding special character string in the log record file to be queried according to the second identifier to obtain the corresponding target character string.

[0120] The device provided in the embodiment of the present disclosure can execute the steps of the log output method of the universal flash storage firmware provided in Example 1, which will not be described again to avoid repetition.

[0121] The log output device of the universal flash storage firmware proposed in this embodiment generates a corresponding unique identifier according to each log content of the universal flash storage firmware; each log content includes an output string; each output string in the universal flash storage firmware is replaced with a corresponding unique identifier; and the output string and its corresponding unique identifier are recorded to obtain a log record file; each unique identifier in the universal flash storage firmware is read, and the corresponding output string is searched in the log record file according to the unique identifier to obtain a target log; the log output content of the universal flash storage firmware is determined according to the target log. In this way, the output string that occupies more memory in the universal flash storage firmware is replaced with a unique identifier that occupies less memory, so as to save memory overhead and improve the performance of the universal flash storage firmware. At the same time, more detailed logs can be recorded in more places during operation, which is convenient for locating and solving problems later.

[0122] Example 3

[0123] In addition, an embodiment of the present disclosure provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the log output method of the universal flash storage firmware described in Embodiment 1 is implemented.

[0124] The device provided in the embodiment of the present disclosure can execute the steps of the log output method of the universal flash storage firmware provided in Example 1, which will not be described again to avoid repetition.

[0125] Example 4

[0126] The embodiment of the present disclosure provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, the log output method of the universal flash memory storage firmware described in Embodiment 1 is implemented.

[0127] In this embodiment, the computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0128] The computer-readable storage medium provided in this embodiment can implement the log output method of the universal flash memory storage firmware provided in Example 1, and will not be described again here to avoid repetition.

[0129] In all examples shown and described herein, any specific values ​​should be interpreted as merely exemplary and not as limiting, and thus other examples of the exemplary embodiments may have different values.

[0130] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.

[0131] The above-mentioned embodiments only express several implementation methods of the present invention, and the description thereof is relatively specific and detailed, but it cannot be understood as limiting the scope of the present invention. It should be pointed out that for ordinary technicians in this field, several modifications and improvements can be made without departing from the concept of the present invention, which all belong to the protection scope of the present invention.

Claims

1. A log output method for a universal flash storage firmware, characterized in that: The method comprises: Generate a corresponding unique identifier according to each log content of the universal flash memory storage firmware; each log content includes an output string; the memory occupied by the unique identifier is less than the memory occupied by the output string; Replacing each of the output strings in the universal flash storage firmware with a corresponding unique identifier; and recording the output string and its corresponding unique identifier to obtain a log record file; Read each of the unique identifiers in the universal flash storage firmware, and query the corresponding output string in the log record file according to the unique identifier to obtain a target log; The log output content of the universal flash storage firmware is determined according to the target log.

2. The log output method of the universal flash storage firmware according to claim 1, characterized in that: The log content includes the original log, the output string includes the original string, the unique identifier includes the first identifier, and the target log includes the first log; Generating a corresponding unique identifier according to the log content of the universal flash storage firmware includes: generating a corresponding first identifier according to each original log of the universal flash storage firmware; each original log includes the original character string; The step of replacing each of the output strings in the universal flash storage firmware with a corresponding unique identifier; and recording the output string and its corresponding unique identifier to obtain a log record file includes: replacing each of the original strings in the universal flash storage firmware with a corresponding first identifier; and recording the original string and its corresponding first identifier to obtain the log record file; The reading of each unique identifier in the universal flash storage firmware, and searching for a corresponding output string in the log record file according to the unique identifier to obtain a target log, includes: reading each first identifier in the universal flash storage firmware, and searching for a corresponding original string in the log record file according to the first identifier to obtain a corresponding first log; The determining the log output content of the universal flash storage firmware according to the target log includes: determining all first logs as the log output content of the universal flash storage firmware.

3. The log output method of the universal flash storage firmware according to claim 2, characterized in that: The log content also includes a special log, the output string also includes a special string, the unique identifier also includes a second identifier, and the target log also includes a second log; The generating of the corresponding unique identifier according to each log content of the universal flash storage firmware includes: when the universal flash storage firmware generates the original log, adding a special character to the original log to obtain the special log, the special log including the special character string; and generating a second identifier corresponding to the special character string; The step of replacing each of the output strings in the universal flash storage firmware with a corresponding unique identifier; and recording the output string and its corresponding unique identifier to obtain a log record file includes: replacing each of the special strings in the universal flash storage firmware with a corresponding second identifier; and recording the special string and its corresponding second identifier to obtain the log record file; The reading of each unique identifier in the universal flash storage firmware, and searching for a corresponding output string in the log record file according to the unique identifier to obtain a target log, includes: reading each second identifier in the universal flash storage firmware, and searching for a corresponding special string in the log record file according to each second identifier to obtain a corresponding target string, and splicing each target string into the second log; The determining the log output content of the universal flash storage firmware according to the target log includes: determining the second log as the log output content of the universal flash storage firmware.

4. The log output method of the universal flash storage firmware according to claim 3, characterized in that: The step of concatenating the target character strings into the second log includes: Determine whether the current target character string includes the special character; If the current target character string includes the special character, the target character string is saved, and the step of reading each second identifier in the universal flash memory storage firmware is re-executed; If the current target character string does not include the special character, all target character strings are concatenated into the second log.

5. The log output method of the universal flash storage firmware according to claim 3, characterized in that: The method further comprises: Determining a first file name of the log record file according to a version number of the universal flash storage firmware; A second file name of the log record file is determined according to the version number of the universal flash storage firmware.

6. The log output method of the universal flash storage firmware according to claim 5, characterized in that: The step of searching the log record file for a corresponding original string according to the first identifier to obtain a corresponding first log includes: Searching among the plurality of first file names according to the version number of the universal flash storage firmware to determine the log record file to be queried; The corresponding original character string is searched in the log record file to be queried according to the first identifier to obtain the first log.

7. The log output method of the universal flash storage firmware according to claim 5, characterized in that: The step of searching the log record file for a corresponding special character string according to the second identifier to obtain a corresponding target character string includes: Searching among the plurality of second file names according to the version number of the universal flash storage firmware to determine the log record file to be queried; The corresponding special character string is searched in the log record file to be queried according to the second identifier to obtain the corresponding target character string.

8. A log output device for universal flash storage firmware, characterized in that: The device comprises: A generating module, used for generating a corresponding unique identifier according to each log content of the universal flash memory storage firmware; each log content includes an output string; the memory occupied by the unique identifier is less than the memory occupied by the output string; A replacement module, used to replace each of the output strings in the universal flash storage firmware with a corresponding unique identifier; and record the output string and its corresponding unique identifier to obtain a log record file; A reading module, used for reading each of the unique identifiers in the universal flash storage firmware, and searching for a corresponding output string in the log record file according to the unique identifier to obtain a corresponding target log; The determination module is used to determine all target logs as log output contents of the universal flash storage firmware.

9. A computer device, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the steps of the log output method of the universal flash storage firmware as described in any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium, characterized in that: It stores a computer program, which, when executed by a processor, implements the steps of the log output method of the universal flash storage firmware as described in any one of claims 1 to 7.