CN111813396A - Script editing method and device, computer equipment and readable storage medium - Google Patents

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

Info

Publication number
CN111813396A
CN111813396A CN202010676887.1A CN202010676887A CN111813396A CN 111813396 A CN111813396 A CN 111813396A CN 202010676887 A CN202010676887 A CN 202010676887A CN 111813396 A CN111813396 A CN 111813396A
Authority
CN
China
Prior art keywords
script
script object
environment
parameter
running
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.)
Granted
Application number
CN202010676887.1A
Other languages
Chinese (zh)
Other versions
CN111813396B (en
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.)
Beijing Ziroom Information Technology Co Ltd
Original Assignee
Beijing Ziroom Information Technology Co Ltd
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 Beijing Ziroom Information Technology Co Ltd filed Critical Beijing Ziroom Information Technology Co Ltd
Priority to CN202010676887.1A priority Critical patent/CN111813396B/en
Publication of CN111813396A publication Critical patent/CN111813396A/en
Application granted granted Critical
Publication of CN111813396B publication Critical patent/CN111813396B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/31Programming languages or programming paradigms
    • G06F8/315Object-oriented languages
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/36Software reuse

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Stored Programmes (AREA)

Abstract

The invention discloses a script editing method, a device, computer equipment and a readable storage medium, wherein the script editing method comprises the following steps: analyzing the script object, identifying a script language environment corresponding to the script object, and distributing a corresponding running environment for the script object; determining a public parameter according to the entry parameter of the script object; and saving the script object as a script tool module according to the running environment and the public parameters. By implementing the invention, the running environment does not need to be repeatedly built locally, the defects that the script object can not support multi-language program compiling and the script object is difficult to multiplex are overcome, repeated editing is avoided, and the development efficiency is improved.

Description

Script editing method and device, computer equipment and readable storage medium
Technical Field
The invention relates to the technical field of system testing, in particular to a script editing method and device, computer equipment and a readable storage medium.
Background
Scripts are executable files written according to a certain format using a particular descriptive language. The scripts can be called and executed temporarily by the application program, and because the scripts can not only reduce the scale of the web page and improve the web page browsing speed, but also enrich the representation of the web page, such as animation, sound and the like, various scripts are widely applied to the web page design. For example, email software such as Outlook Express or Foxmail can be automatically invoked when clicking on an E-mail address on a web page, which is accomplished through scripting.
The existing online script editing tool can only meet the requirements of writing and running of simple single script programs, for example, a bird and vegetable tool, a Monaco Editor and the like can not support writing and running of multi-script and multi-language programs, a user can only stop at the local running and debugging stage, when the script is used, an environment execution script needs to be built locally, when script data changes, script content needs to be changed timely, script multiplexing difficulty is caused, universal scripts can not be shared, testers can not learn and write codes conveniently, and labor development cost is increased.
Disclosure of Invention
Therefore, the technical problem to be solved by the present invention is to overcome the defects that the online script editing tool in the prior art cannot support the writing and running of multi-script and multi-language programs, and the script is difficult to reuse, so as to provide a script editing method, apparatus, computer device and readable storage medium.
According to a first aspect, an embodiment of the present invention provides a method for editing a script, including: analyzing the script object, identifying a script language environment corresponding to the script object, and distributing a corresponding running environment for the script object; determining a public parameter according to the entry parameter of the script object; and saving the script object as a script tool module according to the running environment and the public parameters.
With reference to the first aspect, in a first implementation manner of the first aspect, when an obtaining manner of the script object is uploading, the parsing the script object, identifying a script language environment corresponding to the script object, and allocating a corresponding running environment to the script object includes: globally scanning the script object and identifying the language environment of the script object; and searching a directory where an entry file of the script object is started according to the language environment and the script object, and distributing a corresponding running environment for the script object.
With reference to the first implementation manner of the first aspect, in a second implementation manner of the first aspect, if a plurality of entry files for starting the script object includes, a unique entry file is determined according to an input instruction of a user.
With reference to the first implementation manner of the first aspect, in a third implementation manner of the first aspect, the determining a common parameter according to the entry of the script object includes: acquiring parameters of an entry file corresponding to the script object, determining parameter values and parameter meanings corresponding to the parameter argn by taking the parameter argn as a parameter placeholder, and generating a parameter list; assembling the list of parameters into the common parameter.
With reference to the first aspect, in a fourth implementation manner of the first aspect, when an obtaining manner of the script object is online editing, the parsing the script object, identifying a script language environment corresponding to the script object, and allocating a corresponding running environment to the script object includes: identifying a language environment of the script object; and determining an editor corresponding to the language environment, and distributing a corresponding running environment for the script object according to the language environment.
With reference to the fourth implementation manner of the first aspect, in a fifth implementation manner of the first aspect, the determining a common parameter according to the entry of the script object includes: acquiring a target editing position of the script object; receiving an input instruction of a user, and adding a preset script module to the target editing position according to the input instruction; and assembling the preset script module and the script object to obtain the public parameters.
With reference to the first aspect, in a sixth implementation manner of the first aspect, after saving the script object as a script tool module according to the execution environment and the common parameter, the method further includes: running the script object in the running environment to obtain a running log of the script object; judging whether the type of the running log is a preset type or not; and if the type of the running log is the preset type, converting the running log into a visual chart.
According to a second aspect, an embodiment of the present invention provides a script editing and executing apparatus, including: the identification module is used for analyzing the script object, identifying the script language environment corresponding to the script object and distributing the corresponding running environment for the script object; the determining module is used for determining a public parameter according to the entry parameter of the script object; and the generating module is used for storing the script object as a script tool module according to the running environment and the public parameters.
According to a third aspect, an embodiment of the present invention provides a computer apparatus, including: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the computer instructions to perform the method for editing scripts according to the first aspect or any embodiment of the first aspect.
According to a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, where computer instructions are stored, and the computer instructions are configured to cause the computer to execute the method for editing a script according to the first aspect or any embodiment of the first aspect.
The technical scheme of the invention has the following advantages:
according to the script editing method and device, the computer equipment and the readable storage medium, the script object is analyzed, the script language environment corresponding to the script object to be edited at present is automatically identified, the corresponding running environment is configured for the script object, the running environment does not need to be repeatedly established locally, and the problem that the script object cannot support multi-language program compiling is solved; and determining the public parameters of the script object according to the parameters of the script object, operating the script object in the configured operating environment according to the public parameters, and storing the script object as a script tool module for the next direct use, so that the defect of difficult reuse of the script object is overcome, repeated editing is avoided, and the development efficiency is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
FIG. 1 is a flowchart of a method for editing a script according to an embodiment of the present invention;
FIG. 2 is another flowchart of a method for editing a script according to an embodiment of the present invention;
FIG. 3 is a schematic diagram illustrating uploading of a script object according to an embodiment of the present invention;
FIG. 4 is another flowchart of a method for editing a script according to an embodiment of the present invention;
FIG. 5 is a diagram illustrating parameter editing according to an embodiment of the present invention;
FIG. 6 is another flowchart of a method for editing a script according to an embodiment of the present invention;
FIG. 7 is a diagram illustrating online editing of a script object in an embodiment of the invention;
FIG. 8 is another flowchart of a method for editing scripts in an embodiment of the present invention;
FIG. 9 is a schematic drawing illustrating dragging of a script object during online editing according to an embodiment of the present invention;
FIG. 10 is another flowchart of a method for editing a script according to an embodiment of the present invention;
FIG. 11 is a diagram illustrating a log of a script object according to an embodiment of the present invention;
FIG. 12 is a schematic diagram of a visualization chart of a script object in an embodiment of the invention;
FIG. 13 is a schematic block diagram of an apparatus for editing scripts in an embodiment of the present invention;
fig. 14 is a schematic structural diagram of a computer device in an embodiment of the present invention.
Detailed Description
The technical solutions of the present invention will be described clearly and completely with reference to the accompanying drawings, and it should be understood that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In the description of the present invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicate orientations or positional relationships based on the orientations or positional relationships shown in the drawings, and are only for convenience of description and simplicity of description, but do not indicate or imply that the device or element being referred to must have a particular orientation, be constructed and operated in a particular orientation, and thus, should not be construed as limiting the present invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance.
In the description of the present invention, it should be noted that, unless otherwise explicitly specified or limited, the terms "mounted," "connected," and "connected" are to be construed broadly, e.g., as meaning either a fixed connection, a removable connection, or an integral connection; can be mechanically or electrically connected; the two elements may be directly connected or indirectly connected through an intermediate medium, or may be communicated with each other inside the two elements, or may be wirelessly connected or wired connected. The specific meanings of the above terms in the present invention can be understood in specific cases to those skilled in the art.
In addition, the technical features involved in the different embodiments of the present invention described below may be combined with each other as long as they do not conflict with each other.
Example 1
The embodiment provides a script editing method, which is applied to script editing and running of a user, and as shown in fig. 1, the script editing method includes the following steps:
and S11, analyzing the script object, identifying the script language environment corresponding to the script object, and distributing the corresponding running environment for the script object.
Illustratively, the script object may be obtained by uploading or by editing on-line. The script object may include a plurality of script files, for example, a plurality of script files written in Java language may be packaged as jar packages and uploaded; and packaging a plurality of scripts written by the Python language into a zip package for uploading, which is not limited in the application and can be determined by a person skilled in the art according to actual needs. The server can scan and analyze the obtained script object, determine the script language of the script object, and allocate a corresponding running environment for the script object.
And S12, determining the public parameters according to the entries of the script objects.
Illustratively, the input parameters of the script object are adjusted, and the input parameters of the script object and the parameter values corresponding to the input parameters are defined. The common parameters are input parameters of the script object and output parameters corresponding to the input parameters. And assembling and setting the common parameters of the script object according to the defined input parameters and output parameters, and further determining the common parameters of the script object so that other programmers can edit the script object again.
And S13, saving the script object as a script tool module according to the running environment and the public parameters.
Illustratively, when the server analyzes the script language corresponding to the script object, an operation environment can be automatically established in the background, a dependency package required by the operation of the script object is installed in the established operation environment in the background, and the public parameter of the script object in the current operation environment is determined. And executing the running command of the script object according to the public parameters of the script object and the built running environment, and storing the successfully-run script object as a script tool module to be stored in the server, so that the sharing and the universality of the script object are realized, and the problem that the script object can only be debugged and run locally and cannot be reused is avoided.
According to the script editing method provided by the embodiment, the script language environment corresponding to the script object to be edited at present is automatically identified by analyzing the script object, the corresponding running environment is configured for the script object, the running environment does not need to be repeatedly set up locally, and the problem that the script object cannot support multi-language program compiling is solved; and determining the public parameters of the script object according to the parameters of the script object, operating the script object in the configured operating environment according to the public parameters, and storing the script object as a script tool module for the next direct use, so that the defect of difficult reuse of the script object is overcome, repeated editing is avoided, and the development efficiency is improved.
As an alternative implementation, as shown in fig. 2, when the obtaining manner of the script object is uploading, the step S11 includes:
s111, the script object is scanned globally, and the language environment of the script object is identified.
For example, the script object upload is shown in fig. 3, and may upload a script object of a single script file or upload a packaged script object of a plurality of script files. After the script file is uploaded to the server, the script file in the script object is scanned globally, and the script language environment used for writing the script object, the version information of the script language and the like are identified.
And S112, according to the language environment and the script object, searching a directory where the entry file of the starting script object is located, and distributing a corresponding running environment for the script object.
Illustratively, running the script object requires finding an entry file for starting the script object, and identifying a language environment corresponding to the script object according to the uploaded script object. And searching and positioning the directory where the entry file of the starting script object is located according to the script object and the identified language environment corresponding to the script object, and configuring the running environment required by running the script object in the directory where the entry file is located.
As an alternative embodiment, if the entry file for starting the script object includes a plurality of entry files, a unique entry file is determined according to an input instruction of a user.
For example, if a plurality of entry files for starting the script object are found and the formats of the entry files are all available correctly, the entry files with the correct formats may be displayed to the user for the user to select, and different entry files may correspond to different input instructions. After the user selects the entry file, an instruction corresponding to the selected entry file can be input to the server, the server receives the input instruction of the user, and the unique entry file is determined according to the input instruction.
As an alternative implementation, as shown in fig. 4, when the obtaining manner of the script object is uploading, the step S12 includes:
s121, obtaining parameters of the entry file corresponding to the script object, determining parameter values and parameter meanings corresponding to the parameter argn by taking the parameter argn as a parameter placeholder, and generating a parameter list.
Exemplarily, the input parameters corresponding to the script object to be edited currently are determined through the entry file of the script object, and the input parameters of the entry file are edited. When editing the input parameters of the entry file, the method of argn may be used as a placeholder for the input parameters, and the parameter value corresponding to the argn and the parameter meaning corresponding to the argn are edited, as shown in fig. 5, each parameter may be sequentially edited to form a parameter list.
And S122, assembling the parameter list into a public parameter.
Illustratively, the individual parameters in the parameter list are assembled into a common parameter. For example, the parameter list includes the respective parameters "arg 1: hello123 alias: hello "and" arg 2: random alias: and random ", assembling all corresponding parameters in the parameter list to form a common parameter. The number of parameters included in the parameter list is not limited in the present application, and can be determined by those skilled in the art according to actual needs.
As an alternative implementation, as shown in fig. 6, when the obtaining manner of the script object is online editing, the step S11 includes:
s111', identifying the language environment of the script object.
For example, as shown in fig. 7, after the code of the markup script language is filled in, the language environment of the currently edited script object can be automatically identified. For example, when the keyword "public" is input, it can be automatically recognized that the language environment used by the script object currently edited is the Java language.
And S112', determining an editor corresponding to the language environment, and distributing a corresponding running environment for the script object according to the language environment.
Illustratively, according to the identified language environment, the language editor corresponding to the current script object is determined, and a corresponding running environment is allocated to the currently edited script object according to the language environment corresponding to the script object. For example, after the language environment is identified to be the Java language, the editor of the script object is converted into the script editor corresponding to the Java language, and meanwhile, after the initial letter of the code is input, the corresponding keyword information is automatically prompted and supplemented, and if the input grammar has an error, the corresponding dynamic prompt is popped up in real time.
As an alternative implementation, as shown in fig. 8, when the obtaining manner of the script object is online editing, the step S12 may further include:
s121', and acquiring the target editing position of the script object.
Illustratively, the target editing location is an editing location of the current script object. The target editing position can be determined by identifying the cursor, and the system can identify the position of the cursor in real time. For example, after the user moves the cursor to a certain position of the script object, the current position of the cursor is identified, and the position of the cursor is used as the target editing position of the script object.
And S122', receiving an input instruction of a user, and adding a preset script module to the target editing position according to the input instruction.
For example, the preset script module is a script tool module used for editing before, the input instruction may be a drag instruction, and after receiving the drag instruction input by the user, the required preset script module may be input to the target editing position of the script object. As shown in fig. 9, after a drag instruction of the preset module "generate random number with specified number of bits" by the user is recognized, the preset module "generate random number with specified number of bits" may be added to the target editing position. After the dragging instruction is executed, a Least Recently Used (LRU) algorithm can be adopted to carry out corresponding real-time sequencing according to the use frequency of the preset script modules, the preset script modules which are accessed last for the longest time are eliminated, and the preset script modules with high use frequency are displayed in the front.
And S123', assembling the preset script module and the script object to obtain the public parameters.
Illustratively, the script object and the preset script module added in the script object are assembled to obtain the common parameters of the assembled script object, and at this time, the assembled script object may be saved as a script tool module for other people to continue editing or using.
As an alternative implementation, as shown in fig. 10, after step S13, the method for editing a script further includes:
and S14, operating the script object in the operating environment and acquiring the operating log of the script object.
Illustratively, after the script object is edited, a compiler corresponding to the script language can be executed to compile the script object, the assembled common parameters are transmitted to a main method of the successfully compiled script object, the main method is triggered to run in a configured running environment, a running log returned by the running script object can be acquired in real time after the running of the script object is completed, and running information of the script object is displayed through the running log. When an error occurs in operation, the operation log can prompt the line number of the error script and detailed error reporting information.
And S15, judging whether the type of the operation log is a preset type.
Illustratively, the preset type is a content type of the running log corresponding to the scripting language. As shown in fig. 11, if the running script object is edited by Python language, after the running log of the Python script object is obtained, the type of the running content in the running log may be identified, and whether the type of the running content is a json type or not may be determined.
And S16, if the type of the operation log is a preset type, converting the operation log into a visual chart.
For example, after the operation log of the Python script object is obtained, the type of the operation content in the operation log is identified, and when the type of the operation content is json type, the conversion button may be clicked, and the operation log may be converted into a visual chart form, as shown in fig. 12, the converted chart may further meet requirements of table header merging and the like.
Example 2
The present embodiment provides a script editing apparatus, which is applied to script editing and running of a user, and as shown in fig. 13, the script editing apparatus includes:
and the identification module 21 is configured to analyze the script object, identify a script language environment corresponding to the script object, and allocate a corresponding running environment to the script object. For details, refer to the related description of step S11 corresponding to the above method embodiment, and are not repeated herein.
And the determining module 22 is used for determining the public parameters according to the entries of the script objects. For details, refer to the related description of step S12 corresponding to the above method embodiment, and are not repeated herein.
And the generating module 23 is used for saving the script object as a script tool module according to the running environment and the public parameter. For details, refer to the related description of step S13 corresponding to the above method embodiment, and are not repeated herein.
According to the script editing device provided by the embodiment, the script language environment corresponding to the script object to be edited at present is automatically identified by analyzing the script object, a corresponding running environment is configured for the script object, the running environment does not need to be repeatedly built locally, and the problem that the script object cannot support multi-language program compiling is solved; and determining the public parameters of the script object according to the parameters of the script object, operating the script object in the configured operating environment according to the public parameters, and storing the script object as a script tool module for the next direct use, so that the defect of difficult reuse of the script object is overcome, repeated editing is avoided, and the development efficiency is improved.
As an optional implementation manner, when the acquisition manner of the script object is uploading, the identifying module 21 includes:
and the first identification submodule is used for globally scanning the script object and identifying the language environment of the script object. For details, refer to the related description of step S111 corresponding to the above method embodiment, and are not repeated herein.
And the searching submodule is used for searching the directory where the entry file of the starting script object is located according to the language environment and the script object and distributing a corresponding running environment for the script object. For details, refer to the related description of step S112 corresponding to the above method embodiment, and are not repeated herein.
As an alternative embodiment, if the entry file for starting the script object includes a plurality of entry files, a unique entry file is determined according to an input instruction of a user. For details, refer to the related description of the corresponding part of the above method embodiment, and are not repeated herein.
As an optional implementation, the determining module 22 includes:
and the generating submodule is used for acquiring parameters of the entry file corresponding to the script object, determining parameter values and parameter meanings corresponding to the parameter argn by taking the parameter argn as a parameter placeholder, and generating a parameter list. For details, refer to the related description of step S121 corresponding to the above method embodiment, and are not repeated herein.
And the first assembling submodule is used for assembling the parameter list into the public parameters. For details, refer to the related description of step S122 corresponding to the above method embodiment, and are not repeated herein.
As an optional implementation manner, when the obtaining manner of the script object is online editing, the identifying module 21 includes:
and the second identification submodule is used for identifying the language environment of the script object. For details, refer to the related description of step S111' corresponding to the above method embodiment, and are not repeated herein.
And the determining submodule is used for determining the editor corresponding to the language environment and distributing the corresponding running environment for the script object according to the language environment. For details, refer to the related description of step S112' corresponding to the above method embodiment, and are not repeated herein.
As an optional implementation, the determining module 22 includes:
and the obtaining submodule is used for obtaining the target editing position of the script object. For details, refer to the related description of step S121' corresponding to the above method embodiment, and are not repeated herein.
And the receiving submodule is used for receiving an input instruction of a user and adding the preset script module to the target editing position according to the input instruction. For details, refer to the related description of step S122' corresponding to the above method embodiment, and are not repeated herein.
And the second assembling submodule is used for assembling the preset script module and the script object to obtain the public parameters. For details, refer to the related description of step S123' corresponding to the above method embodiment, and are not repeated herein.
As an optional implementation, after the generating module 23, the apparatus further includes:
and the acquisition module is used for operating the script object in the operating environment and acquiring the operating log of the script object. For details, refer to the related description of step S14 corresponding to the above method embodiment, and are not repeated herein.
And the judging module is used for judging whether the type of the running log is a preset type. For details, refer to the related description of step S15 corresponding to the above method embodiment, and are not repeated herein.
And the conversion module is used for converting the operation log into a visual chart if the type of the operation log is a preset type. For details, refer to the related description of step S16 corresponding to the above method embodiment, and are not repeated herein.
Example 3
An embodiment of the present invention further provides a computer device, as shown in fig. 14, the computer device includes a processor 31 and a memory 32, where the processor 31 and the memory 32 may be connected by a bus or in another manner, and fig. 14 takes the connection by the bus as an example.
The processor 31 may be a Central Processing Unit (CPU). The Processor 31 may also be other general-purpose processors, Digital Signal Processors (DSPs), Graphics Processing Units (GPUs), embedded Neural Network Processors (NPUs), or other dedicated deep learning coprocessors, Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs), or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components, or any combination thereof.
The memory 32 is a non-transitory computer readable storage medium, and can be used to store a non-transitory software program, a non-transitory computer executable program, and a module, such as program instructions/modules (such as the identification module 21, the determination module 22, and the generation module 23 shown in fig. 13) corresponding to the editing method of the script in the embodiment of the present invention, and the processor 31 executes various functional applications and data processing of the processor by running the non-transitory software program, instructions, and modules stored in the memory 32, that is, implementing the editing method of the script in the above-described method embodiment.
The memory 32 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created by the processor 31, and the like. Further, the memory 32 may include high speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, the memory 32 may optionally include memory located remotely from the processor 31, and these remote memories may be connected to the processor 31 via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The one or more modules are stored in the memory 32 and, when executed by the processor 31, perform a method of editing a script as in the embodiment shown in fig. 1-12.
The script object is analyzed, the script language environment corresponding to the script object to be edited at present is automatically identified, the corresponding operation environment is configured for the script object, the operation environment does not need to be repeatedly established locally, and the problem that the script object cannot support multi-language program compiling is solved; and determining the public parameters of the script object according to the parameters of the script object, operating the script object in the configured operating environment according to the public parameters, and storing the script object as a script tool module for the next direct use, so that the defect of difficult reuse of the script object is overcome, repeated editing is avoided, and the development efficiency is improved.
The details of the computer device can be understood by referring to the corresponding descriptions and effects in the embodiments shown in fig. 1 to 13, and are not described herein again.
Embodiments of the present invention further provide a non-transitory computer storage medium, where a computer-executable instruction is stored in the computer storage medium, and the computer-executable instruction can execute the method for editing the script in any of the above method embodiments. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a Flash Memory (Flash Memory), a Hard disk (Hard disk Drive, abbreviated as HDD), a Solid State Drive (SSD), or the like; the storage medium may also comprise a combination of memories of the kind described above.
It should be understood that the above examples are only for clarity of illustration and are not intended to limit the embodiments. Other variations and modifications will be apparent to persons skilled in the art in light of the above description. And are neither required nor exhaustive of all embodiments. And obvious variations or modifications therefrom are within the scope of the invention.

Claims (10)

1. A method for editing a script, comprising:
analyzing the script object, identifying a script language environment corresponding to the script object, and distributing a corresponding running environment for the script object;
determining a public parameter according to the entry parameter of the script object;
and saving the script object as a script tool module according to the running environment and the public parameters.
2. The method according to claim 1, wherein when the script object is obtained in an uploading manner, the parsing the script object, identifying a script language environment corresponding to the script object, and assigning a corresponding running environment to the script object includes:
globally scanning the script object and identifying the language environment of the script object;
and searching a directory where an entry file of the script object is started according to the language environment and the script object, and distributing a corresponding running environment for the script object.
3. The method according to claim 2, wherein if the entry file for starting the script object comprises a plurality of entry files, a unique entry file is determined according to an input instruction of a user.
4. The method of claim 2, wherein determining common parameters based on the entries of the script object comprises:
acquiring parameters of an entry file corresponding to the script object, determining parameter values and parameter meanings corresponding to the parameter argn by taking the parameter argn as a parameter placeholder, and generating a parameter list;
assembling the parameter list into a common parameter.
5. The method according to claim 1, wherein when the script object is obtained by online editing, the parsing the script object, identifying a scripting language environment corresponding to the script object, and assigning a corresponding running environment to the script object includes:
identifying a language environment of the script object;
and determining an editor corresponding to the language environment, and distributing a corresponding running environment for the script object according to the language environment.
6. The method of claim 5, wherein determining common parameters based on the references to the script objects comprises:
acquiring a target editing position of the script object;
receiving an input instruction of a user, and adding a preset script module to the target editing position according to the input instruction;
and assembling the preset script module and the script object to obtain the public parameters.
7. The method of claim 1, after saving the script object as a script tool module according to the runtime environment and the common parameters, further comprising:
running the script object in the running environment to obtain a running log of the script object;
judging whether the type of the running log is a preset type or not;
and if the type of the running log is the preset type, converting the running log into a visual chart.
8. An edit execution apparatus of a script, comprising:
the identification module is used for analyzing the script object, identifying the script language environment corresponding to the script object and distributing the corresponding running environment for the script object;
the determining module is used for determining a public parameter according to the entry parameter of the script object;
and the generating module is used for storing the script object as a script tool module according to the running environment and the public parameters.
9. A computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory having stored therein computer instructions, the processor executing the computer instructions to perform the method of editing a script according to any one of claims 1 to 7.
10. A computer-readable storage medium storing computer instructions for causing a computer to execute a method of editing a script according to any one of claims 1 to 7.
CN202010676887.1A 2020-07-14 2020-07-14 Script editing method and device, computer equipment and readable storage medium Active CN111813396B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010676887.1A CN111813396B (en) 2020-07-14 2020-07-14 Script editing method and device, computer equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010676887.1A CN111813396B (en) 2020-07-14 2020-07-14 Script editing method and device, computer equipment and readable storage medium

Publications (2)

Publication Number Publication Date
CN111813396A true CN111813396A (en) 2020-10-23
CN111813396B CN111813396B (en) 2021-04-20

Family

ID=72865035

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010676887.1A Active CN111813396B (en) 2020-07-14 2020-07-14 Script editing method and device, computer equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN111813396B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100218168A1 (en) * 2009-02-23 2010-08-26 Gonzales Ii Jesus Orlando System and Method for Generating a Test Environment Script File
CN106293704A (en) * 2016-07-26 2017-01-04 北京北森云计算股份有限公司 Dynamic micro services edit methods, device and the server of multilingual cloud compiling
CN108037948A (en) * 2017-12-11 2018-05-15 福建中金在线信息科技有限公司 Script management method, apparatus and system
CN108376073A (en) * 2016-11-15 2018-08-07 平安科技(深圳)有限公司 A kind of test software packet generation method and terminal
CN108710489A (en) * 2018-05-23 2018-10-26 中国平安人寿保险股份有限公司 Automate derivative scenario generation method, device, computer equipment
CN109376166A (en) * 2018-08-20 2019-02-22 中国平安财产保险股份有限公司 Script conversion method, device, computer equipment and storage medium
US20190273655A1 (en) * 2018-03-01 2019-09-05 Red Hat, Inc. Configuration of computing devices via containers
CN111240728A (en) * 2020-01-16 2020-06-05 中国建设银行股份有限公司 Application program updating method, device, equipment and storage medium

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100218168A1 (en) * 2009-02-23 2010-08-26 Gonzales Ii Jesus Orlando System and Method for Generating a Test Environment Script File
CN106293704A (en) * 2016-07-26 2017-01-04 北京北森云计算股份有限公司 Dynamic micro services edit methods, device and the server of multilingual cloud compiling
CN108376073A (en) * 2016-11-15 2018-08-07 平安科技(深圳)有限公司 A kind of test software packet generation method and terminal
CN108037948A (en) * 2017-12-11 2018-05-15 福建中金在线信息科技有限公司 Script management method, apparatus and system
US20190273655A1 (en) * 2018-03-01 2019-09-05 Red Hat, Inc. Configuration of computing devices via containers
CN108710489A (en) * 2018-05-23 2018-10-26 中国平安人寿保险股份有限公司 Automate derivative scenario generation method, device, computer equipment
CN109376166A (en) * 2018-08-20 2019-02-22 中国平安财产保险股份有限公司 Script conversion method, device, computer equipment and storage medium
CN111240728A (en) * 2020-01-16 2020-06-05 中国建设银行股份有限公司 Application program updating method, device, equipment and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
任晓明: "电信业务脚本可视化生成系统设计与实现", 《计算机工程与设计》 *
白鸿钧: "LKJ自动化测试脚本定义及生成技术研究", 《铁路通信信号工程技术》 *

Also Published As

Publication number Publication date
CN111813396B (en) 2021-04-20

Similar Documents

Publication Publication Date Title
US10642721B2 (en) Generation of automated testing scripts by converting manual test cases
WO2018082562A1 (en) Method and device for compiling page data and rendering page, and storage medium
CN113778848A (en) Test code generation method, device, computer system and medium
CN111176996A (en) Test case generation method and device, computer equipment and storage medium
CN108804304B (en) Test case generation method and device, storage medium and electronic equipment
CN111158656B (en) Test code generation method and device based on fruit tree method
CN113094252B (en) Test case generation method and device, computer equipment and storage medium
US11422917B2 (en) Deriving software application dependency trees for white-box testing
CN115599359A (en) Code generation method, device, equipment and medium
CN111143228B (en) Test code generation method and device based on decision table method
CN111813396B (en) Script editing method and device, computer equipment and readable storage medium
CN117235527A (en) End-to-end containerized big data model construction method, device, equipment and medium
CN112632425A (en) Method, device, equipment and storage medium for generating offline resource file
CN115470152B (en) Test code generation method, test code generation device, and storage medium
US11681511B2 (en) Systems and methods for building and deploying machine learning applications
CN114791885A (en) Interface test method, device, equipment and medium
CN114661615A (en) FPGA software testing method and device
CN112559345A (en) LoadRunner-based interface testing method, computer equipment and storage medium
JPWO2020157795A1 (en) Test equipment, test methods and test programs
CN117076335B (en) Model test method, system, medium and electronic equipment
CN111722996B (en) Interactive standard compliance testing method and device
CN110837896B (en) Storage and calling method and device of machine learning model
US11914503B2 (en) Automated performance measurement over software lifecycle
WO2022074712A1 (en) Specification information extraction device, specification information extraction method, and program
CN116756016A (en) Multi-browser testing method, device, equipment, medium and program product

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
GR01 Patent grant
GR01 Patent grant