CN110286894B - Script generation method, script generation device, computer equipment and storage medium - Google Patents

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

Info

Publication number
CN110286894B
CN110286894B CN201910383382.3A CN201910383382A CN110286894B CN 110286894 B CN110286894 B CN 110286894B CN 201910383382 A CN201910383382 A CN 201910383382A CN 110286894 B CN110286894 B CN 110286894B
Authority
CN
China
Prior art keywords
interface
module
information
script
selected module
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.)
Active
Application number
CN201910383382.3A
Other languages
Chinese (zh)
Other versions
CN110286894A (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.)
HNAC Technology Co Ltd
Original Assignee
HNAC 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 HNAC Technology Co Ltd filed Critical HNAC Technology Co Ltd
Priority to CN201910383382.3A priority Critical patent/CN110286894B/en
Publication of CN110286894A publication Critical patent/CN110286894A/en
Application granted granted Critical
Publication of CN110286894B publication Critical patent/CN110286894B/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/33Intelligent editors
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/448Execution paradigms, e.g. implementations of programming paradigms
    • G06F9/4482Procedural
    • G06F9/4484Executing subprograms
    • G06F9/4486Formation of subprogram jump address
    • 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

Landscapes

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

Abstract

The application relates to a script generation method, a script generation device, computer equipment and a storage medium, wherein the script generation method comprises the following steps: receiving module selection information, acquiring selected module information of a selected module, and adding the selected module to a current script according to the selected module information; searching interface information of all interfaces associated with the selected module in a preset database based on the selected module information, and displaying the interface information of all associated interfaces; receiving interface selection information, and determining a first interface of a selected module and a second interface selected from all the searched interfaces according to the interface selection information; calling a module to which the second interface belongs from a preset database, adding the module to the first interface, and updating the current script; taking the module to which the second interface belongs as a new selected module, and returning to search all interfaces associated with the selected module; and generating a complete script when receiving the ending instruction. The method can reduce the grammar error rate of the whole generated script.

Description

Script generation method, script generation device, computer equipment and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a script generating method, a script generating device, a computer device, and a storage medium.
Background
Along with the development of the technical field of computers, programming technology appears, and script programming is wider in the application field due to the flexible and convenient characteristics of the script programming; the traditional script program is written as an editing code, and after the editing code is completed, the code engine executes the code and outputs the result.
However, in the traditional script programming method, a code editor needs to be familiar with source code instructions, and the requirements on the editor are high; moreover, this script writing method is prone to grammar problems during editing of the code.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a script generation method, apparatus, computer device, and storage medium.
A script generation method, the method comprising:
receiving module selection information, acquiring selected module information of a selected module according to the module selection information, and adding the selected module to a current script according to the selected module information;
searching interface information of all interfaces associated with the selected module in a preset database based on the selected module information, and displaying the interface information of all interfaces associated with the selected module;
Receiving interface selection information, and determining a first interface of the selected module and a second interface selected from all the searched interfaces according to the interface selection information; calling a module to which the second interface belongs from the preset database, adding the module to the first interface, and updating the current script;
taking the module to which the second interface belongs as a new selected module, and returning to the step of searching all interfaces associated with the selected module in a preset database based on the information of the selected module;
and when receiving an ending instruction, taking the current script as a complete script.
In one embodiment, the selected module information includes: interface keywords, interface types and interface use frequencies of the selected modules;
searching interface information of all interfaces associated with the selected module in a preset database based on the selected module information, wherein the interface information comprises:
searching interface information of all interfaces associated with the selected module in the preset database based on the interface keywords and the interface types;
interface information for all interfaces associated with the selected module is ordered from high to low based on the interface usage frequency.
In one embodiment, the method further comprises the steps of:
and when the parameter selection information of the selected module is received, updating the parameter of the selected module in the current script according to the parameter selection information.
In one embodiment, the method further comprises the steps of:
when the module or the parameter of the current script is updated, executing the updated simulation data of the current script to obtain a simulation running result.
In one embodiment, after the module to which the second interface belongs is called from the preset database and added to the first interface, the method further includes the steps of:
adding the first interface of the selected module to a usage record with the second interface; adding the second interface to a usage record of the first interface of the selected module; updating the interface use frequency of the first interface and the second interface in the preset database.
In one embodiment, the preset database stores module information of all modules and interrelationships among all modules; the establishment of the preset database comprises the following steps:
respectively obtaining module script files corresponding to the modules;
Analyzing each module script file, extracting module information contained in each module script file, and determining the interrelationship between the modules according to each module information;
and establishing a relation tree among all modules according to the interrelationship among the module information, and storing the relation tree and the module information into the preset database.
In one embodiment, the information in the script file corresponding to each module includes:
module type, input parameter information, output parameter information, referenceable interface function implementation script code, referenceable interface function implementation script code, module attribute.
A script generating apparatus, the apparatus comprising:
the module selection information receiving module is used for receiving module selection information, acquiring selected module information of a selected module according to the module selection information, and adding the selected module to a current script according to the selected module information;
the searching module is used for searching interface information of all interfaces associated with the selected module in a preset database based on the selected module information and displaying the interface information of all interfaces associated with the selected module;
The interface selection information receiving module is used for receiving interface selection information, and determining a first interface of the selected module and a second interface selected from all the searched interfaces according to the interface selection information; calling a module to which the second interface belongs from the preset database, adding the module to the first interface, and updating the current script; taking the module to which the second interface belongs as a new selected module, and returning to the step of searching all interfaces associated with the selected module in a preset database based on the information of the selected module;
and the ending instruction receiving module is used for taking the current script as a complete script when receiving the ending instruction.
A computer device comprising a memory storing a computer program and a processor implementing the steps of the method described above when the processor executes the computer program.
A computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps of the above method.
The script generation method, the script generation device, the computer equipment and the storage medium are characterized in that when receiving module selection information made by a user on a script editing interface, a server firstly acquires information of a selected module, then adds the selected module into a current script, searches interface information of an associated interface in a preset database according to the information of the selected module for display, and adds a module to which the selected interface belongs to the interface of the selected module after receiving the interface selection information so as to update the current script; and returning the module selected by the interface selection information as a new selected module to the step of searching the associated interface in the preset database until the ending instruction is received, and taking the current script as a complete script. In the process of writing the script, the user only needs to select the needed module and interface information, namely, the interface information of the interface connectable interface of the module is searched and obtained in the preset database, so that the editing of the script is completed, and the grammar error rate of the whole generated script can be reduced by the method because the interrelationship among the modules is stored in the preset database.
Drawings
FIG. 1 is an application environment diagram of a script generation method in one embodiment;
FIG. 2 is a flow diagram of a script generation method in one embodiment;
FIG. 3 is a flow diagram of the steps for finding module information for all modules associated with a selected module in one embodiment;
FIG. 4 is a flow chart of a script generation method in another embodiment;
FIG. 5 is a flow chart illustrating the establishment of a preset database in one embodiment;
FIG. 6 is a schematic diagram showing the effect of a script generation method in one embodiment;
FIG. 7 is a block diagram showing a structure of a script generating apparatus in one embodiment;
fig. 8 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.
The script generation method provided by the application can be applied to an application environment shown in fig. 1. Wherein the terminal 110 communicates with the server 120 through a network.
In some embodiments, the preset database is set in the server, the terminal sends the received module selection information selected by the user on the script writing interface to the server, and the server can obtain the selected module information of the selected module according to the module selection information and add the selected module to the current script; searching interface information of all interfaces associated with the selected module in a preset database according to the information of the selected module, sending the interface information to a terminal for display, then receiving interface selection information selected by a user in the interface information of all the searched interfaces, calling a module to which the interface belongs in the preset database, adding the module to the selected interface of the selected module, updating a current script, taking the newly added module as a new selected module, and returning to the step of searching the interface information associated with the selected module in the preset database until an end instruction is received, and taking the current script as a complete script.
The terminal 110 may be, but not limited to, various personal computers, notebook computers, smartphones, tablet computers, and portable wearable devices, and the server 120 may be implemented as a stand-alone server or a server cluster composed of a plurality of servers.
In one embodiment, as shown in fig. 2, a script generation method is provided, and an example of application of the method to the server in fig. 1 is described, including steps S210 to S250.
Step S210, receiving module selection information, obtaining selected module information of the selected module according to the module selection information, and adding the selected module to the current script according to the selected module information.
The module selection information is information of a module selected by a user on a script writing interface, when the server receives the module selection information, the server can acquire a module currently selected by the user and an interface which is expected to be used for the module, and in the embodiment, the module currently selected by the user is recorded as a selected module; it will be appreciated that the selected module information obtained by the server may include the module name of the selected module, the interface type of each interface of the selected module, the interface name, the input parameters, the output parameters, and so on.
A module may also be called a functional module, which refers to a collection of program elements, such as data statements, executable statements, etc., that refers to individually named procedures, functions, subroutines, or macro calls that are accessible by name. The function modularization is to divide the program into a plurality of function modules, each function module completes one sub-function, and then the function modules are combined into a whole to meet the required functions of the whole system. The reference relation between the modules is realized through interfaces.
In this embodiment, a user selects a module at a script editing interface, generates module selection information, sends the module selection information to a server, and the server obtains module information of a selected module according to the module selection information, marks the module information as the selected module information, and adds a module (selected module) selected by the user to a current script from a preset database according to the selected module; specifically, the code of the selected module is added to the current script.
Step S220, based on the selected module information, searching the interface information of all interfaces associated with the selected module in a preset database, and displaying the interface information of all interfaces associated with the selected module.
The preset database is a preset database which stores module information of all modules and interrelationships among all modules. The related information of the existing module is stored in a preset database in advance, and when the module is used, the interface selection can be provided for a user according to the related information of the stored module in the preset database. In one embodiment, the module information stored in the preset database may include a module type, an input parameter name, an input parameter attribute, an output parameter name, an output parameter attribute, a referenceable interface name, and the like of each module. The mutual relation between the modules in the preset database is a mutual reference relation between the modules which is established according to the referenceable interface names of the modules and the referenceable interface names.
The searching based on the selected module information may be searching in a preset database by using the module name of the selected module and the interface names of the interfaces as keywords, and the interface information of all the interfaces associated with the selected module may be obtained by searching in the preset database because the correlation between the modules is stored in the preset database.
Further, in one embodiment, the selected module information includes: interface keywords, interface types, and interface usage frequencies of the interfaces of the selected modules. In this embodiment, as shown in fig. 3, module information of all modules associated with the selected module is searched in a preset database based on the selected interface information of the selected module, including steps S310 to S330.
Step S310, searching interface information of all interfaces associated with the selected module in a preset database based on the interface keywords and the interface types.
The interfaces with the referenceable and referenceable relation with the interfaces of the selected module can be obtained by screening in the preset database according to the keywords and the interface types, and the information of the interfaces is stored in the preset database, and the interface information can include the interface types, the interface names, the interface use frequencies and the like, and the server obtains the information from the preset database in step S310. Further, the selected module includes an upper interface and a lower interface, so in this embodiment, the related interfaces may be searched in a preset database for the interface keywords and interface types of the upper interface and the lower interface, respectively, and displayed.
Step S320, the interface information of all the interfaces associated with the selected module is ordered from high to low based on the interface usage frequency.
Still further, in one embodiment, ordering interface information for all interfaces associated with a selected module from high to low based on interface usage frequency of the selected module includes: and according to the number of times of calling relation generated between the interface of the selected module and the interface of the selected module in the use frequency of the interface of the selected module, sequencing at least more.
The interface use frequency may include the number of times a call relationship occurs between the interface of the selected module and each of the referenceable and referenceable interfaces in the use history. It can be understood that, the higher the frequency of use between the interfaces, the more call times are generated between the two interfaces, and the more likely the interface is the interface that the user wants to select, so in this embodiment, the interface information of all the searched interfaces is ordered according to the frequency of use, so that the time for the user to find the result that the user wants to select in the search result can be reduced, and the script writing speed is improved. In other embodiments, the interface information of all the found interfaces may also be ordered in other ways.
In this embodiment, the server searches the interface information of all interfaces associated with the selected module in the preset database according to the selected module information, and displays the search result, that is, the interface information of all interfaces associated with the selected module, on the current interface of the terminal for the user to select.
Step S230, receiving interface selection information, and determining a first interface of a selected module and a second interface selected from all the searched interfaces according to the interface selection information; and calling a module to which the second interface belongs from a preset database, adding the module to the first interface, and updating the current script.
The server displays the interface information of all the searched interfaces associated with the selected modules on the current interface of the terminal, and the user can select the needed interface from the interface information. It will be appreciated that the user may determine the interface to be selected by clicking or touching on the option to select the desired interface information. In one embodiment, the interfaces of the selected module include both the upper and lower interfaces, and thus, the selection made by the user at this step includes selecting one of the interfaces of the selected module, and the interface referenced by or by this interface (selected among all of the interfaces found to be associated); thus, the interface selection information includes two parts, and in this embodiment, an interface where the user selects a selected module is referred to as a first interface, and an interface where reference is required or referred to is selected from the associated interfaces as a second interface.
Further, after selecting the required interface, the user generates interface selection information and sends the interface selection information to the server. And the server invokes the codes of the modules which the second port selected by the user belongs to according to the interface selection information, and adds the first interface of the selected module to update the current script.
In one embodiment, the interface information of all interfaces associated with the selected module searched by the server in the preset database according to the module selection information includes: interface type, interface name, interface input parameter type, interface output parameter name, and interface output parameter type for all interfaces associated with the selected module. It will be appreciated that displaying interface information for all interfaces associated with the selected module includes: the interface type, interface name, interface input parameter type, interface output parameter name, and interface output parameter type of all interfaces associated with the selected module are displayed.
Step S240, the module to which the second interface belongs is taken as a new selected module, and the step of searching all interface information associated with the selected module in a preset database based on the information of the selected module is returned.
In this embodiment, after the server adds the module code to which the second interface belongs to the selected interface of the selected module according to the selection of the user, the module to which the second interface belongs is used as a new selected module, and the new selected module continues to search the interface information of all the interfaces associated with the new selected module in the preset database, so that the next writing of the script is continued.
Step S250, when receiving the ending instruction, taking the current script as a complete script.
When the user finishes writing, the user can generate an ending instruction to the server by clicking the ending of the script writing interface, and the server receives the ending instruction at the moment, takes the current script as a complete script, and finishes writing the script.
According to the script generation method, when receiving the module selection information made by a user on a script editing interface, a server firstly acquires the information of the selected module, then adds the selected module into a current script, searches interface information of all associated interfaces in a preset database according to the information of the selected module, displays the interface information, and adds the module to which the selected interface belongs to the interface of the selected module after receiving the interface selection information so as to update the current script; and returning the module selected by the interface selection information as a new selected module to the step of searching the associated interface in the preset database until the ending instruction is received, and taking the current script as a complete script. In the process of writing the script, the user only needs to select the needed module and interface information, namely, the interface information of the interface connectable interface of the module is searched and obtained in the preset database, so that the editing of the script is completed, and the grammar error rate of the whole generated script can be reduced by the method because the interrelationship among the modules is stored in the preset database.
In one embodiment, as shown in fig. 4, the script generating method further includes step S410: and when the parameter selection information of the selected module is received, updating the parameters of the selected module in the current script according to the parameter selection information.
After the user selects the module, the user can define parameters for the interface of the module, in this embodiment, the user can select the size of the parameters to be set by clicking the parameter setting on the script writing interface, and at this time, the terminal generates parameter selection information and sends the parameter selection information to the server; wherein the parameter selection information includes interface information of the required setting parameters, parameter values of the required setting parameters, and the like. And when the server interfaces the parameter selection information, updating the parameters of the selected modules in the current script according to the parameter selection information. Through the method, a user can get rid of dependence on a keyboard to a certain extent, and can complete script writing by only selecting through a mouse and defining variables.
With continued reference to fig. 4, the script generating method further includes step S420: when the module or parameter of the current script is updated, executing the updated simulation data of the current script to obtain a simulation running result.
The module update of the current script may be: the user edits the newly added or deleted module in the script editing interface, namely when the module in the current script changes, the background performs simulation execution by adopting the updated script, and a simulation operation result is obtained. Similarly, the parameter update of the current script can be that the user changes the parameter of the current script through parameter setting in the script editing interface, and the background performs simulation execution on the updated script simulation data to obtain a simulation operation result.
Further, in one embodiment, the obtained simulation running result can be used for assisting a user in judging whether the script edited currently has errors or not and whether the correct result can be output, compared with the traditional method, the running result can be known only after the script is written, and the running result can be known in the writing process by the method in the embodiment, so that convenience is brought to the user in writing the script.
In one embodiment, the script generating method further includes the steps of, after a module to which the second interface is called from the preset database is added to the first interface:
adding the first interface of the selected module to a usage record with the second interface; adding the second interface to the usage record of the first interface of the selected module; updating the interface use frequency of the first interface and the second interface in a preset database.
In this embodiment, after adding the module code to which the second interface belongs to the first interface of the selected module, the server also needs to update the frequency of use of the first interface and the second interface in the preset database, and specifically may increase the number of times of call generation between the first interface and the second interface by 1 by increasing the number of times of call generation between the second interface and the first interface by 1. It will be appreciated that in other embodiments, the interface usage frequency of the first interface and the second interface may be updated in other manners.
In one embodiment, the module information of all the modules and the interrelationships between all the modules are stored in a preset database; as shown in fig. 5, the establishment of the preset database includes steps S510 to S530.
Step S510, module script files corresponding to the modules are respectively obtained.
The module script files correspond to the modules one by one; in one embodiment, the information in the script file corresponding to each module includes: module type, input parameter information, output parameter information, referenceable interface function implementation script code, referenceable interface function implementation script code, module attribute. Further, module attributes mainly include variables, fields, methods, events, logic, database operations, and the like.
And step S520, analyzing the script files of the modules, extracting the module information contained in the script files of the modules, and determining the interrelationship among the modules according to the module information.
After the server obtains each module script file, each module script file is parsed by the module script file parser, and module information in each module script file is extracted, where in one embodiment, the extracted module information includes: module type, input parameter list (name, attribute), output parameter list (name, attribute), referenceable interface name, and referenceable interface name. Further, after the module information of each module is extracted, the interrelationship between the modules can be determined according to the module information.
Step S530, a relation tree among all modules is established according to the interrelationships among the module information, and the relation tree and the module information are stored in a preset database.
The relation tree of all the modules is established according to the interrelationships among the modules, the relation among all the modules can be clearly displayed, and the relation tree and the extracted module information of each module are stored into a preset database by the server; the information contained in the preset database comprises: the name, attribute, and cumulative frequency of interface calls for the existing module.
The module information of the module to be stored in the preset database may be selected according to practical situations, for example, if the user wishes to apply the method to the power system, the module information of the existing module involved in the power system may be written into the module script file respectively, and stored in the preset database by the server, so as to form the module information preset database of the power system. It will be appreciated that in other embodiments, the above method may also be applied to other fields.
The script written by the script generation method can reduce the grammar error rate, the modules are mutually referenced and matched, the logic error can be reduced, and the final script logic is clear through visual programming and interface docking.
In a specific embodiment, the user writes the script through the script generation method, which comprises the following steps: when a user selects a graphic control corresponding to a certain module file in the interface (namely the module selection information), adding the code of the module into the current script; the server searches the upper and lower interfaces (i.e. the interface information of all the interfaces associated with the selected module) of the module in the preset database respectively through the key words, the interface types and the interface using frequency (i.e. the selected module information acquired according to the module selecting information), forms an upper interface list and a lower interface list, and displays the upper interface list and the lower interface list on the interfaces for the user to select and add; the upper and lower interface list includes: interface name, interface type, interface input/output parameter name and type. The user selects an interface X (i.e. the second interface) provided in a lower interface (i.e. the first interface) list in the upper and lower interface list, and the server calls the code of the module to which the interface X belongs from the preset database to be added to the lower interface, so as to update the current script. And then, taking the module of the interface X as a new selected module, returning to the step of searching the upper and lower interface lists of the selected module in the preset database, and searching and displaying the upper and lower interface lists of the module of the interface X. And when receiving an ending instruction initiated by a user, finishing writing of the script, and generating and outputting the current script as a complete script. In addition, after the code of the module to which the interface X belongs is added to the lower interface, the server also updates the interface usage frequencies of the interface X and the lower interface of the selected module in the preset database, respectively. FIG. 6 is a schematic diagram showing the effect of the script generation method in one embodiment.
Further, in this embodiment, the step of establishing the preset database includes the steps of: newly creating a module script file, wherein the module script file corresponds to the modules one by one, and the module script file needs to be defined: module type, input/output parameter list (name, attribute, variable name), referenceable/referenceable interface, function implementation script code, module attribute, etc. The module attribute mainly comprises variables, fields, methods, events, logic, database operations and the like. After the writing of all the module script files is completed, all the module script files are analyzed through a module script file analyzer, and the following information and interrelationships in the module script files are extracted: the method comprises the steps of module type, input parameter list (name, attribute), output parameter list (name, attribute), refereable/refereable interface name, building a relation tree, generating a class relation library file according to the extracted information, wherein the class relation library file comprises the name, attribute and accumulated frequency of interface call of the existing module, and storing the name, attribute and accumulated frequency of interface call in a preset database.
The script written by the script generation method can reduce the grammar error rate; the modules are mutually cited and matched, so that logic errors can be reduced; and the final script logic is clear through visual programming and interface interfacing.
It should be understood that, although the steps in the flowcharts of fig. 2-5 are shown in order as indicated by the arrows, these steps are not necessarily performed in order as 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 fig. 2-5 may include multiple sub-steps or stages that are not necessarily performed at the same time, but may be performed at different times, nor do the order in which the sub-steps or stages are performed necessarily occur sequentially, but may be performed alternately or alternately with at least a portion of the sub-steps or stages of other steps or steps.
In one embodiment, as shown in fig. 7, there is provided a script generating apparatus, the apparatus comprising: module selection information receiving module 710, search module 720, interface selection information receiving module 730, and end instruction receiving module 740. Wherein:
a module selection information receiving module 710 for receiving module selection information, obtaining selected module information of the selected module according to the module selection information, and adding the selected module to the current script according to the selected module information;
A searching module 720, configured to search the preset database for interface information of all interfaces associated with the selected module based on the selected module information, and display interface information of all interfaces associated with the selected module;
the interface selection information receiving module 730 is configured to receive interface selection information, determine a first interface of the selected module and a second interface selected from all the found interfaces according to the interface selection information; calling a module to which the second interface belongs from a preset database, adding the module to the first interface, and updating the current script; taking the module to which the second interface belongs as a new selected module, and returning to the step of searching all interface information associated with the selected module in a preset database based on the information of the selected module;
the ending instruction receiving module 740 is configured to take the current script as a complete script when receiving the ending instruction.
For specific limitations of the script generating apparatus, reference may be made to the above limitations of the script generating method, and no further description is given here. Each of the modules in the script generating apparatus described above may be implemented in whole or in part by 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 server, and the internal structure of which may be as shown in fig. 8. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. 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, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database of the computer device is used for storing module information and interrelationships between modules. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a script generation method.
It will be appreciated by those skilled in the art that the structure shown in fig. 8 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:
receiving module selection information, acquiring selected module information of a selected module according to the module selection information, and adding the selected module to a current script according to the selected module information;
searching interface information of all interfaces associated with the selected module in a preset database based on the information of the selected module, and displaying the interface information of all interfaces associated with the selected module;
receiving interface selection information, and determining a first interface of a selected module and a second interface selected from all the searched interfaces according to the interface selection information; calling a module to which the second interface belongs from a preset database, adding the module to the first interface, and updating the current script;
taking the module to which the second interface belongs as a new selected module, and returning to the step of searching all interfaces associated with the selected module in a preset database based on the information of the selected module;
and when receiving the ending instruction, taking the current script as a complete script.
In one embodiment, the processor when executing the computer program further performs the steps of: the selected module information includes: interface keywords, interface types, and interface use frequencies of the selected modules;
searching interface information of all interfaces associated with the selected module in a preset database based on the selected module information, wherein the interface information comprises:
searching interface information of all interfaces associated with the selected module in the preset database based on the interface keywords and the interface types;
the interface information for all interfaces associated with the selected module is ordered from high to low based on the interface usage frequency.
In one embodiment, the processor when executing the computer program further performs the steps of: and when the parameter selection information of the selected module is received, updating the parameters of the selected module in the current script according to the parameter selection information.
In one embodiment, the processor when executing the computer program further performs the steps of: when the module or parameter of the current script is updated, executing the updated simulation data of the current script to obtain a simulation running result.
In one embodiment, the processor when executing the computer program further performs the steps of: the first interface of the selected module is added to the usage record of the second interface; adding the second interface to the usage record of the first interface of the selected module; updating the interface use frequency of the first interface and the second interface in a preset database.
In one embodiment, the processor when executing the computer program further performs the steps of: the method comprises the steps of storing module information of all modules and interrelationships among all modules in a preset database;
the establishment of the preset database comprises the following steps:
respectively obtaining module script files corresponding to the modules;
analyzing each module script file, extracting module information contained in each module script file, and determining the interrelationship between each module according to each module information;
and establishing a relation tree among all modules according to the interrelationship among the module information, and storing the relation tree and the module information into the preset database.
In one embodiment, the processor when executing the computer program further performs the steps of: the information in the script file corresponding to each module includes: module type, input parameter information, output parameter information, referenceable interface function implementation script code, referenceable interface function implementation script code, module attribute.
In one embodiment, a computer readable storage medium is provided having a computer program stored thereon, which when executed by a processor, performs the steps of:
Receiving module selection information, acquiring selected module information of a selected module according to the module selection information, and adding the selected module to a current script according to the selected module information;
searching interface information of all interfaces associated with the selected module in a preset database based on the information of the selected module, and displaying the interface information of all interfaces associated with the selected module;
receiving interface selection information, and determining a first interface of a selected module and a second interface selected from all the searched interfaces according to the interface selection information; calling a module to which the second interface belongs from a preset database, adding the module to the first interface, and updating the current script;
taking the module to which the second interface belongs as a new selected module, and returning to the step of searching all interfaces associated with the selected module in a preset database based on the information of the selected module;
and when receiving the ending instruction, taking the current script as a complete script.
In one embodiment, the computer program when executed by the processor further performs the steps of: the selected module information includes: interface keywords, interface types, and interface use frequencies of the selected modules;
Searching interface information of all interfaces associated with the selected module in a preset database based on the selected module information, wherein the interface information comprises:
searching interface information of all interfaces associated with the selected module in the preset database based on the interface keywords and the interface types;
the interface information for all interfaces associated with the selected module is ordered from high to low based on the interface usage frequency.
In one embodiment, the computer program when executed by the processor further performs the steps of: and when the parameter selection information of the selected module is received, updating the parameters of the selected module in the current script according to the parameter selection information.
In one embodiment, the computer program when executed by the processor further performs the steps of: when the module or parameter of the current script is updated, executing the updated simulation data of the current script to obtain a simulation running result.
In one embodiment, the computer program when executed by the processor further performs the steps of: the first interface of the selected module is added to the usage record of the second interface; adding the second interface to the usage record of the first interface of the selected module; updating the interface use frequency of the first interface and the second interface in a preset database.
In one embodiment, the computer program when executed by the processor further performs the steps of: the method comprises the steps of storing module information of all modules and interrelationships among all modules in a preset database;
the establishment of the preset database comprises the following steps:
respectively obtaining module script files corresponding to the modules;
analyzing each module script file, extracting module information contained in each module script file, and determining the interrelationship between each module according to each module information;
and establishing a relation tree among all modules according to the interrelationship among the module information, and storing the relation tree and the module information into the preset database.
In one embodiment, the computer program when executed by the processor further performs the steps of: the information in the script file corresponding to each module includes: module type, input parameter information, output parameter information, referenceable interface function implementation script code, referenceable interface function implementation script code, module attribute.
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, storage, database, or other medium used in the various embodiments provided herein may include non-volatile and/or volatile memory. The nonvolatile memory can include Read Only Memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous Link DRAM (SLDRAM), memory bus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), among others.
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 merely 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 invention. 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 is to be determined by the claims appended hereto.

Claims (10)

1. A script generation method, the method comprising:
receiving module selection information, acquiring selected module information of a selected module according to the module selection information, and adding codes of the selected module to a current script according to the selected module information;
searching interface information of all interfaces associated with the selected module in a preset database based on the selected module information, and displaying the interface information of all interfaces associated with the selected module;
Receiving interface selection information, and determining a first interface of the selected module and a second interface selected from all the searched interfaces according to the interface selection information; the code of the module which the second interface belongs to is called from the preset database and added to the first interface, the current script is updated, the first interface is the interface of the selected module which is selected by the user at this time, and the second interface is the interface cited by or cited by the interface of the selected module which is selected by the user at this time;
taking the module to which the second interface belongs as a new selected module, and returning to the step of searching all interfaces associated with the selected module in a preset database based on the information of the selected module;
when receiving an ending instruction, taking the current script as a complete script;
the selected module information includes: interface keywords, interface types and interface use frequencies of the selected modules;
searching interface information of all interfaces associated with the selected module in a preset database based on the selected module information, wherein the interface information comprises: searching interface information of all interfaces associated with the selected module in the preset database based on the interface keywords and the interface types; interface information for all interfaces associated with the selected module is ordered from high to low based on the interface usage frequency.
2. The method of claim 1, further comprising the step of:
and when the parameter selection information of the selected module is received, updating the parameter of the selected module in the current script according to the parameter selection information.
3. The method of claim 2, further comprising the step of:
when the module or the parameter of the current script is updated, executing the updated simulation data of the current script to obtain a simulation running result.
4. A method according to any one of claims 1 to 3, further comprising the step, after adding to the first interface, a module from the preset database to which the second interface is invoked, of:
adding the first interface of the selected module to a usage record with the second interface; adding the second interface to a usage record of the first interface of the selected module; updating the interface use frequency of the first interface and the second interface in the preset database.
5. A method according to any one of claims 1 to 3, wherein the preset database stores module information of all modules, and interrelationships between all modules;
The establishment of the preset database comprises the following steps:
respectively obtaining module script files corresponding to the modules;
analyzing each module script file, extracting module information contained in each module script file, and determining the interrelationship among the modules according to each module information;
and establishing a relation tree among all modules according to the interrelationship among the module information, and storing the relation tree and the module information into the preset database.
6. The method of claim 5, wherein the information in the script file corresponding to each module comprises:
module type, input parameter information, output parameter information, referenceable interface function implementation script code, referenceable interface function implementation script code, module attribute.
7. A script generating apparatus, the apparatus comprising:
the module selection information receiving module is used for receiving module selection information, acquiring selected module information of a selected module according to the module selection information, and adding codes of the selected module to a current script according to the selected module information;
The searching module is used for searching interface information of all interfaces associated with the selected module in a preset database based on the selected module information and displaying the interface information of all interfaces associated with the selected module;
the interface selection information receiving module is used for receiving interface selection information, and determining a first interface of the selected module and a second interface selected from all the searched interfaces according to the interface selection information; code of a module which is called from the preset database and to which the second interface belongs is added to the first interface, and the current script is updated; taking the module to which the second interface belongs as a new selected module, and returning to the step of searching all interfaces associated with the selected module in a preset database based on the information of the selected module, wherein the first interface is the interface of the selected module selected by the user at the time, and the second interface is the interface cited by or cited by the interface of the selected module selected by the user at the time;
the ending instruction receiving module is used for taking the current script as a complete script when receiving the ending instruction;
the selected module information includes: interface keywords, interface types and interface use frequencies of the selected modules;
The searching module is further used for searching interface information of all interfaces associated with the selected module in the preset database based on the interface keywords and the interface types; interface information for all interfaces associated with the selected module is ordered from high to low based on the interface usage frequency.
8. The apparatus of claim 7, wherein the apparatus is further configured to add a first interface of the selected module to a usage record with the second interface; adding the second interface to a usage record of the first interface of the selected module; updating the interface use frequency of the first interface and the second interface in the preset database.
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 6 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 6.
CN201910383382.3A 2019-05-09 2019-05-09 Script generation method, script generation device, computer equipment and storage medium Active CN110286894B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910383382.3A CN110286894B (en) 2019-05-09 2019-05-09 Script generation method, script generation device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910383382.3A CN110286894B (en) 2019-05-09 2019-05-09 Script generation method, script generation device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN110286894A CN110286894A (en) 2019-09-27
CN110286894B true CN110286894B (en) 2023-07-04

Family

ID=68001709

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910383382.3A Active CN110286894B (en) 2019-05-09 2019-05-09 Script generation method, script generation device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110286894B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112860774A (en) * 2021-01-06 2021-05-28 宝能(西安)汽车研究院有限公司 Signal interface matching method and device, computer equipment and readable storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105739983A (en) * 2016-01-29 2016-07-06 腾讯科技(深圳)有限公司 Script program edition device and realization method thereof
CN109683982A (en) * 2018-12-06 2019-04-26 深圳市广和通无线股份有限公司 MES system control method, device, computer equipment and storage medium

Family Cites Families (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5350428B2 (en) * 2011-04-12 2013-11-27 株式会社日立製作所 Automatic program generation apparatus, method and computer program
US9448915B2 (en) * 2011-04-13 2016-09-20 Accenture Global Services Limited Modular script designer for next generation testing system
US8881101B2 (en) * 2011-05-24 2014-11-04 Microsoft Corporation Binding between a layout engine and a scripting engine
WO2012106901A1 (en) * 2011-07-18 2012-08-16 华为技术有限公司 Web-based script language editing method, system and web client
CN103365643B (en) * 2012-03-30 2017-07-21 Ge医疗系统环球技术有限公司 A kind of method and device for the test script for automatically generating graphic user interface
CN103810172B (en) * 2012-11-06 2017-07-04 金蝶软件(中国)有限公司 The method and apparatus of formation component dependence graph
US9195456B2 (en) * 2013-04-30 2015-11-24 Hewlett-Packard Development Company, L.P. Managing a catalog of scripts
US20150007129A1 (en) * 2013-06-28 2015-01-01 John Alex William Script execution framework
CN105677306A (en) * 2014-11-18 2016-06-15 中兴通讯股份有限公司 Automation script compiling method and device
CN105607902A (en) * 2015-12-16 2016-05-25 苏州同元软控信息技术有限公司 Component model based system visualization design and code generation system and method
US10795646B2 (en) * 2017-07-07 2020-10-06 Vmware, Inc. Methods and systems that generate proxy objects that provide an interface to third-party executables
CN107632823A (en) * 2017-08-18 2018-01-26 深圳怡化电脑股份有限公司 A kind of software development methodology and device
CN108021363B (en) * 2017-12-06 2021-06-15 广州多益网络股份有限公司 Visual game logic editing method and system

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105739983A (en) * 2016-01-29 2016-07-06 腾讯科技(深圳)有限公司 Script program edition device and realization method thereof
CN109683982A (en) * 2018-12-06 2019-04-26 深圳市广和通无线股份有限公司 MES system control method, device, computer equipment and storage medium

Also Published As

Publication number Publication date
CN110286894A (en) 2019-09-27

Similar Documents

Publication Publication Date Title
CN109901834B (en) Document page generation method, device, computer equipment and storage medium
CN107239392B (en) Test method, test device, test terminal and storage medium
CN109814854B (en) Project framework generation method, device, computer equipment and storage medium
CN112650766B (en) Database data operation method, system and server
US20110107298A1 (en) Integration of structured profiling data with source data in the eclipse development environment
CN110580189A (en) method and device for generating front-end page, computer equipment and storage medium
US20120215804A1 (en) Data-programming environment
CN108415998B (en) Application dependency relationship updating method, terminal, device and storage medium
CN110597552B (en) Configuration method, device, equipment and storage medium of project continuous integrated pipeline
CN111324716A (en) Index data acquisition method and device, computer equipment and storage medium
CN112433712A (en) Report display method and device, computer equipment and storage medium
CN114201615B (en) Scientific research data change review method and server based on data snapshot
CN111949262A (en) Front-end project construction method and device, computer equipment and storage medium
CN110286894B (en) Script generation method, script generation device, computer equipment and storage medium
CN111008022A (en) Relationship graph generation method and device, computer equipment and storage medium
CN113032078A (en) Page display method and device, electronic equipment and computer readable storage medium
CN116048480B (en) Method and device for automatically generating chart based on code tool
CN110263932B (en) Multi-agent simulation system graphical combination construction method and device
CN116048609A (en) Configuration file updating method, device, computer equipment and storage medium
CN115757411A (en) Stock market information data management method, system, equipment and storage medium
CN109871214B (en) Program code generation method, program code generation device, computer device, and storage medium
CN111124386B (en) Animation event processing method, device, equipment and storage medium based on Unity
CN112015378A (en) Skeleton screen page generation method and device, computer equipment and storage medium
CN112579275A (en) Task execution method, device, equipment and storage medium
CN111291159A (en) Patent retrieval method, device, system, 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
GR01 Patent grant
GR01 Patent grant