WO2018188342A1 - Method, apparatus and device for generating script file, and computer-readable storage medium - Google Patents
Method, apparatus and device for generating script file, and computer-readable storage medium Download PDFInfo
- Publication number
- WO2018188342A1 WO2018188342A1 PCT/CN2017/111881 CN2017111881W WO2018188342A1 WO 2018188342 A1 WO2018188342 A1 WO 2018188342A1 CN 2017111881 W CN2017111881 W CN 2017111881W WO 2018188342 A1 WO2018188342 A1 WO 2018188342A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- script file
- script
- configuration information
- file
- generating
- Prior art date
Links
- 238000000034 method Methods 0.000 title claims abstract description 50
- 238000013475 authorization Methods 0.000 claims description 26
- 238000012986 modification Methods 0.000 claims description 23
- 230000004048 modification Effects 0.000 claims description 23
- 238000012360 testing method Methods 0.000 claims description 17
- 238000012545 processing Methods 0.000 claims description 3
- 238000010586 diagram Methods 0.000 description 11
- 230000008569 process Effects 0.000 description 9
- 230000006870 function Effects 0.000 description 8
- 238000004891 communication Methods 0.000 description 5
- 238000013461 design Methods 0.000 description 3
- 239000012634 fragment Substances 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 2
- 230000001960 triggered effect Effects 0.000 description 2
- 238000004883 computer application Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000007689 inspection Methods 0.000 description 1
- 230000009466 transformation Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/21—Design, administration or maintenance of databases
Definitions
- the present application relates to the field of computer application technologies, and in particular, to a script file generation method, apparatus, device, and computer readable storage medium.
- the database design is basically designed by the developer, manually written, and then submitted to the appropriate test personnel for inspection.
- the main purpose of the present application is to provide a script file generation method, apparatus, device, and computer readable storage medium, which aim to solve the technical problem of the existing script file generation method, low efficiency, and poor intelligence.
- the present application provides a script file generating method, where the script file generating method includes:
- the preset script generation tool When receiving the generation instruction of the script file, the preset script generation tool creates a form on the preset interface;
- a script file is generated according to the configuration information defined in the table and the script template corresponding to the table.
- the present application further provides a script file generating apparatus, where the script file generating apparatus includes:
- Establishing a module configured to create a table in a preset interface by using a preset script generation tool when receiving a script file generation instruction;
- a definition module for defining configuration information in the created table
- a generating module configured to generate a script file according to the configuration information defined in the table, and the script program template corresponding to the table.
- the present application further provides a script file generating device, the script file generating device including a processor, and a memory storing a program generated by the script file; the processor is configured to execute the script file generation Program to implement the steps of the script file generation method as described above.
- the present application further provides a computer readable storage medium storing a script file generating program, the script file generating program being executed by a processor to implement as described above The steps of the script file generation method.
- the script file generating method proposed by the present application firstly establishes a form in a preset interface by using a preset script generating tool when receiving a script file generating instruction, and then defines configuration information in the created table, and then according to the definition in the table.
- the configuration information, and the script template corresponding to the table generate a script file.
- the script file is generated by the configuration information in the table and the script template corresponding to the table, and the generated script file conforms to the specification. Even if the script file is to be modified later, the configuration information in the table can be modified, and the code in the script template is Fragments do not need to be written again, improving the efficiency and intelligence of script file generation.
- FIG. 1 is a schematic flowchart of a first embodiment of a method for generating a script file according to the present application
- FIG. 2 is a schematic diagram of a refinement process of step S20 in FIG. 1;
- step S30 in FIG. 1 is a schematic diagram of a refinement process of step S30 in FIG. 1;
- FIG. 4 is a schematic flowchart of a second embodiment of a method for generating a script file according to the present application
- FIG. 5 is a schematic diagram of functional modules of a first embodiment of a script file generating apparatus of the present application
- FIG. 6 is a schematic diagram of a refinement function module of the module 20 defined in FIG. 5;
- FIG. 7 is a schematic diagram of a refinement function module of the generation module 30 in FIG. 5;
- FIG. 8 is a schematic diagram of functional modules of a second embodiment of a script file generating apparatus of the present application.
- FIG. 9 is a schematic structural diagram of a device in a hardware operating environment according to an embodiment of the present application.
- the solution of the embodiment of the present application is mainly: when receiving the generation instruction of the script file, first establishing a table in the preset interface by using a preset script generation tool, and then defining configuration information in the established table, and then defining according to the table
- the configuration information, and the script template corresponding to the table generate a script file.
- the generation of the script file is implemented by the configuration information in the table and the script template corresponding to the table, and the generated script file conforms to the specification. Even if the script file is to be modified later, the configuration information in the table can be modified, and the script template is The code snippet does not need to be written again, and solves the problem of the existing script file generation method, low efficiency, and poor intelligence.
- the application provides a script file generation method.
- FIG. 1 is a schematic flowchart of a preferred embodiment of a script file generating method according to the present application.
- the script file generating method includes:
- the preset script generation tool When receiving the generation instruction of the script file, the preset script generation tool creates a table in the preset interface; defines the configuration information in the established table; according to the configuration information defined in the table, and the script template corresponding to the table , generate a script file.
- the script file generating method is preferably implemented by the terminal by using a preset script generating tool, and the script generating tool may be a DB (Database) tool, and the script file generating tool of the present application is completed by the script generating tool. process.
- the script generating tool may be a DB (Database) tool, and the script file generating tool of the present application is completed by the script generating tool. process.
- Step S10 when receiving the generation instruction of the script file, creating a form on the preset interface by using a preset script generation tool;
- the preset application when receiving the generation instruction of the script file, the preset application is invoked by the preset script generation tool to create a table in the preset interface of the preset application.
- the preset The interface is preferably an interface of an Excel application, and correspondingly, the created form is an Excel spreadsheet.
- Step S20 defining configuration information in the established table
- the configuration information is defined in the established table.
- the configuration information may be configuration information defined by the terminal system, or may be input by the terminal system and the user in the table.
- the configuration information is defined together, and the specific configuration information needs to be defined, depending on the actual situation.
- the configuration information defined by the terminal system is defined by the system by default, and the configuration information input by the user is input according to the actual needs of the user.
- the configuration information input by the user is received, the configuration information input by the user and the configuration information of the terminal system can be defined into the table. If the configuration information input by the user is not received, The configuration information defined by the terminal system is directly adopted.
- the information defined by the terminal system includes: a database associated with the table, and a standard authorization file associated with the table; wherein the database is used to determine the specific type of the script template corresponding to the form, and the standard authorization file is used to determine the generation rules of the script file, and the script file
- the generation rules mainly include: the length of the field in the script file and the access permission of the script file.
- the script file can only be viewed, cannot be added or deleted, or can only be viewed and added, and cannot be deleted.
- the configuration information input by the user includes: user information, synonym user information, triggers, and the like; wherein the user information and the synonym user information are used to distinguish different users, to grant different access rights to different users, and the trigger is used to record the script. Traces of modifications to the file.
- the database and standard authorization file associated with the above mentioned table can also be modified by the user according to actual needs.
- the step S20 includes:
- Step S21 associating a database in the established table
- Step S22 establishing user information and synonym user information for the associated database in the table, so that different users have different access rights;
- step S23 a trigger is created in the table to record the modification trace of the script file based on the created trigger.
- the table is associated with the preset database.
- the system may be associated with the default database at the beginning, and may be added according to actual needs to be associated with other databases.
- the addition mode can be implemented by the user adding a database identification information in the preset area of the table to associate the table to the new database.
- the database initially associated with the table is LBS and ELIS, and the display form is:
- the table in this embodiment is a normalized table, which can be mapped to a script template by using the script generation tool mentioned above, but since the script template to which the table is mapped is the same, The generated script files are different. Therefore, the script template corresponding to the table can be further determined by the database associated with the table, that is, the table is associated with different databases, and the attribute information generated in each database is different, and finally generated. The script template will also be different. In this embodiment, a table can be associated with multiple databases, and finally multiple script templates can be obtained.
- user information and synonym user information are established in the associated database in the table, and different users are authorized to have different access rights for different users.
- the user information set under a certain database is “Zhang Sheng”, and then a synonym user information is set to “Zhang San”, and the “Zhang Sheng” permission is Viewing the specific data in this form, adding, deleting, and modifying, and "Zhang San” is information that tells other users to visit, such as the user information that informs the tester to view, "Zhang San” has the right to view information, and cannot add or delete the table. data.
- Zhang Sheng and “Zhang San” are the same object, setting user information and synonym information for the same object, and setting unused rights for user information and synonym information, so that developers and other personnel such as testers There are two different access rights for this object, which realizes the protection of the data in the table, prevents other people from changing the data in the table, and causes the script file generated subsequently to be incorrect, thus ensuring the security of the information.
- a trigger can be created in the created table to subsequently record the modified trace of the script file based on the created trigger.
- a trigger is created in the created table, so that the modification trace of the script file is recorded based on the created trigger, and the trace of each modification, as well as the specific modified content and the modification time, can be triggered. Record, easy to know the modification of the data in the table, better analysis.
- the script template corresponding to the table may be determined according to the associated database in the table, and the configuration of the related information of the subsequently generated script file is completed.
- Step S30 generating a script file according to the configuration information defined in the table and the script program template corresponding to the table.
- the script template has been obtained, and combined with the configuration information defined by the terminal system in the table and the configuration information input by the user, the configuration information is specifically added to the script template to generate a script file.
- the step S30 includes:
- Step S31 extracting a script file generation rule from a standard authorization file stored in a preset directory
- Step S32 generating a script file according to the extracted script file generation rule, the configuration information defined in the table, and the script program template corresponding to the table.
- the generation rule of the script file may be further extracted from the standard authorization file stored in the preset directory, for example, the script file is only viewed.
- the certain fields are inherently invariant, cannot be modified, and the like, and then generate a script file according to the generated rules of the generated script file, the configuration information defined in the table, and the corresponding script template of the skin label.
- script file generating method further includes:
- the script file generating method in the embodiment when receiving the script file generating instruction, first establishes a table in a preset interface by using a preset script generating tool, and then defines configuration information in the created table, and then defines according to the table.
- the configuration information, and the script template corresponding to the table generate a script file.
- the script file is generated by the configuration information in the table and the script template corresponding to the table, and the generated script file conforms to the specification. Even if the script file is to be modified later, the configuration information in the table can be modified, and the code in the script template is Fragments do not need to be written again, improving the efficiency and intelligence of script file generation.
- the method further includes:
- Step S40 when receiving the running instruction of the script file, calling the database associated with the table to run the script file to implement testing of the script file;
- step S50 when it is detected that the script file is incorrect, the prompt information is output, wherein the manner of outputting the prompt information includes outputting in a position with an error in the table, or popping up the prompt window to output an error information.
- the script file when receiving the running instruction of the script file, first calling the database associated with the table to run the script file, that is, by calling the database, traversing the database to run the script file, and detecting If no error is reported during the running of the script file, the generated script file is considered to be accurate. If the script file is detected to be incorrect, the prompt information is output to prompt the script file to be incorrect, and the manner of outputting the prompt information may be The position of the table is incorrectly output, and the prompt window may output a message with an error.
- the method includes:
- the generated script file is handed over to the preset storage path for subsequent execution of the script file;
- the script file is first handed over to the preset storage path, so that the script file is tested in the storage path, and the test is not performed on the interface for generating the script file, thereby affecting the test of the script file, thereby improving the script.
- the accuracy of the document test is first handed over to the preset storage path, so that the script file is tested in the storage path, and the test is not performed on the interface for generating the script file, thereby affecting the test of the script file, thereby improving the script.
- the above-mentioned storage medium may be a read only memory, a magnetic disk or an optical disk or the like.
- the application further provides a script file generating apparatus.
- FIG. 5 is a schematic diagram of functional modules of a preferred embodiment of the script file generating apparatus 100 of the present application.
- the functional block diagram shown in FIG. 5 is merely an exemplary diagram of a preferred embodiment, and those skilled in the art surround the functional modules of the script file generating apparatus 100 shown in FIG. 5.
- the function modules of the present invention can be easily supplemented by the new function modules.
- the names of the function modules are used to assist in understanding the various program function blocks of the script file generating apparatus 100, and are not used to limit the technical solutions of the present application.
- At the heart of the solution is the functionality to be achieved by the functional modules that each define the name.
- the script file generating apparatus 100 includes:
- Establishing a module configured to: when the script generation instruction is received, create a table in the preset interface by using a preset script generation tool; define a module, configured to define configuration information in the established table; and generate a module, according to the table
- the script file generating apparatus is preferably implemented by the terminal by using a preset script generating tool, and the script generating tool may be a DB (Database) tool, and the script file generating tool of the present application is completed by the script generating tool. process.
- the script generating tool may be a DB (Database) tool, and the script file generating tool of the present application is completed by the script generating tool. process.
- the establishing module 10 is configured to: when receiving the generating instruction of the script file, create a table in the preset interface by using a preset script generating tool;
- the establishing module 10 calls the preset application by using the preset script generating tool to create a table in the preset interface of the preset application.
- the The preset interface is preferably an interface of an Excel application, and correspondingly, the created form is an Excel spreadsheet.
- the definition module 20 is configured to define configuration information in the established table
- the definition module 20 defines the configuration information in the established table.
- the configuration information may be configuration information defined by the terminal system, or may be the terminal system and the user.
- the configuration information entered in the table is defined together, and the specific configuration information needs to be defined, depending on the actual situation.
- the configuration information defined by the terminal system is defined by the system by default, and the configuration information input by the user is input according to the actual needs of the user.
- the configuration information input by the user is received, the configuration information input by the user and the configuration information of the terminal system can be defined into the table. If the configuration information input by the user is not received, The configuration information defined by the terminal system is directly adopted.
- the information defined by the terminal system includes: a database associated with the table, and a standard authorization file associated with the table; wherein the database is used to determine the specific type of the script template corresponding to the form, and the standard authorization file is used to determine the generation rules of the script file, and the script file
- the generation rules mainly include: the length of the field in the script file and the access permission of the script file.
- the script file can only be viewed, cannot be added or deleted, or can only be viewed and added, and cannot be deleted.
- the configuration information input by the user includes: user information, synonym user information, triggers, and the like; wherein the user information and the synonym user information are used to distinguish different users, to grant different access rights to different users, and the trigger is used to record the script. Traces of modifications to the file.
- the database and standard authorization file associated with the above mentioned table can also be modified by the user according to actual needs.
- the definition module 20 includes:
- An association unit 21 configured to associate a database in the established table
- the establishing unit 22 is configured to establish user information and synonym user information in the table for the associated database, so that different users have different access rights;
- a creating unit 23 is configured to create a trigger in the table to record a modification trace of the script file based on the created trigger.
- the association unit 21 associates the table to the preset database.
- the system may be associated with the default database at the beginning, and may be added according to actual needs to be associated with other databases.
- the specific addition method can be implemented by the user adding a database identification information in the preset area of the table, so that the table is associated with the new database.
- the database initially associated with the table is LBS and ELIS, and the display form is:
- the table in this embodiment is a normalized table, which can be mapped to a script template by using the script generation tool mentioned above, but since the script template to which the table is mapped is the same, The generated script files are different. Therefore, the script template corresponding to the table can be further determined by the database associated with the table, that is, the table is associated with different databases, and the attribute information generated in each database is different, and finally generated. The script template will also be different. In this embodiment, a table can be associated with multiple databases, and finally multiple script templates can be obtained.
- the establishing unit 22 establishes user information and synonym user information for the associated database in the table, and authorizes different users so that different users have different access rights. For example, when a developer develops a script file through a form, the user information set under a certain database is “Zhang Sheng”, and then a synonym user information is set to “Zhang San”, and the “Zhang Sheng” permission is Viewing the specific data in this form, adding, deleting, and modifying, and "Zhang San” is information that tells other users to visit, such as the user information that informs the tester to view, "Zhang San" has the right to view information, and cannot add or delete the table. data.
- Zhang Sheng and “Zhang San” are the same object, setting user information and synonym information for the same object, and setting unused rights for user information and synonym information, so that developers and other personnel such as testers There are two different access rights for this object, which realizes the protection of the data in the table, prevents other people from changing the data in the table, and causes the script file generated subsequently to be incorrect, thus ensuring the security of the information.
- the creation unit 23 can also create a trigger in the created table to subsequently record the modification trace of the script file based on the created trigger.
- a trigger is created in the created table, so that the modification trace of the script file is recorded based on the created trigger, and the trace of each modification, as well as the specific modified content and the modification time, can be triggered. Record, easy to know the modification of the data in the table, better analysis.
- the script template corresponding to the table may be determined according to the associated database in the table, and the configuration of the related information of the subsequently generated script file is completed.
- the generating module 30 is configured to generate a script file according to the configuration information defined in the table and the script program template corresponding to the table.
- the script template is obtained according to the database associated with the table.
- the generating module 30 further adds the configuration information to the script template in combination with the configuration information defined by the terminal system in the table and the configuration information input by the user to generate a script. file.
- the generating module 30 includes:
- the extracting unit 31 is configured to extract a script file generating rule from a standard authorization file stored in a preset directory;
- the generating unit 32 is configured to generate a script file according to the extracted script file generation rule, the configuration information defined in the table, and the script program template corresponding to the table.
- the extracting unit 31 may further extract the script file generation rule, such as a script file, from the standard authorization file stored in the preset directory. Is only view, some fields are inherently unchanged, can not be modified, and so on, and then the generating unit 32 according to the generated rules of the generated script file, and the configuration information defined in the table and the corresponding script template of the skin label , generate a script file.
- the script file generation rule such as a script file
- script file generating apparatus further includes:
- a determining module configured to determine, in the preset directory, a location where the standard authorization file is to be modified when the modification instruction of the standard authorization file is detected;
- a processing module that replaces the determined location with a placeholder and adds a new script file generation rule to the determined location.
- the script file generating apparatus 100 of the present embodiment firstly establishes a form in a preset interface by using a preset script generating tool when receiving a script file generating instruction, and then defines configuration information in the created form, and then according to the table.
- the defined configuration information, and the script template corresponding to the table generates a script file.
- the script file is generated by the configuration information in the table and the script template corresponding to the table, and the generated script file conforms to the specification. Even if the script file is to be modified later, the configuration information in the table can be modified, and the code in the script template is Fragments do not need to be written again, improving the efficiency and intelligence of script file generation.
- the script file generating apparatus 100 further includes:
- the calling module 40 is configured to, when receiving the running instruction of the script file, invoke the database associated with the table to run the script file to implement testing of the script file;
- the output module 50 is configured to output prompt information when detecting that the script file is incorrect, wherein the manner of outputting the prompt information includes outputting in a position with an error in the table, or popping up the prompt window to output incorrect information.
- the calling module 40 upon receiving the running instruction of the script file, the calling module 40 first invokes the database associated with the table to run the script file, that is, by calling the database, traversing the database to run the script file, If no error is reported during the running of the script file, the generated script file is considered to be accurate. If the script file is detected to be incorrect, the output module 50 outputs the prompt information to prompt the script file to be incorrect, and output the prompt information. The way can be output in the wrong position in the table, and the prompt window can be displayed to output incorrect information.
- the device in order to ensure the accuracy of the data test, the device includes:
- a handover module configured to: when the handover instruction of the script file is received, hand over the generated script file to a preset storage path, so as to subsequently run the script file;
- the handover module first transfers the script file to the preset storage path, so as to test the script file in the storage path, avoiding testing on the interface for generating the script file, thereby affecting the test of the script file, thereby improving The accuracy of the script file test.
- the above establishing module 10, defining module 20, generating module 30, and the like may be embedded in or independent of the script file generating device in hardware form, or may be stored in the script file generating device in software form.
- the processor can be a central processing unit (CPU), a microprocessor, a microcontroller, or the like.
- FIG. 9 is a schematic structural diagram of a device in a hardware operating environment according to an embodiment of the present application.
- the script file generating device in the embodiment of the present application may be a PC, or may be a terminal device having a display function, such as a smart phone, a tablet computer, or a portable computer.
- the script file generating device may include a processor 1001, such as a CPU, a network interface 1002, a user interface 1003, and a memory 1004. Connection communication between these components can be achieved via a communication bus.
- the network interface 1002 may optionally include a standard wired interface (for connecting to a wired network), a wireless interface (such as a WI-FI interface, a Bluetooth interface, an infrared interface, etc. for connecting to a wireless network).
- the user interface 1003 may include a display, an input unit such as a keyboard, and the optional user interface 1003 may also include a standard wired interface (eg, for connecting a wired keyboard, a wired mouse, etc.), a wireless interface (eg, for Connect a wireless keyboard, wireless mouse).
- the memory 1004 may be a high speed RAM memory or a stable memory (non-volatile) Memory), such as disk storage.
- the memory 1004 can also optionally be a storage device independent of the aforementioned processor 1001.
- the script file generating device may further include a camera, RF (Radio) Frequency, RF) circuits, sensors, audio circuits, WiFi modules, and more.
- RF Radio
- RF Radio
- script file generating device structure shown in FIG. 9 does not constitute a limitation of the script file generating device, and may include more or less components than those illustrated, or combine some components, or different. Parts layout.
- an operating system a network communication module, a user interface module, and a script file generation program may be included in the memory 1004 as a computer storage medium.
- the operating system is a program for managing and controlling the script file generation device hardware and software resources, and supports the operation of the network communication module, the user interface module, the script file generation program, and other programs or software; the network communication module is used to manage and control the network interface. 1002; a user interface module is used to manage and control the user interface 1003.
- the processor 1001 can be used to execute a script file generating program stored in the memory 1004 to implement the steps of the script file generating method as described above.
- the present application provides a computer readable storage medium storing a script file generating program, the script file generating program being executed by a processor to implement the steps of the script file generating method as described above .
- the foregoing embodiment method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be through hardware, but in many cases, the former is better.
- Implementation Based on such understanding, the technical solution of the present application, which is essential or contributes to the prior art, may be embodied in the form of a software product stored in a storage medium (such as ROM/RAM, disk,
- the optical disc includes a number of instructions for causing a terminal device (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the methods described in various embodiments of the present application.
Landscapes
- Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Stored Programmes (AREA)
Abstract
Disclosed is a method for generating a script file. The method comprises: when an instruction for generating a script file is received, creating a table on a pre-set interface by means of a pre-set script generation tool; defining configuration information in the created table; and according to the configuration information defined in the table, and a script program template corresponding to the table, generating a script file. Further disclosed are an apparatus and device for generating a script file, and a computer-readable storage medium. A script file generated in the present application conforms to standards. Even if the script file needs to be subsequently modified, only the configuration information in a table needs to be modified, thus improving the efficiency and intelligence of the generation of the script file.
Description
本申请要求于2017年04月13日提交中国专利局、申请号为201710243035.1、发明名称为“脚本文件生成方法和装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。The present application claims the priority of the Chinese Patent Application, filed on Apr. 13, 2017, the application Serial No.
技术领域Technical field
本申请涉及计算机应用技术领域,尤其涉及一种脚本文件生成方法、装置、设备和计算机可读存储介质。The present application relates to the field of computer application technologies, and in particular, to a script file generation method, apparatus, device, and computer readable storage medium.
背景技术Background technique
目前,数据库设计基本都是开发人员设计后,手工编写,然后提交给相应的测试人员进行检查。At present, the database design is basically designed by the developer, manually written, and then submitted to the appropriate test personnel for inspection.
但是,经常有如下问题:因为数据库设计不合规范,脚本完成后在执行过程中若是出现一些比较低级的错误,导致测试有问题时,需要回头调整设计,重新修改脚本代码,并重新执行。由于这种过程很多内容需要手动重复编写,耗费大量时间,导致脚本文件的生成效率较低,且生成方式智能性也较差。However, there are often the following problems: Because the database design is not standardized, if there are some relatively low-level errors during the execution of the script, and the test has problems, you need to go back and adjust the design, re-edit the script code, and re-execute. Because this process requires a lot of content to be manually rewritten, it takes a lot of time, resulting in low efficiency of script file generation and poor intelligence of the generation method.
发明内容Summary of the invention
本申请的主要目的在于提供一种脚本文件生成方法、装置、设备和计算机可读存储介质,旨在解决现有的脚本文件生成方式,效率低,且智能性差的技术问题。The main purpose of the present application is to provide a script file generation method, apparatus, device, and computer readable storage medium, which aim to solve the technical problem of the existing script file generation method, low efficiency, and poor intelligence.
为实现上述目的,本申请提供一种脚本文件生成方法,所述脚本文件生成方法包括:To achieve the above objective, the present application provides a script file generating method, where the script file generating method includes:
接收到脚本文件的生成指令时,通过预设脚本生成工具在预设界面建立表格;When receiving the generation instruction of the script file, the preset script generation tool creates a form on the preset interface;
在建立的表格中定义配置信息;Define configuration information in the established form;
根据所述表格中定义的配置信息,以及所述表格对应的脚本程序模板,生成脚本文件。A script file is generated according to the configuration information defined in the table and the script template corresponding to the table.
此外,为实现上述目的,本申请还提供一种脚本文件生成装置,所述脚本文件生成装置包括:In addition, in order to achieve the above object, the present application further provides a script file generating apparatus, where the script file generating apparatus includes:
建立模块,用于接收到脚本文件的生成指令时,通过预设脚本生成工具在预设界面建立表格;Establishing a module, configured to create a table in a preset interface by using a preset script generation tool when receiving a script file generation instruction;
定义模块,用于在建立的表格中定义配置信息;a definition module for defining configuration information in the created table;
生成模块,用于根据所述表格中定义的配置信息,以及所述表格对应的脚本程序模板,生成脚本文件。And a generating module, configured to generate a script file according to the configuration information defined in the table, and the script program template corresponding to the table.
此外,为实现上述目的,本申请还提供一种脚本文件生成设备,所述脚本文件生成设备包括处理器、以及存储有脚本文件生成的程序的存储器;所述处理器用于执行所述脚本文件生成的程序,以实现如上文所述的脚本文件生成方法的步骤。In addition, in order to achieve the above object, the present application further provides a script file generating device, the script file generating device including a processor, and a memory storing a program generated by the script file; the processor is configured to execute the script file generation Program to implement the steps of the script file generation method as described above.
此外,为实现上述目的,本申请还提供一种计算机可读存储介质,所述计算机可读存储介质存储有脚本文件生成程序,所述脚本文件生成程序被处理器执行,以实现如上文所述的脚本文件生成方法的步骤。In addition, in order to achieve the above object, the present application further provides a computer readable storage medium storing a script file generating program, the script file generating program being executed by a processor to implement as described above The steps of the script file generation method.
本申请提出的脚本文件生成方法,接收到脚本文件的生成指令时,先通过预设脚本生成工具在预设界面建立表格,然后在建立的表格中定义配置信息,再根据所述表格中定义的配置信息,以及所述表格对应的脚本程序模板,生成脚本文件。使得脚本文件是由表格中的配置信息以及表格对应的脚本程序模板生成的,生成的脚本文件合乎规范,即使后续要修改脚本文件,只要修改表格中的配置信息即可,脚本程序模板中的代码片段无须再次编写,提高了脚本文件生成的效率和智能性。The script file generating method proposed by the present application firstly establishes a form in a preset interface by using a preset script generating tool when receiving a script file generating instruction, and then defines configuration information in the created table, and then according to the definition in the table. The configuration information, and the script template corresponding to the table, generate a script file. The script file is generated by the configuration information in the table and the script template corresponding to the table, and the generated script file conforms to the specification. Even if the script file is to be modified later, the configuration information in the table can be modified, and the code in the script template is Fragments do not need to be written again, improving the efficiency and intelligence of script file generation.
附图说明DRAWINGS
图1为本申请脚本文件生成方法第一实施例的流程示意图;1 is a schematic flowchart of a first embodiment of a method for generating a script file according to the present application;
图2为图1中步骤S20的细化流程示意图;2 is a schematic diagram of a refinement process of step S20 in FIG. 1;
图3为图1中步骤S30的细化流程示意图;3 is a schematic diagram of a refinement process of step S30 in FIG. 1;
图4为本申请脚本文件生成方法第二实施例的流程示意图;4 is a schematic flowchart of a second embodiment of a method for generating a script file according to the present application;
图5为本申请脚本文件生成装置第一实施例的功能模块示意图;5 is a schematic diagram of functional modules of a first embodiment of a script file generating apparatus of the present application;
图6为图5中定义模块20的细化功能模块示意图;6 is a schematic diagram of a refinement function module of the module 20 defined in FIG. 5;
图7为图5中生成模块30的细化功能模块示意图;7 is a schematic diagram of a refinement function module of the generation module 30 in FIG. 5;
图8为本申请脚本文件生成装置第二实施例的功能模块示意图;8 is a schematic diagram of functional modules of a second embodiment of a script file generating apparatus of the present application;
图9是本申请实施例方案涉及的硬件运行环境的设备结构示意图。FIG. 9 is a schematic structural diagram of a device in a hardware operating environment according to an embodiment of the present application.
本申请目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。The implementation, functional features and advantages of the present application will be further described with reference to the accompanying drawings.
具体实施方式detailed description
应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。It is understood that the specific embodiments described herein are merely illustrative of the application and are not intended to be limiting.
本申请实施例的解决方案主要是:接收到脚本文件的生成指令时,先通过预设脚本生成工具在预设界面建立表格,然后在建立的表格中定义配置信息,再根据所述表格中定义的配置信息,以及所述表格对应的脚本程序模板,生成脚本文件。使得脚本文件的生成是由表格中的配置信息以及表格对应的脚本程序模板实现的,生成的脚本文件合乎规范,即使后续要修改脚本文件,只要修改表格中的配置信息即可,脚本程序模板中的代码片段无须再次编写,解决了现有的脚本文件生成方式,效率低,且智能性差的问题。The solution of the embodiment of the present application is mainly: when receiving the generation instruction of the script file, first establishing a table in the preset interface by using a preset script generation tool, and then defining configuration information in the established table, and then defining according to the table The configuration information, and the script template corresponding to the table, generate a script file. The generation of the script file is implemented by the configuration information in the table and the script template corresponding to the table, and the generated script file conforms to the specification. Even if the script file is to be modified later, the configuration information in the table can be modified, and the script template is The code snippet does not need to be written again, and solves the problem of the existing script file generation method, low efficiency, and poor intelligence.
本申请提供一种脚本文件生成方法。The application provides a script file generation method.
参照图1,图1为本申请脚本文件生成方法较佳实施例的流程示意图。Referring to FIG. 1, FIG. 1 is a schematic flowchart of a preferred embodiment of a script file generating method according to the present application.
在本实施例中,所述脚本文件生成方法包括:In this embodiment, the script file generating method includes:
接收到脚本文件的生成指令时,通过预设脚本生成工具在预设界面建立表格;在建立的表格中定义配置信息;根据所述表格中定义的配置信息,以及所述表格对应的脚本程序模板,生成脚本文件。When receiving the generation instruction of the script file, the preset script generation tool creates a table in the preset interface; defines the configuration information in the established table; according to the configuration information defined in the table, and the script template corresponding to the table , generate a script file.
在本实施例中,所述脚本文件生成方法优选是终端通过预设的脚本生成工具实现的,所述脚本生成工具可以为DB(Database)工具,通过该脚本生成工具完成本申请的脚本文件生成过程。In this embodiment, the script file generating method is preferably implemented by the terminal by using a preset script generating tool, and the script generating tool may be a DB (Database) tool, and the script file generating tool of the present application is completed by the script generating tool. process.
以下是本实施例中实现脚本文件生成的具体步骤:The following are the specific steps for implementing the script file generation in this embodiment:
步骤S10,接收到脚本文件的生成指令时,通过预设脚本生成工具在预设界面建立表格;Step S10, when receiving the generation instruction of the script file, creating a form on the preset interface by using a preset script generation tool;
本实施例中,在接收到脚本文件的生成指令时,通过预设脚本生成工具调用预设应用,以在所述预设应用的预设界面中建立表格,本实施例中,所述预设界面优选为Excel应用的界面,对应的,建立的表格就为Excel表格。In this embodiment, when receiving the generation instruction of the script file, the preset application is invoked by the preset script generation tool to create a table in the preset interface of the preset application. In this embodiment, the preset The interface is preferably an interface of an Excel application, and correspondingly, the created form is an Excel spreadsheet.
步骤S20,在建立的表格中定义配置信息;Step S20, defining configuration information in the established table;
在预设界面中建立表格之后,在建立的所述表格中定义配置信息,本实施例中,所述配置信息可以是终端系统自行定义的配置信息,也可以是终端系统和用户在表格中输入的配置信息共同定义的,具体需要定义哪些配置信息,根据实际情况而定。终端系统定义的配置信息是系统默认会定义好的,用户输入的配置信息是根据用户实际需要才输入的。优选地,在表格建立完成之后,若接收到用户输入的配置信息,即可将用户输入的配置信息以及终端系统的配置信息都定义到所述表格中,若未接收到用户输入的配置信息,则直接采用终端系统定义的配置信息。After the table is created in the preset interface, the configuration information is defined in the established table. In this embodiment, the configuration information may be configuration information defined by the terminal system, or may be input by the terminal system and the user in the table. The configuration information is defined together, and the specific configuration information needs to be defined, depending on the actual situation. The configuration information defined by the terminal system is defined by the system by default, and the configuration information input by the user is input according to the actual needs of the user. Preferably, after the form is established, if the configuration information input by the user is received, the configuration information input by the user and the configuration information of the terminal system can be defined into the table. If the configuration information input by the user is not received, The configuration information defined by the terminal system is directly adopted.
终端系统定义的信息包括:表格关联的数据库,表格中关联的标准授权文件;其中,数据库用来确定表格最终对应的脚本程序模板具体类型,标准授权文件用来确定脚本文件的生成规则,脚本文件生成规则主要包括:脚本文件中的字段长度、脚本文件的访问权限,如脚本文件是只能查看,不能增删,还是只能查看和增加内容不能删减等等。用户输入的配置信息包括:用户信息、同义词用户信息,触发器等等;其中,用户信息、同义词用户信息用来区分不同的用户,以对不同的用户授予不同的访问权限,触发器用来记录脚本文件的修改痕迹。当然,上述所提到的表格关联的数据库和标准授权文件,也可由用户根据实际需要进行修改。The information defined by the terminal system includes: a database associated with the table, and a standard authorization file associated with the table; wherein the database is used to determine the specific type of the script template corresponding to the form, and the standard authorization file is used to determine the generation rules of the script file, and the script file The generation rules mainly include: the length of the field in the script file and the access permission of the script file. For example, the script file can only be viewed, cannot be added or deleted, or can only be viewed and added, and cannot be deleted. The configuration information input by the user includes: user information, synonym user information, triggers, and the like; wherein the user information and the synonym user information are used to distinguish different users, to grant different access rights to different users, and the trigger is used to record the script. Traces of modifications to the file. Of course, the database and standard authorization file associated with the above mentioned table can also be modified by the user according to actual needs.
具体地,参照图2,所述步骤S20包括:Specifically, referring to FIG. 2, the step S20 includes:
步骤S21,在建立的表格中关联数据库;Step S21, associating a database in the established table;
步骤S22,在所述表格中对关联的数据库建立用户信息以及同义词用户信息,以使不同的用户对应有不同的访问权限;及Step S22, establishing user information and synonym user information for the associated database in the table, so that different users have different access rights;
步骤S23,在所述表格中创建触发器,以便后续基于创建的所述触发器记录脚本文件的修改痕迹。In step S23, a trigger is created in the table to record the modification trace of the script file based on the created trigger.
即,在建立表格之后,将所述表格关联到预设数据库,本实施例中,系统一开始可以关联到默认的数据库,后续,还可根据实际需要进行增加,以关联到其它数据库,具体的增加方式可由用户在表格的预设区域中增加一个数据库的标识信息实现,以使表格关联到新的数据库,如:表格初始关联的数据库为LBS和ELIS,显示形式为:That is, after the table is created, the table is associated with the preset database. In this embodiment, the system may be associated with the default database at the beginning, and may be added according to actual needs to be associated with other databases. The addition mode can be implemented by the user adding a database identification information in the preset area of the table to associate the table to the new database. For example, the database initially associated with the table is LBS and ELIS, and the display form is:
数据库: LBS ELISDatabase: LBS ELIS
后续根据实际需要再增加多一个数据库d0lucd0,那么就需要在预设区域中对事先关联的数据库加多一个,即关联事先数据的操作为:Subsequent addition of one more database d0lucd0 according to actual needs, then it is necessary to add one more to the database associated in advance in the preset area, that is, the operation of associating the prior data is:
执行脚本数据库: LBSExecute the script database: LBS
ELIS ELIS
在预设区域中增加一个数据库时,操作就是:When adding a database to the default area, the operation is:
执行脚本数据库: LBSExecute the script database: LBS
ELIS ELIS
d0lucd0 D0lucd0
那么,最终得到的数据表格的显示形式就为:Then, the final form of the data table is displayed as:
数据库: LBS ELIS d0lucd0Database: LBS ELIS d0lucd0
应当理解的是,本实施例中的表格是规范化的表格,可以通过上文所提及的脚本生成工具映射为脚本程序模板,但是由于表格映射到的脚本程序模板是相同的,而要使后续生成的脚本文件各不相同,因此,通过所述表格关联的数据库,可以进一步确定所述表格对应的脚本程序模板,即表格关联不同的数据库,由于每个数据库中的属性信息不同,最终生成的脚本程序模板也会有所不同。本实施例中,一个表格可关联有多个数据库,最终可以得到多个脚本程序模板。It should be understood that the table in this embodiment is a normalized table, which can be mapped to a script template by using the script generation tool mentioned above, but since the script template to which the table is mapped is the same, The generated script files are different. Therefore, the script template corresponding to the table can be further determined by the database associated with the table, that is, the table is associated with different databases, and the attribute information generated in each database is different, and finally generated. The script template will also be different. In this embodiment, a table can be associated with multiple databases, and finally multiple script templates can be obtained.
将所述表格关联到预设数据库之后,在所述表格中对关联的数据库建立用户信息以及同义词用户信息,对不同的用户进行授权,以使不同的用户对应有不同的访问权限。例如,开发者在通过表格开发脚本文件时,在某个数据库下设置的用户信息是“张生”,那么此时还设置一个同义词用户信息为“张三”,“张生”的权限是可以对这个表格中的具体数据进行查看增删修改,而“张三”是告诉其他用户进行访问的信息,如通知测试人员查看的用户信息,“张三”只有查看信息的权限,无法增删表格中的数据。应当理解,“张生”和“张三”是同一个对象,对同一个对象设置用户信息和同义词信息,并对用户信息和同义词信息设置不用的权项,使得开发人员和其它人员如测试人员对这个对象有两种不同的访问权项,实现对表格中数据的保护,防止其他人员改动表格中的数据,导致后续生成的脚本文件有误,保证了信息的安全性。After the table is associated with the preset database, user information and synonym user information are established in the associated database in the table, and different users are authorized to have different access rights for different users. For example, when a developer develops a script file through a form, the user information set under a certain database is “Zhang Sheng”, and then a synonym user information is set to “Zhang San”, and the “Zhang Sheng” permission is Viewing the specific data in this form, adding, deleting, and modifying, and "Zhang San" is information that tells other users to visit, such as the user information that informs the tester to view, "Zhang San" has the right to view information, and cannot add or delete the table. data. It should be understood that "Zhang Sheng" and "Zhang San" are the same object, setting user information and synonym information for the same object, and setting unused rights for user information and synonym information, so that developers and other personnel such as testers There are two different access rights for this object, which realizes the protection of the data in the table, prevents other people from changing the data in the table, and causes the script file generated subsequently to be incorrect, thus ensuring the security of the information.
此外,还可在建立的表格中创建触发器,以便后续基于创建的所述触发器记录脚本文件的修改痕迹。本实施例中,对建立的表格中创建触发器,以便后续基于创建的所述触发器记录脚本文件的修改痕迹,每次修改的痕迹,以及具体修改的内容和修改时间,都可以被触发器记录,便于得知表格中数据的修改情况,更好作出分析。In addition, a trigger can be created in the created table to subsequently record the modified trace of the script file based on the created trigger. In this embodiment, a trigger is created in the created table, so that the modification trace of the script file is recorded based on the created trigger, and the trace of each modification, as well as the specific modified content and the modification time, can be triggered. Record, easy to know the modification of the data in the table, better analysis.
在建立的表格中定义配置信息之后,即可根据所述表格中关联的数据库,确定所述表格对应的脚本程序模板,并且完成对后续生成的脚本文件的相关信息的配置。After the configuration information is defined in the established table, the script template corresponding to the table may be determined according to the associated database in the table, and the configuration of the related information of the subsequently generated script file is completed.
步骤S30,根据所述表格中定义的配置信息,以及所述表格对应的脚本程序模板,生成脚本文件。Step S30, generating a script file according to the configuration information defined in the table and the script program template corresponding to the table.
上文根据表格关联的数据库,已经得到脚本程序模板了,再结合终端系统在表格中定义的配置信息以及用户输入的配置信息,将配置信息具体添加到脚本程序模板中,以生成脚本文件。According to the database associated with the table, the script template has been obtained, and combined with the configuration information defined by the terminal system in the table and the configuration information input by the user, the configuration information is specifically added to the script template to generate a script file.
具体地,参照图3,所述步骤S30包括:Specifically, referring to FIG. 3, the step S30 includes:
步骤S31,在预设目录下存储的标准授权文件中提取脚本文件生成规则;Step S31, extracting a script file generation rule from a standard authorization file stored in a preset directory;
步骤S32,根据提取的脚本文件生成规则、所述表格中定义的配置信息以及所述表格对应的脚本程序模板,生成脚本文件。Step S32, generating a script file according to the extracted script file generation rule, the configuration information defined in the table, and the script program template corresponding to the table.
在本实施例中,在确定表格中定义的配置信息,表格对应的脚本程序模板之后,还可进一步在预设目录下存储的标准授权文件中提取脚本文件的生成规则,如脚本文件是只是查看的,某些字段是固有不变,无法修改的等等,然后根据提取的脚本文件的生成规则,以及表格中定义的配置信息以及所述皮标个对应的脚本程序模板,生成脚本文件。In this embodiment, after determining the configuration information defined in the table, the script template corresponding to the table, the generation rule of the script file may be further extracted from the standard authorization file stored in the preset directory, for example, the script file is only viewed. The certain fields are inherently invariant, cannot be modified, and the like, and then generate a script file according to the generated rules of the generated script file, the configuration information defined in the table, and the corresponding script template of the skin label.
进一步地,所述脚本文件生成方法还包括:Further, the script file generating method further includes:
在检测到标准授权文件的修改指令时,在所述预设目录中确定标准授权文件待修改的位置;When the modification instruction of the standard authorization file is detected, determining a location of the standard authorization file to be modified in the preset directory;
用占位符替换确定的位置,并在确定的位置中添加新的脚本文件生成规则。Replace the determined location with a placeholder and add a new script file generation rule in the determined location.
本实施例提出的脚本文件生成方法,接收到脚本文件的生成指令时,先通过预设脚本生成工具在预设界面建立表格,然后在建立的表格中定义配置信息,再根据所述表格中定义的配置信息,以及所述表格对应的脚本程序模板,生成脚本文件。使得脚本文件是由表格中的配置信息以及表格对应的脚本程序模板生成的,生成的脚本文件合乎规范,即使后续要修改脚本文件,只要修改表格中的配置信息即可,脚本程序模板中的代码片段无须再次编写,提高了脚本文件生成的效率和智能性。The script file generating method in the embodiment, when receiving the script file generating instruction, first establishes a table in a preset interface by using a preset script generating tool, and then defines configuration information in the created table, and then defines according to the table. The configuration information, and the script template corresponding to the table, generate a script file. The script file is generated by the configuration information in the table and the script template corresponding to the table, and the generated script file conforms to the specification. Even if the script file is to be modified later, the configuration information in the table can be modified, and the code in the script template is Fragments do not need to be written again, improving the efficiency and intelligence of script file generation.
进一步地,基于第一实施例提出本申请脚本文件生成方法的第二实施例,在本实施例中,参照图4,所述步骤S30之后,所述方法还包括:Further, a second embodiment of the method for generating a script file of the present application is proposed based on the first embodiment. In this embodiment, referring to FIG. 4, after the step S30, the method further includes:
步骤S40,在接收到脚本文件的运行指令时,调用所述表格关联的数据库以运行所述脚本文件,实现对所述脚本文件的测试;Step S40, when receiving the running instruction of the script file, calling the database associated with the table to run the script file to implement testing of the script file;
步骤S50,在检测到所述脚本文件有误时,输出提示信息,其中,输出提示信息的方式包括在表格中有误的位置输出,或者弹出提示窗口输出有误的信息。In step S50, when it is detected that the script file is incorrect, the prompt information is output, wherein the manner of outputting the prompt information includes outputting in a position with an error in the table, or popping up the prompt window to output an error information.
在本实施例中,在接收到脚本文件的运行指令时,先调用所述表格关联的数据库以运行所述脚本文件,即通过调用数据库,对数据库进行遍历以运行所述脚本文件,在检测到脚本文件的运行过程中没有报错,则认为生成的脚本文件准确,若检测到所述脚本文件有误,则输出提示信息,以提示所述脚本文件有误,输出提示信息的方式,可以是在表格中有误的位置输出,还可以弹出提示窗口输出有误的信息。In this embodiment, when receiving the running instruction of the script file, first calling the database associated with the table to run the script file, that is, by calling the database, traversing the database to run the script file, and detecting If no error is reported during the running of the script file, the generated script file is considered to be accurate. If the script file is detected to be incorrect, the prompt information is output to prompt the script file to be incorrect, and the manner of outputting the prompt information may be The position of the table is incorrectly output, and the prompt window may output a message with an error.
本实施例中,为了保证对数据测试的准确性,所述步骤S40之前,所述方法包括:In this embodiment, in order to ensure the accuracy of the data test, before the step S40, the method includes:
在接收到脚本文件的移交指令时,将生成的所述脚本文件移交到预设存储路径中,以便后续运行所述脚本文件;Upon receiving the handover instruction of the script file, the generated script file is handed over to the preset storage path for subsequent execution of the script file;
即,先将脚本文件移交至预设存储路径中,以便在所述存储路径中对脚本文件进行测试,避免在生成脚本文件的界面进行测试,从而对脚本文件的测试造成影响,从而提高了脚本文件测试的准确性。That is, the script file is first handed over to the preset storage path, so that the script file is tested in the storage path, and the test is not performed on the interface for generating the script file, thereby affecting the test of the script file, thereby improving the script. The accuracy of the document test.
需要说明的是,本领域普通技术人员可以理解实现上述实施例的全部或部分步骤可以通过硬件来完成,也可以通过程序来指令相关的硬件完成,所述的程序可以存储于一种计算机可读存储介质中,上述提到的存储介质可以是只读存储器,磁盘或光盘等。It should be noted that those skilled in the art can understand that all or part of the steps of implementing the above embodiments may be completed by hardware, or may be instructed by a program to execute related hardware, and the program may be stored in a computer readable state. In the storage medium, the above-mentioned storage medium may be a read only memory, a magnetic disk or an optical disk or the like.
本申请进一步提供一种脚本文件生成装置。The application further provides a script file generating apparatus.
参照图5,图5为本申请脚本文件生成装置100较佳实施例的功能模块示意图。Referring to FIG. 5, FIG. 5 is a schematic diagram of functional modules of a preferred embodiment of the script file generating apparatus 100 of the present application.
需要强调的是,对本领域的技术人员来说,图5所示功能模块图仅仅是一个较佳实施例的示例图,本领域的技术人员围绕图5所示的脚本文件生成装置100的功能模块,可轻易进行新的功能模块的补充;各功能模块的名称是自定义名称,仅用于辅助理解该脚本文件生成装置100的各个程序功能块,不用于限定本申请的技术方案,本申请技术方案的核心是,各自定义名称的功能模块所要达成的功能。It should be emphasized that, for those skilled in the art, the functional block diagram shown in FIG. 5 is merely an exemplary diagram of a preferred embodiment, and those skilled in the art surround the functional modules of the script file generating apparatus 100 shown in FIG. 5. The function modules of the present invention can be easily supplemented by the new function modules. The names of the function modules are used to assist in understanding the various program function blocks of the script file generating apparatus 100, and are not used to limit the technical solutions of the present application. At the heart of the solution is the functionality to be achieved by the functional modules that each define the name.
本实施例中,所述脚本文件生成装置100包括:In this embodiment, the script file generating apparatus 100 includes:
建立模块,用于接收到脚本文件的生成指令时,通过预设脚本生成工具在预设界面建立表格;定义模块,用于在建立的表格中定义配置信息;生成模块,用于根据所述表格中定义的配置信息,以及所述表格对应的脚本程序模板,生成脚本文件。Establishing a module, configured to: when the script generation instruction is received, create a table in the preset interface by using a preset script generation tool; define a module, configured to define configuration information in the established table; and generate a module, according to the table The configuration information defined in the template, and the script template corresponding to the table, generate a script file.
在本实施例中,所述脚本文件生成装置优选是终端通过预设的脚本生成工具实现的,所述脚本生成工具可以为DB(Database)工具,通过该脚本生成工具完成本申请的脚本文件生成过程。In this embodiment, the script file generating apparatus is preferably implemented by the terminal by using a preset script generating tool, and the script generating tool may be a DB (Database) tool, and the script file generating tool of the present application is completed by the script generating tool. process.
以下是本实施例中实现脚本文件生成的各个模块的具体功能:The following are the specific functions of each module that implements script file generation in this embodiment:
其中,建立模块10,用于接收到脚本文件的生成指令时,通过预设脚本生成工具在预设界面建立表格;The establishing module 10 is configured to: when receiving the generating instruction of the script file, create a table in the preset interface by using a preset script generating tool;
本实施例中,在接收到脚本文件的生成指令时,建立模块10通过预设脚本生成工具调用预设应用,以在所述预设应用的预设界面中建立表格,本实施例中,所述预设界面优选为Excel应用的界面,对应的,建立的表格就为Excel表格。In this embodiment, when the generating instruction of the script file is received, the establishing module 10 calls the preset application by using the preset script generating tool to create a table in the preset interface of the preset application. In this embodiment, the The preset interface is preferably an interface of an Excel application, and correspondingly, the created form is an Excel spreadsheet.
其中,定义模块20,用于在建立的表格中定义配置信息;Wherein, the definition module 20 is configured to define configuration information in the established table;
在预设界面中建立表格之后,定义模块20在建立的所述表格中定义配置信息,本实施例中,所述配置信息可以是终端系统自行定义的配置信息,也可以是终端系统和用户在表格中输入的配置信息共同定义的,具体需要定义哪些配置信息,根据实际情况而定。终端系统定义的配置信息是系统默认会定义好的,用户输入的配置信息是根据用户实际需要才输入的。优选地,在表格建立完成之后,若接收到用户输入的配置信息,即可将用户输入的配置信息以及终端系统的配置信息都定义到所述表格中,若未接收到用户输入的配置信息,则直接采用终端系统定义的配置信息。After the table is created in the preset interface, the definition module 20 defines the configuration information in the established table. In this embodiment, the configuration information may be configuration information defined by the terminal system, or may be the terminal system and the user. The configuration information entered in the table is defined together, and the specific configuration information needs to be defined, depending on the actual situation. The configuration information defined by the terminal system is defined by the system by default, and the configuration information input by the user is input according to the actual needs of the user. Preferably, after the form is established, if the configuration information input by the user is received, the configuration information input by the user and the configuration information of the terminal system can be defined into the table. If the configuration information input by the user is not received, The configuration information defined by the terminal system is directly adopted.
终端系统定义的信息包括:表格关联的数据库,表格中关联的标准授权文件;其中,数据库用来确定表格最终对应的脚本程序模板具体类型,标准授权文件用来确定脚本文件的生成规则,脚本文件生成规则主要包括:脚本文件中的字段长度、脚本文件的访问权限,如脚本文件是只能查看,不能增删,还是只能查看和增加内容不能删减等等。用户输入的配置信息包括:用户信息、同义词用户信息,触发器等等;其中,用户信息、同义词用户信息用来区分不同的用户,以对不同的用户授予不同的访问权限,触发器用来记录脚本文件的修改痕迹。当然,上述所提到的表格关联的数据库和标准授权文件,也可由用户根据实际需要进行修改。The information defined by the terminal system includes: a database associated with the table, and a standard authorization file associated with the table; wherein the database is used to determine the specific type of the script template corresponding to the form, and the standard authorization file is used to determine the generation rules of the script file, and the script file The generation rules mainly include: the length of the field in the script file and the access permission of the script file. For example, the script file can only be viewed, cannot be added or deleted, or can only be viewed and added, and cannot be deleted. The configuration information input by the user includes: user information, synonym user information, triggers, and the like; wherein the user information and the synonym user information are used to distinguish different users, to grant different access rights to different users, and the trigger is used to record the script. Traces of modifications to the file. Of course, the database and standard authorization file associated with the above mentioned table can also be modified by the user according to actual needs.
具体地,参照图6,所述定义模块20包括:Specifically, referring to FIG. 6, the definition module 20 includes:
关联单元21,用于在建立的表格中关联数据库;An association unit 21, configured to associate a database in the established table;
建立单元22,用于在所述表格中对关联的数据库建立用户信息以及同义词用户信息,以使不同的用户对应有不同的访问权限;及The establishing unit 22 is configured to establish user information and synonym user information in the table for the associated database, so that different users have different access rights;
创建单元23,用于在所述表格中创建触发器,以便后续基于创建的所述触发器记录脚本文件的修改痕迹。A creating unit 23 is configured to create a trigger in the table to record a modification trace of the script file based on the created trigger.
即,在建立表格之后,关联单元21将所述表格关联到预设数据库,本实施例中,系统一开始可以关联到默认的数据库,后续,还可根据实际需要进行增加,以关联到其它数据库,具体的增加方式可由用户在表格的预设区域中增加一个数据库的标识信息实现,以使表格关联到新的数据库,如:表格初始关联的数据库为LBS和ELIS,显示形式为:That is, after the table is created, the association unit 21 associates the table to the preset database. In this embodiment, the system may be associated with the default database at the beginning, and may be added according to actual needs to be associated with other databases. The specific addition method can be implemented by the user adding a database identification information in the preset area of the table, so that the table is associated with the new database. For example, the database initially associated with the table is LBS and ELIS, and the display form is:
数据库: LBS ELISDatabase: LBS ELIS
后续根据实际需要再增加多一个数据库d0lucd0,那么就需要在预设区域中对事先关联的数据库加多一个,即关联事先数据的操作为:Subsequent addition of one more database d0lucd0 according to actual needs, then it is necessary to add one more to the database associated in advance in the preset area, that is, the operation of associating the prior data is:
执行脚本数据库: LBSExecute the script database: LBS
ELIS ELIS
在预设区域中增加一个数据库时,操作就是:When adding a database to the default area, the operation is:
执行脚本数据库: LBSExecute the script database: LBS
ELIS ELIS
d0lucd0 D0lucd0
那么,最终得到的数据表格的显示形式就为:Then, the final form of the data table is displayed as:
数据库: LBS ELIS d0lucd0Database: LBS ELIS d0lucd0
应当理解的是,本实施例中的表格是规范化的表格,可以通过上文所提及的脚本生成工具映射为脚本程序模板,但是由于表格映射到的脚本程序模板是相同的,而要使后续生成的脚本文件各不相同,因此,通过所述表格关联的数据库,可以进一步确定所述表格对应的脚本程序模板,即表格关联不同的数据库,由于每个数据库中的属性信息不同,最终生成的脚本程序模板也会有所不同。本实施例中,一个表格可关联有多个数据库,最终可以得到多个脚本程序模板。It should be understood that the table in this embodiment is a normalized table, which can be mapped to a script template by using the script generation tool mentioned above, but since the script template to which the table is mapped is the same, The generated script files are different. Therefore, the script template corresponding to the table can be further determined by the database associated with the table, that is, the table is associated with different databases, and the attribute information generated in each database is different, and finally generated. The script template will also be different. In this embodiment, a table can be associated with multiple databases, and finally multiple script templates can be obtained.
将所述表格关联到预设数据库之后,建立单元22在所述表格中对关联的数据库建立用户信息以及同义词用户信息,对不同的用户进行授权,以使不同的用户对应有不同的访问权限。例如,开发者在通过表格开发脚本文件时,在某个数据库下设置的用户信息是“张生”,那么此时还设置一个同义词用户信息为“张三”,“张生”的权限是可以对这个表格中的具体数据进行查看增删修改,而“张三”是告诉其他用户进行访问的信息,如通知测试人员查看的用户信息,“张三”只有查看信息的权限,无法增删表格中的数据。应当理解,“张生”和“张三”是同一个对象,对同一个对象设置用户信息和同义词信息,并对用户信息和同义词信息设置不用的权项,使得开发人员和其它人员如测试人员对这个对象有两种不同的访问权项,实现对表格中数据的保护,防止其他人员改动表格中的数据,导致后续生成的脚本文件有误,保证了信息的安全性。After the table is associated with the preset database, the establishing unit 22 establishes user information and synonym user information for the associated database in the table, and authorizes different users so that different users have different access rights. For example, when a developer develops a script file through a form, the user information set under a certain database is “Zhang Sheng”, and then a synonym user information is set to “Zhang San”, and the “Zhang Sheng” permission is Viewing the specific data in this form, adding, deleting, and modifying, and "Zhang San" is information that tells other users to visit, such as the user information that informs the tester to view, "Zhang San" has the right to view information, and cannot add or delete the table. data. It should be understood that "Zhang Sheng" and "Zhang San" are the same object, setting user information and synonym information for the same object, and setting unused rights for user information and synonym information, so that developers and other personnel such as testers There are two different access rights for this object, which realizes the protection of the data in the table, prevents other people from changing the data in the table, and causes the script file generated subsequently to be incorrect, thus ensuring the security of the information.
此外,创建单元23还可在建立的表格中创建触发器,以便后续基于创建的所述触发器记录脚本文件的修改痕迹。本实施例中,对建立的表格中创建触发器,以便后续基于创建的所述触发器记录脚本文件的修改痕迹,每次修改的痕迹,以及具体修改的内容和修改时间,都可以被触发器记录,便于得知表格中数据的修改情况,更好作出分析。In addition, the creation unit 23 can also create a trigger in the created table to subsequently record the modification trace of the script file based on the created trigger. In this embodiment, a trigger is created in the created table, so that the modification trace of the script file is recorded based on the created trigger, and the trace of each modification, as well as the specific modified content and the modification time, can be triggered. Record, easy to know the modification of the data in the table, better analysis.
在建立的表格中定义配置信息之后,即可根据所述表格中关联的数据库,确定所述表格对应的脚本程序模板,并且完成对后续生成的脚本文件的相关信息的配置。After the configuration information is defined in the established table, the script template corresponding to the table may be determined according to the associated database in the table, and the configuration of the related information of the subsequently generated script file is completed.
其中,生成模块30,用于根据所述表格中定义的配置信息,以及所述表格对应的脚本程序模板,生成脚本文件。The generating module 30 is configured to generate a script file according to the configuration information defined in the table and the script program template corresponding to the table.
上文根据表格关联的数据库,已经得到脚本程序模板了,生成模块30再结合终端系统在表格中定义的配置信息以及用户输入的配置信息,将配置信息具体添加到脚本程序模板中,以生成脚本文件。The script template is obtained according to the database associated with the table. The generating module 30 further adds the configuration information to the script template in combination with the configuration information defined by the terminal system in the table and the configuration information input by the user to generate a script. file.
具体地,参照图7,所述生成模块30包括:Specifically, referring to FIG. 7, the generating module 30 includes:
提取单元31,用于在预设目录下存储的标准授权文件中提取脚本文件生成规则;The extracting unit 31 is configured to extract a script file generating rule from a standard authorization file stored in a preset directory;
生成单元32,用于根据提取的脚本文件生成规则、所述表格中定义的配置信息以及所述表格对应的脚本程序模板,生成脚本文件。The generating unit 32 is configured to generate a script file according to the extracted script file generation rule, the configuration information defined in the table, and the script program template corresponding to the table.
在本实施例中,在确定表格中定义的配置信息,表格对应的脚本程序模板之后,提取单元31还可进一步在预设目录下存储的标准授权文件中提取脚本文件的生成规则,如脚本文件是只是查看的,某些字段是固有不变,无法修改的等等,然后生成单元32根据提取的脚本文件的生成规则,以及表格中定义的配置信息以及所述皮标个对应的脚本程序模板,生成脚本文件。In this embodiment, after determining the configuration information defined in the table, the script template corresponding to the table, the extracting unit 31 may further extract the script file generation rule, such as a script file, from the standard authorization file stored in the preset directory. Is only view, some fields are inherently unchanged, can not be modified, and so on, and then the generating unit 32 according to the generated rules of the generated script file, and the configuration information defined in the table and the corresponding script template of the skin label , generate a script file.
进一步地,所述脚本文件生成装置还包括:Further, the script file generating apparatus further includes:
确定模块,用于在检测到标准授权文件的修改指令时,在所述预设目录中确定标准授权文件待修改的位置;a determining module, configured to determine, in the preset directory, a location where the standard authorization file is to be modified when the modification instruction of the standard authorization file is detected;
处理模块,用于用占位符替换确定的位置,并在确定的位置中添加新的脚本文件生成规则。A processing module that replaces the determined location with a placeholder and adds a new script file generation rule to the determined location.
本实施例提出的脚本文件生成装置100,接收到脚本文件的生成指令时,先通过预设脚本生成工具在预设界面建立表格,然后在建立的表格中定义配置信息,再根据所述表格中定义的配置信息,以及所述表格对应的脚本程序模板,生成脚本文件。使得脚本文件是由表格中的配置信息以及表格对应的脚本程序模板生成的,生成的脚本文件合乎规范,即使后续要修改脚本文件,只要修改表格中的配置信息即可,脚本程序模板中的代码片段无须再次编写,提高了脚本文件生成的效率和智能性。The script file generating apparatus 100 of the present embodiment firstly establishes a form in a preset interface by using a preset script generating tool when receiving a script file generating instruction, and then defines configuration information in the created form, and then according to the table. The defined configuration information, and the script template corresponding to the table, generates a script file. The script file is generated by the configuration information in the table and the script template corresponding to the table, and the generated script file conforms to the specification. Even if the script file is to be modified later, the configuration information in the table can be modified, and the code in the script template is Fragments do not need to be written again, improving the efficiency and intelligence of script file generation.
进一步地,基于第一实施例提出本申请脚本文件生成装置100的第二实施例,在本实施例中,参照图8,所述脚本文件生成装置100还包括:Further, a second embodiment of the script file generating apparatus 100 of the present application is proposed based on the first embodiment. In this embodiment, referring to FIG. 8, the script file generating apparatus 100 further includes:
调用模块40,用于在接收到脚本文件的运行指令时,调用所述表格关联的数据库以运行所述脚本文件,实现对所述脚本文件的测试;The calling module 40 is configured to, when receiving the running instruction of the script file, invoke the database associated with the table to run the script file to implement testing of the script file;
输出模块50,用于在检测到所述脚本文件有误时,输出提示信息,其中,输出提示信息的方式包括在表格中有误的位置输出,或者弹出提示窗口输出有误的信息。The output module 50 is configured to output prompt information when detecting that the script file is incorrect, wherein the manner of outputting the prompt information includes outputting in a position with an error in the table, or popping up the prompt window to output incorrect information.
在本实施例中,在接收到脚本文件的运行指令时,调用模块40先调用所述表格关联的数据库以运行所述脚本文件,即通过调用数据库,对数据库进行遍历以运行所述脚本文件,在检测到脚本文件的运行过程中没有报错,则认为生成的脚本文件准确,若检测到所述脚本文件有误,则输出模块50输出提示信息,以提示所述脚本文件有误,输出提示信息的方式,可以是在表格中有误的位置输出,还可以弹出提示窗口输出有误的信息。In this embodiment, upon receiving the running instruction of the script file, the calling module 40 first invokes the database associated with the table to run the script file, that is, by calling the database, traversing the database to run the script file, If no error is reported during the running of the script file, the generated script file is considered to be accurate. If the script file is detected to be incorrect, the output module 50 outputs the prompt information to prompt the script file to be incorrect, and output the prompt information. The way can be output in the wrong position in the table, and the prompt window can be displayed to output incorrect information.
本实施例中,为了保证对数据测试的准确性,所述装置包括:In this embodiment, in order to ensure the accuracy of the data test, the device includes:
移交模块,用于在接收到脚本文件的移交指令时,将生成的所述脚本文件移交到预设存储路径中,以便后续运行所述脚本文件;a handover module, configured to: when the handover instruction of the script file is received, hand over the generated script file to a preset storage path, so as to subsequently run the script file;
即,移交模块先将脚本文件移交至预设存储路径中,以便在所述存储路径中对脚本文件进行测试,避免在生成脚本文件的界面进行测试,从而对脚本文件的测试造成影响,从而提高了脚本文件测试的准确性。That is, the handover module first transfers the script file to the preset storage path, so as to test the script file in the storage path, avoiding testing on the interface for generating the script file, thereby affecting the test of the script file, thereby improving The accuracy of the script file test.
需要说明的是,在硬件实现上,以上建立模块10、定义模块20及生成模块30等可以以硬件形式内嵌于或独立于脚本文件生成装置中,也可以以软件形式存储于脚本文件生成装置的存储器中,以便于处理器调用执行以上各个模块对应的操作。该处理器可以为中央处理单元(CPU)、微处理器、单片机等。It should be noted that, in hardware implementation, the above establishing module 10, defining module 20, generating module 30, and the like may be embedded in or independent of the script file generating device in hardware form, or may be stored in the script file generating device in software form. In the memory, so that the processor calls to perform the operations corresponding to the above modules. The processor can be a central processing unit (CPU), a microprocessor, a microcontroller, or the like.
参照图9,图9是本申请实施例方案涉及的硬件运行环境的设备结构示意图。Referring to FIG. 9, FIG. 9 is a schematic structural diagram of a device in a hardware operating environment according to an embodiment of the present application.
本申请实施例脚本文件生成设备可以是PC,也可以是智能手机、平板电脑、便携计算机等具有显示功能的终端设备。The script file generating device in the embodiment of the present application may be a PC, or may be a terminal device having a display function, such as a smart phone, a tablet computer, or a portable computer.
如图9所示,该脚本文件生成设备可以包括:处理器1001,例如CPU,网络接口1002,用户接口1003,存储器1004。这些组件之间的连接通信可以通过通信总线实现。网络接口1002可选的可以包括标准的有线接口(用于连接有线网络)、无线接口(如WI-FI接口、蓝牙接口、红外线接口等,用于连接无线网络)。用户接口1003可以包括显示屏(Display)、输入单元比如键盘(Keyboard),可选用户接口1003还可以包括标准的有线接口(例如用于连接有线键盘、有线鼠标等)、无线接口(例如用于连接无线键盘、无线鼠标)。存储器1004可以是高速RAM存储器,也可以是稳定的存储器(non-volatile
memory),例如磁盘存储器。存储器1004可选的还可以是独立于前述处理器1001的存储装置。As shown in FIG. 9, the script file generating device may include a processor 1001, such as a CPU, a network interface 1002, a user interface 1003, and a memory 1004. Connection communication between these components can be achieved via a communication bus. The network interface 1002 may optionally include a standard wired interface (for connecting to a wired network), a wireless interface (such as a WI-FI interface, a Bluetooth interface, an infrared interface, etc. for connecting to a wireless network). The user interface 1003 may include a display, an input unit such as a keyboard, and the optional user interface 1003 may also include a standard wired interface (eg, for connecting a wired keyboard, a wired mouse, etc.), a wireless interface (eg, for Connect a wireless keyboard, wireless mouse). The memory 1004 may be a high speed RAM memory or a stable memory (non-volatile)
Memory), such as disk storage. The memory 1004 can also optionally be a storage device independent of the aforementioned processor 1001.
可选地,该脚本文件生成设备还可以包括摄像头、RF(Radio
Frequency,射频)电路,传感器、音频电路、WiFi模块等等。Optionally, the script file generating device may further include a camera, RF (Radio)
Frequency, RF) circuits, sensors, audio circuits, WiFi modules, and more.
本领域技术人员可以理解,图9中示出的脚本文件生成设备结构并不构成对脚本文件生成设备的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。It will be understood by those skilled in the art that the script file generating device structure shown in FIG. 9 does not constitute a limitation of the script file generating device, and may include more or less components than those illustrated, or combine some components, or different. Parts layout.
如图9所示,作为一种计算机存储介质的存储器1004中可以包括操作系统、网络通信模块、用户接口模块以及脚本文件生成程序。其中,操作系统是管理和控制脚本文件生成设备硬件与软件资源的程序,支持网络通信模块、用户接口模块、脚本文件生成程序以及其他程序或软件的运行;网络通信模块用于管理和控制网络接口1002;用户接口模块用于管理和控制用户接口1003。As shown in FIG. 9, an operating system, a network communication module, a user interface module, and a script file generation program may be included in the memory 1004 as a computer storage medium. The operating system is a program for managing and controlling the script file generation device hardware and software resources, and supports the operation of the network communication module, the user interface module, the script file generation program, and other programs or software; the network communication module is used to manage and control the network interface. 1002; a user interface module is used to manage and control the user interface 1003.
在图9所示的脚本文件生成设备中,处理器1001可以用于执行存储器1004中存储的脚本文件生成程序,以实现如上文所述的脚本文件生成方法的步骤。In the script file generating apparatus shown in FIG. 9, the processor 1001 can be used to execute a script file generating program stored in the memory 1004 to implement the steps of the script file generating method as described above.
本申请提供了一种计算机可读存储介质,所述计算机可读存储介质存储有脚本文件生成程序,所述脚本文件生成程序被处理器执行,以实现如上文所述的脚本文件生成方法的步骤。The present application provides a computer readable storage medium storing a script file generating program, the script file generating program being executed by a processor to implement the steps of the script file generating method as described above .
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其它变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其它要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。It is to be understood that the term "comprises", "comprising", or any other variants thereof, is intended to encompass a non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes those elements. It also includes other elements not explicitly listed, or elements that are inherent to such a process, method, article, or device. An element that is defined by the phrase "comprising a ..." does not exclude the presence of additional equivalent elements in the process, method, item, or device that comprises the element.
上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。The serial numbers of the embodiments of the present application are merely for the description, and do not represent the advantages and disadvantages of the embodiments.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,空调器,或者网络设备等)执行本申请各个实施例所述的方法。Through the description of the above embodiments, those skilled in the art can clearly understand that the foregoing embodiment method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be through hardware, but in many cases, the former is better. Implementation. Based on such understanding, the technical solution of the present application, which is essential or contributes to the prior art, may be embodied in the form of a software product stored in a storage medium (such as ROM/RAM, disk, The optical disc includes a number of instructions for causing a terminal device (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the methods described in various embodiments of the present application.
以上仅为本申请的优选实施例,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其它相关的技术领域,均同理包括在本申请的专利保护范围内。The above is only a preferred embodiment of the present application, and thus does not limit the scope of the patent application, and the equivalent structure or equivalent process transformation made by the specification and the drawings of the present application, or directly or indirectly applied to other related technical fields. The same is included in the scope of patent protection of this application.
Claims (20)
- 一种脚本文件生成方法,其特征在于,所述脚本文件生成方法包括: A script file generating method, wherein the script file generating method comprises:接收到脚本文件的生成指令时,通过预设脚本生成工具在预设界面建立表格;When receiving the generation instruction of the script file, the preset script generation tool creates a form on the preset interface;在建立的表格中定义配置信息;Define configuration information in the established form;根据所述表格中定义的配置信息,以及所述表格对应的脚本程序模板,生成脚本文件。A script file is generated according to the configuration information defined in the table and the script template corresponding to the table.
- 如权利要求1所述的脚本文件生成方法,其特征在于,所述在建立的表格中定义配置信息的步骤包括:The script file generating method according to claim 1, wherein the step of defining configuration information in the created table comprises:在建立的表格中关联数据库;Associate the database in the established form;在所述表格中对关联的数据库建立用户信息以及同义词用户信息,以使不同的用户对应有不同的访问权限;及User information and synonym user information are established in the table for the associated database, so that different users have different access rights;在所述表格中创建触发器,以便后续基于创建的所述触发器记录脚本文件的修改痕迹。A trigger is created in the table to subsequently record a modification trace of the script file based on the created trigger.
- 如权利要求2所述的脚本文件生成方法,其特征在于,所述根据所述表格中定义的配置信息,以及所述表格对应的脚本程序模板,生成脚本文件的步骤包括:The script file generating method according to claim 2, wherein the step of generating a script file according to the configuration information defined in the table and the script program template corresponding to the table comprises:在预设目录下存储的标准授权文件中提取脚本文件生成规则;Extracting a script file generation rule from a standard authorization file stored in a preset directory;根据提取的脚本文件生成规则、所述表格中定义的配置信息以及所述表格对应的脚本程序模板,生成脚本文件。A script file is generated according to the extracted script file generation rule, the configuration information defined in the table, and the script program template corresponding to the table.
- 如权利要求3所述的脚本文件生成方法,其特征在于,所述方法还包括:The method for generating a script file according to claim 3, wherein the method further comprises:在检测到标准授权文件的修改指令时,在所述预设目录中确定标准授权文件待修改的位置;When the modification instruction of the standard authorization file is detected, determining a location of the standard authorization file to be modified in the preset directory;用占位符替换确定的位置,并在确定的位置中添加新的脚本文件生成规则。Replace the determined location with a placeholder and add a new script file generation rule in the determined location.
- 如权利要求2所述的脚本文件生成方法,其特征在于,所述根据所述表格中定义的配置信息,以及所述表格对应的脚本程序模板,生成脚本文件的步骤之后,所述脚本文件生成方法还包括:The script file generating method according to claim 2, wherein the script file is generated after the step of generating a script file according to the configuration information defined in the table and the script program template corresponding to the table The method also includes:在接收到脚本文件的运行指令时,调用所述表格关联的数据库以运行所述脚本文件,实现对所述脚本文件的测试;Upon receiving the running instruction of the script file, calling the database associated with the table to run the script file to implement testing of the script file;在检测到所述脚本文件有误时,输出提示信息,其中,输出提示信息的方式包括在表格中有误的位置输出,或者弹出提示窗口输出有误的信息。 When it is detected that the script file is incorrect, the prompt information is output, wherein the manner of outputting the prompt information includes outputting in a position with an error in the table, or popping up the prompt window to output an incorrect information.
- 一种脚本文件生成装置,其特征在于,所述脚本文件生成装置包括:A script file generating apparatus, wherein the script file generating apparatus comprises:建立模块,用于接收到脚本文件的生成指令时,通过预设脚本生成工具在预设界面建立表格;Establishing a module, configured to create a table in a preset interface by using a preset script generation tool when receiving a script file generation instruction;定义模块,用于在建立的表格中定义配置信息;a definition module for defining configuration information in the created table;生成模块,用于根据所述表格中定义的配置信息,以及所述表格对应的脚本程序模板,生成脚本文件。And a generating module, configured to generate a script file according to the configuration information defined in the table, and the script program template corresponding to the table.
- 如权利要求6所述的脚本文件生成装置,其特征在于,所述定义模块包括:The script file generating apparatus according to claim 6, wherein the definition module comprises:关联单元,用于在建立的表格中关联数据库;An association unit for associating a database in the established table;建立单元,用于在所述表格中对关联的数据库建立用户信息以及同义词用户信息,以使不同的用户对应有不同的访问权限;及Establishing a unit for establishing user information and synonym user information in the table for the associated database, so that different users have different access rights;创建单元,用于在所述表格中创建触发器,以便后续基于创建的所述触发器记录脚本文件的修改痕迹。Creating a unit for creating a trigger in the table to subsequently record a modification trace of the script file based on the created trigger.
- 如权利要求7所述的脚本文件生成装置,其特征在于,所述生成模块包括:The script file generating apparatus according to claim 7, wherein the generating module comprises:提取单元,用于在预设目录下存储的标准授权文件中提取脚本文件生成规则;An extracting unit, configured to extract a script file generating rule from a standard authorization file stored in a preset directory;生成单元,用于根据提取的脚本文件生成规则、所述表格中定义的配置信息以及所述表格对应的脚本程序模板,生成脚本文件。And a generating unit, configured to generate a script file according to the extracted script file generation rule, the configuration information defined in the table, and the script program template corresponding to the table.
- 如权利要求8所述的脚本文件生成装置,其特征在于,所述装置还包括:The script file generating apparatus according to claim 8, wherein the apparatus further comprises:确定模块,用于在检测到标准授权文件的修改指令时,在所述预设目录中确定标准授权文件待修改的位置;a determining module, configured to determine, in the preset directory, a location where the standard authorization file is to be modified when the modification instruction of the standard authorization file is detected;处理模块,用于用占位符替换确定的位置,并在确定的位置中添加新的脚本文件生成规则。A processing module that replaces the determined location with a placeholder and adds a new script file generation rule to the determined location.
- 如权利要求7所述的脚本文件生成装置,其特征在于,所述脚本文件生成装置还包括:The script file generating apparatus according to claim 7, wherein the script file generating apparatus further comprises:调用模块,用于在接收到脚本文件的运行指令时,调用所述表格关联的数据库以运行所述脚本文件,实现对所述脚本文件的测试;Calling a module, when receiving a running instruction of the script file, calling a database associated with the table to run the script file to implement testing of the script file;输出模块,用于在检测到所述脚本文件有误时,输出提示信息,其中,输出提示信息的方式包括在表格中有误的位置输出,或者弹出提示窗口输出有误的信息。The output module is configured to output prompt information when detecting that the script file is incorrect, wherein the manner of outputting the prompt information includes outputting in a position with an error in the table, or popping up the prompt window to output an incorrect information.
- 一种脚本文件生成设备,其特征在于,所述脚本文件生成设备包括处理器、以及存储有脚本文件生成的程序的存储器;所述处理器用于执行所述脚本文件生成的程序,以实现以下步骤:A script file generating device, wherein the script file generating device includes a processor and a memory storing a program generated by the script file; the processor is configured to execute the program generated by the script file to implement the following steps :接收到脚本文件的生成指令时,通过预设脚本生成工具在预设界面建立表格;When receiving the generation instruction of the script file, the preset script generation tool creates a form on the preset interface;在建立的表格中定义配置信息;Define configuration information in the established form;根据所述表格中定义的配置信息,以及所述表格对应的脚本程序模板,生成脚本文件。A script file is generated according to the configuration information defined in the table and the script template corresponding to the table.
- 如权利要求11所述的脚本文件生成设备,其特征在于,所述处理器还用于执行所述脚本文件生成程序,以实现在建立的表格中定义配置信息的步骤:The script file generating apparatus according to claim 11, wherein the processor is further configured to execute the script file generating program to implement the step of defining configuration information in the created table:在建立的表格中关联数据库;Associate the database in the established form;在所述表格中对关联的数据库建立用户信息以及同义词用户信息,以使不同的用户对应有不同的访问权限;及User information and synonym user information are established in the table for the associated database, so that different users have different access rights;在所述表格中创建触发器,以便后续基于创建的所述触发器记录脚本文件的修改痕迹。A trigger is created in the table to subsequently record a modification trace of the script file based on the created trigger.
- 如权利要求12所述的脚本文件生成设备,其特征在于,所述处理器还用于执行所述脚本文件生成程序,以实现根据所述表格中定义的配置信息,以及所述表格对应的脚本程序模板,生成脚本文件的步骤:The script file generating device according to claim 12, wherein the processor is further configured to execute the script file generating program to implement configuration information according to the table and a script corresponding to the table. Program template, the steps to generate a script file:在预设目录下存储的标准授权文件中提取脚本文件生成规则;Extracting a script file generation rule from a standard authorization file stored in a preset directory;根据提取的脚本文件生成规则、所述表格中定义的配置信息以及所述表格对应的脚本程序模板,生成脚本文件。A script file is generated according to the extracted script file generation rule, the configuration information defined in the table, and the script program template corresponding to the table.
- 如权利要求13所述的脚本文件生成设备,其特征在于,所述处理器还用于执行所述脚本文件生成程序,以实现以下步骤:The script file generating device according to claim 13, wherein the processor is further configured to execute the script file generating program to implement the following steps:在检测到标准授权文件的修改指令时,在所述预设目录中确定标准授权文件待修改的位置;When the modification instruction of the standard authorization file is detected, determining a location of the standard authorization file to be modified in the preset directory;用占位符替换确定的位置,并在确定的位置中添加新的脚本文件生成规则。Replace the determined location with a placeholder and add a new script file generation rule in the determined location.
- 如权利要求12所述的脚本文件生成设备,其特征在于,所述根据所述表格中定义的配置信息,以及所述表格对应的脚本程序模板,生成脚本文件的步骤之后,所述处理器还用于执行所述脚本文件生成程序,以实现以下步骤:The script file generating device according to claim 12, wherein the processor further generates the script file according to the configuration information defined in the table and the script program template corresponding to the table. Used to execute the script file generation program to implement the following steps:在接收到脚本文件的运行指令时,调用所述表格关联的数据库以运行所述脚本文件,实现对所述脚本文件的测试;Upon receiving the running instruction of the script file, calling the database associated with the table to run the script file to implement testing of the script file;在检测到所述脚本文件有误时,输出提示信息,其中,输出提示信息的方式包括在表格中有误的位置输出,或者弹出提示窗口输出有误的信息。When it is detected that the script file is incorrect, the prompt information is output, wherein the manner of outputting the prompt information includes outputting in a position with an error in the table, or popping up the prompt window to output an incorrect information.
- 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储有脚本文件生成程序,所述脚本文件生成程序被处理器执行,以实现以下步骤:A computer readable storage medium, characterized in that the computer readable storage medium stores a script file generating program, the script file generating program being executed by a processor to implement the following steps:接收到脚本文件的生成指令时,通过预设脚本生成工具在预设界面建立表格;When receiving the generation instruction of the script file, the preset script generation tool creates a form on the preset interface;在建立的表格中定义配置信息;Define configuration information in the established form;根据所述表格中定义的配置信息,以及所述表格对应的脚本程序模板,生成脚本文件。A script file is generated according to the configuration information defined in the table and the script template corresponding to the table.
- 如权利要求16所述的计算机可读存储介质,其特征在于,所述脚本文件生成程序被处理器执行,还实现在建立的表格中定义配置信息的步骤:The computer readable storage medium of claim 16 wherein said script file generation program is executed by a processor and further implementing the step of defining configuration information in the created table:在建立的表格中关联数据库;Associate the database in the established form;在所述表格中对关联的数据库建立用户信息以及同义词用户信息,以使不同的用户对应有不同的访问权限;及User information and synonym user information are established in the table for the associated database, so that different users have different access rights;在所述表格中创建触发器,以便后续基于创建的所述触发器记录脚本文件的修改痕迹。A trigger is created in the table to subsequently record a modification trace of the script file based on the created trigger.
- 如权利要求17所述的计算机可读存储介质,其特征在于,所述脚本文件生成程序被处理器执行,还实现根据所述表格中定义的配置信息,以及所述表格对应的脚本程序模板,生成脚本文件的步骤:The computer readable storage medium according to claim 17, wherein said script file generating program is executed by a processor, and further implements configuration information defined in said table, and a script program template corresponding to said table, Steps to generate a script file:在预设目录下存储的标准授权文件中提取脚本文件生成规则;Extracting a script file generation rule from a standard authorization file stored in a preset directory;根据提取的脚本文件生成规则、所述表格中定义的配置信息以及所述表格对应的脚本程序模板,生成脚本文件。A script file is generated according to the extracted script file generation rule, the configuration information defined in the table, and the script program template corresponding to the table.
- 如权利要求18所述的计算机可读存储介质,其特征在于,所述脚本文件生成程序被处理器执行,还实现以下步骤:The computer readable storage medium of claim 18, wherein the script file generation program is executed by a processor, further implementing the following steps:在检测到标准授权文件的修改指令时,在所述预设目录中确定标准授权文件待修改的位置;When the modification instruction of the standard authorization file is detected, determining a location of the standard authorization file to be modified in the preset directory;用占位符替换确定的位置,并在确定的位置中添加新的脚本文件生成规则。Replace the determined location with a placeholder and add a new script file generation rule in the determined location.
- 如权利要求17所述的计算机可读存储介质,其特征在于,所述根据所述表格中定义的配置信息,以及所述表格对应的脚本程序模板,生成脚本文件的步骤之后,所述脚本文件生成程序被处理器执行,还实现以下步骤:The computer readable storage medium according to claim 17, wherein said script file is generated after said step of generating a script file according to configuration information defined in said table and said script template corresponding to said table The generator is executed by the processor and the following steps are implemented:在接收到脚本文件的运行指令时,调用所述表格关联的数据库以运行所述脚本文件,实现对所述脚本文件的测试;Upon receiving the running instruction of the script file, calling the database associated with the table to run the script file to implement testing of the script file;在检测到所述脚本文件有误时,输出提示信息,其中,输出提示信息的方式包括在表格中有误的位置输出,或者弹出提示窗口输出有误的信息。 When it is detected that the script file is incorrect, the prompt information is output, wherein the manner of outputting the prompt information includes outputting in a position with an error in the table, or popping up the prompt window to output an incorrect information.
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710243035.1A CN107688593A (en) | 2017-04-13 | 2017-04-13 | Script file generation method and device |
CN201710243035.1 | 2017-04-13 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2018188342A1 true WO2018188342A1 (en) | 2018-10-18 |
Family
ID=61152434
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2017/111881 WO2018188342A1 (en) | 2017-04-13 | 2017-11-20 | Method, apparatus and device for generating script file, and computer-readable storage medium |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN107688593A (en) |
WO (1) | WO2018188342A1 (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112351104A (en) * | 2020-11-11 | 2021-02-09 | 光大兴陇信托有限责任公司 | Proxy server function extension method and system based on script engine |
CN112433705A (en) * | 2020-11-25 | 2021-03-02 | 平安普惠企业管理有限公司 | Script generation method and device, electronic equipment and storage medium |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109032582A (en) * | 2018-07-19 | 2018-12-18 | 郑州云海信息技术有限公司 | A kind of method and device generating server O&M script |
CN110347985B (en) * | 2019-05-30 | 2023-07-28 | 平安科技(深圳)有限公司 | Method, device, computer equipment and storage medium for generating table |
CN110505088B (en) * | 2019-08-20 | 2021-07-27 | 北京市燃气集团有限责任公司 | Storage authorization change method and device |
CN111008346A (en) * | 2019-11-13 | 2020-04-14 | 苏宁云计算有限公司 | Data acquisition method and device |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20040254914A1 (en) * | 2003-06-10 | 2004-12-16 | Polizzi Nicholas P. | Script generator for automating system administration operations |
CN102135990A (en) * | 2011-03-11 | 2011-07-27 | 北京神舟航天软件技术有限公司 | Java server page (JSP) template-based intelligent table system capable of being defined freely and generating method |
CN102541730A (en) * | 2011-12-08 | 2012-07-04 | 北京空间飞行器总体设计部 | Semantic identification and automatic generation method for spacecraft test script |
CN105740368A (en) * | 2016-01-27 | 2016-07-06 | 浪潮通信信息系统有限公司 | Method and device for generating report form |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN100361127C (en) * | 2004-11-01 | 2008-01-09 | 华为技术有限公司 | Automatic generation system and method for script file |
CN102446090B (en) * | 2010-10-09 | 2014-01-29 | 金蝶软件(中国)有限公司 | Method and device for automatically generating test script |
US10417314B2 (en) * | 2012-06-14 | 2019-09-17 | Open Text Sa Ulc | Systems and methods of a script generation engine |
CN105279090B (en) * | 2015-11-17 | 2018-07-03 | 中国建设银行股份有限公司 | Test script generation method and device applied to financial field |
CN106126215B (en) * | 2016-06-17 | 2019-06-21 | 深圳市麦斯杰网络有限公司 | Business rule scenario generation method and device |
-
2017
- 2017-04-13 CN CN201710243035.1A patent/CN107688593A/en active Pending
- 2017-11-20 WO PCT/CN2017/111881 patent/WO2018188342A1/en active Application Filing
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20040254914A1 (en) * | 2003-06-10 | 2004-12-16 | Polizzi Nicholas P. | Script generator for automating system administration operations |
CN102135990A (en) * | 2011-03-11 | 2011-07-27 | 北京神舟航天软件技术有限公司 | Java server page (JSP) template-based intelligent table system capable of being defined freely and generating method |
CN102541730A (en) * | 2011-12-08 | 2012-07-04 | 北京空间飞行器总体设计部 | Semantic identification and automatic generation method for spacecraft test script |
CN105740368A (en) * | 2016-01-27 | 2016-07-06 | 浪潮通信信息系统有限公司 | Method and device for generating report form |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112351104A (en) * | 2020-11-11 | 2021-02-09 | 光大兴陇信托有限责任公司 | Proxy server function extension method and system based on script engine |
CN112351104B (en) * | 2020-11-11 | 2021-09-10 | 光大兴陇信托有限责任公司 | Proxy server function extension method and system based on script engine |
CN112433705A (en) * | 2020-11-25 | 2021-03-02 | 平安普惠企业管理有限公司 | Script generation method and device, electronic equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN107688593A (en) | 2018-02-13 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2018188342A1 (en) | Method, apparatus and device for generating script file, and computer-readable storage medium | |
WO2018107610A1 (en) | Service data processing method, system and device, and computer-readable storage medium | |
WO2018120429A1 (en) | Resource update method, terminal, computer readable storage medium and resource update device | |
WO2017143692A1 (en) | Smart television and voice control method therefor | |
WO2018120457A1 (en) | Data processing method, apparatus, device, and computer readable storage medium | |
WO2014011000A1 (en) | Method and apparatus for controlling application by handwriting image recognition | |
WO2019000800A1 (en) | Credential preparation method, apparatus, and device and computer readable storage medium | |
WO2019104876A1 (en) | Insurance product pushing method and system, terminal, client terminal, and storage medium | |
WO2017148112A1 (en) | Fingerprint entry method, and terminal | |
WO2018082482A1 (en) | Network sharing method, and method and system for accessing network | |
WO2019024219A1 (en) | Automatic document generation method and apparatus, automatic document generator and medium | |
WO2018205545A1 (en) | Data generation method, apparatus, terminal, and computer-readable storage medium | |
WO2019196213A1 (en) | Interface test method, apparatus and device, and computer-readable storage medium | |
WO2019037396A1 (en) | Account clearing method, device and equipment and storage medium | |
WO2018149190A1 (en) | Component debugging method, device and apparatus, and computer readable storage medium | |
WO2017054592A1 (en) | Interface display method and terminal | |
WO2013127233A1 (en) | Cellphone-based key unlocking method and cellphone | |
WO2018188196A1 (en) | Data version control method, data version controller, device and computer-readable storage medium | |
WO2019114262A1 (en) | User interface loading method, smart television and computer-readable storage medium | |
WO2019000801A1 (en) | Data synchronization method, apparatus, and device, and computer readable storage medium | |
WO2019169814A1 (en) | Method, apparatus and device for automatically generating chinese annotation, and storage medium | |
WO2019109521A1 (en) | Identity approval method, apparatus and device for video interview, and readable storage medium | |
WO2019001087A1 (en) | Case claim method, device, server and computer readable storage medium | |
WO2019041851A1 (en) | Home appliance after-sales consulting method, electronic device and computer-readable storage medium | |
WO2018076875A1 (en) | Backup data synchronisation method, apparatus, storage medium, electronic device, and server |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 17905055 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
32PN | Ep: public notification in the ep bulletin as address of the adressee cannot be established |
Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 15/01/2020) |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 17905055 Country of ref document: EP Kind code of ref document: A1 |