CN116610693A - Method and device for generating structured query statement and computer equipment - Google Patents

Method and device for generating structured query statement and computer equipment Download PDF

Info

Publication number
CN116610693A
CN116610693A CN202310483175.1A CN202310483175A CN116610693A CN 116610693 A CN116610693 A CN 116610693A CN 202310483175 A CN202310483175 A CN 202310483175A CN 116610693 A CN116610693 A CN 116610693A
Authority
CN
China
Prior art keywords
structured
query statement
structured query
text
generating
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.)
Pending
Application number
CN202310483175.1A
Other languages
Chinese (zh)
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.)
Industrial Bank Co Ltd
CIB Fintech Services Shanghai Co Ltd
Original Assignee
Industrial Bank Co Ltd
CIB Fintech Services Shanghai 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 Industrial Bank Co Ltd, CIB Fintech Services Shanghai Co Ltd filed Critical Industrial Bank Co Ltd
Priority to CN202310483175.1A priority Critical patent/CN116610693A/en
Publication of CN116610693A publication Critical patent/CN116610693A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/242Query formulation
    • G06F16/2433Query languages
    • 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/245Query processing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • General Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Human Computer Interaction (AREA)
  • Mathematical Physics (AREA)
  • Computer Security & Cryptography (AREA)
  • Document Processing Apparatus (AREA)

Abstract

The application relates to a method, a device and computer equipment for generating a structured query statement. The method comprises the following steps: acquiring parameters of a structured query statement to be generated and a code template of the structured query statement to be generated; the code template is obtained from a preset template instance set, wherein the template instance set is obtained by analyzing and extracting edited structured texts corresponding to the structure information instance according to the structure information instance; and generating the structured query statement according to the parameters and the code template. The application realizes the editing and management of the completely personalized structured query statement codes, and when the structured query statement needs to be generated, only the corresponding structured query statement template and the corresponding parameters are required to be determined and input, so that the structured query statement can be automatically generated, and the complexity of manually writing the codes is reduced.

Description

Method and device for generating structured query statement and computer equipment
Technical Field
The present application relates to the field of database technology, and in particular, to a generation, an apparatus, a computer device, a storage medium, and a computer program product of a structured query statement.
Background
Structured query language (Structured Query Language, SQL), a program related language for databases, is used to store data and query, update and manage relational databases. The structured query statement has various types and numbers, and needs are frequent. In the related art, when writing the structured query statement, the structured query statement is copied by manual coding or from other corresponding positions of programs, and the copied structured query statement is modified. Therefore, the writing of the structured query statement in the related art is time-consuming and labor-consuming.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a generation, an apparatus, a computer device, a storage medium, and a computer program product of a structured query statement.
In a first aspect, the present application provides a method for generating a structured query statement. The method comprises the following steps:
a method of generating a structured query statement, comprising:
acquiring parameters of a structured query statement to be generated and a code template of the structured query statement to be generated; the code template is obtained from a preset template instance set, wherein the template instance set is obtained by analyzing and extracting edited structured texts corresponding to the structure information instance according to the structure information instance;
and generating the structured query statement according to the parameters and the code template.
In one possible implementation manner, before the obtaining the parameter of the to-be-generated structured query statement and the code template corresponding to the to-be-generated structured query statement, the method further includes:
displaying an editing interface of the structured text;
and receiving editing operation of the code template of the structured query sentence in the editing interface to obtain edited structured text.
In one possible implementation manner, the editing interface for displaying the structured text includes:
displaying a configuration interface of the structured text element structure;
receiving configuration operation of the structured text element structure at the configuration interface to obtain a structured text element structure file;
and generating a corresponding structured text according to the structured text meta-structure file, and displaying an editing interface of the structured text.
In one possible implementation manner, after the obtaining the structured text element structure text, the method further includes:
analyzing the structural text of the structural text element to obtain a structural information instance;
and generating a structure information instance set according to the structure information instance corresponding to each structured text element structure text.
In one possible implementation manner, the generating the structured query statement according to the parameter and the code template further includes:
receiving configuration operation of a data source, and establishing connection of a database corresponding to the data source;
and querying data in the database by using the structured query statement.
In a second aspect, the present application further provides a device for generating a structured query statement, including:
the acquisition module is used for acquiring parameters of the to-be-generated structured query statement and a code template of the to-be-generated structured query statement; the code template is obtained from a preset template instance set, wherein the template instance set is obtained by analyzing and extracting edited structured texts corresponding to the structure information instance according to the structure information instance;
and the generation module is used for generating the structured query statement according to the parameters and the code template.
In one possible implementation, the method further includes:
the display module is used for displaying an editing interface of the structured text;
and the editing module is used for receiving the editing operation of the code template of the structured query sentence in the editing interface to obtain the edited structured text.
In one possible implementation, the display module includes:
the first display sub-module is used for displaying a configuration interface of the structured text element structure;
a configuration sub-module, configured to receive a configuration operation of the structured text meta-structure at the configuration interface, to obtain a structured text meta-structure file;
and the second display sub-module is used for generating a corresponding structured text according to the structured text meta-structure file and displaying an editing interface of the structured text.
In one possible implementation manner, the display module further includes:
the analysis submodule is used for analyzing the structural text of the structural text element to obtain a structural information instance;
and the generation sub-module is used for generating a structure information instance set according to the structure information instance corresponding to each structured text element structure text.
In one possible implementation, the method further includes:
the connection module is used for receiving configuration operation of the data source and establishing connection of a database corresponding to the data source;
and the query module is used for querying data in the database by utilizing the structured query statement.
In a third aspect, the present application also provides a computer device. The computer device comprises a memory storing a computer program and a processor implementing the method of generating a structured query statement according to any of the embodiments of the present disclosure when the computer program is executed.
In a fourth aspect, the present application also provides a computer-readable storage medium. The computer readable storage medium has stored thereon a computer program which, when executed by a processor, implements a method of generating a structured query statement according to any of the embodiments of the present disclosure.
In a fifth aspect, the present application also provides a computer program product. The computer program product comprises a computer program which, when executed by a processor, implements a method of generating a structured query statement according to any of the embodiments of the present disclosure.
The method, the device, the computer equipment, the storage medium and the computer program product for generating the structured query sentence receive the editing of various code templates through the structured text, wherein the structured text can have different formats, and the structural information of the structured text with different formats is stored in the corresponding structural information instance; and analyzing the corresponding edited structured text according to the structure information instance to obtain a code template of the structured query statement. The method can realize the editing and management of the completely personalized structured query statement codes, when the structured query statement needs to be generated, only the corresponding structured query statement template and the corresponding parameters are needed to be determined, the structured query statement can be automatically generated, the complexity of manually writing the codes is reduced, in addition, the structured texts corresponding to the templates of various structured query statement can be uniformly managed through the structured information instance, the code templates of the structured query statement written by different accounts can be conveniently and rapidly searched, and the efficiency is improved.
Drawings
FIG. 1 is a first flow diagram of a method of generating a structured query statement in one embodiment;
FIG. 2 is a second flow diagram of a method of generating a structured query statement in another embodiment;
FIG. 3 is a block diagram of an apparatus for generating a structured query statement in one embodiment;
FIG. 4 is an internal block diagram of a computer device in one embodiment;
fig. 5 is an internal structural view of a computer device in another embodiment.
Detailed Description
The present application will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present application more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the application.
It should be noted that, in the technical scheme of the application, the acquisition, storage, use and processing of the data all meet the relevant regulations of national laws and regulations.
In one embodiment, as shown in fig. 1, there is provided a method for generating a structured query statement, including the steps of:
step S101, parameters of a structured query statement to be generated and a code template of the structured query statement to be generated are obtained; the code template is obtained from a preset template instance set, and the template instance set is obtained by analyzing and extracting edited structured texts corresponding to the structure information instance according to the structure information instance.
In particular, the structured query statement is an important operation statement of a relational database, which can perform various data operations, such as querying, filtering, ordering, grouping, limiting the number, and the like. Relational databases include databases that employ relational models to organize data, with data stored in rows and columns. The series of rows and columns of a relational database is called a table, and a set of tables forms the database. In an embodiment of the disclosure, the parameters of the structured query term may include parameters of variables, for example, the structured query term that we want to look at the table a total record may include: SELECT COUNT (1) FROM a. Wherein, table a can be regarded as a parameter because when we need to look up other tables, we need to do some replacement for a only with the identity of the target table to be looked up.
In the embodiment of the disclosure, the code template of the structured query statement may include code portions common to a class of statements having the same function or achieving the purpose, and the code template may include different forms. In an exemplary embodiment, the code templates of the structured query statement corresponding to the above embodiment may include: SELECT COUNT (1) from@param. Wherein @ { param } can be assigned or replaced according to a specific application scenario. In another exemplary embodiment, the code templates of the structured query statement corresponding to the above embodiment may also include: SELECT @ { param1} FROM @ { param2}. Wherein @ { param1} and @ { param2} can be assigned or replaced according to specific application scenarios.
In the embodiment of the disclosure, the template instance set may include code templates of multiple structured query sentences, where the code templates of the multiple structured query sentences may be from the same edited structured text or from different edited structured texts. In an exemplary embodiment, the code templates of the structured query statement in the template instance set may be evaluated to screen the structured query statement templates with the number of uses greater than a preset threshold, and delete the structured query statement templates with the number of uses less than the preset threshold. The structured query statement templates with the number of uses less than a preset threshold can also be modified and perfected. In another exemplary embodiment, management may also be implemented for the lifecycle of the code templates of the structured query statement in the template instance set, such as creation phase, modification maintenance phase, end phase, and so forth.
In the embodiment of the disclosure, the structured text may include a text file obtained by normalizing the text information according to a preset rule. The edited structured text may include structured text that results after some editing operations of the structured text, such as adding data, deleting data, modifying data, etc. The meta structure of the structured document may include a structure for defining the structure of the structured document, which may be understood as a rule system for generating the structured document. For example, for structured text a, the symbols "< p >", "</p >" and the content therebetween may be defined to represent paragraphs in one structured text a that are part of the structured text; and "< p >" and "</p >" are part of the meta-structure of this structured document.
In an exemplary embodiment, the structural information may be extracted from the meta structure corresponding to the structured text, to obtain the structural information instance corresponding to the structured text. Correspondingly, the corresponding edited structured text can be analyzed according to the structure information instance to obtain the code template of the structured query sentence in the edited structured text.
And step S103, generating the structured query statement according to the parameters and the code template.
Specifically, the parameters in the actual application scenario may be inserted into the code template, or the parameters may be replaced or assigned to the corresponding variables in the code template, for example, in the foregoing embodiment, table a is replaced with @ { param } in the code template SELECT COUNT (1) FROM @ { param } to obtain the structured query statement SELECT COUNT (1) FROM a. In an exemplary embodiment, when the code templates of the structured query statement may include a plurality of code templates, the code templates of the structured query statement may be batched to obtain the corresponding structured query statement.
In the method for generating the structured query sentence, various code templates are edited through the structured text, wherein the structured text can have different formats, and the structure information of the structured text with different formats is stored in the corresponding structure information instance; and analyzing the corresponding edited structured text according to the structure information instance to obtain a code template of the structured query statement. The method can realize the editing and management of the completely personalized structured query statement codes, when the structured query statement needs to be generated, only the corresponding structured query statement template and the corresponding parameters are needed to be determined, the structured query statement can be automatically generated, the complexity of manually writing the codes is reduced, in addition, the structured texts corresponding to the templates of various structured query statement can be uniformly managed through the structured information instance, the code templates of the structured query statement written by different users can be conveniently and rapidly searched, and the efficiency is improved.
In one possible implementation manner, before the obtaining the parameter of the to-be-generated structured query statement and the code template corresponding to the to-be-generated structured query statement, the method further includes:
displaying an editing interface of the structured text;
and receiving editing operation of the code template of the structured query sentence in the editing interface to obtain edited structured text.
Specifically, the structured text may include an offline structured text and an online structured text, and when the structured text is in an offline form, the structured text may enter the system through an imported form, so as to extract structural information of the structured text subsequently, and generate a structural information instance. In an exemplary embodiment, the composition rules of the code templates of the structured query statement may also be presented in the editing interface of the structured text. In another exemplary embodiment, a selection box may also be provided for the user to select the appropriate sentence. In another exemplary embodiment, a check option may also be provided for format check sum prompting of the code template entered by the user.
In the embodiment of the disclosure, the structured texts may be written in units of tables, or all the template structured texts of all the tables may be written in the same template structured text. The structure of the structured document needs to respect the structural information defined in the meta structure of the structured document.
In the embodiment, the user can edit the code template of the structured query sentence in advance through the editing interface for displaying the structured text, so that the code template can be multiplexed when the subsequent structured query sentence is generated, and the code generation efficiency is improved. Compared with the traditional method of pasting the structured query statement and modifying the structured query statement from other codes, the embodiment of the disclosure can effectively manage each code template, is convenient to query, does not need to understand the context of the structured query statement, and achieves decoupling of parameters of the code template and the structured query statement.
In one possible implementation manner, the editing interface for displaying the structured text includes:
displaying a configuration interface of the structured text element structure;
receiving configuration operation of the structured text element structure at the configuration interface to obtain a structured text element structure file;
and generating a corresponding structured text according to the structured text meta-structure file, and displaying an editing interface of the structured text.
In particular, the meta structure of the structured document, as described in the above embodiments, may include a structure for defining the structure of the structured document, and may be understood as a rule system for generating the structured document. In an exemplary embodiment, the structured text element structure is configured regularly by presenting a configuration interface of the structured text in which the configuration interface is configured. Thereby generating a grammar system of the self-defined structured text, and constructing the structured text according to the grammar system. In another exemplary embodiment, the structured document may also be maintained through a configuration interface of the structured document.
According to the embodiment, the configuration of the meta structure of the structured text can be realized through the configuration interface of the meta structure of the structured text, so that personalized structured text is realized, and the convenience and the utilization rate of a user are improved.
In one possible implementation manner, after the obtaining the structured text element structure text, the method further includes:
analyzing the structural text of the structural text element to obtain a structural information instance;
and generating a structure information instance set according to the structure information instance corresponding to each structured text element structure text.
Specifically, the structured text meta-structure text is used for storing a file of meta-structure information of the structured text. And analyzing the structural text meta-structure text, namely obtaining a corresponding structure information instance from the meta-structure text according to a semantic system for defining the structural text. The structure information instance is used to extract a code template of a structured program statement from the structured text.
In the embodiment of the disclosure, the meta structure of the structured text can be defined by a user, so that the meta structure of each structured text may be different, and thus, the structural information instance of each structured text is also different. And generating a structure information instance set according to the structure information instance corresponding to each structured text. In an exemplary embodiment, the lifecycle and use of the structure information instances in the structure information instance set may be managed. It should be noted that, two modes of automatic management and manual management may be adopted to manage the structure information instance set, so that the user may operate the structure information instance set.
In the above embodiment, by managing the structure information instance corresponding to each structured text element structure, the user is not limited to using the code template of the structured program statement written by the user, and the generation efficiency of the structured program statement is greatly improved.
In one possible implementation manner, the generating the structured query statement according to the parameter and the code template further includes:
receiving configuration operation of a data source, and establishing connection of a database corresponding to the data source;
and querying data in the database by using the structured query statement.
Specifically, the user can maintain connection information of all used data sources through the data source configuration function, and complete connection of the program and the database through establishing data source connection. After the data source configuration and connection are completed, the user enters the structured program statement and executes the structured program statement at the place where the structured program statement is required to be executed, and then the function of inquiring the data can be realized. In an exemplary embodiment, query results may be received.
In the above embodiment, the connection with the database is established through the configuration operation of the data source, so that the data is directly queried in the database by using the generated structured query statement, and the query result is received. The convenience of data query is improved. And development efficiency and quality are improved.
FIG. 2 is a second flow diagram of a method for generating a structured query term in another embodiment, with reference to FIG. 2, the method includes:
step S201, a configuration interface of the structured text element structure is displayed.
Step S203, receiving a configuration operation of the structured text meta structure at the configuration interface, to obtain a structured text meta structure file.
Step S205, according to the structural text meta-structure file, a corresponding structural text is generated, and an editing interface of the structural text is displayed.
In particular, the meta structure of the structured document, as described in the above embodiments, may include a structure for defining the structure of the structured document, and may be understood as a rule system for generating the structured document. In an exemplary embodiment, the structured text element structure is configured regularly by presenting a configuration interface of the structured text in which the configuration interface is configured. Thereby generating a grammar system of the self-defined structured text, and constructing the structured text according to the grammar system. In another exemplary embodiment, the structured document may also be maintained through a configuration interface of the structured document.
Step S207, receiving the editing operation of the code template of the structured query sentence in the editing interface to obtain the edited structured text.
Specifically, the structured text may include an offline structured text and an online structured text, and when the structured text is in an offline form, the structured text may enter the system through an imported form, so as to extract structural information of the structured text subsequently, and generate a structural information instance. In an exemplary embodiment, the composition rules of the code templates of the structured query statement may also be presented in the editing interface of the structured text
Step S101, parameters of a structured query statement to be generated and a code template of the structured query statement to be generated are obtained.
And step S103, generating the structured query statement according to the parameters and the code template.
In particular, the structured query statement is an important operation statement of a relational database, which can perform various data operations, such as querying, filtering, ordering, grouping, limiting the number, and the like. In the embodiment of the disclosure, the code template of the structured query statement may include code portions common to a class of statements having the same function or achieving the purpose, and the code template may include different forms. In the embodiment of the disclosure, the template instance set may include code templates of multiple structured query sentences, where the code templates of the multiple structured query sentences may be from the same edited structured text or from different edited structured texts.
Step S209, receiving configuration operation of a data source, and establishing connection of a database corresponding to the data source.
Step S211, querying data in the database by using the structured query statement.
Specifically, the user can maintain connection information of all used data sources through the data source configuration function, and complete connection of the program and the database through establishing data source connection. After the data source configuration and connection are completed, the user enters the structured program statement and executes the structured program statement at the place where the structured program statement is required to be executed, and then the function of inquiring the data can be realized. In an exemplary embodiment, query results may be received.
The configuration of the structure text element structure in the embodiment realizes the customization of the structure text, so that a user can define, manage and maintain own structure query sentences in a flexible and tidy mode. Through the parameters of the structured sentences and the code templates of the structured sentences, the user can multiplex the code templates of the structured sentences, and the workload is reduced. Therefore, the scheme provides a loosely-coupled structured query statement generation, use and maintenance management method which can be dynamically generated and is convenient to maintain for a user, the structured query statement can be operated and managed in a more flexible and convenient mode, and development efficiency and quality are improved.
It should be understood that, although the steps in the flowcharts related to the embodiments described above are sequentially shown as indicated by arrows, these steps are not necessarily sequentially performed in the order indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in the flowcharts described in the above embodiments may include a plurality of steps or a plurality of stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of the steps or stages is not necessarily performed sequentially, but may be performed alternately or alternately with at least some of the other steps or stages.
Based on the same inventive concept, the embodiment of the application also provides a device for generating the structured query statement for realizing the method for generating the structured query statement. The implementation scheme of the solution provided by the device is similar to the implementation scheme recorded in the method, so the specific limitation in the embodiment of the generating device of one or more structured query sentences provided below can be referred to the limitation of the generating method of the structured query sentences hereinabove, and will not be repeated here.
In one embodiment, as shown in fig. 3, there is provided a generating apparatus 300 of a structured query statement, including:
an obtaining module 301, configured to obtain parameters of a structured query statement to be generated and a code template of the structured query statement to be generated; the code template is obtained from a preset template instance set, wherein the template instance set is obtained by analyzing and extracting edited structured texts corresponding to the structure information instance according to the structure information instance;
and the generating module 303 is configured to generate the structured query statement according to the parameters and the code template.
In one possible implementation, the method further includes:
the display module is used for displaying an editing interface of the structured text;
and the editing module is used for receiving the editing operation of the code template of the structured query sentence in the editing interface to obtain the edited structured text.
In one possible implementation, the display module includes:
the first display sub-module is used for displaying a configuration interface of the structured text element structure;
a configuration sub-module, configured to receive a configuration operation of the structured text meta-structure at the configuration interface, to obtain a structured text meta-structure file;
and the second display sub-module is used for generating a corresponding structured text according to the structured text meta-structure file and displaying an editing interface of the structured text.
In one possible implementation manner, the display module further includes:
the analysis submodule is used for analyzing the structural text of the structural text element to obtain a structural information instance;
and the generation sub-module is used for generating a structure information instance set according to the structure information instance corresponding to each structured text element structure text.
In one possible implementation, the method further includes:
the connection module is used for receiving configuration operation of the data source and establishing connection of a database corresponding to the data source;
and the query module is used for querying data in the database by utilizing the structured query statement.
The above-described respective modules in the generation means of the structured query statement may be implemented in whole or in part by software, hardware, and combinations thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
In one embodiment, a computer device is provided, which may be a server, the internal structure of which may be as shown in fig. 4. The computer device includes a processor, a memory, and a network interface connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database of the computer device is used for storing data of a generation method of the structured query statement. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program, when executed by a processor, implements a method of generating a structured query statement.
In one embodiment, a computer device is provided, which may be a terminal, and the internal structure of which may be as shown in fig. 5. The computer device includes a processor, a memory, a communication interface, a display screen, and an input device connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The communication interface of the computer device is used for carrying out wired or wireless communication with an external terminal, and the wireless mode can be realized through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. The computer program, when executed by a processor, implements a method of generating a structured query statement. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, can also be keys, a track ball or a touch pad arranged on the shell of the computer equipment, and can also be an external keyboard, a touch pad or a mouse and the like.
It will be appreciated by those skilled in the art that the structure shown in FIG. 5 is merely a block diagram of some of the structures associated with the present inventive arrangements and is not limiting of the computer device to which the present inventive arrangements may be applied, and that a particular computer device may include more or fewer components than shown, or may combine some of the components, or have a different arrangement of components.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, database, or other medium used in embodiments provided herein may include at least one of non-volatile and volatile memory. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, high density embedded nonvolatile Memory, resistive random access Memory (ReRAM), magnetic random access Memory (Magnetoresistive Random Access Memory, MRAM), ferroelectric Memory (Ferroelectric Random Access Memory, FRAM), phase change Memory (Phase Change Memory, PCM), graphene Memory, and the like. Volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory, and the like. By way of illustration, and not limitation, RAM can be in the form of a variety of forms, such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM), and the like. The databases referred to in the embodiments provided herein may include at least one of a relational database and a non-relational database. The non-relational database may include, but is not limited to, a blockchain-based distributed database, and the like. The processor referred to in the embodiments provided in the present application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic unit, a data processing logic unit based on quantum computing, or the like, but is not limited thereto.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The foregoing examples illustrate only a few embodiments of the application and are described in detail herein without thereby limiting the scope of the application. It should be noted that it will be apparent to those skilled in the art that several variations and modifications can be made without departing from the spirit of the application, which are all within the scope of the application. Accordingly, the scope of the application should be assessed as that of the appended claims.

Claims (13)

1. A method of generating a structured query statement, comprising:
acquiring parameters of a structured query statement to be generated and a code template of the structured query statement to be generated; the code template is obtained from a preset template instance set, wherein the template instance set is obtained by analyzing and extracting edited structured texts corresponding to the structure information instance according to the structure information instance;
and generating the structured query statement according to the parameters and the code template.
2. The method according to claim 1, further comprising, before the obtaining parameters of the structured query statement to be generated and the code templates corresponding to the structured query statement to be generated:
displaying an editing interface of the structured text;
and receiving editing operation of the code template of the structured query sentence in the editing interface to obtain edited structured text.
3. The method of claim 2, wherein the editing interface for presenting structured text comprises:
displaying a configuration interface of the structured text element structure;
receiving configuration operation of the structured text element structure at the configuration interface to obtain a structured text element structure file;
and generating a corresponding structured text according to the structured text meta-structure file, and displaying an editing interface of the structured text.
4. A method according to claim 3, further comprising, after said deriving structured text of the structured text element:
analyzing the structural text of the structural text element to obtain a structural information instance;
and generating a structure information instance set according to the structure information instance corresponding to each structured text element structure text.
5. The method of any of claims 1 to 4, wherein generating the structured query statement from the parameters and the code template is followed by:
receiving configuration operation of a data source, and establishing connection of a database corresponding to the data source;
and querying data in the database by using the structured query statement.
6. A device for generating a structured query statement, comprising:
the acquisition module is used for acquiring parameters of the to-be-generated structured query statement and a code template of the to-be-generated structured query statement; the code template is obtained from a preset template instance set, wherein the template instance set is obtained by analyzing and extracting edited structured texts corresponding to the structure information instance according to the structure information instance;
and the generation module is used for generating the structured query statement according to the parameters and the code template.
7. The apparatus as recited in claim 6, further comprising:
the display module is used for displaying an editing interface of the structured text;
and the editing module is used for receiving the editing operation of the code template of the structured query sentence in the editing interface to obtain the edited structured text.
8. The apparatus of claim 7, wherein the display module comprises:
the first display sub-module is used for displaying a configuration interface of the structured text element structure;
a configuration sub-module, configured to receive a configuration operation of the structured text meta-structure at the configuration interface, to obtain a structured text meta-structure file;
and the second display sub-module is used for generating a corresponding structured text according to the structured text meta-structure file and displaying an editing interface of the structured text.
9. The apparatus of claim 8, wherein the display module further comprises:
the analysis submodule is used for analyzing the structural text of the structural text element to obtain a structural information instance;
and the generation sub-module is used for generating a structure information instance set according to the structure information instance corresponding to each structured text element structure text.
10. The apparatus according to any one of claims 6 to 9, further comprising:
the connection module is used for receiving configuration operation of the data source and establishing connection of a database corresponding to the data source;
and the query module is used for querying data in the database by utilizing the structured query statement.
11. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor, when executing the computer program, implements the steps of the method of generating a structured query statement of any of claims 1 to 5.
12. A computer readable storage medium having stored thereon a computer program, characterized in that the computer program when executed by a processor realizes the steps of the method of generating a structured query statement according to any of claims 1 to 5.
13. A computer program product comprising a computer program, characterized in that the computer program, when being executed by a processor, implements the steps of the method of generating a structured query statement as claimed in any one of claims 1 to 5.
CN202310483175.1A 2023-04-28 2023-04-28 Method and device for generating structured query statement and computer equipment Pending CN116610693A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310483175.1A CN116610693A (en) 2023-04-28 2023-04-28 Method and device for generating structured query statement and computer equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310483175.1A CN116610693A (en) 2023-04-28 2023-04-28 Method and device for generating structured query statement and computer equipment

Publications (1)

Publication Number Publication Date
CN116610693A true CN116610693A (en) 2023-08-18

Family

ID=87682735

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310483175.1A Pending CN116610693A (en) 2023-04-28 2023-04-28 Method and device for generating structured query statement and computer equipment

Country Status (1)

Country Link
CN (1) CN116610693A (en)

Similar Documents

Publication Publication Date Title
CN108874926B (en) Mass data query method, device, computer equipment and storage medium
CN111061475B (en) Software code generating method, device, computer equipment and storage medium
CN112036736A (en) Workflow creating method and device
CN111126019B (en) Report generation method and device based on mode customization and electronic equipment
CN112015412A (en) Device and method for generating business model based on form engine
CN104516864A (en) Report generating method and report generating device
CN115544183A (en) Data visualization method and device, computer equipment and storage medium
CN104537012A (en) Data processing method and device
CN113283228A (en) Document generation method and device, electronic equipment and storage medium
CN117332766A (en) Flow chart generation method, device, computer equipment and storage medium
CN102171696B (en) The generation method and apparatus of customization data
CN117078181A (en) Automatic method and system for power transaction business data processing flow
CN116738954A (en) Report export method, report template configuration device and computer equipment
CN114895875B (en) Zero-code visual information system metadata production application method and system
CN116610693A (en) Method and device for generating structured query statement and computer equipment
CN108845857A (en) A kind of icon management method and device based on cloud platform
KR102300444B1 (en) Document editing device to check whether the font applied to the document is a supported font and operating method thereof
CN112632266A (en) Data writing method and device, computer equipment and readable storage medium
CN115455035B (en) Data query model construction method and computer-readable storage medium
CN116611418B (en) Report processing method and device based on online editing, electronic equipment and medium
CN113704593B (en) Operation data processing method and related device
CN114553954B (en) Information pushing method, nonvolatile storage medium and electronic equipment
CN114064716B (en) Metadata-based automatic WEB report generation method and device
CN116484820A (en) Form configuration method and device and computer equipment
CN116756022A (en) Data preparation method, device, computer equipment and storage medium

Legal Events

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