WO2019080401A1 - 脚本语句转换方法、装置及计算机可读存储介质 - Google Patents

脚本语句转换方法、装置及计算机可读存储介质

Info

Publication number
WO2019080401A1
WO2019080401A1 PCT/CN2018/074809 CN2018074809W WO2019080401A1 WO 2019080401 A1 WO2019080401 A1 WO 2019080401A1 CN 2018074809 W CN2018074809 W CN 2018074809W WO 2019080401 A1 WO2019080401 A1 WO 2019080401A1
Authority
WO
WIPO (PCT)
Prior art keywords
conversion
statement
converted
script statement
type
Prior art date
Application number
PCT/CN2018/074809
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 WO2019080401A1 publication Critical patent/WO2019080401A1/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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • 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/21Design, administration or maintenance of databases

Definitions

  • the present application relates to the field of computer application technologies, and in particular, to a script statement conversion method and apparatus, and a computer readable storage medium.
  • the main purpose of the present application is to provide a script statement conversion method, apparatus, and computer readable storage medium, which aim to solve the problem of manually inputting query conditions in the prior art, which is time consuming.
  • the present application provides a script statement conversion method, and the script statement conversion method includes the following steps:
  • the script statement to be converted includes a query statement and a function block statement
  • the step of converting the script statement to be converted into a target script statement corresponding to the type according to the type of the conversion trigger instruction includes:
  • the type of the conversion trigger instruction is the first conversion type corresponding to the query statement, adding a first identifier between the row and the row of the script statement to be converted to convert the script statement to be converted into a correspondence corresponding to the first conversion type Target script statement;
  • the type of the conversion trigger instruction is the second conversion type corresponding to the function block statement
  • adding a second identifier between the line and the line of the script statement to be converted to convert the script statement to be converted into corresponding to the second conversion type The target script statement.
  • the step of adding a first identifier between the row and the row of the script statement to be converted to convert the script statement to be converted into the target script statement corresponding to the first conversion type comprises:
  • the step of adding a second delimiter between the row and the row of the script statement to be converted to convert the script statement to be converted into the target script statement corresponding to the second conversion type comprises:
  • the step of receiving, by the conversion interface of the terminal, the script statement to be converted includes:
  • the control conversion application jumps to the conversion interface of the query statement
  • the control conversion application jumps to the conversion interface of the function block statement.
  • the step of determining the type of the conversion trigger instruction comprises:
  • the conversion trigger instruction is a first conversion type corresponding to the query statement
  • the conversion trigger instruction is a second conversion type corresponding to the function block statement.
  • the step of converting the script statement to be converted into a target script statement corresponding to the number of converted lines comprises:
  • the number of lines of the script statement to be converted is displayed on the conversion interface, and the script statement to be converted and the target script statement of the number of lines are displayed correspondingly.
  • the step of displaying the number of rows of the script to be converted and the target script statement after the step comprises:
  • the present application further provides a script statement conversion apparatus, where the script statement conversion apparatus includes: a memory, a processor, a communication bus, and a script statement conversion 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 script statement conversion 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 script statement conversion method and device and the computer readable storage medium of the embodiment determine the number of conversion lines of the script statement to be converted when the conversion interface of the terminal receives the script statement to be converted; and when determining the conversion trigger instruction, determining The type of the trigger instruction is converted to convert the script statement to be converted into a target script statement according to the type of the conversion trigger instruction.
  • the program converts the script statement to be converted into a target script statement.
  • the conversion script can be added by the conversion.
  • the number or comma generates the target script statement.
  • different target script statements can be converted to avoid manual scripting by developers, and the conversion efficiency is high.
  • FIG. 1 is a schematic flow chart of a first embodiment of a script statement conversion method of the present application
  • FIG. 2 is a schematic flow chart of a second embodiment of a script statement conversion method of the present application.
  • FIG. 3 is a schematic flow chart of a third embodiment of a script statement conversion method of the present application.
  • FIG. 4 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. 5 is a schematic diagram of a query statement conversion of a script statement conversion method of the present application.
  • FIG. 6 is a schematic diagram of functional block statement conversion of the script statement conversion method of the present application.
  • the application provides a script statement conversion method.
  • FIG. 1 is a schematic flowchart diagram of a first embodiment of a script statement conversion method according to the present application.
  • the script statement conversion method includes:
  • Step S10 determining, when the conversion interface of the terminal receives the script statement to be converted, determining the number of conversion lines of the script statement to be converted;
  • the script statement conversion method of the embodiment is adapted to convert a statement input by a user to obtain a target script statement that meets a user's requirement, wherein the converted statement may be a single query statement or a plurality of function block statements.
  • a script is an extension of a batch file. It is a plain text save program consisting of a series of text commands. Each text command is a script statement.
  • the statement before the conversion is the script statement to be converted, the user inputs the script statement to be converted with the conversion requirement into the conversion interface of the terminal, the terminal may be a tablet computer or a mobile computer, and the conversion interface is a conversion software for implementing script statement conversion. interface.
  • the conversion software is installed on the terminal, and a shortcut icon is displayed on the desktop of the terminal; when there is a conversion requirement, double-click the shortcut icon to open the conversion software, display the conversion interface, and input the script to be converted in the conversion interface displayed on the terminal.
  • the conversion interface of the terminal receives the conversion script statement, and detects whether a conversion trigger instruction is received.
  • the conversion trigger instruction is a conversion trigger for starting the received script statement to be converted, and when the conversion trigger instruction is received, the conversion script statement is started. Conversion.
  • Step S20 when receiving the conversion trigger instruction, determining the type of the conversion trigger instruction
  • the conversion trigger instruction when the conversion trigger instruction is received, it indicates that the user has a requirement to convert the input script statement to be converted, and the conversion operation can be started.
  • the conversion of the embodiment can be performed for a single statement of a query statement, it can also be converted for multiple statements of the entire function block that implements a certain function; for different types of conversions, the type of the conversion trigger instruction is not The same, so after the conversion trigger instruction is received, the type of the conversion trigger instruction needs to be determined before the conversion. Since the conversion interface of the single statement conversion and the multiple statement conversion is different, the type of the conversion trigger instruction can be determined by receiving the interface of the conversion trigger instruction.
  • the type of the conversion trigger instruction may be determined to be a type corresponding to a single statement conversion, and when the interface that receives the conversion trigger instruction is used for multiple
  • the conversion interface of the statement conversion can determine the type of the conversion trigger instruction as the type corresponding to the conversion of multiple statements. In turn, according to the specific type of the conversion trigger instruction, the conversion statement is converted in a targeted manner.
  • Step S30 Convert the script statement to be converted into a target script statement corresponding to the type according to the type of the conversion trigger instruction.
  • the conversion script statement is converted according to the type of the conversion trigger instruction.
  • the script statement to be converted includes a query statement and a function block statement, and the type of the conversion trigger instruction is further divided into a first conversion type corresponding to the query statement and a second conversion type corresponding to the function block statement. Therefore, according to the type of the conversion trigger instruction, the step of converting the script statement to be converted into the target script statement corresponding to the type includes:
  • Step S31 when the type of the conversion trigger instruction is the first conversion type corresponding to the query statement, adding a first identifier between the row and the row of the script statement to be converted, to convert the script statement to be converted into the first conversion The target script statement corresponding to the type;
  • Step S32 when the type of the conversion trigger instruction is the second conversion type corresponding to the function block statement, adding a second identifier between the line and the line of the script statement to be converted, to convert the script statement to be converted into the second The target script statement corresponding to the conversion type.
  • the script statement to be converted is a script statement that needs to be converted into a query statement type, and the items of the query statement may be quoted by single quotes, and the items are separated by commas. Therefore, when the type of the conversion trigger instruction is the first conversion type, the first identifier is added between the row and the row of the script to be converted, and the script statement to be converted is converted into the target script statement of the query statement.
  • the script statement to be converted is a single item
  • the first identifier adds a single quotation mark to the script statement to be converted for the single item; when there are multiple items to be converted, the first identifier is for each of the plurality of items.
  • a conversion interface of a terminal includes two left and right display frames, and a virtual button for transmitting a conversion trigger instruction between the two display frames, and the left display frame is configured to receive and display a script to be converted.
  • the virtual button that detects the conversion trigger instruction is triggered, the script statement to be converted on the left side is converted, and the target script statement obtained after the conversion is displayed in the display box on the right side.
  • the left display box has a lot of items to be converted, and each item is displayed in the left side display box in a row. After the conversion, the generated target script statement is displayed on the right side in the same line as one line.
  • the first identifier can also be double quotes, parentheses, etc., which can be set according to user requirements.
  • the type of the conversion trigger instruction is the second conversion type, indicating that the script statement to be converted is a script statement that needs to be converted into a function block statement type
  • a second identifier is added between the row and the row of the script to be converted, which is to be converted.
  • the script statement is converted to the target script statement of the function block statement.
  • the function block statement includes a multi-line statement, and the database executes the multi-line statement to implement a certain function.
  • the function blocks for similar functions can be coded by means of code copying and pasting to improve the writing speed.
  • the code implementing function A is executed by the database, so that the function block statement implementing function A can be copied to implement the function of function B.
  • the newline characters, spaces, etc. in the function block statement are deleted to form a whole block code, and the line and line division are not performed according to the original function block statement, which is not conducive to the code reading inheritance. Therefore, it is necessary to add a newline character, a space, and the like to the function block statement to be copied.
  • a conversion interface of a terminal includes two upper and lower display frames, and a virtual button for transmitting a conversion trigger instruction between the two display frames, and the upper display frame is used for receiving the display as a script to be converted.
  • the function block statement converts the upper function block statement when the virtual button that detects the conversion trigger instruction is triggered, and displays the converted target script statement in the lower display box.
  • the function block statement of the upper display box includes a plurality of different lines.
  • a new line character and a semicolon as the second identifier are added to each line to perform the division between the items and the items, so that the number is increased.
  • a script statement corresponding to the format of the script statement to be converted can be obtained.
  • the second identifier may also be a single quotation mark, a double quotation mark, etc., which can be set according to user requirements.
  • the first identifier is added between the row and the row of the script statement to be converted, and the script statement to be converted is converted to correspond to the first conversion type.
  • the steps of the target script statement include:
  • Step S311 determining whether the current line number of the script statement to be converted is the last line of the number of converted lines;
  • Step S312 when the current line number of the script statement to be converted is the last line of the number of converted lines, the space between the line and the line at the end of the last line is canceled, and the script statement to be converted is converted into the first conversion type. Target script statement.
  • the script statement to be converted is a query statement
  • there may be multiple items that is, there are multiple query statements as the script statement to be converted.
  • the read data When there is no data, the read data is null; if the current line number is not the last line, and the next line has data, the read data is not null; thus, whether the read data is null or not is judged.
  • the read data When the read data is null, it indicates that the current row number of the script to be converted is the last row of the number of converted rows, and the interval between the row and the row at the end of the last row is canceled, that is, the row is not added.
  • the separator between the line and the line completes the conversion of the query statement to be converted to the target script statement.
  • the second delimiter is added between the row and the row of the script statement to be converted, and the script statement to be converted is converted to correspond to the second conversion type.
  • the steps of the target script statement are followed by:
  • Step S33 when receiving the variable replacement request, acquiring the replacement quantity and the variable to be replaced corresponding to the variable replacement request, and determining the replacement quantity of the variable to be replaced;
  • Step S33 the variable to be replaced corresponding to the replacement quantity in the target script statement is replaced with the replacement quantity.
  • the statement to be converted is a function block statement
  • there may be a variable for inputting information to the outside world in the function block statement and the result obtained by executing the function block statement is different according to different input information of the outside world.
  • the variable In the conversion process, there is no recognition function for the variable, and the variable may be converted as a normal amount, so that the function block statement cannot implement its original function, or an abnormality occurs during the conversion process.
  • a replacement function is set in the conversion interface, and the variable that cannot be recognized in the conversion process is replaced with an identifiable quantity by the replacement function. Referring to FIG. 6 further, two input boxes and one virtual button are arranged between the upper and lower display boxes in the conversion interface.
  • the two input boxes are used for input variables and replacement quantities respectively, and the virtual button user triggers to replace variables with replacement. the amount.
  • the virtual key When it is detected that the virtual key is triggered, it is used as a variable replacement request, and after receiving the variable replacement request, the replacement quantity corresponding to the variable replacement request and the variable to be replaced are acquired.
  • the variable to be replaced is the variable, and the number of variables to be replaced that need to be replaced is determined. According to the number of variables to be replaced that need to be replaced, the variable to be replaced in the converted target script statement is replaced with the replacement amount to ensure the function of the converted function block statement.
  • a second embodiment of the script statement conversion method of the present application is proposed.
  • the conversion interface is received at the terminal.
  • the steps to be converted to the script statement include:
  • Step S40 when the terminal receives the startup instruction for starting the conversion application, starting the conversion application
  • Step S50 when the conversion application receives the trigger instruction of the query statement conversion, the control conversion application jumps to the conversion interface of the query statement;
  • Step S60 when the conversion application receives the trigger instruction of the function block statement conversion, the control conversion application jumps to the conversion interface of the function block statement.
  • the script statement to be converted is performed by converting the application software, and the conversion application software is installed on the terminal, so that the conversion application software needs to be started before the conversion of the script statement to be converted is performed.
  • the conversion application is started to enter the first page of the conversion application.
  • a selection button is set on the first page to select the type of the script to be converted, that is, to select a query or a function block statement.
  • the control conversion application jumps to the conversion interface of the query statement to perform the query statement conversion; and when the conversion application receives the trigger instruction of the function block statement conversion, the control conversion is performed.
  • the application jumps to the conversion interface of the function block statement to perform function block statement conversion; through this different selection trigger, different types of script statements to be converted are converted to meet different needs of the user.
  • the step of determining the type of the conversion trigger instruction includes:
  • Step S21 when receiving the conversion trigger instruction, determining the type of the current interface according to the type of the control of the current display interface of the conversion application;
  • Step S22 if the current interface is a conversion interface of the query statement, the conversion trigger instruction is a first conversion type corresponding to the query statement;
  • Step S23 if the current interface is a conversion interface of the function block statement, the conversion trigger instruction is a second conversion type corresponding to the function block statement.
  • the types of the scripts to be converted are different, and the types of the corresponding conversion interfaces and the conversion triggering instructions are different, so that the type of the conversion triggering instruction can be determined by the type of the current interface, according to the type of the conversion triggering instruction.
  • the corresponding script statement to be converted is converted. Specifically, when the conversion trigger instruction is received, the type of the current interface is determined, wherein the determined manner can be performed by detecting a control used to display the current interface in the background, and the control is a component having a user interface.
  • the current interface When the control for displaying the current interface is a conversion control of the query statement, that is, the current display interface displays the conversion interface of the query statement, the current interface may be determined as a conversion interface of the query statement; when the control for displaying the current interface is The conversion control of the function block statement, that is, the current display interface displays the conversion interface of the function block statement, the current interface can be determined as the conversion interface of the function block statement.
  • the conversion trigger instruction is determined to be a second conversion type corresponding to the function block statement; according to the first conversion type or the second conversion type, the conversion script statement is converted.
  • the method includes:
  • Step S60 displaying the number of lines of the script statement to be converted in the conversion interface, and displaying the number of lines of the script to be converted and the target script statement.
  • the number of rows of the script to be converted in the conversion interface is displayed, and the script statement to be converted and the target script statement of the row are displayed correspondingly.
  • the user can grasp the basic situation of the conversion by converting the number of lines of the previous statement and the number of lines of the converted statement.
  • the number of rows before the conversion is the same as the number of rows after the conversion, it indicates that the conversion is normal, and the number of rows missing after the conversion, or the number of rows is increased, etc., which is abnormal.
  • the number of rows of the script to be converted is to perform a line-by-line detection on the input script statement to be converted when the script statement to be converted is input to the display box of the conversion interface, and determine whether the detection line has a script statement to be converted.
  • the number of rows of the script to be converted is incremented by one until the last row, and the sum of the counts is the number of rows of the entire statement to be converted.
  • comparing and determining whether the converted target script statement lacks the number of rows increases the number of rows, or increases the first identifier or the second identifier for each row of the target script statement. .
  • the conversion interface is also provided with a clear virtual button for clearing the content displayed in the display box in the conversion interface.
  • a clear virtual button for clearing the content displayed in the display box in the conversion interface.
  • the above-mentioned storage medium may be a read only memory, a magnetic disk or an optical disk or the like.
  • FIG. 4 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 script statement conversion device in the embodiment of the present application may be a PC, or may be a smart phone, a tablet computer, an e-book reader, and an MP3 (Moving). Picture Experts Group Audio Layer III, motion picture expert compresses standard audio layer 3) player, MP4 (Moving Picture Experts Group Audio Layer IV, dynamic video experts compress standard audio layers 3) terminal devices such as players and portable computers.
  • the script statement conversion means 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 script statement conversion 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 script statement conversion device shown in FIG. 4 does not constitute a limitation on the script sentence conversion device, and may include more or less components than those illustrated, or combine some components, or different. Parts layout.
  • an operating system As shown in FIG. 4, an operating system, a network communication module, and a script statement conversion program may be included in the memory 1005 as a computer storage medium.
  • the operating system is a program that manages and controls script statements to translate device hardware and software resources, and supports the operation of script statement conversion programs and other software and/or programs.
  • the network communication module is used to implement communication between components within the memory 1005 and with other hardware and software in the script statement conversion device.
  • the processor 1001 is configured to execute a script statement conversion program stored in the memory 1005, and implement the steps in the embodiments of the script statement conversion 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 script statement conversion method steps in various embodiments.
  • 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)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Quality & Reliability (AREA)
  • Computer Hardware Design (AREA)
  • Mathematical Physics (AREA)
  • Computational Linguistics (AREA)
  • Stored Programmes (AREA)
  • Machine Translation (AREA)

Abstract

一种脚本语句转换方法、装置及计算机可读存储介质,所述脚本语句转换方法包括:在终端的转换界面接收待转换脚本语句,并检测是否接收到转换触发指令(S10);当接收到转换触发指令时,确定转换触发指令的类型(S20);根据所述转换触发指令的类型,将待转换脚本语句转换为与所述类型对应的目标脚本语句(S30)。上述方法根据转换触发指令的类型,将待转换脚本语句转换为目标脚本语句,当转换触发指令的类型为对待转换脚本语句增加分号或逗号形成查询条件时,通过转换即可对待转换脚本增加分号或逗号生成目标脚本语句。对于不同类型的转换触发指令,可转换得到不同的目标脚本语句,避免开发人员的手动编写脚本,转换效率高。

Description

脚本语句转换方法、装置及计算机可读存储介质
本申请要求于2017年10月26日提交中国专利局、申请号为201711030554.6、发明名称为“脚本语句转换方法、装置及计算机可读存储介质”的中国专利申请的优先权,其全部内容通过引用结合在申请中。
技术领域
本申请主要涉及计算机应用技术领域,具体地说,涉及一种脚本语句转换方法、装置及计算机可读存储介质。
背景技术
数据库在完成开发,投入市场使用之前,需要经过测试;或者在使用过程中,出现问题时,需要进行检测确定问题点;此测试或检测过程均需要使用SQL的条件查询。条件查询时采用“IN”带变量的形式作为查询条件进行查询,各变量之间用单引号引用,且各项之间用逗号隔开,如IN('A','B','C');当IN带的变量特别多时,手动输入查询条件需要花费大量时间。
发明内容
本申请的主要目的是提供一种脚本语句转换方法、装置及计算机可读存储介质,旨在解决现有技术中手动输入查询条件,耗费时间多的问题。
为实现上述目的,本申请提供一种脚本语句转换方法,所述脚本语句转换方法包括以下步骤:
在终端的转换界面接收待转换脚本语句,并检测是否接收到转换触发指令;
当接收到转换触发指令时,确定转换触发指令的类型;
根据所述转换触发指令的类型,将待转换脚本语句转换为与所述类型对应的目标脚本语句。
优选地,所述待转换脚本语句包括查询语句和功能块语句;
所述根据所述转换触发指令的类型,将待转换脚本语句转换为与所述类型对应的目标脚本语句的步骤包括:
当转换触发指令的类型为与查询语句对应的第一转换类型时,在待转换脚本语句的行与行之间增加第一标识符,以将待转换脚本语句转换为与第一转换类型对应的目标脚本语句;
当转换触发指令的类型为与功能块语句对应的第二转换类型时,在待转换脚本语句的行与行之间增加第二标识符,以将待转换脚本语句转换为与第二转换类型对应的目标脚本语句。
优选地,所述在待转换脚本语句的行与行之间增加第一标识符,以将待转换脚本语句转换为与第一转换类型对应的目标脚本语句的步骤包括:
判断待转换脚本语句的当前行数是否为转换行数的最后一行;
当待转换脚本语句的当前行数是转换行数的最后一行时,将最后一行末尾的行与行之间的间隔符取消,将待转换脚本语句转换为与第一转换类型对应的目标脚本语句。
优选地,所述在待转换脚本语句的行与行之间增加第二分隔符,以将待转换脚本语句转换为与第二转换类型对应的目标脚本语句的步骤之后包括:
当接收到变量替换请求时,获取与变量替换请求所对应的替换量与待替换变量,并确定待替换变量的替换数量;
将目标脚本语句中与替换数量对应的待替换变量替换为替换量。
优选地,所述在终端的转换界面接收待转换脚本语句的步骤之前包括:
当终端接收到启动转换应用的启动指令时,对转换应用进行启动;
当转换应用接收到查询语句转换的触发指令时,控制转换应用跳转到查询语句的转换界面;
当转换应用接收到功能块语句转换的触发指令时,控制转换应用跳转到功能块语句的转换界面。
优选地,所述当接收到转换触发指令时,确定转换触发指令的类型的步骤包括:
当接收到转换触发指令时,根据转换应用当前显示界面的控件类型确定当前界面的类型;
若当前界面为查询语句的转换界面时,转换触发指令为与查询语句对应的第一转换类型;
若当前界面为功能块语句的转换界面时,转换触发指令为与功能块语句对应的第二转换类型。
优选地,所述将待转换脚本语句转换为与转换行数对应的目标脚本语句的步骤之后包括:
在转换界面显示待转换脚本语句的行数,并将所述行数的待转换脚本语句和目标脚本语句对应显示。
优选地,所述将所述行数的待转换脚本语句和目标脚本语句对应显示的步骤之后包括:
当接收到清除指令时,将转换界面中显示的待转换脚本语句和目标脚本语句清除。
此外,为实现上述目的,本申请还提出一种脚本语句转换装置,所述脚本语句转换装置包括:存储器、处理器、通信总线以及存储在所述存储器上的脚本语句转换程序;
所述通信总线用于实现处理器和存储器之间的连接通信;
所述处理器用于执行所述脚本语句转换程序,以实现以下步骤:
在终端的转换界面接收待转换脚本语句,并检测是否接收到转换触发指令;
当接收到转换触发指令时,确定转换触发指令的类型;
根据所述转换触发指令的类型,将待转换脚本语句转换为与所述类型对应的目标脚本语句。
此外,为实现上述目的,本申请还提供一种计算机可读存储介质,所述计算机可读存储介质存储有一个或者一个以上程序,所述一个或者一个以上程序可被一个或者一个以上的处理器执行以用于:
在终端的转换界面接收待转换脚本语句,并检测是否接收到转换触发指令;
当接收到转换触发指令时,确定转换触发指令的类型;
根据所述转换触发指令的类型,将待转换脚本语句转换为与所述类型对应的目标脚本语句。
本实施例的脚本语句转换方法、装置及计算机可读存储介质,当终端的转换界面接收到待转换脚本语句时,确定待转换脚本语句的转换行数;并在接收到转换触发指令时,确定转换触发指令的类型,以根据转换触发指令的类型,将待转换脚本语句转换为目标脚本语句。本方案根据转换触发指令的类型,将待转换脚本语句转换为目标脚本语句,当转换触发指令的类型为对待转换脚本语句增加分号或逗号形成查询条件时,通过转换即可对待转换脚本增加分号或逗号生成目标脚本语句。对于不同类型的转换触发指令,可转换得到不同的目标脚本语句,避免开发人员的手动编写脚本,转换效率高。
附图说明
图1是本申请的脚本语句转换方法第一实施例的流程示意图;
图2是本申请的脚本语句转换方法第二实施例的流程示意图;
图3是本申请的脚本语句转换方法第三实施例的流程示意图;
图4是本申请实施例方法涉及的硬件运行环境的设备结构示意图;
图5是本申请的脚本语句转换方法的查询语句转换示意图;
图6是本申请的脚本语句转换方法的功能块语句转换示意图。
本申请目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。
具体实施方式
应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。
本申请提供一种脚本语句转换方法。
请参照图1,图1为本申请脚本语句转换方法第一实施例的流程示意图。在本实施例中,所述脚本语句转换方法包括:
步骤S10,在终端的转换界面接收到待转换脚本语句时,确定待转换脚本语句的转换行数;
本实施例的脚本语句转换方法适用于对用户输入的语句进行转换,得到符合用户需求的目标脚本语句,其中转换的语句可以是单条的查询语句也可以是多条的功能块语句。脚本是批处理文件的延伸,是一种纯文本保存的程序,由一条条的文字命令组成,每一条文字命令即为一条脚本语句。进行转换之前的语句为待转换脚本语句,用户将有转换需求的待转换脚本语句输入到终端的转换界面,终端可以是平板电脑或移动电脑,转换界面为用于实现脚本语句转换的转换软件的界面。转换软件安装在终端上,在终端的桌面上显示有快捷方式图标;当有转换需求时,双击快捷方式图标打开转换软件,显示转换界面,在此终端显示的转换界面输入待转换脚本语句。终端的转换界面对待转换脚本语句进行接收,并检测是否接收到转换触发指令,转换触发指令为开始对接收的待转换脚本语句的转换触发,在接收到转换触发指令时,开始对待转换脚本语句进行转换。
步骤S20,当接收到转换触发指令时,确定转换触发指令的类型;
进一步地,当接收到转换触发指令时,则说明用户有将输入的待转换脚本语句进行转换的需求,可以开始转换操作。但是考虑到本实施例的转换可针对查询语句的单条语句进行转换,也可以针对实现某个功能的整个功能块的多条语句进行转换;对于不同的类型的转换,转换触发指令的类型也不相同,从而在接收到转换触发指令之后,进行转换之前,需要对转换触发指令的类型进行确定。因单条语句转换和多条语句转换两者的转换界面不一样,从而可通过接收到转换触发指令的界面确定转换触发指令的类型。如接收到转换触发指令的界面为用于单条语句转换的转换界面,则可将转换触发指令的类型确定为与单条语句转换对应的类型,而当接收到转换触发指令的界面为用于多条语句转换的转换界面,则可将转换触发指令的类型确定为与多条语句转换对应的类型。进而根据转换触发指令的具体类型,对待转换语句进行有针对性的转换。
步骤S30,根据所述转换触发指令的类型,将待转换脚本语句转换为与所述类型对应的目标脚本语句。
在确定转换触发指令的类型后,根据转换触发指令的类型,对待转换脚本语句进行转换。待转换脚本语句包括查询语句和功能块语句,转换触发指令的类型也相应分为与查询语句对应的第一转换类型和与功能块语句对应的第二转化类型。从而根据所述转换触发指令的类型,将待转换脚本语句转换为与所述类型对应的目标脚本语句的步骤包括:
步骤S31,当转换触发指令的类型为与查询语句对应的第一转换类型时,在待转换脚本语句的行与行之间增加第一标识符,以将待转换脚本语句转换为与第一转换类型对应的目标脚本语句;
步骤S32,当转换触发指令的类型为与功能块语句对应的第二转换类型时,在待转换脚本语句的行与行之间增加第二标识符,以将待转换脚本语句转换为与第二转换类型对应的目标脚本语句。
当转换触发指令的类型为第一转换类型时,说明待转换脚本语句为需要转换为查询语句类型的脚本语句,查询语句的项可用单引号引用,项与项之间用逗号隔开。从而在转换触发指令的类型为第一转换类型时,则对待转换脚本语句的行与行之间增加第一标识符,将待转换脚本语句转换为查询语句的目标脚本语句。当待转换脚本语句为单项时,则第一标识符为对此单项的待转换脚本语句增加单引号;当待转换脚本语句有多项时,则第一标识符为对多项中每一项的待转换脚本语句增加单引号,且在多项的项与项之间增加逗号。请参照图5,在一终端的转换界面中,包括左右两个显示框,以及位于两个显示框之间用于发送转换触发指令的虚拟按键,左侧显示框用于接收显示待转换脚本语句,当检测到转换触发指令的虚拟按键被触发时,对左侧的待转换脚本语句进行转换,并将转换后得到的目标脚本语句显示在右侧的显示框中。左侧显示框有很多项待转换语句,每项以占据一行的方式显示在左侧显示框中,在转换之后,生成的目标脚本语句同样的以一项占据一行的方式显示在右侧的显示框中,且每项都增加了作为第一标识符的单引号及逗号,以进行项与项之间的区别,并根据此增加第一标识符的目标脚本语句进行SQL的条件查询。此第一标识符也可以是双引号、括号等,其可根据用户需求进行设定。
当转换触发指令的类型为第二转换类型时,说明待转换脚本语句为需要转换为功能块语句类型的脚本语句,则对待转换脚本语句的行与行之间增加第二标识符,将待转换脚本语句转换为功能块语句的目标脚本语句。功能块语句包括多行语句,数据库执行此多行语句实现某一功能。在代码开发过程中,考虑到代码编写的快捷性,对于相似功能的功能块可通过代码复制、粘贴的方式进行代码编写,以提高编写速度。如功能A和功能B的功能类似,实现功能A的代码经数据库执行无误,从而可将实现功能A的功能块语句复制用于实现功能B的功能。在复制使用的过程中,会将功能块语句中的换行符、空格等删除,形成整块代码,不按照原功能块语句进行行与行划分,不利于代码的阅读继承。从而需要对此复制的功能块语句增加换行符、空格等,本实施例可实现对作为待转换脚本语句的功能块语句增加作为第二标识符的换行符、空格等,生成目标脚本语句,避免开发人员手动编写增加换行符、空格等。请参照图6,在一终端的转换界面中,包括上下两个显示框,以及位于两个显示框之间用于发送转换触发指令的虚拟按键,上方显示框用于接收显示作为待转换脚本语句的功能块语句,当检测到转换触发指令的虚拟按键被触发时,对上方的功能块语句进行转换,并将转换后得到的目标脚本语句显示在下方的显示框中。上方显示框的功能块语句包括多个不同的行,在转换之后,对每行增加作为第二标识符的换行符以及分号,以进行项与项之间的分割区别,使对此增加第二标识符的目标脚本语句进行复制时,可得到和待转换脚本语句对应格式的脚本语句。此第二标识符也可以是单引号、双引号等,其可根据用户需求进行设定。
进一步地,在本申请脚本语句转换方法的另一实施例中,所述在待转换脚本语句的行与行之间增加第一标识符,将待转换脚本语句转换为与第一转换类型对应的目标脚本语句的步骤包括:
步骤S311,判断待转换脚本语句的当前行数是否为转换行数的最后一行;
步骤S312,当待转换脚本语句的当前行数是转换行数的最后一行时,将最后一行末尾的行与行之间的间隔符取消,将待转换脚本语句转换为与第一转换类型对应的目标脚本语句。
可理解地,待转换脚本语句为查询语句时,其可能有多项,即作为待转换脚本语句的查询语句有多条。在转换时,对各项增加单引号的同时,还需要对项与项之间增加作为分隔符的逗号。当转换到多项查询语句的最后一项,其后没有其他查询语句时,不需要对此最后一项增加分隔符。从而本实施例对待转换脚本语句的当前行数是否为转换行数的最后一行进行判断,具体地,通过读取当前行数的后一行数据进行判断,若当前行数为最后一行,其后一行没有数据时,读取的数据为空值;若当前行数不为最后一行,其后一行有数据,则读取的数据不为空值;从而通过读取的数据是否为空值进行判断。当读取的数据为空值时,则说明待转换脚本语句的当前行数是转换行数的最后一行,将此最后一行末尾处的行与行之间的间隔符取消,即不对其增加行与行之间的分割符,完成将作为待转换脚本语句的查询语句转换为目标脚本语句的转换。
进一步地,在本申请脚本语句转换方法的另一实施例中,所述在待转换脚本语句的行与行之间增加第二分隔符,将待转换脚本语句转换为与第二转换类型对应的目标脚本语句的步骤之后包括:
步骤S33,当接收到变量替换请求时,获取与变量替换请求所对应的替换量与待替换变量,并确定待替换变量的替换数量;
步骤S33,将目标脚本语句中与替换数量对应的待替换变量替换为替换量。
更进一步地,当待转换语句为功能块语句时,功能块语句中可能存在用于供外界输入信息的变量,根据外界输入信息的不同,执行功能块语句所得的结果存在差异。在转换过程中,不具有对变量的识别功能,可能出现将变量当做普通量进行转换,使功能块语句不能实现其原本功能,或者转换过程中出现异常的情况。本实施例在转换界面设置有替换功能,通过替换功能将转换过程中不能识别的变量替换为可识别的量值。请进一步参照图6,转换界面中的上下两个显示框之间设置有两个输入框和一个虚拟按键,两个输入框分别用于输入变量和替换量,虚拟按键用户触发将变量替换为替换量。当检测到此虚拟按键被触发,将其作为变量替换请求,在接收到此变量替换请求后,获取与变量替换请求对应的替换量以及待替换变量。其中待替换变量即为变量,并确定需要替换的待替换变量的数量。根据此需要替换的待替换变量的数量,将转换后的目标脚本语句中的待替换变量替换为替换量,以确保转换后功能块语句的功能。
进一步地,请参照图2,在本申请脚本语句转换方法第一实施例的基础上,提出本申请脚本语句转换方法第二实施例,在第二实施例中,所述在终端的转换界面接收待转换脚本语句的步骤之前包括:
步骤S40,当终端接收到启动转换应用的启动指令时,对转换应用进行启动;
步骤S50,当转换应用接收到查询语句转换的触发指令时,控制转换应用跳转到查询语句的转换界面;
步骤S60,当转换应用接收到功能块语句转换的触发指令时,控制转换应用跳转到功能块语句的转换界面。
更进一步地,待转换脚本语句通过转换应用软件进行,转换应用软件安装在终端上,从而在进行待转换脚本语句转换之前,需要对转换应用软件进行启动。当终端接收到启动转换应用的启动指令时,对此转换应用进行启动,进入到转换应用的首页面。在其首页面设置有选择按键,以对待转换脚本语句的类型进行选择,即选择对查询语句或功能块语句进行转换。当转换应用接收到查询语句转换的触发指令时,则控制转换应用跳转到查询语句的转换界面,以进行查询语句转换;而当转换应用接收到功能块语句转换的触发指令时,则控制转换应用跳转到功能块语句的转换界面,以进行功能块语句转换;通过此不同的选择触发,实现不同类型的待转换脚本语句的转换,满足用户的不同需求。
进一步地,在本申请脚本语句转换方法的另一实施例中,所述当接收到转换触发指令时,确定转换触发指令的类型的步骤包括:
步骤S21,当接收到转换触发指令时,根据转换应用当前显示界面的控件类型确定当前界面的类型;
步骤S22,若当前界面为查询语句的转换界面时,转换触发指令为与查询语句对应的第一转换类型;
步骤S23,若当前界面为功能块语句的转换界面时,转换触发指令为与功能块语句对应的第二转换类型。
可理解地,待转换脚本语句的类型不同,相应的转换界面以及转换触发指令的类型均不同,从而可通过当前界面的类型确定转换触发指令的类型,以根据转换触发指令的类型对与此类型对应的待转换脚本语句进行转换。具体地,当接收到转换触发指令时,确定当前界面的类型,其中确定的方式可通过检测后台用于显示当前界面的控件进行,控件是具有用户界面的组件。当用于显示当前界面的控件为查询语句的转换控件,即当前显示界面显示的是查询语句的转换界面,则可将当前界面确定为查询语句的转换界面;当用于显示当前界面的控件为功能块语句的转换控件,即当前显示界面显示的是功能块语句的转换界面,则可将当前界面确定为功能块语句的转换界面。根据此当前界面的类型,确定转换触发指令的类型;若当前界面为查询语句的转换界面时,则确定转换触发指令为与查询语句对应的第一转换类型;而当前界面为功能块语句的转换界面时,则确定转换触发指令为与功能块语句对应的第二转换类型;根据此第一转换类型或第二转换类型,对待转换脚本语句进行转换。
进一步地,请参照图3,在本申请脚本语句转换方法第一实施例或第二实施例的基础上,提出本申请脚本语句转换方法第三实施例,在第三实施例中,所述将待转换脚本语句转换为与转换行数对应的目标脚本语句的步骤之后包括:
步骤S60,在转换界面显示待转换脚本语句的行数,并将所述行数的待转换脚本语句和目标脚本语句对应显示。
请进一步参照图5或图6,为了更好的体现转换结果,在转换界面中对待转换脚本语句的行数进行显示,同时还将此行数的待转换脚本语句和目标脚本语句对应显示。用户通过转换前语句的行数和转换后语句的行数,即可掌握转换的基本情况。当转换前行数和转换后行数相同,则表明转换初步正常,而转换后缺少行数,或增加行数等,都是不正常的情况。其中待转换脚本语句的行数在将待转换脚本语句输入到转换界面的显示框时,对输入的待转换脚本语句进行逐行检测,确定检测行是否有待转换脚本语句。当有待转换脚本语句时,则对待转换脚本语句的行数计数加1,直到最后一行,计数总和即为待转换整条语句的行数。将待转换脚本语句和目标脚本语句对应显示,进行对比确定转换后的目标脚本语句是否缺少行数、增加行数或目标脚本语句的每一行是否均增加了第一标识符或第二标识符等。此外转换界面还设置有清除虚拟按键,用于清除转换界面中显示框里显示的内容。当接收到清除指令时,将转换界面中显示的待转换脚本语句和目标脚本语句清除,清除后可再次进行待转换脚本语句的转换,满足用户不同的转换需求。
需要说明的是,本领域普通技术人员可以理解实现上述实施例的全部或部分步骤可以通过硬件来完成,也可以通过程序来指令相关的硬件完成,所述的程序可以存储于一种计算机可读存储介质中,上述提到的存储介质可以是只读存储器,磁盘或光盘等。
参照图4,图4是本申请实施例方法涉及的硬件运行环境的装置结构示意图。
本申请实施例脚本语句转换装置可以是PC,也可以是智能手机、平板电脑、电子书阅读器、MP3(Moving Picture Experts Group Audio Layer III,动态影像专家压缩标准音频层面3)播放器、MP4(Moving Picture Experts Group Audio Layer IV,动态影像专家压缩标准音频层面3)播放器、便携计算机等终端设备。
如图4所示,该脚本语句转换装置可以包括:处理器1001,例如CPU,存储器1005,通信总线1002。其中,通信总线1002用于实现处理器1001和存储器1005之间的连接通信。存储器1005可以是高速RAM存储器,也可以是稳定的存储器(non-volatile memory),例如磁盘存储器。存储器1005可选的还可以是独立于前述处理器1001的存储装置。
可选地,该脚本语句转换装置还可以包括用户接口、网络接口、摄像头、RF(Radio Frequency,射频)电路,传感器、音频电路、WiFi模块等等。用户接口可以包括显示屏(Display)、输入单元比如键盘(Keyboard),可选用户接口还可以包括标准的有线接口、无线接口。网络接口可选的可以包括标准的有线接口、无线接口(如WI-FI接口)。
本领域技术人员可以理解,图4中示出的脚本语句转换装置结构并不构成对脚本语句转换装置的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。
如图4所示,作为一种计算机存储介质的存储器1005中可以包括操作系统、网络通信模块以及脚本语句转换程序。操作系统是管理和控制脚本语句转换装置硬件和软件资源的程序,支持脚本语句转换程序以及其它软件和/或程序的运行。网络通信模块用于实现存储器1005内部各组件之间的通信,以及与脚本语句转换装置中其它硬件和软件之间通信。
在图4所示的脚本语句转换装置中,处理器1001用于执行存储器1005中存储的脚本语句转换程序,实现上述脚本语句转换方法各实施例中的步骤。
本申请提供了一种计算机可读存储介质,所述计算机可读存储介质存储有一个或者一个以上程序,所述一个或者一个以上程序还可被一个或者一个以上的处理器执行以用于实现上述脚本语句转换方法各实施例中的步骤。
还需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。
上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在如上所述的一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本申请各个实施例所述的方法。
以上所述仅为本申请的优选实施例,并非因此限制本申请的专利范围,凡是在本申请的构思下,利用本申请说明书及附图内容所作的等效结构变换,或直接/间接运用在其他相关的技术领域均包括在本申请的专利保护范围内。

Claims (20)

  1. 一种脚本语句转换方法,其特征在于,所述脚本语句转换方法包括以下步骤:
    在终端的转换界面接收待转换脚本语句,并检测是否接收到转换触发指令;
    当接收到转换触发指令时,确定转换触发指令的类型;
    根据所述转换触发指令的类型,将待转换脚本语句转换为与所述类型对应的目标脚本语句。
  2. 如权利要求1所述的脚本语句转换方法,其特征在于,所述待转换脚本语句包括查询语句和功能块语句;
    所述根据所述转换触发指令的类型,将待转换脚本语句转换为与所述类型对应的目标脚本语句的步骤包括:
    当转换触发指令的类型为与查询语句对应的第一转换类型时,在待转换脚本语句的行与行之间增加第一标识符,以将待转换脚本语句转换为与第一转换类型对应的目标脚本语句;
    当转换触发指令的类型为与功能块语句对应的第二转换类型时,在待转换脚本语句的行与行之间增加第二标识符,以将待转换脚本语句转换为与第二转换类型对应的目标脚本语句。
  3. 如权利要求2所述的脚本语句转换方法,其特征在于,所述在待转换脚本语句的行与行之间增加第一标识符,以将待转换脚本语句转换为与第一转换类型对应的目标脚本语句的步骤包括:
    判断待转换脚本语句的当前行数是否为转换行数的最后一行;
    当待转换脚本语句的当前行数是转换行数的最后一行时,将最后一行末尾的行与行之间的间隔符取消,将待转换脚本语句转换为与第一转换类型对应的目标脚本语句。
  4. 如权利要求2所述的脚本语句转换方法,其特征在于,所述在待转换脚本语句的行与行之间增加第二分隔符,以将待转换脚本语句转换为与第二转换类型对应的目标脚本语句的步骤之后包括:
    当接收到变量替换请求时,获取与变量替换请求所对应的替换量与待替换变量,并确定待替换变量的替换数量;
    将目标脚本语句中与替换数量对应的待替换变量替换为替换量。
  5. 如权利要求2所述的脚本语句转换方法,其特征在于,所述在终端的转换界面接收待转换脚本语句的步骤之前包括:
    当终端接收到启动转换应用的启动指令时,对转换应用进行启动;
    当转换应用接收到查询语句转换的触发指令时,控制转换应用跳转到查询语句的转换界面;
    当转换应用接收到功能块语句转换的触发指令时,控制转换应用跳转到功能块语句的转换界面。
  6. 如权利要求5所述的脚本语句转换方法,其特征在于,所述当接收到转换触发指令时,确定转换触发指令的类型的步骤包括:
    当接收到转换触发指令时,根据转换应用当前显示界面的控件类型确定当前界面的类型;
    若当前界面为查询语句的转换界面时,转换触发指令为与查询语句对应的第一转换类型;
    若当前界面为功能块语句的转换界面时,转换触发指令为与功能块语句对应的第二转换类型。
  7. 如权利要求1所述的脚本语句转换方法,其特征在于,所述将待转换脚本语句转换为与转换行数对应的目标脚本语句的步骤之后包括:
    在转换界面显示待转换脚本语句的行数,并将所述行数的待转换脚本语句和目标脚本语句对应显示。
  8. 如权利要求7所述的脚本语句转换方法,其特征在于,所述将所述行数的待转换脚本语句和目标脚本语句对应显示的步骤之后包括:
    当接收到清除指令时,将转换界面中显示的待转换脚本语句和目标脚本语句清除。
  9. 一种脚本语句转换装置,其特征在于,所述脚本语句转换装置包括:存储器、处理器、通信总线以及存储在所述存储器上的脚本语句转换程序;
    所述通信总线用于实现处理器和存储器之间的连接通信;
    所述处理器用于执行所述脚本语句转换程序,以实现以下步骤:
    在终端的转换界面接收待转换脚本语句,并检测是否接收到转换触发指令;
    当接收到转换触发指令时,确定转换触发指令的类型;
    根据所述转换触发指令的类型,将待转换脚本语句转换为与所述类型对应的目标脚本语句。
  10. 如权利要求9所述的脚本语句转换装置,其特征在于,所述待转换脚本语句包括查询语句和功能块语句;
    所述根据所述转换触发指令的类型,将待转换脚本语句转换为与所述类型对应的目标脚本语句的步骤包括:
    当转换触发指令的类型为与查询语句对应的第一转换类型时,在待转换脚本语句的行与行之间增加第一标识符,以将待转换脚本语句转换为与第一转换类型对应的目标脚本语句;
    当转换触发指令的类型为与功能块语句对应的第二转换类型时,在待转换脚本语句的行与行之间增加第二标识符,以将待转换脚本语句转换为与第二转换类型对应的目标脚本语句。
  11. 如权利要求10所述的脚本语句转换装置,其特征在于,所述在待转换脚本语句的行与行之间增加第一标识符,以将待转换脚本语句转换为与第一转换类型对应的目标脚本语句的步骤包括:
    判断待转换脚本语句的当前行数是否为转换行数的最后一行;
    当待转换脚本语句的当前行数是转换行数的最后一行时,将最后一行末尾的行与行之间的间隔符取消,将待转换脚本语句转换为与第一转换类型对应的目标脚本语句。
  12. 如权利要求10所述的脚本语句转换装置,其特征在于,所述在待转换脚本语句的行与行之间增加第二分隔符,以将待转换脚本语句转换为与第二转换类型对应的目标脚本语句的步骤之后,所述处理器用于执行所述脚本语句转换程序,以实现以下步骤:
    当接收到变量替换请求时,获取与变量替换请求所对应的替换量与待替换变量,并确定待替换变量的替换数量;
    将目标脚本语句中与替换数量对应的待替换变量替换为替换量。
  13. 如权利要求10所述的脚本语句转换装置,其特征在于,所述在终端的转换界面接收待转换脚本语句的步骤之前,所述处理器用于执行所述脚本语句转换程序,以实现以下步骤:
    当终端接收到启动转换应用的启动指令时,对转换应用进行启动;
    当转换应用接收到查询语句转换的触发指令时,控制转换应用跳转到查询语句的转换界面;
    当转换应用接收到功能块语句转换的触发指令时,控制转换应用跳转到功能块语句的转换界面。
  14. 如权利要求13所述的脚本语句转换装置,其特征在于,所述当接收到转换触发指令时,确定转换触发指令的类型的步骤包括:
    当接收到转换触发指令时,根据转换应用当前显示界面的控件类型确定当前界面的类型;
    若当前界面为查询语句的转换界面时,转换触发指令为与查询语句对应的第一转换类型;
    若当前界面为功能块语句的转换界面时,转换触发指令为与功能块语句对应的第二转换类型。
  15. 一种计算机可读存储介质,其特征在于,所述计算机课读存储介质上存储有脚本语句转换程序,所述脚本语句转换程序被处理器执行,以实现以下步骤:
    在终端的转换界面接收待转换脚本语句,并检测是否接收到转换触发指令;
    当接收到转换触发指令时,确定转换触发指令的类型;
    根据所述转换触发指令的类型,将待转换脚本语句转换为与所述类型对应的目标脚本语句。
  16. 如权利要求15所述的计算机可读存储介质,其特征在于,所述待转换脚本语句包括查询语句和功能块语句;
    所述根据所述转换触发指令的类型,将待转换脚本语句转换为与所述类型对应的目标脚本语句的步骤包括:
    当转换触发指令的类型为与查询语句对应的第一转换类型时,在待转换脚本语句的行与行之间增加第一标识符,以将待转换脚本语句转换为与第一转换类型对应的目标脚本语句;
    当转换触发指令的类型为与功能块语句对应的第二转换类型时,在待转换脚本语句的行与行之间增加第二标识符,以将待转换脚本语句转换为与第二转换类型对应的目标脚本语句。
  17. 如权利要求16所述的计算机可读存储介质,其特征在于,所述在待转换脚本语句的行与行之间增加第一标识符,以将待转换脚本语句转换为与第一转换类型对应的目标脚本语句的步骤包括:
    判断待转换脚本语句的当前行数是否为转换行数的最后一行;
    当待转换脚本语句的当前行数是转换行数的最后一行时,将最后一行末尾的行与行之间的间隔符取消,将待转换脚本语句转换为与第一转换类型对应的目标脚本语句。
  18. 如权利要求16所述的计算机可读存储介质,其特征在于,所述在待转换脚本语句的行与行之间增加第二分隔符,以将待转换脚本语句转换为与第二转换类型对应的目标脚本语句的步骤之后,所述脚本语句转换程序被处理器执行,以实现以下步骤:
    当接收到变量替换请求时,获取与变量替换请求所对应的替换量与待替换变量,并确定待替换变量的替换数量;
    将目标脚本语句中与替换数量对应的待替换变量替换为替换量。
  19. 如权利要求16所述的计算机可读存储介质,其特征在于,所述在终端的转换界面接收待转换脚本语句的步骤之前,所述脚本语句转换程序被处理器执行,以实现以下步骤:
    当终端接收到启动转换应用的启动指令时,对转换应用进行启动;
    当转换应用接收到查询语句转换的触发指令时,控制转换应用跳转到查询语句的转换界面;
    当转换应用接收到功能块语句转换的触发指令时,控制转换应用跳转到功能块语句的转换界面。
  20. 如权利要求19所述的计算机可读存储介质,其特征在于,所述当接收到转换触发指令时,确定转换触发指令的类型的步骤包括:
    当接收到转换触发指令时,根据转换应用当前显示界面的控件类型确定当前界面的类型;
    若当前界面为查询语句的转换界面时,转换触发指令为与查询语句对应的第一转换类型;
    若当前界面为功能块语句的转换界面时,转换触发指令为与功能块语句对应的第二转换类型。
PCT/CN2018/074809 2017-10-26 2018-01-31 脚本语句转换方法、装置及计算机可读存储介质 WO2019080401A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201711030554.6 2017-10-26
CN201711030554.6A CN107908679B (zh) 2017-10-26 2017-10-26 脚本语句转换方法、装置及计算机可读存储介质

Publications (1)

Publication Number Publication Date
WO2019080401A1 true WO2019080401A1 (zh) 2019-05-02

Family

ID=61841942

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/074809 WO2019080401A1 (zh) 2017-10-26 2018-01-31 脚本语句转换方法、装置及计算机可读存储介质

Country Status (2)

Country Link
CN (1) CN107908679B (zh)
WO (1) WO2019080401A1 (zh)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108875378A (zh) * 2018-06-12 2018-11-23 珠海市君天电子科技有限公司 脚本病毒检测方法、装置、电子设备及存储介质
CN109376166B (zh) * 2018-08-20 2023-07-04 中国平安财产保险股份有限公司 脚本转换方法、装置、计算机设备及存储介质
CN110060667B (zh) * 2019-03-15 2023-05-30 平安科技(深圳)有限公司 语音信息的批量处理方法、装置、计算机设备及存储介质
CN115470229B (zh) * 2022-08-30 2023-04-14 昆仑数智科技有限责任公司 数据表处理方法、装置、电子设备及存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101021877A (zh) * 2007-03-16 2007-08-22 华为技术有限公司 将对象局部属性更新到关系数据库的方法及装置
US20100082536A1 (en) * 2001-08-13 2010-04-01 Crucial Apex Communications Llc Universal data management interface
CN103092980A (zh) * 2013-01-31 2013-05-08 中国科学院自动化研究所 一种数据自动转换与存储的方法及系统
CN103365847A (zh) * 2012-03-27 2013-10-23 腾讯科技(深圳)有限公司 一种自定义网页文件的生成方法和装置

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102426534B (zh) * 2011-11-02 2014-06-04 大唐联仪科技有限公司 一种实现测试脚本语言转换成可执行指令的方法及系统
CN103529773B (zh) * 2013-09-18 2015-01-21 国家电网公司 一种行为控制脚本语言的自动化转化方法
CN105868204B (zh) * 2015-01-21 2019-06-21 中移信息技术有限公司 一种转换Oracle脚本语言SQL的方法及装置
CN104932974B (zh) * 2015-05-28 2018-11-13 国家计算机网络与信息安全管理中心 一种脚本转换方法和装置
US10970277B2 (en) * 2016-01-20 2021-04-06 Oracle International Corporation System and method for dynamic conversion of database accessing scripts during runtime in a mainframe rehosting platform

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100082536A1 (en) * 2001-08-13 2010-04-01 Crucial Apex Communications Llc Universal data management interface
CN101021877A (zh) * 2007-03-16 2007-08-22 华为技术有限公司 将对象局部属性更新到关系数据库的方法及装置
CN103365847A (zh) * 2012-03-27 2013-10-23 腾讯科技(深圳)有限公司 一种自定义网页文件的生成方法和装置
CN103092980A (zh) * 2013-01-31 2013-05-08 中国科学院自动化研究所 一种数据自动转换与存储的方法及系统

Also Published As

Publication number Publication date
CN107908679A (zh) 2018-04-13
CN107908679B (zh) 2020-11-27

Similar Documents

Publication Publication Date Title
WO2019127837A1 (zh) 建表脚本生成方法、装置、设备及计算机可读存储介质
WO2019165691A1 (zh) 自动生成测试案例的方法、装置、设备及可读存储介质
WO2019080401A1 (zh) 脚本语句转换方法、装置及计算机可读存储介质
WO2019119624A1 (zh) 基于Excel表的计算方法、装置、设备及存储介质
WO2019223070A1 (zh) 应用测试方法、装置、设备及可读存储介质
WO2017028601A1 (zh) 智能终端的语音控制方法、装置及电视机系统
WO2019019714A1 (zh) 一种微信客户行为反馈方法、设备及存储介质
WO2017190450A1 (zh) 进程关闭方法及装置
WO2013143341A1 (zh) 一种更新移动终端的应用信息的方法及装置
WO2020224247A1 (zh) 基于区块链的数据溯源方法、装置、设备及可读存储介质
WO2019041832A1 (zh) 修改源数据库表结构的方法、服务器、系统及存储介质
WO2018098880A1 (zh) 网站信息下载方法及装置
WO2016173192A1 (zh) 电视稳定性测试方法及装置
WO2018120430A1 (zh) 一种页面构建方法、终端、计算机可读存储介质及页面构建设备
WO2015144052A1 (en) Method and apparatus for collecting statistics on network information
WO2017063366A1 (zh) 应用启动方法和系统
WO2018053964A1 (zh) 基于安卓系统的语音输入标点符号的方法及装置
WO2019205272A1 (zh) 虚拟机服务提供方法、装置、设备及计算机可读存储介质
WO2017036208A1 (zh) 显示界面中的信息提取方法及系统
WO2017059686A1 (zh) 桌面显示方法及装置
WO2019024472A1 (zh) 数据操作方法、装置及计算机可读存储介质
WO2019127869A1 (zh) 漏洞信息收集方法、装置、设备及可读存储介质
WO2017071223A1 (zh) 电视应用的控制方法及装置
WO2019062093A1 (zh) Raid管理方法、装置及计算机可读存储介质
WO2016206223A1 (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 06/10/2020)

122 Ep: pct application non-entry in european phase

Ref document number: 18870101

Country of ref document: EP

Kind code of ref document: A1