CN-113190412-B - Error log classification method and device
Abstract
The invention discloses a classification method and a classification device for error logs, comprising the steps of obtaining each case step result log, wherein each case step result log is used for recording the execution state of a corresponding step in case execution, determining the step type of the corresponding step of the case step error result log according to the case step error result log in each case step result log, wherein the case step error result log is the result log of the last step after case execution fails, determining the error type of the case step error result log according to the step type of the corresponding step of the case step error result log, and determining the error information of the case step error result log according to the preset rule of the error type, thereby realizing automatic analysis of the error log, improving the efficiency of analyzing the error log and freeing manpower.
Inventors
- ZENG QINGXI
- LI JING
- JIN XIAOFENG
- WANG HUIHUI
- ZENG BO
- LUO CHUNGUANG
- WANG JIN
Assignees
- 深圳前海微众银行股份有限公司
Dates
- Publication Date
- 20260512
- Application Date
- 20210521
Claims (7)
- 1. A method for classifying an error log, comprising: The method comprises the steps of obtaining a step result log of each use case, wherein the step result log of each use case is used for recording the execution state of a corresponding step in the execution of the use case; Determining the step type of a step corresponding to the case step error result log according to the case step error result log in each case step result log, wherein the step type comprises determining the resource information of the case step error result log according to the resource ID of the case step error result log, wherein the resource ID is in one-to-one correspondence with the resource information, determining the step type of the step corresponding to the case step error result log according to the resource information of the case step error result log, wherein the resource information comprises interface resources, database table operation/assertion resources, extension script resources, sub-case resources and parameter assertion resources, and the step type comprises interface steps, database table operation/assertion steps, extension script steps, sub-case steps and parameter assertion steps; Determining the error type of the case step error result log according to the step type of the step corresponding to the case step error result log, wherein the method comprises the steps of determining that the error type is an interface message error type if the step type is a parameter assertion step and the step type of the last step of the case step error result log corresponding to the step is an interface step, otherwise determining that the error type is a database table error type if the step type is the interface step, determining that the error type is an interface message error type if the step type is the interface step, determining that the error type is a database table error type if the step type is a database table operation/assertion step, determining that the error type is an extension script error type if the step type is an extension script error type, and determining that the error type is a sub-case error type if the step type is the sub-case step; When the error type of the case step error result log is determined to be the interface message error type, acquiring an interface message, and determining the error information of the case step error result log according to the interface message and the preset rule of the interface message error type; when the error type of the case step error result log is determined to be the database table error type, the extension script error type or the sub case error type, determining error information according to the information of the case step error result log.
- 2. The method of claim 1, wherein determining the error information of the use case step error result log according to the interface message and a preset rule of the interface message error type comprises: Converting the interface message into a preset data structure, and determining a field path meeting the conditions; Extracting information of the field path according to the field path; and determining the information of the field path as the error information of the case step error result log.
- 3. The method of claim 1, wherein upon determining that the error type is the database table error type, the extended script error type, or the child use case error type, determining error information from information of the use case step error result log comprises: When the error type is determined to be the database table error type, if the database table error type is abnormal in operation, determining the operation abnormality information of the case step error result log as the error information; When the error type is determined to be the error type of the extension script, determining a script name path and execution information of the extension script as the error information; And when the error type is determined to be the child case error type, determining the unique identification of the child case as the error information.
- 4. The method of claim 1, wherein after determining the error information of the use case step error result log, further comprising: Aggregating error information of the case step error result log of each case; and classifying the use cases according to the error information to obtain error results of the use cases.
- 5. A device for classifying an error log, comprising: the system comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring each case step result log, and the each case step result log is used for recording the execution state of the corresponding step in the case execution; The processing module is used for determining the step type of the corresponding step of the case step error result log according to the case step error result log in the case step result log, and comprises determining the resource information of the case step error result log according to the resource ID of the case step error result log, wherein the resource ID is in one-to-one correspondence with the resource information, determining the step type of the corresponding step of the case step error result log according to the resource information of the case step error result log, wherein the resource information comprises interface resources, database table operation/assertion resources, extension script resources, sub-case resources and parameter assertion resources, and the step type comprises interface steps, database table operation/assertion steps, extension script steps, sub-case steps and parameter assertion steps; Determining the error type of the case step error result log according to the step type of the step corresponding to the case step error result log, wherein the method comprises the steps of determining that the error type is an interface message error type if the step type is a parameter assertion step and the step type of the last step of the case step error result log corresponding to the step is an interface step, otherwise determining that the error type is a database table error type if the step type is the interface step, determining that the error type is an interface message error type if the step type is the interface step, determining that the error type is a database table error type if the step type is a database table operation/assertion step, determining that the error type is an extension script error type if the step type is an extension script error type, and determining that the error type is a sub-case error type if the step type is the sub-case step; When the error type of the case step error result log is determined to be the interface message error type, acquiring an interface message, and determining the error information of the case step error result log according to the interface message and the preset rule of the interface message error type; when the error type of the case step error result log is determined to be the database table error type, the extension script error type or the sub case error type, determining error information according to the information of the case step error result log.
- 6. A computer device, comprising: a memory for storing program instructions; A processor for invoking program instructions stored in said memory to perform the method of any of claims 1 to 4 in accordance with the obtained program.
- 7. A computer-readable storage medium storing computer-executable instructions for causing a computer to perform the method of any one of claims 1 to 4.
Description
Error log classification method and device Technical Field The invention relates to the field of financial science and technology (Fintech), in particular to a method and a device for classifying error logs. Background With the development of computer technology, more and more technologies (such as blockchain, cloud computing or big data) are applied in the financial field, the traditional financial industry is gradually changed to financial technology, and big data technology is not exceptional, but because of the requirements of safety and real-time performance of the financial and payment industries, higher requirements are also put on logs generated in the testing process. In the prior art, when the automation case log is an error log, a tester is required to analyze the failure reason of the automation case, and record the error classification of an automation user, such as interface assertion error, script operation error, sub-case execution error, and the like. However, a large amount of automation case logs are analyzed in an artificial way, the phenomenon of missing analysis is easy to occur, and the manpower resource and the cost are consumed excessively, so that the efficiency is low. Therefore, a method for classifying the automation case logs of the errors is needed, so that the efficiency of analyzing the error logs is improved, and the labor force is liberated. Disclosure of Invention The embodiment of the invention provides a method for classifying error logs, which is used for improving the efficiency of analyzing the error logs and freeing up labor force. In a first aspect, an embodiment of the present invention provides a method including: The method comprises the steps of obtaining a step result log of each use case, wherein the step result log of each use case is used for recording the execution state of a corresponding step in the execution of the use case; Determining the step type of the corresponding step of the case step error result log according to the case step error result log in the case step result log, wherein the case step error result log is the result log of the last step after the case fails to be executed; Determining the error type of the case step error result log according to the step type of the corresponding step of the case step error result log; And determining error information of the case step error result log according to the preset rule of the error type. According to the technical scheme, after the execution of one use case is completed, the use case comprises a plurality of use case step result logs, each use case step result log comprises a successful result log and an error result log, wherein the error result log is generally the last step result log in the plurality of use case step result logs, then the error source, namely the error type, of the use case step error result log can be determined according to the information in the use case step error result log through the error result log (the last step result log), and then the error information of the use case step error result log is determined according to a preset rule, wherein the preset rule and the error type are correspondingly set, so that automatic analysis of the error log is realized, the efficiency of analyzing the error log is improved, and manpower is liberated. Optionally, determining the step type of the step corresponding to the case step error result log according to the case step error result log in the case step result log includes: determining resource information of the case step error result log according to the resource ID of the case step error result log, wherein the resource ID and the resource information are in one-to-one correspondence; Determining a step type of a step corresponding to the case step error result log according to the resource information of the case step error result log, wherein the resource information comprises an interface resource, a database table operation/assertion resource, an extension script resource, a sub-case resource and a parameter assertion resource, and the step type comprises an interface step, a database table operation/assertion step, an extension script step, a sub-case step and a parameter assertion step. According to the technical scheme, the resource information is determined according to the resource ID recorded in the case step error result log, and then the step type is determined according to the resource information, so that the automatic analysis of the case step error result log is realized, and the labor force is released. Optionally, determining the error type of the case step error result log according to the step type of the corresponding step of the case step error result log includes: if the step type is a parameter assertion step and the step type of the last step of the step corresponding to the case step error result log is an interface step, determining that the error type is an interface message error type, othe