CN116185866A - Script editing method, script editing device, computer equipment and storage medium - Google Patents

Script editing method, script editing device, computer equipment and storage medium Download PDF

Info

Publication number
CN116185866A
CN116185866A CN202310212891.6A CN202310212891A CN116185866A CN 116185866 A CN116185866 A CN 116185866A CN 202310212891 A CN202310212891 A CN 202310212891A CN 116185866 A CN116185866 A CN 116185866A
Authority
CN
China
Prior art keywords
script
execution
plan
total
time length
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310212891.6A
Other languages
Chinese (zh)
Inventor
朱伟健
张彬
唐琳娜
黄菁
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Industrial and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN202310212891.6A priority Critical patent/CN116185866A/en
Publication of CN116185866A publication Critical patent/CN116185866A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The application relates to a script editing method, a script editing device, computer equipment, a storage medium and a computer program product, and relates to the technical field of artificial intelligence. The method comprises the following steps: acquiring a script execution plan of a test task and preset adjustment information aiming at the script execution plan; under the condition that the total execution time length of the plan corresponding to the script execution plan is not equal to the actual total execution time length, adjusting the total execution days and/or the daily execution time length of the script execution plan according to preset adjustment information to obtain a script programming plan; the actual total execution time length is the sum of the actual execution time length of each script in the full script in the script execution plan; according to the script programming plan, iteratively executing the full-quantity scripts to obtain the average execution duration of each script in the full-quantity scripts; and updating the script programming plan according to the average execution duration of each script to obtain an updated script programming plan. By adopting the method, the utilization rate of the automatic test resources can be improved.

Description

Script editing method, script editing device, computer equipment and storage medium
Technical Field
The present application relates to the field of artificial intelligence technology, and in particular, to a script editing method, apparatus, computer device, storage medium, and computer program product.
Background
With the development of computer software technology, the number of scripts in automated test engineering is increasing, and under the condition of limited test resources, in order to cope with the situations of periodically executing regression tests, version iteration tests and the like of all scripts in batches, the execution sequence of the scripts needs to be reasonably distributed.
In the conventional technology, the execution sequence of the script is mainly distributed periodically by manual operation. However, the allocation performed by this allocation method makes the execution time of each execution of the automated test job have a large difference, resulting in a low utilization rate of the automated test resources.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a scripting method, apparatus, computer device, computer readable storage medium, and computer program product that can improve utilization of automated test resources.
In a first aspect, the present application provides a scripting method. The method comprises the following steps:
acquiring a script execution plan of a test task and preset adjustment information aiming at the script execution plan;
under the condition that the total execution time length of the corresponding program of the script execution program is not equal to the actual total execution time length, adjusting the total execution days and/or the daily execution time length of the script execution program according to the preset adjustment information to obtain a script programming program; the actual total execution time length is the sum of the actual execution time length of each script in the total scripts in the script execution plan;
Iteratively executing the full-volume scripts according to the script programming plan to obtain the average execution duration of each script in the full-volume scripts;
and updating the script arrangement plan according to the average execution duration of each script to obtain an updated script arrangement plan.
In one embodiment, the adjusting the total number of days and/or the daily execution duration of the script execution plan according to the preset adjustment information to obtain a script programming plan includes:
under the condition that the preset adjustment information is used for preferentially adjusting the execution duration of each day, creating an array with corresponding number according to the total execution days, and sorting each script in descending order according to the actual execution duration of each script;
sequentially placing ordered scripts into an array with the smallest current accumulated execution total duration in the created array, and obtaining a script list executed every day in the total execution days as the script programming plan; the difference between the total execution time length of the script list executed every day and the updated daily execution time length meets a preset range, and the updated daily execution time length is determined according to the total execution days of the script execution plan and the actual total execution time length.
In one embodiment, the adjusting the total number of days and/or the daily execution duration of the script execution plan according to the preset adjustment information to obtain a script programming plan includes:
under the condition that the preset adjustment information is used for preferentially adjusting the total execution days, updating the total execution days of the script execution plan according to the daily execution duration and the actual total execution duration of the script execution plan;
creating an array with corresponding number according to the updated total execution days, and sorting the scripts in descending order according to the actual execution duration of each script;
sequentially placing the ordered scripts into an array with the smallest current accumulated execution total duration in the created array, and obtaining a script list executed every day in the updated execution total days as the script programming plan; and the total execution duration of the script list executed every day is smaller than or equal to the execution duration every day.
In one embodiment, the updating the total number of days of execution of the script execution plan according to the daily execution duration and the actual total execution duration of the script execution plan includes:
determining updated information of the total execution days of the script execution plan according to the planned total execution time length, the actual execution total time length and the daily execution time length; the update information is used for representing the number of days which are increased or decreased on the basis of the total number of execution days;
And updating the total execution days according to the updating information to obtain the updated total execution days.
In one embodiment, the iteratively executing the full-volume scripts according to the script arrangement plan to obtain an average execution duration of each script in the full-volume scripts, including:
iteratively executing the full-volume scripts according to the script arrangement plan, and recording each execution time length of each script in the full-volume scripts until the total execution times of the full-volume scripts are the same as the preset times;
and determining the average execution duration of each script in the full-volume scripts according to the execution duration of each script in the full-volume scripts.
In one embodiment, the updating the script arrangement plan according to the average execution duration of each script to obtain an updated script arrangement plan includes:
when the total planned execution time length corresponding to the script execution plan is not equal to the actual execution time length, according to the preset adjustment information and the average execution time length of each script, adjusting the total execution days and/or the daily execution time length of the script execution plan again;
And obtaining the updated script programming plan according to the adjustment result of the script execution plan.
In one embodiment, the method further comprises:
generating abnormal data alarm information according to abnormal execution time of the script under the condition that script execution abnormality occurs in the execution process of the full script;
and according to the abnormal data alarm information, eliminating abnormal execution time of the script by using a preset abnormal data processing mode.
In a second aspect, the present application further provides a script editing apparatus. The device comprises:
the information acquisition module is used for acquiring a script execution plan of the test task and preset adjustment information aiming at the script execution plan;
the script arrangement module is used for adjusting the total execution days and/or the daily execution time length of the script execution plan according to the preset adjustment information under the condition that the total plan execution time length corresponding to the script execution plan is not equal to the actual execution time length, so as to obtain the script arrangement plan; the actual total execution time length is the sum of the actual execution time length of each script in the total scripts in the script execution plan;
the script execution module is used for iteratively executing the full-volume scripts according to the script programming plan to obtain the average execution duration of each script in the full-volume scripts;
And the arrangement updating module is used for updating the script arrangement plan according to the average execution time length of each script to obtain an updated script arrangement plan.
In a third aspect, the present application also provides a computer device. The computer device comprises a memory storing a computer program and a processor which when executing the computer program performs the steps of:
acquiring a script execution plan of a test task and preset adjustment information aiming at the script execution plan;
under the condition that the total execution time length of the corresponding program of the script execution program is not equal to the actual total execution time length, adjusting the total execution days and/or the daily execution time length of the script execution program according to the preset adjustment information to obtain a script programming program; the actual total execution time length is the sum of the actual execution time length of each script in the total scripts in the script execution plan;
iteratively executing the full-volume scripts according to the script programming plan to obtain the average execution duration of each script in the full-volume scripts;
and updating the script arrangement plan according to the average execution duration of each script to obtain an updated script arrangement plan.
In a fourth aspect, the present application also provides a computer-readable storage medium. The computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps of:
acquiring a script execution plan of a test task and preset adjustment information aiming at the script execution plan;
under the condition that the total execution time length of the corresponding program of the script execution program is not equal to the actual total execution time length, adjusting the total execution days and/or the daily execution time length of the script execution program according to the preset adjustment information to obtain a script programming program; the actual total execution time length is the sum of the actual execution time length of each script in the total scripts in the script execution plan;
iteratively executing the full-volume scripts according to the script programming plan to obtain the average execution duration of each script in the full-volume scripts;
and updating the script arrangement plan according to the average execution duration of each script to obtain an updated script arrangement plan.
In a fifth aspect, the present application also provides a computer program product. The computer program product comprises a computer program which, when executed by a processor, implements the steps of:
Acquiring a script execution plan of a test task and preset adjustment information aiming at the script execution plan;
under the condition that the total execution time length of the corresponding program of the script execution program is not equal to the actual total execution time length, adjusting the total execution days and/or the daily execution time length of the script execution program according to the preset adjustment information to obtain a script programming program; the actual total execution time length is the sum of the actual execution time length of each script in the total scripts in the script execution plan;
iteratively executing the full-volume scripts according to the script programming plan to obtain the average execution duration of each script in the full-volume scripts;
and updating the script arrangement plan according to the average execution duration of each script to obtain an updated script arrangement plan.
The script programming method, the script programming device, the computer equipment, the storage medium and the computer program product are used for acquiring a script execution plan of a test task and preset adjustment information aiming at the script execution plan; under the condition that the total execution time length of the plan corresponding to the script execution plan is not equal to the actual total execution time length, adjusting the total execution days and/or the daily execution time length of the script execution plan according to preset adjustment information to obtain a script programming plan; according to the script programming plan, iteratively executing the full-quantity scripts to obtain the average execution duration of each script in the full-quantity scripts; and finally, updating the script programming plan according to the average execution duration of each script to obtain an updated script programming plan. In this way, firstly, a script execution plan of the test task and preset adjustment information aiming at the script execution plan are obtained, so that the script execution plan can be flexibly adjusted according to the preset adjustment information; under the condition that the total plan execution time length corresponding to the script execution plan is unequal to the actual total execution time length, the total execution days and/or the daily execution time length of the script execution plan are adjusted according to preset adjustment information, so that a script arrangement plan is obtained, the initial script execution plan is effectively adjusted to be a script arrangement plan in a practical situation, and the rationality of automatic test resource allocation is improved; according to the script programming plan, iteratively executing the full-quantity scripts to obtain the average execution time length of each script in the full-quantity scripts, wherein the programming analysis result of the scripts is more accurate due to the fact that the average execution time length is taken for analysis; finally, updating the script programming plan according to the average execution duration of each script to obtain an updated script programming plan; the automatic test script arrangement mode based on the artificial intelligence technology is adopted to generate a script arrangement plan, the resource usage of each execution of the automatic test operation is balanced as much as possible under the condition that the daily execution duration range is met, the rationality of automatic test resource allocation is improved, manual participation is not needed in the whole process, deviation caused by human subjective factors is avoided, and the utilization rate of the automatic test resources is improved.
Drawings
FIG. 1 is a flow diagram of a scripting method in one embodiment;
FIG. 2 is a flow diagram that illustrates the steps of creating a scripting plan in one embodiment;
FIG. 3 is a flow chart of a scripting method in another embodiment;
FIG. 4 is a flow chart of a scripting method in yet another embodiment;
FIG. 5 is a block diagram of the scripting apparatus in one embodiment;
fig. 6 is an internal structural diagram of a computer device in one embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the present application.
In one embodiment, as shown in fig. 1, a script editing method is provided, where this embodiment is applied to a terminal to illustrate the method, it is understood that the method may also be applied to a server, and may also be applied to a system including a terminal and a server, and implemented through interaction between the terminal and the server. The terminal can be, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers and the like; the server may be implemented as a stand-alone server or as a server cluster composed of a plurality of servers. In this embodiment, the method includes the steps of:
Step S101, acquiring a script execution plan of a test task and preset adjustment information for the script execution plan.
The test task refers to an automatic test task, such as regression test, version iteration test and the like of a script.
The script execution plan refers to script execution plan information which is preset by a user before script programming is executed; for example, 1 full execution of the automated test scripts every 6 days, a daily execution time period of 60 minutes, and a planned total execution time period of 360 minutes.
When the actual arrangement does not conform to the plan, the preset adjustment information refers to automatic adjustment preference for the script execution plan, such as preferentially adjusting the total execution days and preferentially adjusting the daily execution duration, which is preset by the user.
Specifically, the terminal receives a script arrangement request for an automatic test task, and obtains a script execution plan preset by a user and preset adjustment information corresponding to the script execution plan according to the script arrangement request.
For example, assume that a script execution plan predetermined by a user is: executing the automatic test script 1 time every 6 days, wherein the execution time per day is 60 minutes, and the planned total execution time is 360 minutes; the preset adjustment information corresponding to the script execution plan is: and under the condition that the planned total execution time length corresponding to the script execution plan is not equal to the actual total execution time length, preferentially adjusting the total execution days.
Further, after acquiring a script execution plan of the test task and preset adjustment information aiming at the script execution plan, the terminal also performs script execution of a total amount of scripts according to the preset arrangement plan, records a start time stamp before each script is executed, and records an end time stamp after each script is executed; and obtaining script execution time of each script according to the start time stamp and the end time stamp, and taking the script execution time as the actual execution time of each script in the full script.
Step S102, under the condition that the total execution time length of the corresponding program is unequal to the actual total execution time length, adjusting the total execution days and/or the daily execution time length of the script execution program according to preset adjustment information to obtain a script programming program; the actual total execution time length is the sum of the actual execution time length of each script in the full script in the script execution plan.
Wherein the actual total execution duration refers to the sum of the actual execution durations of each script in the total scripts in the script execution plan.
The script programming plan refers to a programming plan for the script obtained through script programming analysis and adjustment according to the script execution plan and preset adjustment information.
Specifically, the terminal acquires a planned total execution time length and an actual total execution time length corresponding to the script execution plan, judges whether the planned total execution time length is equal to the actual total execution time length, and adjusts the execution total number of days and/or the daily execution time length of the script execution plan according to preset adjustment information under the condition that the planned total execution time length is not equal to the actual total execution time length, so as to obtain a script list to be executed every day in the execution total number of days, and then obtains the script arrangement plan.
For example, for the case that the planned total execution duration is longer than the actual total execution duration, and the user selects to preferentially adjust the total execution days; assume that a script execution plan preset by a user is: executing the automatic test script 1 time every 6 days, wherein the execution time per day is 60 minutes, and the planned total execution time is 360 minutes; and the actual total duration of executing the 1-time automatic test script in full is 300 minutes, then after being processed by the script arrangement analysis module, the generated execution plan is to execute the 1-time automatic test script in full every 5 days, and execute for 60 minutes every day.
And step S103, iteratively executing the full-volume scripts according to the script arrangement plan to obtain the average execution duration of each script in the full-volume scripts.
Where iteration refers to the activity of repeating the feedback process, the purpose of which is typically to approximate a desired target or result. Each repetition of the process is referred to as an "iteration," and the result from each iteration is used as the initial value for the next iteration.
The method comprises the steps that a terminal iteratively executes a full-volume script according to a script programming plan, simultaneously records each execution time length of each script in the full-volume script, and continuously repeats the process until the total execution times of the full-volume script reach preset times; and calculating the average execution time length of each script in the full-volume script according to the execution time length of each script in the full-volume script.
Step S104, updating the script arrangement plan according to the average execution duration of each script, and obtaining an updated script arrangement plan.
The updated script programming plan refers to a more reasonable script programming plan obtained after multiple iterations.
Specifically, the terminal re-uses each module to perform script arrangement analysis according to the average execution duration of each script, so as to obtain a more reasonable script arrangement plan, and the more reasonable script arrangement plan is used as an updated script arrangement plan. For example, the terminal uses preset adjustment information and average execution duration of each script to adjust total execution days and/or daily execution duration of the script arrangement plan, and obtains an adjusted script arrangement plan as an updated script arrangement plan.
In the script arranging method, a script execution plan of a test task and preset adjustment information aiming at the script execution plan are obtained; under the condition that the total execution time length of the plan corresponding to the script execution plan is not equal to the actual total execution time length, adjusting the total execution days and/or the daily execution time length of the script execution plan according to preset adjustment information to obtain a script programming plan; according to the script programming plan, iteratively executing the full-quantity scripts to obtain the average execution duration of each script in the full-quantity scripts; and finally, updating the script programming plan according to the average execution duration of each script to obtain an updated script programming plan. In this way, firstly, a script execution plan of the test task and preset adjustment information aiming at the script execution plan are obtained, so that the script execution plan can be flexibly adjusted according to the preset adjustment information and the adjustment preference of a user; under the condition that the total plan execution time length corresponding to the script execution plan is unequal to the actual total execution time length, the total execution days and/or the daily execution time length of the script execution plan are adjusted according to preset adjustment information, so that a script arrangement plan is obtained, the initial script execution plan is effectively adjusted to be a script arrangement plan in a practical situation, and the rationality of automatic test resource allocation is improved; according to the script programming plan, iteratively executing the full-quantity scripts to obtain the average execution time length of each script in the full-quantity scripts, wherein the programming analysis result of the scripts is more accurate due to the fact that the average execution time length is taken for analysis; finally, updating the script programming plan according to the average execution duration of each script to obtain an updated script programming plan; the automatic test script arrangement mode based on the artificial intelligence technology is adopted to generate a script arrangement plan, the resource usage of each execution of the automatic test operation is balanced as much as possible under the condition that the daily execution duration range is met, the rationality of automatic test resource allocation is improved, manual participation is not needed in the whole process, deviation caused by human subjective factors is avoided, and the utilization rate of the automatic test resources is improved.
In one embodiment, in the step S102, the total number of days and/or the duration of execution of the script execution plan is adjusted according to the preset adjustment information to obtain the script arrangement plan, which specifically includes the following contents: under the condition that the preset adjustment information is used for preferentially adjusting the execution duration of each day, creating an array of corresponding number according to the total number of days of execution, and ordering each script in descending order according to the actual execution duration of each script; sequentially placing the ordered scripts into an array with the smallest current accumulated execution total duration in the created array, and obtaining a script list executed every day in the total execution days as a script programming plan; the difference between the total execution time length of the script list executed every day and the updated daily execution time length meets a preset range, and the updated daily execution time length is determined according to the total execution days of the script execution plan and the actual total execution time length.
Wherein the array is a linear table data structure which stores a set of data of the same type using a set of contiguous memory spaces
Wherein, the descending order sorting refers to sorting from big to small in sequence.
The preset range is a preset time range, for example, a difference between the total execution duration of the script list executed every day and the updated execution duration every day is preset, and the time range to be satisfied is between 0 and 10 minutes.
Specifically, the terminal identifies the acquired script execution plan and preset adjustment information to obtain the total execution days of the script execution plan, and the preset adjustment information is used for preferentially adjusting the execution time length of each day; creating an array with corresponding number according to the total execution days, and sorting each script in descending order according to the actual execution time length of each script; traversing the ordered scripts, sequentially placing the ordered scripts into an array with the smallest current accumulated execution total duration in the created array, and obtaining a script list executed every day in the total execution days as a script programming plan.
For example, assume that a script execution plan predetermined by a user is: executing the automated test scripts 1 time in full every 6 days, wherein the execution time period of each day is 60 minutes, the planned total execution time period is 360 minutes, and the actual total time period of executing the automated test scripts 1 time in full is 300 minutes; the terminal identifies the acquired script execution plan and preset adjustment information, obtains the total execution days of the script execution plan as 6 days, and adjusts the execution time length of each day from 60 minutes to 50 minutes; creating 6 arrays according to the total execution days, and sorting each script in a descending order according to the actual execution time of each script; traversing the ordered scripts by using a greedy algorithm, sequentially placing the ordered scripts into an array with the smallest current accumulated execution total duration in the created array, and if the current accumulated execution total duration is the same, prioritizing the array with the sequence number in the front, so as to obtain a script list executed every day within 6 days of total execution days, namely a script programming plan.
Further by way of example, assume that there are 9 scripts: a is that 1 (0.5 min), A 2 (0.8 min), A 3 (1.2 minutes), A 4 (1.5 minutes), A 5 (2 minutes), A 6 (2.4 minutes), A 7 (2.8 minutes), A 8 (3 minutes), A 9 (3.2 minutes), according to the actual execution duration of each script, the result obtained by ordering the scripts in a descending order is: a is that 9 、A 8 、A 7 、A 6 、A 5 、A 4 、A 3 、A 2 、A 1 The method comprises the steps of carrying out a first treatment on the surface of the If the total execution days formulated by the user are 3 days, correspondingly creating 3 arrays, traversing the ordered scripts by using a greedy algorithm, and sequentiallyPutting the script path into an array with the smallest current accumulated execution total time length (if the current accumulated execution total time length is the same, the array with the sequence number arranged in the front is prioritized), and obtaining the following result:
Figure BDA0004113947780000101
in this embodiment, when the execution time period per day is preferentially increased or decreased and the total number of days of execution is kept unchanged, a script list of daily execution within the total number of days of execution is created as a script scheduling plan, so that the target script scheduling plan in this embodiment is effectively obtained.
In one embodiment, as shown in fig. 2, in the step S102, the total number of days and/or the duration of execution of the script execution plan is adjusted according to the preset adjustment information to obtain the script programming plan, which specifically includes the following steps:
Step S201, when the preset adjustment information is to adjust the total number of days of execution preferentially, updating the total number of days of execution of the script execution plan according to the daily execution duration and the actual total execution duration of the script execution plan.
Step S202, creating an array of corresponding number according to the updated total execution days, and sorting the scripts in descending order according to the actual execution duration of each script.
Step S203, orderly placing the ordered scripts into an array with the smallest current accumulated execution total duration in the created array, and obtaining an updated script list executed every day in the total execution days as a script programming plan; the total execution duration of the script list executed daily is less than or equal to the daily execution duration.
The updated total execution days refer to new total execution days obtained after the addition or the reduction of the original total execution days.
Specifically, the terminal identifies the acquired script execution plan and preset adjustment information to obtain the total execution days of the script execution plan, and the preset adjustment information is used for preferentially adjusting the total execution days; updating the total number of days of execution of the script execution plan according to the daily execution time and the actual total execution time of the script execution plan; creating an array with corresponding number according to the updated total execution days, and sorting each script in descending order according to the actual execution duration of each script; traversing the ordered scripts, sequentially placing the ordered scripts into an array with the smallest current accumulated execution total duration in the created array, and obtaining an updated script list executed every day in the total number of days of execution as a script programming plan.
For example, assume that a script execution plan predetermined by a user is: executing the automated test scripts 1 time in full every 6 days, wherein the execution time period of each day is 60 minutes, the planned total execution time period is 360 minutes, and the actual total time period of executing the automated test scripts 1 time in full is 300 minutes; the terminal identifies the acquired script execution plan and preset adjustment information, obtains the execution duration of each day to be 60 minutes, and adjusts the total execution days from 6 days to 5 days; creating 5 arrays according to the updated total execution days, and sorting each script in a descending order according to the actual execution time of each script; traversing the ordered scripts by using a greedy algorithm, sequentially placing the ordered scripts into an array with the smallest current accumulated execution total duration in the created array, and if the current accumulated execution total duration is the same, prioritizing the array with the sequence number in the front, so as to obtain a script list executed every day within 5 days of total execution days, namely a script programming plan.
In the present embodiment, when the total number of days of execution is preferentially increased or decreased, a script list is created, which is executed daily within the updated total number of days of execution, as a script arrangement plan, whereby the target script arrangement plan in the present embodiment is effectively obtained.
In one embodiment, in the step S201, the total number of days of execution of the script execution plan is updated according to the daily execution duration and the actual total execution duration of the script execution plan, and specifically includes the following contents: determining updated information of the total execution days of the script execution plan according to the planned total execution time length, the actual total execution time length and the daily execution time length; the update information is used to indicate days that are increased or decreased on the basis of the total number of days performed; and updating the total execution days according to the updating information to obtain updated total execution days.
The update information is information indicating the number of days that increases or decreases based on the total number of days performed.
Specifically, the terminal inputs the planned total execution time length, the actual execution total time length and the daily execution time length into a pre-constructed numerical calculation model to obtain a numerical calculation result; determining the update information of the total execution days of the script execution plan according to the numerical calculation result; and updating the total execution days according to the updating information to obtain updated total execution days.
For example, assume that a script execution plan predetermined by a user is: executing the automated test scripts 1 time in full every 6 days, wherein the execution time period of each day is 60 minutes, the planned total execution time period is 360 minutes, and the actual total time period of executing the automated test scripts 1 time in full is 300 minutes; and the numerical value calculation result is-1, namely the update information of the total execution days is-1, the total execution days are updated according to the update information, and the updated total execution days are 5 days.
In this embodiment, the update information of the total execution days of the script execution plan is accurately calculated through three data indexes, namely, the planned total execution time length, the actual total execution time length and the daily execution time length; thereby effectively obtaining updated total days of execution.
In one embodiment, in step S103, the overall script is executed iteratively according to the script arrangement plan, to obtain an average execution duration of each script in the overall script, which specifically includes the following contents: according to the script programming plan, iteratively executing the full-volume scripts, and recording each execution time length of each script in the full-volume scripts until the total execution times of the full-volume scripts are the same as the preset times; and determining the average execution duration of each script in the full-scale script according to each execution duration of each script in the full-scale script.
The preset times are target execution times of a preset full script.
Specifically, the terminal acquires preset times for executing the full-volume scripts, after the first script arrangement analysis is completed, the full-volume scripts are executed iteratively according to the script arrangement plan, and meanwhile, each execution time length of each script in the full-volume scripts is recorded until the total execution times of the full-volume scripts are the same as the preset times; and calculating the average execution time length of each script in the full-volume script according to the execution time length of each script in the full-volume script.
In this embodiment, the full-volume scripts are executed through multiple iterations, and each execution duration of each script in the full-volume scripts is recorded at the same time, and according to the recorded effective information, the average execution duration of each script in the full-volume scripts is accurately calculated.
In one embodiment, in step S104, the scripting plan is updated according to the average execution duration of each script, so as to obtain an updated scripting plan, which specifically includes the following contents: under the condition that the total planned execution time length corresponding to the script execution plan is not equal to the actual execution time length, the total execution days and/or the daily execution time length of the script execution plan are adjusted again according to preset adjustment information and the average execution time length of each script; and obtaining an updated script programming plan according to the adjustment result of the script execution plan.
The adjustment result of the script execution plan is a result obtained after more accurate adjustment is performed according to preset adjustment information and average execution duration of each script.
Specifically, the terminal acquires a planned total execution time length and an actual total execution time length corresponding to the script execution plan, judges whether the planned total execution time length is equal to the actual total execution time length, and adjusts the execution total days and/or the daily execution time length of the script execution plan again according to preset adjustment information and the average execution time length of each script under the condition that the planned total execution time length is not equal to the actual total execution time length; and obtaining a script list to be executed every day in the new total execution days according to the adjustment result of the script execution plan, namely obtaining the updated script programming plan.
For example, an automated test equipment plan executes 1 full run of automated test scripts every 6 days for 60 minutes per day, with a total planned execution time of 360 minutes; for the situation that the actual total execution duration is longer than the planned execution total duration and the user selects to adjust the total execution days preferentially, assuming that the actual total execution duration of the automated test project is 420 minutes, after the processing of the script arrangement analysis module, the generated execution plan is to execute 1-time automated test script every 7 days in total, and the execution is performed for 60 minutes every day.
By way of further example, an automated test equipment plan executes 1 full run of automated test scripts every 6 days for 60 minutes per day, with a total planned execution time of 360 minutes; for the case that the actual total execution duration is less than the planned execution total duration and the user selects to adjust the daily execution duration preferentially, assuming that the actual total execution duration of the automated test project is 300 minutes, after the processing of the script arrangement analysis module, the generated execution plan is to execute 1-time automated test script every 6 days in total, and the automated test script is executed for 50 minutes every day.
In this embodiment, when the total execution duration of the program corresponding to the script execution program is not equal to the actual execution duration, the total number of days and/or the daily execution duration of the execution program of the script is adjusted again according to the preset adjustment information and the average execution duration of each script, so that an updated script arrangement program is effectively obtained according to the adjustment result of the script execution program.
In one embodiment, the scripting method further includes the following: generating abnormal data alarm information according to abnormal execution duration of the script under the condition that the script is abnormal in execution of the full script; and according to the abnormal data alarm information, eliminating abnormal execution time of the script by using a preset abnormal data processing mode.
The scenario execution exception refers to a scenario execution duration being too short or an execution duration being too long.
The preset abnormal data processing modes generally comprise two types, namely manual removal by a user and automatic removal by a system.
Specifically, in the execution process of the full-volume script, the terminal acquires the abnormal execution time length corresponding to the abnormal execution of the script and generates abnormal data alarm information according to the abnormal execution time length of the script when recognizing that the execution of the script is abnormal; and then eliminating abnormal execution time of the script by using a preset abnormal data processing mode according to the abnormal data alarm information.
For example, in the execution process of the full-volume script, the terminal acquires the abnormal execution time length corresponding to the abnormal execution of the script and generates abnormal data alarm information according to the abnormal execution time length of the script when recognizing that the execution time length of the script is overlong; and then according to the abnormal data alarm information, eliminating abnormal execution time of the script by using a system automatic elimination mode.
In the embodiment, the abnormal data alarm information is generated under the condition that the script execution abnormality occurs, and the abnormal execution duration of the abnormal script is eliminated by using a preset abnormal data processing mode, so that the influence of the abnormal execution duration on script programming analysis is reduced.
In one embodiment, as shown in fig. 3, another scripting method is provided, specifically including the following steps:
step S301, acquiring a script execution plan of a test task and preset adjustment information for the script execution plan.
Step S302, when the preset adjustment information is to adjust the execution time of each day preferentially, creating an array of corresponding number according to the total number of days of execution, and sorting each script in descending order according to the actual execution time of each script.
Step S303, orderly placing the ordered scripts into an array with the smallest current accumulated execution total duration in the created array, and obtaining a script list executed every day in the total execution days as a script programming plan; the difference between the total execution time length of the script list executed every day and the updated daily execution time length meets a preset range, and the updated daily execution time length is determined according to the total execution days of the script execution plan and the actual total execution time length.
Step S304, under the condition that the preset adjustment information is the priority adjustment execution total days, determining the update information of the execution total days of the script execution plan according to the planned total execution time length, the actual execution total time length and the daily execution time length; the update information is used to indicate days that are increased or decreased based on the total number of days performed.
Step S305, updating the total execution days according to the updating information to obtain updated total execution days; and creating an array with corresponding number according to the updated total execution days, and ordering the scripts in descending order according to the actual execution duration of each script.
Step S306, orderly placing the ordered scripts into an array with the smallest current accumulated execution total duration in the created array, and obtaining an updated script list executed every day in the total execution days as a script programming plan; the total execution duration of the script list executed daily is less than or equal to the daily execution duration.
Step S307, iteratively executing the full-volume scripts according to the script arrangement plan, and recording each execution time of each script in the full-volume scripts until the total execution times of the full-volume scripts are the same as the preset times; and determining the average execution duration of each script in the full-scale script according to each execution duration of each script in the full-scale script.
Step S308, when the total execution time length of the corresponding program of the script execution program is not equal to the actual execution time length, the total execution days and/or the daily execution time length of the script execution program are adjusted again according to preset adjustment information and the average execution time length of each script; and obtaining an updated script programming plan according to the adjustment result of the script execution plan.
Step S309, generating abnormal data alarm information according to abnormal execution time length of the script under the condition that the script is abnormal in execution process of the full script; and according to the abnormal data alarm information, eliminating abnormal execution time of the script by using a preset abnormal data processing mode.
In the script programming method, the script execution plan of the test task and the preset adjustment information aiming at the script execution plan are acquired first, so that the script execution plan can be adjusted flexibly according to the preset adjustment information and the adjustment preference of a user. When the preset adjustment information is used for preferentially adjusting the execution time of each day, creating an array of corresponding number according to the total number of days of execution, and ordering each script in descending order according to the actual execution time of each script; sequentially placing the ordered scripts into an array with the smallest current accumulated execution total duration in the created array, and obtaining a script list executed every day in the total execution days as a script programming plan; the target script programming plan in this embodiment is effectively obtained by creating a script list of daily execution within the total number of execution days while preferentially increasing or decreasing the daily execution time period and keeping the total number of execution days unchanged. Under the condition that the preset adjustment information is the priority adjustment execution total number of days, determining the update information of the execution total number of days of the script execution plan according to the planned total execution time length, the actual execution total time length and the daily execution time length, and updating the execution total number of days according to the update information to obtain updated execution total number of days; creating an array with corresponding number according to the updated total execution days, and sorting the scripts in descending order according to the actual execution duration of each script; sequentially placing the ordered scripts into an array with the smallest current accumulated execution total duration in the created array, and obtaining an updated script list executed every day in the total execution days as a script programming plan; by creating a script list that is executed daily for the updated total number of days of execution with priority to increase or decrease the total number of days of execution, the target script arrangement plan in this embodiment is effectively obtained. According to the script programming plan, iteratively executing the full-volume scripts, and recording each execution time length of each script in the full-volume scripts until the total execution times of the full-volume scripts are the same as the preset times; determining the average execution duration of each script in the full-volume script according to each execution duration of each script in the full-volume script; and executing the full-volume scripts through multiple rounds of iteration, recording each execution time length of each script in the full-volume scripts, and accurately calculating the average execution time length of each script in the full-volume scripts according to the recorded effective information. Under the condition that the total planned execution time length corresponding to the script execution plan is not equal to the actual execution time length, the total execution days and/or the daily execution time length of the script execution plan are adjusted again according to preset adjustment information and the average execution time length of each script; therefore, the updated script arrangement plan is effectively obtained according to the adjustment result of the script execution plan. Generating abnormal data alarm information according to abnormal execution duration of the script under the condition that the script is abnormal in execution of the full script; according to the abnormal data alarm information, the abnormal execution time length of the script is eliminated by using a preset abnormal data processing mode, so that the influence of the abnormal execution time length on script programming analysis is reduced. The automatic test script arrangement mode based on the artificial intelligence technology is adopted to generate a script arrangement plan, the resource usage of each execution of the automatic test operation is balanced as much as possible under the condition that the daily execution duration range is met, the rationality of automatic test resource allocation is improved, manual participation is not needed in the whole process, deviation caused by human subjective factors is avoided, and the utilization rate of the automatic test resources is improved.
In order to more clearly clarify the scripting method provided in the embodiments of the present application, the scripting method will be specifically described in the following with a specific embodiment. In one embodiment, as shown in fig. 4, the present application further provides a script editing method, which specifically includes the following steps:
step 1: a script execution plan made by the user is obtained, and automatically adjusting preferences when the actual schedule does not conform to the plan.
Step 2: and performing first full script execution by using a default programming plan, and recording the resource usage of each script by a resource monitoring module.
Step 3: and calculating the total resource usage according to the resource usage record of each script, and carrying out script arrangement analysis.
Step 4: and judging whether the script execution plan formulated by the user is satisfied.
Step 5: in the case where the result of the scripting analysis does not satisfy the script execution plan, the script execution plan is adjusted according to the automatic adjustment preference.
Step 6: and finishing the arrangement and obtaining a script arrangement plan.
Step 7: and executing the full script iteratively by using the generated script programming plan, and obtaining a more reasonable script programming plan after multiple iterations.
In the script programming method, firstly, a script execution plan formulated by a user is obtained, and when the actual programming does not accord with the plan, the automatic adjustment preference is automatically adjusted, so that the script execution plan can be flexibly adjusted according to the adjustment preference of the user; performing first full script execution by using a default programming plan, and recording the resource usage of each script by using a resource monitoring module, thereby accurately obtaining the execution duration of each script; calculating the total resource usage according to the resource usage record of each script, and providing data information for the subsequent script arrangement analysis; judging whether a script execution plan formulated by a user is met, and under the condition that the result of script programming analysis does not meet the script execution plan, adjusting the script execution plan according to automatic adjustment preference, completing programming and obtaining the script programming plan, thereby effectively adjusting the initial script execution plan into the script programming plan in a practical situation, and being beneficial to improving the rationality of automatic test resource allocation; finally, iteratively executing the full-quantity scripts according to the generated script arrangement plan to obtain the average execution duration of each script in the full-quantity scripts, and updating the script arrangement plan according to the average execution duration of each script to obtain a more reasonable script arrangement plan; the automatic test script arrangement mode based on the artificial intelligence technology is adopted to generate a script arrangement plan, the resource usage of each execution of the automatic test operation is balanced as much as possible under the condition that the daily execution duration range is met, the rationality of automatic test resource allocation is improved, manual participation is not needed in the whole process, deviation caused by human subjective factors is avoided, and the utilization rate of the automatic test resources is improved.
It should be understood that, although the steps in the flowcharts related to the embodiments described above are sequentially shown as indicated by arrows, these steps are not necessarily sequentially performed in the order indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in the flowcharts described in the above embodiments may include a plurality of steps or a plurality of stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of the steps or stages is not necessarily performed sequentially, but may be performed alternately or alternately with at least some of the other steps or stages.
Based on the same inventive concept, the embodiment of the application also provides a script editing device for realizing the script editing method. The implementation of the solution provided by the device is similar to the implementation described in the above method, so the specific limitation in one or more embodiments of the scripting device provided below may refer to the limitation of the scripting method described above, and will not be repeated here.
In one embodiment, as shown in fig. 5, there is provided a scripting apparatus, comprising: an information acquisition module 501, a script orchestration module 502, a script execution module 503, and an orchestration update module 504, wherein:
the information obtaining module 501 is configured to obtain a script execution plan of a test task and preset adjustment information for the script execution plan.
The script arrangement module 502 is configured to adjust a total execution day and/or a daily execution time length of the script execution plan according to preset adjustment information when a total execution time length of the plan corresponding to the script execution plan is not equal to an actual execution total time length, so as to obtain a script arrangement plan; the actual total execution time length is the sum of the actual execution time length of each script in the full script in the script execution plan.
And the script execution module 503 is configured to iteratively execute the full-volume scripts according to the script programming plan, so as to obtain an average execution duration of each script in the full-volume scripts.
And the arrangement updating module 504 is configured to update the script arrangement plan according to the average execution duration of each script, so as to obtain an updated script arrangement plan.
In one embodiment, the script arrangement module 502 is further configured to create an array of a corresponding number according to a total number of days of execution and sort each script in descending order according to an actual execution duration of each script, where the preset adjustment information is to preferentially adjust the execution duration of each day; sequentially placing the ordered scripts into an array with the smallest current accumulated execution total duration in the created array, and obtaining a script list executed every day in the total execution days as a script programming plan; the difference between the total execution time length of the script list executed every day and the updated daily execution time length meets a preset range, and the updated daily execution time length is determined according to the total execution days of the script execution plan and the actual total execution time length.
In one embodiment, the script orchestration module 502 is further configured to update the total number of days of execution of the script execution plan according to the daily execution duration and the actual total execution duration of the script execution plan when the preset adjustment information is to preferentially adjust the total number of days of execution; creating an array with corresponding number according to the updated total execution days, and ordering scripts in descending order according to the actual execution duration of each script; sequentially placing the ordered scripts into an array with the smallest current accumulated execution total duration in the created array, and obtaining an updated script list executed every day in the total execution days as a script programming plan; the total execution duration of the script list executed daily is less than or equal to the daily execution duration.
In one embodiment, the script orchestration module 502 is further configured to determine updated information of a total number of days of execution of the script execution plan according to the planned total execution time length, the actual total execution time length, and the daily execution time length; the update information is used to indicate days that are increased or decreased on the basis of the total number of days performed; and updating the total execution days according to the updating information to obtain updated total execution days.
In one embodiment, the script execution module 503 is further configured to iterate and execute the full-volume scripts according to the script arrangement plan, and record each execution duration of each script in the full-volume scripts until the total execution times of the full-volume scripts are the same as the preset times; and determining the average execution duration of each script in the full-scale script according to each execution duration of each script in the full-scale script.
In one embodiment, the arrangement updating module 504 is further configured to, when the total planned execution duration corresponding to the script execution plan is not equal to the actual total execution duration, readjust the total number of days and/or the daily execution duration of the script execution plan according to the preset adjustment information and the average execution duration of each script; and obtaining an updated script programming plan according to the adjustment result of the script execution plan.
In one embodiment, the script editing device further comprises an exception processing module, which is used for generating exception data alarm information according to the exception execution duration of the script when the execution of the script is abnormal in the execution process of the full script; and according to the abnormal data alarm information, eliminating abnormal execution time of the script by using a preset abnormal data processing mode.
The various modules in the scripting apparatus described above may be implemented in whole or in part in software, hardware, and combinations thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
In one embodiment, a computer device is provided, which may be a terminal, and the internal structure of which may be as shown in fig. 6. The computer device includes a processor, a memory, an input/output interface, a communication interface, a display unit, and an input means. The processor, the memory and the input/output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input/output interface. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The input/output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used for carrying out wired or wireless communication with an external terminal, and the wireless mode can be realized through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. The computer program is executed by a processor to implement a scripting method. The display unit of the computer device is used for forming a visual picture, and can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, can also be a key, a track ball or a touch pad arranged on the shell of the computer equipment, and can also be an external keyboard, a touch pad or a mouse and the like.
It will be appreciated by those skilled in the art that the structure shown in fig. 6 is merely a block diagram of some of the structures associated with the present application and is not limiting of the computer device to which the present application may be applied, and that a particular computer device may include more or fewer components than shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is provided comprising a memory and a processor, the memory having stored therein a computer program, the processor when executing the computer program performing the steps of:
acquiring a script execution plan of a test task and preset adjustment information aiming at the script execution plan;
under the condition that the total execution time length of the corresponding program of the script execution program is not equal to the actual total execution time length, adjusting the total execution days and/or the daily execution time length of the script execution program according to the preset adjustment information to obtain a script programming program; the actual total execution time length is the sum of the actual execution time length of each script in the total scripts in the script execution plan;
iteratively executing the full-volume scripts according to the script programming plan to obtain the average execution duration of each script in the full-volume scripts;
And updating the script arrangement plan according to the average execution duration of each script to obtain an updated script arrangement plan.
In one embodiment, the processor when executing the computer program further performs the steps of: under the condition that the preset adjustment information is used for preferentially adjusting the execution duration of each day, creating an array of corresponding number according to the total number of days of execution, and ordering each script in descending order according to the actual execution duration of each script; sequentially placing the ordered scripts into an array with the smallest current accumulated execution total duration in the created array, and obtaining a script list executed every day in the total execution days as a script programming plan; the difference between the total execution time length of the script list executed every day and the updated daily execution time length meets a preset range, and the updated daily execution time length is determined according to the total execution days of the script execution plan and the actual total execution time length.
In one embodiment, the processor when executing the computer program further performs the steps of: under the condition that the preset adjustment information is to preferentially adjust the total number of days of execution, updating the total number of days of execution of the script execution plan according to the daily execution duration and the actual total execution duration of the script execution plan; creating an array with corresponding number according to the updated total execution days, and ordering scripts in descending order according to the actual execution duration of each script; sequentially placing the ordered scripts into an array with the smallest current accumulated execution total duration in the created array, and obtaining an updated script list executed every day in the total execution days as a script programming plan; the total execution duration of the script list executed daily is less than or equal to the daily execution duration.
In one embodiment, the processor when executing the computer program further performs the steps of: determining updated information of the total execution days of the script execution plan according to the planned total execution time length, the actual total execution time length and the daily execution time length; the update information is used to indicate days that are increased or decreased on the basis of the total number of days performed; and updating the total execution days according to the updating information to obtain updated total execution days.
In one embodiment, the processor when executing the computer program further performs the steps of: according to the script programming plan, iteratively executing the full-volume scripts, and recording each execution time length of each script in the full-volume scripts until the total execution times of the full-volume scripts are the same as the preset times; and determining the average execution duration of each script in the full-scale script according to each execution duration of each script in the full-scale script.
In one embodiment, the processor when executing the computer program further performs the steps of: under the condition that the total planned execution time length corresponding to the script execution plan is not equal to the actual execution time length, the total execution days and/or the daily execution time length of the script execution plan are adjusted again according to preset adjustment information and the average execution time length of each script; and obtaining an updated script programming plan according to the adjustment result of the script execution plan.
In one embodiment, the processor when executing the computer program further performs the steps of: generating abnormal data alarm information according to abnormal execution duration of the script under the condition that the script is abnormal in execution of the full script; and according to the abnormal data alarm information, eliminating abnormal execution time of the script by using a preset abnormal data processing mode.
In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored which, when executed by a processor, carries out the steps of the method embodiments described above.
In an embodiment, a computer program product is provided, comprising a computer program which, when executed by a processor, implements the steps of the method embodiments described above.
It should be noted that, the user information (including, but not limited to, user equipment information, user personal information, etc.) and the data (including, but not limited to, data for analysis, stored data, presented data, etc.) referred to in the present application are information and data authorized by the user or sufficiently authorized by each party, and the collection, use and processing of the related data are required to comply with the related laws and regulations and standards of the related countries and regions.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, database, or other medium used in the various embodiments provided herein may include at least one of non-volatile and volatile memory. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, high density embedded nonvolatile Memory, resistive random access Memory (ReRAM), magnetic random access Memory (Magnetoresistive Random Access Memory, MRAM), ferroelectric Memory (Ferroelectric Random Access Memory, FRAM), phase change Memory (Phase Change Memory, PCM), graphene Memory, and the like. Volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory, and the like. By way of illustration, and not limitation, RAM can be in the form of a variety of forms, such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM), and the like. The databases referred to in the various embodiments provided herein may include at least one of relational databases and non-relational databases. The non-relational database may include, but is not limited to, a blockchain-based distributed database, and the like. The processors referred to in the embodiments provided herein may be general purpose processors, central processing units, graphics processors, digital signal processors, programmable logic units, quantum computing-based data processing logic units, etc., without being limited thereto.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The above examples only represent a few embodiments of the present application, which are described in more detail and are not to be construed as limiting the scope of the present application. It should be noted that it would be apparent to those skilled in the art that various modifications and improvements could be made without departing from the spirit of the present application, which would be within the scope of the present application. Accordingly, the scope of protection of the present application shall be subject to the appended claims.

Claims (11)

1. A method of scripting, said method comprising:
acquiring a script execution plan of a test task and preset adjustment information aiming at the script execution plan;
under the condition that the total execution time length of the corresponding program of the script execution program is not equal to the actual total execution time length, adjusting the total execution days and/or the daily execution time length of the script execution program according to the preset adjustment information to obtain a script programming program; the actual total execution time length is the sum of the actual execution time length of each script in the total scripts in the script execution plan;
Iteratively executing the full-volume scripts according to the script programming plan to obtain the average execution duration of each script in the full-volume scripts;
and updating the script arrangement plan according to the average execution duration of each script to obtain an updated script arrangement plan.
2. The method according to claim 1, wherein the adjusting the total number of days and/or the duration of execution of the script execution plan according to the preset adjustment information to obtain a script programming plan includes:
under the condition that the preset adjustment information is used for preferentially adjusting the execution duration of each day, creating an array with corresponding number according to the total execution days, and sorting each script in descending order according to the actual execution duration of each script;
sequentially placing ordered scripts into an array with the smallest current accumulated execution total duration in the created array, and obtaining a script list executed every day in the total execution days as the script programming plan; the difference between the total execution time length of the script list executed every day and the updated daily execution time length meets a preset range, and the updated daily execution time length is determined according to the total execution days of the script execution plan and the actual total execution time length.
3. The method according to claim 1, wherein the adjusting the total number of days and/or the duration of execution of the script execution plan according to the preset adjustment information to obtain a script programming plan includes:
under the condition that the preset adjustment information is used for preferentially adjusting the total execution days, updating the total execution days of the script execution plan according to the daily execution duration and the actual total execution duration of the script execution plan;
creating an array with corresponding number according to the updated total execution days, and sorting the scripts in descending order according to the actual execution duration of each script;
sequentially placing the ordered scripts into an array with the smallest current accumulated execution total duration in the created array, and obtaining a script list executed every day in the updated execution total days as the script programming plan; and the total execution duration of the script list executed every day is smaller than or equal to the execution duration every day.
4. The method of claim 3, wherein updating the total number of days of execution of the script execution plan based on the daily execution duration and the actual total execution duration of the script execution plan comprises:
Determining updated information of the total execution days of the script execution plan according to the planned total execution time length, the actual execution total time length and the daily execution time length; the update information is used for representing the number of days which are increased or decreased on the basis of the total number of execution days;
and updating the total execution days according to the updating information to obtain the updated total execution days.
5. The method according to claim 1, wherein the iteratively executing the full-volume scripts according to the script orchestration plan, to obtain an average execution duration for each script in the full-volume scripts, comprises:
iteratively executing the full-volume scripts according to the script arrangement plan, and recording each execution time length of each script in the full-volume scripts until the total execution times of the full-volume scripts are the same as the preset times;
and determining the average execution duration of each script in the full-volume scripts according to the execution duration of each script in the full-volume scripts.
6. The method according to any one of claims 1 to 5, wherein updating the scripting plan according to the average execution duration of each script to obtain an updated scripting plan includes:
When the total planned execution time length corresponding to the script execution plan is not equal to the actual execution time length, according to the preset adjustment information and the average execution time length of each script, adjusting the total execution days and/or the daily execution time length of the script execution plan again;
and obtaining the updated script programming plan according to the adjustment result of the script execution plan.
7. The method of claim 6, wherein the method further comprises:
generating abnormal data alarm information according to abnormal execution time of the script under the condition that script execution abnormality occurs in the execution process of the full script;
and according to the abnormal data alarm information, eliminating abnormal execution time of the script by using a preset abnormal data processing mode.
8. A script orchestration device, the device comprising:
the information acquisition module is used for acquiring a script execution plan of the test task and preset adjustment information aiming at the script execution plan;
the script arrangement module is used for adjusting the total execution days and/or the daily execution time length of the script execution plan according to the preset adjustment information under the condition that the total plan execution time length corresponding to the script execution plan is not equal to the actual execution time length, so as to obtain the script arrangement plan; the actual total execution time length is the sum of the actual execution time length of each script in the total scripts in the script execution plan;
The script execution module is used for iteratively executing the full-volume scripts according to the script programming plan to obtain the average execution duration of each script in the full-volume scripts;
and the arrangement updating module is used for updating the script arrangement plan according to the average execution time length of each script to obtain an updated script arrangement plan.
9. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the method of any of claims 1 to 7 when the computer program is executed.
10. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 7.
11. A computer program product comprising a computer program, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 7.
CN202310212891.6A 2023-03-06 2023-03-06 Script editing method, script editing device, computer equipment and storage medium Pending CN116185866A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310212891.6A CN116185866A (en) 2023-03-06 2023-03-06 Script editing method, script editing device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310212891.6A CN116185866A (en) 2023-03-06 2023-03-06 Script editing method, script editing device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116185866A true CN116185866A (en) 2023-05-30

Family

ID=86447406

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310212891.6A Pending CN116185866A (en) 2023-03-06 2023-03-06 Script editing method, script editing device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116185866A (en)

Similar Documents

Publication Publication Date Title
CN111124644B (en) Method, device and system for determining task scheduling resources
CN116185866A (en) Script editing method, script editing device, computer equipment and storage medium
CN115729687A (en) Task scheduling method and device, computer equipment and storage medium
CN117314067A (en) Work order distribution method, apparatus, device, storage medium and program product
CN116579585B (en) Resource allocation method, device, computer equipment and storage medium
CN116260823B (en) Controlled data sharing method, device, computer equipment and storage medium
CN117474174A (en) Scheduling rule optimization method, scheduling rule optimization device, computer equipment, storage medium and product
CN116909705A (en) Batch task processing method and system
CN117455501A (en) Request processing method, apparatus, computer device and storage medium
CN117745446A (en) Resource data processing method, device, computer equipment and storage medium
CN117082143A (en) Resource scheduling method, device, computer equipment and storage medium
CN117453356A (en) Thread pool adjusting method, device, computer equipment and storage medium
CN117311970A (en) Processing method and device for application memory, computer equipment and storage medium
CN114490537A (en) Multi-server data processing method and device, computer equipment and storage medium
CN117376114A (en) Parameter configuration method, device, computer equipment and storage medium
CN117574221A (en) Business logic analysis method, device, computer equipment and storage medium
CN116126490A (en) Resource scheduling method, device, computer equipment and storage medium
CN117112206A (en) Transaction resource isolation method, device, computer equipment and storage medium
CN116820558A (en) Application program development method, device, equipment, storage medium and program product
CN116304269A (en) User activity prediction method and device, computer equipment and storage medium
CN118034906A (en) Cloud server cluster processing method and device, computer equipment and storage medium
CN117077917A (en) Personnel capability assessment method and device based on low-code platform and computer equipment
CN117724830A (en) Method, device and computer equipment for configuring application resources
CN117726076A (en) Method, device, equipment and medium for determining resource conversion service influence information
CN116401162A (en) Verification method and device for automatic test, computer equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination