CN114756217B - Plug-in based script generation system - Google Patents

Plug-in based script generation system Download PDF

Info

Publication number
CN114756217B
CN114756217B CN202210283024.7A CN202210283024A CN114756217B CN 114756217 B CN114756217 B CN 114756217B CN 202210283024 A CN202210283024 A CN 202210283024A CN 114756217 B CN114756217 B CN 114756217B
Authority
CN
China
Prior art keywords
information
script
plug
target
configuration
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
CN202210283024.7A
Other languages
Chinese (zh)
Other versions
CN114756217A (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 Yunshu Innovation Software Technology Co ltd
Shanghai Hejian Industrial Software Group Co Ltd
Original Assignee
Beijing Yunshu Innovation Software Technology Co ltd
Shanghai Hejian Industrial Software Group 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 Yunshu Innovation Software Technology Co ltd, Shanghai Hejian Industrial Software Group Co Ltd filed Critical Beijing Yunshu Innovation Software Technology Co ltd
Priority to CN202210283024.7A priority Critical patent/CN114756217B/en
Publication of CN114756217A publication Critical patent/CN114756217A/en
Application granted granted Critical
Publication of CN114756217B publication Critical patent/CN114756217B/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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Landscapes

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

Abstract

The invention relates to a script generation system based on plug-ins, which comprises an information configuration module, a parser and a script generation module, wherein the information configuration module is used for generating at least one target configuration information according to a preset information configuration template and sending the target configuration information to the parser; the analyzer is used for analyzing the target configuration information and sending the step type information, the plug-in id and the flow information corresponding to each step type to the script generator; the plug-in library comprises at least one plug-in, and each plug-in corresponds to one step type; and the script generator is used for calling the corresponding plug-in unit based on the corresponding plug-in unit id in the target configuration information, generating a step script corresponding to each step based on the corresponding plug-in unit and the step parameter information, and combining the corresponding step scripts based on the flow information to generate the target script. The invention improves the generation efficiency of the script and is convenient for batch modification.

Description

Plug-in based script generation system
Technical Field
The invention relates to the technical field of computers, in particular to a script generation system based on a plug-in.
Background
In many application scenarios, a large amount of scripts needs to be generated, for example, in the process of developing an IC (Integrated Circuit), a plurality of test cases (test cases) are needed to verify the code of the emulation software, and the number of test cases may reach the ten thousand or even the hundred thousand level. The massive script generation requirements make a large number of homologous or similar automated scripts difficult to compile, centrally update, and manage in a standardized manner. And under the condition that the running environment is specific, one script is difficult to be simply converted into another script form after being written. In the prior art, the test cases are directly executed by adopting the script files, so that the efficiency is extremely low in the scene that massive test cases need to be generated and executed. In addition, the common template system is difficult to expand and cannot be expanded continuously according to the requirements of users. When ten-thousand or even hundred-thousand test case scripts need to be generated, the generation efficiency is extremely low, and if batch modification is needed, the test case scripts need to be modified one by one, so that the efficiency is extremely low, and errors are easy to occur.
Disclosure of Invention
The invention aims to provide a plug-in-based script generation system, which improves the generation efficiency of scripts and is convenient for batch modification.
The invention provides a script generation system based on plug-ins, which comprises an information configuration module, a parser, a plug-in library and a script generator, wherein,
the information configuration module is used for generating at least one piece of target configuration information according to a preset information configuration template and sending the target configuration information to the resolver, wherein the information configuration template comprises corresponding at least one step type information, corresponding plug-in id and step parameter information of each step type and at least one piece of flow information generated based on the step type information;
the analyzer is used for analyzing the target configuration information and sending step type information, plug-in id and flow information corresponding to each step type to the script generator;
the plug-in library comprises at least one plug-in, and each plug-in corresponds to one step type;
the script generator is used for calling corresponding plug-ins from the plug-in library based on corresponding plug-in ids in the target configuration information, generating step scripts corresponding to each step based on the corresponding plug-ins and step parameter information, and combining the corresponding step scripts based on flow information to generate target scripts.
Compared with the prior art, the invention has obvious advantages and beneficial effects. By means of the technical scheme, the plug-in-based script generation system provided by the invention can achieve considerable technical progress and practicability, has wide industrial utilization value and at least has the following advantages:
the invention generates the target configuration information by setting the uniform information configuration template, automatically generates the script information by setting the plug-in library and combining the target configuration information, is convenient for centralized updating and management, improves the generation efficiency of the script and has universality. In addition, step type information, flow information and plug-ins in the plug-in library in the information configuration template can be expanded according to application requirements, and batch modification is facilitated.
The foregoing description is only an overview of the technical solutions of the present invention, and in order to make the technical means of the present invention more clearly understood, the present invention may be implemented in accordance with the content of the description, and in order to make the above and other objects, features, and advantages of the present invention more clearly understood, the following preferred embodiments are described in detail with reference to the accompanying drawings.
Drawings
FIG. 1 is a schematic diagram of a plug-in based script generation system according to an embodiment of the present invention;
fig. 2 is a schematic diagram of a plug-in unit according to an embodiment of the present invention.
Detailed Description
To further illustrate the technical means and effects of the present invention adopted to achieve the predetermined objects, the following detailed description will be given to the specific implementation and effects of the plug-in based script generating system according to the present invention with reference to the accompanying drawings and preferred embodiments.
An embodiment of the present invention provides a plug-in based script generation system, as shown in fig. 1, which includes an information configuration module, a parser, a plug-in (plug) library, and a script generator, where,
the information configuration module is used for generating at least one piece of target configuration information according to a preset information configuration template and sending the target configuration information to the resolver, wherein the information configuration template comprises at least one corresponding step type information, plug-in id and step parameter information corresponding to each step type, and at least one piece of flow information generated based on the step type information. It should be noted that, by setting the information configuration template, an automatic script can be generated, the templates can be mutually referenced, scripts with similar functions can share most functions, and the script writing mode can be normalized while the same type of script writing work is reduced.
The analyzer is used for analyzing the target configuration information and sending step type information, plug-in id and flow information corresponding to each step type to the script generator.
The script generator is used for calling corresponding plug-ins from the plug-in library based on corresponding plug-in ids in the target configuration information, generating step scripts corresponding to each step based on the corresponding plug-ins and step parameter information, and combining the corresponding step scripts based on flow information to generate target scripts.
The system of the embodiment of the invention generates the target configuration information by setting the uniform information configuration template, automatically generates the script information by setting the plug-in library and combining the target configuration information, is convenient for centralized updating and management, improves the generation efficiency of the script and has universality. In addition, step type information, flow information and plug-ins in the plug-in library in the information configuration template can be expanded according to application requirements, and batch modification is facilitated.
As an embodiment, the information configuration module may configure one corresponding target configuration information for each target script separately, but it is understood that the same step type information, the plug-in id corresponding to the step type, and the flow information generated based on the step type information may be multiplexed.
As another embodiment, the information configuration module may further generate target configuration information for a plurality of target scripts in batches, and the step type information, the plug-in id corresponding to the step type, and the flow information generated based on the step type information may be multiplexed in an inherited form. Specifically, the information configuration module is further configured to divide the multiple pieces of target configuration information into M information groups, set, for each information group, a step type information set and a flow information set corresponding to all target configurations in the information group, and step parameter information corresponding to each piece of target configuration information, where each piece of target information inherits the step type information set and the flow information set in the corresponding group. And step type information, the plug-in unit id corresponding to the step type and flow information are multiplexed in an inherited form, so that batch modification and management are facilitated, and the generation efficiency of the batch target script is improved.
As an embodiment, the information group is further provided with information group configuration description information, each target configuration information further includes corresponding configuration description information, and the configuration description information is set in the target configuration information or inherits the information group configuration description information corresponding to the information group. The configuration description information is metadata, and is set as text information, which specifically includes tag information, owner information, and script function information. It should be noted that the information group configuration description information corresponding to the information group is default configuration description information that can be inherited by the target configuration information in the group, when the target configuration information in the group is configured with the corresponding configuration description information, the configured configuration description information is taken as the standard, and if the target configuration information in the group is not configured, the information group configuration description information is directly inherited. Based on the configuration description information, the script classification and management are facilitated, the workload of the script classification and management is greatly reduced, and batch selection can be realized.
As an embodiment, the system further includes a selecting module, where the selecting module is configured to traverse all target configuration information based on preset configuration description information, select target configuration information corresponding to all preset configuration description information from the target configuration information, and generate a target script in batch through the script generator for execution. It should be noted that the selecting module may perform batch selection on the target configuration information in a plurality of different information groups, which is convenient for batch operation.
As an embodiment, the plug-in library includes at least one plug-in, each plug-in corresponds to a step type, it should be noted that the generated plug-ins may be directly called, or the plug-ins may be modified, and the target script may be modified in batch by modifying the plug-ins. The universal plug-in can be directly configured, and in addition, a user can conveniently and flexibly realize various plug-ins to expand the whole system. For a batch of ten thousand or even hundred thousand target scripts, the required step types are only dozens or even less, so that the ten thousand or even hundred thousand target scripts can be quickly and accurately generated based on the plug-in library and the target configuration information by configuring the plug-in library, and the script generation efficiency is greatly improved.
As an embodiment, the plug-in is generated based on a preset plug-in structure, as shown in fig. 2, the preset plug-in structure includes a script template data segment (template), a step parameter data segment (step option definition), and a rendering function data segment (render function), and the script template data segment is used to set at least one script generation template; the step parameter data segment is used for acquiring step parameter information of a corresponding step type in the target configuration information; the rendering function data segment is used for setting a rendering function. The plug-in supports a plurality of script templates, and the script generation templates comprise a shell script generation template, a makefile script generation template, a tcl script generation template and the like.
In one embodiment, when the plug-in is called by the script generator, the plug-in is used for acquiring a target script type, the target script type can be directly input by a user, and if the user does not specify, a preset default script template is directly adopted. And the called plug-in acquires the step parameter information of the corresponding step type from the target configuration information, stores the step parameter information of the corresponding step type into the step parameter data section, calls the rendering function, correspondingly sets the step parameter information of the corresponding step type into the script template data section corresponding to the target script type, and generates a corresponding step script. It should be noted that the rendering function data segment may correspond to different types of renderings, and the corresponding auxiliary function is selected to perform the rendering operation based on the target script type. In addition, the type of the target script is not limited to one, and two or more types of target scripts can be set, and multiple types of scripts can be generated at the same time and called according to the subsequent specific application requirements.
As an embodiment, as shown in fig. 2, the preset plug-in structure may further include comment information (comments), where the comment information includes a plug-in id, step type information, and script template information; the script generator is also used for generating annotation display information based on the annotation information for displaying, so that the user can conveniently check the annotation display information.
As an embodiment, when the information configuration module configures step parameter information, the step parameter information includes mandatory parameter information and optional parameter information, an initial state of the mandatory information is null, and an initial state of the optional information is a default value, and the information configuration module is configured to generate the mandatory parameter information based on the mandatory parameter input by a user; and if the information configuration module receives the optional parameter value input by the user, replacing the optional parameter information corresponding to the optional value input by the user, otherwise, reserving the corresponding default value for the optional parameter information.
The flow information is generated based on corresponding step type information in order of execution, for example, a step set "steps" is { step1, step2, ·.. Times., stepM }, a flow information set "flows" = { flow1, flow2,... Times., flowN }, flow1= (step 1, step2, step 4), flow2= (step 2, step5, step 4), and the like. In addition, the flow information may also set a default flow = (step 1, step2,..., stepM), and if the flow information is not configured, the default flow is directly selected as the flow information.
As an embodiment, the system further includes a first detection module, configured to verify correctness of the target configuration information, and specifically, the first detection module is connected to the information configuration module, and configured to detect whether the target configuration information generated by the information configuration module conforms to a preset configuration file syntax, if so, continue to detect whether the target configuration information conforms to an information configuration template, if so, send the target configuration information to the parser, and if the target configuration information does not conform to the preset configuration file syntax, or the target configuration information does not conform to the information configuration template, generate first warning information. The first detection module can timely detect errors occurring in the target script generation process, early warning is carried out, and generation of error scripts is timely avoided.
As an embodiment, the system further includes a plug-in loader, where the plug-in loader is connected to the plug-in library and the script generator, respectively, and the plug-in loader loads a corresponding plug-in from the plug-in library based on a corresponding plug-in id in the target configuration information, and sends the corresponding plug-in to the script generator.
As an embodiment, the system further includes a second detection module, connected to the plug-in loader, and configured to detect whether the loaded plug-in conforms to a preset plug-in structure before the plug-in loaded by the plug-in loader is sent to the script generator, and if so, send the plug-in loaded by the plug-in loader to the script generator, otherwise, generate second warning information. Errors in the target script generating process can be detected in time through the second detecting module, early warning is carried out, and generation of error scripts is avoided in time.
As an embodiment, the system further includes a post-processor, connected to the script generator, and configured to verify whether a script syntax of a target script generated by the script generator is correct, set the target script as an executable right if the script syntax is correct, and generate third warning information if the script syntax is not correct.
It should be noted that only one or more of the first detection module, the second detection module, and the detection function in the post-processor may be set according to specific application requirements, and if all the detection functions are set, errors occurring in each process can be detected quickly in time, so that the accuracy of generating the target script is improved.
In the prior art, a script generation manner is directly generated, and in the present application, based on a plug-in and target configuration information, a target script generated by the script generator belongs to an intermediate file, and can be debugged on the basis of the intermediate file, so as to illustrate an example shown in fig. 1, the system may further include a debugging module for obtaining the target script from the script generator to debug. This is not possible with existing script generation techniques.
In addition, parameter adjustment can be performed on the basis of the intermediate file, the adjusted intermediate file can be directly used, if the intermediate file meets the requirement, the information configuration module can be directly returned based on the parameter adjustment, batch adjustment is performed, and the script generation efficiency is greatly improved. Specifically, as shown in fig. 1, the system further includes a parameter adjusting module, respectively connected to the script generator and the information configuring module, and configured to obtain the target script, modify step parameter information therein, generate the target adjusting script, detect whether the target adjusting script conforms to a preset adjusting target, if so, generate step parameter adjusting information, send the step parameter adjusting information to the information configuring module, and configure the target configuring information in batch based on the step parameter adjusting information.
As an embodiment, the system of the present invention may be applied to application scenarios such as batch generation of test cases (test cases), and by taking the code of the batch generation of test case verification IC design software as an example, the system generates a script of each test case, and drives the running of each test case based on the script, thereby implementing the verification of the code. In the invention, the system is used for generating the target script corresponding to the test case, and the test case is driven based on the target script instead of directly executing the test case by using the script file, so that the test efficiency is improved.
Although the present invention has been described with reference to a preferred embodiment, it should be understood that various changes, substitutions and alterations can be made herein without departing from the spirit and scope of the invention as defined by the appended claims.

Claims (9)

1. A plug-in based script generation system,
comprises an information configuration module, a resolver, a plug-in library and a script generator, wherein,
the information configuration module is used for generating at least one piece of target configuration information according to a preset information configuration template and sending the target configuration information to the resolver, wherein the information configuration template comprises corresponding at least one step type information, corresponding plug-in id and step parameter information of each step type and at least one piece of flow information generated based on the step type information;
the analyzer is used for analyzing the target configuration information and sending step type information, plug-in id and flow information corresponding to each step type to the script generator;
the plug-in library comprises at least one plug-in, and each plug-in corresponds to a step type;
the script generator is used for calling corresponding plug-ins from the plug-in library based on corresponding plug-in id in the target configuration information, generating step scripts corresponding to each step based on the corresponding plug-ins and step parameter information, and combining the corresponding step scripts based on flow information to generate target scripts;
the plug-in is generated based on a preset plug-in structure, the preset plug-in structure comprises a script template data segment, a step parameter data segment and a rendering function data segment, and the script template data segment is used for setting at least one script generation template; the step parameter data segment is used for acquiring step parameter information of a corresponding step type in the target configuration information; the rendering function data segment is used for setting a rendering function.
2. The system of claim 1,
the script generation template comprises a shell script generation template, a makefi le script generation template and a tcl script generation template.
3. The system of claim 1,
and when the plug-in is called by the script generator, the plug-in is used for acquiring a target script type, acquiring step parameter information of a corresponding step type from the target configuration information, storing the step parameter information of the corresponding step type into the step parameter data section, calling the rendering function, correspondingly setting the step parameter information of the corresponding step type into the script template data section corresponding to the target script type, and generating a corresponding step script.
4. The system of claim 1,
the system also comprises a first detection module which is connected with the information configuration module and used for detecting whether the target configuration information generated by the information configuration module conforms to the preset configuration file grammar, if so, continuously detecting whether the target configuration information conforms to the information configuration template, if so, sending the target configuration information to the analyzer, and if not, generating first early warning information.
5. The system of claim 1,
the system also comprises a second detection module which is connected with the plug-in loader and used for detecting whether the loaded plug-in accords with a preset plug-in structure or not before the plug-in loaded by the plug-in loader is sent to the script generator, if so, the plug-in loaded by the plug-in loader is sent to the script generator, otherwise, second early warning information is generated.
6. The system of claim 1,
the system also comprises a post processor which is connected with the script generator and used for verifying whether the script grammar of the target script generated by the script generator is correct, if so, the target script is set as an executable authority, otherwise, third early warning information is generated.
7. The system of claim 1,
the system also comprises a debugging module which is used for obtaining the target script from the script generator to debug.
8. The system of claim 1,
the system also comprises a parameter adjusting module which is respectively connected with the script generator and the information configuration module and used for acquiring the target script, modifying step parameter information in the target script, generating the target adjusting script, detecting whether the target adjusting script accords with a preset adjusting target or not, if so, generating step parameter adjusting information, sending the step parameter adjusting information to the information configuration module, and configuring the target configuration information in batches based on the step parameter adjusting information.
9. The system of claim 1,
the system is used for generating a target script corresponding to the test case and driving the test case based on the target script.
CN202210283024.7A 2022-03-22 2022-03-22 Plug-in based script generation system Active CN114756217B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210283024.7A CN114756217B (en) 2022-03-22 2022-03-22 Plug-in based script generation system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210283024.7A CN114756217B (en) 2022-03-22 2022-03-22 Plug-in based script generation system

Publications (2)

Publication Number Publication Date
CN114756217A CN114756217A (en) 2022-07-15
CN114756217B true CN114756217B (en) 2022-10-25

Family

ID=82327091

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210283024.7A Active CN114756217B (en) 2022-03-22 2022-03-22 Plug-in based script generation system

Country Status (1)

Country Link
CN (1) CN114756217B (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113254040A (en) * 2021-06-01 2021-08-13 康键信息技术(深圳)有限公司 Front-end framework updating method, device, equipment and storage medium

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9612817B2 (en) * 2013-10-30 2017-04-04 Oracle International Corporation System and method for providing a physical plugin for use in a cloud platform environment
CN104731566B (en) * 2013-12-19 2018-12-25 华为软件技术有限公司 Integrated Development Environment test device, method and system
US20180210819A1 (en) * 2017-01-25 2018-07-26 Macy's West Stores, Inc. System and method of controlling a web browser plug-in for testing analytics
CN111177623A (en) * 2019-12-23 2020-05-19 北京健康之家科技有限公司 Information processing method and device
CN112364049B (en) * 2020-11-10 2024-05-17 中国平安人寿保险股份有限公司 Data synchronization script generation method, system, terminal and storage medium
CN113706110B (en) * 2021-08-30 2022-07-15 航天中认软件测评科技(北京)有限责任公司 FPGA test tool integrated test management platform
CN114168122A (en) * 2021-12-31 2022-03-11 中国邮政储蓄银行股份有限公司 Data script generation method and device

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113254040A (en) * 2021-06-01 2021-08-13 康键信息技术(深圳)有限公司 Front-end framework updating method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN114756217A (en) 2022-07-15

Similar Documents

Publication Publication Date Title
CN111399853A (en) Templated deployment method of machine learning model and custom operator
CN109634600B (en) Code generation method based on security extension SysML and AADL models
CN111158741B (en) Method and device for monitoring dependency relationship change of service module on third party class library
US20210103514A1 (en) Reusable test cases for identifiable patterns
CN111382070A (en) Compatibility testing method and device, storage medium and computer equipment
CN104657274A (en) Method and device for testing software interface
CN115904989A (en) Interface testing method, device, equipment and readable storage medium
CN107622017B (en) Analysis method for universal automation software test
CN113094252B (en) Test case generation method and device, computer equipment and storage medium
CN112948233A (en) Interface testing method, device, terminal equipment and medium
CN114996127A (en) Intelligent test method and system for solid state disk firmware module
CN112860587B (en) UI automatic test method and device
EP3570173B1 (en) Equivalence verification apparatus and equivalence verification program
CN117493188A (en) Interface testing method and device, electronic equipment and storage medium
CN117370217A (en) Automatic interface test result generation method based on python
CN113742215A (en) Method and system for automatically configuring and calling test tool to perform test analysis
CN114756217B (en) Plug-in based script generation system
CN114443039A (en) Input parameter verification method and device, electronic equipment and storage medium
CN113886221B (en) Test script generation method and device, storage medium and electronic equipment
CN114385271B (en) Command execution system based on plug-in
KR20120111618A (en) Apparatus and method for testing plc command
CN112256554B (en) Method and equipment for testing based on scene test cases
CN108628606B (en) Method and system for generating WEB network management application program of embedded equipment
CN109800155B (en) Method and device for testing QTE interlocking application software based on Probe
CN117591104B (en) Model generation method and device, electronic 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