WO2019127837A1 - 建表脚本生成方法、装置、设备及计算机可读存储介质 - Google Patents

建表脚本生成方法、装置、设备及计算机可读存储介质 Download PDF

Info

Publication number
WO2019127837A1
WO2019127837A1 PCT/CN2018/074997 CN2018074997W WO2019127837A1 WO 2019127837 A1 WO2019127837 A1 WO 2019127837A1 CN 2018074997 W CN2018074997 W CN 2018074997W WO 2019127837 A1 WO2019127837 A1 WO 2019127837A1
Authority
WO
WIPO (PCT)
Prior art keywords
script
identifier
setting
generating
table creation
Prior art date
Application number
PCT/CN2018/074997
Other languages
English (en)
French (fr)
Inventor
易周成
Original Assignee
平安科技(深圳)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2019127837A1 publication Critical patent/WO2019127837A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/242Query formulation
    • G06F16/2433Query languages
    • G06F16/2443Stored procedures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures

Definitions

  • the present application relates to the field of computer application technologies, and in particular, to a method, device, device and computer readable storage medium for generating a table creation script.
  • a database is a repository of data organized, stored, and managed on a computer storage device in accordance with a data structure that includes a large number of data tables for storing data.
  • the data tables in the database are created by the developers manually scripting, but due to the huge number of data tables and the differences in the level of different developers, there may be problems in writing scripts or scripts that are not standardized, and need to be manually re-manualized. Adjust the correction. This process of manually writing or adjusting the build script requires a lot of time, which results in low efficiency of the build script, and the error probability of manual writing is large and the intelligence is poor.
  • the main purpose of the present application is to provide a method, an apparatus, a device, and a computer readable storage medium for creating a table script, which aim to solve the problem of low efficiency of generating a table script in the prior art and a large error probability.
  • the present application provides a method for generating a table creation script, and the method for generating a table creation script includes the following steps:
  • the step of determining a script program template according to the respective identifiers and the setting instruction, and calling a plurality of parameter groups corresponding to the identifiers based on the script program template, the step of generating the table construction script includes:
  • the script template is called to read a plurality of parameter groups corresponding to the identifiers in the table frame to generate a table creation script.
  • the calling script template reads a plurality of parameter groups corresponding to the identifiers in the table frame
  • the step of generating the table construction script comprises:
  • the identifier includes a field name, a field description, a field type, a null attribute, a primary key, an index, and a comment;
  • the step of acquiring each identifier in the table frame of the terminal preset interface and the plurality of parameter groups corresponding to the identifier includes:
  • a configuration instruction Receiving, by the terminal preset interface, a configuration instruction, and configuring, according to the configuration instruction, an identifier including a field name, a field description, a field type, a null attribute, a primary key, an index, and a comment, and a plurality of sets of parameters corresponding to the identifier;
  • the identifier and the plurality of sets of parameters corresponding to the identifier are associated to form a table frame.
  • the options of the script setting interface include a universal setting option and a script setting option
  • the setting instruction includes a first setting instruction and a second setting instruction
  • the step of receiving the setting instruction sent by the user based on the option of the script setting interface includes:
  • a second setting instruction for the script setting option is received to perform the characteristic setting of the table creation script.
  • the step of the script-based template calling the plurality of sets of parameters corresponding to the identifier, after the step of generating the form-building script comprises:
  • the generated build script is stored in the storage location, and when receiving the query instruction, jumps to the storage location of the storage build script, and displays the build script.
  • the step of the script-based template calling a plurality of parameter groups corresponding to the identifier, after the step of generating the table-building script comprises:
  • the state of each parameter group is generated one by one according to the order of each parameter group, and the state is displayed;
  • the alarm group corresponding to the failure status is alerted.
  • the present application further provides a table creation script generating apparatus, where the table creation script generating apparatus includes:
  • An obtaining module configured to acquire each identifier in a table frame of the terminal preset interface and a plurality of parameter groups corresponding to the identifier
  • a jump module configured to jump to the script setting interface, and receive a setting instruction sent by the user according to an option of the script setting interface
  • a generating module configured to determine a script program template according to the each identifier and the setting instruction, and generate a table building script by calling a plurality of parameter groups corresponding to the identifier based on the script program template.
  • the present application further provides a table creation script generation device, where the table creation script generation device includes: a memory, a processor, a communication bus, and a table creation script generation program stored on the memory;
  • the communication bus is used to implement connection communication between a processor and a memory
  • the processor is configured to execute the table creation script generating program to implement the following steps:
  • the present application also provides a computer readable storage medium storing one or more programs, the one or more programs being configurable by one or more processors Execute for:
  • the method for generating a table creation script obtain each identifier in the table frame of the terminal preset interface and a plurality of parameter groups corresponding to the identifier; and jump to the script setting interface And receiving a setting instruction sent by the user based on an option of the script setting interface; determining a script program template according to each identifier and a setting instruction, thereby generating a table creation script based on the script template template calling a plurality of parameter groups corresponding to the identifier .
  • the program generates a script program template by using various identifiers and setting instructions in the terminal preset interface table framework, so that the table creation script can be automatically generated by calling the script program template, and the developer does not need to manually write the table creation script, thereby avoiding human error.
  • the script error reduces the probability of error, makes the generated table-building script conform to the specification, and improves the generation efficiency.
  • FIG. 1 is a schematic flowchart of a first embodiment of a method for generating a table creation script according to the present application
  • FIG. 2 is a schematic flowchart of a second embodiment of a method for generating a table creation script according to the present application
  • FIG. 3 is a schematic flowchart of a third embodiment of a method for generating a table creation script according to the present application
  • FIG. 4 is a schematic diagram of functional modules of a first embodiment of a table creation script generating apparatus of the present application
  • FIG. 5 is a schematic structural diagram of a device in a hardware operating environment involved in a method according to an embodiment of the present application
  • FIG. 6 is a schematic diagram of a table frame of a method for generating a table creation script of the present application
  • FIG. 7 is a schematic diagram of a script setting interface of a table creation script generation method of the present application.
  • FIG. 8 is a table construction script generated by the method for generating a table creation script of the present application.
  • the application provides a method for generating a table creation script.
  • FIG. 1 is a schematic flowchart diagram of a first embodiment of a method for generating a table creation script according to the present application.
  • the method for generating a table creation script includes:
  • Step S10 Obtain each identifier in the table frame of the terminal preset interface and a plurality of parameter groups corresponding to the identifier;
  • the table creation script generation method of this embodiment is applicable to a table creation script for generating a database table for storing data in a database.
  • a database is a repository built on a computer storage device that organizes, stores, and manages data according to a data structure. It is stored in a computer for a long time, and is an organized, shareable collection of data. Data is organized, described and stored together in a certain data model, with the least possible redundancy, high data independence and scalability, and can be shared by multiple users within a certain range.
  • the data is stored in a data table of the database, which is a structured file, referred to as a table, in the form of "rows" and "columns".
  • Each record in the table consists of a number of fields; each column in the table is a field, and each field has corresponding description information, such as data type, data width, etc., and the data table is established by a program script.
  • a table creation script is generated according to each identifier in the table frame of the obtained terminal preset interface and a plurality of parameter groups corresponding to the identifier, and needs to be established for representation before acquiring each identifier and corresponding parameter in the table frame.
  • a table framework that creates attributes for each column in the data table.
  • the table frame represents the column attributes in the created data table by identifiers, including the field name, field description, field type, null attribute, primary key, index, and comments.
  • a plurality of identifiers, the set of parameter values corresponding to the plurality of identifiers characterizing column attributes of the created data table.
  • Step q1 Receive a configuration instruction on the terminal preset interface, and configure, according to the configuration instruction, an identifier including a field name, a field description, a field type, a null attribute, a primary key, an index, and a comment, and multiple groups corresponding to the identifier parameter;
  • step q2 the identifier and the plurality of sets of parameters corresponding to the identifier are associated to form a table frame.
  • the terminal may be a tablet computer, a mobile computer, etc.
  • the terminal preset interface is an editing interface of the EXCEL table.
  • This editing operation is the configuration instruction, and the edited field name, Field descriptions, field types, null attributes, primary keys, indexes, and comments are the individual identifiers for the table frame.
  • parameters corresponding to each of the field name, field description, field type, null attribute, primary key, index, and comment are configured to represent the attributes of a column in the created data table.
  • the terminal preset interface receives an editing operation as a configuration instruction, edits an identifier including a field name, a field description, a field type, a null value attribute, a primary key, an index, and a comment, and a plurality of parameters corresponding to the identifier according to the editing operation. group.
  • the data table created by the table creation script includes 4 columns, and the 4 columns are JOB_GROP, JOB_NAME, STATUS, and RESULT_INFO, respectively, and the identifiers for indicating the attributes of each column include: field description, Field type, null attribute, primary key, index, and comment.
  • the field names are JOB_GROP, JOB_NAME, STATUS, and RESULT_INFO;
  • the field description, field type, null attribute, primary key, index, and comment corresponding to the first column JOB_GROP are: job group name, VARCHAR2(32), N, empty Value, null, and null;
  • the field description, field type, null attribute, primary key, index, and comment corresponding to the second column JOB_NAME are: job group name, VARCHAR2(32), N, null, null, and Null value;
  • the field description, field type, null attribute, primary key, index, and comment corresponding to the third column STATUS are: state 0 - failure, 1-success, VARCHAR2 (22), N, null, null, and Null value;
  • the field description, field type, null attribute, primary key, index, and comment corresponding to the fourth column RESULT_INFO are: result information, VARCHAR2(300), N, null, nu
  • the table frame is formed on the terminal preset interface. Obtaining each identifier in the terminal preset interface table frame and a plurality of parameter groups corresponding to the respective identifiers, and generating a table construction script by using the respective identifiers and the corresponding plurality of parameter groups.
  • Step S20 jumping to the script setting interface, and receiving a setting instruction sent by the user based on the option of the script setting interface;
  • the system jumps to the script setting interface to set the generation of the table creation script.
  • the terminal preset interface is the EXCEL table editing interface
  • the table frame can be established in one sheet, and the script setting interface is established in another sheet.
  • the table frame only needs to edit the column information required to create the data table in the sheet cell; and the script setting interface includes the setting operation of the generated table creation script, which is generated by EXCEL VBA editing, VBA (Visual Basic For Applications) It is a programming language developed by Microsoft to perform general automation (OLE) tasks in its desktop applications.
  • VBA requires a host application to travel (it needs to be run under software such as EXCEL), which automates common processes or processes, and can create custom solutions for customizing existing desktop applications.
  • the VBA editing script setting interface is run on the basis of the EXCEL running.
  • the script setting interface has an option for generating a built-in script, and the user selects an option according to the requirement thereof, and receives the option that the user sends based on the script setting interface.
  • When setting the instruction When setting the instruction, generate a table creation script that meets the user's requirements according to this setting instruction.
  • the options of the script setting interface include a common setting option and a script setting option
  • the setting instruction includes a first setting instruction and a second setting instruction, so that the step of receiving the setting instruction sent by the user based on the option of the script setting interface comprises:
  • Step S21 receiving a first setting instruction for the universal setting option to determine a storage location of the built-in script
  • Step S22 receiving a second setting instruction for the script setting option to perform characteristic setting of the table building script.
  • the options of the script setting interface of this embodiment include a common setting option and a script setting option, the common setting option is used to set the storage address of the generated table creation script, and the script setting option is used to set the characteristics of the generated table creation script.
  • the universal setting option includes a display box and two virtual buttons.
  • the setting instruction corresponding to the common setting is a first setting instruction, and the display box is used to display a storage address of the generated script file, and the two virtual buttons are respectively selected.
  • Directory and open directory The select directory virtual button is used to select the storage address of the generated script file, and the selected storage address is displayed in the display box, and the open directory virtual button is used to open the storage location of the storage table creation script.
  • the folder of the D disk can be opened by opening the directory virtual button, and the generated table creation script is performed. display.
  • the script setting option is used to implement the special requirements of the user for the generated table creation script
  • the corresponding setting instruction is the second setting instruction, which includes: generating a table creation script, creating a primary key, creating an index, creating a synonym, generating an authorization script, and generating Roll back scripts and other options.
  • the second setup command is only selected to generate the build script option, and when the user has other requirements, such as the need to generate the authorization script, the corresponding second setup command is selected to generate the authorization.
  • the script setting interface further includes a virtual button for triggering the generation of the table creation script.
  • the virtual button When the virtual button is triggered, the user has the requirement to generate a table creation script, thereby starting to generate the table creation script operation.
  • the user by jumping to the script setting interface, the user selects settings according to his needs, and receives a setting instruction sent by the user based on the option of the script setting interface, to generate a table-building script that meets the user's requirements according to the setting instruction.
  • Step S30 determining a script program template according to the respective identifiers and setting instructions, and invoking a plurality of parameter groups corresponding to the identifiers based on the script program template to generate a table construction script.
  • determining a script template for generating a script program and calling a plurality of parameter groups corresponding to the identifier based on the script program template Generate a build script that meets the user's needs.
  • the steps for determining the script template and generating the build script include:
  • Step S31 acquiring a preset script program template according to each identifier, and adjusting the preset script program template according to the setting instruction, and determining the script program template;
  • Step S32 calling the script program template to read a plurality of parameter groups corresponding to the identifiers in the table frame, and generating a table construction script.
  • a script template is set, and a table creation script is generated by calling a script template to read a plurality of corresponding parameter groups in the table frame and the identifier.
  • the generated table creation scripts also have corresponding differences. If the same script template is used, the difference requirements are not met. Therefore, in this embodiment, the preset script program template is obtained according to each identifier, and each identifier represents a column attribute in the data table, so that a preset script program template is set to obtain the preset script program template in order to implement the column attribute;
  • the preset script template is adjusted according to the difference of the setting instructions of the script setting interface to obtain a script template conforming to each identifier and the setting instruction.
  • the script program in the script template is called to read a plurality of parameter groups corresponding to the identifiers in the table frame to generate a table construction script.
  • the start of the script program read operation can be set by the program, such as setting the table frame from the third sheet of the EXCEL table, and setting the table frame in the sheet when reading the sheet from the sheet.
  • the second row and the second column start can also be automatically read, when there is no data in the sheet table, the value read is empty; when there is data, the value read is not empty, will be read for the first time Go to the row and column of the data as the starting point for the read.
  • All the parameters corresponding to the identifier in the table frame are read from the beginning by the script program template to generate a table-building script, and the table-building script generated corresponding to the table frame shown in FIG. 6 is shown in FIG. 8.
  • This embodiment can establish different table frameworks for different build scripts that need to be generated, such as establishing a table of a student information table, a table of a student cost table, and the like, by calling a program script template to identify identifiers in different table frames.
  • a plurality of parameter groups are generated to generate a table creation script, so that the developer can write each of the table creation scripts, thereby improving the generation efficiency and the correct rate of the table creation script.
  • the method for generating a table creation script of the embodiment obtains each identifier in the table frame of the terminal preset interface and a plurality of parameter groups corresponding to the identifier; jumps to the script setting interface, and receives an option of the user setting interface based on the script Sending a setting instruction; determining a script program template according to each identifier and a setting instruction, thereby generating a table building script by calling a plurality of parameter groups corresponding to the identifier based on the script program template.
  • the program generates a script program template by using various identifiers and setting instructions in the terminal preset interface table framework, so that the table creation script can be automatically generated by calling the script program template, and the developer does not need to manually write the table creation script, thereby avoiding human error.
  • the script error reduces the probability of error, makes the generated table-building script conform to the specification, and improves the generation efficiency.
  • the calling script template reads a plurality of parameter groups corresponding to the identifier in the table frame, and the step of generating the table creation script includes:
  • Step S321 performing lexical analysis and syntax analysis on each parameter in the plurality of parameter groups to obtain a lexical analysis result and a syntax analysis result;
  • Step S322 when the lexical analysis result and the grammar parsing result respectively conform to the preset lexical rule and the preset grammar rule, the plurality of parameter groups corresponding to the identifier in the table frame are read, and the table construction script is generated.
  • lexical analysis and syntax analysis are performed on each parameter in each parameter group, so that each parameter is determined by the lexical analysis and the syntax analysis.
  • Generate rules The lexical analysis is to scan the parameters and identify the parameters according to the word formation rules; the grammar analysis combines the parameters to form various grammatical phrases, such as "program”, "statement”, "expression”, etc. on the basis of lexical analysis.
  • a preset lexical rule and a preset grammar rule for determining whether each parameter meets the generation rule are set, and the lexical analysis result obtained by the lexical analysis is compared with the preset lexical rule to determine whether each parameter conforms to the preset lexical method.
  • Rule comparing the parsed result obtained by the parsing with the preset grammar rule to determine whether each parameter conforms to the preset grammar rule, and when conforming to the preset lexical rule and the preset grammar rule, indicating that the conforming script is generated Rules, thereby reading a plurality of parameter groups corresponding to the identifiers in the table frame, and generating a table construction script.
  • a second embodiment of the method for generating a script for creating a table of the present application is proposed.
  • the script is called based on a script template.
  • the parameter group corresponding to the identifier includes:
  • Step S40 Store the generated table creation script in the storage location, and when receiving the query instruction, jump to the storage location of the storage table creation script, and display the table creation script.
  • the build script is stored in the storage location set in the script setup interface.
  • the query instruction for the built-in script is received, the jump to the storage location of the storage build script is performed, and the build script is displayed.
  • the query instruction can be triggered by the open directory virtual button in the script setting interface, and the directory link is to the storage location of the built-in script, such as a storage folder; the generated build script can be a TXT text, and the display is a content of the TXT text. Display.
  • a third embodiment of the method for generating a script for creating a table of the present application is proposed.
  • the script is called based on a script template.
  • the parameter group corresponding to the identifier includes:
  • Step S50 when receiving the display execution parameter instruction, acquiring the state of each parameter group generation table creation script one by one according to the order of each parameter group, and displaying the state;
  • step S60 when the state of the parameter group generating the table creation script is a failure, an alarm is given to the parameter group corresponding to the failure state.
  • the script setting interface of the embodiment is provided with a virtual button for displaying an instruction parameter, which can be used to display the execution process of generating the table creation script.
  • the state of each parameter group is generated one by one according to the sequence of the plurality of parameter groups corresponding to each identifier in the table frame, wherein the generation of the table creation script is generated.
  • the status of the table script includes two states of failure and success, and the obtained failed or successful status is displayed, and the displayed position can be in a blank area in the script setting interface. If the status of the parameter creation script is failed, the parameter group corresponding to the failure status is determined, and an alarm is generated for the parameter group.
  • the parameter group of the failed state is displayed in color difference.
  • the parameter group corresponding to each identifier is A, B, C, and D.
  • the status of the four sets of parameters to generate the table creation script is: the status of parameter group A, B, and D is successful, and the status of parameter group C is failure.
  • the parameter groups A, B, and D are displayed in black, and the parameter group C is displayed in red. The user can know the generated parameter group by alarming by displaying the displayed status.
  • the corresponding parameter group is optimized to ensure the successful generation of the build script.
  • a fourth embodiment of the method for generating a script for creating a table of the present application is proposed.
  • the script-based template is called to correspond to an identifier.
  • the steps to generate a table creation script include:
  • Step S70 Acquire a table-building script, and send the obtained table-building script to the associated upper-level database script, so that the upper-level database script executes the table-building script to establish a data table.
  • the build script is obtained, and the obtained build script is sent to the upper database script associated with it, and the upper database script executes the build script, creates and builds the script.
  • Corresponding data table If the generated table creation script is used to establish an employee information table, the employee information table includes a name, a gender, and an age; the generated table creation script is a script related to the column of the employee information table, and is used according to the script for creating Create a table of employee information related to the employee information table and establish an employee information table.
  • the correct rate of the table creation script can be improved, so that when the data table is created according to the table creation script, the correct rate of creating the data table can be improved accordingly.
  • the application provides a table-building script generating apparatus.
  • the table-building script generating apparatus includes:
  • the obtaining module 10 is configured to acquire each identifier in a table frame of the terminal preset interface and a plurality of parameter groups corresponding to the identifier;
  • the jump module 20 is configured to jump to the script setting interface, and receive a setting instruction sent by the user according to an option of the script setting interface;
  • the generating module 30 is configured to determine a script program template according to the each identifier and the setting instruction, and generate a table building script by calling a plurality of parameter groups corresponding to the identifier based on the script program template.
  • the above-mentioned storage medium may be a read only memory, a magnetic disk or an optical disk or the like.
  • FIG. 5 is a schematic structural diagram of a device in a hardware operating environment involved in a method according to an embodiment of the present application.
  • the built-in script generating device in the embodiment of the present application may be a PC, or may be a terminal device such as a smart phone, a tablet computer, an e-book reader, or a portable computer.
  • the table creation script generating device may include a processor 1001, such as a CPU, a memory 1005, and a communication bus 1002.
  • the communication bus 1002 is used to implement connection communication between the processor 1001 and the memory 1005.
  • the memory 1005 may be a high speed RAM memory or a stable memory (non-volatile) Memory), such as disk storage.
  • the memory 1005 can also optionally be a storage device independent of the aforementioned processor 1001.
  • the table creation script generating device may further include a user interface, a network interface, a camera, and an RF (Radio) Frequency, RF) circuits, sensors, audio circuits, WiFi modules, and more.
  • the user interface may include a display, an input unit such as a keyboard, and the optional user interface may also include a standard wired interface, a wireless interface.
  • the network interface can optionally include a standard wired interface or a wireless interface (such as a WI-FI interface).
  • the structure of the built-in script generating device shown in FIG. 5 does not constitute a limitation on the built-in script generating device, and may include more or less components than the illustrated ones, or combine some components. Or different parts arrangement.
  • an operating system As shown in FIG. 5, an operating system, a network communication module, and a table creation script generation program may be included in the memory 1005 as a computer storage medium.
  • the operating system is a program that manages and controls the build script to generate device hardware and software resources, and supports the running of the build script generation program and other software and/or programs.
  • the network communication module is used to implement communication between components within the memory 1005 and to communicate with other hardware and software in the built-in script generation device.
  • the processor 1001 is configured to execute the table creation script generation program stored in the memory 1005, and implement the steps in the embodiments of the above table creation script generation method.
  • the application provides a computer readable storage medium storing one or more programs, the one or more programs being further executable by one or more processors for implementing the above The steps in the various embodiments of the table creation method.
  • 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 as described above). , a disk, an optical disk, including a number of instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the methods described in the various embodiments of the present application.
  • a terminal device which may be a mobile phone, a computer, a server, or a network device, etc.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Mathematical Physics (AREA)
  • Computational Linguistics (AREA)
  • Stored Programmes (AREA)

Abstract

一种建表脚本生成方法、装置、设备及计算机可读存储介质,所述建表脚本生成方法包括:获取终端预设界面的表框架中各个标识符以及与标识符对应的多个参数组(S10);跳转到脚本设置界面,并接收用户基于脚本设置界面的选项发送的设置指令(S20);根据所述各个标识符以及设置指令,确定脚本程序模板,并基于脚本程序模板调用与标识符对应的多个参数组,生成建表脚本(S30)。通过终端预设界面表框架中的各个标识符以及设置指令生成脚本程序模板,使得建表脚本可通过调用脚本程序模板自动生成,无需开发人员手动编写建表脚本,避免了人为失误导致的脚本错误,降低了出错概率,使生成的建表脚本符合规范,提高了生成效率。

Description

建表脚本生成方法、装置、设备及计算机可读存储介质
本申请要求于2017年12月28日提交中国专利局、申请号为201711467963.2、发明名称为“建表脚本生成方法、装置、设备及计算机可读存储介质”的中国专利申请的优先权,其全部内容通过引用结合在申请中。
技术领域
本申请主要涉及计算机应用技术领域,具体地说,涉及一种建表脚本生成方法、装置、设备及计算机可读存储介质。
背景技术
数据库是建立在计算机存储设备上按照数据结构来组织、存储和管理数据的仓库,其包括大量用于存储数据的数据表格。目前,数据库中数据表格均通过开发人员手动编写脚本建立,但由于数据表格的数量巨大,且不同开发人员的水平差异,可能出现编写的脚本出现差错或编写的脚本不规范的问题,需要重新手动调整修正。此手动编写或调整建表脚本的过程均需要耗费大量时间,导致建表脚本的生成效率低,且手动编写生成方式的出错概率大,智能性较差。
发明内容
本申请的主要目的是提供一种建表脚本生成方法、装置、设备及计算机可读存储介质,旨在解决现有技术中建表脚本的生成效率低,出错概率大的问题。
为实现上述目的,本申请提供一种建表脚本生成方法,所述建表脚本生成方法包括以下步骤:
获取终端预设界面的表框架中各个标识符以及与标识符对应的多个参数组;
跳转到脚本设置界面,并接收用户基于脚本设置界面的选项发送的设置指令;
根据所述各个标识符以及设置指令,确定脚本程序模板,并基于脚本程序模板调用与标识符对应的多个参数组,生成建表脚本。
优选地,所述根据所述各个标识符以及设置指令,确定脚本程序模板,并基于脚本程序模板调用与标识符对应的多个参数组,生成建表脚本的步骤包括:
根据所述各个标识符获取预设脚本程序模板,并根据设置指令对预设脚本程序模板调整,确定脚本程序模板;
调用脚本程序模板读取表框架中与标识符对应的多个参数组,生成建表脚本。
优选地,所述调用脚本程序模板读取表框架中与标识符对应的多个参数组,生成建表脚本的步骤包括:
对所述多个参数组中的各个参数进行词法解析和语法解析,得到词法解析结果和语法解析结果;
当词法解析结果和语法解析结果分别符合预设词法规则和预设语法规则时,读取表框架中与标识符对应的多个参数组,生成建表脚本。
优选地,所述标识符包括字段名、字段描述、字段类型、空值属性、主键、索引和备注;
所述获取终端预设界面的表框架中各个标识符以及与标识符对应的多个参数组的步骤之前包括:
在终端预设界面接收配置指令,根据所述配置指令配置包括字段名、字段描述、字段类型、空值属性、主键、索引和备注的标识符以及与所述标识符对应的多组参数;
将所述标识符以及与标识符对应的多组参数关联以形成表框架。
优选地,所述脚本设置界面的选项包括通用设置选项和脚本设置选项,设置指令包括第一设置指令和第二设置指令;
所述接收用户基于脚本设置界面的选项发送的设置指令的步骤包括:
接收对通用设置选项的第一设置指令,以确定建表脚本的存储位置;
接收对脚本设置选项的第二设置指令,以进行建表脚本的特性设置。
优选地,所述基于脚本程序模板调用与标识符对应的多组参数,生成建表脚本的步骤之后包括:
将生成的建表脚本存储在所述存储位置,并在接收到查询指令时,跳转到存储建表脚本的存储位置,对建表脚本进行显示。
优选地,所述基于脚本程序模板调用与标识符对应的多个参数组,生成建表脚本的步骤之后包括:
当接收到显示执行参数指令时,按照各个参数组的顺序逐一获取各个参数组生成建表脚本的状态,并对所述状态进行显示;
当参数组生成建表脚本的状态为失败时,对与失败状态对应的参数组进行告警提醒。
此外,为实现上述目的,本申请还提出一种建表脚本生成装置,所述建表脚本生成装置包括:
获取模块,用于获取终端预设界面的表框架中各个标识符以及与标识符对应的多个参数组;
跳转模块,用于跳转到脚本设置界面,并接收用户基于脚本设置界面的选项发送的设置指令;
生成模块,用于根据所述各个标识符以及设置指令,确定脚本程序模板,并基于脚本程序模板调用与标识符对应的多个参数组,生成建表脚本。
此外,为实现上述目的,本申请还提出一种建表脚本生成设备,所述建表脚本生成设备包括:存储器、处理器、通信总线以及存储在所述存储器上的建表脚本生成程序;
所述通信总线用于实现处理器和存储器之间的连接通信;
所述处理器用于执行所述建表脚本生成程序,以实现以下步骤:
获取终端预设界面的表框架中各个标识符以及与标识符对应的多个参数组;
跳转到脚本设置界面,并接收用户基于脚本设置界面的选项发送的设置指令;
根据所述各个标识符以及设置指令,确定脚本程序模板,并基于脚本程序模板调用与标识符对应的多个参数组,生成建表脚本。
此外,为实现上述目的,本申请还提供一种计算机可读存储介质,所述计算机可读存储介质存储有一个或者一个以上程序,所述一个或者一个以上程序可被一个或者一个以上的处理器执行以用于:
获取终端预设界面的表框架中各个标识符以及与标识符对应的多个参数组;
跳转到脚本设置界面,并接收用户基于脚本设置界面的选项发送的设置指令;
根据所述各个标识符以及设置指令,确定脚本程序模板,并基于脚本程序模板调用与标识符对应的多个参数组,生成建表脚本。
本实施例的建表脚本生成方法、装置、设备及计算机可读存储介质,通过获取终端预设界面的表框架中各个标识符以及与标识符对应的多个参数组;跳转到脚本设置界面,并接收用户基于脚本设置界面的选项发送的设置指令;以根据各个标识符以及设置指令,确定脚本程序模板,从而基于此脚本程序模板调用与标识符对应的多个参数组,生成建表脚本。本方案通过终端预设界面表框架中的各个标识符以及设置指令生成脚本程序模板,使得建表脚本可通过调用脚本程序模板自动生成,无需开发人员手动编写建表脚本,避免了人为失误导致的脚本错误,降低了出错概率,使生成的建表脚本符合规范,提高了生成效率。
附图说明
图1是本申请的建表脚本生成方法第一实施例的流程示意图;
图2是本申请的建表脚本生成方法第二实施例的流程示意图;
图3是本申请的建表脚本生成方法第三实施例的流程示意图;
图4是本申请的建表脚本生成装置第一实施例的功能模块示意图;
图5是本申请实施例方法涉及的硬件运行环境的设备结构示意图;
图6是本申请的建表脚本生成方法表框架示意图;
图7是本申请的建表脚本生成方法脚本设置界面示意图;
图8是本申请的建表脚本生成方法生成的建表脚本。
本申请目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。
具体实施方式
应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。
本申请提供一种建表脚本生成方法。
请参照图1,图1为本申请建表脚本生成方法第一实施例的流程示意图。在本实施例中,所述建表脚本生成方法包括:
步骤S10,获取终端预设界面的表框架中各个标识符以及与标识符对应的多个参数组;
本实施例的建表脚本生成方法适用于生成数据库中用于存储数据的数据库表的建表脚本。数据库(Database)是按照数据结构来组织、存储和管理数据的建立在计算机存储设备上的仓库,其长期储存在计算机内、是有组织的、可共享的数据集合。数据以一定的数据模型组织、描述和储存在一起、具有尽可能小的冗余度、较高的数据独立性和易扩展性的特点并可在一定范围内为多个用户共享。数据存储在数据库的数据表中,数据表是一种结构化的文件,简称表,以“行”和“列”的形式存在。表中每一行为一个记录,由若干个字段组成;表中每一列为一个字段,每个字段都有相应的描述信息,如数据类型、数据宽度等,数据表通过程序脚本建立。
本实施例根据获取的终端预设界面的表框架中各个标识符以及与标识符对应的多个参数组生成建表脚本,在获取表框架中各个标识符以及对应参数前,需要建立用于表示创建数据表中各列属性的表框架,表框架通过标识符来表示创建数据表中的各列属性,其中标识符包括字段名、字段描述、字段类型、空值属性、主键、索引和备注等多个标识符,此多个标识符所对应的一组参数值表征创建数据表的列属性。在获取表框架中各个标识符以及对应多个参数组的步骤之前包括:
步骤q1,在终端预设界面接收配置指令,根据所述配置指令配置包括字段名、字段描述、字段类型、空值属性、主键、索引和备注的标识符以及与所述标识符对应的多组参数;
步骤q2,将所述标识符以及与标识符对应的多组参数关联以形成表框架。
具体地,终端可以是平板电脑、移动电脑等,终端预设界面则为EXCEL表的编辑界面。在EXCEL表的编辑界面编辑需要创建数据表各列的字段名、字段描述、字段类型、空值属性、主键、索引和备注等信息,此编辑操作即为配置指令,将此编辑的字段名、字段描述、字段类型、空值属性、主键、索引和备注作为表框架的各个标识符。此外对此包括字段名、字段描述、字段类型、空值属性、主键、索引和备注的各个标识符配置对应的参数以表征创建数据表中一列的属性。因需要创建数据表的列有多个,不同的列有不同的属性,从而作为标识符的字段名、字段描述、字段类型、空值属性、主键、索引和备注有多个参数组,通过多个参数组来表征不同列的属性。当终端预设界面接收到作为配置指令的编辑操作时,根据编辑操作编辑包括字段名、字段描述、字段类型、空值属性、主键、索引和备注的标识符以及与标识符对应的多个参数组。
请参照图6,在一具体实施例中,通过建表脚本创建的数据表包括4列,4列分别为JOB_GROP、JOB_NAME、STATUS和RESULT_INFO,用于表示每列属性的标识符包括:字段描述、字段类型、空值属性、主键、索引和备注。从而字段名分别为JOB_GROP、JOB_NAME、STATUS和RESULT_INFO;与第一列JOB_GROP对应的字段描述、字段类型、空值属性、主键、索引和备注分别为:job组名称、VARCHAR2(32)、N、空值、空值和空值;与第二列JOB_NAME对应的字段描述、字段类型、空值属性、主键、索引和备注分别为:job组名称、VARCHAR2(32)、N、空值、空值和空值;与第三列STATUS对应的字段描述、字段类型、空值属性、主键、索引和备注分别为:状态0-失败,1-成功、VARCHAR2(22)、N、空值、空值和空值;与第四列RESULT_INFO对应的字段描述、字段类型、空值属性、主键、索引和备注分别为:结果信息、VARCHAR2(300)、N、空值、空值和空值。在对此各个标识符以及对应的4个参数组配置完成后,即在终端预设界面形成表框架。以获取此终端预设界面表框架中各个标识符以及与各个标识符对应的多个参数组,通过此各个标识符以及对应的多个参数组生成建表脚本。
步骤S20,跳转到脚本设置界面,并接收用户基于脚本设置界面的选项发送的设置指令;
进一步地,在获取到终端预设界面的表框架中各个标识符以及与各个标识符对应的多组参数后,跳转到脚本设置界面,对建表脚本的生成进行设置。因终端预设界面为EXCEL表编辑界面,因EXCEL表中包括多个sheet,可将表框架在一个sheet中建立,而在另一个sheet建立脚本设置界面。其中表框架只需要在sheet单元格中编辑好创建数据表所需的列信息;而脚本设置界面包括对生成建表脚本的设置操作,其通过EXCEL的VBA编辑生成,VBA(Visual Basic For Applications)是微软开发出来在其桌面应用程序中执行通用的自动化(OLE)任务的编程语言。VBA需要一个宿主应用程序才能远行(需要在EXCEL等软件的运行下才能运行),其可使常用的过程或者进程自动化,可以创建自定义的解决方案,适用于来定制已有的桌面应用程序。本实施例使用在EXCEL运行的基础上运行VBA编辑脚本设置界面,脚本设置界面中有对生成建表脚本的选项,供用户根据其需求选择选项,当接收到用户基于脚本设置界面的选项发送的设置指令时,根据此设置指令生成符合用户需求的建表脚本。具体地,脚本设置界面的选项包括通用设置选项和脚本设置选项,设置指令包括第一设置指令和第二设置指令,从而接收用户基于脚本设置界面的选项发送的设置指令的步骤包括:
步骤S21,接收对通用设置选项的第一设置指令,以确定建表脚本的存储位置;
步骤S22,接收对脚本设置选项的第二设置指令,以进行建表脚本的特性设置。
本实施例的脚本设置界面的选项包括通用设置选项和脚本设置选项,通用设置选项用于设置生成的建表脚本的存储地址;脚本设置选项用于设置生成建表脚本的特性。请参照图7,通用设置选项包括显示框和两个虚拟按键,与此通用设置对应的设置指令为第一设置指令,显示框用于显示生成脚本文件的存储地址,两个虚拟按键分别为选择目录和打开目录。其中选择目录虚拟按键用于选择生成脚本文件的存储地址,并将选择的存储地址显示在显示框中,打开目录虚拟按键则用于打开存储建表脚本的存储位置。如当接收第一设置指令触发选择目录虚拟按键将生成的建表脚本存储在D盘的文件夹中,则通过打开目录虚拟按键则可实现打开D盘的文件夹,对生成的建表脚本进行显示。脚本设置选项用于实现用户对生成的建表脚本的特殊需求,与其对应的设置指令为第二设置指令,其包括:生成建表脚本、创建主键、创建索引、创建同义词、生成授权脚本和生成回退脚本等选项。当用户只需要生成建表脚本时,则发送第二设置指令只选择生成建表脚本选项即可,而当用户有其他需求,如需要生成授权脚本,则相应的发送第二设置指令选择生成授权脚本,即可生成针对不同用户的不同权限脚本。此外脚本设置界面中还包括用于触发生成建表脚本的虚拟按键,当检测到此虚拟按键触发,说明用户有生成建表脚本的需求,从而开始生成建表脚本操作。本实施例通过跳转到脚本设置界面,供用户根据其需求选择设置,接收用户基于脚本设置界面的选项发送的设置指令,以根据此设置指令生成符合用户需求的建表脚本。
步骤S30,根据所述各个标识符以及设置指令,确定脚本程序模板,并基于脚本程序模板调用与标识符对应的多个参数组,生成建表脚本。
更进一步地,在获取到表框架中的各个标识符以及接收到表征用户特定需求的设置指令后,确定生成脚本程序的脚本程序模板,基于此脚本程序模板调用与标识符对应的多个参数组生成符合用户需求的建表脚本。其中此确定脚本程序模板以及生成建表脚本的步骤包括:
步骤S31,根据所述各个标识符获取预设脚本程序模板,并根据设置指令对预设脚本程序模板调整,确定脚本程序模板;
步骤S32,调用脚本程序模板读取表框架中与标识符对应的多个参数组,生成建表脚本。
进一步地,本实施例设置有脚本程序模板,通过调用脚本程序模板读取表框架中与标识符的多个对应参数组生成建表脚本。考虑到在脚本设置界面设置选项的差异性,生成的建表脚本也相应的存在差异,如果使用同样的脚本程序模板,达不到差异性的需求。从而本实施例先根据各个标识符获取预设脚本程序模板,各个标识符表征数据表中的列属性,从而为了实现此列属性,设置有预设脚本程序模板,获取此预设脚本程序模板;并根据脚本设置界面的设置指令的差异性调整预设脚本程序模板,以得到与各个标识符以及设置指令相符合的脚本程序模板。调用此脚本程序模板中的脚本程序读取表框架中标识符对应的多个参数组,生成建表脚本。其中脚本程序读取操作的起始处可以通过程序设定,如设定从EXCEL表的第3个sheet开始读取表框架,且设定在读取sheet中的表框架时,从sheet中的第2行第2列开始;也可以自动读取,当sheet表中没有数据时,则读取的值为空;当有数据时,则读取的值不为空,将第一次读取到数据的行和列,作为读取的起始处。通过脚本程序模板从起始处对表框架中与标识符对应的所有参数进行读取,生成建表脚本,如图6中所示的表框架所对应生成的建表脚本见图8所示。本实施例可针对需要生成的不同建表脚本,建立不同的表框架,如建立学生信息表的建表脚本、学生成本表的建表脚本等,通过调用程序脚本模板对不同表框架中标识符对应的多个参数组生成建表脚本,避免开发人员对每个建表脚本进行编写,提高了建表脚本的生成效率以及正确率。
本实施例的建表脚本生成方法,通过获取终端预设界面的表框架中各个标识符以及与标识符对应的多个参数组;跳转到脚本设置界面,并接收用户基于脚本设置界面的选项发送的设置指令;以根据各个标识符以及设置指令,确定脚本程序模板,从而基于此脚本程序模板调用与标识符对应的多个参数组,生成建表脚本。本方案通过终端预设界面表框架中的各个标识符以及设置指令生成脚本程序模板,使得建表脚本可通过调用脚本程序模板自动生成,无需开发人员手动编写建表脚本,避免了人为失误导致的脚本错误,降低了出错概率,使生成的建表脚本符合规范,提高了生成效率。
进一步地,在本申请建表脚本生成方法另一实施例中,所述调用脚本程序模板读取表框架中与标识符对应的多个参数组,生成建表脚本的步骤包括:
步骤S321,对所述多个参数组中的各个参数进行词法解析和语法解析,得到词法解析结果和语法解析结果;
步骤S322,当词法解析结果和语法解析结果分别符合预设词法规则和预设语法规则时,读取表框架中与标识符对应的多个参数组,生成建表脚本。
可理解地,在将标识符的多个参数组生成建表脚本的过程中,需要对各个参数组中的各个参数进行词法解析和语法解析,以通过此词法解析和语法解析判断各个参数是否符合生成规则。其中词法解析为对参数进行扫描,根据构词规则识别参数;语法解析在词法解析的基础上将参数组合形成各类语法短语,如“程序”、“语句”、“表达式”等。本实施例中设置有用于判断各个参数是否符合生成规则的预设词法规则和预设语法规则,将经词法解析得到的词法解析结果和预设词法规则对比,以判断各个参数是否符合预设词法规则;将经语法解析得到的语法解析结果和预设语法规则对比,以判断各个参数是否符合预设语法规则,当符合预设词法规则和预设语法规则时,则说明符合建表脚本的生成规则,从而读取表框架中与标识符对应的多个参数组,生成建表脚本。
进一步地,请参照图2,在本申请建表脚本生成方法第一实施例基础上,提出本申请建表脚本生成方法第二实施例,在第二实施例中,所述基于脚本程序模板调用与标识符对应的多个参数组,生成建表脚本的步骤之后包括:
步骤S40,将生成的建表脚本存储在所述存储位置,并在接收到查询指令时,跳转到存储建表脚本的存储位置,对建表脚本进行显示。
在生成建表脚本后,将此建表脚本存储在脚本设置界面中设置的存储位置中。而在接收到对建表脚本的查询指令时,则跳转到存储建表脚本的存储位置,对建表脚本进行显示。其中查询指令可通过脚本设置界面中的打开目录虚拟按键触发,目录链接到建表脚本的存储位置,如存储文件夹;生成的建表脚本可以是TXT文本,显示时则是对TXT文本的内容进行显示。
进一步地,请参照图3,在本申请建表脚本生成方法第二实施例基础上,提出本申请建表脚本生成方法第三实施例,在第三实施例中,所述基于脚本程序模板调用与标识符对应的多个参数组,生成建表脚本的步骤之后包括:
步骤S50,当接收到显示执行参数指令时,按照各个参数组的顺序逐一获取各个参数组生成建表脚本的状态,并对所述状态进行显示;
步骤S60,当参数组生成建表脚本的状态为失败时,对与失败状态对应的参数组进行告警提醒。
更进一步地,本实施例的脚本设置界面中设置有显示指令参数的虚拟按键,其可用于对生成建表脚本的执行过程进行显示。具体地,当检测到此虚拟按键被触发,接收到显示执行参数指令时,按照表框架中各个标识符对应的多个参数组的顺序逐一获取各个参数组生成建表脚本的状态,其中生成建表脚本的状态包括失败和成功两种状态,对此获取的失败或成功的状态进行显示,且显示的位置可以在脚本设置界面中的空白区域。且在参数组生成建表脚本的状态为失败时,确定此失败状态对应的参数组,对此参数组进行告警提醒。具体地,在脚本设置界面中的空白区域对成功或失败状态的参数组进行显示时,对失败状态的参数组以颜色区别显示。如各个标识符对应的参数组为A、B、C、D四组,获取四组参数生成建表脚本的状态为:参数组A、B、D的状态为成功,参数组C的状态为失败,则在脚本设置界面中的空白区域将参数组A、B、D以黑色显示,而对参数组C以红色显示,用户通过查看显示的状态,通过告警提醒即可获知生成失败的参数组,相应的对此参数组优化,以确保建表脚本的成功生成。
进一步地,在本申请建表脚本生成方法第三实施例基础上,提出本申请建表脚本生成方法第四实施例,在第四实施例中,所述基于脚本程序模板调用与标识符对应的多个参数组,生成建表脚本的步骤之后包括:
步骤S70,获取建表脚本,并将获取的建表脚本发送到关联的上位数据库脚本中,以供上位数据库脚本执行所述建表脚本建立数据表。
更进一步地,在生成建表脚本后,对此建表脚本进行获取,并将获取的建表脚本发送到与其关联的上位数据库脚本中,上位数据库脚本执行此建表脚本,创建与建表脚本对应的数据表。如生成的建表脚本用于建立员工信息表,此员工信息表包括的列有姓名、性别、年龄;从而生成的建表脚本为与此员工信息表的列相关的脚本,根据此用于创建员工信息表相关的建表脚本,建立员工信息表。因通过脚本程序模板对各个标识符对应的参数组生成建表脚本,可提高建表脚本的正确率,从而在根据建表脚本创建数据表时,相应的可提高创建数据表的正确率。
此外,请参照图4,本申请提供一种建表脚本生成装置,在本申请建表脚本生成装置第一实施例中,所述建表脚本生成装置包括:
获取模块10,用于获取终端预设界面的表框架中各个标识符以及与标识符对应的多个参数组;
跳转模块20,用于跳转到脚本设置界面,并接收用户基于脚本设置界面的选项发送的设置指令;
生成模块30,用于根据所述各个标识符以及设置指令,确定脚本程序模板,并基于脚本程序模板调用与标识符对应的多个参数组,生成建表脚本。
需要说明的是,本领域普通技术人员可以理解实现上述实施例的全部或部分步骤可以通过硬件来完成,也可以通过程序来指令相关的硬件完成,所述的程序可以存储于一种计算机可读存储介质中,上述提到的存储介质可以是只读存储器,磁盘或光盘等。
参照图5,图5是本申请实施例方法涉及的硬件运行环境的设备结构示意图。
本申请实施例建表脚本生成设备可以是PC,也可以是智能手机、平板电脑、电子书阅读器、便携计算机等终端设备。
如图5所示,该建表脚本生成设备可以包括:处理器1001,例如CPU,存储器1005,通信总线1002。其中,通信总线1002用于实现处理器1001和存储器1005之间的连接通信。存储器1005可以是高速RAM存储器,也可以是稳定的存储器(non-volatile memory),例如磁盘存储器。存储器1005可选的还可以是独立于前述处理器1001的存储装置。
可选地,该建表脚本生成设备还可以包括用户接口、网络接口、摄像头、RF(Radio Frequency,射频)电路,传感器、音频电路、WiFi模块等等。用户接口可以包括显示屏(Display)、输入单元比如键盘(Keyboard),可选用户接口还可以包括标准的有线接口、无线接口。网络接口可选的可以包括标准的有线接口、无线接口(如WI-FI接口)。
本领域技术人员可以理解,图5中示出的建表脚本生成设备结构并不构成对建表脚本生成设备的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。
如图5所示,作为一种计算机存储介质的存储器1005中可以包括操作系统、网络通信模块以及建表脚本生成程序。操作系统是管理和控制建表脚本生成设备硬件和软件资源的程序,支持建表脚本生成程序以及其它软件和/或程序的运行。网络通信模块用于实现存储器1005内部各组件之间的通信,以及与建表脚本生成设备中其它硬件和软件之间通信。
在图5所示的建表脚本生成设备中,处理器1001用于执行存储器1005中存储的建表脚本生成程序,实现上述建表脚本生成方法各实施例中的步骤。
本申请提供了一种计算机可读存储介质,所述计算机可读存储介质存储有一个或者一个以上程序,所述一个或者一个以上程序还可被一个或者一个以上的处理器执行以用于实现上述建表脚本生成方法各实施例中的步骤。
还需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。
上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在如上所述的一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本申请各个实施例所述的方法。
以上所述仅为本申请的优选实施例,并非因此限制本申请的专利范围,凡是在本申请的构思下,利用本申请说明书及附图内容所作的等效结构变换,或直接/间接运用在其他相关的技术领域均包括在本申请的专利保护范围内。

Claims (20)

  1. 一种建表脚本生成方法,其特征在于,所述建表脚本生成方法包括以下步骤:
    获取终端预设界面的表框架中各个标识符以及与标识符对应的多个参数组;
    跳转到脚本设置界面,并接收用户基于脚本设置界面的选项发送的设置指令;
    根据所述各个标识符以及设置指令,确定脚本程序模板,并基于脚本程序模板调用与标识符对应的多个参数组,生成建表脚本。
  2. 如权利要求1所述的建表脚本生成方法,其特征在于,所述根据所述各个标识符以及设置指令,确定脚本程序模板,并基于脚本程序模板调用与标识符对应的多个参数组,生成建表脚本的步骤包括:
    根据所述各个标识符获取预设脚本程序模板,并根据设置指令对预设脚本程序模板调整,确定脚本程序模板;
    调用脚本程序模板读取表框架中与标识符对应的多个参数组,生成建表脚本。
  3. 如权利要求2所述的建表脚本生成方法,其特征在于,所述调用脚本程序模板读取表框架中与标识符对应的多个参数组,生成建表脚本的步骤包括:
    对所述多个参数组中的各个参数进行词法解析和语法解析,得到词法解析结果和语法解析结果;
    当词法解析结果和语法解析结果分别符合预设词法规则和预设语法规则时,读取表框架中与标识符对应的多个参数组,生成建表脚本。
  4. 如权利要求1所述的建表脚本生成方法,其特征在于,所述标识符包括字段名、字段描述、字段类型、空值属性、主键、索引和备注;
    所述获取终端预设界面的表框架中各个标识符以及与标识符对应的多个参数组的步骤之前包括:
    在终端预设界面接收配置指令,根据所述配置指令配置包括字段名、字段描述、字段类型、空值属性、主键、索引和备注的标识符以及与所述标识符对应的多组参数;
    将所述标识符以及与标识符对应的多组参数关联以形成表框架。
  5. 如权利要求1所述的建表脚本生成方法,其特征在于,所述脚本设置界面的选项包括通用设置选项和脚本设置选项,设置指令包括第一设置指令和第二设置指令;
    所述接收用户基于脚本设置界面的选项发送的设置指令的步骤包括:
    接收对通用设置选项的第一设置指令,以确定建表脚本的存储位置;
    接收对脚本设置选项的第二设置指令,以进行建表脚本的特性设置。
  6. 如权利要求5所述的建表脚本生成方法,其特征在于,所述基于脚本程序模板调用与标识符对应的多个参数组,生成建表脚本的步骤之后包括:
    将生成的建表脚本存储在所述存储位置,并在接收到查询指令时,跳转到存储建表脚本的存储位置,对建表脚本进行显示。
  7. 如权利要求1所述的建表脚本生成方法,其特征在于,所述基于脚本程序模板调用与标识符对应的多个参数组,生成建表脚本的步骤之后包括:
    当接收到显示执行参数指令时,按照各个参数组的顺序逐一获取各个参数组生成建表脚本的状态,并对所述状态进行显示;
    当参数组生成建表脚本的状态为失败时,对与失败状态对应的参数组进行告警提醒。
  8. 一种建表脚本生成装置,其特征在于,所述建表脚本生成装置包括:
    获取模块,用于获取终端预设界面的表框架中各个标识符以及与标识符对应的多个参数组;
    跳转模块,用于跳转到脚本设置界面,并接收用户基于脚本设置界面的选项发送的设置指令;
    生成模块,用于根据所述各个标识符以及设置指令,确定脚本程序模板,并基于脚本程序模板调用与标识符对应的多个参数组,生成建表脚本。
  9. 一种建表脚本生成设备,其特征在于,所述建表脚本生成设备包括:存储器、处理器、通信总线以及存储在所述存储器上的建表脚本生成程序;
    所述通信总线用于实现处理器和存储器之间的连接通信;
    所述处理器用于执行所述建表脚本生成程序,以实现以下步骤:
    获取终端预设界面的表框架中各个标识符以及与标识符对应的多个参数组;
    跳转到脚本设置界面,并接收用户基于脚本设置界面的选项发送的设置指令;
    根据所述各个标识符以及设置指令,确定脚本程序模板,并基于脚本程序模板调用与标识符对应的多个参数组,生成建表脚本。
  10. 如权利要求9所述的建表脚本生成设备,其特征在于,所述根据所述各个标识符以及设置指令,确定脚本程序模板,并基于脚本程序模板调用与标识符对应的多个参数组,生成建表脚本的步骤包括:
    根据所述各个标识符获取预设脚本程序模板,并根据设置指令对预设脚本程序模板调整,确定脚本程序模板;
    调用脚本程序模板读取表框架中与标识符对应的多个参数组,生成建表脚本。
  11. 如权利要求10所述的建表脚本生成设备,其特征在于,所述调用脚本程序模板读取表框架中与标识符对应的多个参数组,生成建表脚本的步骤包括:
    对所述多个参数组中的各个参数进行词法解析和语法解析,得到词法解析结果和语法解析结果;
    当词法解析结果和语法解析结果分别符合预设词法规则和预设语法规则时,读取表框架中与标识符对应的多个参数组,生成建表脚本。
  12. 如权利要求9所述的建表脚本生成设备,其特征在于,所述标识符包括字段名、字段描述、字段类型、空值属性、主键、索引和备注;
    所述获取终端预设界面的表框架中各个标识符以及与标识符对应的多个参数组的步骤之前包括:
    在终端预设界面接收配置指令,根据所述配置指令配置包括字段名、字段描述、字段类型、空值属性、主键、索引和备注的标识符以及与所述标识符对应的多组参数;
    将所述标识符以及与标识符对应的多组参数关联以形成表框架。
  13. 如权利要求9所述的建表脚本生成设备,其特征在于,所述脚本设置界面的选项包括通用设置选项和脚本设置选项,设置指令包括第一设置指令和第二设置指令;
    所述接收用户基于脚本设置界面的选项发送的设置指令的步骤包括:
    接收对通用设置选项的第一设置指令,以确定建表脚本的存储位置;
    接收对脚本设置选项的第二设置指令,以进行建表脚本的特性设置。
  14. 如权利要求13所述的建表脚本生成设备,其特征在于,所述基于脚本程序模板调用与标识符对应的多个参数组,生成建表脚本的步骤之后包括:
    将生成的建表脚本存储在所述存储位置,并在接收到查询指令时,跳转到存储建表脚本的存储位置,对建表脚本进行显示。
  15. 一种计算机可读存储介质,其特征在于,所述计算机课读存储介质上存储有建表脚本生成程序,所述建表脚本生成程序被处理器执行,以实现以下步骤:
    获取终端预设界面的表框架中各个标识符以及与标识符对应的多个参数组;
    跳转到脚本设置界面,并接收用户基于脚本设置界面的选项发送的设置指令;
    根据所述各个标识符以及设置指令,确定脚本程序模板,并基于脚本程序模板调用与标识符对应的多个参数组,生成建表脚本。
  16. 如权利要求15所述的计算机可读存储介质,其特征在于,所述根据所述各个标识符以及设置指令,确定脚本程序模板,并基于脚本程序模板调用与标识符对应的多个参数组,生成建表脚本的步骤包括:
    根据所述各个标识符获取预设脚本程序模板,并根据设置指令对预设脚本程序模板调整,确定脚本程序模板;
    调用脚本程序模板读取表框架中与标识符对应的多个参数组,生成建表脚本。
  17. 如权利要求16所述的计算机可读存储介质,其特征在于,所述调用脚本程序模板读取表框架中与标识符对应的多个参数组,生成建表脚本的步骤包括:
    对所述多个参数组中的各个参数进行词法解析和语法解析,得到词法解析结果和语法解析结果;
    当词法解析结果和语法解析结果分别符合预设词法规则和预设语法规则时,读取表框架中与标识符对应的多个参数组,生成建表脚本。
  18. 如权利要求15所述的计算机可读存储介质,其特征在于,所述标识符包括字段名、字段描述、字段类型、空值属性、主键、索引和备注;
    所述获取终端预设界面的表框架中各个标识符以及与标识符对应的多个参数组的步骤之前包括:
    在终端预设界面接收配置指令,根据所述配置指令配置包括字段名、字段描述、字段类型、空值属性、主键、索引和备注的标识符以及与所述标识符对应的多组参数;
    将所述标识符以及与标识符对应的多组参数关联以形成表框架。
  19. 如权利要求15所述的计算机可读存储介质,其特征在于,所述脚本设置界面的选项包括通用设置选项和脚本设置选项,设置指令包括第一设置指令和第二设置指令;
    所述接收用户基于脚本设置界面的选项发送的设置指令的步骤包括:
    接收对通用设置选项的第一设置指令,以确定建表脚本的存储位置;
    接收对脚本设置选项的第二设置指令,以进行建表脚本的特性设置。
  20. 如权利要求19所述的计算机可读存储介质,其特征在于,所述基于脚本程序模板调用与标识符对应的多个参数组,生成建表脚本的步骤之后包括:
    将生成的建表脚本存储在所述存储位置,并在接收到查询指令时,跳转到存储建表脚本的存储位置,对建表脚本进行显示。
PCT/CN2018/074997 2017-12-28 2018-02-01 建表脚本生成方法、装置、设备及计算机可读存储介质 WO2019127837A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201711467963.2 2017-12-28
CN201711467963.2A CN108170809B (zh) 2017-12-28 2017-12-28 建表脚本生成方法、装置、设备及计算机可读存储介质

Publications (1)

Publication Number Publication Date
WO2019127837A1 true WO2019127837A1 (zh) 2019-07-04

Family

ID=62519550

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/074997 WO2019127837A1 (zh) 2017-12-28 2018-02-01 建表脚本生成方法、装置、设备及计算机可读存储介质

Country Status (2)

Country Link
CN (1) CN108170809B (zh)
WO (1) WO2019127837A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111221518A (zh) * 2019-11-08 2020-06-02 深圳市彬讯科技有限公司 一种脚本生成方法、装置、设备及计算机存储介质

Families Citing this family (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110825764B (zh) * 2018-07-23 2022-07-26 北京国双科技有限公司 一种sql脚本的生成方法、系统、存储介质和处理器
CN109299005B (zh) * 2018-09-05 2020-07-07 北京邮电大学 测试脚本的生成方法及装置
CN109325046A (zh) * 2018-10-25 2019-02-12 深圳壹账通智能科技有限公司 数据库脚本生成方法、装置、介质及电子设备
CN109684326A (zh) * 2018-11-13 2019-04-26 平安科技(深圳)有限公司 数据表创建方法、装置、设备及计算机可读存储介质
CN109542539A (zh) * 2018-11-22 2019-03-29 郑州云海信息技术有限公司 一种配置Web系统中脚本参数的方法和系统
CN109635041A (zh) * 2018-12-04 2019-04-16 山东中创软件商用中间件股份有限公司 基于Sqoop工具的数据传输方法、装置、设备及介质
CN111831638A (zh) * 2019-04-17 2020-10-27 阿里巴巴集团控股有限公司 一种数据表的创建方法和装置
CN111857679B (zh) * 2019-04-29 2024-03-15 西门子(中国)有限公司 用于生成脚本程序的方法、装置及脚本程序处理系统
CN110347985B (zh) * 2019-05-30 2023-07-28 平安科技(深圳)有限公司 表格生成的方法、装置、计算机设备和存储介质
CN110389955A (zh) * 2019-07-13 2019-10-29 北京海致星图科技有限公司 一种数据仓库调度文件自动生成系统及生成方法
CN110457063B (zh) * 2019-07-15 2024-04-16 中国平安人寿保险股份有限公司 脚本程序的封装方法及装置、电子设备、可读存储介质
CN110889271A (zh) * 2019-11-08 2020-03-17 深圳市彬讯科技有限公司 基于模板的数据表构建方法、设备及存储介质
CN112256263B (zh) * 2020-09-23 2024-02-06 杭州讯酷科技有限公司 一种基于自然语言的ui界面智能制作系统及方法
CN112558952A (zh) * 2020-12-16 2021-03-26 中国平安人寿保险股份有限公司 程序语句生成方法、装置、计算机设备及存储介质
CN112632072B (zh) * 2020-12-24 2023-04-07 浪潮软件科技有限公司 基于vb生成c格式nr数据库表信息的方法及装置

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102360290A (zh) * 2011-09-29 2012-02-22 用友软件股份有限公司 表单生成装置和表单生成方法
CN102830974A (zh) * 2012-08-13 2012-12-19 南京莱斯信息技术股份有限公司 一种可视化快速生成java代码的辅助开发工具
CN103473108A (zh) * 2013-08-12 2013-12-25 福建富士通信息软件有限公司 一种Java代码生成方法
US20140101178A1 (en) * 2012-10-08 2014-04-10 Bmc Software, Inc. Progressive analysis for big data
CN107515933A (zh) * 2017-08-29 2017-12-26 平安科技(深圳)有限公司 修改源数据库表结构的方法、服务器、系统及存储介质

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8788931B1 (en) * 2000-11-28 2014-07-22 International Business Machines Corporation Creating mapping rules from meta data for data transformation utilizing visual editing
CN103135976B (zh) * 2011-11-30 2016-05-11 阿里巴巴集团控股有限公司 代码自动生成方法及装置
CN103365847B (zh) * 2012-03-27 2016-02-24 腾讯科技(深圳)有限公司 一种自定义网页文件的生成方法和装置
CN107291438B (zh) * 2016-04-13 2021-09-24 阿里巴巴集团控股有限公司 自动化脚本的生成方法、装置及电子设备

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102360290A (zh) * 2011-09-29 2012-02-22 用友软件股份有限公司 表单生成装置和表单生成方法
CN102830974A (zh) * 2012-08-13 2012-12-19 南京莱斯信息技术股份有限公司 一种可视化快速生成java代码的辅助开发工具
US20140101178A1 (en) * 2012-10-08 2014-04-10 Bmc Software, Inc. Progressive analysis for big data
CN103473108A (zh) * 2013-08-12 2013-12-25 福建富士通信息软件有限公司 一种Java代码生成方法
CN107515933A (zh) * 2017-08-29 2017-12-26 平安科技(深圳)有限公司 修改源数据库表结构的方法、服务器、系统及存储介质

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111221518A (zh) * 2019-11-08 2020-06-02 深圳市彬讯科技有限公司 一种脚本生成方法、装置、设备及计算机存储介质

Also Published As

Publication number Publication date
CN108170809A (zh) 2018-06-15
CN108170809B (zh) 2020-11-03

Similar Documents

Publication Publication Date Title
WO2019127837A1 (zh) 建表脚本生成方法、装置、设备及计算机可读存储介质
WO2019165691A1 (zh) 自动生成测试案例的方法、装置、设备及可读存储介质
WO2018227880A1 (zh) 数据比对方法、装置、设备及可读存储介质
WO2019223070A1 (zh) 应用测试方法、装置、设备及可读存储介质
WO2017028601A1 (zh) 智能终端的语音控制方法、装置及电视机系统
WO2019174375A1 (zh) 接口测试方法、装置、设备及计算机可读存储介质
WO2019218444A1 (zh) 测试报告的生成方法、装置、设备及存储介质
WO2018205545A1 (zh) 数据生成方法、装置、终端及计算机可读存储介质
WO2020045927A1 (en) Electronic device and method for generating short cut of quick command
WO2017041538A1 (zh) 终端用户界面的受控显示方法及装置
WO2019080401A1 (zh) 脚本语句转换方法、装置及计算机可读存储介质
WO2019119771A1 (zh) 语音交互方法、装置及计算机可读存储介质
WO2017201913A1 (zh) 一种精准语音控制方法及装置
WO2019104877A1 (zh) 通过网站对接购买保险的方法、装置、设备及介质
WO2019144585A1 (zh) 虚拟机器人的控制方法、装置、设备及可读存储介质
WO2019169814A1 (zh) 自动生成中文注释的方法、装置、设备及存储介质
WO2020224247A1 (zh) 基于区块链的数据溯源方法、装置、设备及可读存储介质
WO2018120430A1 (zh) 一种页面构建方法、终端、计算机可读存储介质及页面构建设备
WO2019041832A1 (zh) 修改源数据库表结构的方法、服务器、系统及存储介质
WO2019161615A1 (zh) 账单录入方法、系统、光学字符识别服务器和存储介质
WO2018076840A1 (zh) 数据分享方法、装置、存储介质及服务器
WO2020000621A1 (zh) 空调控制方法、空调控制装置、空调设备及存储介质
CN107943466B (zh) 数据库访问语句生成方法、装置及设备
WO2015144052A1 (en) Method and apparatus for collecting statistics on network information
WO2019127869A1 (zh) 漏洞信息收集方法、装置、设备及可读存储介质

Legal Events

Date Code Title Description
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 13/10/2020)

122 Ep: pct application non-entry in european phase

Ref document number: 18894390

Country of ref document: EP

Kind code of ref document: A1