A drive log management method, device, equipment, program product and medium
Generating a log parsing tree by recursively extracting rules solves the problem of limited storage resources of the board device, and improves driver log storage efficiency and positioning experience without increasing hardware costs.
Patent Information
- Application Number
- CN202410889278.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-04
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2044-07-04
AI Technical Summary
The storage resources of board devices are limited, resulting in low driver log storage efficiency. Increased storage space to improve log storage capacity will increase hardware costs.
Through recursive extraction rules, the shared structured statement templates and variable factors in the driver log are generated to generate log parsing trees, optimize the storage structure and improve the number of log storage without increasing the storage space.
Improves memory utilization, saves hardware costs, and simplifies the process of driving log positioning problems.
Smart Images

Figure CN118409808B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a drive log management method, device, equipment, program product and medium. Background Art
[0002] A driver is a program that enables communication between an operating system (OS) and a hardware component or software application. Each computer uses multiple drivers to control various installed hardware components and applications. Driver operation often requires recording operation logs (Logs). Recording logs is a very important debugging and maintenance tool that can help developers track problems, analyze performance, and maintain equipment, so as to better understand the operation of device drivers and continuously optimize the performance and stability of device drivers.
[0003] The board device is an important driver device of the computer. The storage of its driver log is currently more commonly handled by allocating a circular queue buffer area for each board device on the host side during the board device driver initialization phase. Storing the log data in the circular queue can ensure that part of the log is recorded, but the board device generally has limited storage resources, and the effective information recorded is very limited, which undoubtedly increases the difficulty of problem location, and increasing the storage space of the board device undoubtedly increases the hardware cost. Therefore, how to store as many driver logs as possible without adding additional storage space is a problem that technicians in this field currently need to solve. Summary of the invention
[0004] In view of this, the purpose of the present invention is to provide a driver log management method, device, equipment, program product and medium, which can store as many driver logs as possible without increasing additional storage space. The specific scheme is as follows:
[0005] In a first aspect, the present application discloses a drive log management method, comprising:
[0006] Acquire a driver log of a board device, and recursively extract the driver log using a first extraction rule according to a log structure of the driver log to obtain at least one first shared structured statement template;
[0007] Based on the first shared structured statement template, recursively extract the driver log using a second extraction rule to obtain at least one first variable factor corresponding to each of the first shared structured statement templates;
[0008] A log parsing tree corresponding to the driver log is generated based on the first shared structured statement template and the first variable factor, so as to store the driver log according to the log parsing tree.
[0009] Optionally, the acquiring of the driver log of the board device and recursively extracting the driver log using a first extraction rule according to the log structure of the driver log to obtain at least one first shared structured statement template includes:
[0010] A driver log of a unified extensible firmware interface device is obtained, and according to a log structure of the driver log, the driver log is recursively extracted by using a first extraction rule to obtain at least one first shared structured statement template.
[0011] Optionally, recursively extracting the driver log using a first extraction rule according to the log structure of the driver log to obtain at least one first shared structured statement template includes:
[0012] Acquire driver logs having the same log structure from the driver logs, and divide the driver logs having the same log structure into a group to obtain at least one target driver log;
[0013] The target drive logs are extracted respectively using the first extraction rule to obtain target shared structured statement templates corresponding to the target drive logs;
[0014] The first shared structured statement template is determined according to the target shared structured statement template.
[0015] Optionally, the extracting the target drive logs respectively by using the first extraction rule to obtain a target shared structured statement template corresponding to the target drive log includes:
[0016] Obtaining a character string to be identified in the target drive log;
[0017] Identify the character string to be identified to extract a common part of the character string to be identified;
[0018] The target shared structured statement template is generated using the common portion.
[0019] Optionally, recursively extracting the driver log using the first extraction rule to obtain at least one first shared structured statement template includes:
[0020] Acquire a second shared structured statement template; the second shared structured statement template includes all currently obtained shared structured statement templates;
[0021] Acquire a current drive log, and determine the similarity between the current drive log and the to-be-compared shared structured statement template in the second shared structured statement template to obtain a similarity comparison result;
[0022] Based on the similarity comparison result, at least one of the first shared structured statement templates is obtained.
[0023] Optionally, the driver log management method further includes:
[0024] Pre-build a threshold management interface, and obtain the log similarity threshold through the threshold management interface;
[0025] Correspondingly, the determining the similarity between the current drive log and the to-be-compared shared structured statement template in the second shared structured statement template to obtain a similarity comparison result includes:
[0026] The similarity between the current drive log and the shared structured statement template to be compared in the second shared structured statement template is determined, and the similarity is compared with the log similarity threshold to obtain a similarity comparison result.
[0027] Optionally, obtaining at least one of the first shared structured statement templates based on the similarity comparison result includes:
[0028] If the similarity is not less than the log similarity threshold, extracting the current drive log using the first extraction rule to obtain a corresponding current shared structured statement template, and classifying the current shared structured statement template into the shared structured statement template to be compared;
[0029] If the similarity is less than the log similarity threshold, the current shared structured statement template is used as a newly added shared structured statement template, and the newly added shared structured statement template is included in the second shared structured statement template;
[0030] At least one of the first shared structured statement templates is obtained according to the second shared structured statement template.
[0031] Optionally, obtaining at least one of the first shared structured statement templates according to the second shared structured statement template includes:
[0032] After all the driver logs are extracted using the first extraction rule, at least one of the first shared structured statement templates is obtained according to the current second shared structured statement template.
[0033] Optionally, recursively extracting the driver log based on the first shared structured statement template using a second extraction rule to obtain at least one first variable factor corresponding to each of the first shared structured statement templates includes:
[0034] Based on the target shared structured statement template, recursively extract the target drive logs respectively using a second extraction rule to obtain at least one target variable factor corresponding to each of the target drive logs;
[0035] After all the target shared structured statement templates in the first shared structured statement template are extracted, the first variable factor is determined according to the target variable factor.
[0036] Optionally, the recursive extraction of the target drive logs by using the second extraction rule to obtain at least one target variable factor corresponding to each target drive log includes:
[0037] Obtaining a character string to be identified in the target drive log;
[0038] Identify the character string to be identified to extract a unique portion of the character string to be identified;
[0039] The target variable factor is generated using the unique portion.
[0040] Optionally, after recursively extracting the target drive logs respectively by using the second extraction rule to obtain at least one target variable factor corresponding to each target drive log, the method further includes:
[0041] Taking the target variable factor as the current variable factor, and extracting the current variable factors in sequence using the first extraction rule to obtain at least one third shared structured statement template;
[0042] Based on the third shared structured statement template, the current variable factors are sequentially extracted using the second extraction rule to obtain at least one second variable factor corresponding to each of the third shared structured statement templates;
[0043] A variable group corresponding to the current variable factor is generated based on the third shared structured statement template and the second variable factor.
[0044] Optionally, after all the target shared structured statement templates in the first shared structured statement template are extracted, determining the first variable factor according to the target variable factor includes:
[0045] After all the target shared structured statement templates in the first shared structured statement template are extracted, the first variable factor is determined according to the target variable factor and the variable group.
[0046] Optionally, after extracting the current variable factors in sequence by using the second extraction rule based on the third shared structured statement template to obtain at least one second variable factor corresponding to each of the third shared structured statement templates, the method further includes:
[0047] Determining whether the second variable factor is a variable factor of minimum granularity;
[0048] If the second variable factor is the variable factor of the minimum granularity, triggering the step of generating a variable group corresponding to the current variable factor based on the third shared structured statement template and the second variable factor;
[0049] If the second variable factor is not the variable factor of the minimum granularity, the second variable factor is determined as the current variable factor, and then the step of extracting the current variable factors in sequence by using the first extraction rule is triggered.
[0050] Optionally, the driver log management method further includes:
[0051] When the second variable factor cannot be extracted using the first extraction rule, the second variable factor is determined to be the variable factor of the minimum granularity.
[0052] Optionally, after recursively extracting the driver log using the first extraction rule to obtain at least one first shared structured statement template, the method further includes:
[0053] Generating primary identification information corresponding to each of the first shared structured statement templates;
[0054] Correspondingly, after recursively extracting the driver log using the second extraction rule to obtain at least one first variable factor corresponding to each of the first shared structured statement templates, the method further includes:
[0055] Secondary identification information corresponding to each of the first variable factors is generated according to the primary identification information.
[0056] Optionally, the generating a log parsing tree corresponding to the driver log based on the first shared structured statement template and the first variable factor so as to store the driver log according to the log parsing tree includes:
[0057] Taking the first shared structured statement template and the first variable factor as nodes in the log parsing tree, and assigning corresponding node positions to the first shared structured statement template and the first variable factor according to the first-level identification information and the second-level identification information;
[0058] Based on the node position, a log parsing tree corresponding to the driver log is generated by using the first shared structured statement template and the first variable factor, so as to store the driver log according to the log parsing tree.
[0059] In a second aspect, the present application discloses a drive log management device, comprising:
[0060] A first template generation module is used to obtain a driver log of a board device, and recursively extract the driver log according to a log structure of the driver log using a first extraction rule to obtain at least one first shared structured statement template;
[0061] a first variable factor generating module, configured to recursively extract the driver log based on the first shared structured statement template and using a second extraction rule to obtain at least one first variable factor corresponding to each of the first shared structured statement templates;
[0062] A parse tree generation module is used to generate a log parse tree corresponding to the driver log based on the first shared structured statement template and the first variable factor, so as to store the driver log according to the log parse tree.
[0063] In a third aspect, the present application discloses an electronic device, comprising:
[0064] Memory for storing computer programs;
[0065] The processor is used to load and execute the computer program to implement the aforementioned drive log management method.
[0066] In a fourth aspect, the present application discloses a computer program product, including a computer program / instruction, which implements the steps of the aforementioned drive log management method when executed by a processor.
[0067] In a fifth aspect, the present application discloses a computer-readable storage medium for storing a computer program; wherein the computer program implements the aforementioned drive log management method when executed by a processor.
[0068] The beneficial technical effects of the present application are as follows: through the first extraction rule, the common part shared by several strings with the same log structure in the driver log of the board device can be extracted to obtain the first shared structured statement template; then according to the first shared structured statement template, through the second extraction rule, the corresponding unique part of each log can be generated into a first variable factor; recursively drive the log to generate a log parsing tree. In this way, under the same conditions, that is, without increasing the computational complexity and expanding the hardware capacity, the storage quantity of the driver log is increased while not increasing the hardware cost. It greatly improves the memory utilization, saves the hardware cost, and also improves the user experience of using the driver log to locate the problem.
[0069] In addition, the present application provides a drive log management device, equipment, program product and medium, which correspond to the above-mentioned drive log management method and have the same effect as above. BRIEF DESCRIPTION OF THE DRAWINGS
[0070] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0071] Figure 1 A schematic diagram of UEFI log generation disclosed in this application;
[0072] Figure 2 A schematic diagram of storing UEFI logs in a circular queue disclosed in this application;
[0073] Figure 3 A schematic diagram of a UEFI log export process disclosed in this application;
[0074] Figure 4 A schematic diagram of a UEFI log export ring queue disclosed in this application;
[0075] Figure 5 A flow chart of a drive log management method disclosed in this application;
[0076] Figure 6 A schematic diagram of a UEFI log storage optimization algorithm disclosed in this application;
[0077] Figure 7 A schematic diagram of the structure of a drive log management device disclosed in this application;
[0078] Figure 8 This is a structural diagram of an electronic device disclosed in this application. DETAILED DESCRIPTION
[0079] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0080] First of all, in order to facilitate a better understanding of the present application, before introducing the present application, the technical background and current technology-related processes in the present application are explained.
[0081] Recording logs during the operation of the driver is a very important debugging and maintenance method. Board devices such as UEFI (Universal Extensible Firmware Interface) devices are important driver devices for computers. The driver log printing methods include direct printing to the serial port for output. Generally, the logs of the basic input and output system of UEFI are printed out through the serial port, and the device driver directly accesses the host serial port, which will confuse the device driver log with the host log printing, affecting the consistency of the host log. If the board device driver prints logs to the serial port, and the number and style of logs printed by different board device manufacturers are very different, it will be complicated for users to export or view the logs of the basic input and output system or a board device separately.
[0082] UEFI log output content format: add time, program running file name, function name, and line number at the beginning of each line to achieve quick query and positioning. The specific format is as follows.
[0083] \WinHost.exe
[0084] \WinHost.exp
[0085] \WinHost.1ib
[0086] \WinHost.map
[0087] WinHost.pdb
[0088] [2023 / 12 / 28 / 09:16:44][d:\code\edk2_test_1121\MdeModu1ePkg\Universa1\RaidHiiDriver\RaidContro11erMng. c]
[0089] [EnterUeriLogExportForm: 2706] [There may be some errors from paraconfig,Paral:-123,Para2:789, This is a test!!!];
[0090] Among them, each Log structure is divided into two parts: fixed part and variable part:
[0091] 1) Fixed part:
[0092] [Level][yyyy / mm / dd / hh:mm:ss][FileName][FunctionName:Line];
[0093] Level is the log level, which is divided into F (FATAL), E (ERROR), W (WRANING), I (INFO), and D (DEBUG) according to the priority from high to low;
[0094] yyyy / mm / dd / hh:mm:ss is year, month, day, hour, minute, second;
[0095] FileName is the file name where the current log is recorded;
[0096] FunctionName:Line is the function name and line number where the current log is recorded;
[0097] 2) Variable part:
[0098] User-defined variable string with format characters, for example:
[0099] [I][2024 / 02 / 20 / 15:12:36][RaidControllerMng.c] [GetControllerAttr:436]identify controller Buffer len:10324.
[0100] [I] [2024 / 02 / 20 / 15:12:36][RaidControllerMng.c] [GetControllerAttr:436] belongs to the fixed part, identify controller Buffer len:1032 belongs to the variable part.
[0101] At present, the more common processing method is to allocate a ring queue buffer area for each board device on the host side during the board device driver initialization phase, such as Figure 1The following is a schematic diagram of UEFI log generation. The Log interface UEFI_LOG is called, and the Error Level log level is configured in combination with the UEFI interface options to filter whether the current log is stored in the queue. If the log is recorded, it is stored in the circular queue, otherwise the process ends, and the driver log of the corresponding board device is stored in the circular queue buffer area. Figure 2 The following is a schematic diagram of storing UEFI logs in a circular queue. The current state of the queue determines whether circular overlay storage is required. First, get the queue, and then determine whether the queue is empty. If it is empty, create a queue first. Otherwise, determine whether the queue is full. If it is, perform the Dequeue operation, that is, delete an element from the circular queue. If it is successfully deleted, it returns true. Otherwise, perform the Enqueue operation, that is, insert an element into the circular queue. If it is successfully inserted, it returns true. Figure 3 The following is a schematic diagram of the UEFI log export process. During the board device driver operation phase, the board device driver log is output to the corresponding circular queue buffer. First, the log storage path and file name are obtained; then, it is determined whether there is a log file with the same name. If so, data is obtained from the circular queue; otherwise, it is also necessary to determine whether to overwrite the original file. Only after the original file is overwritten can data be obtained from the circular queue; finally, a log file is generated. Figure 4 The figure shows the schematic diagram of the UEFI log export circular queue. When reading the circular queue elements, it is important to note that each time the queue is read to the end, the head position needs to be restored. Otherwise, the next generated file data will be lost. The process starts by getting the queue head, judging whether the queue head is empty, and writing the log file if it is not empty; then the corresponding operations are performed on the elements behind the queue in turn until the process ends when the queue is empty.
[0102] From the above process, we can know that storing the Log data in a circular queue can ensure that part of the log is recorded, but the board device generally has limited storage resources, and the effective information recorded is very limited, which undoubtedly increases the difficulty of problem location. Increasing the storage space of the board device undoubtedly increases the hardware cost.
[0103] To this end, the present application provides a driver log management solution that can store as many driver logs as possible without increasing additional storage space.
[0104] The embodiment of the present invention discloses a drive log management method, see Figure 5 As shown, the method includes:
[0105] Step S11: Acquire a driver log of a board device, and recursively extract the driver log using a first extraction rule according to a log structure of the driver log to obtain at least one first shared structured statement template.
[0106] The board device is an important driver device of the computer. By recording the driver log generated when its driver is running, the operation status of the driver of the board device can be better understood, thereby helping developers track problems, analyze performance, and maintain equipment. In a specific implementation, the UEFI device in the board device is used as an example for illustration, which is suitable for scenarios where the UEFI storage space is very limited, but a sufficient number of logs are required for problem recovery. Specifically, the driver log of the unified extensible firmware interface device is obtained, and according to the log structure of the driver log, the driver log is recursively extracted using the first extraction rule to obtain at least one first shared structured statement template. It can be understood by those of ordinary skill in the art that the UEFI device is only for illustration and does not limit the type of the above-mentioned board device. The following embodiments are all described by taking the UEFI device as an example, and will not be repeated later.
[0107] In the embodiment of the present application, the UEFI Log data may include multiple types of log structures. Therefore, for different types of log structures, the driver log is recursively extracted using the first extraction rule to obtain shared structured statement templates corresponding to the extracted log structures.
[0108] Specifically, the driver logs with the same log structure in the driver log are obtained, and the driver logs with the same log structure are divided into a group to obtain at least one target driver log; the target driver logs are extracted respectively using the first extraction rule to obtain the target shared structured statement template corresponding to the target driver log; the first shared structured statement template is determined according to the target shared structured statement template. It can be seen that the driver logs with the same structure are divided into a group as target driver logs. It can be understood that the target driver log may include one driver log or multiple driver logs, depending on the actual scenario. That is, the log structure of one or more driver logs in a target driver log is the same. After all the driver logs with the same structure are divided and extracted, the at least one first shared structured statement template is jointly determined by the respective target shared structured statement templates corresponding to each target driver log, so as to realize the recursive extraction of the template.
[0109] It should be pointed out that when the first extraction rule is used to recursively extract the driver log, the common part shared by several strings with the same log structure in the UEFI Log data is extracted to generate a shared structured statement template.
[0110] Specifically, the character string to be identified in the target drive log is obtained; the character string to be identified is identified to extract the common part in the character string to be identified; and the target shared structured statement template is generated using the common part. It can be seen that the character string in the drive log is identified, the common part in each target drive log is identified, and the common part is used as a template to realize the generation of the target shared structured statement template.
[0111] Step S12: Based on the first shared structured statement templates, recursively extract the driver log using a second extraction rule to obtain at least one first variable factor corresponding to each of the first shared structured statement templates.
[0112] It can be seen from step S11 that the first shared structured statement template may include templates extracted from multiple log structures. Therefore, in the embodiment of the present application, based on the first shared structured statement template, the driver log is recursively extracted using the second extraction rule to obtain at least one first variable factor corresponding to each of the first shared structured statement templates. Specifically, the process may include: based on the target shared structured statement template, the target driver log is recursively extracted using the second extraction rule to obtain at least one target variable factor corresponding to each of the target driver logs; when all the target shared structured statement templates in the first shared structured statement template are extracted, the first variable factor is determined according to the target variable factor.
[0113] That is, for a target shared structured statement template extracted from a certain log structure, recursively extract the corresponding target driver log to obtain at least one corresponding target variable factor. After the driver logs corresponding to all target shared structured statement templates are extracted, the first variable factor is jointly determined using the respective target variable factors corresponding to each target shared structured statement template.
[0114] It should be pointed out that the variable factor Mutant is a unique part of each log in a string of several logs with the same log structure in the UEFI Log data. Therefore, the process of recursively extracting the target drive logs respectively using the second extraction rule to obtain at least one target variable factor corresponding to each of the target drive logs specifically includes: obtaining the string to be identified in the target drive log; identifying the string to be identified to extract the unique part in the string to be identified; and generating the target variable factor using the unique part. It can be seen that the character string in the driver log is identified, the unique part in each target driver log is identified, and the unique part is used as the target variable factor corresponding to the target shared structured statement template to achieve the generation of the target variable factor.
[0115] As shown in the text format below, after optimization using the present invention, 5 complete logs are extracted into 1 Template and 4 groups of Mutants.
[0116] [I][2024 / 02 / 20 / 15:12:45][RaidControllerMng.c][UpdateControllePrivateData:808]PrivateData->NvmePassThru:6D106228 BufferLen:156 TIvLen:16;
[0117] [I][2024 / 02 / 20 / 15:12:45][RaidControllerMng.c][UpdateControllePrivateData:808]PrivateData->NvmePassThru:6D106E22 BufferLen:328 TlvLen:28;
[0118] [I][2024 / 02 / 20 / 15:12:51][RaidControllerMng.c][UpdateControllePrivateData:808]PrivateData->NvmePassThru:6D106A22 BufferLen:204 TlvLen:64;
[0119] [I][2024 / 02 / 20 / 15:12:54][RaidControllerMng.c][UpdateControllePrivateData:808]PrivateData->NvmePassThru:6D106334 BufferLen:778 TlvLen:32;
[0120] [I][2024 / 02 / 20 / 15:12:56][RaidControllerMng.c][UpdateControllePrivateData:808]PrivateData->NvmePassThru:6D106673 BufferLen:234 TlvLen:24;
[0121] Template:
[0122] [I][2024 / 02 / 20 / 15:12:*]][RaidControllerMng.c][UpdateControllePrivateData:808]PrivateData->NvmePassThru:<*>BufferLen:<*>TlvLen:<*>;
[0123] Mutant; 1) 45, 45, 51, 54, 56;
[0125] 2) 6D106228, 6D106E22, 6D106A22, 6D106334, 6D106673; 3) 156, 328, 204, 778, 234; 4) 16, 28, 64, 32, 24;
[0128] It can be seen that "[I][2024 / 02 / 20 / 15:12:*]][RaidControllerMng.c][UpdateControllePrivateData:808]PrivateData->NvmePassThru:<*>BufferLen:<*>TlvLen:<*>" is a Template, where "*" is a different part in each Log. The 4 groups of Mutants are: 1) 45, 45, 51, 54, 56; 2) 6D106228, 6D106E22, 6D106A22, 6D106334, 6D106673; 3) 156, 328, 204, 778, 234; 4) 16, 28, 64, 32, 24.
[0129] Step S13: generating a log parsing tree corresponding to the driver log based on the first shared structured statement template and the first variable factor, so as to store the driver log according to the log parsing tree.
[0130] In the embodiment of the present application, the first extraction rule is used to recursively extract the driver log, so that the corresponding templates can be extracted for all logs; the second extraction rule is used to recursively extract the driver log, so that the variable factors corresponding to all templates can be extracted, and the variable factors can no longer be subdivided and extracted to generate other variable factors. Therefore, after the recursive extraction of the driver log is completed, a "log parsing tree" can be generated, and the driver log is stored according to the log parsing tree. In this way, under the same conditions, the memory utilization rate is greatly improved, the hardware cost is saved, and the user experience of using UEFI Log to locate problems is also improved.
[0131] The present application provides a driver log management method, comprising: obtaining a driver log of a board device, and recursively extracting the driver log using a first extraction rule according to a log structure of the driver log to obtain at least one first shared structured statement template; based on the first shared structured statement template, recursively extracting the driver log using a second extraction rule to obtain at least one first variable factor corresponding to each of the first shared structured statement templates; generating a log parsing tree corresponding to the driver log based on the first shared structured statement template and the first variable factor, so as to store the driver log according to the log parsing tree.
[0132] The beneficial technical effects of the present application are as follows: through the first extraction rule, the common part shared by several strings with the same log structure in the driver log of the board device can be extracted to obtain the first shared structured statement template; then according to the first shared structured statement template, through the second extraction rule, the corresponding unique part of each log can be generated into a first variable factor; recursively drive the log to generate a log parsing tree. In this way, under the same conditions, that is, without increasing the computational complexity and expanding the hardware capacity, the storage quantity of the driver log is increased while not increasing the hardware cost. It greatly improves the memory utilization, saves the hardware cost, and also improves the user experience of using the driver log to locate the problem.
[0133] Based on the above embodiment, this embodiment will specifically explain S11 in the above embodiment. In order to realize recursive extraction of the driver log, the process of recursively extracting the driver log using the first extraction rule to obtain at least one first shared structured statement template may include the following steps:
[0134] Acquire a second shared structured statement template; the second shared structured statement template includes all currently obtained shared structured statement templates;
[0135] Acquire a current drive log, and determine the similarity between the current drive log and the to-be-compared shared structured statement template in the second shared structured statement template to obtain a similarity comparison result;
[0136] Based on the similarity comparison result, at least one of the first shared structured statement templates is obtained.
[0137] In an embodiment of the present application, for the log parsing tree finally generated, the data input node of the log parsing tree can be a section of the log in the UEFI Log file obtained in sequence as input. In the process of determining at least one first shared structured statement template finally obtained, first obtain all the currently obtained shared structured statement templates, and the shared structured statement template is the second shared structured statement template. Secondly, for the input current driver log, the similarity comparison result is obtained by comparing the current input log with each template in the second shared structured statement template in turn; finally, according to the similarity comparison result, the current driver log is directly classified into the second shared structure template, or it is newly added as a shared structured statement template and then classified into the second shared structure template. When all driver logs have completed template extraction, all templates contained in the current second shared structured statement template correspond to at least one of the first shared structured statement templates.
[0138] In a feasible implementation, a threshold management interface is pre-constructed, and the log similarity threshold is obtained through the threshold management interface. It should be pointed out that the log similarity threshold can be manually set through the threshold management interface, or a ready-made log similarity threshold can be directly obtained, for example, a reliable log similarity threshold is generated by a training model. Furthermore, judging the similarity between the current drive log and the shared structured statement template to be compared in the second shared structured statement template to obtain a similarity comparison result may include the following steps: determining the similarity between the current drive log and the shared structured statement template to be compared in the second shared structured statement template, and comparing the similarity with the log similarity threshold to obtain a similarity comparison result.
[0139] It can be seen that by comparing the current drive log with the shared structured statement template to be compared in the second shared structured statement template, the similarity between the two is obtained, and then the similarity is compared with the obtained log similarity threshold to obtain a similarity comparison result.
[0140] In a specific implementation, if the similarity is not less than the log similarity threshold, the current driver log is extracted using the first extraction rule to obtain the corresponding current shared structured statement template, and the current shared structured statement template is included in the shared structured statement template to be compared. It can be understood that for the similarity comparison result obtained by comparison, if the similarity between the two is greater than or equal to the log similarity threshold, it means that the two are very similar and more common parts can be extracted. Therefore, the corresponding template extracted from the current driver log can be classified as the shared structured statement template to be compared with it for similarity comparison. That is, the template extracted from the current driver log and the shared structured statement template to be compared are the same template.
[0141] In another specific implementation, if the similarity is less than the log similarity threshold, the current shared structured statement template is used as a newly added shared structured statement template, and the newly added shared structured statement template is included in the second shared structured statement template. It can be understood that for the similarity comparison result obtained by comparison, if the similarity between the two is less than the log similarity threshold, it means that there is a large difference between the current driver log and the shared structured statement template to be compared, and the template extracted from the current driver log cannot be classified into the shared structured statement template to be compared. Therefore, when all the shared structured statement templates to be compared in the second shared structured statement template do not satisfy that the similarity between the two is not less than the log similarity threshold, the current shared structured statement template extracted from the current driver log is added as a new Template, added to the second shared structured statement template to continue subsequent comparisons with other driver logs.
[0142] It can be understood that after all the driver logs are extracted using the first extraction rule, at least one of the first shared structured statement templates is obtained according to the current second shared structured statement template.
[0143] For example, Figure 6The figure shows a flow diagram of a storage optimization algorithm for UEFI log implementation corresponding to the present invention. After the process starts, data input is performed, and its input node is a section of log in the UEFI Log file. Wherein, i represents the i-th template, and a section of log in the UEFI Log file is taken as input in sequence. In fact, this layer does not occupy the storage memory of the generated log parsing tree, but is listed only for the convenience of analysis. Wherein, Ns represents the total number of nodes of the "log parsing tree", and each log is compared with the i-th template on the log parsing tree for similarity, TD is the set UEFI log similarity threshold; TDi is the similarity between each log and the i-th template on the log parsing tree. When TDi is greater than or equal to TD, the i-th log is classified into the i-th template Template; when TDi is less than TD, the i-th log is added as a new template Template. Furthermore, the variable factor Mutant is recursively extracted for the template, and the corresponding variable group is added until the Mutant can no longer be generated, thereby generating a "log parsing tree". The log parsing tree is a UEFI log storage tree structure generated after optimization using the log storage optimization algorithm corresponding to the present invention.
[0144] Based on the above embodiment, this embodiment will specifically explain S12 in the above embodiment. In order to achieve recursive extraction of variable factors until no more variable factors can be generated, the target drive logs are recursively extracted using the second extraction rule to obtain at least one target variable factor corresponding to each target drive log, and the following steps may also be included:
[0145] Taking the target variable factor as the current variable factor, and extracting the current variable factors in sequence using the first extraction rule to obtain at least one third shared structured statement template;
[0146] Based on the third shared structured statement template, the current variable factors are sequentially extracted using the second extraction rule to obtain at least one second variable factor corresponding to each of the third shared structured statement templates;
[0147] A variable group corresponding to the current variable factor is generated based on the third shared structured statement template and the second variable factor.
[0148] In the embodiment of the present application, the second extraction rule is used to recursively extract the driver log, which can not only extract the variable factors corresponding to all templates, but also generate other variable factors when the variable factors cannot be further subdivided and extracted.
[0149] It can be understood that the target variable factor is a variable factor obtained by extracting the target drive log corresponding to the target shared structured statement template, and there is a situation where the Mutant can be further subdivided to generate a Template. For example, for the Mutant 1) obtained in the above embodiment, 45 and 45 can extract the template to change it to "4*"; 51 and 54 can extract the template to change it to "5*". Therefore, in the process of recursively extracting and determining the final first variable factor for each target variable factor, the target variable factor is first used as the current variable factor, and then the common part of the target variable factor is extracted to obtain the corresponding template. That is, the current variable factor is extracted in sequence using the first extraction rule to obtain at least one third shared structured statement template. Secondly, based on the same process, the variable factor is extracted from the Mutant again; finally, a variable group of the variable factor is generated, and the variable group is to continue to recursively extract the current variable factor and subdivide the Mutant to generate a Template until the variable group of the Mutant can no longer be generated.
[0150] It can be understood that, after all the target shared structured statement templates in the first shared structured statement template are extracted, the first variable factor is determined according to the target variable factor and the variable group.
[0151] It should be noted that, in the process of further subdividing and extracting the current variable factor, whether to stop extracting the current variable factor is determined by judging whether the second variable factor obtained is a variable factor of the minimum granularity. When the second variable factor cannot be extracted using the first extraction rule, the second variable factor is determined to be a variable factor of the minimum granularity.
[0152] In a specific implementation, if the second variable factor is the variable factor of the minimum granularity, the step of generating a variable group corresponding to the current variable factor based on the third shared structured statement template and the second variable factor is triggered. It can be seen that if the second variable factor cannot be further subdivided, the variable group corresponding to the current variable factor can be determined according to the current subdivision result.
[0153] In another specific implementation, if the second variable factor is not the variable factor of the minimum granularity, the second variable factor is determined as the current variable factor, and then the step of extracting the current variable factor in sequence using the first extraction rule is triggered. It can be seen that if the second variable factor can be further subdivided, the subdivision is continued until the second variable factor can no longer be subdivided.
[0154] Based on the above embodiment, in a feasible implementation, in order to quickly generate a log parsing tree, the generated template and variable factors are identified in the embodiment of the present application. Specifically, after recursively extracting the driver log using the first extraction rule to obtain at least one first shared structured statement template, the following steps may also be included:
[0155] Generating primary identification information corresponding to each of the first shared structured statement templates;
[0156] Correspondingly, after recursively extracting the driver log using the second extraction rule to obtain at least one first variable factor corresponding to each of the first shared structured statement templates, the method further includes:
[0157] Secondary identification information corresponding to each of the first variable factors is generated according to the primary identification information.
[0158] In an embodiment of the present application, in order to facilitate a more intuitive generation of a log parse tree, the data of the log parse tree is managed, and first-level identification information corresponding to each of the first shared structured statement templates is generated. That is, for each template, it can be identified accordingly to distinguish each template. Similarly, for the generated first variable factor, corresponding second-level identification information can also be generated. It can be understood that the second-level identification information is for the first-level identification information, and is used to distinguish which template corresponds to the variable factor. For example, for the first shared structured statement template with the first-level identification information of 1, 1-1 is the first variable factor under the first shared structured statement template with the first-level identification information of 1.
[0159] Furthermore, after generating identification information of all templates and variable factors, the first shared structured statement template and the first variable factor are used as nodes in the log parsing tree, and corresponding node positions are assigned to the first shared structured statement template and the first variable factor according to the first-level identification information and the second-level identification information; based on the node position, a log parsing tree corresponding to the driver log is generated using the first shared structured statement template and the first variable factor, so as to store the driver log according to the log parsing tree.
[0160] The following uses a log segment from the UEFI Log file as input to explain the specific generation process of the "log parsing tree". The generation of the parsing tree is divided into 5 steps from top to bottom. The specific process includes the following steps:
[0161] Step 1: For the data input node of the log parsing tree, take a section of the log in the UEFI Log file as input. This layer does not actually occupy the storage memory of the parsing tree, but is listed for the convenience of analysis.
[0162] Step 2: Template all input logs for the first time, generating 3 groups of 3 templates respectively;
[0163] Step 3: Based on the three groups of three templates in Step 2, generate the mutants of each template, such as 1-1, 1-2, 1-3, etc.
[0164] Step 4: Use each mutant in Step 3 as input, continue to Template, and generate 3 groups of 9 Templates such as 2*, 209*, PrivateData->NvmePassThru:6D106***;
[0165] Step 5: Based on the three groups of nine templates in Step 4, generate the mutants of each template, such as 1-1-1, 1-2-1, 1-3-1, etc.
[0166] It is understandable that, because the mutant generated in Step 5 is already the mutant with the smallest granularity, the common template cannot be extracted any further, so the recursion ends.
[0167] After the above analysis, the final generated log parsing tree can be obtained. Furthermore, for the log storage method before and after the calculation optimization, the memory consumption before optimization is 682 bytes. Without affecting the accuracy, the traditional method of directly pushing the log into the ring queue without processing is optimized to generate a "log parsing tree". After optimization, the memory occupied is 260 bytes, saving 38% of the memory, and the effect is still very obvious. Without increasing the calculation complexity and expanding the hardware capacity, the storage efficiency of the log is improved.
[0168] Correspondingly, the present application embodiment also discloses a drive log management device, see Figure 7 As shown, the device comprises:
[0169] The first template generation module 11 is used to obtain a driver log of a board device, and recursively extract the driver log according to a log structure of the driver log using a first extraction rule to obtain at least one first shared structured statement template;
[0170] A first variable factor generating module 12, configured to recursively extract the driver log based on the first shared structured statement template using a second extraction rule to obtain at least one first variable factor corresponding to each of the first shared structured statement templates;
[0171] The parse tree generation module 13 is used to generate a log parse tree corresponding to the driver log based on the first shared structured statement template and the first variable factor, so as to store the driver log according to the log parse tree.
[0172] Among them, for more specific working processes of the above-mentioned modules, please refer to the corresponding contents disclosed in the aforementioned embodiments, which will not be repeated here.
[0173] It can be seen that through the above scheme of this embodiment, this includes: obtaining the driver log of the board device, and according to the log structure of the driver log, recursively extracting the driver log using the first extraction rule to obtain at least one first shared structured statement template; based on the first shared structured statement template, recursively extracting the driver log using the second extraction rule to obtain at least one first variable factor corresponding to each of the first shared structured statement templates; generating a log parsing tree corresponding to the driver log based on the first shared structured statement template and the first variable factor, so as to store the driver log according to the log parsing tree.
[0174] The beneficial technical effects of the present application are as follows: through the first extraction rule, the common part shared by several strings with the same log structure in the driver log of the board device can be extracted to obtain the first shared structured statement template; then according to the first shared structured statement template, through the second extraction rule, the corresponding unique part of each log can be generated into a first variable factor; recursively drive the log to generate a log parsing tree. In this way, under the same conditions, that is, without increasing the computational complexity and expanding the hardware capacity, the storage quantity of the driver log is increased while not increasing the hardware cost. It greatly improves the memory utilization, saves the hardware cost, and also improves the user experience of using the driver log to locate the problem.
[0175] In a specific implementation, the first template generating module 11 is specifically used to:
[0176] A driver log of a unified extensible firmware interface device is obtained, and according to a log structure of the driver log, the driver log is recursively extracted by using a first extraction rule to obtain at least one first shared structured statement template.
[0177] In a specific implementation, the first template generating module 11 includes:
[0178] A structure division module, used for obtaining driver logs with the same log structure from the driver logs, and dividing the driver logs with the same log structure into a group to obtain at least one target driver log;
[0179] A first extraction module, configured to extract the target drive logs respectively by using a first extraction rule to obtain a target shared structured statement template corresponding to the target drive log;
[0180] The first template generating unit is configured to determine the first shared structured statement template according to the target shared structured statement template.
[0181] In a specific implementation, the first template generating module 11 includes:
[0182] A first character string acquisition module, used to acquire a character string to be identified in the target drive log;
[0183] A first string recognition module, used for recognizing the string to be recognized to extract a common part of the string to be recognized;
[0184] The second template generating module is used to generate the target shared structured statement template by using the common part.
[0185] In a specific implementation, the first template generating module 11 includes:
[0186] A template acquisition module, used to acquire a second shared structured statement template; the second shared structured statement template includes all currently acquired shared structured statement templates;
[0187] a similarity comparison module, configured to obtain a current drive log, and determine a similarity between the current drive log and a to-be-compared shared structured statement template in the second shared structured statement template to obtain a similarity comparison result;
[0188] The second template generating unit is used to obtain at least one of the first shared structured sentence templates based on the similarity comparison result.
[0189] In a specific implementation, the drive log management device further includes:
[0190] An interface management module, used to pre-build a threshold management interface and obtain a log similarity threshold through the threshold management interface;
[0191] Accordingly, the similarity comparison module is specifically used for:
[0192] The similarity between the current drive log and the shared structured statement template to be compared in the second shared structured statement template is determined, and the similarity is compared with the log similarity threshold to obtain a similarity comparison result.
[0193] In a specific implementation, the second template generating unit is specifically used to:
[0194] If the similarity is not less than the log similarity threshold, extracting the current drive log using the first extraction rule to obtain a corresponding current shared structured statement template, and classifying the current shared structured statement template into the shared structured statement template to be compared;
[0195] If the similarity is less than the log similarity threshold, the current shared structured statement template is used as a newly added shared structured statement template, and the newly added shared structured statement template is included in the second shared structured statement template;
[0196] At least one of the first shared structured statement templates is obtained according to the second shared structured statement template.
[0197] In a specific implementation, the second template generating unit is specifically used to:
[0198] After all the driver logs are extracted using the first extraction rule, at least one of the first shared structured statement templates is obtained according to the current second shared structured statement template.
[0199] In a specific implementation, the first variable factor generating module 12 includes:
[0200] A second extraction module, configured to recursively extract the target drive logs based on the target shared structured statement template and using a second extraction rule to obtain at least one target variable factor corresponding to each of the target drive logs;
[0201] The first variable factor generating unit is configured to determine the first variable factor according to the target variable factor after all the target shared structured statement templates in the first shared structured statement template are extracted.
[0202] In a specific implementation, the first variable factor generating module 12 includes:
[0203] A second character string acquisition module, used to acquire a character string to be identified in the target drive log;
[0204] A second string recognition module, used for recognizing the string to be recognized to extract a unique part of the string to be recognized;
[0205] The second variable factor generating module is used to generate the target variable factor using the unique part.
[0206] In a specific implementation, the first variable factor generating module 12 further includes:
[0207] a recursive module, configured to use the target variable factor as a current variable factor, and sequentially extract the current variable factors using the first extraction rule to obtain at least one third shared structured statement template;
[0208] Based on the third shared structured statement template, the current variable factors are sequentially extracted using the second extraction rule to obtain at least one second variable factor corresponding to each of the third shared structured statement templates;
[0209] A variable group corresponding to the current variable factor is generated based on the third shared structured statement template and the second variable factor.
[0210] In a specific implementation, the first variable factor generating unit is specifically used to:
[0211] After all the target shared structured statement templates in the first shared structured statement template are extracted, the first variable factor is determined according to the target variable factor and the variable group.
[0212] In a specific implementation, the recursive module further includes:
[0213] A granularity determination module, used for determining whether the second variable factor is a variable factor of minimum granularity;
[0214] a first processing module, configured to trigger the step of generating a variable group corresponding to the current variable factor based on the third shared structured statement template and the second variable factor if the second variable factor is the variable factor of the minimum granularity;
[0215] The second processing module is used for determining the second variable factor as the current variable factor if the second variable factor is not the variable factor of the minimum granularity, and then triggering the step of extracting the current variable factors in sequence by using the first extraction rule.
[0216] In a specific implementation, the drive log management device further includes:
[0217] The minimum granularity variable factor determination module is used to determine that the second variable factor is the variable factor of the minimum granularity when the second variable factor cannot be extracted using the first extraction rule.
[0218] In a specific implementation, the drive log management device further includes:
[0219] A first identification generating module, configured to generate primary identification information corresponding to each of the first shared structured statement templates;
[0220] The second identification generating module is used to generate secondary identification information corresponding to each of the first variable factors according to the primary identification information.
[0221] In a specific implementation, the parse tree generation module 13 includes:
[0222] a node position allocation module, configured to use the first shared structured statement template and the first variable factor as nodes in the log parsing tree, and to allocate corresponding node positions to the first shared structured statement template and the first variable factor according to the first-level identification information and the second-level identification information;
[0223] A parse tree generating unit is used to generate a log parse tree corresponding to the driver log based on the node position by using the first shared structured statement template and the first variable factor, so as to store the driver log according to the log parse tree.
[0224] Furthermore, the present application also discloses an electronic device. Figure 8 This is a structural diagram of an electronic device 20 according to an exemplary embodiment, and the content in the diagram cannot be considered as any limitation on the scope of use of the present application.
[0225] Figure 8 A schematic diagram of the structure of an electronic device 20 provided in an embodiment of the present application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the drive log management method disclosed in any of the aforementioned embodiments. In addition, the electronic device 20 in this embodiment may specifically be a server.
[0226] In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.
[0227] In addition, the memory 22 as a carrier for resource storage may be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon may include an operating system 221, a computer program 222 and data 223, etc. The data 223 may include various data. The storage method may be temporary storage or permanent storage.
[0228] The operating system 221 is used to manage and control the hardware devices and computer program 222 on the electronic device 20, which can be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program that can be used to complete the drive log management method performed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 222 can further include a computer program that can be used to complete other specific tasks.
[0229] Furthermore, the embodiment of the present application also discloses a computer-readable storage medium, where the computer-readable storage medium includes a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a magnetic disk or an optical disk, or any other form of storage medium known in the technical field. Wherein, when the computer program is executed by the processor, the aforementioned drive log management method is implemented. For the specific steps of the method, reference can be made to the corresponding contents disclosed in the aforementioned embodiments, which will not be repeated here.
[0230] Furthermore, an embodiment of the present application also provides a computer program product, including a computer program / instruction, which implements any one of the above-mentioned drive log management methods when executed by a processor.
[0231] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0232] The steps of the drive log management method or algorithm described in conjunction with the embodiments disclosed herein can be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module can be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the technical field.
[0233] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0234] The above is a detailed introduction to a drive log management method, device, equipment, program product and medium provided by the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for a person skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A drive log management method, characterized in that: include: Acquire a driver log of a board device, and recursively extract the driver log using a first extraction rule according to a log structure of the driver log to obtain at least one first shared structured statement template; Based on the first shared structured statement template, recursively extract the driver log using a second extraction rule to obtain at least one first variable factor corresponding to each of the first shared structured statement templates; generating a log parsing tree corresponding to the driver log based on the first shared structured statement template and the first variable factor, so as to store the driver log according to the log parsing tree; The step of generating a log parsing tree corresponding to the driver log based on the first shared structured statement template and the first variable factor so as to store the driver log according to the log parsing tree includes: Using the first shared structured statement template and the first variable factor as nodes in the log parsing tree, and assigning corresponding node positions to the first shared structured statement template and the first variable factor according to the primary identification information and the secondary identification information; Based on the node position, generating a log parsing tree corresponding to the driver log by using the first shared structured statement template and the first variable factor, so as to store the driver log according to the log parsing tree; The first-level identification information is used to distinguish each of the first shared structured statement templates, and the second-level identification information is used to distinguish the first variable factors with respect to the first-level identification information.
2. The drive log management method according to claim 1, characterized in that: The step of obtaining a driver log of a board device and recursively extracting the driver log using a first extraction rule according to a log structure of the driver log to obtain at least one first shared structured statement template includes: A driver log of a unified extensible firmware interface device is obtained, and according to a log structure of the driver log, the driver log is recursively extracted by using a first extraction rule to obtain at least one first shared structured statement template.
3. The drive log management method according to claim 1, characterized in that: The step of recursively extracting the driver log according to the log structure of the driver log by using a first extraction rule to obtain at least one first shared structured statement template includes: Acquire driver logs having the same log structure from the driver logs, and divide the driver logs having the same log structure into a group to obtain at least one target driver log; The target drive logs are extracted respectively using the first extraction rule to obtain target shared structured statement templates corresponding to the target drive logs; The first shared structured statement template is determined according to the target shared structured statement template.
4. The drive log management method according to claim 3, characterized in that: The step of extracting the target drive logs respectively by using the first extraction rule to obtain target shared structured statement templates corresponding to the target drive logs includes: Obtaining a character string to be identified in the target drive log; Identify the character string to be identified to extract a common part of the character string to be identified; The target shared structured statement template is generated using the common portion.
5. The drive log management method according to claim 1, characterized in that: The recursive extraction of the driver log by using the first extraction rule to obtain at least one first shared structured statement template includes: Acquire a second shared structured statement template; the second shared structured statement template includes all currently obtained shared structured statement templates; Acquire a current drive log, and determine the similarity between the current drive log and the to-be-compared shared structured statement template in the second shared structured statement template to obtain a similarity comparison result; Based on the similarity comparison result, at least one of the first shared structured statement templates is obtained.
6. The drive log management method according to claim 5, characterized in that: Also includes: Pre-build a threshold management interface, and obtain the log similarity threshold through the threshold management interface; Correspondingly, the determining the similarity between the current drive log and the to-be-compared shared structured statement template in the second shared structured statement template to obtain a similarity comparison result includes: The similarity between the current drive log and the shared structured statement template to be compared in the second shared structured statement template is determined, and the similarity is compared with the log similarity threshold to obtain a similarity comparison result.
7. The drive log management method according to claim 6, characterized in that: The obtaining, based on the similarity comparison result, at least one of the first shared structured statement templates comprises: If the similarity is not less than the log similarity threshold, extracting the current drive log using the first extraction rule to obtain a corresponding current shared structured statement template, and classifying the current shared structured statement template into the shared structured statement template to be compared; If the similarity is less than the log similarity threshold, the current shared structured statement template is used as a newly added shared structured statement template, and the newly added shared structured statement template is included in the second shared structured statement template; At least one of the first shared structured statement templates is obtained according to the second shared structured statement template.
8. The drive log management method according to claim 7, characterized in that: The obtaining at least one of the first shared structured statement templates according to the second shared structured statement template comprises: After all the driver logs are extracted using the first extraction rule, at least one of the first shared structured statement templates is obtained according to the current second shared structured statement template.
9. The drive log management method according to claim 3, characterized in that: The recursive extraction of the driver log based on the first shared structured statement template using a second extraction rule to obtain at least one first variable factor corresponding to each of the first shared structured statement templates includes: Based on the target shared structured statement template, recursively extract the target drive logs respectively using a second extraction rule to obtain at least one target variable factor corresponding to each of the target drive logs; After all the target shared structured statement templates in the first shared structured statement template are extracted, the first variable factor is determined according to the target variable factor.
10. The drive log management method according to claim 9, characterized in that: The recursive extraction of the target drive logs by using the second extraction rule to obtain at least one target variable factor corresponding to each target drive log includes: Obtaining a character string to be identified in the target drive log; Identify the character string to be identified to extract a unique portion of the character string to be identified; The target variable factor is generated using the unique portion.
11. The drive log management method according to claim 9, characterized in that: After recursively extracting the target drive logs by using the second extraction rule to obtain at least one target variable factor corresponding to each target drive log, the method further includes: Taking the target variable factor as the current variable factor, and extracting the current variable factors in sequence using the first extraction rule to obtain at least one third shared structured statement template; Based on the third shared structured statement template, the current variable factors are sequentially extracted using the second extraction rule to obtain at least one second variable factor corresponding to each of the third shared structured statement templates; A variable group corresponding to the current variable factor is generated based on the third shared structured statement template and the second variable factor.
12. The drive log management method according to claim 11, characterized in that: After all the target shared structured statement templates in the first shared structured statement template are extracted, determining the first variable factor according to the target variable factor includes: After all the target shared structured statement templates in the first shared structured statement template are extracted, the first variable factor is determined according to the target variable factor and the variable group.
13. The drive log management method according to claim 11, characterized in that: After extracting the current variable factors in sequence based on the third shared structured statement template using the second extraction rule to obtain at least one second variable factor corresponding to each of the third shared structured statement templates, the method further includes: Determining whether the second variable factor is a variable factor of minimum granularity; If the second variable factor is the variable factor of the minimum granularity, triggering the step of generating a variable group corresponding to the current variable factor based on the third shared structured statement template and the second variable factor; If the second variable factor is not the variable factor of the minimum granularity, the second variable factor is determined as the current variable factor, and then the step of extracting the current variable factors in sequence by using the first extraction rule is triggered.
14. The drive log management method according to claim 13, characterized in that: Also includes: When the second variable factor cannot be extracted using the first extraction rule, the second variable factor is determined to be the variable factor of the minimum granularity.
15. The drive log management method according to any one of claims 1 to 14, characterized in that: After recursively extracting the driver log using the first extraction rule to obtain at least one first shared structured statement template, the method further includes: Generating primary identification information corresponding to each of the first shared structured statement templates; Correspondingly, after recursively extracting the driver log using the second extraction rule to obtain at least one first variable factor corresponding to each of the first shared structured statement templates, the method further includes: Secondary identification information corresponding to each of the first variable factors is generated according to the primary identification information.
16. A drive log management device, characterized in that: include: A first template generation module is used to obtain a driver log of a board device, and recursively extract the driver log according to a log structure of the driver log using a first extraction rule to obtain at least one first shared structured statement template; a first variable factor generating module, configured to recursively extract the driver log based on the first shared structured statement template and using a second extraction rule to obtain at least one first variable factor corresponding to each of the first shared structured statement templates; A parse tree generation module, configured to generate a log parse tree corresponding to the driver log based on the first shared structured statement template and the first variable factor, so as to store the driver log according to the log parse tree; Wherein, the parse tree generation module includes: a node position allocation module, configured to use the first shared structured statement template and the first variable factor as nodes in the log parsing tree, and allocate corresponding node positions to the first shared structured statement template and the first variable factor according to the primary identification information and the secondary identification information; A parse tree generating unit, configured to generate a log parse tree corresponding to the driver log based on the node position and using the first shared structured statement template and the first variable factor, so as to store the driver log according to the log parse tree; The first-level identification information is used to distinguish each of the first shared structured statement templates, and the second-level identification information is used to distinguish the first variable factors with respect to the first-level identification information.
17. An electronic device, characterized in that: include: Memory for storing computer programs; A processor, configured to load and execute the computer program to implement the drive log management method according to any one of claims 1 to 15.
18. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the steps of the drive log management method according to any one of claims 1 to 15 are implemented.
19. A computer-readable storage medium, characterized in that: Used to store computer programs; wherein the computer program, when executed by a processor, implements the drive log management method according to any one of claims 1 to 15.
