Abnormality processing method and electronic equipment
By obtaining log files and register information from storage devices and performing analysis and correlation analysis in conjunction with the program source code, the problem of inaccurate anomaly location in storage devices was solved, achieving fast and accurate anomaly location and improving user experience.
Patent Information
- Application Number
- CN202511429766.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-30
- Publication Date
- 2025-11-07
- Estimated Expiration
- 2045-09-30
AI Technical Summary
In existing technologies, when storage devices encounter abnormal problems during operation, it is difficult to quickly and accurately locate the cause of the abnormality, resulting in a decline in user experience and low efficiency in problem localization.
By obtaining log files and register information from storage devices, and combining this information with program source code analysis and correlation analysis, anomaly localization can be achieved.
It improves the accuracy and efficiency of anomaly localization, reduces loop closure time, and enhances user experience.
Smart Images

Figure CN120909832A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of electronics, and in particular to an exception processing method and an electronic device. BACKGROUND
[0002] With the continuous development of electronic technology, storage devices have been widely used in many fields. However, in some cases, the storage device may have some abnormal problems during operation, such as hardware failure, data loss, performance degradation, etc., which will affect the user's experience.
[0003] Therefore, how to accurately locate the abnormal problem to accurately inform the user of the cause of the abnormal problem is a problem to be solved. SUMMARY
[0004] The present application provides an exception processing method and an electronic device for accurately locating abnormal problems and timely informing users of the cause of the abnormal problem.
[0005] The present application provides an exception processing method, comprising: obtaining a target log file and register information generated by a target storage device master program and program source code obtained in the development environment of the master program; parsing the target log file to obtain a log parsing file; wherein the log parsing file includes error information in the target log file and a target exception cause, and the target exception cause is the cause of the error information in the target log file; correlation analysis of the log parsing file, the register information and the program source code to obtain an exception positioning result; performing a result feedback operation on the exception positioning result.
[0006] The present application also provides an exception processing device, comprising: an information acquisition unit for acquiring a target log file and register information generated by a target storage device master program and program source code obtained in the development environment of the master program; a log parsing unit for parsing the target log file to obtain a log parsing file; wherein the log parsing file includes error information in the target log file and a target exception cause, and the target exception cause is the cause of the error information in the target log file; a data analysis unit for correlation analysis of the log parsing file, the register information and the program source code to obtain an exception positioning result; a result feedback unit for performing a result feedback operation on the exception positioning result.
[0007] The present application also provides an electronic device, comprising: at least one processor; and a target storage device in communication connection with the at least one processor; wherein, the target storage device stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the steps of any of the above methods.
[0008] The application also provides a non-transitory computer-readable storage medium comprising computer instructions for causing a processor to perform the steps of any of the above methods.
[0009] The application also provides a computer program product comprising a computer program which, when executed by a processor, implements the steps of any of the above methods.
[0010] The application provides an exception handling method and an electronic device. By analyzing a target log file collected, a reason for the presence of error information in the target log file can be determined, so that a surface reason for an exception of a target storage device occurring in a running process is obtained. Then, by jointly analyzing a log analysis file, register information and program source code, detailed analysis can be performed at a program source code level, the code position at which an exception problem occurs can be quickly and accurately located, that is, the root cause of the exception problem can be accurately determined, the situation that the exception problem cannot be accurately located due to the inconsistency between the error information in the target log file and the program source code logic is reduced, the accuracy of exception location is improved, and the user experience is improved. Furthermore, by feeding back the exception location result, the user can quickly know the reason for the exception of the target storage device, the closed-loop time of the exception of the target storage device is maximally reduced, and the feedback efficiency of the problem location result is improved.
[0011] It should be understood that the content described in this part is not intended to identify key or important features of the embodiments of the present disclosure, nor is it used to limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description. BRIEF DESCRIPTION OF DRAWINGS
[0012] In order to more clearly illustrate the embodiments of the present application, the drawings required in the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor on the basis of these drawings.
[0013] Figure 1 A structural schematic diagram of an exception handling system provided by the embodiments of the present application; Figure 2A flowchart of an abnormality processing method provided by an embodiment of the present application is shown in FIG. 1. Figure 3 A flowchart of a log analysis method provided by an embodiment of the present application is shown in FIG. 2. Figure 4 A structure diagram of an abnormality processing device provided by an embodiment of the present application is shown in FIG. 3. DETAILED DESCRIPTION
[0014] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work fall within the protection scope of the present application.
[0015] It should be noted that, in the description of the present application, the terms “comprise”, “contain” or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device comprising a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such process, method, article or device. The terms “first”, “second” and the like in the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence.
[0016] In order for those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the drawings and specific embodiments.
[0017] In some embodiments, the electronic device can include a storage device (or memory) capable of storing the log files and other content generated by the electronic device. In the embodiments of the present application, the storage device can be a solid state disk (SSD). In other embodiments, the storage device can also be a hard disk drive (HDD) and the like, which is not limited in particular.
[0018] In other embodiments, the server can also include a storage device. The storage device can be used to store the log files and other content sent by the electronic device.
[0019] The above storage device will be described in detail below as an SSD.
[0020] It should be noted that, due to the complex internal structure of the SSD, the performance and reliability of the SSD can be affected by a variety of factors. The variety of factors can include hardware design, firmware algorithm, storage medium characteristics, etc. And, as the capacity of the SSD continues to increase and the application scenarios diversify, the internal storage management mechanism of the SSD is also becoming more and more complex, which can all cause problems in the running process of the SSD, thereby causing performance degradation or data loss. For example, the storage management mechanism can be garbage collection (GC), wear leveling, and bad block management of the SSD. Similarly, the master chip of the SSD can also have problems such as software defects or hardware failures when processing complex storage operations.
[0021] It can be understood that, if the SSD encounters the above abnormal problems, such as performance degradation, data loss, software defects, hardware failures, etc. during the running process, it can cause the SSD to be difficult to run stably, thereby affecting the user's use experience. Therefore, in order to be able to locate the abnormal problem in time to ensure that the SSD can run stably, the developer usually manually checks the problem in combination with the error log and the register information. That is, the abnormal problem is analyzed by human. In this way, the developer needs to spend a lot of time and effort to analyze the problem, which reduces the analysis efficiency of the abnormal problem, and in turn reduces the feedback efficiency of the problem positioning result. For example, when the SSD has an abnormal problem of performance degradation, the developer needs to check the log file line by line to find possible error codes or abnormal behaviors. In addition, the problem positioning result can be limited by the analysis experience of the developer, so that the developer cannot accurately judge the cause of the abnormal problem, that is, cannot accurately and quickly locate the abnormal problem.
[0022] And, the developer lacks a unified analysis process and tool, and the operation method and result of different developers can have differences, making it difficult to guarantee the consistency and accuracy of problem positioning. For example, different developers can use different analysis tools and methods, resulting in inconsistent diagnosis results for the same problem.
[0023] Therefore, in order to realize accurate positioning of abnormal problems and timely inform the user of the cause of the abnormal problem, the embodiment of the present application provides an abnormal processing method. In the method, the target log file generated by the main control program of the target storage device and the register information and the program source code obtained in the development environment of the main control program are obtained. Then, the target log file is parsed to obtain a log analysis file. The log analysis file includes error information in the target log file and a target abnormal cause, and the target abnormal cause is the cause of the error information in the target log file. Then, the log analysis file, the register information and the program source code are associated and analyzed to obtain an abnormal positioning result. Then, the abnormal positioning result is fed back.
[0024] In the embodiment of the present application, by analyzing the collected target log file, the cause of the error information in the target log file can be determined, so that the surface cause of the abnormality of the target storage device in the running process is obtained. Then, by jointly analyzing the log analysis file, the register information and the program source code, detailed analysis can be performed at the program source code level, the code position when the abnormal problem occurs can be quickly and accurately positioned, that is, the root cause of the abnormal problem can be accurately determined, the situation that the abnormal problem cannot be accurately positioned due to the inconsistency between the error information in the target log file and the program source code logic is reduced, the accuracy of abnormal positioning is improved, and the user's experience is improved. And by feeding back the abnormal positioning result, the user can quickly know the cause of the abnormality of the target storage device, the closed-loop time of the abnormality of the target storage device is minimized, and the feedback efficiency of the problem positioning result is improved.
[0025] In addition, by parsing the target log file and jointly analyzing the log analysis file, the register information and the program source code, the abnormal problem occurring in the running process of the target storage device and the cause of the abnormal problem can be obtained, and the abnormal positioning result is fed back. In this way, automatic analysis of abnormal problems can be realized, and developers do not need to manually analyze abnormal causes, which reduces labor costs and improves the analysis efficiency of abnormal causes and the accuracy of abnormal positioning.
[0026] In some examples, the electronic device in the embodiments of the present application can be a mobile phone, a tablet computer, a desktop computer, a laptop computer, a handheld computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a cellular phone, a personal digital assistant (PDA), an augmented reality (AR) \ virtual reality (VR) device, and the like, including a storage device and a display screen. The embodiments of the present application do not specially limit the specific form of the electronic device.
[0027] Figure 1 is a structural schematic diagram of an exception handling system in the embodiments of the present application.
[0028] As shown in Figure 1 , the exception handling system can include a log collection module, a log analysis module, a data correlation module, and a result feedback module.
[0029] The log collection module is configured to collect a target log file, register information, and program source code. The target log file can be automatically collected when the SSD host program generates the target log file, or can be collected when it is detected that the running state of the SSD has an exception, and the specific implementation is not limited. For example, the target log file can be collected by setting a hook function in the host program of the SSD. That is, if the SSD host program generates the target log file, the hook function will automatically trigger the log collection module to collect the target log file.
[0030] The register information can be automatically generated by the SSD host program, or can be read from the registers related to the SSD through a hardware debugging interface or a firmware interface. For example, the hardware debugging interface can be a JTAG interface. The firmware interface can be a SATA interface or an NVMe interface. The registers related to the SSD can include state registers, control registers, data registers, and the like. In some cases, the register information can be used to reflect the real-time running state of the SSD.
[0031] The program source code is the code content obtained from the development environment of the SSD host program. For example, the log collection module can obtain the latest version of the program source code from the development environment of the SSD host program through a version control system. For example, the version control system can be Git.
[0032] Correspondingly, after obtaining the program source code from the development environment of the SSD host program, the log collection module can download the obtained program source code to the local, so as to facilitate subsequent analysis of the log to be combined with the code logic for detailed analysis, thereby ensuring that the subsequent code location when the abnormal problem occurs can be quickly and accurately located.
[0033] The log analysis module is configured to analyze the target log file to obtain a log analysis file. The log analysis file can include error information in the target log file and a target abnormal reason. The target abnormal reason is a reason for the error information in the target log file. Specifically, the log analysis module can analyze the target log file by using a regular expression, a natural language processing (NLP) model, and a machine learning algorithm to obtain key log information. The key log information can include an error code, a register value, a timestamp, and the like. Then, the log analysis module can determine the log analysis file according to the key log information and a log analysis rule library.
[0034] The data correlation module is configured to correlate and analyze the log analysis file, the register information, and the program source code to obtain an abnormal positioning result. Specifically, the data correlation module can correlate the error information in the target log file with the program source code to obtain abnormal position information. The abnormal position information is used to represent a code location corresponding to the abnormality of the SSD. Then, the data correlation module can determine code content corresponding to the abnormal position information and annotation information of the code content from the program source code. The annotation information is used to indicate the purpose of the code content. Then, the data correlation module can analyze call stack information in the target log file to obtain an abnormal execution path. The abnormal execution path is an execution path when the SSD is abnormal. Then, the data correlation module can take register information corresponding to the error information in the register information as target register information. Then, the data correlation module can adjust the target register information according to a preset structure body format to obtain adjusted target register information. Then, the data correlation module can compare the adjusted target register information with the preset structure body format to obtain an information comparison result. The information comparison result includes register information that is different from the content of the preset structure body format. Then, the data correlation module can analyze the annotation information of the code content, the abnormal execution path, and the information comparison result by using a data analysis script to obtain the abnormal positioning result. The abnormal positioning result can include an abnormal problem occurring in the running process of the SSD and a reason for the abnormal problem of the SSD.
[0035] The result feedback module is configured to perform a result feedback operation on the abnormality positioning result. The abnormality positioning result can further include an abnormality solution. In some embodiments, the result feedback module can display first feedback information. The first feedback information can include a time sequence graph of error information in the target log file, a change curve of register information corresponding to the error information in the register information, and / or an execution path graph of an error code in the target log file. In other embodiments, the result feedback module can display second feedback information and / or output the second feedback information through a preset voice output mode. The second feedback information includes the abnormality solution.
[0036] It should be noted that the execution subject of each module in the abnormality processing system described above can be an electronic device. That is, after the electronic device collects the target log file, the register information, and the program source code, the electronic device can directly analyze the target log file, and perform a correlation analysis on the analyzed log file (i.e., the log analysis file), the register information, and the program source code to obtain the abnormality positioning result. Then, the electronic device can perform a result feedback operation on the abnormality positioning result.
[0037] However, in some cases, the execution subject of the log analysis module and the data correlation module in the abnormality processing system described above can also be a server. The server and the electronic device are in communication connection. The server can be a single server, a server cluster, a distributed server, a centralized server, a cloud server, or a computer, and the specific type is not limited.
[0038] Specifically, after the electronic device collects the target log file, the register information, and the program source code, the electronic device can package and send the target log file, the register information, and the program source code to the server. Then, when the server receives the target log file, the register information, and the program source code sent by the electronic device, the server can analyze the target log file, and perform a correlation analysis on the analyzed log file, the register information, and the program source code to obtain the abnormality positioning result. Then, the server can send the abnormality positioning result to the electronic device. After receiving the abnormality positioning result sent by the server, the electronic device performs a result feedback operation on the abnormality positioning result.
[0039] In the following, the execution subject of the abnormality processing method is an electronic device, and the abnormality processing method and the electronic device according to the embodiments of the present disclosure will be described with reference to the accompanying drawings.
[0040] Figure 2 A flowchart of an abnormality processing method provided by the embodiments of the present disclosure is shown.
[0041] As shown in Figure 2 the method includes the following steps: S201, obtaining a target log file generated by a main program of the solid state disk and register information, and obtaining program source code in a development environment of the main program.
[0042] In some cases, the target log file can be automatically collected when the main program of the solid state disk generates the target log file. For example, the target log file can be collected by setting a hook function in the main program of the solid state disk. That is, if the main program of the solid state disk generates the target log file, the hook function triggers the electronic device to automatically collect the target log file.
[0043] In other cases, the target log file can also be collected when it is detected that the running state of the solid state disk is abnormal. That is, in the case where it is detected that the running state of the solid state disk is abnormal, the log file generated by the main program of the solid state disk can be automatically collected.
[0044] The register information can be automatically generated by the main program of the solid state disk, or can be read from the registers related to the solid state disk through a hardware debugging interface or a firmware interface. For example, the hardware debugging interface can be a JTAG interface. The firmware interface can be a SATA interface or an NVMe interface. The registers related to the solid state disk can include state registers, control registers, data registers, etc. In some cases, the register information can be used to reflect the real-time running state of the solid state disk.
[0045] The program source code is the code content obtained from the development environment of the main program of the solid state disk. For example, the electronic device can obtain the latest version of the program source code from the development environment of the main program of the solid state disk through a version control system. For example, the version control system can be Git.
[0046] In some embodiments, after obtaining the program source code from the development environment of the main program of the solid state disk, the electronic device can download the obtained program source code to the local, so as to combine the code logic for detailed analysis when analyzing the log in the future, thereby ensuring that the code position when the abnormal problem occurs can be quickly and accurately located in the future.
[0047] S202, parsing the target log file to obtain a log parsing file.
[0048] The log parsing file can include error information in the target log file and a target abnormal reason. The target abnormal reason is the reason for the error information in the target log file.
[0049] In some embodiments, as Figure 3As shown, the process of parsing the target log file can specifically include S2021-S2024: S2021, using a regular expression, a natural language processing model, and a machine learning algorithm, the target log file is parsed to obtain key log information.
[0050] The key log information can include error codes, register values, timestamps, etc. Optionally, the electronic device can store the key log information in a structured JSON format.
[0051] It should be noted that the electronic device can simultaneously input the target log file into the regular expression, the natural language processing model, and the machine learning algorithm to directly obtain the key log information. Alternatively, the electronic device can also input sequentially according to a preset input order. For example, the electronic device can first input the target log file into the regular expression, then input the target log file into the natural language processing model, and finally input the target log file into the machine learning algorithm to obtain the key log information.
[0052] Specifically, the electronic device inputs the target log file into the regular expression to obtain log information in the target log file corresponding to the preset log format. That is, the regular expression is used to match and extract log information (i.e. fixed format information) in the target log file corresponding to the preset log format. The preset log format can be error codes, timestamps, etc.
[0053] For example, the target log file includes 2025-08-01 12:34:56 [ERROR] Code: 0x1234 -Description: Invalid operation, the electronic device can obtain the error code 0x1234 and the timestamp 2025-08-01 12:34:56 through the regular expression.
[0054] Then, the electronic device inputs the target log file into the natural language processing model to obtain the key information in the target log file. That is, the natural language processing model is used to parse the natural language description in the target log file to extract the key information. The key information can be error description, operation context, etc. For example, the above example of the target log file is continued, the electronic device can obtain the error description Invalid operation through the natural language processing model.
[0055] Afterwards, the electronic device inputs the target log file into the machine learning algorithm to obtain a log detection result. The log detection result includes abnormal information in the target log file and a predicted potential problem. The abnormal information is information in the target log file that causes the SSD to be abnormal. The predicted potential problem is used to represent a possible reason for the SSD to be abnormal. That is, the machine learning algorithm is used to identify abnormal information in the target log file and predict a potential problem.
[0056] In some cases, the training process of the machine learning algorithm described above can include obtaining a log data set. The log data set can include a plurality of log files. Each log file can include at least one log feature and a true log label. The log feature can be an error code, a timestamp, a register value, etc. The true log label is used to indicate whether the log file will cause the SSD to be abnormal. Afterwards, for each log file, the electronic device can input at least one log feature into the pre-constructed machine learning algorithm to obtain a predicted log label. Afterwards, the electronic device can adjust the parameters of the pre-constructed machine learning algorithm according to the predicted log label and the true log label to obtain a trained machine learning algorithm.
[0057] S2022, the log parsing rule in the log parsing rule library that is adapted to the key log information is taken as a target log parsing rule.
[0058] Specifically, after obtaining the key log information described above, the electronic device can determine a target log parsing rule according to the key log information and a log parsing rule library. The log parsing rule library can include device information of a plurality of solid state disks and a parsing rule set for each device information. The device information of the solid state disk can include a device model and a firmware version of the solid state disk. That is, the device model and the firmware version of the same solid state disk correspond to a parsing rule set. The parsing rule set includes at least one parsing rule, and the parsing rule includes at least one parameter mode and an abnormal reason corresponding to the at least one parameter mode.
[0059] In the embodiments of the present application, it is considered that the same parameter mode can have different meanings in solid state disks of different device models and / or firmware versions. For example, the code "0x0001" means a read-write error in a first firmware version, but means a temperature warning in a second firmware version. Therefore, the electronic device can take the device model and the firmware version of the solid state disk as a unique index key, that is, determine the corresponding parsing rule set through the device model and the firmware version of the solid state disk. In this way, it can reduce the occurrence of a situation where the success rate of rule matching is reduced due to single information matching the parsing rule, reduce the occurrence of a situation where the parsing rule is incorrectly matched, and improve the accuracy and flexibility of log parsing.
[0060] Exemplarily, the parameter patterns can include an error code pattern, a timestamp pattern, a register pattern, a call stack pattern, a log level pattern, and the like. The error code pattern is used to match error codes in the target log file. The timestamp pattern is used to match timestamps in the target log file. The register pattern is used to match register information in the target log file. The call stack pattern is used to match call stack information in the target log file. The log level pattern is used to match log levels in the target log file. For example, the log levels can be ERROR, WARNING, INFO, and the like.
[0061] It should be noted that if the device models of the solid state disks are the same, but the parameter pattern difference between the new firmware version and the old firmware version of the device model meets the first preset condition, the electronic device can directly call the remaining parameter patterns except the parameter pattern difference from the parsing rule set of the old firmware version as the parsing rule set of the new firmware version, and add the parameter pattern that exists difference to the parsing rule set of the new firmware version. That is, the parsing rule set of the new firmware version can only update the parameter pattern that exists difference. In this way, the update redundancy can be reduced, and the updating efficiency of the parsing rule set can be improved.
[0062] The parameter pattern difference meeting the first preset condition can include that the number of parameter patterns that exist difference between the new firmware version and the old firmware version is less than a first preset number, and / or the ratio between the number of parameter patterns and the total number of parameter patterns is less than a first preset ratio.
[0063] In an implementation manner, the log parsing rule library can be manually updated by a user. Specifically, the electronic device can automatically check the format of the parsing rules in the new rule package uploaded by the user, and add the parsed rules to the log parsing rule library. The new rule package can include the device model of the solid state disk, the firmware version of the device model, and the mapping relationship between the parsing rules.
[0064] In another implementation manner, the log parsing rule library can also be automatically updated by the electronic device. Specifically, the electronic device can obtain the parsing rules of new device models and / or new firmware versions from the rule server of the SSD every interval of a preset time. Then, the obtained parsing rules are added to the log parsing rule library. The preset time can be pre-set according to actual needs, and the specific value is not limited. It should be noted that the encryption verification needs to be performed before adding the parsing rules. In this way, the situation of malicious rule injection can be reduced, and the accuracy of adding the parsing rules can be improved.
[0065] In the embodiments of the present application, the log analysis rule library can be updated in time by the user manually updating the log analysis rule library and the electronic device automatically updating the log analysis rule library, thereby reducing the situation that the iteration efficiency of the log analysis rule library is low due to the need to redevelop the analysis rules after the release of new device models and / or new firmware versions, and improving the iteration efficiency of the log analysis rule library, thereby providing a convenient condition for subsequent accurate determination of the target abnormal reason.
[0066] In another implementation manner, the log analysis rule library can also be obtained by optimizing the rules with differences in results according to the rule matching results and the manual matching results. The rule matching results are the matching results of the target log file and the analysis rules in the log analysis rule library. The manual matching results are the matching results obtained by manually analyzing the target log file.
[0067] Specifically, in the case that the parameter mode difference between the rule matching results and the manual matching results meets the second preset condition, the electronic device can record the comparison results between the rule matching results and the manual matching results, and adjust the weights corresponding to the parameter modes between the rule matching results and the manual matching results in combination with the weight value confirmed by the human. The parameter mode difference meeting the second preset condition can include that the number of parameter modes with differences between the rule matching results and the manual matching results is greater than a second preset number, and / or the ratio between the number of parameter modes and the total number of parameter modes is greater than a second preset ratio.
[0068] For example, in the case that the comparison results between the rule matching results and the manual matching results are that the error code mode matching is correct but the register mode matching is incorrect, the electronic device can increase the weight of the error code mode and decrease the weight of the register mode.
[0069] In some cases, the electronic device can take the log analysis rules in the log analysis rule library that are adapted to the key log information as target log analysis rules. Specifically, the determination process of the target log analysis rules can specifically include that the electronic device can take the set of analysis rules in the log analysis rule library that match the device information of the solid state disk as a target analysis rule set. Then, the electronic device can match the key log information with the preset log scoring standard to obtain at least one matching score corresponding to each parameter mode in the key log information. The preset log scoring standard includes a plurality of matching standards under different parameter modes.
[0070] In an example, taking the parameter mode as an example of the error code mode, if the error codes in the key log information are all the same as the preset codes, the electronic device can determine the score of the error codes in the key log information as 10 points. If the error codes in the key log information are only the same as the prefix part of the preset codes, the electronic device can determine the score of the error codes in the key log information as 5 points. If the error codes in the key log information are not the same as the preset codes, the electronic device can determine the score of the error codes in the key log information as 0 points. For example, the preset codes can be 0x0003, and the prefix part of the preset codes is 0x000.
[0071] In another example, taking the parameter mode as an example of the register mode, if the register addresses and values in the key log information are all the same as the preset register information, the electronic device can determine the score of the register information in the key log information as 10 points. If the register addresses and values in the key log information are the same as the register addresses in the preset register information, the electronic device can determine the score of the register information in the key log information as 5 points. If the register addresses and values in the key log information are not the same as the preset register information, the electronic device can determine the score of the register information in the key log information as 0 points.
[0072] In another example, taking the parameter mode as an example of the log level mode, if the log level in the key log information is the same as the preset log level, the electronic device can determine the score of the log level in the key log information as 10 points. If the log level in the key log information is not the same as the preset log level, the electronic device can determine the score of the log level in the key log information as 0 points. For example, the preset log level can be ERROR.
[0073] In another example, taking the parameter mode as an example of the timestamp mode, if the timestamp format in the key log information is all the same as the preset timestamp format, the electronic device can determine the score of the timestamp information in the key log information as 10 points. If the timestamp format in the key log information is the same as the prefix format in the preset timestamp format, the electronic device can determine the score of the timestamp information in the key log information as 5 points. If the timestamp format in the key log information is not the same as the preset timestamp format, the electronic device can determine the score of the timestamp information in the key log information as 0 points. For example, the preset timestamp format can be YYYY-MM-DD HH:MM:SS.fff, and the prefix format in the preset timestamp format can be YYYY-MM-DD.
[0074] In another example, taking the parameter mode as an example of the call stack mode, if the call stack function in the key log information is the same as all the preset call stack functions, the electronic device can determine the score of the call stack information in the key log information as 10 points. If the call stack function in the key log information is the same as the prefix part in the preset call stack function, the electronic device can determine the score of the call stack information in the key log information as 5 points. If the call stack function in the key log information is different from the preset call stack function, the electronic device can determine the score of the call stack information in the key log information as 0 points. For example, the preset call stack function can be write_func, and the prefix part in the preset call stack function can be write_.
[0075] Correspondingly, after obtaining at least one matching score corresponding to each parameter mode in the key log information, for each parameter mode, the electronic device can normalize the at least one matching score corresponding to the parameter mode to obtain a target matching score of the parameter mode. In this way, each parameter mode can correspond to only one matching score, reducing the situation that the accuracy of the target log analysis rule determination is low due to the difference in the number of matching scores corresponding to the parameter mode, and improving the accuracy of the analysis rule determination.
[0076] Specifically, for each matching score corresponding to the parameter mode, the electronic device can multiply the matching score by the weight value of the parameter mode to which the matching score belongs to obtain a first matching score. Then, the electronic device can add at least one first matching score to obtain a second matching score. The second matching parameter is the total matching score corresponding to the same parameter mode. Then, the electronic device can normalize the second matching score to obtain the target matching score of the parameter mode. The normalization processing refers to mapping the total matching score corresponding to the same parameter mode to a value in the interval of 0-1.
[0077] It should be noted that the weight value corresponding to the parameter mode described above can be randomly set, can be set based on the priority of the target log file analysis, or can be pre-set according to other standards, and the specific limitation is not limited. In this way, by setting different weights, the preferred cause of the abnormality of the solid state disk can be determined in advance, the target abnormality cause can be quickly and accurately located, and then a convenient condition is provided for subsequent quick analysis of the abnormality positioning result.
[0078] In an implementation, the weight value corresponding to the parameter mode is set based on a priority of the target log file analysis, which is used to represent a possibility that the parameter mode can cause the SSD to be abnormal. That is, the higher the priority of the target log file analysis, the greater the possibility that the parameter mode can cause the SSD to be abnormal. Therefore, the weight value corresponding to the parameter mode can be set higher. That is, the electronic device can set the weight value corresponding to the parameter mode differently according to the possibility that the parameter mode can cause the SSD to be abnormal, so as to reduce the occurrence of the case that the unimportant parameter (such as the timestamp) interferes with the determination of the target abnormal reason, so that the electronic device can locate the target abnormal reason more quickly and accurately, thereby providing a convenient condition for subsequent rapid analysis of the abnormal positioning result.
[0079] It can be understood that, considering that the error code mode is the most critical for detecting fault positioning, if the code information in the target log file is incorrect, it is more likely to cause the SSD to be abnormal, that is, the probability of causing the SSD to be abnormal is greater. Therefore, the electronic device can set the priority of the error code mode as the first, that is, set the weight value corresponding to the error code mode as the highest value (such as 0.3). And considering that the register mode can directly reflect the fault reason from the hardware state, if the register information in the target log file is incorrect, it is still more likely to cause the SSD to be abnormal, that is, the probability of causing the SSD to be abnormal is still greater. Therefore, the electronic device can set the priority of the register mode as the second, that is, the weight value corresponding to the register mode is lower than the weight value corresponding to the error code mode (such as 0.25).
[0080] Similarly, considering that the call stack mode can trace the fault from the software perspective, if the call stack information in the target log file is incorrect, it is still moderately likely to cause the SSD to be abnormal, that is, the probability of causing the SSD to be abnormal is moderate. Therefore, the electronic device can set the priority of the register mode as the third, that is, the weight value corresponding to the call stack mode is lower than the weight value corresponding to the register mode (such as 0.20). Then considering that the log level mode can filter the key fault log, if the log level in the target log file is incorrect, it is still less likely to cause the SSD to be abnormal, that is, the probability of causing the SSD to be abnormal is low. Therefore, the electronic device can set the priority of the log level mode as the fourth, that is, the weight value corresponding to the log level mode is lower than the weight value corresponding to the call stack mode (such as 0.15).
[0081] Finally, considering that the timestamp mode can only be associated with the log timing, even if there is an error in the timestamp format in the target log file, it is not likely to cause the solid state disk to be abnormal, that is, the probability of causing the solid state disk to be abnormal is low. Therefore, the electronic device can set the priority of the timestamp mode as the last one, that is, set the weight value corresponding to the timestamp mode as the lowest value (such as 0.10).
[0082] Correspondingly, after obtaining the target matching score of the parameter mode, the electronic device can select the log parsing rule in the target log parsing rule set that is the same as the parameter mode with the highest target matching score as the target log parsing rule. In this way, by selecting the parameter mode with the highest target matching score, the log parsing rule that is most suitable for the key log information is determined, which can make the subsequent determination of the log parsing file more accurate and provide a convenient condition for subsequent rapid and accurate positioning of the abnormal reason.
[0083] In an implementation manner, the target log parsing rule can be obtained by expression one as follows: Selected Rule = argmax rule (∑param∈rulematch_score(param, log_entry)) expression one; Wherein, Selected Rule is used to represent the log parsing rule in the target log parsing rule set that is the same as the parameter mode with the highest target matching score; rulematch_score() is a matching score function, which is used to evaluate the matching degree between the target log file and each parameter mode; rulematch_score(param, log_entry) is at least one matching score corresponding to each parameter mode; param is the weight value corresponding to the parameter mode; ∑param∈rulematch_score(param, log_entry) is the second matching score corresponding to the parameter mode.
[0084] Exemplarily, the target log file includes 2025-08-01 12:34:56 [ERROR] Code: 0x1234 -Description: Invalid operation, and the log scoring criteria and the weight value of each parameter mode are exemplified above, the electronic device can determine that the target matching score of the timestamp mode is 10*0.1=1, the target matching score of the log level mode is 10*0.15=1.5, and the target matching score of the error code mode is 0*0.3=0. Then, the electronic device can determine the log parsing rule including the log level mode in the target analysis rule set as the target log parsing rule, and determine the content corresponding to the log level mode (that is, ERROR) in the target log file as the error information in the target log file. Then, the electronic device can determine the abnormal reason included in the target log parsing rule as the target abnormal reason.
[0085] S2023, determining the error information in the target log file from the key log information according to at least one parameter mode included in the target log parsing rule.
[0086] S2024, determining the abnormal reason included in the target log parsing rule as the target abnormal reason.
[0087] Specifically, after determining the target log parsing rule, the electronic device can determine the error information in the target log file according to at least one parameter mode included in the target log parsing rule, and determine the abnormal reason included in the target log parsing rule as the target abnormal reason. That is, by matching the target log parsing rule from the log parsing rule library, the surface cause of the target log file that causes the solid state disk to occur an abnormality can be determined, which provides a convenient condition for the electronic device to continue to analyze the root cause in a targeted manner subsequently.
[0088] S203, performing correlation analysis on the log parsing file, the register information, and the program source code to obtain an abnormal positioning result.
[0089] The abnormal positioning result is used to represent the root cause of the abnormality of the firmware hard disk in the running process. In some cases, the abnormal positioning result can include the abnormal problem occurred in the running process of the firmware hard disk and the cause of the abnormal problem of the firmware hard disk. In another case, the abnormal positioning result can also include an abnormal solution, which is a solution that can solve the abnormal problem of the firmware hard disk.
[0090] Specifically, after obtaining the log analysis file, the electronic device can perform correlation analysis on the log analysis file, the register information, and the program source code to obtain an abnormality positioning result. In this way, detailed analysis can be performed at the program source code level, the code position at which the abnormality problem occurs can be quickly and accurately positioned, that is, the root cause of the abnormality problem can be accurately determined, the situation that the abnormality problem cannot be accurately positioned due to the inconsistency between the error information in the target log file and the program source code logic is reduced, the accuracy of abnormality positioning is improved, and thus the user experience is improved.
[0091] In an implementation manner, the electronic device can associate the error information in the target log file with the program source code to obtain abnormality position information. The abnormality position information is used to represent the corresponding code position when the solid state disk has an abnormality. Then, the electronic device can determine the code content corresponding to the abnormality position information and the annotation information of the code content from the program source code. The annotation information is used to indicate the purpose of the code content. In this way, by determining the annotation information, the electronic device can know the definition and processing logic of the error information in the target log file, which provides a basis for subsequently determining the root cause of the abnormality of the firmware hard disk.
[0092] It should be noted that in the process of compiling the program source code, the electronic device can automatically generate a mapping relationship between the log information and the source code position. The source code position is used to represent the position information of the code in the program source code. Then, after obtaining the key log information (such as error code) in the target log file by using the regular expression, the electronic device can find the source code information (that is, the abnormality position information) corresponding to the key log information from the mapping relationship. In this way, by finding the mapping relationship, the code position causing the abnormality problem can be quickly positioned, which provides a basis for subsequently quickly determining the root cause of the abnormality of the firmware hard disk.
[0093] In some cases, the electronic device can analyze the call stack information in the target log file to obtain an abnormality execution path. The abnormality execution path is the execution path when the solid state disk has an abnormality. Then, the electronic device can analyze the annotation information of the code content, the abnormality execution path, and the register information to obtain an abnormality positioning result. In this way, by analyzing the call stack information to obtain the abnormality execution path, the root cause of the abnormality problem can be determined, which provides a convenient condition for subsequently quickly and accurately determining the abnormality positioning result.
[0094] Specifically, the electronic device can input the target log file into the regular expression to obtain the call stack information in the target log file. The call stack information can include the file name of the call stack and the code line number called by the call stack. Then, the electronic device can determine the abnormal execution path according to the call stack information. In this way, the accuracy of the abnormal execution path determination can be improved, thereby providing a basis for subsequent accurate determination of the root cause of the abnormality of the firmware hard disk.
[0095] In an implementation manner, the process of analyzing the annotation information of the code content, the abnormal execution path, and the register information by the electronic device can specifically include: the electronic device can take the register information corresponding to the error information in the register information as target register information. Then, the electronic device can adjust the target register information according to a preset structure body format to obtain adjusted target register information. The preset structure body format can be a structure body format of program source code, or a structure body format defined by other data types, and is not limited in particular.
[0096] Optionally, the electronic device can print the adjusted target register information, that is, the electronic device can print the target register information according to the preset structure body format. In this way, the developer can browse conveniently, so as to quickly and accurately locate and determine the cause of the abnormality of the firmware hard disk, thereby achieving accurate determination of the abnormality locating result.
[0097] Then, the electronic device can compare the adjusted target register information with the preset structure body format to obtain an information comparison result. The information comparison result includes register information that is different from the content of the preset structure body format. Then, the data association module can analyze the annotation information of the code content, the abnormal execution path, and the information comparison result by using a data analysis script to obtain an abnormality locating result. The abnormality locating result can include an abnormal problem occurring in the running process of the solid state disk and a cause of the abnormal problem of the solid state disk. In this way, by adjusting the target register information according to the preset structure body format and comparing, line-level matching of the preset format content and the target register information can be achieved, so as to quickly determine the error information in the target register information, and thereby achieve fast and accurate determination of the abnormality locating result.
[0098] In some embodiments, the electronic device can call an analysis tool through a data analysis script to analyze the annotation information of the code content, the abnormal execution path, and the information comparison result, so as to obtain a first analysis report. The first analysis report can include an abnormal problem of the solid state disk, a possible cause of the abnormality of the solid state disk, and a suggested solution to the abnormality of the solid state disk, etc. For example, the analysis tool can be a GNU debugger (GNU Debugger, GDB), an LLDB debugger, etc.
[0099] Subsequently, the electronic device can find at least one abnormal positioning result same as the error information included in the log analysis file from the historical abnormal positioning results, and determine to generate a second analysis report according to the at least one abnormal positioning result. The first analysis report can include an abnormal problem of the solid state disk, a possible cause of the abnormality of the solid state disk, and a suggested solution to the abnormality of the solid state disk, etc. Subsequently, the electronic device can generate an abnormal positioning result in combination with the first analysis report and the second analysis report. In this way, the accuracy of the abnormal positioning result determination can be improved.
[0100] For example, taking the error information included in the log analysis file as an error code, if the historical abnormal positioning results include the same error information as the error code, and the error information is caused by the same abnormal problem, that is, the abnormal problems of the solid state disk are the same. Therefore, the electronic device can take the abnormal positioning result in the historical abnormal positioning result that is adapted to the error code as the second analysis report.
[0101] S204, performing a result feedback operation on the abnormal positioning result.
[0102] Specifically, after obtaining the above abnormal positioning result, the electronic device can perform a result feedback according to the abnormal positioning result. In this way, the user can quickly know the cause of the abnormality of the solid state disk, which maximizes the closed-loop time of the abnormality of the solid state disk and improves the feedback efficiency of the problem positioning result. In addition, by analyzing the target log file, and jointly analyzing the log analysis file, the register information, and the program source code, the abnormal problem occurred in the running process of the target storage device and the cause of the abnormal problem can be obtained, and the abnormal positioning result is fed back. In this way, the automatic analysis of the abnormal problem can be realized, and the developers do not need to analyze the abnormal cause manually, which reduces the labor cost and improves the analysis efficiency of the abnormal cause and the accuracy of the abnormal positioning.
[0103] In some cases, in order to facilitate the user to understand the detailed situation of the abnormality of the solid state disk, the electronic device can display the above abnormal positioning result in a visual manner.
[0104] In some embodiments, the electronic device can display first feedback information. The first feedback information can include a time series graph of error information in the target log file, a change curve of register information corresponding to the error information in the register information, and / or an execution path graph of an error code in the target log file. The time series graph is used to represent the error information in the target log file at different timestamps. The change curve is used to represent the register information corresponding to the error information at different timestamps. The execution path graph is used to represent the execution path of the error code at different timestamps. In this way, the detailed situation of the abnormality of the solid state disk can be intuitively displayed, so that the user can quickly know the cause of the abnormality of the solid state disk, the closed-loop time of the abnormality of the solid state disk is minimized, and the user experience is improved.
[0105] In some embodiments, the electronic device can display first feedback information. The first feedback information can include a time series graph of error information in the target log file, a change curve of register information corresponding to the error information in the register information, and / or an execution path graph of an error code in the target log file. The time series graph is used to represent the error information in the target log file at different timestamps. The change curve is used to represent the register information corresponding to the error information at different timestamps. The execution path graph is used to represent the execution path of the error code at different timestamps. In this way, the detailed situation of the abnormality of the solid state disk can be intuitively displayed, so that the user can quickly know the cause of the abnormality of the solid state disk, the closed-loop time of the abnormality of the solid state disk is minimized, and the user experience is improved.
[0106] In some embodiments, the electronic device can display first feedback information. The first feedback information can include a time series graph of error information in the target log file, a change curve of register information corresponding to the error information in the register information, and / or an execution path graph of an error code in the target log file. The time series graph is used to represent the error information in the target log file at different timestamps. The change curve is used to represent the register information corresponding to the error information at different timestamps. The execution path graph is used to represent the execution path of the error code at different timestamps. In this way, the detailed situation of the abnormality of the solid state disk can be intuitively displayed, so that the user can quickly know the cause of the abnormality of the solid state disk, the closed-loop time of the abnormality of the solid state disk is minimized, and the user experience is improved.
[0107] In an implementation manner, in a case where the repair operation of the user is detected, the electronic device can record the repair operation, so as to subsequently analyze the result according to the recorded repair operation, thereby improving the analysis performance and analysis accuracy of the electronic device.
[0108] It should be noted that the embodiments of the present disclosure can include a plurality of steps, and in order to facilitate description, these steps are numbered, but these numbers are not a limitation on the execution time slot and execution order between the steps; these steps can be implemented in any order, and the embodiments of the present disclosure do not limit this.
[0109] Corresponding to the above-mentioned abnormality processing method, the present disclosure also proposes an abnormality processing device. Since the device embodiment of the present disclosure corresponds to the above-mentioned method embodiment, for the details not disclosed in the device embodiment, the above-mentioned method embodiment can be referred to, and the present disclosure will not be described in detail.
[0110] Figure 4 A structural schematic diagram of an abnormality processing device provided by the embodiments of the present disclosure is shown in Figure 4As shown, the system includes: an information acquisition unit 41, a log analysis unit 42, a data analysis unit 43, and a result feedback unit 44.
[0111] The information acquisition unit 41 is configured to acquire target log files and register information generated by a target storage device, and program source code obtained in a development environment of the target storage device.
[0112] The log analysis unit 42 is configured to analyze the target log files to obtain log analysis files. The log analysis files include error information in the target log files and a target abnormality cause, which is a cause of the error information in the target log files.
[0113] The data analysis unit 43 is configured to perform correlation analysis on the log analysis files, the register information, and the program source code to obtain an abnormality positioning result.
[0114] The result feedback unit 44 is configured to perform a result feedback operation on the abnormality positioning result.
[0115] Further, in a possible implementation manner of the embodiment, as shown in Figure 4 The log analysis unit 42 is further configured to analyze the target log files by using a regular expression, a natural language processing model, and a machine learning algorithm to obtain key log information. The log analysis unit 42 is further configured to determine error information in the target log files from the key log information according to at least one parameter mode included in the target log analysis rule. The log analysis unit 42 is further configured to determine a target abnormality cause from the target log analysis rule. The log analysis unit 42 is further configured to determine a target abnormality cause from the target log analysis rule.
[0116] Further, in a possible implementation manner of the embodiment, as shown in Figure 4 The log analysis unit 42 is further configured to determine a target abnormality cause from the target log analysis rule. The log analysis unit 42 is further configured to match the key log information with a preset log scoring standard to obtain at least one matching score corresponding to each parameter mode in the key log information. The preset log scoring standard includes a plurality of matching standards under different parameter modes. The log analysis unit 42 is further configured to normalize the at least one matching score corresponding to each parameter mode to obtain a target matching score of the parameter mode. The log analysis rule in the target analysis rule set that is the same as the parameter mode with the highest target matching score is taken as a target log analysis rule.
[0117] Further, in a possible implementation manner of the embodiment, as shown in Figure 4 The data analysis unit 43 is further configured to associate the error information in the target log file with the program source code to obtain abnormal position information; the abnormal position information is used to represent a code position corresponding to an abnormality of the target storage device; determine code content corresponding to the abnormal position information and annotation information of the code content from the program source code; the annotation information is used to indicate a purpose of the code content; analyze the call stack information in the target log file to obtain an abnormal execution path; the abnormal execution path is an execution path when the target storage device is abnormal; analyze the annotation information of the code content, the abnormal execution path, and the register information to obtain an abnormal positioning result.
[0118] Further, in a possible implementation manner of the embodiment, as shown in Figure 4 The data analysis unit 43 is further configured to take the register information corresponding to the error information in the register information as target register information; adjust the target register information according to a preset structure body format to obtain adjusted target register information; compare the adjusted target register information with the preset structure body format to obtain an information comparison result; the information comparison result includes register information that is different from content of the preset structure body format; analyze the annotation information of the code content, the abnormal execution path, and the information comparison result by using a data analysis script to obtain an abnormal positioning result; the abnormal positioning result includes an abnormal problem occurring in a running process of the target storage device and a cause of the abnormal problem of the target storage device.
[0119] Further, in a possible implementation manner of the embodiment, as shown in Figure 4 The result feedback unit 44 is further configured to display first feedback information; the first feedback information includes a time sequence graph of the error information in the target log file, a change curve of the register information corresponding to the error information in the register information, and / or an execution path graph of the error code in the target log file.
[0120] Further, in a possible implementation manner of the embodiment, as shown in Figure 4 The result feedback unit 44 is further configured to display second feedback information; the second feedback information includes an abnormal solution; and / or, The second feedback information is output through a preset voice output mode.
[0121] It should be noted that the foregoing description of the method embodiments also applies to the device of the present embodiment, and the principles are the same, which will not be limited in the present embodiment.
[0122] The description of the features in the embodiment corresponding to the exception handling device can be referred to the related description of the embodiment corresponding to the exception handling method, which will not be described one by one here.
[0123] The embodiment of the present application also provides an electronic device, comprising a target storage device and a processor, the target storage device stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the foregoing exception handling method embodiments.
[0124] The embodiment of the present application also provides a computer readable storage medium, which stores a computer program, wherein the computer program is configured to execute the steps in any one of the foregoing exception handling method embodiments when running.
[0125] In an example embodiment, the foregoing computer readable storage medium can include, but is not limited to, a U disk, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and various media that can store computer programs.
[0126] The embodiment of the present application also provides a computer program product, which comprises a computer program, and the computer program is executed by a processor to implement the steps in any one of the foregoing exception handling method embodiments.
[0127] The embodiment of the present application also provides another computer program product, which comprises a non-volatile computer readable storage medium, the non-volatile computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the steps in any one of the foregoing exception handling method embodiments.
[0128] The skilled person can further realize that the units and algorithm steps of the examples described in conjunction with the embodiments disclosed herein can be realized in electronic hardware, computer software or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the components and steps of the examples have been described in the foregoing description in general terms. Whether the functions are realized in hardware or software depends on the specific application and design constraints of the technical solution. The skilled person can use different methods to realize the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.
[0129] The above describes in detail the abnormality processing method and the electronic device provided by the present application. The principles and implementation manners of the present application are described by applying specific examples, and the above description of the embodiments is only used to help understand the method of the present application and the core idea thereof. It should be indicated that, for those skilled in the art, some improvements and modifications can be made to the present application without departing from the principles of the present application, and these improvements and modifications also fall within the protection scope of the claims of the present application.
Claims
1. An abnormality processing method characterized by comprising: The method comprises the following steps: obtaining a target log file and register information generated by a master program of a target storage device, and program source code obtained in a development environment of the master program; parsing the target log file to obtain a log parsing file; wherein the log parsing file comprises error information in the target log file and a target abnormal reason, and the target abnormal reason is a reason for the error information in the target log file; performing correlation analysis on the log parsing file, the register information and the program source code to obtain an abnormal positioning result; performing a result feedback operation on the abnormal positioning result.
2. The method of claim 1, wherein, The correlation analysis on the log parsing file, the register information and the program source code to obtain the abnormal positioning result comprises: correlating the error information in the target log file with the program source code to obtain abnormal position information; wherein the abnormal position information is used to represent a code position corresponding to an abnormality of the target storage device; determining code content corresponding to the abnormal position information and annotation information of the code content from the program source code; wherein the annotation information is used to indicate a purpose of the code content; parsing call stack information in the target log file to obtain an abnormal execution path; wherein the abnormal execution path is an execution path when the target storage device has an abnormality; analyzing the annotation information of the code content, the abnormal execution path and the register information to obtain the abnormal positioning result.
3. The method of claim 2, wherein, The analysis of the annotation information of the code content, the abnormal execution path and the register information to obtain the abnormal positioning result comprises: taking register information corresponding to the error information in the register information as target register information; adjusting the target register information according to a preset structure format to obtain adjusted target register information; comparing the adjusted target register information with the preset structure format to obtain an information comparison result; wherein the information comparison result comprises register information different from content of the preset structure format; analyzing the annotation information of the code content, the abnormal execution path and the information comparison result by using a data analysis script to obtain the abnormal positioning result; wherein the abnormal positioning result comprises an abnormal problem occurring in a running process of the target storage device and a reason for the abnormal problem of the target storage device.
4. The method of claim 1, wherein, The parsing of the target log file to obtain a log parsing file comprises: parsing the target log file by using a regular expression, a natural language processing model and a machine learning algorithm to obtain key log information; taking a log parsing rule in a log parsing rule library that is adapted to the key log information as a target log parsing rule; wherein the target log parsing rule comprises at least one parameter mode and an abnormal reason corresponding to the at least one parameter mode. determine error information in the target log file from the key log information according to at least one parameter mode included in the target log analysis rule; take an abnormal reason included in the target log analysis rule as the target abnormal reason.
5. The method of claim 4, wherein, The target log analysis rule adapted to the key log information in the log analysis rule library comprises: a set of analysis rules in the log analysis rule library that match the device information of the target storage device are taken as a target analysis rule set; The key log information is matched with a preset log scoring standard to obtain at least one matching score corresponding to each parameter mode in the key log information; wherein the preset log scoring standard includes a plurality of matching standards under different parameter modes; For each parameter mode, the at least one matching score corresponding to the parameter mode is normalized to obtain a target matching score of the parameter mode; The log analysis rule in the target analysis rule set that is the same as the parameter mode with the highest target matching score is taken as the target log analysis rule.
6. The method according to claim 4 or 5, characterized in that, The log analysis rule library includes device information of a plurality of storage devices and an analysis rule set for each device information, the device information includes a device model of the storage device and a firmware version of the device model, and the analysis rule set includes at least one analysis rule.
7. The method according to claim 4 or 5, characterized in that, The target log file is parsed by using a regular expression, a natural language processing model, and a machine learning algorithm to obtain key log information, comprising: inputting the target log file into the regular expression to obtain log information in the target log file corresponding to a preset log format; wherein the preset log format at least includes an error code and a timestamp; inputting the target log file into the natural language processing model to obtain key information; wherein the key information at least includes error information and operation context; inputting the target log file into the machine learning algorithm to obtain a log detection result; wherein the log detection result includes abnormal information in the target log file and a predicted potential problem, and the predicted potential problem is used to represent a possible reason for the abnormality of the target storage device.
8. The method according to any one of claims 1-5, characterized in that, The result feedback operation of the abnormal positioning result comprises: displaying first feedback information; wherein the first feedback information includes a time series graph of error information in the target log file, a change curve of register information corresponding to the error information in the register information, and / or an execution path graph of an error code in the target log file.
9. The method according to any one of claims 1-5, characterized in that, In the case that the abnormal positioning result further includes an abnormal solution, the result feedback operation of the abnormal positioning result further comprises: displaying second feedback information; wherein the second feedback information includes the abnormal solution; and / or, outputting the second feedback information through a preset voice output mode.
10. An electronic device, comprising: comprise: at least one processor; and a target storage device in communication connection with the at least one processor; wherein, The target storage device stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the abnormality processing method of any one of claims 1-9.
Citation Information
Patent Citations
Hard disk fault diagnosis method and device, computer equipment and storage medium
CN117591355A
Abnormal log processing method and device based on large language dialogue model
CN119512866A
Core dump collapse reason positioning method and device, equipment and storage medium
CN120429147A
Fault reason determination method and device, storage medium, electronic equipment and computer program product
CN120631638A
Method for determining location where memory error occurs
US20200151046A1
Cited By
Charging log processing method and device, equipment, storage medium and program product
CN121636517A