Error analysis method and device, computer equipment and storage medium

By building an error analysis model based on the audit function and using decision tree technology to automatically analyze equipment errors, it solves the user's time-consuming problem of locating errors, improves development efficiency and ensures system stability.

CN118796533APending Publication Date: 2024-10-18INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410856956.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-28
Publication Date
2024-10-18

AI Technical Summary

Technical Problem

When a device encounters an error, users need to spend a lot of time locating and analyzing the error, especially during the development phase, resulting in a tedious manual analysis process that is time-consuming and error-prone.

Method used

Obtain the command line list and module characteristics of the device under test through the audit function, build an error analysis model, use decision tree technology to automatically determine the error probability of the command line list to be analyzed, generate analysis reports and execute preset processing rules to reduce error location time.

Benefits of technology

It achieves rapid automated error analysis, reduces the burden on developers, improves development efficiency, and ensures system stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118796533A_ABST
    Figure CN118796533A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of data processing, and discloses an error analysis method and device, computer equipment and a storage medium, and the method comprises the steps: obtaining a command line configured by tested equipment based on an auditing function; under the condition that the tested equipment has an error, determining a command line list corresponding to the error, and determining a module feature corresponding to each command line in the command line list; constructing an error analysis model by taking the command line list corresponding to the error and the corresponding module characteristics as the characteristic attributes of the error; the error analysis model is used for determining the error probability of the to-be-analyzed command line list. The error analysis model can conveniently and quickly perform error analysis on the currently configured to-be-analyzed command line list so as to automatically determine the error possibility of the to-be-analyzed command lines, so that developers can be assisted in analyzing errors, the development and analysis process can be accelerated, and the burden of development / network management personnel can also be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to an error analysis method, device, computer equipment and storage medium. Background Art

[0002] When a device encounters an error, users (e.g., developers, network administrators, etc.) often need to spend a lot of time locating and finding the error. This may involve analyzing a large number of system logs and event records that record important information such as the device's operating status, error messages, and user operations.

[0003] Due to the complexity and huge amount of log data, users often need to face tedious manual analysis process, which is not only time-consuming but also prone to errors. Especially in the development stage, developers need to find problems in a large amount of log information, which will result in a lot of analysis time. Summary of the invention

[0004] In view of this, the present invention provides a method, apparatus, computer device and storage medium for error analysis to solve the problem of time-consuming error analysis.

[0005] In a first aspect, the present invention provides a method for error analysis, comprising:

[0006] Based on the audit function, obtain the command line of the device under test configuration;

[0007] In the case where an error occurs in the device under test, determining a command line list corresponding to the error, and determining a module feature corresponding to each command line in the command line list;

[0008] The command line list corresponding to the error and the corresponding module features are used as feature attributes of the error to construct an error analysis model; the error analysis model is used to determine the error probability of the command line list to be analyzed.

[0009] In some optional implementations, the taking the command line list corresponding to the error and the corresponding module features as feature attributes of the error to construct an error analysis model includes:

[0010] Constructing a data set; the data set includes a plurality of errors and corresponding feature attributes;

[0011] generating a plurality of different training sets according to the data set;

[0012] Constructing a decision tree for error analysis according to each of the training sets;

[0013] An error analysis model is constructed according to the plurality of decision trees; the error analysis model is used to determine the error probability of the command line list to be analyzed according to the analysis results of the plurality of decision trees.

[0014] In some optional implementations, the command line list includes command lines arranged in an execution order;

[0015] The step of constructing a decision tree for error analysis according to each of the training sets comprises:

[0016] For each of the training sets, determining the first command line of each feature attribute in the training set;

[0017] The operation of dividing the command line is executed cyclically until the condition for stopping dividing the command line is met;

[0018] The operation of dividing the command line includes:

[0019] Determine the first current command line of each characteristic attribute in the current training subset; the initial value of the current training subset is the training set;

[0020] Select one from the plurality of first current command lines as the first partition attribute corresponding to the command line node of the decision tree;

[0021] According to the first division attribute, the current training subset is divided into a plurality of mutually disjoint first training subsets;

[0022] For each of the first training subsets, taking the module feature corresponding to the first command line of the first training subset as the second partitioning attribute corresponding to the module feature node, and generating a decision subtree including the module feature node;

[0023] According to the second partitioning attribute of each leaf node of the decision subtree, the first training subset is partitioned into at least one second training subset that is mutually disjoint and does not include the first current command line; the second training subset is used as the current training subset for the next round of command line partitioning operation.

[0024] In some optional implementations, generating a plurality of different training sets according to the data set includes:

[0025] Setting a unique index for each of the errors in the data set;

[0026] For each of the training sets, the process of randomly selecting indexes is cyclically executed until the number of indexes reaches a preset number; the process of randomly selecting indexes comprises: randomly selecting an index corresponding to the data set as a target index, and copying the target index to an index list;

[0027] The target error corresponding to the target index in the data set is located according to the index list, and the target error is copied to the training set to form a training set including the preset number of target errors.

[0028] In some optional embodiments, the method further comprises:

[0029] Obtaining a list of command lines to be analyzed; the list of command lines to be analyzed includes at least one command line to be analyzed;

[0030] taking all the command lines to be analyzed in the command line list to be analyzed and the module features corresponding to the command lines to be analyzed as feature attributes of the command line list to be analyzed;

[0031] The characteristic attributes of the command line list to be analyzed are input into the error analysis model, and the error probability of the command line list to be analyzed is determined according to the analysis result of the error analysis model.

[0032] In some optional implementations, after determining the error probability of the command line list to be analyzed according to the analysis result of the error analysis model, the method further includes:

[0033] Generate an analysis report; the analysis report includes the execution order of all the command lines to be analyzed in the list of command lines to be analyzed, and the probability of at least one error occurring.

[0034] In some optional implementations, after determining the error probability of the command line list to be analyzed according to the analysis result of the error analysis model, the method further includes:

[0035] Determining a preset processing rule corresponding to the error probability of the command line list to be analyzed;

[0036] Execute a corresponding processing strategy according to the preset processing rules; the preset processing rules include: generating an alarm message when the error probability exceeds a first preset threshold; prohibiting command line configuration when the error probability exceeds a second preset threshold, and / or restoring the system configuration based on a rollback mechanism; the second preset threshold is greater than the first preset threshold.

[0037] In a second aspect, the present invention provides an error analysis device, comprising:

[0038] Audit module, used to obtain the command line of the device under test configuration based on the audit function;

[0039] A determination module, used for determining, when an error occurs in the device under test, a command line list corresponding to the error, and determining a module feature corresponding to each command line in the command line list;

[0040] The model building module is used to build an error analysis model by taking the command line list corresponding to the error and the corresponding module features as the feature attributes of the error; the error analysis model is used to determine the error probability of the command line list to be analyzed.

[0041] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the error analysis method of the first aspect or any corresponding embodiment thereof by executing the computer instructions.

[0042] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the error analysis method of the first aspect or any corresponding embodiment thereof.

[0043] In a fifth aspect, the present invention provides a computer program product, comprising computer instructions for causing a computer to execute the error analysis method of the first aspect or any corresponding embodiment thereof.

[0044] The embodiment of the present invention uses the audit function to obtain the command line list when an error occurs in at least one device under test, and then based on the command line list and the module characteristics of each command line, the characteristic attributes of the corresponding error can be determined, so as to train an error analysis model. Based on the error analysis model, the error analysis of the currently configured command line list to be analyzed can be conveniently and quickly performed to automatically determine the possibility of errors in these command lines to be analyzed, which can assist developers in analyzing errors, speed up the development and analysis process, and reduce the burden on developers / network management personnel. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the related technologies, the drawings required for use in the specific embodiments or the related technical descriptions will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0046] Figure 1 is a flowchart of a method for error analysis according to an embodiment of the present invention;

[0047] Figure 2 is a schematic diagram of an architecture for obtaining a command line according to an embodiment of the present invention;

[0048] Figure 3is a flow chart of another error analysis method according to an embodiment of the present invention;

[0049] Figure 4 is a schematic diagram of generating multiple training sets according to an embodiment of the present invention;

[0050] Figure 5 is a schematic diagram of a decision tree according to an embodiment of the present invention;

[0051] Figure 6 is another schematic diagram of a decision tree according to an embodiment of the present invention;

[0052] Figure 7 is a schematic diagram of comprehensively processing analysis results of multiple decision trees according to an embodiment of the present invention;

[0053] Figure 8 is a schematic diagram of generating an analysis report according to an embodiment of the present invention;

[0054] Fig. 9 is a schematic diagram of generating a corresponding processing strategy based on a preset processing rule according to an embodiment of the present invention;

[0055] Fig.10 is a structural block diagram of an apparatus for error analysis according to an embodiment of the present invention;

[0056] Fig.11 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0057] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0058] AAA is a security management mechanism that helps organizations ensure the security, compliance, and traceability of systems and resources, and provides comprehensive monitoring and logging of user activities. It specifically includes three main components: Authentication, Authorization, and Accounting.

[0059] Authentication: Authentication is the process of confirming the identity of a user. When a user attempts to access a system or resource, the system will ask the user to provide proof of identity, such as a user name and password. Only after the user passes the authentication will the system allow the user to access the system or resource.

[0060] Authorization: Authorization is the process of determining the operations a user is allowed to perform or the resources they are allowed to access. Once a user passes identity authentication, the system will determine whether the user has permission to perform specific operations or access specific resources based on the user's identity and permission settings.

[0061] Auditing: Auditing is the process of recording user activities and events. When a user logs into a system, accesses resources, performs an action, or performs other activities, the system records relevant information, such as the user name, timestamp, resources accessed, or actions performed. These log records can be used for security audits, compliance audits, usage monitoring, and investigations.

[0062] TACACS+ (Terminal Access Controller Access Control System Plus) is a protocol for network device authentication, authorization, and account management. It is widely used in enterprise network management for authentication, authorization, and account management. It provides powerful functions and flexible settings to help organizations achieve secure management and control of network resources. Compared with the original TACACS protocol, TACACS+ provides more powerful, flexible, and secure functions.

[0063] Faced with the problem that users need to spend a lot of time locating device errors, the error analysis method provided in the embodiment of the present invention utilizes the audit (Accounting) function of AAA to build a decision tree for predicting errors. Based on the decision tree, possible errors can be automatically determined, simplifying the error locating process and improving development efficiency. AAA audit (accounting) is a mechanism for recording user activities of network devices. It monitors and tracks user activities by recording information such as user login time, accessed resources, and operations performed. Combined with the TACACS+ protocol, more comprehensive AAA functions can be implemented.

[0064] According to an embodiment of the present invention, a method embodiment of error analysis is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0065] This embodiment provides an error analysis method, which can be applied to a device that supports an audit function, such as a TACACS server. Figure 1 is a flow chart of a method for error analysis according to an embodiment of the present invention. Figure 1 As shown, the process includes the following steps.

[0066] Step S101: Based on the audit function, a command line configured by the device under test is obtained.

[0067] In this embodiment, the method can be implemented by a TACACS server, which has strong security, supports flexible access control and multiple identity authentication mechanisms, and can meet the needs of different scenarios; after the user authenticates through TACACS+, the TACACS server can record and track the user's operation history, including login time, accessed resources, and operations performed, so as to achieve comprehensive monitoring and tracking of user activities. This information can be used for subsequent security monitoring, user behavior analysis, compliance auditing, and other purposes.

[0068] Figure 2 FIG. 1 shows a schematic diagram of the architecture for obtaining command lines. Figure 2 As shown in the figure, based on the AAA audit function, the TACACS server can collect user-configured command lines (cmd) from multiple devices under test (DUT). The TACACS server collects data from multiple devices under test, which can collect diverse data, and then train the error analysis model more intelligently; and, each device under test does not need to calculate independently, and a TACACS server can be responsible for the calculation, which can save the device unnecessary calculation overhead.

[0069] Specifically, when an error occurs when the device under test executes a command line, the TACACS server can be notified. The notification information sent by the device under test may include one or more command lines that caused the error, or the TACACS server may determine the one or more command lines executed by the device under test at this time from the log, which is not limited here. In addition, the notification information may also include the specific error type of the error.

[0070] Step S102: when an error occurs in the device under test, a command line list corresponding to the error is determined, and module features corresponding to each command line in the command line list are determined.

[0071] In this embodiment, if an error occurs in the device under test, the TACACS server can determine one or more command lines that cause the error, thereby generating a command line list corresponding to the error, and the command line list includes these command lines. Optionally, since the execution order of the command lines will also affect whether an error occurs, the error type, etc., the command lines can be arranged in sequence in the command line list according to the execution order of the command lines.

[0072] Table 1 shows various errors and their corresponding command line lists. As shown in Table 1, the command line list of error E1 includes three command lines, namely cmd1, cmd3, and cmd4. In other words, after the device under test executes cmd1, cmd3, and cmd4 in sequence, error E1 may occur.

[0073] Table 1

[0074] mistake Command Line List E1 cmd1, cmd3, cmd4 E2 cmd2, cmd3, cmd5 E3 cmd1, cmd2, cmd3, cmd5 E4 cmd2, cmd5 E5 cmd1, cmd3, cmd5

[0075] Furthermore, for each command line, the module features corresponding to the command line can be collected from the corresponding logs. The module features can be module names, such as BGP (Border Gateway Protocol), NDP (Neighbor Discovery Protocol), ARP (Address Resolution Protocol), etc.; or, the module features can be more precise module events, such as adding or deleting IP addresses, adding or deleting neighbors, etc.

[0076] Table 2 shows the module features corresponding to different command lines. As shown in Table 2, the command line cmd1 corresponds to three module features, namely moduleA, moduleB, and moduleC, and these module features can form a corresponding module feature list. In different environments, the same command line may correspond to different operations, so that the same command line may correspond to different module feature lists, which is based on actual conditions.

[0077] Table 2

[0078] Command Line Module feature list cmd1 moduleA, moduleB, moduleC cmd2 moduleB、moduleC cmd3 moduleA, moduleD, moduleE cmd4 moduleD cmd5 moduleA, moduleB, moduleD

[0079] Step S103, using the command line list corresponding to the error and the corresponding module features as feature attributes of the error to construct an error analysis model; the error analysis model is used to determine the error probability of the command line list to be analyzed.

[0080] In this embodiment, for each error reported by the device under test, the characteristic attributes corresponding to the device are determined. Specifically, the command line list corresponding to the error and the corresponding module features are used as the characteristic attributes of the error. For example, taking Table 1 and Table 2 above as examples, for error E1, its characteristic attributes include the command line list cmd1, cmd3, cmd4, and the module features corresponding to each command line, that is, the module features moduleA, moduleB, moduleC corresponding to cmd1, the module features moduleA, moduleD, moduleE corresponding to cmd3, and the module feature moduleD corresponding to cmd4.

[0081] Since the command line has a certain order, the characteristic attribute sequence of the error can be generated according to the execution order of the command line and the module features corresponding to the corresponding command line. For example, the characteristic attribute sequence corresponding to the above error E1 can be expressed as: {cmd1, moduleA, moduleB, moduleC, cmd3, moduleA, moduleB, moduleE, cmd4, moduleD}.

[0082] In this embodiment, these errors and corresponding characteristic attributes (for example, characteristic attribute sequences) can be used as training samples of the model. Model training is performed based on these training samples, and an error analysis model capable of implementing error analysis can be obtained by training. The error analysis model can be used to determine the error probability of the command line list to be analyzed, that is, after obtaining the command line list to be analyzed that needs to be analyzed for error, the characteristic attributes of the command line list to be analyzed are determined, and then the error analysis model is used to determine the error probability corresponding to the characteristic attributes of the command line list to be analyzed, and when the command line list to be analyzed may be wrong, the corresponding error type can be determined.

[0083] For example, during the development phase, the command line list configured by the developer can be used as the command line list to be analyzed, and the error probability of the command line list to be analyzed can be determined based on the error analysis model, thereby assisting the developer in determining whether the command line may be erroneous and improving the developer's development efficiency.

[0084] After the device under test executes the command line, if no error occurs, it can also send information to the TACACS server indicating that the command line is correct. Alternatively, it can also not send any information. In this case, the TACACS server can also read one or more corresponding command lines from the log and determine that these command lines will not cause errors. Model training can also be performed using these error-free command line lists, so that the constructed error analysis model can determine whether the command line list to be analyzed may be wrong.

[0085] The error analysis method provided by the embodiment of the present invention uses the audit function to obtain the command line list when an error occurs in at least one device under test, and then based on the command line list and the module characteristics of each command line, the characteristic attributes of the corresponding error can be determined, thereby training an error analysis model. Based on the error analysis model, the error analysis of the currently configured command line list to be analyzed can be conveniently and quickly performed to automatically determine the possibility of errors in these command lines to be analyzed, which can assist developers in analyzing errors, accelerate the development and analysis process, and also reduce the burden on developers / network management personnel.

[0086] This embodiment provides an error analysis method, which can be applied to a device that supports an audit function, such as a TACACS server. Figure 3 is a flow chart of a method for error analysis according to an embodiment of the present invention. Figure 3 As shown, the process includes the following steps.

[0087] Step S301: Based on the audit function, a command line configured by the device under test is obtained.

[0088] For details, please see Figure 1 Step S101 of the illustrated embodiment will not be described in detail here.

[0089] Step S302: when an error occurs in the device under test, a command line list corresponding to the error is determined, and module features corresponding to each command line in the command line list are determined.

[0090] For details, please see Figure 1 Step S102 of the illustrated embodiment will not be described in detail here.

[0091] Step S303: construct an error analysis model by taking the command line list corresponding to the error and the corresponding module features as feature attributes of the error; the error analysis model is used to determine the error probability of the command line list to be analyzed.

[0092] For details, please see Figure 1 Step S103 of the illustrated embodiment will not be described in detail here.

[0093] In some optional implementations, the error analysis model is constructed based on a decision tree. Specifically, the above step S303 "using the command line list corresponding to the error and the corresponding module features as feature attributes of the error to construct an error analysis model" includes the following steps A1 to A4.

[0094] Step A1, constructing a data set; the data set includes multiple errors and corresponding feature attributes.

[0095] In this embodiment, multiple command line lists where errors occur can be obtained from multiple devices under test, and then a correspondence between the errors and corresponding feature attributes (including the command line list and the module features of the corresponding command lines) is established. This correspondence can be used as a sample data that can be used for model training, thereby forming a corresponding data set.

[0096] For example, the characteristic attribute of the error can be used as the input data of the corresponding sample data, and the error type of the error can be used as the label data of the sample data.

[0097] Step A2: Generate multiple different training sets based on the data set.

[0098] In this embodiment, in order to improve the accuracy of error analysis, multiple different training sets are generated based on the data set, each training set is used to construct a decision tree, and then error analysis can be performed based on multiple decision trees.

[0099] Optionally, the step A2 of "generating a plurality of different training sets according to the data set" may include the following steps A21 to A23.

[0100] In step A21, a unique index is set for each error in the data set.

[0101] Step A22, for each training set, the process of randomly selecting indexes is cyclically executed until the number of indexes reaches a preset number; the process of randomly selecting indexes includes: randomly selecting an index corresponding to the data set as a target index, and copying the target index to the index list.

[0102] Step A23, locating the target error corresponding to the target index in the data set according to the index list, and copying the target error to the training set to form a training set including a preset number of target errors.

[0103] Figure 4 A schematic diagram of generating multiple training sets is shown. Figure 4 As shown, for each error in the data set, a unique index is set. Figure 4 For example, a data set includes 100 errors, and indexes 1 to 100 are set for the 100 errors respectively.

[0104] For each training set, a corresponding index list is configured for it. In the process of generating each training set, an index is randomly selected from the data set as the target index multiple times, and the target index is copied to the index list of the training set in a copying manner.

[0105] To generate Figure 4Taking the process of training set A as an example, when the random index selection process is executed for the first time, index 23 is randomly selected as the target index and index 23 is copied to the index list; when the random index selection process is executed for the second time, index 44 is randomly selected as the target index and index 44 is copied to the index list, and so on. In addition, a preset number n of samples in the training set is pre-set, and n does not exceed the number of samples in the data set (i.e., the number of errors), so that Figure 4 For example, n≤100; for example, n=50, that is, after 50 target indexes are selected, the process of randomly selecting indexes is stopped, and finally an index list containing 50 target indexes is generated.

[0106] The target index is selected in a copying manner so that the process of generating the index list does not affect the index of the data set itself. In the next random index selection process, an index can still be randomly selected from the complete index of the data set as the target index, that is, some target indexes in the index list may be the same. Figure 4 As shown, the training set B includes a plurality of indexes 34 .

[0107] After determining the index list of the training set, the error in the data set, i.e., the target error, can be located based on the target index in the index list, and then the target error can be copied to the training set in a copying manner, and finally a training set including n target errors can be obtained. It can be understood that the same target error can be included in the training set.

[0108] In this embodiment, by duplicating the index, data can be randomly extracted to form a training set, which can ensure the randomness between different training sets; and the data in the training set is repeatable, which can avoid the problem of sample reduction caused by splitting the data set. In addition, the decision trees are subsequently constructed based on these training sets, which can ensure the diversity of the decision trees and improve the generalization ability of the error analysis model.

[0109] Step A3: construct a decision tree for error analysis based on each training set.

[0110] In this embodiment, after multiple training sets are determined, each training set is used to train a decision tree for error analysis. For example, if K training sets are determined from the data set, K decision trees can be constructed based on the K training sets.

[0111] Optionally, as described above, the erroneous command line list includes command lines arranged in execution order; and the above step A3 "constructing a decision tree for error analysis according to each training set" may specifically include the following steps A31 to A32.

[0112] Step A31, for each training set, determine the first command line for each feature attribute in the training set.

[0113] Step A32, the operation of dividing the command line is executed cyclically until the condition for stopping dividing the command line is met.

[0114] In this embodiment, for each training set, in the process of constructing a corresponding decision tree based on the training set, since the characteristic attributes of the error mainly include two categories: command line and module features, and since the execution order of the command line is related to the error type, correspondingly, the nodes of the constructed decision tree are mainly divided into two categories: command line nodes and module feature nodes. In this embodiment, based on the first command line in the training set, the root node of the decision tree is constructed, and the root node is the command line node.

[0115] Specifically, by cyclically executing the operation of dividing the command line, the command line nodes of the decision tree are set in order; when the condition for stopping dividing the command line is met, the decision tree can be constructed. The condition for stopping dividing the command line can be specifically: the decision tree reaches a preset maximum depth, or the samples in the divided subset (such as the subsequent second training subset) all correspond to the same error type, which can be determined based on actual conditions.

[0116] The "operation of dividing the command line" in step A32 may specifically include steps A321 to A325.

[0117] Step A321, determining the first current command line of each characteristic attribute in the current training subset; the initial value of the current training subset is the training set.

[0118] Step A322: Select one from the multiple first current command lines as the first partitioning attribute corresponding to the command line node of the decision tree.

[0119] In this embodiment, when the command line division operation is performed for the first time, the complete training set is used as the "current training subset" at this time, and the first command line of each characteristic attribute in the training set is based on the first current command line. At this time, one can be selected from multiple (partial or all) first current command lines based on information gain, Gini coefficient, etc. as the first division attribute corresponding to the root node (command line node) of the decision tree. The root node is used to divide different first command lines.

[0120] Assume that the errors contained in a training set are as shown in Table 1 above. The training set includes five errors, and the first command line of each error is cmd1, cmd2, cmd1, cmd2, cmd1, so cmd1 and cmd2 can be the first current command line at this time. At this time, one of cmd1 and cmd2 can be selected as the partition attribute of the root node based on information gain, Gini coefficient, etc., that is, the first partition attribute. For example, if cmd2 is selected as the first partition attribute of the root node, the root node is used to distinguish whether the first command line is cmd2.

[0121] Step A323: divide the current training subset into a plurality of mutually non-overlapping first training subsets according to the first division attribute.

[0122] In this embodiment, the first partition data can also be used to partition the current training subset to obtain a plurality of mutually non-intersecting new training subsets, namely, first training subsets; generally, two first training subsets can be obtained.

[0123] Continuing with the training set shown in Table 1 above as an example, if cmd2 is selected as the first partitioning attribute of the root node, a first training subset whose first command line is cmd2 can be partitioned, and the first training subset includes E2 and E4. Another first training subset whose first command line is not cmd2 (the first command line is cmd1) can also be partitioned, and the first training subset includes E1, E3 and E5.

[0124] Step A324, for each first training subset, the module feature corresponding to the first command line of the first training subset is used as the second partitioning attribute corresponding to the module feature node, and a decision subtree including the module feature node is generated.

[0125] Step A325, according to the second partitioning attribute of each leaf node of the decision subtree, the first training subset is partitioned into at least one second training subset that is mutually disjoint and does not contain the first current command line; the second training subset is used as the current training subset for the next round of command line partitioning operation.

[0126] In this embodiment, for each first training subset divided, a module feature node can be generated based on the module feature corresponding to the first command line of the first training subset, and then a decision subtree composed of these module feature nodes is formed. The decision subtree is a part of the decision tree, which represents the process of making a decision using the module feature corresponding to the first command line in the first training subset.

[0127] For example, for the first training subset including E2 and E4, the first command line of the first training subset is cmd2, and the corresponding module features include moduleB and moduleC, so a module feature node corresponding to moduleB and moduleC can be constructed to form a corresponding decision subtree.

[0128] For example, taking the error E4 shown in Table 1 and Table 2 as an example, the error E4 is caused by command lines cmd2 and cmd5. Combining the module features of these two command lines, a decision tree related to the error E4 can be constructed. A schematic diagram of the decision tree can be seen in Figure 5 shown.

[0129] It can be understood that the decision tree has multiple branches. Figure 5 Only the branch for judging error E4 is taken as an example. For example, if the module features of command line cmd5 are moduleA, moduleB, moduleE, and error E6 is generated, the constructed decision tree can be as follows: Figure 6 shown.

[0130] In addition, after the decision subtree is generated, the first training subset can be further divided based on the leaf nodes of the decision subtree (the leaf nodes are module feature nodes), thereby generating at least one second training subset that is mutually disjoint and does not contain the first current command line. In other words, in the process of generating the second training subset, the original first current command line is removed, so that the second command line in the first training subset becomes the first command line in the second training subset. When the second training subset is subsequently used as the current training subset for the next round of command line division operations, the first current command line of the current training subset determined is the second command line of the first training subset generated in the previous round.

[0131] For example, still taking the first training subset including E2 and E4 as an example, since its policy subtree has only one leaf node, a second training subset is divided, which also includes E2 and E4, but removes the first command line in the first training subset. At this time, the command line lists corresponding to E2 and E4 are: "cmd3, cmd5", "cmd5". In the next round, the first current command line includes cmd3 and cmd5, and then the operation of dividing the command line can be repeated.

[0132] Optionally, for the module features corresponding to the command line, since the module features are not sequential, and for the same command line, the same module features are generally easy to exist in the different module feature lists corresponding to it, in order to reduce the branches of the decision subtree, the appropriate module feature node is selected and generated based on the number of module features. Specifically, the above step A324 "using the module feature corresponding to the first command line of the first training subset as the second partitioning attribute corresponding to the module feature node, and generating a decision subtree containing the module feature node" can include: looping the process of partitioning the module features until the condition for stopping the partitioning of the module features is met, and the condition for stopping the partitioning of the module features can specifically be traversing all the module features corresponding to the first command line of the first training subset.

[0133] Among them, the "process of dividing module features" can specifically include the following steps A3241 to A3242.

[0134] Step A3241, determining the first module feature in the module feature list corresponding to the first command line of the first training subset; the first module feature is the module feature with the largest number among the module features of the undetermined module feature nodes.

[0135] Step A3242: Use the first module feature as the partition attribute corresponding to the module feature node of the decision subtree.

[0136] In this embodiment, each time a module feature node is generated, a corresponding module feature node is generated based on the module features with the largest number, so that the root node of the decision subtree (a module feature node) has a smaller branch probability. While being able to simplify the decision subtree structure, the module feature node can be quickly determined without calculating information such as information gain, thereby quickly constructing a suitable decision subtree.

[0137] Step A4, constructing an error analysis model based on multiple decision trees; the error analysis model is used to determine the error probability of the command line list to be analyzed based on the analysis results of the multiple decision trees.

[0138] After constructing multiple decision trees, an analysis result can be output based on the analysis results of these decision trees, and the error probability of the command line list to be analyzed can be determined based on the analysis result. Figure 7 As shown, the analysis results of multiple decision trees can be comprehensively processed by averaging, weighting or voting, etc., which is not limited in this embodiment.

[0139] Step S304, obtaining a list of command lines to be analyzed; the list of command lines to be analyzed includes at least one command line to be analyzed.

[0140] In the development stage, R&D personnel need to find problems in a large amount of log information, which will cause a lot of analysis time; or, in the actual operation stage, the tested device often needs to update the version, but there may be unknown problems after the upgrade. In the embodiment of the present invention, the corresponding command line to be analyzed can be obtained, and the corresponding command line list to be analyzed can be constructed, and then the error analysis model that has been constructed can be used to quickly perform error analysis, thereby reducing the development analysis time, and by predicting the occurrence of errors, it can also avoid repeated system errors.

[0141] Step S305: All the command lines to be analyzed in the command line list to be analyzed and the module features corresponding to the command lines to be analyzed are used as feature attributes of the command line list to be analyzed.

[0142] Step S306: input the characteristic attributes of the command line list to be analyzed into the error analysis model, and determine the error probability of the command line list to be analyzed according to the analysis result of the error analysis model.

[0143] In this embodiment, similar to the process of generating characteristic attributes when training the error analysis model, for the command line list to be analyzed, the command line to be analyzed and the module features corresponding to the command line to be analyzed can also be used as the characteristic attributes of the command line list to be analyzed, which will not be described in detail here. After determining the characteristic attributes of the command line list to be analyzed, the error analysis model can be used to perform error analysis on these characteristic attributes, thereby obtaining the error probability of the command line list to be analyzed.

[0144] In some optional implementations, after step S306 "determining the error probability of the command line list to be analyzed according to the analysis result of the error analysis model", the method further includes the following step B1.

[0145] Step B1, generating an analysis report; the analysis report includes the execution order of all the command lines to be analyzed in the command line list to be analyzed, and the probability of at least one error occurring.

[0146] In this embodiment, after determining the error probability of the corresponding error based on the error analysis model, a corresponding analysis report can be generated and provided to R&D for analysis and problem location. Figure 8 As shown; among them, Figure 8 The dotted box in represents the analysis results of the error analysis model on each command line list to be analyzed. Taking the first command line list to be analyzed as an example, it has a 30% probability of error E1, a 30% probability of error E2, and a 40% probability of no error.

[0147] Optionally, after step S306 of "determining the error probability of the command line list to be analyzed according to the analysis result of the error analysis model", the method further includes the following steps C1 to C2.

[0148] Step C1, determining a preset processing rule corresponding to the error probability of the command line list to be analyzed.

[0149] Step C2, execute the corresponding processing strategy according to the preset processing rules; the preset processing rules include: when the error probability exceeds the first preset threshold, generate an alarm message; when the error probability exceeds the second preset threshold, prohibit the command line configuration, and / or, restore the system configuration based on the rollback mechanism; the second preset threshold is greater than the first preset threshold.

[0150] In this embodiment, rules for handling errors, namely preset processing rules, can be pre-set, and the preset processing rules are used to indicate that different processing strategies are executed in different situations. Specifically, different processing strategies can be executed according to the error probability. If the error probability exceeds a first preset threshold (for example, 80%), an alarm message is generated to prompt the user; when the error probability exceeds a second preset threshold (for example, 90%, 100%, etc.), command line configuration is prohibited, and / or the system configuration is restored based on a rollback mechanism to ensure the stability of the system. The process of generating corresponding processing strategies based on preset processing rules can be found in Fig. 9 As shown, no further details are given here.

[0151] The error analysis method provided by the embodiment of the present invention can conveniently and quickly perform error analysis on the list of command lines to be analyzed in the current configuration based on the error analysis model, which can accelerate the research and development time; by predicting the probability of configuration errors and then taking corresponding measures, the stability of the system can be guaranteed. By forming a training set by copying the index, the randomness between different training sets can be guaranteed, and the problem of sample reduction caused by splitting the data set can be avoided. The diversity of the decision tree can also be guaranteed, and the generalization ability of the error analysis model can be improved. The command line nodes of the decision tree are selected in turn according to the execution order of the command lines, and then the decision subtree formed by the module feature nodes is constructed, so that it can be constructed to distinguish the execution order of different command lines and distinguish the same command line corresponding to different module features, which can ensure the accuracy of the analysis results of the decision tree.

[0152] In the present embodiment, a device for error analysis is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions thereof will not be repeated. As used below, the term "module" may be a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and contemplated.

[0153] This embodiment provides a device for error analysis, such as Fig.10 As shown, including:

[0154] Audit module 1001, used to obtain command lines configured by the device under test based on the audit function;

[0155] A determination module 1002 is used to determine, when an error occurs in the device under test, a command line list corresponding to the error, and to determine a module feature corresponding to each command line in the command line list;

[0156] The model building module 1003 is used to build an error analysis model by taking the command line list corresponding to the error and the corresponding module features as the feature attributes of the error; the error analysis model is used to determine the error probability of the command line list to be analyzed.

[0157] In some optional implementations, the model building module 1003 uses the command line list corresponding to the error and the corresponding module features as feature attributes of the error to build an error analysis model, including:

[0158] Constructing a data set; the data set includes a plurality of errors and corresponding feature attributes;

[0159] generating a plurality of different training sets according to the data set;

[0160] Constructing a decision tree for error analysis according to each of the training sets;

[0161] An error analysis model is constructed according to the plurality of decision trees; the error analysis model is used to determine the error probability of the command line list to be analyzed according to the analysis results of the plurality of decision trees.

[0162] In some optional implementations, the command line list includes command lines arranged in an execution order;

[0163] The model building module 1003 builds a decision tree for error analysis according to each training set, including:

[0164] For each of the training sets, determining the first command line of each feature attribute in the training set;

[0165] The operation of dividing the command line is executed cyclically until the condition for stopping dividing the command line is met;

[0166] The operation of dividing the command line includes:

[0167] Determine the first current command line of each characteristic attribute in the current training subset; the initial value of the current training subset is the training set;

[0168] Select one from the plurality of first current command lines as the first partition attribute corresponding to the command line node of the decision tree;

[0169] According to the first division attribute, the current training subset is divided into a plurality of mutually disjoint first training subsets;

[0170] For each of the first training subsets, taking the module feature corresponding to the first command line of the first training subset as the second partitioning attribute corresponding to the module feature node, and generating a decision subtree including the module feature node;

[0171] According to the second partitioning attribute of each leaf node of the decision subtree, the first training subset is partitioned into at least one second training subset that is mutually disjoint and does not include the first current command line; the second training subset is used as the current training subset for the next round of command line partitioning operation.

[0172] In some optional implementations, the model building module 1003 generates a plurality of different training sets according to the data set, including:

[0173] Setting a unique index for each of the errors in the data set;

[0174] For each of the training sets, the process of randomly selecting indexes is cyclically executed until the number of indexes reaches a preset number; the process of randomly selecting indexes comprises: randomly selecting an index corresponding to the data set as a target index, and copying the target index to an index list;

[0175] The target error corresponding to the target index in the data set is located according to the index list, and the target error is copied to the training set to form a training set including the preset number of target errors.

[0176] In some optional embodiments, the device further comprises a processing module, configured to:

[0177] Obtaining a list of command lines to be analyzed; the list of command lines to be analyzed includes at least one command line to be analyzed;

[0178] taking all the command lines to be analyzed in the command line list to be analyzed and the module features corresponding to the command lines to be analyzed as feature attributes of the command line list to be analyzed;

[0179] The characteristic attributes of the command line list to be analyzed are input into the error analysis model, and the error probability of the command line list to be analyzed is determined according to the analysis result of the error analysis model.

[0180] In some optional implementations, after determining the error probability of the command line list to be analyzed according to the analysis result of the error analysis model, the processing module is further configured to:

[0181] Generate an analysis report; the analysis report includes the execution order of all the command lines to be analyzed in the list of command lines to be analyzed, and the probability of at least one error occurring.

[0182] In some optional implementations, after determining the error probability of the command line list to be analyzed according to the analysis result of the error analysis model, the processing module is further configured to:

[0183] Determining a preset processing rule corresponding to the error probability of the command line list to be analyzed;

[0184] Execute a corresponding processing strategy according to the preset processing rules; the preset processing rules include: generating an alarm message when the error probability exceeds a first preset threshold; prohibiting command line configuration when the error probability exceeds a second preset threshold, and / or restoring the system configuration based on a rollback mechanism; the second preset threshold is greater than the first preset threshold.

[0185] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.

[0186] The error analysis device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, including a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.

[0187] The embodiment of the present invention also provides a computer device having the above Fig.10 The apparatus for error analysis is shown.

[0188] See also Fig.11 , Fig.11 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Fig.11As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Fig.11 A processor 10 is taken as an example.

[0189] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.

[0190] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.

[0191] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0192] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.

[0193] The computer device further comprises a communication interface 30 for the computer device to communicate with other devices or a communication network.

[0194] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.

[0195] A part of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of the computer program instruction in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc., and accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.

[0196] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.

Claims

1. A method for error analysis, characterized in that: The method comprises: Based on the audit function, obtain the command line configured by the device under test; In the case where an error occurs in the device under test, determining a command line list corresponding to the error, and determining a module feature corresponding to each command line in the command line list; The command line list corresponding to the error and the corresponding module features are used as feature attributes of the error to construct an error analysis model; the error analysis model is used to determine the error probability of the command line list to be analyzed.

2. The method according to claim 1, characterized in that The step of using the command line list corresponding to the error and the corresponding module features as feature attributes of the error to construct an error analysis model includes: Constructing a data set; the data set includes a plurality of errors and corresponding feature attributes; generating a plurality of different training sets according to the data set; Constructing a decision tree for error analysis according to each of the training sets; An error analysis model is constructed according to the plurality of decision trees; the error analysis model is used to determine the error probability of the command line list to be analyzed according to the analysis results of the plurality of decision trees.

3. The method according to claim 2, characterized in that The command line list includes command lines arranged in execution order; The step of constructing a decision tree for error analysis according to each of the training sets comprises: For each of the training sets, determining the first command line of each feature attribute in the training set; The operation of dividing the command line is executed cyclically until the condition for stopping dividing the command line is met; The operation of dividing the command line includes: Determine the first current command line of each characteristic attribute in the current training subset; the initial value of the current training subset is the training set; Select one from the plurality of first current command lines as the first partition attribute corresponding to the command line node of the decision tree; According to the first division attribute, the current training subset is divided into a plurality of mutually disjoint first training subsets; For each of the first training subsets, taking the module feature corresponding to the first command line of the first training subset as the second partitioning attribute corresponding to the module feature node, and generating a decision subtree including the module feature node; According to the second partitioning attribute of each leaf node of the decision subtree, the first training subset is partitioned into at least one second training subset that is mutually disjoint and does not include the first current command line; the second training subset is used as the current training subset for the next round of command line partitioning operation.

4. The method according to claim 2, characterized in that: The generating a plurality of different training sets according to the data set comprises: Setting a unique index for each of the errors in the data set; For each of the training sets, the process of randomly selecting indexes is cyclically executed until the number of indexes reaches a preset number; the process of randomly selecting indexes comprises: randomly selecting an index corresponding to the data set as a target index, and copying the target index to an index list; The target error corresponding to the target index in the data set is located according to the index list, and the target error is copied to the training set to form a training set including the preset number of target errors.

5. The method according to claim 1, characterized in that Also includes: Obtaining a list of command lines to be analyzed; the list of command lines to be analyzed includes at least one command line to be analyzed; taking all the command lines to be analyzed in the command line list to be analyzed and the module features corresponding to the command lines to be analyzed as feature attributes of the command line list to be analyzed; The characteristic attributes of the command line list to be analyzed are input into the error analysis model, and the error probability of the command line list to be analyzed is determined according to the analysis result of the error analysis model.

6. The method according to claim 5, characterized in that After determining the error probability of the command line list to be analyzed according to the analysis result of the error analysis model, the method further includes: Generate an analysis report; the analysis report includes the execution order of all the command lines to be analyzed in the list of command lines to be analyzed, and the probability of at least one error occurring.

7. The method according to claim 5, characterized in that After determining the error probability of the command line list to be analyzed according to the analysis result of the error analysis model, the method further includes: Determining a preset processing rule corresponding to the error probability of the command line list to be analyzed; Execute a corresponding processing strategy according to the preset processing rules; the preset processing rules include: generating an alarm message when the error probability exceeds a first preset threshold; prohibiting command line configuration when the error probability exceeds a second preset threshold, and / or restoring the system configuration based on a rollback mechanism; the second preset threshold is greater than the first preset threshold.

8. An error analysis device, characterized in that: The device comprises: Audit module, used to obtain the command line of the device under test configuration based on the audit function; A determination module, used for determining, when an error occurs in the device under test, a command line list corresponding to the error, and determining a module feature corresponding to each command line in the command line list; The model building module is used to build an error analysis model by taking the command line list corresponding to the error and the corresponding module features as the feature attributes of the error; the error analysis model is used to determine the error probability of the command line list to be analyzed.

9. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the error analysis method according to any one of claims 1 to 7 by executing the computer instructions.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the error analysis method according to any one of claims 1 to 7.