Script error correction method and device

By obtaining the error report information generated during script execution and the fault knowledge information in the fault knowledge base, and performing fault location and processing, the problems of low efficiency and poor automation in the existing technology are solved, and efficient script error correction processing is achieved.

CN114328219BActive Publication Date: 2025-06-13工银科技有限公司 +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111624953.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-28
Publication Date
2025-06-13
Estimated Expiration
2041-12-28

AI Technical Summary

Technical Problem

In the prior art, there are problems of low efficiency and poor automation in the script execution process, resulting in high cost and low efficiency of script error correction.

Method used

By obtaining the error report information generated during script execution, combining the fault knowledge information in the preset fault knowledge base, fault cause location and fault type determination are carried out, and error correction is used to handle error correction, and the error correction script is obtained.

Benefits of technology

It improves the automation and efficiency of script failure handling, and reduces the professional requirements and costs of script error correction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114328219B_ABST
    Figure CN114328219B_ABST
Patent Text Reader

Abstract

The present disclosure provides a script error correction processing method, which is applied to the field of Internet technology or financial technology. The method includes: obtaining error report information generated during the execution of a script; locating the cause of a fault in the script execution process according to the error report information and fault knowledge information in a preset fault knowledge base to determine the type of script fault; and adopting a fault handling strategy matching the type of script fault to perform error correction processing on the content of the script with an error to obtain a corrected script, so as to execute the corresponding script function based on the corrected script. The present disclosure also provides a script error correction processing device, an electronic device, and a computer storage medium.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of Internet technologies, and in particular, to a method and apparatus for script error correction processing, an electronic device, a computer-readable storage medium, and a computer program product. Background Art

[0002] During the execution of a script, problems such as execution errors may occur. The efficiency of fault resolution affects the execution effect of the script, and the degree of automation of fault resolution affects the cost and efficiency of script error correction. In the process of implementing the technical solution of the present disclosure, the inventors found that the script error correction processing in the related art has the phenomena of low fault resolution efficiency and poor automation. Summary of the Invention

[0003] One aspect of the present disclosure provides a method for script error correction processing, which includes obtaining error report information generated during the execution of a script; performing fault cause location for the script execution process according to the error report information and fault knowledge information in a preset fault knowledge base to determine the script fault type; and adopting a fault handling strategy matching the script fault type to perform error correction processing on the reported error script content to obtain a corrected script, so as to execute the corresponding script function based on the corrected script.

[0004] Optionally, the fault knowledge information includes fault definition parameters and fault description information; the performing fault cause location for the script execution process according to the error report information and fault knowledge information in a preset fault knowledge base to determine the script fault type includes: when the error report information includes an error code, determining, in the fault knowledge base, the fault definition parameter associated with the error code in the error report information according to a preset mapping relationship between the error code and the fault definition parameter; determining the similarity between each type of fault description information and the error report information according to at least one type of fault description information associated with the fault definition parameter; taking the fault description information with the highest corresponding similarity in the at least one type of fault description information as the target fault description information; and taking the fault type indicated by the target fault description information as the script fault type.

[0005] Optionally, the fault knowledge information further includes at least one level of fault handling strategies associated with the fault description information; the adopting a fault handling strategy matching the script fault type to perform error correction processing on the reported error script content to obtain a corrected script includes: when the error report information includes error location information, taking the script content indicated by the error location information as the reported error script content to be subjected to error correction processing; and adopting the finest level of fault handling strategy associated with the target fault description information to perform error correction processing on the reported error script content to obtain the corrected script.

[0006] Optionally, the script content includes at least one of an action item, an object item, and a parameter item. The action item indicates a script action to be performed during the execution of the script. The object item indicates a control element that is the object of the script action. The parameter item indicates keywords and / or variables sent to the control element during the execution of the script action.

[0007] Optionally, adopting a fault handling strategy matching the script fault type to perform error correction processing on the reported script content to obtain a corrected script, including: when the script fault type indicates that the action item cannot be recognized, screening in the fault knowledge base for the current keyword characterizing the action item; using a candidate keyword having a preset mapping relationship with the current keyword to replace the current keyword, so as to use the candidate keyword to characterize the action item and obtain the corrected script, where the candidate keyword is a script action keyword that can be recognized.

[0008] Optionally, adopting a fault handling strategy matching the script fault type to perform error correction processing on the reported script content to obtain a corrected script, including: when the script fault type indicates that the execution of the action item fails, adding a waiting item adapted to the control element category associated with the script action indicated by the action item according to the control element category, to obtain the corrected script, where the waiting item indicates the maximum duration of waiting for the execution of the script action.

[0009] Optionally, adopting a fault handling strategy matching the script fault type to perform error correction processing on the reported script content to obtain a corrected script, including: when the script fault type indicates that the object item cannot be located, replacing the current positioning path for locating the object item with a candidate positioning path represented by the identity ID of the object item, where the identity IDs corresponding to different object items are different from each other.

[0010] Optionally, adopting a fault handling strategy matching the script fault type to perform error correction processing on the reported script content to obtain a corrected script, including: when the script fault type indicates that the method instruction defined by the parameter item cannot be recognized, screening in the fault knowledge base for the current method instruction defined by the parameter item; using a candidate method instruction having a preset mapping relationship with the current method instruction to replace the current method instruction, to obtain the corrected script, where the candidate method instruction is a function instruction that can be recognized, and the candidate method instruction and the current method instruction can implement the same script function.

[0011] Optionally, the method of performing error correction processing on the reported script content by adopting a fault handling strategy matching the script fault type to obtain a corrected script includes: splitting the script content into at least one corresponding function, where the at least one function includes the function to be error-corrected indicated by the error report information; performing at least one of the following processing on the function to be error-corrected to perform error correction processing on the reported script content and obtain the corrected script, correcting variables in the function to be error-corrected that are not initialized and / or not defined; correcting incorrect variable reference relationships in the function to be error-corrected; correcting duplicate-defined sub-functions according to the sub-functions called by the function to be error-corrected, and / or correcting misspelled content in the sub-functions.

[0012] Optionally, the method further includes: when the script fault type cannot be determined based on the fault knowledge base, adding the error report information to a manual processing queue and generating a prompt message for manually resolving the fault.

[0013] Optionally, the error report information includes error report information generated during the execution of a script program using the Junit unit test framework.

[0014] On the other hand, the present disclosure provides a script error correction processing device, including an acquisition module for acquiring error report information generated during script execution; a first processing module for positioning the cause of a fault during script execution according to the error report information and fault knowledge information in a preset fault knowledge base to determine the script fault type; and a second processing module for performing error correction processing on the reported script content by adopting a fault handling strategy matching the script fault type to obtain a corrected script, so as to execute the corresponding script function based on the corrected script.

[0015] Optionally, the fault knowledge information includes fault definition parameters and fault description information; the first processing module includes: a first processing sub-module for, when the error report information includes an error code, determining, in the fault knowledge base, fault definition parameters associated with the error code in the error report information according to a preset mapping relationship between the error code and the fault definition parameters; a second processing sub-module for determining the similarity between each type of fault description information and the error report information according to at least one type of fault description information associated with the fault definition parameters; a third processing sub-module for using the fault description information with the highest corresponding similarity among the at least one type of fault description information as the target fault description information; and a fourth processing sub-module for using the fault type indicated by the target fault description information as the script fault type.

[0016] Optionally, the fault knowledge information further includes at least one level of fault handling strategies associated with the fault description information; the second processing module includes: a fifth processing sub-module, configured to, when the error report information includes error location information, use the script content indicated by the error location information as the error reporting script content to be corrected; and a sixth processing sub-module, configured to perform error correction processing on the error reporting script content by using the finest level of fault handling strategy associated with the target fault description information, to obtain the corrected script.

[0017] Optionally, the script content includes at least one of an action item, an object item, and a parameter item, where the action item indicates a script action to be performed during the execution of the script, the object item indicates a control element that is the object of the script action, and the parameter item indicates a keyword and / or variable sent to the control element during the execution of the script action.

[0018] Optionally, the second processing module includes: a seventh processing sub-module, configured to, when the script fault type indicates that the action item cannot be recognized, screen the current keyword used to represent the action item in the fault knowledge base; and an eighth processing sub-module, configured to replace the current keyword with a candidate keyword having a preset mapping relationship with the current keyword, so as to use the candidate keyword to represent the action item, to obtain the corrected script, where the candidate keyword is a script action keyword that can be recognized.

[0019] Optionally, the second processing module includes: a ninth processing sub-module, configured to, when the script fault type indicates that the execution of the action item fails, add a waiting item adapted to the control element category associated with the script action indicated by the action item to the action item, to obtain the corrected script, where the waiting item indicates the maximum duration of waiting for the execution of the script action.

[0020] Optionally, the second processing module includes: a tenth processing sub-module, configured to, when the script fault type indicates that the object item cannot be located, replace the current positioning path used to locate the object item with a candidate positioning path represented by the identity ID of the object item, where the identity ID of different object items is different from each other.

[0021] Optionally, the second processing module includes: an eleventh processing sub-module, configured to screen for the current method instruction defined by the parameter item in the fault knowledge base when the script fault type indicates that the method instruction defined by the parameter item cannot be recognized; a twelfth processing sub-module, configured to replace the current method instruction with a candidate method instruction having a preset mapping relationship with the current method instruction to obtain the corrected script, where the candidate method instruction is a function instruction that can be recognized, and the candidate method instruction and the current method instruction can implement the same script function.

[0022] Optionally, the second processing module includes: a thirteenth processing sub-module, configured to split the script content into at least one corresponding function, where the at least one function includes the function to be corrected indicated by the error report information; a fourteenth processing sub-module, configured to perform at least one of the following processing on the function to be corrected to perform error correction processing on the reported error script content to obtain the corrected script, correct variables that are not initialized and / or not defined in the function to be corrected; correct variable reference relationships with errors in the function to be corrected; correct repeatedly defined sub-functions according to the sub-functions called by the function to be corrected, and / or correct spelling error content in the sub-functions.

[0023] Optionally, the apparatus further includes: a third processing module, configured to add the error report information to an artificial processing queue and generate a prompt message for artificially resolving the fault when the script fault type cannot be determined according to the fault knowledge base.

[0024] Optionally, the error report information includes error report information generated during the execution of the script program using the Junit unit test framework.

[0025] Another aspect of the present disclosure provides an electronic device, including: one or more processors; and a memory, configured to store one or more programs, where when the one or more programs are executed by the one or more processors, the one or more processors are caused to implement the method of the embodiments of the present disclosure.

[0026] Another aspect of the present disclosure provides a computer-readable storage medium, on which executable instructions are stored, and when the instructions are executed by a processor, the processor is caused to implement the method of the embodiments of the present disclosure.

[0027] Another aspect of the present disclosure provides a computer program product, including a computer program, where when the computer program is executed by a processor, the method of the embodiments of the present disclosure is implemented. Description of the Drawings

[0028] To more fully understand the present disclosure and its advantages, reference will now be made to the following description in conjunction with the accompanying drawings, where

[0029] Figure 1 the system architecture of a script error correction processing method and apparatus according to an embodiment of the present disclosure is schematically shown;

[0030] Figure 2 the flowchart of a script error correction processing method according to an embodiment of the present disclosure is schematically shown;

[0031] Figure 3 the schematic diagram of a script error correction processing process according to an embodiment of the present disclosure is schematically shown;

[0032] Figure 4 the block diagram of a script error correction processing apparatus according to an embodiment of the present disclosure is schematically shown;

[0033] Figure 5 the block diagram of an electronic device according to an embodiment of the present disclosure is schematically shown. Detailed Embodiments

[0034] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are merely exemplary and are not intended to limit the scope of the present disclosure. In the following detailed description, for the sake of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present disclosure. However, obviously, one or more embodiments can also be implemented without these specific details. In addition, in the following description, descriptions of well-known structures and technologies are omitted to avoid unnecessarily obscuring the concepts of the present disclosure.

[0035] The terms used herein are merely for describing specific embodiments and are not intended to limit the present disclosure. The terms "comprising", "including", etc. used herein indicate the presence of features, operations, operations, and / or components, but do not exclude the presence or addition of one or more other features, operations, operations, or components.

[0036] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification and should not be interpreted in an idealized or overly rigid manner.

[0037] In the case of using expressions such as "at least one of A, B, and C, etc.", generally, it should be interpreted according to the meaning commonly understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include, but not be limited to, a system having only A, only B, only C, having A and B, having A and C, having B and C, and / or having A, B, and C, etc.).

[0038] Some block diagrams and / or flowcharts are shown in the accompanying drawings. It should be understood that some of the blocks in the block diagrams and / or flowcharts, or combinations thereof, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable script error correction processing devices, so that when executed by the processor, these instructions can create a device for implementing the functions / operations illustrated in these block diagrams and / or flowcharts. The technology of the present disclosure can be implemented in the form of hardware and / or software (including firmware, microcode, etc.). Additionally, the technology of the present disclosure can take the form of a computer program product on a computer-readable storage medium storing instructions, which can be used by or in conjunction with an instruction execution system.

[0039] Embodiments of the present disclosure provide a script error correction processing method. The script error correction processing method includes: obtaining error report information generated during the execution of a script, performing fault cause location for the script execution process according to the error report information and fault knowledge information in a preset fault knowledge base to determine the script fault type, and adopting a fault handling strategy matching the script fault type to perform error correction processing on the reported script content to obtain a corrected script, so as to execute the corresponding script function based on the corrected script.

[0040] Figure 1 Schematically shows the system architecture of the script error correction processing method and device according to an embodiment of the present disclosure. It should be noted that Figure 1 The shown is only an example of the system architecture to which the embodiments of the present disclosure can be applied, to help those skilled in the art understand the technical content of the present disclosure, but it does not mean that the embodiments of the present disclosure cannot be used in other devices, systems, environments or scenarios.

[0041] As Figure 1 shown, the system architecture 100 may include terminal devices (multiple are shown in the figure, such as terminal devices 101, 102, 103), a network 104, and a server 105. The network 104 is a medium for providing a communication link between the terminal devices (such as terminal devices 101, 102, 103) and the server 105. The network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, etc. The server 105 may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud computing, network services, and middleware services.

[0042] Server 105 is used to obtain error report information generated during the execution of a script in a terminal device (such as terminal devices 101, 102, 103), and perform fault cause location for the script execution process based on the error report information and fault knowledge information in a preset fault knowledge base to determine the script fault type. Server 105 is also used to adopt a fault handling strategy matching the script fault type to perform error correction processing on the reported script content to obtain a corrected script, so as to execute the corresponding script function based on the corrected script.

[0043] It should be noted that the script error correction processing method and device of the embodiments of the present disclosure can be used in the financial field and can also be used in any field other than the financial field. The present disclosure will be elaborated in detail below in conjunction with the accompanying drawings and specific embodiments.

[0044] Figure 2 Schematically shows a flowchart of a script error correction processing method according to an embodiment of the present disclosure, as Figure 2 shown, method 200 may include operations S210 - S230.

[0045] In operation S210, obtain error report information generated during the execution of the script.

[0046] In operation S220, perform fault cause location for the script execution process based on the error report information and fault knowledge information in the preset fault knowledge base to determine the script fault type.

[0047] In operation S230, adopt a fault handling strategy matching the script fault type to perform error correction processing on the reported script content to obtain a corrected script, so as to execute the corresponding script function based on the corrected script.

[0048] The following examples illustrate the example processes of the steps of the script error correction processing method of this embodiment.

[0049] Exemplarily, the script content may include at least one of an action item, an object item, and a parameter item. The action item indicates the script action to be performed during the execution of the script, the object item indicates the control element that is the object of the script action, and the parameter item indicates the keyword and / or variable sent to the control element during the execution of the script action.

[0050] The action item indicates the script action to be performed during the execution of the script. The script action may, for example, include actions such as opening a program, sending a keyboard event, performing a mouse double - click / single - click event, object selection, object submission, clearing the value in the object, and judging the execution result of the event.

[0051] The object item indicates the control element that is the object of the script action. The control element may include, for example, window titles, window addresses, interface control elements, etc. The interface control elements may include, for example, input boxes, buttons, menus, pull-down boxes, etc. For the control element, the corresponding positioning type and positioning value can be set.

[0052] The positioning types of the control element may include, for example, positioning according to the element identification number of the control element, positioning according to the relative path of the control element in an Extensible Markup Language (XML) file, positioning according to the element category to which the control element belongs, positioning in a fuzzy matching manner, etc.

[0053] The parameter item indicates the keyword and / or variable sent to the control element during the execution of the script action. The parameter item is not a necessary item of the script content. Exemplarily, when performing a double-click mouse action, keywords and / or variables may not be sent to the control element. Another example is that when automatically filling in the password in a password box, the automatically filled password constitutes the parameter item during the execution of the script action.

[0054] Obtain the error report information generated during the execution of the script. According to the error report information and the fault knowledge information in the preset fault knowledge base, perform fault cause location for the script execution process to determine the script fault type.

[0055] The fault knowledge information in the fault knowledge base may include fault definition parameters and fault description information. The obtained error report information may include an error code. According to the pre-established correspondence between the error code, fault classification, and solution, the solution to the fault can be found. One example method is to determine the fault definition parameter associated with the error code in the error report information in the fault knowledge base according to the preset mapping relationship between the error code and the fault definition parameter. According to at least one type of fault description information associated with the fault definition parameter, determine the similarity between each type of fault description information and the error report information. Use the fault description information with the highest corresponding similarity in at least one type of fault description information as the target fault description information, and use the fault type indicated by the target fault description information as the script fault type.

[0056] Exemplarily, the obtained error report information contains the error code E2. According to the preset mapping relationship between the error code and the fault definition parameter, the fault definition parameter associated with the error code E2 is determined to be "application error". At least one type of fault description information associated with "application error" may include, for example, description information associated with error types such as program call error, system parameter error, and user data error.

[0057] Exemplarily, the obtained error report information contains an error code E22. According to the preset mapping relationship between the error code and the fault definition parameters, it is determined that the fault definition parameter associated with the error code E22 is "system parameter error". The fault description information associated with "system parameter error" may, for example, include description information associated with error types such as parameter setting out of bounds, parameter does not exist, parameter value is illegal, parameter definition is unclear, etc.

[0058] Determine the similarity between each type of fault description information and the error report information. Exemplarily, the fault description information is segmented to obtain a segmentation result, and the valid words in the segmentation result are input into a word vector model to obtain word vectors associated with each valid word. Valid words may, for example, be other words in the segmentation result except stop words.

[0059] Perform vector addition processing on the word vectors associated with each valid word to obtain a text vector corresponding to the fault description information. According to the text vectors of the fault description information associated with the fault definition parameters, by calculating the similarity between the text vectors, the target fault description information that matches the error code is determined. The fault type indicated by the target fault description information is used as the script fault type.

[0060] Adopt a fault handling strategy that matches the script fault type to perform error correction processing on the reported script content to obtain a corrected script, so as to execute the corresponding script function based on the corrected script. In one example, in the case where the script fault type cannot be determined according to the fault knowledge base, the error report information can be added to the manual processing queue and a prompt message for manually resolving the fault can be generated.

[0061] Exemplarily, the obtained error report information may include error report information generated during the execution of a script program using the Junit unit test framework. Junit is a Java language unit test framework that can be used to write and run repeatable tests.

[0062] Through the embodiments of the present disclosure, error report information generated during the execution of a script is obtained, and based on the error report information and the fault knowledge information in the preset fault knowledge base, the cause of the fault during the script execution process is located to determine the script fault type, and a fault handling strategy that matches the script fault type is adopted to perform error correction processing on the reported script content to obtain a corrected script, so as to execute the corresponding script function based on the corrected script.

[0063] Using the fault knowledge information and fault handling strategies in the fault knowledge base to automatically correct the error report information generated during the execution of the script, the script fault handling process can effectively reduce human participation, is conducive to realizing automated script fault handling, can effectively improve the script error correction efficiency, and reduce the professional requirements for script error correction.

[0064] Figure 3 Schematically shows a schematic diagram of a script error correction processing procedure according to an embodiment of the present disclosure.

[0065] As Figure 3 shown, the script error types in the script error correction processing procedure 300 may include unrecognized action items 301A, failed execution of action items 302A, unable to locate object items 303A, and unable to recognize method instructions defined by parameter items 304A. The fault handling strategies respectively matched with each script error type may be replacing the keyword used to represent the action item 301B, adding a waiting item for the action item with execution failure 302B, changing the positioning path of the object item 303B, and replacing the method instruction defined by the parameter item 304B.

[0066] The following example illustrates the example process of the script error correction processing procedure of this embodiment.

[0067] In the case where the script fault type indicates an unrecognized action item, screen the current keyword used to represent the action item in the fault knowledge base. Use the candidate keyword having a preset mapping relationship with the current keyword to replace the current keyword, so as to use the candidate keyword to represent the action item and obtain the corrected script. The candidate keyword is a script action keyword that can be recognized.

[0068] In the case where the script fault type indicates the failure of executing an action item, according to the control element category associated with the script action indicated by the action item, add a waiting item adapted to the control element category for the action item to obtain the corrected script. The waiting item indicates the maximum duration for waiting to execute the script action.

[0069] Within the maximum duration range indicated by the waiting item, if the control element is loaded, the script action is immediately executed. If the control element is not loaded after the waiting duration exceeds the maximum duration range, the script action is not executed. According to the control element category associated with the script action indicated by the action item, adding a waiting item adapted to the control element category for the action item can effectively prevent the problem that the execution of the script action fails due to the slow loading of the control element.

[0070] In the case where the script fault type indicates an inability to locate an object item, replace the current positioning path used to locate the object item with a candidate positioning path represented by the identity ID of the object item. The identity IDs corresponding to different object items are different from each other.

[0071] Exemplarily, in the case where the script failure type indicates that the object item cannot be located, the object item located by the script can be determined to be a static page element or a dynamic page element based on a preset identification field. For example, in the case where the script contains the accessibility_id or identifier field, it is determined that the script is used to locate static page elements. In the case where the script contains the ios field, it is determined that the script is used to locate dynamic page elements.

[0072] Static page elements include page elements in the user interface whose display positions and display contents do not change. For example, they can be menu options in the user interface or label elements corresponding to function modules. Dynamic page elements include page elements in the user interface that are dynamically generated or whose display contents change. For example, they can be lists or form elements in the user interface that display real-time updated data.

[0073] In the case where the script cannot locate static page elements, the current location path for the static page elements can be replaced with a candidate location path characterized by the identity ID of the static page elements. In the case where the script cannot locate dynamic page elements, it can be determined whether the underlying location path for the dynamic page elements is correct based on the fault handling strategy in the fault knowledge base. The underlying location path for dynamic page elements in the fault knowledge base can be manually entered by the operation and maintenance personnel or obtained by converting the XPath (XML Path Language) of the dynamic page elements.

[0074] In the case where the script failure type indicates that the method instruction defined by the parameter item cannot be recognized, the current method instruction defined by the parameter item is screened in the fault knowledge base. The current method instruction is replaced with a candidate method instruction that has a preset mapping relationship with the current method instruction to obtain a corrected script. The candidate method instruction is a function instruction that can be recognized, and the candidate method instruction and the current method instruction can achieve the same script function.

[0075] When performing error correction processing on the content of the error-reporting script, the script content can also be split into at least one corresponding function, and the at least one function includes the function to be error-corrected indicated by the error report information. At least one of the following processes is performed on the function to be error-corrected to perform error correction processing on the content of the error-reporting script and obtain a corrected script: correcting variables that are not initialized and / or not defined in the function to be error-corrected; correcting incorrect variable reference relationships in the function to be error-corrected; correcting duplicate-defined sub-functions according to the sub-functions called by the function to be error-corrected, and / or correcting misspelled content in the sub-functions.

[0076] In the case where the script failure type cannot be determined based on the failure knowledge base, the error report information can be added to the manual processing queue, and a prompt message for manually resolving the failure can be generated.

[0077] By using the failure knowledge information and failure handling strategies in the failure knowledge base to automatically correct the error report information generated during the script execution process, the accuracy of script failure handling can be effectively improved, which is beneficial to enhancing the automation degree of script failure handling, can effectively improve the script error correction efficiency, and reduce the professional requirements for script error correction.

[0078] Figure 4 A block diagram of a script error correction processing device according to an embodiment of the present disclosure is schematically shown.

[0079] As Figure 4 shown, the device 400 includes an acquisition module 401, a first processing module 402, and a second processing module 403.

[0080] The acquisition module 401 is configured to acquire the error report information generated during the script execution process; the first processing module 402 is configured to locate the cause of the failure during the script execution process according to the error report information and the failure knowledge information in the preset failure knowledge base to determine the script failure type; and the second processing module 403 is configured to perform error correction processing on the content of the reported error script by using a failure handling strategy matching the script failure type to obtain a corrected script, so as to execute the corresponding script function based on the corrected script.

[0081] Through the embodiment of the present disclosure, the error report information generated during the script execution process is acquired, the cause of the failure during the script execution process is located according to the error report information and the failure knowledge information in the preset failure knowledge base to determine the script failure type, and a failure handling strategy matching the script failure type is used to perform error correction processing on the content of the reported error script to obtain a corrected script, so as to execute the corresponding script function based on the corrected script.

[0082] By using the failure knowledge information and failure handling strategies in the failure knowledge base to automatically correct the error report information generated during the script execution process, the human participation in the script failure handling process can be effectively reduced, which is beneficial to realizing automated script failure handling, can effectively improve the script error correction efficiency, and reduce the professional requirements for script error correction.

[0083] According to an embodiment of the present disclosure, the fault knowledge information includes fault definition parameters and fault description information; the first processing module includes: a first processing sub-module, configured to, when the error report information includes an error code, determine, according to a preset mapping relationship between the error code and the fault definition parameters, the fault definition parameters associated with the error code in the fault knowledge base; a second processing sub-module, configured to determine the similarity between each type of fault description information and the error report information according to at least one type of fault description information associated with the fault definition parameters; a third processing sub-module, configured to use the fault description information with the highest corresponding similarity among at least one type of fault description information as the target fault description information; and a fourth processing sub-module, configured to use the fault type indicated by the target fault description information as the script fault type.

[0084] According to an embodiment of the present disclosure, the fault knowledge information further includes at least one level of fault handling strategies associated with the fault description information; the second processing module includes: a fifth processing sub-module, configured to, when the error report information includes error location information, use the script content indicated by the error location information as the error reporting script content to be corrected; and a sixth processing sub-module, configured to perform error correction processing on the error reporting script content by using the finest level of fault handling strategy associated with the target fault description information to obtain a corrected script.

[0085] According to an embodiment of the present disclosure, the script content includes at least one of an action item, an object item, and a parameter item. The action item indicates a script action to be performed during the execution of the script, the object item indicates a control element that is the object of the script action, and the parameter item indicates a keyword and / or variable sent to the control element during the execution of the script action.

[0086] According to an embodiment of the present disclosure, the second processing module includes: a seventh processing sub-module, configured to screen, in the fault knowledge base, the current keyword used to represent the action item when the script fault type indicates that the action item cannot be recognized; and an eighth processing sub-module, configured to replace the current keyword with a candidate keyword having a preset mapping relationship with the current keyword so as to use the candidate keyword to represent the action item and obtain a corrected script. The candidate keyword is a script action keyword that can be recognized.

[0087] According to an embodiment of the present disclosure, the second processing module includes: a ninth processing sub-module, configured to add a waiting item adapted to the control element category to the action item according to the control element category associated with the script action indicated by the action item when the script fault type indicates that the execution of the action item fails, to obtain a corrected script. The waiting item indicates the maximum duration for waiting to execute the script action.

[0088] According to an embodiment of the present disclosure, the second processing module includes: a tenth processing sub-module, configured to, when the script fault type indicates that the object item cannot be located, replace the current location path for locating the object item with a candidate location path represented by the identity ID of the object item. The identity IDs corresponding to different object items are different from each other.

[0089] According to an embodiment of the present disclosure, the second processing module includes: an eleventh processing sub-module, configured to screen for the current method instruction defined by the parameter item in the fault knowledge base when the script fault type indicates that the method instruction defined by the parameter item cannot be recognized; a twelfth processing sub-module, configured to replace the current method instruction with a candidate method instruction having a preset mapping relationship with the current method instruction to obtain a corrected script. The candidate method instruction is a function instruction that can be recognized, and the candidate method instruction and the current method instruction can implement the same script function.

[0090] According to an embodiment of the present disclosure, the second processing module includes: a thirteenth processing sub-module, configured to split the script content into at least one corresponding function, and the at least one function includes the function to be corrected indicated by the error report information; a fourteenth processing sub-module, configured to perform at least one of the following processing on the function to be corrected so as to perform error correction processing on the reported error script content to obtain a corrected script, correct variables that are not initialized and / or not defined in the function to be corrected; correct variable reference relationships with errors in the function to be corrected; correct repeatedly defined sub-functions according to the sub-functions called by the function to be corrected, and / or correct spelling error contents in the sub-functions.

[0091] According to an embodiment of the present disclosure, the apparatus further includes: a third processing module, configured to, when the script fault type cannot be determined according to the fault knowledge base, add the error report information to an artificial processing queue and generate a prompt message for artificially resolving the fault.

[0092] According to an embodiment of the present disclosure, the error report information includes error report information generated during the execution of the script program using the Junit unit test framework.

[0093] It should be noted that in the embodiments of the present disclosure, the implementation manners of the apparatus part are the same as or similar to those of the method part, and will not be described in detail here.

[0094] Any number of modules according to embodiments of the present disclosure, or at least part of the functions of any of them, may be implemented in one module. Any one or more of the modules according to embodiments of the present disclosure may be split into multiple modules for implementation. Any one or more of the modules according to embodiments of the present disclosure may be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on chip, a system on a substrate, a system in a package, an application specific integrated circuit (ASIC), or may be implemented by any other reasonable way of integrating or packaging circuits, etc., in hardware or firmware, or implemented in any one of the three implementation manners of software, hardware, and firmware, or in any suitable combination of several of them. Alternatively, one or more of the modules according to embodiments of the present disclosure may be at least partially implemented as a computer program module, and when the computer program module is run, the corresponding functions may be executed.

[0095] For example, any number of the acquisition module 401, the first processing module 402, and the second processing module 403 may be combined and implemented in one module, or any one of them may be split into multiple modules. Alternatively, at least part of the functions of one or more of these modules may be combined with at least part of the functions of other modules and implemented in one module. According to embodiments of the present disclosure, at least one of the acquisition module 401, the first processing module 402, and the second processing module 403 may be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on chip, a system on a substrate, a system in a package, an application specific integrated circuit (ASIC), or may be implemented by any other reasonable way of integrating or packaging circuits, etc., in hardware or firmware, or implemented in any one of the three implementation manners of software, hardware, and firmware, or in any suitable combination of several of them. At least one of the acquisition module 401, the first processing module 402, and the second processing module 403 may be at least partially implemented as a computer program module, and when the computer program module is run, the corresponding functions may be executed.

[0096] Figure 5 A block diagram of an electronic device 500 suitable for implementing a processing method and a processing device according to embodiments of the present disclosure is schematically shown. Figure 5 The illustrated electronic device 500 is only an example and should not impose any limitation on the functions and the scope of use of embodiments of the present disclosure.

[0097] As Figure 5As shown, the electronic device 500 according to an embodiment of the present disclosure includes a processor 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage section 508 into a random access memory (RAM) 503. The processor 501 can include, for example, a general microprocessor (e.g., CPU), an instruction set processor, and / or a related chipset, and / or a dedicated microprocessor (e.g., an application specific integrated circuit (ASIC)), and so on. The processor 501 can also include on-board memory for caching purposes. The processor 501 can include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present disclosure.

[0098] In the RAM 503, various programs and data required for the operation of the electronic device 500 are stored. The processor 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. The processor 501 performs various operations of the method flow according to an embodiment of the present disclosure by executing the program in the ROM 502 and / or the RAM 503. It should be noted that the program can also be stored in one or more memories other than the ROM 502 and the RAM 503. The processor 501 can also perform various operations of the method flow according to an embodiment of the present disclosure by executing the program stored in one or more memories.

[0099] According to an embodiment of the present disclosure, the electronic device 500 can further include an input / output (I / O) interface 505, and the input / output (I / O) interface 505 is also connected to the bus 504. The electronic device 500 can further include one or more of the following components connected to the I / O interface 505: an input section 506 including a keyboard, a mouse, etc.; an output section 507 including, for example, a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 508 including a hard disk, etc.; and a communication section 509 including a network interface card such as a LAN card, a modem, etc. The communication section 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to the I / O interface 505 as needed. A removable medium 511, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 510 as needed so that a computer program read from it can be installed into the storage section 508 as needed.

[0100] According to an embodiment of the present disclosure, the method flow according to the embodiment of the present disclosure can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable storage medium, and the computer program includes program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through the communication part 509, and / or installed from the removable medium 511. When the computer program is executed by the processor 501, the above functions defined in the system of the embodiment of the present disclosure are executed. According to an embodiment of the present disclosure, the above-described system, device, apparatus, module, unit, etc. can be implemented by computer program modules.

[0101] The present disclosure also provides a computer-readable storage medium, which may be included in the device / device / system described in the above embodiment; or may exist alone without being assembled into the device / device / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiment of the present disclosure is implemented.

[0102] According to an embodiment of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium, for example, it may include but is not limited to: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the above. In the present disclosure, the computer-readable storage medium may be any tangible medium that includes or stores a program, and the program can be used by or combined with an instruction execution system, device, or device. For example, according to an embodiment of the present disclosure, the computer-readable storage medium may include the above-described ROM 502 and / or RAM 503 and / or one or more memories other than ROM 502 and RAM 503.

[0103] An embodiment of the present disclosure also includes a computer program product, which includes a computer program, and the computer program includes program code for executing the method provided by the embodiment of the present disclosure. When the computer program product runs on an electronic device, the program code is used to cause the electronic device to implement the method for detecting file upload vulnerabilities provided by the embodiment of the present disclosure.

[0104] When the computer program is executed by the processor 501, the above functions defined in the system / device of the embodiment of the present disclosure are executed. According to an embodiment of the present disclosure, the above-described system, device, module, unit, etc. can be implemented by computer program modules.

[0105] In one embodiment, the computer program may rely on tangible storage media such as optical storage devices, magnetic storage devices, etc. In another embodiment, the computer program may also be transmitted and distributed in the form of a signal on a network medium, and downloaded and installed through the communication section 509, and / or installed from the removable medium 511. The program code included in the computer program may be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.

[0106] According to embodiments of the present disclosure, the program code for executing the computer program provided by the embodiments of the present disclosure may be written in any combination of one or more programming languages. Specifically, these computing programs may be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include but are not limited to, for example, Java, C++, Python, the "C" language, or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., by connecting through the Internet using an Internet service provider).

[0107] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagram may represent a module, a program segment, or a part of code, and the above-mentioned module, program segment, or part of code includes one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than marked in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram or flowchart, and the combination of blocks in the block diagram or flowchart, may be implemented by a dedicated hardware-based system for performing the specified functions or operations, or may be implemented by a combination of dedicated hardware and computer instructions.

[0108] The above describes the embodiments of the present disclosure. However, these embodiments are for illustrative purposes only and are not intended to limit the scope of the present disclosure. Without departing from the scope of the present disclosure, those skilled in the art can make various substitutions and modifications, and these substitutions and modifications should all fall within the scope of the present disclosure.

Claims

1. A method for script error correction processing, including: obtaining error report information generated during the execution of the script; locating the cause of the fault during the execution of the script according to the error report information and the fault knowledge information in the preset fault knowledge base to determine the script fault type, wherein the fault knowledge information includes fault definition parameters, fault description information, and at least one level of fault handling strategies associated with the fault description information; The locating the cause of the fault during the execution of the script according to the error report information and the fault knowledge information in the preset fault knowledge base to determine the script fault type includes: when the error report information includes an error code, determining the fault definition parameter associated with the error code in the error report information in the fault knowledge base according to the preset mapping relationship between the error code and the fault definition parameter; determining the similarity between each type of fault description information and the error report information according to at least one type of fault description information associated with the fault definition parameter; taking the fault description information with the highest corresponding similarity in the at least one type of fault description information as the target fault description information; and taking the fault type indicated by the target fault description information as the script fault type; and adopting a fault handling strategy matching the script fault type to perform error correction processing on the reported error script content to obtain a corrected script, so as to execute the corresponding script function based on the corrected script.

2. The method according to claim 1, wherein, the adopting a fault handling strategy matching the script fault type to perform error correction processing on the reported error script content to obtain a corrected script includes: when the error report information includes error location information, taking the script content indicated by the error location information as the reported error script content to be subjected to error correction processing; and adopting the finest level of fault handling strategy associated with the target fault description information to perform error correction processing on the reported error script content to obtain the corrected script.

3. The method according to claim 1, wherein, the script content includes at least one of an action item, an object item, and a parameter item, the action item indicates the script action to be performed during the execution of the script, the object item indicates the control element that is the object of the script action, and the parameter item indicates the keyword and / or variable sent to the control element during the execution of the script action.

4. The method according to claim 3, wherein, the adopting a fault handling strategy matching the script fault type to perform error correction processing on the reported error script content to obtain a corrected script includes: when the script fault type indicates that the action item cannot be recognized, screening the current keyword used to represent the action item in the fault knowledge base; using a candidate keyword having a preset mapping relationship with the current keyword to replace the current keyword, so as to use the candidate keyword to represent the action item to obtain the corrected script, wherein the candidate keyword is a script action keyword that can be recognized.

5. The method according to claim 3, Among them, adopting a fault handling strategy matching the script fault type to perform error correction processing on the reported error script content to obtain a corrected script, including: when the script fault type indicates that the execution of the action item fails, adding a waiting item adapted to the control element category associated with the script action indicated by the action item to the action item to obtain the corrected script, wherein the waiting item indicates the maximum duration for waiting to execute the script action.

6. The method according to claim 3, wherein, adopting a fault handling strategy matching the script fault type to perform error correction processing on the reported error script content to obtain a corrected script, including: when the script fault type indicates that the object item cannot be located, replacing the current location path for locating the object item with a candidate location path represented by the identity ID identifier of the object item, wherein the identity ID identifiers corresponding to different object items are different from each other.

7. The method according to claim 3, wherein, adopting a fault handling strategy matching the script fault type to perform error correction processing on the reported error script content to obtain a corrected script, including: when the script fault type indicates that the method instruction defined by the parameter item cannot be recognized, screening the current method instruction defined by the parameter item in the fault knowledge base; using a candidate method instruction having a preset mapping relationship with the current method instruction to replace the current method instruction to obtain the corrected script, wherein the candidate method instruction is a function instruction that can be recognized, and the candidate method instruction and the current method instruction can implement the same script function.

8. The method according to claim 1, wherein, adopting a fault handling strategy matching the script fault type to perform error correction processing on the reported error script content to obtain a corrected script, including: splitting the script content into at least one corresponding function, where the at least one function includes the function to be error-corrected indicated by the error report information; performing at least one of the following processes on the function to be error-corrected to perform error correction processing on the reported error script content to obtain the corrected script, correcting variables that are not initialized and / or not defined in the function to be error-corrected; correcting variable reference relationships with errors in the function to be error-corrected; correcting repeatedly defined sub-functions according to the sub-functions called by the function to be error-corrected, and / or correcting misspelled content in the sub-functions.

9. The method according to claim 1, further including: when the script fault type cannot be determined according to the fault knowledge base, adding the error report information to the manual processing queue and generating a prompt message for manually resolving the fault.

10. The method according to any one of claims 1 to 9, wherein, the error report information includes error report information generated during the execution of the script program using the Junit unit test framework.

11. A script error correction processing device, including: An acquisition module for acquiring error report information generated during the execution of a script; A first processing module for locating the cause of a fault in the script execution process based on the error report information and the fault knowledge information in a preset fault knowledge base to determine the script fault type, where the fault knowledge information includes fault definition parameters, fault description information, and at least one level of fault handling strategies associated with the fault description information; The first processing module includes: A first processing sub-module for, when the error report information includes an error code, determining, in the fault knowledge base, the fault definition parameter associated with the error code in the error report information according to a preset mapping relationship between the error code and the fault definition parameter; A second processing sub-module for determining the similarity between each type of fault description information and the error report information according to at least one type of fault description information associated with the fault definition parameter; A third processing sub-module for taking the fault description information with the highest corresponding similarity in the at least one type of fault description information as the target fault description information; and A fourth processing sub-module for taking the fault type indicated by the target fault description information as the script fault type; and A second processing module for performing error correction processing on the script content with an error by using a fault handling strategy matching the script fault type to obtain a corrected script, so as to execute the corresponding script function based on the corrected script.

12. An electronic device comprising: One or more processors; and A memory for storing one or more programs, wherein, when the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 10.

13. A computer-readable storage medium having executable instructions stored thereon, and when the instructions are executed by a processor, the processor implements the method according to any one of claims 1 to 10.

14. A computer program product comprising a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 10 is implemented.

Citation Information

Patent Citations

  • Automatic repairing method and device for script vulnerability, equipment and storage medium

    CN109684847A

  • Exception handling method and device, electronic equipment and storage medium

    CN110046002A