CN107908679B - Script statement conversion method and device and computer readable storage medium - Google Patents

Script statement conversion method and device and computer readable storage medium Download PDF

Info

Publication number
CN107908679B
CN107908679B CN201711030554.6A CN201711030554A CN107908679B CN 107908679 B CN107908679 B CN 107908679B CN 201711030554 A CN201711030554 A CN 201711030554A CN 107908679 B CN107908679 B CN 107908679B
Authority
CN
China
Prior art keywords
conversion
statement
converted
script statement
script
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201711030554.6A
Other languages
Chinese (zh)
Other versions
CN107908679A (en
Inventor
易周成
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN201711030554.6A priority Critical patent/CN107908679B/en
Priority to PCT/CN2018/074809 priority patent/WO2019080401A1/en
Publication of CN107908679A publication Critical patent/CN107908679A/en
Application granted granted Critical
Publication of CN107908679B publication Critical patent/CN107908679B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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

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

The invention discloses a script statement conversion method, a device and a computer readable storage medium, wherein the script statement conversion method comprises the following steps: receiving a script statement to be converted at a conversion interface of a terminal, and detecting whether a conversion trigger instruction is received or not; when a conversion trigger instruction is received, determining the type of the conversion trigger instruction; and converting the script statement to be converted into a target script statement corresponding to the type according to the type of the conversion triggering instruction. According to the scheme, the script statement to be converted is converted into the target script statement according to the type of the conversion trigger instruction, and when the type of the conversion trigger instruction is that a semicolon or comma is added to the script statement to be converted to form a query condition, the semicolon or comma can be added to the script to be converted through conversion to generate the target script statement. Different types of conversion trigger instructions can be converted to obtain different target script statements, so that a developer is prevented from manually writing scripts, and the conversion efficiency is high.

Description

Script statement conversion method and device and computer readable storage medium
Technical Field
The present invention relates to the field of computer application technologies, and in particular, to a method and an apparatus for converting script statements, and a computer-readable storage medium.
Background
The database needs to be tested before being developed and put into market; or in the using process, when a problem occurs, detecting is needed to determine a problem point; this test or detection process requires a conditional query using SQL. When the condition is queried, the query is carried out by adopting a form of 'IN' with variables as query conditions, the variables are referenced by single quotation marks and are separated by commas, such as IN ('A', 'B', 'C'); when the IN band has a particularly large number of variables, it takes a lot of time to manually input the query condition.
Disclosure of Invention
The invention mainly aims to provide a script statement conversion method, a script statement conversion device and a computer readable storage medium, and aims to solve the problem that in the prior art, the query condition is manually input, and much time is consumed.
In order to achieve the above object, the present invention provides a script statement conversion method, which comprises the following steps:
receiving a script statement to be converted at a conversion interface of a terminal, and detecting whether a conversion trigger instruction is received or not;
when a conversion trigger instruction is received, determining the type of the conversion trigger instruction;
and converting the script statement to be converted into a target script statement corresponding to the type according to the type of the conversion triggering instruction.
Preferably, the script statement to be converted comprises a query statement and a function block statement;
the step of converting the script statement to be converted into the target script statement corresponding to the type according to the type of the conversion triggering instruction comprises the following steps:
when the type of the conversion trigger instruction is a first conversion type corresponding to the query statement, adding a first identifier between lines of the script statement to be converted so as to convert the script statement to be converted into a target script statement corresponding to the first conversion type;
and when the type of the conversion trigger instruction is a second conversion type corresponding to the functional block statement, adding a second identifier between lines of the script statement to be converted so as to convert the script statement to be converted into a target script statement corresponding to the second conversion type.
Preferably, the step of adding a first identifier between lines 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 includes:
judging whether the current line number of the script statement to be converted is the last line of the conversion line number;
and when the current line number of the script statement to be converted is the last line of the conversion line number, canceling a line-to-line space character at the tail of the last line, and converting the script statement to be converted into a target script statement corresponding to the first conversion type.
Preferably, the step of adding a second delimiter between lines 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 is followed by the step of:
when a variable replacement request is received, acquiring a replacement quantity and a variable to be replaced corresponding to the variable replacement request, and determining the replacement quantity of the variable to be replaced;
and replacing variables to be replaced corresponding to the replacement quantity in the target script statement with the replacement quantity.
Preferably, the step of receiving the script statement to be converted at the conversion interface of the terminal includes:
when the terminal receives a starting instruction for starting the conversion application, starting the conversion application;
when the conversion application receives a trigger instruction of query statement conversion, controlling the conversion application to jump to a conversion interface of the query statement;
and when the conversion application receives a trigger instruction of the functional block statement conversion, controlling the conversion application to jump to a conversion interface of the functional block statement.
Preferably, when receiving a conversion trigger instruction, the step of determining the type of the conversion trigger instruction comprises:
when a conversion trigger instruction is received, determining the type of the current interface according to the control type of the conversion application current display interface;
if the current interface is a conversion interface of the query statement, converting the trigger instruction into a first conversion type corresponding to the query statement;
and if the current interface is the conversion interface of the function block statement, converting the trigger instruction into a second conversion type corresponding to the function block statement.
Preferably, the step of converting the script statement to be converted into the target script statement corresponding to the number of conversion lines includes:
displaying the line number of the script statement to be converted on a conversion interface, and correspondingly displaying the script statement to be converted and the target script statement of the line number.
Preferably, the step of correspondingly displaying the to-be-converted script statement and the target script statement of the line number includes:
and when a clearing instruction is received, clearing the script statement to be converted and the target script statement displayed in the conversion interface.
In addition, to achieve the above object, the present invention further provides a script sentence converting apparatus, including: the device comprises a memory, a processor, a communication bus and a script statement conversion program stored on the memory;
the communication bus is used for realizing connection communication between the processor and the memory;
the processor is used for executing the script statement conversion program to realize the following steps:
receiving a script statement to be converted at a conversion interface of a terminal, and detecting whether a conversion trigger instruction is received or not;
when a conversion trigger instruction is received, determining the type of the conversion trigger instruction;
and converting the script statement to be converted into a target script statement corresponding to the type according to the type of the conversion triggering instruction.
Further, to achieve the above object, the present invention also provides a computer-readable storage medium storing one or more programs, the one or more programs being executable by one or more processors for:
receiving a script statement to be converted at a conversion interface of a terminal, and detecting whether a conversion trigger instruction is received or not;
when a conversion trigger instruction is received, determining the type of the conversion trigger instruction;
and converting the script statement to be converted into a target script statement corresponding to the type according to the type of the conversion triggering instruction.
In the script statement conversion method of the embodiment, when a conversion interface of a terminal receives a script statement to be converted, the number of conversion lines of the script statement to be converted is determined; and when receiving a conversion trigger instruction, determining the type of the conversion trigger instruction, and converting the script statement to be converted into a target script statement according to the type of the conversion trigger instruction. According to the scheme, the script statement to be converted is converted into the target script statement according to the type of the conversion trigger instruction, and when the type of the conversion trigger instruction is that a semicolon or comma is added to the script statement to be converted to form a query condition, the semicolon or comma can be added to the script to be converted through conversion to generate the target script statement. Different types of conversion trigger instructions can be converted to obtain different target script statements, so that a developer is prevented from manually writing scripts, and the conversion efficiency is high.
Drawings
FIG. 1 is a flow chart diagram of a first embodiment of a script statement conversion method of the present invention;
FIG. 2 is a flowchart illustrating a second embodiment of a script statement conversion method according to the present invention;
FIG. 3 is a flowchart of a third embodiment of a script statement conversion method of the present invention;
FIG. 4 is a schematic diagram of an apparatus architecture of a hardware operating environment to which a method of an embodiment of the invention relates;
FIG. 5 is a query statement conversion diagram of the script statement conversion method of the present invention;
FIG. 6 is a functional block statement conversion diagram of the script statement conversion method of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The invention provides a script statement conversion method.
Referring to fig. 1, fig. 1 is a flowchart illustrating a script statement conversion method according to a first embodiment of the present invention. In this embodiment, the script statement conversion method includes:
step S10, when the conversion interface of the terminal receives the script statement to be converted, determining the conversion line number of the script statement to be converted;
the script statement conversion method of the embodiment is suitable for converting the statement input by the user to obtain the target script statement meeting the user requirement, wherein the converted statement may be a single query statement or a plurality of function block statements. The script is an extension of batch processing files, is a pure text storage program and consists of a strip of word commands, and each word command is a script statement. The sentence before conversion is the script sentence to be converted, the user inputs the script sentence to be converted with the conversion requirement to a conversion interface of the terminal, the terminal can be a tablet computer or a mobile computer, and the conversion interface is an interface of conversion software for realizing the conversion of the script sentence. The conversion software is installed on the terminal, and a shortcut icon is displayed on a desktop of the terminal; and when a conversion requirement exists, double-clicking the shortcut icon to open conversion software, displaying a conversion interface, and inputting a script sentence to be converted into the conversion interface displayed by the terminal. And a conversion interface of the terminal receives the script statement to be converted and detects whether a conversion trigger instruction is received, wherein the conversion trigger instruction is used for starting the conversion trigger of the received script statement to be converted, and when the conversion trigger instruction is received, the script statement to be converted is started to be converted.
Step S20, when receiving the conversion trigger instruction, determining the type of the conversion trigger instruction;
further, when a conversion trigger instruction is received, it indicates that the user has a need to convert the input script statement to be converted, and the conversion operation can be started. However, it is considered that the conversion of the present embodiment may be performed for a single statement of the query statement, or may be performed for a plurality of statements of the whole functional block that implements a certain function; for different types of conversion, the type of the conversion trigger instruction is different, so that after the conversion trigger instruction is received and before the conversion is performed, the type of the conversion trigger instruction needs to be determined. Since the conversion interfaces of the single statement conversion and the multiple statement conversions are different, the type of the conversion trigger instruction can be determined through the interface receiving the conversion trigger instruction. If the interface receiving the conversion trigger instruction is a conversion interface for conversion of a single statement, the type of the conversion trigger instruction may be determined as a type corresponding to conversion of a single statement, and if the interface receiving the conversion trigger instruction is a conversion interface for conversion of a plurality of statements, the type of the conversion trigger instruction may be determined as a type corresponding to conversion of a plurality of statements. And then, performing targeted conversion on the statement to be converted according to the specific type of the conversion trigger instruction.
And step S30, 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.
And after the type of the conversion trigger instruction is determined, converting the script statement to be converted according to the type of the conversion trigger instruction. The script statement to be converted comprises an inquiry statement and a function block statement, and the type of the conversion trigger instruction is also correspondingly divided into a first conversion type corresponding to the inquiry 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 comprises the following steps:
step S31, when the type of the conversion trigger instruction is a first conversion type corresponding to the query statement, adding a first identifier between lines of the script statement to be converted so as to convert the script statement to be converted into a target script statement corresponding to the first conversion type;
and step S32, when the type of the conversion trigger instruction is a second conversion type corresponding to the function block statement, adding a second identifier between lines of the script statement to be converted so as to convert the script statement to be converted into a target script statement corresponding to the second conversion type.
When the type of the conversion trigger instruction is a first conversion type, the script statement to be converted is the script statement needing to be converted into the query statement type, the items of the query statement can be quoted by using the quotation marks, and the items are separated by using commas. Therefore, when the type of the conversion trigger instruction is the first conversion type, the first identifier is added between lines of the script statement to be converted, and the script statement to be converted is converted into the target script statement of the query statement. When the script statement to be converted is a single item, the first identifier is a single quotation mark added to the script statement to be converted of the single item; when the script sentence to be converted has a plurality of items, the first identifier is to add a quotation mark to the script sentence to be converted of each item in the plurality of items, and add commas between the items of the plurality of items. Referring to fig. 5, a conversion interface of a terminal includes a left display frame and a right display frame, and a virtual key located between the two display frames and used for sending a conversion trigger instruction, where the left display frame is used to receive and display a to-be-converted script statement, and when it is detected that the virtual key of the conversion trigger instruction is triggered, the to-be-converted script statement on the left side is converted, and a target script statement obtained after the conversion is displayed in the right display frame. The left side display frame is provided with a plurality of sentences to be converted, each sentence occupies one line and is displayed in the left side display frame, after conversion, the generated target script sentences are displayed in the right side display frame in a mode that one sentence occupies one line, and each sentence is added with a single quotation mark and a comma as a first identifier so as to distinguish the sentences, and SQL conditional query is carried out according to the target script sentences added with the first identifiers. The first identifier may also be a double quotation mark, a bracket, etc., which can be set according to the user's needs.
And when the type of the conversion trigger instruction is a second conversion type, indicating that the script statement to be converted is the script statement needing to be converted into the functional block statement type, adding a second identifier between lines of the script statement to be converted, and converting the script statement to be converted into a target script statement of the functional block statement. The function block statements comprise multi-line statements that the database executes to perform a function. In the process of code development, considering the quickness of code writing, functional blocks with similar functions can be written by copying and pasting codes, so that the writing speed is improved. If functions A and B are similar, the code implementing function A is executed via the database without errors, so that the function block statements implementing function A can be copied for implementing the function of function B. In the process of copying and using, line feed characters, spaces and the like in the function block sentences are deleted to form a whole block of code, and line division is not performed according to the original function block sentences, so that the reading inheritance of the code is not facilitated. Therefore, it is necessary to add line breaks, spaces, and the like to the copied function block statement, and this embodiment can realize that line breaks, spaces, and the like as second identifiers are added to the function block statement as the script statement to be converted, so as to generate the target script statement, and avoid that a developer manually writes and adds line breaks, spaces, and the like. Referring to fig. 6, a conversion interface of a terminal includes an upper display frame, a lower display frame, and a virtual key located between the two display frames and used for sending a conversion trigger instruction, where the upper display frame is used to receive and display a function block statement as a script statement to be converted, and when it is detected that the virtual key of the conversion trigger instruction is triggered, the upper function block statement is converted, and a target script statement obtained after the conversion is displayed in the lower display frame. The functional block statement of the upper display frame comprises a plurality of different lines, and after conversion, a line feed character and a semicolon which are used as second identifiers are added to each line to divide and distinguish items, so that when the target script statement added with the second identifiers is copied, the script statement with a format corresponding to 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 the user's needs.
Further, in another embodiment of the method for converting a script statement of the present invention, the adding a first identifier between lines of the script statement to be converted, and the step of converting the script statement to be converted into a target script statement corresponding to the first conversion type includes:
step S311, judging whether the current line number of the script statement to be converted is the last line of the conversion line number;
in step S312, when the current line number of the script statement to be converted is the last line of the conversion line number, the line-to-line space between the last line and the last line is cancelled, and the script statement to be converted is converted into the target script statement corresponding to the first conversion type.
Understandably, when the script statement to be converted is a query statement, there may be a plurality of items, that is, there are a plurality of query statements as the script statement to be converted. In conversion, a comma as a separator is added between items while adding an apostrophe to each item. When a transition is made to the last entry of the multiple query statement followed by no other query statement, there is no need to add a separator to this last entry. Therefore, in this embodiment, whether the current line number of the script statement to be converted is the last line of the conversion line number is judged, specifically, judgment is performed by reading the data of the next line of the current line number, and if the current line number is the last line and the data of the next line is not present, the read data is null; if the current row number is not the last row and the next row has data, the read data is not null; so that the judgment is made by whether the read data is null or not. And when the read data is a null value, the current line number of the script statement to be converted is the last line of the conversion line number, the space character between lines at the tail of the last line is cancelled, namely, the line-to-line separators are not added, and the conversion of converting the query statement serving as the script statement to be converted into the target script statement is completed.
Further, in another embodiment of the method for converting a script statement of the present invention, the adding a second delimiter between lines of the script statement to be converted, and the step of converting the script statement to be converted into a target script statement corresponding to the second conversion type includes:
step S33, when a variable replacement request is received, acquiring a replacement quantity and a variable to be replaced corresponding to the variable replacement request, and determining the replacement quantity of the variable to be replaced;
and step S33, replacing the variables to be replaced corresponding to the replacement quantity in the target script statement with the replacement quantity.
Furthermore, when the statement to be converted is a function block statement, a variable for external input information may exist in the function block statement, and a result obtained by executing the function block statement is different according to different external input information. In the conversion process, the variable is not identified, and the variable may be converted as a general flux, so that the function block statement cannot realize the original function of the variable, or an abnormal condition occurs in the conversion process. In the embodiment, the conversion interface is provided with a replacement function, and variables which cannot be identified in the conversion process are replaced by identifiable quantities through the replacement function. Referring to fig. 6, two input boxes and a virtual key are disposed between an upper display box and a lower display box in the conversion interface, the two input boxes are respectively used for inputting variables and replacement variables, and a user of the virtual key triggers to replace the variables with the replacement variables. And when the virtual key is detected to be triggered, the virtual key is used as a variable replacing request, and after the variable replacing request is received, a replacing quantity corresponding to the variable replacing request and a variable to be replaced are obtained. The variables to be replaced are variables, and the number of the variables to be replaced which need to be replaced is determined. And replacing the variables to be replaced in the converted target script statement with replacement quantity according to the quantity of the variables to be replaced which need to be replaced so as to ensure the function of the converted function block statement.
Further, referring to fig. 2, on the basis of the first embodiment of the method for converting a script statement of the present invention, a second embodiment of the method for converting a script statement of the present invention is provided, and in the second embodiment, the step of receiving the script statement to be converted at the conversion interface of the terminal includes:
step S40, when the terminal receives the start instruction of starting the conversion application, the conversion application is started;
step S50, when the conversion application receives the trigger instruction of query statement conversion, the conversion application is controlled to jump to the conversion interface of the query statement;
and step S60, when the conversion application receives the trigger instruction of the conversion of the function block statement, controlling the conversion application to jump to the conversion interface of the function block statement.
Furthermore, the to-be-converted script statement is performed by conversion application software, and the conversion application software is installed on the terminal, so that the conversion application software needs to be started before the to-be-converted script statement is converted. And when the terminal receives a starting instruction for starting the conversion application, starting the conversion application and entering a home page of the conversion application. A selection key is arranged on the home page of the script sentence conversion device to select the type of the script sentence to be converted, namely, to select to convert the query sentence or the function block sentence. When the conversion application receives a trigger instruction of query statement conversion, controlling the conversion application to jump to a conversion interface of the query statement so as to convert the query statement; when the conversion application receives a trigger instruction of the functional block statement conversion, the conversion application is controlled to jump to a conversion interface of the functional block statement so as to convert the functional block statement; through the different selection triggers, the conversion of different types of script statements to be converted is realized, and different requirements of users are met.
Further, in another embodiment of the script statement converting method of the present invention, the step of determining the type of the conversion trigger instruction when the conversion trigger instruction is received includes:
step S21, when a conversion trigger instruction is received, determining the type of the current interface according to the control type of the conversion application current display interface;
step S22, if the current interface is the conversion interface of the query statement, the conversion trigger instruction is the first conversion type corresponding to the query statement;
in 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.
Understandably, the types of the script statements to be converted are different, and the types of the corresponding conversion interfaces and the conversion trigger instructions are different, so that the type of the conversion trigger instruction can be determined according to the type of the current interface, and the script statements to be converted corresponding to the type are converted according to the type of the conversion trigger instruction. Specifically, when a conversion trigger instruction is received, the type of the current interface is determined, wherein the determination can be performed by detecting a control used by a background for displaying the current interface, and the control is a component with a user interface. When the control for displaying the current interface is a conversion control of the query statement, namely the current display interface displays the conversion interface of the query statement, the current interface can be determined as the conversion interface of the query statement; when the control for displaying the current interface is the conversion control of the functional block statement, that is, the current display interface displays the conversion interface of the functional block statement, the current interface can be determined as the conversion interface of the functional block statement. Determining the type of a conversion trigger instruction according to the type of the current interface; if the current interface is the conversion interface of the query statement, determining that the conversion trigger instruction is a first conversion type corresponding to the query statement; when the current interface is a conversion interface of the function block statement, determining that the conversion trigger instruction is a second conversion type corresponding to the function block statement; and converting the script statement to be converted according to the first conversion type or the second conversion type.
Further, referring to fig. 3, on the basis of the first embodiment or the second embodiment of the method for converting a script statement of the present invention, a third embodiment of the method for converting a script statement to be converted into a target script statement corresponding to the number of lines to be converted is proposed, where in the third embodiment, the step of converting the script statement to be converted into the target script statement corresponding to the number of lines to be converted includes:
and step S70, displaying the line number of the script statement to be converted on the conversion interface, and correspondingly displaying the script statement to be converted and the target script statement with the line number.
Referring to fig. 5 or fig. 6, to better embody the conversion result, the line number of the to-be-converted script statement is displayed in the conversion interface, and the to-be-converted script statement and the target script statement of the line number are correspondingly displayed. The user can grasp the basic situation of the conversion by the line number of the sentence before the conversion and the line number of the sentence after the conversion. When the number of lines before and after conversion is the same, it indicates that the conversion is primarily normal, and the lack of the number of lines after conversion, or the increase of the number of lines, etc. are all abnormal conditions. And when the line number of the script statement to be converted is input into a display frame of the conversion interface, detecting the input script statement to be converted line by line, and determining whether the detection line is the script statement to be converted. And when the script statement is to be converted, adding 1 to the line number count of the script statement to be converted until the last line, wherein the sum of the counts is the line number of the whole statement to be converted. And correspondingly displaying the script statement to be converted and the target script statement, and comparing to determine whether the converted target script statement lacks a line number, increases the line number or whether each line of the target script statement is added with a first identifier or a second identifier and the like. In addition, the conversion interface is also provided with a clearing virtual key for clearing the content displayed in the display frame in the conversion interface. And when a clearing instruction is received, clearing the script statement to be converted and the target script statement displayed in the conversion interface, and converting the script statement to be converted again after clearing to meet different conversion requirements of users.
Referring to fig. 4, fig. 4 is a schematic device structure diagram of a hardware operating environment related to a method according to an embodiment of the present invention.
The script sentence conversion device of the embodiment of the present invention may be a PC, or may be a terminal device such as a smart phone, a tablet PC, an e-book reader, an MP3(Moving Picture Experts Group Audio Layer III, motion video Experts compression standard Audio Layer 3) player, an MP4(Moving Picture Experts Group Audio Layer IV, motion video Experts compression standard Audio Layer 3) player, a portable computer, or the like.
As shown in fig. 4, the script statement converting means may include: a processor 1001, such as a CPU, a memory 1005, and a communication bus 1002. The communication bus 1002 is used for realizing connection communication between the processor 1001 and the memory 1005. The memory 1005 may be a high-speed RAM memory or a non-volatile memory (e.g., a magnetic disk memory). The memory 1005 may alternatively be a storage device separate from the processor 1001.
Optionally, the script sentence converting apparatus may further include a user interface, a network interface, a camera, a Radio Frequency (RF) circuit, a sensor, an audio circuit, a WiFi module, and the like. The user interface may comprise a Display screen (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface may also comprise a standard wired interface, a wireless interface. The network interface may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface).
Those skilled in the art will appreciate that the structure of the script statement conversion apparatus shown in fig. 4 does not constitute a limitation of the script statement conversion apparatus, and may include more or less components than those shown, or combine some components, or a different arrangement of components.
As shown in fig. 4, a memory 1005, which is a kind of computer storage medium, may include therein an operating system, a network communication module, and a script statement conversion program. The operating system is a program that manages and controls hardware and software resources of the script statement conversion means, and supports the execution of the script statement conversion means as well as other software and/or programs. The network communication module is used for realizing communication among the components in the memory 1005 and with other hardware and software in the script statement conversion device.
In the script statement conversion apparatus shown in fig. 4, the processor 1001 is configured to execute the script statement conversion program stored in the memory 1005, and implements the following steps:
receiving a script statement to be converted at a conversion interface of a terminal, and detecting whether a conversion trigger instruction is received or not;
when a conversion trigger instruction is received, determining the type of the conversion trigger instruction;
and converting the script statement to be converted into a target script statement corresponding to the type according to the type of the conversion triggering instruction.
Further, the script statement to be converted comprises a query statement and a function block statement;
the step of converting the script statement to be converted into the target script statement corresponding to the type according to the type of the conversion triggering instruction comprises the following steps:
when the type of the conversion trigger instruction is a first conversion type corresponding to the query statement, adding a first identifier between lines of the script statement to be converted so as to convert the script statement to be converted into a target script statement corresponding to the first conversion type;
and when the type of the conversion trigger instruction is a second conversion type corresponding to the functional block statement, adding a second identifier between lines of the script statement to be converted so as to convert the script statement to be converted into a target script statement corresponding to the second conversion type.
Further, the step of adding a first identifier between lines of the script statement to be converted to convert the script statement to be converted into a target script statement corresponding to the first conversion type includes:
judging whether the current line number of the script statement to be converted is the last line of the conversion line number;
and when the current line number of the script statement to be converted is the last line of the conversion line number, canceling a line-to-line space character at the tail of the last line, and converting the script statement to be converted into a target script statement corresponding to the first conversion type.
Further, after the step of adding a second delimiter between lines 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, the processor 1001 is configured to execute the script statement conversion program stored in the memory 1005, and implement the following steps:
when a variable replacement request is received, acquiring a replacement quantity and a variable to be replaced corresponding to the variable replacement request, and determining the replacement quantity of the variable to be replaced;
and replacing variables to be replaced corresponding to the replacement quantity in the target script statement with the replacement quantity.
Further, before the step of receiving the script statement to be converted at the conversion interface of the terminal, the processor 1001 is configured to execute the script statement conversion program stored in the memory 1005, and implement the following steps:
when the terminal receives a starting instruction for starting the conversion application, starting the conversion application;
when the conversion application receives a trigger instruction of query statement conversion, controlling the conversion application to jump to a conversion interface of the query statement;
and when the conversion application receives a trigger instruction of the functional block statement conversion, controlling the conversion application to jump to a conversion interface of the functional block statement.
Further, when receiving a conversion trigger instruction, the step of determining the type of the conversion trigger instruction comprises:
when a conversion trigger instruction is received, determining the type of the current interface according to the control type of the conversion application current display interface;
if the current interface is a conversion interface of the query statement, converting the trigger instruction into a first conversion type corresponding to the query statement;
and if the current interface is the conversion interface of the function block statement, converting the trigger instruction into a second conversion type corresponding to the function block statement.
Further, after the step of converting the script statement to be converted into the target script statement corresponding to the number of conversion lines, the processor 1001 is configured to execute the script statement conversion program stored in the memory 1005, and implement the following steps:
displaying the line number of the script statement to be converted on a conversion interface, and correspondingly displaying the script statement to be converted and the target script statement of the line number.
Further, after the step of correspondingly displaying the line number of the script statement to be converted and the target script statement, the processor 1001 is configured to execute the script statement conversion program stored in the memory 1005, and implement the following steps:
and when a clearing instruction is received, clearing the script statement to be converted and the target script statement displayed in the conversion interface.
The specific implementation of the script statement conversion device of the present invention is basically the same as that of the above embodiments of the script statement conversion method, and is not described herein again.
The present invention provides a computer readable storage medium storing one or more programs, the one or more programs further executable by one or more processors for:
receiving a script statement to be converted at a conversion interface of a terminal, and detecting whether a conversion trigger instruction is received or not;
when a conversion trigger instruction is received, determining the type of the conversion trigger instruction;
and converting the script statement to be converted into a target script statement corresponding to the type according to the type of the conversion triggering instruction.
Further, the script statement to be converted comprises a query statement and a function block statement;
the step of converting the script statement to be converted into the target script statement corresponding to the type according to the type of the conversion triggering instruction comprises the following steps:
when the type of the conversion trigger instruction is a first conversion type corresponding to the query statement, adding a first identifier between lines of the script statement to be converted so as to convert the script statement to be converted into a target script statement corresponding to the first conversion type;
and when the type of the conversion trigger instruction is a second conversion type corresponding to the functional block statement, adding a second identifier between lines of the script statement to be converted so as to convert the script statement to be converted into a target script statement corresponding to the second conversion type.
Further, the step of adding a first identifier between lines of the script statement to be converted to convert the script statement to be converted into a target script statement corresponding to the first conversion type includes:
judging whether the current line number of the script statement to be converted is the last line of the conversion line number;
and when the current line number of the script statement to be converted is the last line of the conversion line number, canceling a line-to-line space character at the tail of the last line, and converting the script statement to be converted into a target script statement corresponding to the first conversion type.
Further, after the step of adding a second delimiter from line to line 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, the one or more programs are also executable by the one or more processors for:
when a variable replacement request is received, acquiring a replacement quantity and a variable to be replaced corresponding to the variable replacement request, and determining the replacement quantity of the variable to be replaced;
and replacing variables to be replaced corresponding to the replacement quantity in the target script statement with the replacement quantity.
Further, before the step of receiving the script statement to be converted at the conversion interface of the terminal, the one or more programs may be further executable by one or more processors for:
when the terminal receives a starting instruction for starting the conversion application, starting the conversion application;
when the conversion application receives a trigger instruction of query statement conversion, controlling the conversion application to jump to a conversion interface of the query statement;
and when the conversion application receives a trigger instruction of the functional block statement conversion, controlling the conversion application to jump to a conversion interface of the functional block statement.
Further, when receiving a conversion trigger instruction, the step of determining the type of the conversion trigger instruction comprises:
when a conversion trigger instruction is received, determining the type of the current interface according to the control type of the conversion application current display interface;
if the current interface is a conversion interface of the query statement, converting the trigger instruction into a first conversion type corresponding to the query statement;
and if the current interface is the conversion interface of the function block statement, converting the trigger instruction into a second conversion type corresponding to the function block statement.
Further, after the step of converting the script statement to be converted into the target script statement corresponding to the number of conversion lines, the one or more programs may be further executable by the one or more processors for:
displaying the line number of the script statement to be converted on a conversion interface, and correspondingly displaying the script statement to be converted and the target script statement of the line number.
Further, after the step of correspondingly displaying the to-be-converted script statement and the target script statement in the number of lines, the one or more programs may be further executable by one or more processors to:
and when a clearing instruction is received, clearing the script statement to be converted and the target script statement displayed in the conversion interface. .
The specific implementation manner of the computer-readable storage medium of the present invention is substantially the same as that of the above embodiments of the script statement conversion method, and is not described herein again.
It should also be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) as described above and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and is not intended to limit the scope of the present invention, and all modifications and equivalents of the present invention, which are made by the contents of the present specification and the accompanying drawings, or directly/indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (9)

1. A script statement conversion method, characterized by comprising the steps of:
receiving a script statement to be converted at a conversion interface of a terminal, and detecting whether a conversion trigger instruction is received or not;
when a conversion trigger instruction is received, determining the type of the conversion trigger instruction;
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;
the script statement to be converted comprises a query statement and a function block statement;
the conversion interface for displaying the query sentence comprises a left display frame and a right display frame, and a virtual key positioned between the two display frames, wherein the left display frame displays the query sentence;
the conversion interface for displaying the functional block sentences comprises an upper display frame, a lower display frame and a virtual key positioned between the two display frames, wherein the upper display frame displays the functional block sentences;
the step of converting the script statement to be converted into the target script statement corresponding to the type according to the type of the conversion triggering instruction comprises the following steps:
when the type of a conversion trigger instruction triggered based on the virtual key is a first conversion type corresponding to the query statement, adding a first identifier between lines of the script statement to be converted so as to convert the script statement to be converted into a target script statement corresponding to the first conversion type and display the target script statement in a right display frame;
and when the type of the conversion triggering instruction triggered based on the virtual key is a second conversion type corresponding to the functional block statement, adding a second identifier between lines of the script statement to be converted so as to convert the script statement to be converted into a target script statement corresponding to the second conversion type and display the target script statement on the lower display frame.
2. The script statement converting method according to claim 1, wherein the step of adding a first identifier between lines 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:
judging whether the current line number of the script statement to be converted is the last line of the conversion line number;
and when the current line number of the script statement to be converted is the last line of the conversion line number, canceling a line-to-line space character at the tail of the last line, and converting the script statement to be converted into a target script statement corresponding to the first conversion type.
3. The script statement converting method according to claim 1, wherein the step of adding a second delimiter from line to line 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 is followed by:
when a variable replacement request is received, acquiring a replacement quantity and a variable to be replaced corresponding to the variable replacement request, and determining the replacement quantity of the variable to be replaced;
and replacing variables to be replaced corresponding to the replacement quantity in the target script statement with the replacement quantity.
4. The script sentence converting method of claim 1, wherein the step of receiving the script sentence to be converted at the conversion interface of the terminal comprises, before:
when the terminal receives a starting instruction for starting the conversion application, starting the conversion application;
when the conversion application receives a trigger instruction of query statement conversion, controlling the conversion application to jump to a conversion interface of the query statement;
and when the conversion application receives a trigger instruction of the functional block statement conversion, controlling the conversion application to jump to a conversion interface of the functional block statement.
5. The script statement converting method according to claim 4, wherein the step of determining the type of the conversion trigger instruction when the conversion trigger instruction is received comprises:
when a conversion trigger instruction is received, determining the type of the current interface according to the control type of the conversion application current display interface;
if the current interface is a conversion interface of the query statement, converting the trigger instruction into a first conversion type corresponding to the query statement;
and if the current interface is the conversion interface of the function block statement, converting the trigger instruction into a second conversion type corresponding to the function block statement.
6. The script statement converting method according to any one of claims 1 to 5, wherein the step of converting the script statement to be converted into the target script statement corresponding to the number of conversion lines is followed by comprising:
displaying the line number of the script statement to be converted on a conversion interface, and correspondingly displaying the script statement to be converted and the target script statement of the line number.
7. The script statement converting method according to claim 6, wherein said step of displaying said line number of the script statement to be converted and the target script statement in correspondence comprises the steps of:
and when a clearing instruction is received, clearing the script statement to be converted and the target script statement displayed in the conversion interface.
8. A script sentence converting apparatus, comprising: the device comprises a memory, a processor, a communication bus and a script statement conversion program stored on the memory;
the communication bus is used for realizing connection communication between the processor and the memory;
the processor is configured to execute the script statement conversion program to implement the steps of the script statement conversion method according to any of claims 1-7.
9. A computer-readable storage medium, having stored thereon a script statement converting program which, when executed by a processor, implements the steps of the script statement converting method according to any one of claims 1 to 7.
CN201711030554.6A 2017-10-26 2017-10-26 Script statement conversion method and device and computer readable storage medium Active CN107908679B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201711030554.6A CN107908679B (en) 2017-10-26 2017-10-26 Script statement conversion method and device and computer readable storage medium
PCT/CN2018/074809 WO2019080401A1 (en) 2017-10-26 2018-01-31 Method and apparatus for converting script statement, and computer-readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711030554.6A CN107908679B (en) 2017-10-26 2017-10-26 Script statement conversion method and device and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN107908679A CN107908679A (en) 2018-04-13
CN107908679B true CN107908679B (en) 2020-11-27

Family

ID=61841942

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711030554.6A Active CN107908679B (en) 2017-10-26 2017-10-26 Script statement conversion method and device and computer readable storage medium

Country Status (2)

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

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108875378A (en) * 2018-06-12 2018-11-23 珠海市君天电子科技有限公司 Script virus detection method, device, electronic equipment and storage medium
CN109376166B (en) * 2018-08-20 2023-07-04 中国平安财产保险股份有限公司 Script conversion method, script conversion device, computer equipment and storage medium
CN110060667B (en) * 2019-03-15 2023-05-30 平安科技(深圳)有限公司 Batch processing method and device for voice information, computer equipment and storage medium
CN115470229B (en) * 2022-08-30 2023-04-14 昆仑数智科技有限责任公司 Data table processing method and device, electronic equipment and storage medium

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7117225B2 (en) * 2001-08-13 2006-10-03 Jasmin Cosic Universal data management interface
CN100489860C (en) * 2007-03-16 2009-05-20 华为技术有限公司 Method and apparatus for updating object local attribute to related database
CN102426534B (en) * 2011-11-02 2014-06-04 大唐联仪科技有限公司 Method and system for converting test script language into executable instruction
CN103365847B (en) * 2012-03-27 2016-02-24 腾讯科技(深圳)有限公司 A kind of generation method and apparatus of self-defined web page files
CN103092980A (en) * 2013-01-31 2013-05-08 中国科学院自动化研究所 Method and system of data automatic conversion and storage
CN103529773B (en) * 2013-09-18 2015-01-21 国家电网公司 Automatic conversion method for behavior control scripting language
CN105868204B (en) * 2015-01-21 2019-06-21 中移信息技术有限公司 A kind of method and device for converting Oracle scripting language SQL
CN104932974B (en) * 2015-05-28 2018-11-13 国家计算机网络与信息安全管理中心 A kind of script conversion method and device
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

Also Published As

Publication number Publication date
WO2019080401A1 (en) 2019-05-02
CN107908679A (en) 2018-04-13

Similar Documents

Publication Publication Date Title
KR102436987B1 (en) Method and terminal device for extracting web page content
TWI690812B (en) Method, device and client for dynamic layout of page elements
CN107908679B (en) Script statement conversion method and device and computer readable storage medium
CN112181554B (en) Interactive interface display method, device, electronic device and storage medium
US20130283100A1 (en) Testing device
US10175954B2 (en) Method of processing big data, including arranging icons in a workflow GUI by a user, checking process availability and syntax, converting the workflow into execution code, monitoring the workflow, and displaying associated information
CN108197024B (en) Embedded browser debugging method, debugging terminal and computer readable storage medium
CN103941964A (en) Information loading method based on desktop components and intelligent terminal
US11055107B2 (en) Electronic apparatus and method of executing application program
US20210109644A1 (en) Display method when application is exited and terminal
CN111796896A (en) Theme switching method of application page and related equipment
CN114065080B (en) Page rendering method, device, equipment and computer readable storage medium
CN104063071A (en) Content input method and device
CN110727429A (en) Front-end page generation method, device and equipment
CN107220377B (en) Search method, electronic device, and computer storage medium
CN107168549B (en) Input method, display device and computer-readable storage medium
CN114816389B (en) Management system building method, device, equipment and medium based on meta-model
CN105573705A (en) Display control method and terminal
CN112905072B (en) Application processing method and device and electronic equipment
CN114647411A (en) Programming interface loading method and device, electronic equipment and storage medium
CN110049374B (en) Focus frame determination method and device
CN113342553A (en) Data acquisition method and device, electronic equipment and storage medium
CN113656439A (en) Data query method and device, storage medium and electronic equipment
CN110895592B (en) Link starting method, device, equipment and medium on mobile terminal
CN110866203B (en) Page jump method, device, equipment and computer readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant