CN118092897A - Low code generation method and device for database DML tool - Google Patents

Low code generation method and device for database DML tool Download PDF

Info

Publication number
CN118092897A
CN118092897A CN202410223122.0A CN202410223122A CN118092897A CN 118092897 A CN118092897 A CN 118092897A CN 202410223122 A CN202410223122 A CN 202410223122A CN 118092897 A CN118092897 A CN 118092897A
Authority
CN
China
Prior art keywords
database
information
tool
component
dml
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
CN202410223122.0A
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 and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
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 and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN202410223122.0A priority Critical patent/CN118092897A/en
Publication of CN118092897A publication Critical patent/CN118092897A/en
Pending legal-status Critical Current

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Stored Programmes (AREA)

Abstract

The invention discloses a low code generation method and a device of a database DML tool, which relate to the technical field of finance or other technologies, and the method comprises the following steps: acquiring database type information, application name information, a Structured Query Language (SQL) template, SQL text analysis logic and operation instructions; determining a data source JBDC of the DML tool according to the database type information; generating a component according to the operation instruction; obtaining front-end page information of a database DML tool; according to the data source JBDC of the database DML tool, the front-end page information of the database DML tool and the SQL text analysis logic, the database DML tool is generated, and the method and the device can save the development labor cost of the database DML tool, avoid errors caused by cognitive deviation of developers and improve the development efficiency.

Description

Low code generation method and device for database DML tool
Technical Field
The invention relates to the technical field of finance, in particular to a low code generation method and device of a database DML tool.
Background
This section is intended to provide a background or context for embodiments of the invention. The description herein is not admitted to be prior art by inclusion in this section.
Low code development is a method of application development through visualization, enabling developers with different experience levels to create web pages and mobile applications through a graphical user interface using drag components and model driven logic. The low code development platform allows non-technical developers to not have to write code, but rather abstract traditional IT architecture to support professional developers. The business and IT department developers can create, iterate, and publish applications together, taking less time than conventional, such as APAAS (Application Platform AS A SERVICE, application platform is a service).
Digital economies have become an integral part of the socioeconomic development process. The data is used as a key production element of the financial industry, and the database is not operated in development and test work. Operations on databases are typically added, deleted, changed, or viewed, also known as data manipulation languages (Data Manipulation Language, DML). DML is a programming statement for running access work on objects and data in a database, typically a subset of a database-specific programming language, for example, in the SQL (Structured Query Language ) language of the information software industry traffic standard, with INSERT, UPDATE, DELETE instructions as the core, representing insertion (meaning addition or creation), update (modification) and deletion (destruction), respectively.
However, since the data in the financial industry is used as an internal security material, the DML authority of the database cannot be directly opened to all staff, and the purpose of controlling the operation authority of the database is achieved by a mode of solidifying the database to change the SQL and customizing part of fields in the database, namely, a mode of developing a database DML tool in a fixed mode, so that the method is inevitably hindered in the development and test processes. In the face of increasing DML change demands of databases, if IT staff of a company adopts a traditional development mode to develop DML tools, more developers are needed to solve the need for a large number of innovative services, but due to high manpower resource cost and error caused by cognitive deviation of the developers, the company is even more lack of competitiveness.
Disclosure of Invention
The embodiment of the invention provides a low code generation method of a database DML tool, which is used for saving the development labor cost of the database DML tool, avoiding errors caused by cognitive deviation of developers and improving the development efficiency, and comprises the following steps:
Acquiring database type information, application name information, a Structured Query Language (SQL) template, SQL text analysis logic and operation instructions; the SQL template comprises a parameter class character string and an attribute class character string expressed by a specific character string; the SQL text analysis logic is used for acquiring an SQL text input by a user according to an SQL template, splitting the SQL text, replacing the attribute type character string in the split SQL text with the attribute value of the component according to the corresponding relation between the attribute value of the component and the attribute type character string, and splicing the replaced SQL text; the operation instruction is used for defining the position, the name and the attribute value of the component;
Determining a data source JBDC of the database DML tool according to the database type information, the application name information and a pre-configured data source information table; the data source information table comprises corresponding relations between database type information, application name information and database access information;
Generating a component according to the operation instruction; the component name of the component is a parameter character string; the attribute values of the components are in one-to-one correspondence with attribute type character strings;
Obtaining front-end page information of a database DML tool according to the operation instruction and the component information; the component information comprises a component name, a component attribute value and component position information;
the database DML tool is generated from the data source JBDC (Java Database Connectivity, java database connection) of the database DML tool, the front page information of the database DML tool, and the SQL text parsing logic.
The embodiment of the invention also provides a low code generation device of the database DML tool, which is used for saving the development labor cost of the database DML tool, avoiding errors caused by cognitive deviation of developers and improving the development efficiency, and comprises the following steps:
The acquisition module is used for acquiring database type information, application name information, a Structured Query Language (SQL) template, SQL text analysis logic and operation instructions; the SQL template comprises a parameter class character string and an attribute class character string expressed by a specific character string; the SQL text analysis logic is used for acquiring an SQL text input by a user according to an SQL template, splitting the SQL text, replacing the attribute type character string in the split SQL text with the attribute value of the component according to the corresponding relation between the attribute value of the component and the attribute type character string, and splicing the replaced SQL text; the operation instruction is used for defining the position, the name and the attribute value of the component;
The customization module is used for determining a data source JBDC of the database data operation language DML tool according to the database type information, the application name information and a pre-configured data source information table; the data source information table comprises corresponding relations between database type information, application name information and database access information;
The component generating module is used for generating a component according to the operation instruction; the component name of the component is a parameter character string; the attribute values of the components are in one-to-one correspondence with attribute type character strings;
the front-end page information generation module is used for obtaining front-end page information of the database DML tool according to the operation instruction and the component information; the component information comprises a component name, a component attribute value and component position information;
The database DML tool generating module is configured to generate a database DML tool according to a data source JBDC of the database DML tool, front page information of the database DML tool, and SQL text parsing logic.
Compared with the technical scheme of adopting the traditional research and development mode to develop the DML tool in the prior art, the embodiment of the invention obtains the database type information, the application name information, the structured query language SQL template, the SQL text analysis logic and the operation instruction; the SQL template comprises a parameter class character string and an attribute class character string expressed by a specific character string; the SQL text analysis logic is used for acquiring an SQL text input by a user according to an SQL template, splitting the SQL text, replacing the attribute type character string in the split SQL text with the attribute value of the component according to the corresponding relation between the attribute value of the component and the attribute type character string, and splicing the replaced SQL text; the operation instruction is used for defining the position, the name and the attribute value of the component; determining a data source JBDC of the database DML tool according to the database type information, the application name information and a pre-configured data source information table; the data source information table comprises corresponding relations between database type information, application name information and database access information; generating a component according to the operation instruction; the component name of the component is a parameter character string; the attribute values of the components are in one-to-one correspondence with attribute type character strings; obtaining front-end page information of a database DML tool according to the operation instruction and the component information; the component information comprises a component name, a component attribute value and component position information; according to the data source JBDC of the database DML tool, the front-end page information of the database DML tool and the SQL text analysis logic, the database DML tool is generated, so that the development labor cost of the database DML tool can be saved, errors caused by cognitive deviation of developers can be avoided, and the development efficiency is improved.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art. In the drawings:
FIG. 1 is a flow chart of a method of low code generation for a database DML tool in an embodiment of the invention;
FIG. 2 is a block diagram of a low code generation system for a database DML tool in accordance with an embodiment of the present invention;
FIG. 3 is a technical framework diagram of a low code generation system of a database DML tool in an embodiment of the invention;
FIG. 4 is a flow chart of an implementation of the low code generation system of the database DML tool in an embodiment of the invention;
FIG. 5 is a schematic diagram of a low code generation apparatus for a database DML tool in an embodiment of the invention;
fig. 6 is a schematic diagram of a computer device according to an embodiment of the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the embodiments of the present invention will be described in further detail with reference to the accompanying drawings. The exemplary embodiments of the present invention and their descriptions herein are for the purpose of explaining the present invention, but are not to be construed as limiting the invention.
In order to avoid the traditional research and development pressure brought by the increasing demands on database DML tools in the development and testing processes of the financial industry, save the development labor cost of the database DML tools, avoid errors caused by cognitive deviation of developers and improve the development efficiency, the invention provides a low-code development method of the database DML tools based on SQL splitting. FIG. 1 is a flowchart of a method for generating a low code of a database DML tool according to an embodiment of the present invention, as shown in FIG. 1, the method for generating a low code of a database DML tool may include:
Step 101, obtaining database type information, application name information, a Structured Query Language (SQL) template, SQL text analysis logic and an operation instruction; the SQL template comprises a parameter class character string and an attribute class character string expressed by a specific character string; the SQL text analysis logic is used for acquiring an SQL text input by a user according to an SQL template, splitting the SQL text, replacing the attribute type character string in the split SQL text with the attribute value of the component according to the corresponding relation between the attribute value of the component and the attribute type character string, and splicing the replaced SQL text; the operation instruction is used for defining the position, the name and the attribute value of the component;
step 102, determining a data source JBDC of a database DML tool according to database type information, application name information and a pre-configured data source information table; the data source information table comprises corresponding relations between database type information, application name information and database access information;
step 103, generating a component according to the operation instruction; the component name of the component is a parameter character string; the attribute values of the components are in one-to-one correspondence with attribute type character strings;
104, obtaining front-end page information of the database DML tool according to the operation instruction and the component information; the component information comprises a component name, a component attribute value and component position information;
Step 105, generating the database DML tool according to the data source JBDC of the database DML tool, the front page information of the database DML tool, and the SQL text parsing logic.
In one embodiment, the low code development method of the database DML tool can be based on a system or platform, and the embodiment of the invention provides a low code development platform of the database DML tool based on SQL splitting, which completes the development of the database DML tool in a form of a visual drag control.
In this embodiment, the low-code development platform of the database DML tool may include four modules in total, namely, a data source automatic encapsulation module, an SQL statement parsing module, a tool interface visual design module, and a front-end and back-end integration module. Even if the user does not have knowledge base of front-end and back-end development, the method and the platform in the embodiment of the invention can be utilized to rapidly develop a database DML tool so as to enable other people to complete the addition, deletion and modification of the database. The development labor cost in the traditional development mode is saved, and the enterprise digitization level is also improved.
Fig. 2 is a frame diagram of a low code generation system of a database DML tool in an embodiment of the present invention, where, as shown in fig. 2, the low code generation system of the database DML tool may include a storage layer, a back end, and a front end, and a user may access the front end of a platform in an http manner through a browser to complete tool development. The storage layer can adopt a MySQL database; the back end can adopt a Linux server or a Java platform and realize personnel management, a workbench, authority management, page generation, approval management, development flow, a custom component and log management functions; the front-end may complete drag generation of the database DML tool front-end page using a Vue framework, HTML (HyperText Markup Language ) technology, JS (JavaScript, javaScript programming language), etc.
FIG. 3 is a technical framework diagram of a low code generation system of a database DML tool according to an embodiment of the present invention, as shown in FIG. 3:
The data source automatic packaging module can complete three functions of judging the type of the database, acquiring the information of the database and splicing the data source JDBC. The low code generation system of the database DML tool supports multiple database types, and JDBCs of different types of databases may have minor differences, so that the database types need to be determined in the data source automatic encapsulation module. Each JDBC will set a fixed template where the database address, database port, and database instance name need to be customized, depending on the advanced configuration of the user (system user) of the low code generation system of the database DML tool. And finally, replacing the actual database address, port and instance name to obtain the data source JDBC used by the final database DML tool.
The SQL sentence analysis module needs to complete functions of SQL text acquisition, SQL sentence regular splitting and SQL sentence analysis. For the database DML operation that the user of the low code generation system of the database DML tool needs to implement by using the page developed by the low code generation system of the database DML tool, that is, the corresponding SQL statement, the user needs to define when designing the tool. The SQL statement parsing module will store the complete SQL text for subsequent splitting. The SQL text splitting can be realized through regularization, and the SQL text is mainly split into three parts, wherein one part is a grammar type character string, the other part is a parameter type character string, and the other part is an attribute type character string. And then, restoring the statement through SQL statement analysis, and marking the located attribute type character strings so as to integrate the following front end and the following back end.
The tool interface visual design module comprises three functions of component drag design, component customization and interface information transmission. A user of a low code generation system of the database DML tool can drag the components to design a UI interface of the database DML tool in a visual mode, wherein each component needs to be customized to correspond to a parameter class character string and an attribute class character string in the SQL sentence analysis module. And finally, packaging the interface information, including the component information and the customized information, and transmitting the packaged interface information to the back end for subsequent front-end and back-end integration.
The front-end and back-end integration module needs to complete the function of SQL statement customization and front-end and back-end logic splicing. The analyzed SQL sentence has attribute character strings which need to be spliced with the component attributes in the front-end component one by one, so that after a database DML tool user inputs the SQL customized field at the front end, the SQL sentence which is finally executed by the user can be spliced to the rear end through the logic. Meanwhile, front-end and back-end integration is completed through the corresponding relation between the attribute type character strings in the SQL sentences and the attributes of the front-end components.
Fig. 4 is a flowchart showing an implementation flow of the system for implementing the low code generation system of the database DML tool in the embodiment of the present invention. The system user first needs to complete the data source configuration, including the database type, the database address, the database port and the database instance, and configures the corresponding key field application name. Therefore, when the interface is defined, the corresponding database information can be positioned only by selecting the type and the application name of the database. And then a user of the system needs to input an SQL template, wherein the attribute character string needs to be replaced by a special character, so that the attribute character string can be positioned according to the special character string when SQL analysis is realized. Also, since the format of the defined field in the SQL statement is fixed to "field name=field value", when the field value is determined to be the attribute class string, the string located at the front of it "=" is marked as the parameter class string. In the process of component design, the customized field attributes are replaced by the corresponding special characters in the SQL statement. When there are multiple customization fields, it is necessary to ensure that both the SQL statement attribute class strings and the component attributes are one-to-one, so that the customization values are consistent and in one-to-one correspondence. After the design of the back-end logic and the front-end interface is completed, the front-end logic and back-end logic integration can be completed by clicking the generating tool, so that the database DML tool is generated.
The low code generation system using the database DML tool can solve the problem of insufficient quantity of company developers, and as the old technical method for generating a large quantity of required documents, the business application of the low code generation system using the database DML tool can more conveniently inject the requirements into the application development environment, and the change requirements can not generate errors due to the deviation recognized by the company IT team.
In one embodiment, since the DML tool for generating the database needs to access multiple database types, and JDBCs of different types of databases may have minor differences, it is necessary to determine the database types and pre-configure the data source information table to quickly locate the corresponding database information. In step 102 of the low code generation method of the database DML tool, determining the data source JBDC of the database DML tool according to the database type information, the application name information, and the pre-configured data source information table may include: determining a Java database connection JBDC template of a data source according to the database type information; the data source JBDC template includes fields to be customized; and according to the database type information, the application name information and the pre-configured data source information table, customizing the field to be customized in the data source JBDC template to obtain a data source JBDC of the database DML tool. For example, a developer needs to develop a database DML tool for MySQL database, determine a data source JBDC template according to the database type information, i.e., mySQL, and then according to the database type information: mySQL, application name information: XXX1, the fields to be customized in the templates of data source JBDC.
In this embodiment, in order to more simply, quickly and efficiently complete the data source configuration of the database SQL tool, according to the database type information, the application name information and the pre-configured data source information table, the customization of the to-be-customized fields in the data source JBDC template is performed to obtain the data source JBDC of the database DML tool, which may include: determining database access information according to database type information, application name information and a pre-configured data source information table; the database access information comprises one or any combination of database IP address information, database port information and database instance name information; and customizing a field to be customized in a data source JBDC template according to the database access information to obtain a data source JBDC of the database DML tool. For example, a developer needs to develop a database DML tool for MySQL database, where the input database type information is MySQL, the application name information is XXX1, and the system searches the corresponding database IP address information in the preconfigured data source information table for xx.xx.xx.xx, the database port information is port 1, and the database instance name information is XXX. And determining a data source JBDC template for the MySQL database according to the database type information, and customizing a field to be customized in the data source JBDC template by utilizing database ip address information (XX.XX.XX), database port information (port 1) and database instance name information (XXX) to obtain a data source JBDC of the database DML tool.
In this embodiment, to implement low code data source customization, the customization of the to-be-customized field in the data source JBDC template according to the database access information may include: and replacing the field to be customized in the template of the data source JBDC with database access information. For example, the to-be-customized field in the data source JBDC template may be replaced with database ip address information (xx.xx.xx.xx), database port information (port 1), and database instance name information (XXX).
In one embodiment, in order for a developer to develop a database DML tool based on SQL text quickly even without knowledge base of front-end and back-end development, the low code generation method of the database DML tool may further include: generating an SQL text component according to the operation instruction; generating the database DML tool according to the data source JBDC of the database DML tool, the front page information of the database DML tool, and the SQL text parsing logic may include: the method comprises the steps of utilizing SQL text analysis logic to obtain an SQL text input by a user through an SQL text component, analyzing the logic of the SQL text, splitting the SQL text according to the type of character strings, replacing the attribute character strings in the split SQL text with the attribute values of the components according to the corresponding relation between the attribute values of the components and the attribute character strings, and splicing the SQL text after replacement according to the logic of the analyzed SQL text; the character string types comprise grammar character strings, parameter character strings and attribute character strings. For example, suppose a developer wants to develop a MySQL database tool with an INSERT function, and can drag on the front-end page to generate an SQL text component, and according to the already configured SQL text parsing logic, can receive the SQL text input by the user through the SQL text component, the general format of the INSERT sentence is "INSERT INTO table name (field name 1, field name 2, … …) VALUES (variable name 1, variable name 2, … …)", and the template instance is "INSERT intofn_test (status, creator, … …) VALUES (num 1, num2, … …)". Analyzing the logic of the SQL text, wherein num1 and num2 are special character strings, corresponding attribute character strings, status, creator is a customized field, and the marks num1 and num2 in the back-end logic need to be replaced by specific attribute values sent by the front-end component. Splitting the SQL text according to the character string type by utilizing SQL text analysis logic, and marking attribute character strings in the split SQL text. Replacing the attribute character strings in the split SQL text by utilizing SQL text parsing logic according to the corresponding relation between the attribute values of the components and the attribute character strings; and splicing the SQL text subjected to replacement processing by utilizing SQL text parsing logic according to the parsed SQL text logic. When the next step of interface visual design is performed, attribute values of all components are defined, and two text boxes are designed assuming status and creator (creator) are texts, wherein field name attributes of the text boxes are defined as num1 and num2 respectively, so that a front-end component can be ensured to correspondingly transmit the values to the rear end after a tool user inputs the two fields, and num1 and num2 in an SQL sentence are replaced, and the customization of the SQL sentence is completed.
In this embodiment, in order to make the splitting and replacing of the SQL text more convenient, splitting the SQL text according to the type of the character string, and replacing the attribute type character string in the split SQL text with the attribute value of the component according to the correspondence between the attribute value of the component and the attribute type character string may include: splitting the SQL text according to the character string type by utilizing SQL text analysis logic and a regular expression; and marking the attribute type character strings in the split SQL text by utilizing SQL text analysis logic, searching the attribute type character strings in the SQL text according to the marks, and replacing the searched attribute type character strings with the attribute values of the components according to the corresponding relations between the attribute values of the components and the attribute type character strings. For example, using SQL text parsing logic and regular expressions, splitting "INSERT INTO fn_test (status, creator, … …)" VALUES (num 1, num2, … …) according to grammar class strings, parameter class strings, attribute class strings; marking attribute character strings in the split SQL text by utilizing SQL text analysis logic, namely marking num1 and num2 as special character strings and corresponding attribute character strings, marking num1 and num2, searching the attribute character strings in the SQL text according to the marks, and replacing the searched attribute character strings with the attribute values of the components according to the corresponding relations between the attribute values of the components and the attribute character strings.
In one embodiment, the generating component according to the operation instruction may include: determining the position, name and attribute value of the component according to the operation instruction; and generating the components according to the positions, names and attribute values of the components. For example, a developer inputs a drag operation instruction to determine the position of the component, inputs a name and an attribute value to determine the name and the attribute value of the component; and inputting a determining operation instruction, and generating the component according to the position, the name and the attribute value of the component by the aid of the platform. In this way, a developer can visualize the dragging component through a simple operation instruction, define component information and complete the development of the database DML tool.
In one embodiment, the database DML tool generated by the low code generation method of the database DML tool supports the addition, modification, deletion, (dictionary) query function of database tables. Dictionary queries refer to: the technique may configure the query page to specify an enumeration type for some of the fields. For example: sex 1-male, 0-female. The configured query results can be automatically translated.
To facilitate an understanding of embodiments of the present invention, examples of the development of a low code generation method for a database DML tool are as follows:
Firstly, the system user configures data source information as shown in the following table 1, and when developing, the corresponding ip, port and instance name information can be positioned by inputting the application name and the database type:
TABLE 1
Application name Database type Database ip address Database port Database instance names
XXX1 MySQL XX.XX.XX.XX 3306 XXX
XXX2 DB2 …… …… ……
XXX3 Oracle …… …… ……
XXX4 GaussDB …… …… ……
(1) Suppose that a system user needs to develop a MySQL database tool with an insert function.
The general format of the inserted sentence is "INSERT INTO table name (field name 1, field name 2, … …) VALUES (variable name 1, variable name 2, … …)", and when configuring the SQL template, it is required to ensure that each customized field corresponds to a variable to be input. Thus, the template example is "INSERT intofn_test (status, creator, … …) VALUES (num 1, num2, … …)", where num1, num2 are special strings, corresponding attribute type strings, status, creator is a customized field, and the back-end logical labels num1, num2 need to be replaced with specific attribute values sent by the front-end component. When the next step of interface visual design is performed, attribute values of all components are defined, and two text boxes are designed assuming status and creator are texts, wherein field name attributes of the text boxes are respectively defined as num1 and num2, so that a front-end component can be ensured to correspondingly transmit the values to the rear end after a tool user inputs the two fields, and num1 and num2 in an SQL sentence are replaced, and customization of the SQL sentence is completed. And finally, logically assembling the front end and the back end, and generating a tool interface to finish the development of the database INSERT tool.
(2) Suppose that a system user needs to develop a MySQL database tool with change functionality.
The general format of the change statement is "UPDATE table name SET field 1=variable 1, field 2=variable 2where field 3=variable 3", and then an example is "UPDATE fn_test SET status=num 1, creator =num 2where id=num 3". And if num1, num2 and num3 are special character strings and corresponding attribute character strings, status, creator, id is a customized field, and the back-end logic marks num1, num2 and num3 to be replaced by specific attribute values sent by the front-end component. The UI interface needs to drag three components correspondingly and define the component attributes as num1, num2, and num3, and transmit corresponding values of num1, num2, and num3 to the back end, respectively.
In this embodiment, delete and query statements and so on.
In summary, compared with the technical scheme of adopting the traditional research and development mode to develop the DML tool in the prior art, the embodiment of the invention obtains the database type information, the application name information, the structured query language SQL template, the SQL text analysis logic and the operation instruction; the SQL template comprises a parameter class character string and an attribute class character string expressed by a specific character string; the SQL text analysis logic is used for acquiring an SQL text input by a user according to an SQL template, splitting the SQL text, replacing the attribute type character string in the split SQL text with the attribute value of the component according to the corresponding relation between the attribute value of the component and the attribute type character string, and splicing the replaced SQL text; the operation instruction is used for defining the position, the name and the attribute value of the component; determining a Java database connection JBDC template of a data source according to the database type information; the data source JBDC template includes fields to be customized; according to the database type information, the application name information and the pre-configured data source information table, the to-be-customized fields in the data source JBDC template are customized to obtain a data source JBDC of the database DML tool; the data source information table comprises corresponding relations between database type information, application name information and database access information; generating a component according to the operation instruction; the component name of the component is a parameter character string; the attribute values of the components are in one-to-one correspondence with attribute type character strings; obtaining front-end page information of a database DML tool according to the operation instruction and the component information; the component information comprises a component name, a component attribute value and component position information; according to the data source JBDC of the database DML tool, the front-end page information of the database DML tool and the SQL text analysis logic, the database DML tool is generated, so that the development labor cost of the database DML tool can be saved, errors caused by cognitive deviation of developers can be avoided, and the development efficiency is improved.
The embodiment of the invention also provides a low code generation device of the database DML tool, which is described in the following embodiment. Because the principle of the device for solving the problem is similar to that of the low code generation method of the database DML tool, the implementation of the device can be referred to the implementation of the low code generation method of the database DML tool, and the repetition is omitted.
FIG. 5 is a schematic diagram of a low code generation apparatus for a database DML tool in an embodiment of the invention, comprising:
The acquiring module 501 is configured to acquire database type information, application name information, a structured query language SQL template, SQL text parsing logic and an operation instruction; the SQL template comprises a parameter class character string and an attribute class character string expressed by a specific character string; the SQL text analysis logic is used for acquiring an SQL text input by a user according to an SQL template, splitting the SQL text, replacing the attribute type character string in the split SQL text with the attribute value of the component according to the corresponding relation between the attribute value of the component and the attribute type character string, and splicing the replaced SQL text; the operation instruction is used for defining the position, the name and the attribute value of the component;
The customization module 502 is configured to determine a data source JBDC of the database data manipulation language DML tool according to the database type information, the application name information, and the pre-configured data source information table; the data source information table comprises corresponding relations between database type information, application name information and database access information;
a component generating module 503, configured to generate a component according to the operation instruction; the component name of the component is a parameter character string; the attribute values of the components are in one-to-one correspondence with attribute type character strings;
The front page information generating module 504 is configured to obtain front page information of the database DML tool according to the operation instruction and the component information; the component information comprises a component name, a component attribute value and component position information;
The database DML tool generating module 505 is configured to generate a database DML tool according to the data source JBDC of the database DML tool, front page information of the database DML tool, and SQL text parsing logic.
In one embodiment, the customization module 502 is specifically configured to determine the data source JBDC of the database DML tool according to the database type information, the application name information, and the preconfigured data source information table, and includes:
determining a Java database connection JBDC template of a data source according to the database type information; the data source JBDC template includes fields to be customized;
And according to the database type information, the application name information and the pre-configured data source information table, customizing the field to be customized in the data source JBDC template to obtain a data source JBDC of the database DML tool.
In this embodiment, the customization module 502 is specifically configured to:
Determining database access information according to database type information, application name information and a pre-configured data source information table; the database access information comprises one or any combination of database ip address information, database port information and database instance name information;
and customizing a field to be customized in a data source JBDC template according to the database access information to obtain a data source JBDC of the database DML tool.
In this embodiment, the customization module 502 is specifically configured to:
And replacing the field to be customized in the template of the data source JBDC with database access information.
In one embodiment, the low code generation apparatus of the database DML tool further includes: the SQL text component generating module is used for: generating an SQL text component according to the operation instruction;
The database DML tool generation module 505 is specifically configured to:
The method comprises the steps of utilizing SQL text analysis logic to obtain an SQL text input by a user through an SQL text component, analyzing the logic of the SQL text, splitting the SQL text according to the type of character strings, replacing the attribute character strings in the split SQL text with the attribute values of the components according to the corresponding relation between the attribute values of the components and the attribute character strings, and splicing the SQL text after replacement according to the logic of the analyzed SQL text; the character string types comprise grammar character strings, parameter character strings and attribute character strings.
In this embodiment, the database DML tool generating module 505 is specifically configured to:
Splitting the SQL text according to the character string type by utilizing SQL text analysis logic and a regular expression;
and marking the attribute type character strings in the split SQL text by utilizing SQL text analysis logic, searching the attribute type character strings in the SQL text according to the marks, and replacing the searched attribute type character strings with the attribute values of the components according to the corresponding relations between the attribute values of the components and the attribute type character strings.
In one embodiment, the component generating module 503 is specifically configured to:
determining the position, name and attribute value of the component according to the operation instruction;
and generating the components according to the positions, names and attribute values of the components.
The embodiment of the invention provides a low-code development method, a device and a platform for a database DML tool based on SQL splitting, which realize the low-code development of the database DML tool according to the steps of the low-code development method of the database DML tool through the synergistic effect of a data source self-encapsulation module, an SQL statement analysis module, a tool interface visual design module and a front-end and back-end integration module of a system. The development of the database DML tool can be completed through three steps of simple configuration data source, configuration SQL template and visual interface design by a system user (developer), and the manpower cost loss in the traditional research and development mode is avoided. Even if a developer does not develop a foundation, the method, the system and the device provided by the invention can complete the development task, and are simple, quick and efficient. The developed tool can also be used by users to realize the addition, deletion, modification and checking of the database so as to improve the development and test efficiency of the financial industry.
An embodiment of the present invention further provides a computer device, and fig. 6 is a schematic diagram of a computer device in the embodiment of the present invention, where the computer device 600 includes a memory 610, a processor 620, and a computer program 630 stored in the memory 610 and capable of running on the processor 620, and when the processor 620 executes the computer program 630, the low code generation method of the database DML tool is implemented.
The embodiment of the invention also provides a computer readable storage medium, wherein the computer readable storage medium stores a computer program, and the computer program realizes the low code generation method of the database DML tool when being executed by a processor.
The embodiment of the invention also provides a computer program product, which comprises a computer program, wherein the computer program is executed by a processor to realize the low code generation method of the database DML tool.
It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The foregoing description of the embodiments has been provided for the purpose of illustrating the general principles of the invention, and is not meant to limit the scope of the invention, but to limit the invention to the particular embodiments, and any modifications, equivalents, improvements, etc. that fall within the spirit and principles of the invention are intended to be included within the scope of the invention.

Claims (11)

1. A method for generating a low code for a database data manipulation language DML tool, comprising:
Acquiring database type information, application name information, a Structured Query Language (SQL) template, SQL text analysis logic and operation instructions; the SQL template comprises a parameter class character string and an attribute class character string expressed by a specific character string; the SQL text analysis logic is used for acquiring an SQL text input by a user according to an SQL template, splitting the SQL text, replacing the attribute type character string in the split SQL text with the attribute value of the component according to the corresponding relation between the attribute value of the component and the attribute type character string, and splicing the replaced SQL text; the operation instruction is used for defining the position, the name and the attribute value of the component;
Determining a data source JBDC of the database DML tool according to the database type information, the application name information and a pre-configured data source information table; the data source information table comprises corresponding relations between database type information, application name information and database access information;
Generating a component according to the operation instruction; the component name of the component is a parameter character string; the attribute values of the components are in one-to-one correspondence with attribute type character strings;
Obtaining front-end page information of a database DML tool according to the operation instruction and the component information; the component information comprises a component name, a component attribute value and component position information;
and generating the database DML tool according to the data source JBDC of the database DML tool, the front-end page information of the database DML tool and the SQL text parsing logic.
2. The method of claim 1, wherein determining the data source JBDC of the database DML tool based on the database type information, the application name information, and the pre-configured data source information table, comprises:
determining a Java database connection JBDC template of a data source according to the database type information; the data source JBDC template includes fields to be customized;
And according to the database type information, the application name information and the pre-configured data source information table, customizing the field to be customized in the data source JBDC template to obtain a data source JBDC of the database DML tool.
3. The method of claim 2, wherein customizing the to-be-customized field in the data source JBDC template according to the database type information, the application name information, and the pre-configured data source information table to obtain the data source JBDC of the database DML tool comprises:
Determining database access information according to database type information, application name information and a pre-configured data source information table; the database access information comprises one or any combination of database ip address information, database port information and database instance name information;
and customizing a field to be customized in a data source JBDC template according to the database access information to obtain a data source JBDC of the database DML tool.
4. The method of claim 3, wherein customizing the to-be-customized field in the data source JBDC template according to the database access information comprises:
And replacing the field to be customized in the template of the data source JBDC with database access information.
5. The method as recited in claim 1, further comprising:
Generating an SQL text component according to the operation instruction;
Generating the database DML tool according to the data source JBDC of the database DML tool, front page information of the database DML tool, and SQL text parsing logic, including:
The method comprises the steps of utilizing SQL text analysis logic to obtain an SQL text input by a user through an SQL text component, analyzing the logic of the SQL text, splitting the SQL text according to the type of character strings, replacing the attribute character strings in the split SQL text with the attribute values of the components according to the corresponding relation between the attribute values of the components and the attribute character strings, and splicing the SQL text after replacement according to the logic of the analyzed SQL text; the character string types comprise grammar character strings, parameter character strings and attribute character strings.
6. The method of claim 5, wherein splitting the SQL text according to the string type, and replacing the attribute class string in the split SQL text with the attribute value of the component according to the correspondence between the attribute value of the component and the attribute class string, comprises:
Splitting the SQL text according to the character string type by utilizing SQL text analysis logic and a regular expression;
and marking the attribute type character strings in the split SQL text by utilizing SQL text analysis logic, searching the attribute type character strings in the SQL text according to the marks, and replacing the searched attribute type character strings with the attribute values of the components according to the corresponding relations between the attribute values of the components and the attribute type character strings.
7. The method of claim 1, wherein generating a component from the operational instructions comprises:
determining the position, name and attribute value of the component according to the operation instruction;
and generating the components according to the positions, names and attribute values of the components.
8. A low code generation apparatus for a database DML tool, comprising:
The acquisition module is used for acquiring database type information, application name information, a Structured Query Language (SQL) template, SQL text analysis logic and operation instructions; the SQL template comprises a parameter class character string and an attribute class character string expressed by a specific character string; the SQL text analysis logic is used for acquiring an SQL text input by a user according to an SQL template, splitting the SQL text, replacing the attribute type character string in the split SQL text with the attribute value of the component according to the corresponding relation between the attribute value of the component and the attribute type character string, and splicing the replaced SQL text; the operation instruction is used for defining the position, the name and the attribute value of the component;
The customization module is used for determining a data source JBDC of the database data operation language DML tool according to the database type information, the application name information and a pre-configured data source information table; the data source information table comprises corresponding relations between database type information, application name information and database access information;
The component generating module is used for generating a component according to the operation instruction; the component name of the component is a parameter character string; the attribute values of the components are in one-to-one correspondence with attribute type character strings;
the front-end page information generation module is used for obtaining front-end page information of the database DML tool according to the operation instruction and the component information; the component information comprises a component name, a component attribute value and component position information;
The database DML tool generating module is configured to generate a database DML tool according to a data source JBDC of the database DML tool, front page information of the database DML tool, and SQL text parsing logic.
9. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the method of any of claims 1 to 7 when executing the computer program.
10. A computer readable storage medium, characterized in that the computer readable storage medium stores a computer program which, when executed by a processor, implements the method of any of claims 1 to 7.
11. A computer program product, characterized in that the computer program product comprises a computer program which, when executed by a processor, implements the method of any of claims 1 to 7.
CN202410223122.0A 2024-02-28 2024-02-28 Low code generation method and device for database DML tool Pending CN118092897A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410223122.0A CN118092897A (en) 2024-02-28 2024-02-28 Low code generation method and device for database DML tool

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410223122.0A CN118092897A (en) 2024-02-28 2024-02-28 Low code generation method and device for database DML tool

Publications (1)

Publication Number Publication Date
CN118092897A true CN118092897A (en) 2024-05-28

Family

ID=91162966

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410223122.0A Pending CN118092897A (en) 2024-02-28 2024-02-28 Low code generation method and device for database DML tool

Country Status (1)

Country Link
CN (1) CN118092897A (en)

Similar Documents

Publication Publication Date Title
US9779133B2 (en) Contextual debugging of SQL queries in database-accessing applications
US10162610B2 (en) Method and apparatus for migration of application source code
AU2010319344B2 (en) Managing record format information
US10691584B2 (en) Behavior driven development integration with test tool
CN108762743B (en) Data table operation code generation method and device
US10614126B2 (en) Textual query editor for graph databases that performs semantic analysis using extracted information
US11768677B2 (en) Method and system for software application optimization using natural language-based queries
Luković et al. An approach to developing complex database schemas using form types
US20150261507A1 (en) Validating sql queries in a report
US11301643B2 (en) String extraction and translation service
CN114253995A (en) Data tracing method, device, equipment and computer readable storage medium
CN113297251A (en) Multi-source data retrieval method, device, equipment and storage medium
CN116166718B (en) Data blood margin acquisition method and device
CN112506488A (en) Method for generating programming language class based on sql creating statement
CN118092897A (en) Low code generation method and device for database DML tool
García et al. Improving understanding of dynamically typed software developed by agile practitioners
Kosanović et al. Applang–A DSL for specification of mobile applications for android platform based on textX
US20240046214A1 (en) Systems and methods for facilitating modifications and updates to shared content
US20230306002A1 (en) Help documentation enabler
Misev Integrating SUMO and OMDoc
KR20050027462A (en) Program automatic generating tools and method
Elotmani et al. Automating the Creation of Graph-Based NoSQL Databases in the Context of Big Data
Chang et al. Improvement of Excel data processing function based on Spring MVC framework
WO2022204409A1 (en) Systems and methods for implementing homoiconic representations of client-specific datasets
CN116562819A (en) Intelligent management system for hydraulic engineering construction scheme and construction organization design method

Legal Events

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