UI script modification method and device, computer equipment and storage medium

By analyzing the logs of failed execution of UI scripts and automatically extracting and modifying the target scripts caused by functional changes in the financial system, the problem of high maintenance costs of UI automation scripts is solved, and testing efficiency and software quality are improved.

CN119149396APending Publication Date: 2024-12-17PING AN HEALTH INSURANCE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411090602.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-08
Publication Date
2024-12-17

AI Technical Summary

Technical Problem

In the financial system, the maintenance and update cost of UI automation scripts has increased exponentially due to changes in the system's functions, resulting in manual update of a large number of automated scripts, which consumes a lot of manpower and time.

Method used

By obtaining the failure log of UI script execution failure, analyzing the cause of failure, if the function changes, extract the corresponding script scope of the function changes, obtain the normalized script of the target script, parse and generate a modification plan, and automatically complete the modification of the target script.

Benefits of technology

It realizes that when the UI script automation execution fails due to functional changes, the target scripts in each script range are quickly and accurately modified, which reduces maintenance costs, improves testing efficiency and software testing quality, and expands the functional expansion space of UI scripts.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119149396A_ABST
    Figure CN119149396A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a UI script modification method and device, computer equipment and a storage medium. According to the method, when execution of the UI script fails, if it is determined that a failure reason is function change according to a failure log, a script range corresponding to the function change is obtained, a target script is extracted from the UI script according to the script range, and then a standardized script corresponding to the target script is obtained; and generating a modification scheme corresponding to the target script according to the standardized script to complete modification of the target script. Furthermore, when a large number of UI scripts fail to be executed automatically due to function changes, the target scripts corresponding to each script range can be quickly and accurately modified one by one, and it can be ensured that the automatic maintenance cost is not greatly increased when the number of the UI scripts is increased due to service changes; and a tester does not need to put too much energy on script analysis and maintenance. And automatic modification of the script is realized, so that a platform corresponding to the UI script has a larger function expansion space.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and in particular to a UI script modification method, device, computer equipment and storage medium. Background Art

[0002] In the financial system, which has a huge business volume and frequent business changes, the automated application of the UI interface can greatly improve the user experience of the financial system. However, the maintenance and update of UI automation scripts has always been the main factor that troubles the application of UI automation. There are many tools for writing UI automation, but how to make the scripts of the UI automation interface recognize and optimize the scripts after business changes, so that the maintenance of UI scripts is more efficient and cost-effective, is a problem that needs to be solved.

[0003] Currently, UI automation will analyze the cause of failure after execution fails. If it is confirmed that the failure is due to business changes, the UI designer needs to manually update the script. If multiple system functions are changed, a large number of automation scripts need to be manually updated, resulting in an exponential increase in maintenance costs. Summary of the invention

[0004] The present application discloses a UI script modification method, device, computer equipment and storage medium, which are intended to solve the problem that if multiple functional changes occur in the current UI script system, a large number of automated scripts need to be manually updated, resulting in an exponential increase in maintenance costs.

[0005] In a first aspect, the present application provides a UI script modification method, comprising:

[0006] If the UI script fails to execute, obtain the failure log;

[0007] Obtain the failure reason according to the failure log, and if the failure reason is a function change, obtain the script range corresponding to the function change, and extract the target script according to the script range in the UI script;

[0008] Obtaining a standardized script corresponding to the target script, parsing the target script and the standardized script, so as to generate a modification plan corresponding to the target script according to the standardized script;

[0009] The target script is modified according to the script modification scheme.

[0010] In some embodiments, obtaining the script range corresponding to the function change includes: obtaining the function type corresponding to the function change; obtaining the script language type corresponding to the UI script; generating a retrieval identifier according to the script language type and the function type; searching in the UI script according to the retrieval identifier to obtain the script range corresponding to the retrieval identifier.

[0011] In some embodiments, obtaining the standardized script corresponding to the target script includes: parsing the target script to obtain the script feature vector corresponding to the target script; calculating the similarity coefficient corresponding to the script feature vector of the target script and the script feature vector of each standardized script in a preset standardized script library; and determining the standardized script corresponding to the target script based on multiple similarity coefficients.

[0012] Exemplarily, the calculating of the similarity coefficients corresponding to the script feature vector of the target script and the script feature vectors of each of the standardized scripts includes: obtaining a script weight corresponding to each of the standardized scripts; calculating the similarity coefficients corresponding to the script feature vector of the target script and the script feature vectors of each of the standardized scripts in a preset similarity formula according to the script weight corresponding to each of the standardized scripts, wherein the similarity formula includes:

[0013] γ(T1,T 2,i )=v i ·δ(T1, T 2,i );

[0014] Among them, γ is the similarity coefficient, T1 is the script feature vector corresponding to the target script, T 2,i is the script feature vector corresponding to the normalized script, δ(,) is the preset vector similarity coefficient, v i is the script weight.

[0015] In some embodiments, the parsing of the target script and the normalized script to generate a modification plan corresponding to the target script according to the normalized script includes: performing feature extraction on the target script and the normalized script respectively; obtaining first feature information corresponding to the target script and second feature information corresponding to the normalized script; and comparing the second feature information with the first feature information to determine abnormal features existing in the first feature information and modification plans corresponding to the abnormal features.

[0016] In some embodiments, after completing the modification of the target script according to the script modification plan, it also includes: generating an automation use case based on the modified UI script; executing the automation use case, if the execution fails, obtaining the failure reason of the execution failure, sending the target script, the failure reason and the modification plan to the script modification model to update the modification plan.

[0017] In some embodiments, obtaining the cause of failure based on the failure log includes: parsing the failure log to obtain the running node where the UI script execution fails; determining the target module corresponding to the running node; obtaining function change information of the target module; if it is determined according to the function change information that the function of the target module has changed within a preset time, determining that the cause of failure is the function change.

[0018] In a second aspect, the present application provides a UI script modification device, comprising:

[0019] The log acquisition unit is used to acquire the failure log if the UI script execution fails;

[0020] a reason acquisition unit, configured to acquire a failure reason according to the failure log, and if the failure reason is a function change, acquire a script range corresponding to the function change, and extract a target script according to the script range in the UI script;

[0021] A script extraction unit, used to obtain a standardized script corresponding to the target script, parse the target script and the standardized script, and generate a modification plan corresponding to the target script according to the standardized script;

[0022] The modification completion unit is used to complete the modification of the target script according to the script modification plan.

[0023] In a third aspect, the present application provides a computer device, comprising a processor, a memory, and a computer program stored in the memory and executable by the processor, wherein the memory stores a policy model, wherein when the computer program is executed by the processor, a UI script modification method as provided in any embodiment of the present application is implemented.

[0024] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the processor implements a UI script modification method as provided in any one of the embodiments of the present application.

[0025] The embodiment of the present application provides a UI script modification method, device, computer equipment and storage medium. In the provided method, when the UI script fails to execute, if the failure reason is determined to be a function change according to the failure log, the script range corresponding to the function change is obtained, and the target script is extracted from the UI script according to the script range, and then the standardized script corresponding to the target script is obtained, so as to generate a modification plan corresponding to the target script according to the standardized script to complete the modification of the target script.

[0026] Furthermore, when a large number of UI scripts fail to be automatically executed due to functional changes during the operation of the financial system, the provided method can quickly and accurately modify the target scripts corresponding to each script range one by one, and ensure that the cost of automated maintenance will not increase significantly when the number of UI scripts increases due to business changes, so that testers do not need to invest too much energy in the analysis and maintenance of UI scripts, and can invest more in use case design and automated writing, which improves the test efficiency, better guarantees the scope of software testing, and improves the quality of software testing. At the same time, by realizing the automatic modification of the target script, the platform corresponding to the operation of the UI script has a larger functional expansion space.

[0027] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0029] Figure 1 This is a schematic flowchart of the steps of a UI script modification method provided by an embodiment of the present application;

[0030] Figure 2 This is a schematic flow chart of the steps of a method for obtaining a script range provided in an embodiment of the present application;

[0031] Figure 3 This is a schematic flow chart of the steps of a method for obtaining a standardized script provided in an embodiment of the present application;

[0032] Figure 4 It is a structural diagram of a UI script modification device provided in an embodiment of the present application;

[0033] Figure 5 It is a schematic block diagram of the structure of a computer device provided in one embodiment of the present application.

[0034] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. DETAILED DESCRIPTION

[0035] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0036] The flowcharts shown in the accompanying drawings are only examples and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may also be decomposed, combined or partially merged, so the actual execution order may change according to actual conditions.

[0037] It should be understood that the terms used in this application specification are only for the purpose of describing specific embodiments and are not intended to limit the application. As used in this application specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.

[0038] It should be understood that, in order to facilitate the clear description of the technical solutions of the embodiments of the present application, in the embodiments of the present application, the words "first", "second", etc. are used to distinguish the same items or similar items with substantially the same functions and effects. Those skilled in the art can understand that the words "first", "second", etc. do not limit the quantity and execution order, and the words "first", "second", etc. do not necessarily limit the difference.

[0039] It should be further understood that the term “and / or” used in the specification and appended claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0040] To facilitate understanding of the embodiments of the present application, some words involved in the embodiments of the present application are briefly explained below.

[0041] 1. UI (User Interface) script: UI refers to the overall design of the software's human-computer interaction, operation logic, and interface aesthetics. UI is the medium for interaction and information exchange between the system and the user, and it realizes the conversion between the internal form of information and the form acceptable to humans.

[0042] UI script is a necessary computer language designed to realize the interactive communication between users and hardware during the UI design process. The purpose is to enable users to operate hardware conveniently and efficiently through UI script design to achieve two-way interaction and complete the tasks they want to complete with the help of hardware.

[0043] In conjunction with the accompanying drawings, some embodiments of the present application are described in detail below. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.

[0044] In the financial system, which has a huge business volume and frequent business changes, the automated application of the UI interface can greatly improve the user experience of the financial system. However, the maintenance and update of UI automation scripts has always been the main factor that troubles the application of UI automation. There are many tools for writing UI automation, but how to make the scripts of the UI automation interface recognize and optimize the scripts after business changes, so that the maintenance of UI scripts is more efficient and cost-effective, is a problem that needs to be solved.

[0045] Currently, UI automation will analyze the cause of failure after execution fails. If it is confirmed that the failure is due to business changes, the UI designer needs to manually update the script. If multiple system functions are changed, a large number of automation scripts need to be manually updated, resulting in an exponential increase in maintenance costs.

[0046] To solve the above problems, the present application embodiment proposes a UI script modification method. Figure 1 , Figure 1 This is a flowchart showing the steps of a UI script modification method provided in one embodiment of the present application.

[0047] It should be noted that the UI script modification method provided in this application can be used in the scenario of the financial system, which has a large business volume and frequent changes, resulting in a huge amount of changes in the UI scripts of the corresponding platform / application. It can also be applied to the platform / application corresponding to any other scenario to realize the automatic modification of its UI script. This application takes the financial scenario as an example for explanation.

[0048] like Figure 1 As shown, the proposed UI script modification method includes steps S101 to S104.

[0049] S101. If the UI script execution fails, obtain the failure log.

[0050] Specifically, in the application corresponding to the financial system, when the execution fails during the operation of its UI script, it is necessary to obtain the failure log corresponding to the UI script. The failure log is a log automatically generated by the application corresponding to the UI script when the UI script fails to run. The traditional method requires testers to determine the reasons for the failure of UI script execution based on the failure log and debug them one by one, which takes too much energy and time. The present application aims to automatically complete the repair of UI scripts based on the failure log, so as to free testers from the work of UI script maintenance and enable the application corresponding to the UI script to have more complex / rich functional expansion space.

[0051] S102. Obtain the failure reason according to the failure log. If the failure reason is a function change, obtain the script range corresponding to the function change, and extract the target script in the UI script according to the script range.

[0052] Specifically, by parsing the failure log corresponding to the UI script, the failure reason corresponding to the automatic running of the UI script can be obtained. For example, when the failure reason is that a functional change occurs in the application corresponding to the UI script, the method provided at this time can lock the script scope of the functional change of the UI script according to the failure log, and then extract the target script with functional change, so as to automatically and quickly determine the target script that causes the execution failure, and perform targeted repairs on the target script.

[0053] In some embodiments, obtaining the cause of failure based on the failure log includes: parsing the failure log to obtain the running node where the UI script execution fails; determining the target module corresponding to the running node; obtaining function change information of the target module; if it is determined according to the function change information that the function of the target module has changed within a preset time, determining that the cause of failure is the function change.

[0054] The provided method parses the failure log, parses the running node of the UI script when the execution fails, and determines the target module corresponding to the running node and the corresponding function change information. However, when the corresponding modification time of the function change information is too long outside the preset time, such as the preset time is 24 hours, it is considered that the function change of the target module is not the cause of the execution failure, and the cause of the failure is re-checked.

[0055] In some embodiments, when the cause of failure is not a function change, the cause of failure is re-checked according to the failure log and the cause of failure and the corresponding UI script are sent to a preset script repair model to obtain a repair solution to repair the UI script.

[0056] In some embodiments, please refer to Figure 2 , Figure 2 It is a schematic flowchart of the steps of the script range acquisition method provided in an embodiment of the present application.

[0057] like Figure 2 As shown, the provided method includes steps S102a to S102d.

[0058] S102a. Get the function type corresponding to the function change;

[0059] S102b. Get the script language type corresponding to the UI script;

[0060] S102c generates a search identifier based on the scripting language type and function type;

[0061] S102d. Search the UI script according to the search identifier and obtain the script range corresponding to the search identifier.

[0062] Through the above steps, the present application can obtain the function type of the function change in the failure log, such as the function type of the failed execution is the search function. Then obtain the script language type of the UI script, such as VBScript and JavaScript. Then generate a corresponding search identifier based on the function type and the script language type, that is, convert the function type into the corresponding script language as the search identifier, and then extract one or more script ranges corresponding to the function change in the UI script to repair the target script in the script range.

[0063] S103. Obtain a standardized script corresponding to the target script, parse the target script and the standardized script, and generate a modification plan corresponding to the target script according to the standardized script.

[0064] Specifically, by extracting the standardized script with the same function and script language type as the target script, that is, determining the repair specification corresponding to the target script, the corresponding modification plan can be confirmed based on the content of the standardized script and the target script, such as comparing the target script and the standardized script to determine the corresponding modification plan for the part with differences, or inputting the target script and the standardized script into a preset script modification model to generate the corresponding modification plan from the model. This can quickly achieve standardized modification of the content of the target script.

[0065] In some embodiments, please refer to Figure 3 , Figure 3 This is a flowchart showing the steps of a method for obtaining a standardized script provided in one embodiment of the present application.

[0066] like Figure 3 As shown, the provided method includes steps S103a to S103c.

[0067] S103a. Parse the target script and obtain the script feature vector corresponding to the target script;

[0068] S103b calculates the similarity coefficient corresponding to the script feature vector of the target script and the script feature vector of each standardized script in the preset standardized script library;

[0069] S103c. Determine the normalized script corresponding to the target script based on multiple similarity coefficients.

[0070] Through the above steps, the provided method can convert the script into a corresponding script feature vector, such as by encoding the target script. Then, by calculating the similarity coefficient (such as L1 distance, L2 distance, etc.) of the script feature vector of the target script and the script feature vector of the standardized script in the preset standardized script library, the standardized script that is most similar to the target script can be determined. Thus, the accuracy of the modification of the target script is improved.

[0071] Exemplarily, the calculating of the similarity coefficients corresponding to the script feature vector of the target script and the script feature vectors of each of the standardized scripts includes: obtaining a script weight corresponding to each of the standardized scripts; calculating the similarity coefficients corresponding to the script feature vector of the target script and the script feature vectors of each of the standardized scripts in a preset similarity formula according to the script weight corresponding to each of the standardized scripts, wherein the similarity formula includes:

[0072] γ(T1,T 2,i )=v i ·δ(T1, T 2,i );

[0073] Among them, γ is the similarity coefficient, T1 is the script feature vector corresponding to the target script, T 2,i is the script feature vector corresponding to the normalized script, δ(,) is the preset vector similarity coefficient, v i is the script weight.

[0074] Furthermore, the provided method can determine the corresponding script weight for each standardized script, so that a more representative or more frequently used standardized script can be more favorably selected, and the size of the script weight can also be intelligently adjusted. Furthermore, the provided method can improve the flexibility and accuracy of script modification.

[0075] In some embodiments, the parsing of the target script and the normalized script to generate a modification plan corresponding to the target script according to the normalized script includes: performing feature extraction on the target script and the normalized script respectively; obtaining first feature information corresponding to the target script and second feature information corresponding to the normalized script; and comparing the second feature information with the first feature information to determine abnormal features existing in the first feature information and modification plans corresponding to the abnormal features.

[0076] The provided method extracts features from the target script and the standardized script through a preset feature extraction model to determine abnormal features of the target script compared to the standardized script, and determines that the modification scheme corresponding to the abnormal features can quickly lock the modification object and method.

[0077] S104. Complete modification of the target script according to the script modification plan.

[0078] Specifically, by quickly completing the modification of the target script according to the script modification plan, the provided method can manage the execution of the automation use cases and use case sets corresponding to the UI script when entering the UI script for automated operation, and can also realize the corresponding application report output, report traceability and other conventional functions. Innovatively designed intelligent analysis after the failure of the automated operation of the UI script, identify whether the cause of the failure is a functional change of the system, and provide the scope of the automated modified script and the modification plan of the modification suggestion after confirming that it is a functional change, which largely solves the problem of high maintenance cost of UI automation scripts.

[0079] Conventional UI script automation failure analysis requires manual troubleshooting of all affected automation operations after learning of business changes, and then evaluating the scope of the changes and modifying them line by line, which is inefficient and time-consuming. This application abstracts the basic actions of automation when writing use cases, and also divides the test scenarios into multiple operation intervals. After the automation fails, the operation interval is compared with the same functional point during historical execution to find the change point and obtain the script interval for executing the corresponding operation. Then, the algorithm written by the user is used to implement modification guidance and modification scope evaluation, so as to achieve the purpose of automated and efficient maintenance.

[0080] In some embodiments, after completing the modification of the target script according to the script modification plan, it also includes: generating an automation use case based on the modified UI script; executing the automation use case, if the execution fails, obtaining the failure reason of the execution failure, sending the target script, the failure reason and the modification plan to the script modification model to update the modification plan.

[0081] The provided method generates a corresponding automation case according to the modified UI script. When the execution fails, the failure reason is obtained again through the failure log, and the target script, failure reason and modification plan are sent to the preset script modification model, and the modification plan is updated while optimizing the model parameters. The accuracy of the provided modification plan is ensured.

[0082] Through the method provided by this application, when a large number of UI scripts fail to be automatically executed due to functional changes during the operation of a financial system, the target scripts corresponding to each script range can be modified quickly and accurately one by one, which can ensure that the cost of automated maintenance will not increase significantly when the number of UI scripts increases due to business changes, so that testers do not need to invest too much energy in the analysis and maintenance of UI scripts, and can invest more in use case design and automated writing, which improves the test efficiency while better ensuring the scope of software testing and improving the quality of software testing. At the same time, by realizing the automatic modification of the target script, the platform corresponding to the operation of the UI script has a larger functional expansion space.

[0083] like Figure 4 As shown, Figure 4 1 is a schematic diagram of the structure of a UI script modification device provided in an embodiment of the present application, wherein the UI script modification device is used to execute the aforementioned UI script modification method. The UI script modification device can be configured in a terminal or a server.

[0084] like Figure 4 As shown, the UI script modification device 200 includes a log acquisition unit 201 , a reason acquisition unit 202 , a script extraction unit 203 and a modification completion unit 204 .

[0085] The log acquisition unit 201 is used to acquire a failure log if the UI script execution fails;

[0086] A reason acquisition unit 202 is used to acquire a failure reason according to the failure log, and if the failure reason is a function change, acquire a script range corresponding to the function change, and extract a target script according to the script range in the UI script;

[0087] The script extraction unit 203 is used to obtain the normalized script corresponding to the target script, parse the target script and the normalized script, and generate a modification plan corresponding to the target script according to the normalized script;

[0088] The modification completing unit 204 is used to complete the modification of the target script according to the script modification scheme.

[0089] In some embodiments, the reason acquisition unit 202 is further used to: acquire the function type corresponding to the function change and acquire the script language type corresponding to the UI script; generate a retrieval identifier according to the script language type and the function type; search in the UI script according to the retrieval identifier, and acquire the script range corresponding to the retrieval identifier.

[0090] In some embodiments, the script extraction unit 203 is also used to: parse the target script to obtain a script feature vector corresponding to the target script; calculate the similarity coefficient between the script feature vector of the target script and the script feature vector of each standardized script in a preset standardized script library; and determine the standardized script corresponding to the target script based on multiple similarity coefficients.

[0091] Exemplarily, the script extraction unit 203 is further used to: obtain a script weight corresponding to each of the standardized scripts; calculate a similarity coefficient corresponding to the script feature vector of the target script and the script feature vector of each of the standardized scripts in a preset similarity formula according to the script weight corresponding to each of the standardized scripts, wherein the similarity formula includes:

[0092] γ(T1,T 2,i )=v i ·δ(T1, T 2,i );

[0093] Among them, γ is the similarity coefficient, T1 is the script feature vector corresponding to the target script, T 2,i is the script feature vector corresponding to the normalized script, δ(,) is the preset vector similarity coefficient, v i is the script weight.

[0094] In some embodiments, the script extraction unit 203 is also used to: perform feature extraction on the target script and the standardized script respectively; obtain first feature information corresponding to the target script and second feature information corresponding to the standardized script; compare the second feature information with the first feature information to determine the abnormal features existing in the first feature information and the modification plan corresponding to the abnormal features.

[0095] In some embodiments, the UI script modification device 200 also includes a scheme updating unit 205, which is used to generate an automation use case according to the modified UI script after the modification of the target script according to the script modification scheme is completed; execute the automation use case, and if the execution fails, obtain the failure reason of the execution failure, and send the target script, the failure reason and the modification scheme to the script modification model to update the modification scheme.

[0096] In some embodiments, the cause acquisition unit 202 is also used to: parse the failure log to obtain the running node where the UI script execution fails; determine the target module corresponding to the running node; obtain the function change information of the target module; if it is determined according to the function change information that the function of the target module has changed within a preset time, determine that the cause of the failure is the function change.

[0097] It should be noted that those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described device and each module can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0098] The above-mentioned device can be implemented in the form of a computer program. Figure 5 Runs on the computer device shown.

[0099] See also Figure 5 , Figure 5 is a schematic block diagram of a computer device provided in an embodiment of the present application. The computer device may be a server. Figure 5 The computer device includes a processor, a memory and a network interface connected through a system bus, wherein the memory may include a non-volatile storage medium and an internal memory.

[0100] The non-volatile storage medium can store an operating system and a computer program. The computer program includes program instructions, and when the program instructions are executed, the processor can execute any one of the UI script modification methods.

[0101] The processor is used to provide computing and control capabilities and support the operation of the entire computer equipment.

[0102] The internal memory provides an environment for the operation of the computer program in the non-volatile storage medium. When the computer program is executed by the processor, the processor can execute any one of the UI script modification methods.

[0103] The network interface is used for network communication, such as sending assigned tasks, etc. Those skilled in the art will understand that Figure 5 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0104] It should be understood that the processor may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0105] In one embodiment, the processor is used to run a computer program stored in the memory to implement the following steps:

[0106] If the UI script fails to execute, obtain the failure log;

[0107] Obtain the failure reason according to the failure log, and if the failure reason is a function change, obtain the script range corresponding to the function change, and extract the target script according to the script range in the UI script;

[0108] Obtaining a standardized script corresponding to the target script, parsing the target script and the standardized script, so as to generate a modification plan corresponding to the target script according to the standardized script;

[0109] The target script is modified according to the script modification scheme.

[0110] In some embodiments, obtaining the script range corresponding to the function change includes: obtaining the function type corresponding to the function change and obtaining the script language type corresponding to the UI script; generating a retrieval identifier according to the script language type and the function type; searching in the UI script according to the retrieval identifier to obtain the script range corresponding to the retrieval identifier.

[0111] In some embodiments, obtaining the standardized script corresponding to the target script includes: parsing the target script to obtain the script feature vector corresponding to the target script; calculating the similarity coefficient corresponding to the script feature vector of the target script and the script feature vector of each standardized script in a preset standardized script library; and determining the standardized script corresponding to the target script based on multiple similarity coefficients.

[0112] Exemplarily, the calculating of the similarity coefficients corresponding to the script feature vector of the target script and the script feature vectors of each of the standardized scripts includes: obtaining a script weight corresponding to each of the standardized scripts; calculating the similarity coefficients corresponding to the script feature vector of the target script and the script feature vectors of each of the standardized scripts in a preset similarity formula according to the script weight corresponding to each of the standardized scripts, wherein the similarity formula includes:

[0113] γ(T1,T 2,i )=v i ·δ(T1, T 2,i );

[0114] Among them, γ is the similarity coefficient, T1 is the script feature vector corresponding to the target script, T 2,i is the script feature vector corresponding to the normalized script, δ(,) is the preset vector similarity coefficient, v i is the script weight.

[0115] In some embodiments, the parsing of the target script and the normalized script to generate a modification plan corresponding to the target script according to the normalized script includes: performing feature extraction on the target script and the normalized script respectively; obtaining first feature information corresponding to the target script and second feature information corresponding to the normalized script; and comparing the second feature information with the first feature information to determine abnormal features existing in the first feature information and modification plans corresponding to the abnormal features.

[0116] In some embodiments, after completing the modification of the target script according to the script modification plan, it also includes: generating an automation use case based on the modified UI script; executing the automation use case, if the execution fails, obtaining the failure reason of the execution failure, sending the target script, the failure reason and the modification plan to the script modification model to update the modification plan.

[0117] In some embodiments, obtaining the cause of failure based on the failure log includes: parsing the failure log to obtain the running node where the UI script execution fails; determining the target module corresponding to the running node; obtaining function change information of the target module; if it is determined according to the function change information that the function of the target module has changed within a preset time, determining that the cause of failure is the function change.

[0118] A computer-readable storage medium is also provided in an embodiment of the present application. The computer-readable storage medium stores a computer program. The computer program includes program instructions. The processor executes the program instructions to implement any UI script modification method provided in the embodiment of the present application.

[0119] The computer-readable storage medium may be an internal storage unit of the computer device described in the foregoing embodiment, such as a hard disk or memory of the computer device. The computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a smart memory card (SmartMedia Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc., equipped on the computer device.

[0120] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.

Claims

1. A UI script modification method, characterized in that: include: If the UI script fails to execute, obtain the failure log; Obtain the failure reason according to the failure log, and if the failure reason is a function change, obtain the script range corresponding to the function change, and extract the target script according to the script range in the UI script; Obtaining a standardized script corresponding to the target script, parsing the target script and the standardized script, so as to generate a modification plan corresponding to the target script according to the standardized script; The target script is modified according to the script modification scheme.

2. The method according to claim 1, characterized in that The obtaining of the script range corresponding to the function change includes: Obtaining the function type corresponding to the function change; Get the script language type corresponding to the UI script; Generate a search identifier according to the script language type and the function type; The UI script is searched according to the search identifier to obtain the script range corresponding to the search identifier.

3. The method according to claim 1, characterized in that The step of obtaining a normalized script corresponding to the target script includes: Parsing the target script to obtain a script feature vector corresponding to the target script; Calculate the similarity coefficient between the script feature vector of the target script and the script feature vector of each normalized script in a preset normalized script library; The normalized script corresponding to the target script is determined according to the multiple similarity coefficients.

4. The method according to claim 3, characterized in that The calculating of the similarity coefficients corresponding to the script feature vector of the target script and the script feature vectors of each of the normalized scripts includes: Obtaining a script weight corresponding to each of the normalized scripts; The similarity coefficients corresponding to the script feature vector of the target script and the script feature vector of each of the standardized scripts are calculated in a preset similarity formula according to the script weight corresponding to each of the standardized scripts, wherein the similarity formula includes: γ(T1,T 2,i )=v i ·δ(T1,T 2,i ); Among them, γ is the similarity coefficient, T1 is the script feature vector corresponding to the target script, T 2,i is the script feature vector corresponding to the normalized script, δ(,) is the preset vector similarity coefficient, v i is the script weight.

5. The method according to claim 1, characterized in that The parsing of the target script and the normalized script to generate a modification scheme corresponding to the target script according to the normalized script includes: Performing feature extraction on the target script and the normalized script respectively; Obtaining first characteristic information corresponding to the target script and second characteristic information corresponding to the standardized script; The second feature information is compared with the first feature information to determine abnormal features present in the first feature information and modification solutions corresponding to the abnormal features.

6. The method according to claim 1, characterized in that After completing the modification of the target script according to the script modification scheme, the method further includes: Generate an automation use case according to the modified UI script; Execute the automation use case, if the execution fails, obtain the failure reason of the execution failure, send the target script, the failure reason and the modification plan to the script modification model to update the modification plan.

7. The method according to claim 1, characterized in that The obtaining the failure reason according to the failure log includes: Parse the failure log to obtain the running node where the UI script execution failed; Determine the target module corresponding to the running node; Acquiring function change information of the target module; If it is determined according to the function change information that the function of the target module has changed within a preset time, it is determined that the cause of the failure is the function change.

8. A UI script modification device, characterized in that: include: The log acquisition unit is used to acquire the failure log if the UI script execution fails; a reason acquisition unit, configured to acquire a failure reason according to the failure log, and if the failure reason is a function change, acquire a script range corresponding to the function change, and extract a target script according to the script range in the UI script; A script extraction unit, used to obtain a standardized script corresponding to the target script, parse the target script and the standardized script, and generate a modification plan corresponding to the target script according to the standardized script; The modification completion unit is used to complete the modification of the target script according to the script modification plan.

9. A computer device, characterized in that: The computer device includes a memory and a processor; The memory is used to store computer programs; The processor is configured to execute the computer program and implement the UI script modification method according to any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor implements the UI script modification method according to any one of claims 1 to 7.