A system exception processing method, device, apparatus and storage medium
By automating the processing of abnormal operation information, generating summary information and comparing it with historical records, the problem of developers having to manually identify the first exception is solved, thus improving the efficiency of exception handling.
Patent Information
- Application Number
- CN202111554638.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-17
- Publication Date
- 2025-11-28
- Estimated Expiration
- 2041-12-17
AI Technical Summary
Developers need to manually browse the exception logs to identify the first exception that occurs, resulting in inefficient exception handling.
By acquiring abnormal operation information of the target system in real time, extracting key abnormal information, generating first and second abnormal summary information, and comparing them with historical abnormal summary information, the system can automatically determine whether the abnormality is the first occurrence and send an alarm message to the developers.
Automated detection of whether an anomaly is the first occurrence improves anomaly handling efficiency, reduces the need for manual identification, and enhances the efficiency of anomaly handling.
Smart Images

Figure CN114281585B_ABST
Abstract
Description
Technical Field
[0001] This document relates to the field of computer technology, and in particular to a system anomaly handling method, apparatus, device, and storage medium. Background Technology
[0002] Software systems often encounter various problems during operation. Developers need to promptly identify these problems in order to optimize the software system.
[0003] Currently, software system malfunctions can be recorded in an exception log. Developers can review the exception log to identify abnormal situations and take appropriate action. During exception handling, the first exception encountered is often the focus of developers' attention.
[0004] However, the exception log cannot mark whether the exception is the first time it has occurred. Developers need to manually browse the exception log and identify the first exception, which has the problem of slow manual identification and reduced exception handling efficiency. Summary of the Invention
[0005] The purpose of one embodiment of this specification is to provide a system exception handling method, apparatus, device, and storage medium to solve the problem that developers need to manually browse exception operation logs and identify the first occurrence of exceptions, which is slow and reduces the efficiency of exception handling.
[0006] To solve the above-mentioned technical problems, one embodiment of this specification is implemented as follows:
[0007] Firstly, one embodiment of this specification provides a system exception handling method, including:
[0008] After the target system is running, abnormal operation information of the target system is acquired in real time; wherein, the target system is jointly developed by multiple developers, including the target developer; the target developer adds target functional modules to the target system;
[0009] According to the preset rules for extracting critical abnormal information, critical abnormal information is extracted from the abnormal operation information.
[0010] Based on the aforementioned key anomaly information, a first anomaly summary information and a second anomaly summary information are generated. The first anomaly summary information is used to characterize the abnormal code fragment in the target system, and the second anomaly summary information is used to characterize the location of the abnormal code fragment in the source code of the target system.
[0011] Based on the first anomaly summary information, the second anomaly summary information, and the historical anomaly summary information of the target system, it is determined whether the anomaly of the target system is the first occurrence. Based on the determination result, anomaly handling related to the target developer is performed.
[0012] Secondly, another embodiment of this specification provides a system anomaly handling apparatus, comprising:
[0013] An information acquisition unit is used to acquire abnormal operation information of the target system in real time after the target system is running; wherein the target system is jointly developed by multiple developers, including the target developer; the target developer adds target functional modules to the target system;
[0014] The information extraction unit is used to extract abnormal key information from the abnormal operation information according to the preset abnormal key information extraction rules;
[0015] The summary generation unit is used to generate first abnormal summary information and second abnormal summary information based on the abnormal key information. The first abnormal summary information is used to characterize the abnormal code fragment in the target system, and the second abnormal summary information is used to characterize the position of the abnormal code fragment in the source code of the target system.
[0016] An exception handling unit is configured to determine whether an exception in the target system is the first occurrence based on the first exception summary information, the second exception summary information, and the historical exception summary information of the target system, and to perform exception handling related to the target developer based on the determination result.
[0017] Thirdly, in another embodiment of this specification, a system exception handling device is provided, comprising: a memory, a processor, and computer-executable instructions stored in the memory and executable on the processor, wherein the computer-executable instructions, when executed by the processor, implement the steps of the system exception handling method as described in the first aspect above.
[0018] Fourthly, in another embodiment of this specification, a computer-readable storage medium is provided for storing computer-executable instructions that, when executed by a processor, implement the steps of the system exception handling method described in the first aspect above.
[0019] In one embodiment of this specification, after the target system is running, abnormal operation information of the target system can be obtained, and key abnormal information can be extracted from the abnormal operation information. Based on the key abnormal information, first abnormal summary information and second abnormal summary information are generated. The first abnormal summary information is used to characterize the abnormal code fragment in the target system, and the second abnormal summary information is used to characterize the position of the abnormal code fragment in the source code of the target system. Based on the first abnormal summary information, the second abnormal summary information, and the historical abnormal summary information of the target system, it is determined whether the abnormality of the target system is the first occurrence. This automatically determines whether the abnormality of the target system is the first occurrence, eliminating the need for developers to make manual judgments. This improves the efficiency of identifying the first occurrence of an abnormality and improves the efficiency of abnormality handling. It solves the problem that developers need to manually browse the abnormal operation log and identify the first occurrence of an abnormality, which is slow and reduces the efficiency of abnormality handling. Attached Figure Description
[0020] To more clearly illustrate the technical solutions in one or more embodiments of this specification, the accompanying drawings used in the description of the embodiments or prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this specification. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0021] Figure 1 This is a schematic diagram illustrating an application scenario of the system exception handling method provided in one embodiment of this specification.
[0022] Figure 2 A flowchart illustrating a system exception handling method provided in one or more embodiments of this specification;
[0023] Figure 3 A flowchart illustrating a system exception handling method provided in yet another embodiment of this specification;
[0024] Figure 4 This is a schematic diagram of the system fault handling device provided in one embodiment of this specification;
[0025] Figure 5 This is a schematic diagram of the system fault handling device provided in one embodiment of this specification. Detailed Implementation
[0026] To enable those skilled in the art to better understand the technical solutions in one or more embodiments of this specification, the technical solutions in one or more embodiments of this specification will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this specification, and not all of the embodiments. Based on one or more embodiments of this specification, all other embodiments obtained by those skilled in the art without creative effort should fall within the protection scope of this document.
[0027] To address the issue that developers need to manually review exception logs and identify the first occurrence of an exception, which is inefficient and reduces exception handling efficiency, this specification provides an embodiment of a system exception handling method. Figure 1 This is a schematic diagram illustrating an application scenario of the system exception handling method provided in one embodiment of this specification, such as... Figure 1 As shown, this scenario includes a target system, a message middleware, and an exception handling system. The target system is the system whose operational abnormality is to be detected. The target system can be an automated testing system. When the target system malfunctions, it generates exception information. The message middleware (such as Kafka) can read this exception information and send it to the exception handling system. The exception handling system executes the system exception handling methods provided in one or more embodiments of this specification, determines whether the exception in the target system is the first occurrence based on the exception information, and performs corresponding exception handling. Of course, in other scenarios, the exception handling system can also communicate directly with the target system without going through the message middleware, obtain the exception information from the target system, and perform subsequent processing.
[0028] Figure 2 This is a flowchart illustrating one or more embodiments of the system exception handling method provided in this specification, such as... Figure 2 As shown, this process is... Figure 1 The exception handling system in the middle is executed. This exception handling system can interface with the target system, either through or without a message middleware, and implements the following steps:
[0029] Step S202: After the target system is running, abnormal operation information of the target system is obtained in real time; wherein, the target system is jointly developed by multiple developers, including the target developer; the target developer adds target functional modules to the target system;
[0030] Step S204: Extract key abnormal information from the abnormal operation information according to the preset key abnormal information extraction rules;
[0031] Step S206: Based on the key abnormal information, generate first abnormal summary information and second abnormal summary information. The first abnormal summary information is used to characterize the abnormal code fragment in the target system, and the second abnormal summary information is used to characterize the location of the abnormal code fragment in the source code of the target system.
[0032] Step S208: Based on the first exception summary information, the second exception summary information, and the historical exception summary information of the target system, determine whether the exception of the target system is the first occurrence. Based on the determination result, execute exception handling related to the target developer.
[0033] In the embodiments of this specification, after the target system is running, abnormal operation information of the target system can be obtained, and key abnormal information can be extracted from the abnormal operation information. Based on the key abnormal information, first abnormal summary information and second abnormal summary information are generated. The first abnormal summary information is used to characterize the abnormal code fragment in the target system, and the second abnormal summary information is used to characterize the position of the abnormal code fragment in the source code of the target system. Based on the first abnormal summary information, the second abnormal summary information, and the historical abnormal summary information of the target system, it is determined whether the abnormality of the target system is the first occurrence. This automatically determines whether the abnormality of the target system is the first occurrence, eliminating the need for developers to make manual judgments. This improves the efficiency of identifying the first occurrence of an abnormality and improves the efficiency of abnormality handling. It solves the problem that developers need to manually browse the abnormal operation log and identify the first occurrence of an abnormality, which is slow and reduces the efficiency of abnormality handling.
[0034] The target system is jointly developed by multiple developers, including the target developer. The target developer adds target functional modules to the target system. Specifically, the target system is a system jointly developed by multiple developers, with the target developer being one of them. In one scenario, the target system is first developed and launched by developers other than the target developer. After the target system is launched, the target developer adds target functional modules to the target system. After adding these modules, the target system needs to be checked for any operational anomalies using steps S202-S208 described above.
[0035] In step S202 above, after the target system starts running, the exception handling system acquires the exception operation information of the target system in real time. The exception handling system can detect the operation of the target system and acquire its exception operation information in real time after it starts running. For example... Figure 1As shown, in one scenario, after the target system starts running, it outputs runtime logs to the message middleware in real time. The message middleware retrieves these logs and sends them to the exception handling system in real time. The exception handling system extracts the abnormal runtime logs from the runtime logs based on preset exception identifiers, excluding the normal runtime logs. The exception handling system then uses these abnormal runtime logs as the abnormal runtime information for the target system. In another scenario, after the target system starts running, it outputs abnormal runtime logs to the message middleware in real time. The message middleware retrieves these logs and sends them to the exception handling system in real time. The exception handling system then uses the received abnormal runtime logs as the abnormal runtime information for the target system.
[0036] In both scenarios described above, the exception handling system uses the target system's exception logs as its exception information. Exception logs in the exception handling system can be stored as a stack. Each stack represents a single exception log entry, which in turn represents a single exception entry. The top of the stack records the exception name and line number corresponding to that log entry. Starting from the bottom and working upwards, the stack records the call chain between the class and method that caused the exception. For example, for a particular exception log entry, the top of the stack might record the exception name "NullPointerException, Line 100." Starting from the bottom and working upwards, the stack records that during the target system's execution, in chronological order, method A in class 1 calls method B, and method B calls method C. Therefore, the call chain between the class and method that caused the "NullPointerException" is "method A in class 1 calls method B, method B calls method C," and the "NullPointerException" is located at line 100 of the target system's source code.
[0037] Since the exception handling system obtains the exception operation information of the target system in real time, the exception handling system can execute steps S204-S208 once after obtaining each exception operation information, so as to perform exception handling on each exception operation information.
[0038] In step S204 above, the exception handling system extracts key exception information from the exception runtime information according to preset key exception information extraction rules. The exception runtime information can be the exception runtime log, and the key exception information can include the exception name, exception class name, exception method name, and exception code line number. For example, when the exception runtime log is stored in stack format, the exception name, exception class name, exception method name, and exception code line number can be extracted from the information recorded in the stack. Taking the previous example, the exception name "NullPointerException", exception class name "Class 1", exception method names "Method A", "Method B", and exception code line number "Line 100" can be extracted.
[0039] In one embodiment, critical exception information is extracted from exception execution information. When the exception execution information is an exception execution log stored in stack form, when extracting critical exception information from the exception execution log, since there is a calling order between the methods, and the stack often records the calling relationship between the exception methods based on this calling order, the exception method name, exception class name, and exception code line number can be extracted based on the stack's recording order of the exception methods.
[0040] Specifically, exception execution logs stored in stack form can typically be represented as array information such as [class, line number, method name]. One array information corresponds to one method. When there are multiple method calls, there are multiple array information recorded in the order of the calls. Based on the stack record information, each array information can be extracted to obtain the exception method name, exception class name, and exception code line number.
[0041] For example, if the stack trace contains "[Class 1, Line 10, Method Name a], [Class 1, Line 20, Method Name c]", indicating that method a calls method b, then the extracted exception method name, exception class name, and exception code line number are "[Class 1, Line 10, Method Name a], [Class 1, Line 20, Method Name c]". In other words, the exception class name, exception method name, and exception code line number are extracted directly based on the array information format of [Class, Line, Method Name] in the stack trace.
[0042] Typically, during the operation of a target system, one or more third-party application packages will be called and run. If a runtime exception occurs during the execution of a third-party application package, it indicates a problem with the third-party application package. This is usually not the focus of the target system's developers; they tend to focus on exceptions within the target system itself. Therefore, in one embodiment, according to preset exception key information extraction rules, exception key information is extracted from the exception runtime information, including:
[0043] (1) Determine whether the abnormal operation information is the first abnormal information related to the target system according to the target system identifier recorded in the preset abnormal key information extraction rules;
[0044] (2) If so, then according to the abnormal information composition recorded in the preset abnormal key information extraction rules, the key content is identified from the abnormal operation information as abnormal key information.
[0045] Specifically, the preset rules for extracting critical anomaly information contain the identifier of the target system, such as "XXX.com". The abnormal operation information of the target system also records the source identifier of the anomaly information. The source of the anomaly information falls into two categories: 1. from the source code of the target system itself; 2. from third-party application packages called during the operation of the target system. The source identifier of the anomaly information is extracted from the abnormal operation information. It is then determined whether this source identifier matches the identifier of the target system recorded in the preset rules for extracting critical anomaly information. If they match, it indicates that the anomaly information is an anomaly of the target system itself, thus identifying it as the first anomaly information related to the target system. If they do not match, it indicates that the anomaly information is not an anomaly of the target system itself, thus identifying it as not the first anomaly information related to the target system.
[0046] Next, after determining that the abnormal operation information is the first abnormal information related to the target system, key content is identified from the abnormal operation information as the abnormal key information according to the abnormal information composition recorded in the preset abnormal key information extraction rules. As introduced above, the abnormal information composition includes the abnormal name, abnormal class name, abnormal method name, and abnormal code line number. Therefore, the abnormal key information also includes the abnormal name, abnormal class name, abnormal method name, and abnormal code line number.
[0047] As can be seen, this embodiment can eliminate runtime anomalies caused by calling third-party application packages during the operation of the target system, and analyze runtime anomalies caused by the target system source code itself, thereby achieving the effect of filtering out invalid anomaly information.
[0048] From a software architecture perspective, the target system's architecture can be divided into a request layer, a model layer, and a data layer. Considering that developers may sometimes focus on runtime exceptions in a particular layer while neglecting exceptions in other layers, in one embodiment, according to preset exception key information extraction rules, exception key information is extracted from the exception runtime information, including:
[0049] (1) According to the identifier of the target system and the identifier of the target service layer in the target system recorded in the preset abnormal key information extraction rules, determine whether the abnormal operation information is the second abnormal information related to the target service layer in the target system.
[0050] (2) If so, then according to the abnormal information composition recorded in the preset abnormal key information extraction rules, the key content is identified from the abnormal operation information as abnormal key information.
[0051] Specifically, the preset rules for extracting critical anomaly information include the identifier of the target system and the identifier of the target service layer. The target service layer can be any layer among the request layer, model layer, and data layer. The abnormal operation information of the target system also records the source identifier of the anomaly information. This source identifier can indicate whether the operation anomaly originates from the target system or a third-party application package, and it can also indicate which specific service layer of the target system it originates from. The source identifier of the anomaly information is extracted from the abnormal operation information. It is then determined whether this source identifier is consistent with the identifier of the target system and the identifier of the target service layer recorded in the preset rules for extracting critical anomaly information. If they are consistent, it means that the abnormal operation information is caused by the target service layer of the target system, that is, it is determined that the abnormal operation information is a second anomaly information related to the target service layer of the target system. If they are inconsistent, it means that the abnormal operation information is not caused by the target service layer of the target system, that is, it is determined that the abnormal operation information is not a second anomaly information related to the target service layer of the target system.
[0052] Next, after determining that the abnormal operation information is a second abnormal information related to the target service layer in the target system, key content is identified from the abnormal operation information as the abnormal key information according to the abnormal information composition recorded in the preset abnormal key information extraction rules. As introduced above, the abnormal information composition includes the abnormal name, abnormal class name, abnormal method name, and abnormal code line number. Therefore, the abnormal key information also includes the abnormal name, abnormal class name, abnormal method name, and abnormal code line number.
[0053] As can be seen, this embodiment can filter out operational anomalies caused by the target service layer in the target system, achieving the effect of filtering important anomalies according to the needs of developers.
[0054] It should be noted that in this embodiment, the preset rules for extracting critical anomaly information include the identifier of the target system and the identifier of the target service layer. These two identifiers can be arbitrarily configured by the developers according to their needs. The developers mentioned in this embodiment can be any developer involved in the development of the target system, including but not limited to the target developers.
[0055] In step S206 above, based on the key abnormal information, a first abnormal summary information and a second abnormal summary information are generated. The first abnormal summary information is used to characterize the abnormal code fragment in the target system, and the second abnormal summary information is used to characterize the location of the abnormal code fragment in the source code of the target system.
[0056] In one embodiment, based on key anomaly information, first anomaly summary information is generated, specifically as follows:
[0057] (1) Concatenate the exception name, exception class name and exception method name in the exception key information to obtain the first string;
[0058] (2) Perform message digest processing on the first string to obtain the first anomaly digest information.
[0059] As mentioned earlier, key exception information includes the exception name, exception class name, exception method name, and exception code line number. Here, we extract the exception name, exception class name, and exception method name from the key exception information. For example, using the previous example, we can extract the exception name "NullPointer", the exception class name "Class 1", and the exception method names "Method A", "Method B", and "Method C". Then, we concatenate the extracted exception name, exception class name, and exception method name to obtain the first string. Next, we perform message digest processing on the first string, such as using the MD5 message-digest algorithm, to obtain the first exception digest information.
[0060] Based on the aforementioned stack example, when extracting the array information "[Class1, line number 10, method name a], [Class1, line number 20, method name c]" from the stack, we can extract "[Class1, method name a], [Class1, method name c]" from the array information, concatenate this part with the exception name, and thus obtain the first string.
[0061] Therefore, the first anomaly summary information is obtained by processing the anomaly name, anomaly class name, and anomaly method name in the anomaly key information, and thus can characterize the anomaly code fragment in the target system.
[0062] In one embodiment, based on key anomaly information, a second anomaly summary is generated, specifically as follows:
[0063] (1) Concatenate the exception name, exception class name, exception method name and exception code line number in the exception key information to obtain the second string;
[0064] (2) Perform message digest processing on the second string to obtain the second anomaly digest information.
[0065] As mentioned earlier, key exception information includes the exception name, exception class name, exception method name, and exception code line number. Here, we extract the exception name, exception class name, exception method name, and exception code line number from the key exception information. For example, using the previous example, we can extract the exception name "NullPointerException", the exception class name "Class 1", the exception method names "Method A", "Method B", and "Method C", and the exception code line number "Line 100". Then, we concatenate the extracted exception name, exception class name, exception method name, and exception code line number to obtain the second string. Next, we perform message digest processing on the second string, such as MD5 processing, to obtain the second exception digest information.
[0066] Based on the aforementioned stack example, when extracting the array information "[Class 1, Line 10, Method Name a], [Class 1, Line 20, Method Name c]" from the stack, the array information can be directly concatenated with the exception name to obtain the second string.
[0067] Therefore, the second exception summary information is obtained by processing the exception name, exception class name, exception method name and exception code line number in the exception key information, and thus it can characterize the location of the exception code fragment in the source code of the target system.
[0068] In step S208 above, based on the first anomaly summary information, the second anomaly summary information, and the historical anomaly summary information of the target system, it is determined whether the anomaly of the target system is the first occurrence, specifically as follows:
[0069] (1) Extract the first type of historical summary information used to characterize the abnormal code fragment from the abnormal historical summary information of the target system, and extract the second type of historical summary information used to characterize the position of the abnormal code fragment in the source code of the target system.
[0070] (2) Search for whether there is information in the first type of historical summary information that is the same as the first abnormal summary information to obtain the first search result, and search for whether there is information in the second type of historical summary information that is the same as the second abnormal summary information to obtain the second search result;
[0071] (3) If both the first search result and the second search result are negative, the anomaly of the target system is determined to be the first occurrence. If the first search result is positive and the second search result is negative, the anomaly of the target system is determined to be a suspected first occurrence. If both the first search result and the second search result are positive, the anomaly of the target system is determined to be a non-first occurrence.
[0072] Specifically, the first step is to obtain the abnormal historical summary information of the target system. This abnormal historical summary information includes two parts: 1. a first type of historical summary information used to characterize the abnormal code fragment, and 2. a second type of historical summary information extracted to characterize the position of the abnormal code fragment in the source code of the target system. In action (1), the first type of historical summary information and the second type of historical summary information are extracted. The algorithm for generating the first type of historical summary information is the same as the process and algorithm for generating the first abnormal summary information, and the algorithm for generating the second type of historical summary information is the same as the process and algorithm for generating the second abnormal summary information.
[0073] In action (2), the first search result is obtained by searching for whether there is information in the first type of historical summary information that is the same as the first abnormal summary information, and the second search result is obtained by searching for whether there is information in the second type of historical summary information that is the same as the second abnormal summary information.
[0074] In action (3), if both the first and second search results are negative, it means that there has never been an exception corresponding to the first and second exception summary information in the historical exceptions of the target system, indicating that the exception in the target system is the first occurrence. If the first search result is positive and the second search result is negative, it means that there has been an exception in the historical exceptions of the target system with the same exception name, exception method name, and exception class name as the exception running information, but the source code line number of the exception in the target system is different. Therefore, it is determined that the exception in the target system is suspected to be the first occurrence. The suspected first occurrence may be due to the target developers adding some code, thereby changing the position of an original exception. If both the first and second search results are positive, it means that there has been an exception in the historical exceptions of the target system with the same exception name, exception method name, and exception class name as the exception running information, and the source code line number of the exception in the target system is the same. Therefore, it is determined that the exception in the target system is not the first occurrence.
[0075] It is understood that in this embodiment, each time an anomaly occurs in the target system, a first anomaly summary information and a second anomaly summary information are recorded. When a new operational anomaly is reported in the target system, the first anomaly summary information in the historical records is the first type of historical summary information, and the second anomaly summary information in the historical records is the second type of historical summary information. By comparing with the historical summaries, it is possible to determine whether the newly reported operational anomaly in the target system is the first anomaly to appear.
[0076] In step S208 above, based on the judgment result, exception handling related to the target developer is performed, specifically as follows:
[0077] (1) When the judgment result indicates that the anomaly of the target system is the first occurrence or is suspected to be the first occurrence, an alarm message is sent to the target developer;
[0078] (2) When the judgment result indicates that the anomaly of the target system is not the first occurrence, the anomaly of the target system is ignored.
[0079] When the judgment result indicates that the anomaly of the target system is the first occurrence or a suspected first occurrence, since the target developers have added a new target functional module to the target system, the first occurrence or suspected first occurrence of the anomaly may have been introduced by the target developers during the development of the target functional module. Therefore, an alarm message is sent to the target developers. The alarm message can be in the form of communication such as SMS, WeChat or email.
[0080] If the judgment result indicates that the anomaly in the target system is either the first occurrence or a non-first occurrence, it means that the anomaly may have been left by other developers who developed the target system before the target developer. Therefore, the anomaly is ignored and no alarm message is sent to the target developer.
[0081] As can be seen, through this embodiment, when the target developer adds a target functional module to the target system, it is possible to analyze whether the target system's operational anomaly is the first occurrence. The first occurrence of the anomaly is likely introduced by the target developer during the development of the target functional module, thereby reminding the target developer to pay attention to the first occurrence of the anomaly and resolve it in a timely manner, so as to improve the efficiency of program anomaly resolution and program development efficiency.
[0082] Figure 3 A flowchart illustrating a system exception handling method provided in another embodiment of this specification is shown below. Figure 3 As shown, this process is executed by the exception handling system and includes:
[0083] Step S302: After the target system is running, obtain abnormal operation information of the target system in real time;
[0084] Step S304: Extract key abnormal information from abnormal operation information according to the preset key abnormal information extraction rules;
[0085] Step S306: Based on the key anomaly information, generate first anomaly summary information and second anomaly summary information;
[0086] Step S308: Based on the first anomaly summary information, the second anomaly summary information, and the historical anomaly summary information of the target system, determine whether the anomaly of the target system is the first occurrence.
[0087] Step S310: When the judgment result indicates that the anomaly of the target system is the first occurrence or a suspected first occurrence, an alarm message is sent to the target developer.
[0088] Step S312: If the judgment result indicates that the anomaly of the target system is not the first occurrence, ignore the anomaly of the target system and do not send an alarm message to the target developer.
[0089] In summary, this embodiment automatically determines whether an anomaly in the target system is the first occurrence, eliminating the need for manual judgment by developers. This improves the efficiency of identifying first-time anomalies and enhances anomaly handling efficiency. It also solves the problem that developers need to manually browse anomaly logs and identify first-time anomalies, which is slow and reduces anomaly handling efficiency.
[0090] Figure 4 This is a schematic diagram of a system exception handling device provided in one embodiment of this specification. This device can be located within the aforementioned exception handling system, such as... Figure 4 As shown, the device includes:
[0091] The information acquisition unit 41 is used to acquire abnormal operation information of the target system in real time after the target system is running; wherein the target system is jointly developed by multiple developers, including the target developer; the target developer adds target functional modules to the target system;
[0092] Information extraction unit 42 is used to extract abnormal key information from the abnormal operation information according to preset abnormal key information extraction rules;
[0093] Summary generation unit 43 is used to generate first abnormal summary information and second abnormal summary information based on the abnormal key information. The first abnormal summary information is used to characterize the abnormal code fragment in the target system, and the second abnormal summary information is used to characterize the position of the abnormal code fragment in the source code of the target system.
[0094] The exception handling unit 44 is used to determine whether the exception of the target system is the first occurrence based on the first exception summary information, the second exception summary information and the historical exception summary information of the target system, and to perform exception handling related to the target developer based on the determination result.
[0095] Optionally, the information extraction unit is specifically used for:
[0096] According to the identifier of the target system recorded in the preset abnormal key information extraction rules, determine whether the abnormal operation information is the first abnormal information related to the target system;
[0097] If so, then according to the abnormal information composition recorded in the preset abnormal key information extraction rules, key content is identified from the abnormal operation information as the abnormal key information.
[0098] Optionally, the information extraction unit is specifically used for:
[0099] According to the identifier of the target system and the identifier of the target service layer in the target system recorded in the preset abnormal key information extraction rules, determine whether the abnormal operation information is a second abnormal information related to the target service layer in the target system;
[0100] If so, then according to the abnormal information composition recorded in the preset abnormal key information extraction rules, key content is identified from the abnormal operation information as the abnormal key information.
[0101] Optionally, the key information about the exception includes the exception name, the exception class name, the exception method name, and the exception code line number.
[0102] Optionally, the summary generation unit is specifically used for:
[0103] The exception name, exception class name, and exception method name in the exception key information are concatenated to obtain the first string;
[0104] The first string is processed by message digest processing to obtain the first anomaly digest information.
[0105] Optionally, the summary generation unit is specifically used for:
[0106] The exception name, exception class name, exception method name, and exception code line number in the exception key information are concatenated to obtain the second string;
[0107] The second string is processed into a message digest to obtain the second anomaly digest information.
[0108] Optionally, the exception handling unit is specifically used for:
[0109] Extract a first type of historical summary information to characterize the abnormal code fragment from the abnormal historical summary information of the target system, and extract a second type of historical summary information to characterize the position of the abnormal code fragment in the source code of the target system;
[0110] The system searches for information in the first type of historical summary information that is identical to the first abnormal summary information to obtain a first search result; and searches for information in the second type of historical summary information that is identical to the second abnormal summary information to obtain a second search result.
[0111] If both the first search result and the second search result are negative, the anomaly of the target system is determined to be the first occurrence. If the first search result is positive and the second search result is negative, the anomaly of the target system is determined to be a suspected first occurrence. If both the first search result and the second search result are positive, the anomaly of the target system is determined to be a non-first occurrence.
[0112] Optionally, the exception handling unit is specifically used for:
[0113] When the judgment result indicates that the anomaly in the target system is the first occurrence or a suspected first occurrence, an alarm message is sent to the target developer.
[0114] When the judgment result indicates that the anomaly of the target system is not the first occurrence, the anomaly of the target system is ignored.
[0115] In the embodiments of this specification, after the target system is running, abnormal operation information of the target system can be obtained, and key abnormal information can be extracted from the abnormal operation information. Based on the key abnormal information, first abnormal summary information and second abnormal summary information are generated. The first abnormal summary information is used to characterize the abnormal code fragment in the target system, and the second abnormal summary information is used to characterize the position of the abnormal code fragment in the source code of the target system. Based on the first abnormal summary information, the second abnormal summary information, and the historical abnormal summary information of the target system, it is determined whether the abnormality of the target system is the first occurrence. This automatically determines whether the abnormality of the target system is the first occurrence, eliminating the need for developers to make manual judgments. This improves the efficiency of identifying the first occurrence of an abnormality and improves the efficiency of abnormality handling. It solves the problem that developers need to manually browse the abnormal operation log and identify the first occurrence of an abnormality, which is slow and reduces the efficiency of abnormality handling.
[0116] The system exception handling device provided in one embodiment of this specification can implement the various processes in the aforementioned system exception handling method embodiments and achieve the same functions and effects, which will not be repeated here.
[0117] Furthermore, one embodiment of this specification also provides a system anomaly handling device. Figure 5 This is a schematic diagram of the structure of a system fault handling device provided in one embodiment of this specification, as shown below. Figure 5 As shown, the device includes a memory 601, a processor 602, a bus 603, and a communication interface 604. The memory 601, the processor 602, and the communication interface 604 communicate via the bus 603. The communication interface 604 may include input / output interfaces, including but not limited to a keyboard, mouse, monitor, microphone, and loudspeaker.
[0118] Figure 5In the processor 602, the memory 601 stores computer-executable instructions that can run on the processor 602. When the processor 602 executes the computer-executable instructions, the following process is implemented:
[0119] After the target system is running, abnormal operation information of the target system is acquired in real time; wherein, the target system is jointly developed by multiple developers, including the target developer; the target developer adds target functional modules to the target system;
[0120] According to the preset rules for extracting critical abnormal information, critical abnormal information is extracted from the abnormal operation information.
[0121] Based on the aforementioned key anomaly information, a first anomaly summary information and a second anomaly summary information are generated. The first anomaly summary information is used to characterize the abnormal code fragment in the target system, and the second anomaly summary information is used to characterize the location of the abnormal code fragment in the source code of the target system.
[0122] Based on the first anomaly summary information, the second anomaly summary information, and the historical anomaly summary information of the target system, it is determined whether the anomaly of the target system is the first occurrence. Based on the determination result, anomaly handling related to the target developer is performed.
[0123] Optionally, when the computer-executable instructions are executed by the processor, abnormal key information is extracted from the abnormal operation information according to preset abnormal key information extraction rules, including:
[0124] According to the identifier of the target system recorded in the preset abnormal key information extraction rules, determine whether the abnormal operation information is the first abnormal information related to the target system;
[0125] If so, then according to the abnormal information composition recorded in the preset abnormal key information extraction rules, key content is identified from the abnormal operation information as the abnormal key information.
[0126] Optionally, when the computer-executable instructions are executed by the processor, abnormal key information is extracted from the abnormal operation information according to preset abnormal key information extraction rules, including:
[0127] According to the identifier of the target system and the identifier of the target service layer in the target system recorded in the preset abnormal key information extraction rules, determine whether the abnormal operation information is a second abnormal information related to the target service layer in the target system;
[0128] If so, then according to the abnormal information composition recorded in the preset abnormal key information extraction rules, key content is identified from the abnormal operation information as the abnormal key information.
[0129] Optionally, when the computer-executable instructions are executed by the processor, the exception key information includes the exception name, exception class name, exception method name, and exception code line number.
[0130] Optionally, when the computer-executable instructions are executed by the processor, a first exception summary is generated based on the exception key information, including:
[0131] The exception name, exception class name, and exception method name in the exception key information are concatenated to obtain the first string;
[0132] The first string is processed by message digest processing to obtain the first anomaly digest information.
[0133] Optionally, when the computer-executable instructions are executed by the processor, a second exception summary is generated based on the exception key information, including:
[0134] The exception name, exception class name, exception method name, and exception code line number in the exception key information are concatenated to obtain the second string;
[0135] The second string is processed into a message digest to obtain the second anomaly digest information.
[0136] Optionally, when the computer-executable instructions are executed by the processor, determining whether the anomaly of the target system is the first occurrence based on the first anomaly summary information, the second anomaly summary information, and the historical anomaly summary information of the target system includes:
[0137] Extract a first type of historical summary information to characterize the abnormal code fragment from the abnormal historical summary information of the target system, and extract a second type of historical summary information to characterize the position of the abnormal code fragment in the source code of the target system;
[0138] The system searches for information in the first type of historical summary information that is identical to the first abnormal summary information to obtain a first search result; and searches for information in the second type of historical summary information that is identical to the second abnormal summary information to obtain a second search result.
[0139] If both the first search result and the second search result are negative, the anomaly of the target system is determined to be the first occurrence. If the first search result is positive and the second search result is negative, the anomaly of the target system is determined to be a suspected first occurrence. If both the first search result and the second search result are positive, the anomaly of the target system is determined to be a non-first occurrence.
[0140] Optionally, when the computer-executable instructions are executed by the processor, based on the judgment result, exception handling related to the target developer is performed, including:
[0141] When the judgment result indicates that the anomaly in the target system is the first occurrence or a suspected first occurrence, an alarm message is sent to the target developer.
[0142] When the judgment result indicates that the anomaly of the target system is not the first occurrence, the anomaly of the target system is ignored.
[0143] In the embodiments of this specification, after the target system is running, abnormal operation information of the target system can be obtained, and key abnormal information can be extracted from the abnormal operation information. Based on the key abnormal information, first abnormal summary information and second abnormal summary information are generated. The first abnormal summary information is used to characterize the abnormal code fragment in the target system, and the second abnormal summary information is used to characterize the position of the abnormal code fragment in the source code of the target system. Based on the first abnormal summary information, the second abnormal summary information, and the historical abnormal summary information of the target system, it is determined whether the abnormality of the target system is the first occurrence. This automatically determines whether the abnormality of the target system is the first occurrence, eliminating the need for developers to make manual judgments. This improves the efficiency of identifying the first occurrence of an abnormality and improves the efficiency of abnormality handling. It solves the problem that developers need to manually browse the abnormal operation log and identify the first occurrence of an abnormality, which is slow and reduces the efficiency of abnormality handling.
[0144] The system anomaly handling device provided in one embodiment of this specification can implement the various processes in the aforementioned system anomaly handling method embodiments and achieve the same functions and effects, which will not be repeated here.
[0145] Furthermore, another embodiment of this specification provides a computer-readable storage medium for storing computer-executable instructions that, when executed by a processor, implement the following process:
[0146] After the target system is running, abnormal operation information of the target system is acquired in real time; wherein, the target system is jointly developed by multiple developers, including the target developer; the target developer adds target functional modules to the target system;
[0147] According to the preset rules for extracting critical abnormal information, critical abnormal information is extracted from the abnormal operation information.
[0148] Based on the aforementioned key anomaly information, a first anomaly summary information and a second anomaly summary information are generated. The first anomaly summary information is used to characterize the abnormal code fragment in the target system, and the second anomaly summary information is used to characterize the location of the abnormal code fragment in the source code of the target system.
[0149] Based on the first anomaly summary information, the second anomaly summary information, and the historical anomaly summary information of the target system, it is determined whether the anomaly of the target system is the first occurrence. Based on the determination result, anomaly handling related to the target developer is performed.
[0150] Optionally, when the computer-executable instructions are executed by the processor, abnormal key information is extracted from the abnormal operation information according to preset abnormal key information extraction rules, including:
[0151] According to the identifier of the target system recorded in the preset abnormal key information extraction rules, determine whether the abnormal operation information is the first abnormal information related to the target system;
[0152] If so, then according to the abnormal information composition recorded in the preset abnormal key information extraction rules, key content is identified from the abnormal operation information as the abnormal key information.
[0153] Optionally, when the computer-executable instructions are executed by the processor, abnormal key information is extracted from the abnormal operation information according to preset abnormal key information extraction rules, including:
[0154] According to the identifier of the target system and the identifier of the target service layer in the target system recorded in the preset abnormal key information extraction rules, determine whether the abnormal operation information is a second abnormal information related to the target service layer in the target system;
[0155] If so, then according to the abnormal information composition recorded in the preset abnormal key information extraction rules, key content is identified from the abnormal operation information as the abnormal key information.
[0156] Optionally, when the computer-executable instructions are executed by the processor, the critical exception information includes the exception name, exception class name, exception method name, and exception code line number.
[0157] Optionally, when the computer-executable instructions are executed by the processor, a first exception summary information is generated based on the exception key information, including:
[0158] The exception name, exception class name, and exception method name in the exception key information are concatenated to obtain the first string;
[0159] The first string is processed by message digest processing to obtain the first anomaly digest information.
[0160] Optionally, when the computer-executable instructions are executed by the processor, a second exception summary is generated based on the exception key information, including:
[0161] The exception name, exception class name, exception method name, and exception code line number in the exception key information are concatenated to obtain the second string;
[0162] The second string is processed into a message digest to obtain the second anomaly digest information.
[0163] Optionally, when the computer-executable instructions are executed by the processor, determining whether the anomaly of the target system is the first occurrence based on the first anomaly summary information, the second anomaly summary information, and the historical anomaly summary information of the target system includes:
[0164] Extract a first type of historical summary information to characterize the abnormal code fragment from the abnormal historical summary information of the target system, and extract a second type of historical summary information to characterize the position of the abnormal code fragment in the source code of the target system;
[0165] The system searches for information in the first type of historical summary information that is identical to the first abnormal summary information to obtain a first search result; and searches for information in the second type of historical summary information that is identical to the second abnormal summary information to obtain a second search result.
[0166] If both the first search result and the second search result are negative, the anomaly of the target system is determined to be the first occurrence. If the first search result is positive and the second search result is negative, the anomaly of the target system is determined to be a suspected first occurrence. If both the first search result and the second search result are positive, the anomaly of the target system is determined to be a non-first occurrence.
[0167] Optionally, when the computer-executable instructions are executed by the processor, based on the judgment result, exception handling related to the target developer is performed, including:
[0168] When the judgment result indicates that the anomaly in the target system is the first occurrence or a suspected first occurrence, an alarm message is sent to the target developer.
[0169] When the judgment result indicates that the anomaly of the target system is not the first occurrence, the anomaly of the target system is ignored.
[0170] In the embodiments of this specification, after the target system is running, abnormal operation information of the target system can be obtained, and key abnormal information can be extracted from the abnormal operation information. Based on the key abnormal information, first abnormal summary information and second abnormal summary information are generated. The first abnormal summary information is used to characterize the abnormal code fragment in the target system, and the second abnormal summary information is used to characterize the position of the abnormal code fragment in the source code of the target system. Based on the first abnormal summary information, the second abnormal summary information, and the historical abnormal summary information of the target system, it is determined whether the abnormality of the target system is the first occurrence. This automatically determines whether the abnormality of the target system is the first occurrence, eliminating the need for developers to make manual judgments. This improves the efficiency of identifying the first occurrence of an abnormality and improves the efficiency of abnormality handling. It solves the problem that developers need to manually browse the abnormal operation log and identify the first occurrence of an abnormality, which is slow and reduces the efficiency of abnormality handling.
[0171] The computer-readable storage medium includes read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks, etc.
[0172] When the computer-executable instructions stored in the storage medium provided in one embodiment of this specification are executed by the processor, they can realize the various processes in the aforementioned system exception handling method embodiments and achieve the same functions and effects, which will not be repeated here.
[0173] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments.
[0174] The above description is merely an embodiment of this specification and is not intended to limit this document. Various modifications and variations can be made to the embodiments described in this specification by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this document should be included within the scope of the claims of this document.
Claims
1. A system abnormality processing method characterized by comprising: The method comprises the following steps: adding a target function module in a target system; obtaining abnormal running information of the target system in real time after the target system is running, wherein the target system is developed by a plurality of developers including a target developer, and the target developer adds a target function module in the target system; extracting abnormal key information from the abnormal running information according to a preset abnormal key information extraction rule; generating first abnormal summary information and second abnormal summary information based on the abnormal key information, wherein the first abnormal summary information is used to represent an abnormal code segment in the target system, and the second abnormal summary information is used to represent a position of the abnormal code segment in source code of the target system; judging whether the abnormality of the target system is a first occurrence according to the first abnormal summary information, the second abnormal summary information and historical abnormal summary information of the target system, and performing abnormality processing related to the target developer based on a judgment result; judging whether the abnormality of the target system is a first occurrence according to the first abnormal summary information, the second abnormal summary information and historical abnormal summary information of the target system, comprising: extracting first type historical summary information used to represent an abnormal code segment from the historical abnormal summary information of the target system, and extracting second type historical summary information used to represent a position of the abnormal code segment in source code of the target system; finding whether there is the same information as the first abnormal summary information in the first type historical summary information to obtain a first finding result, and finding whether there is the same information as the second abnormal summary information in the second type historical summary information to obtain a second finding result; if the first finding result and the second finding result are both no, it is determined that the abnormality of the target system is a first occurrence, if the first finding result is yes and the second finding result is no, it is determined that the abnormality of the target system is a suspected first occurrence, and if the first finding result and the second finding result are both yes, it is determined that the abnormality of the target system is a non-first occurrence.
2. The method of claim 1, wherein, extracting abnormal key information from the abnormal running information according to a preset abnormal key information extraction rule, comprising: judging whether the abnormal running information is first abnormal information related to the target system according to an identifier of the target system recorded in the preset abnormal key information extraction rule; if yes, identifying key content from the abnormal running information as the abnormal key information according to abnormal information composition content recorded in the preset abnormal key information extraction rule.
3. The method of claim 1, wherein, extracting abnormal key information from the abnormal running information according to a preset abnormal key information extraction rule, comprising: judging whether the abnormal running information is second abnormal information related to a target service layer in the target system according to an identifier of the target system and an identifier of the target service layer in the target system recorded in the preset abnormal key information extraction rule; If yes, key content is identified from the abnormal running information as the abnormal key information according to abnormal information composition content recorded in a preset abnormal key information extraction rule.
4. The method according to claim 2 or 3, characterized in that, The abnormal key information includes an abnormal name, an abnormal class name, an abnormal method name, and an abnormal code line number.
5. The method of claim 4, wherein, Based on the abnormal key information, first abnormal summary information is generated, including: The abnormal name, the abnormal class name, and the abnormal method name in the abnormal key information are spliced to obtain a first string; The first string is subjected to information digest processing to obtain the first abnormal summary information.
6. The method of claim 4, wherein, Based on the abnormal key information, second abnormal summary information is generated, including: The abnormal name, the abnormal class name, the abnormal method name, and the abnormal code line number in the abnormal key information are spliced to obtain a second string; The second string is subjected to information digest processing to obtain the second abnormal summary information.
7. The method of claim 1, wherein, Based on the judgment result, abnormal processing related to the target developer is performed, including: When the judgment result represents that the abnormality of the target system is first occurrence or suspected first occurrence, an alarm message is sent to the target developer; When the judgment result represents that the abnormality of the target system is not first occurrence, the abnormality of the target system is ignored.
8. A system abnormality handling apparatus characterized by comprising: Including: An information acquisition unit is configured to acquire abnormal running information of a target system in real time after the target system is developed and runs, wherein the target system is developed by a plurality of developers including a target developer, and the target developer adds a target function module to the target system; An information extraction unit is configured to extract abnormal key information from the abnormal running information according to a preset abnormal key information extraction rule; An abstract generation unit is configured to generate first abnormal summary information and second abnormal summary information based on the abnormal key information, wherein the first abnormal summary information is used to represent an abnormal code segment in the target system, and the second abnormal summary information is used to represent a position of the abnormal code segment in source code of the target system; An abnormal processing unit is configured to determine whether an abnormality of the target system is first occurrence according to the first abnormal summary information, the second abnormal summary information, and historical abnormal summary information of the target system, and perform abnormal processing related to the target developer based on a judgment result; The abnormal processing unit is specifically configured to: extract first type historical summary information representing an abnormal code segment from the historical abnormal summary information of the target system, and extract second type historical summary information representing a position of the abnormal code segment in source code of the target system; find whether there is the same information as the first abnormal summary information in the first type historical summary information to obtain a first finding result, and find whether there is the same information as the second abnormal summary information in the second type historical summary information to obtain a second finding result; If the first search result and the second search result are both no, it is determined that the abnormality of the target system is first occurrence, if the first search result is yes and the second search result is no, it is determined that the abnormality of the target system is suspected first occurrence, and if the first search result and the second search result are both yes, it is determined that the abnormality of the target system is non-first occurrence.
9. The apparatus of claim 8, wherein, The information extraction unit is specifically configured to: According to the identification of the target system recorded in the preset abnormal key information extraction rule, it is determined whether the abnormal running information is first abnormal information related to the target system. If yes, according to the abnormal information composition content recorded in the preset abnormal key information extraction rule, the key content is identified from the abnormal running information as the abnormal key information.
10. The apparatus of claim 8, wherein, The information extraction unit is specifically configured to: According to the identification of the target system and the identification of the target service layer in the target system recorded in the preset abnormal key information extraction rule, it is determined whether the abnormal running information is second abnormal information related to the target service layer in the target system. If yes, according to the abnormal information composition content recorded in the preset abnormal key information extraction rule, the key content is identified from the abnormal running information as the abnormal key information.
11. The apparatus of claim 9 or 10, wherein, The abnormal key information includes abnormal name, abnormal class name, abnormal method name and abnormal code line number.
12. A system abnormality handling apparatus characterized by comprising: It comprises: A memory, a processor and computer executable instructions stored on the memory and executable on the processor, which when executed by the processor implement the steps of the system exception handling method according to any one of claims 1-7.
13. A computer-readable storage medium, characterized in that, The computer readable storage medium is used to store computer executable instructions, which when executed by the processor implement the steps of the system exception handling method according to any one of claims 1-7.
Citation Information
Patent Citations
Data processing method, terminal and computer readable storage medium
CN108829535A
Application exception restoration method and device, computer program product and storage medium
CN113613063A