WO2022242635A1 - Management device for sql records for maintenance and application system - Google Patents

Management device for sql records for maintenance and application system Download PDF

Info

Publication number
WO2022242635A1
WO2022242635A1 PCT/CN2022/093284 CN2022093284W WO2022242635A1 WO 2022242635 A1 WO2022242635 A1 WO 2022242635A1 CN 2022093284 W CN2022093284 W CN 2022093284W WO 2022242635 A1 WO2022242635 A1 WO 2022242635A1
Authority
WO
WIPO (PCT)
Prior art keywords
sql
record
maintenance
records
template
Prior art date
Application number
PCT/CN2022/093284
Other languages
French (fr)
Chinese (zh)
Inventor
汪永松
Original Assignee
安翰科技(武汉)股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 安翰科技(武汉)股份有限公司 filed Critical 安翰科技(武汉)股份有限公司
Publication of WO2022242635A1 publication Critical patent/WO2022242635A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/21Design, administration or maintenance of databases
    • 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/23Updating
    • G06F16/2379Updates performed during online database operations; commit processing
    • 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/25Integrating or interfacing systems involving database management systems
    • G06F16/252Integrating or interfacing systems involving database management systems between a Database Management System and a front-end application
    • 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/28Databases characterised by their database models, e.g. relational or object models
    • G06F16/284Relational databases

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Stored Programmes (AREA)

Abstract

Disclosed are a management device for SQL records for maintenance and an application system, the device comprising a service database connection module, a template definition module, a record management module and an API interface module. In the device, SQL commands or templates for maintenance are extracted from codes or configuration files and packaged into records that can be maintained by means of a user interface, then all of the records are managed in a unified way, improving management efficiency and reducing the complexity and costs of development and maintenance.

Description

维护用SQL记录的管理装置及应用系统Management device and application system for maintaining SQL records
(本申请要求了申请日为2021年05月18日,申请号为202110538142.3,发明名称为“维护用SQL记录的管理装置及应用系统”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。)(This application claims the priority of the Chinese patent application whose application date is May 18, 2021, application number is 202110538142.3, and the title of the invention is "management device and application system for maintaining SQL records", the entire content of which is incorporated by reference in this application.)
技术领域technical field
本发明涉及计算机技术领域,具体涉及一种维护用SQL记录的管理装置及应用系统。The invention relates to the field of computer technology, in particular to a management device and an application system for maintaining SQL records.
背景技术Background technique
对于应用系统,无论是C/S(Client/Server,客户机/服务器)还是B/S(Browser/Server,浏览器/服务器)结构,其本质都是为用户提供信息化服务。而数据又是信息化的核心,所以信息化服务可以狭义地理解成数据服务。从系统实现的层面,提供数据服务是一系列的过程,通常包括:请求数据→获取数据→处理数据→展现数据。For the application system, whether it is C/S (Client/Server, client/server) or B/S (Browser/Server, browser/server) structure, its essence is to provide users with information services. And data is the core of informatization, so informatization services can be narrowly understood as data services. From the level of system implementation, providing data services is a series of processes, usually including: requesting data → obtaining data → processing data → displaying data.
业务数据通常存储在数据库服务器上的数据库系统中,而数据库系统目前绝大多数还是使用关系型数据库(例如:Oracle、MySQL等)。应用系统与数据库系统进行交互的模式:首先注册数据库驱动,然后调用数据库驱动所提供的API(Application Programming Interface,应用程序接口)来建立与数据库系统的连接,继而通过API执行SQL(Structured Query Language,结构化查询语言)语句的方式进行数据库操作,通常包括:数据表的创建和更新,记录的查询、新增、更新和删除等。Business data is usually stored in a database system on a database server, and the vast majority of database systems still use relational databases (for example: Oracle, MySQL, etc.). The mode of interaction between the application system and the database system: first register the database driver, then call the API (Application Programming Interface, application programming interface) provided by the database driver to establish a connection with the database system, and then execute SQL (Structured Query Language, Structured query language) statements to perform database operations, usually including: creation and update of data tables, query, addition, update and deletion of records, etc.
对于数据访问API,业界中常用的有Windows环境下的ODBC(Open Database Connectivity,开放数据库连接),JAVA环境下的JDBC(Java Database Connectivity,Java数据库连接)。For data access APIs, ODBC (Open Database Connectivity, open database connection) in the Windows environment and JDBC (Java Database Connectivity, Java database connection) in the JAVA environment are commonly used in the industry.
所以,从系统实现的层面,数据服务的管理,可以简化地理解为对SQL语句的管理。例如:查询学生信息服务,对应的就是查询学生的SQL语句(SELECT);新增学生记录服务,对应的就是新增学生的SQL语句(INSERT INTO);更新学生信息服务,对应的就是更新学生的SQL语句(UPDATE)。Therefore, from the level of system implementation, the management of data services can be simplified as the management of SQL statements. For example: querying student information service corresponds to querying students' SQL statement (SELECT); adding student record service corresponds to adding student's SQL statement (INSERT INTO); updating student information service corresponds to updating student's SQL statement (UPDATE).
系统越庞大、服务越复杂,用到的SQL语句的数量也会越来越多。从系统实现的层面,系统中存在大量的SQL语句,势必要进行有效的管理,否则会直接影响系统的可维护和开发效率。The larger the system and the more complex the service, the more SQL statements will be used. From the perspective of system implementation, there are a large number of SQL statements in the system, which must be managed effectively, otherwise it will directly affect the maintainability and development efficiency of the system.
随着技术规范的发展(例如:ORM(Object Relational Mapping,对象关系映射)框架,JPA(Java Persistence API,Java持久化API)规范),对于数据的访问不再是比较底层的JDBC API,取而代之的是各种持久层框架,业界使用较多的持久层框架是Hibernate和MyBatis,他们支持的查询语句都不是原生的SQL,而是类SQL,Hibernate支持的是HQL(Hibernate Query Language,Hibernate查询语言),MyBatis支持的是自定义SQL。With the development of technical specifications (for example: ORM (Object Relational Mapping, Object Relational Mapping) framework, JPA (Java Persistence API, Java Persistence API) specification), access to data is no longer a relatively low-level JDBC API, replaced by It is a variety of persistence layer frameworks. Hibernate and MyBatis are the most commonly used persistence layer frameworks in the industry. The query statements they support are not native SQL, but SQL-like. Hibernate supports HQL (Hibernate Query Language, Hibernate Query Language) , MyBatis supports custom SQL.
实际上,持久化框架的底层机制还是执行SQL,不同的是SQL语法和定义方式不同。 MyBatis是在配置文件(XML)中定义,而Hibernate则直接在代码中定义。In fact, the underlying mechanism of the persistence framework still executes SQL, the difference is that the syntax and definition of SQL are different. MyBatis is defined in the configuration file (XML), while Hibernate is defined directly in the code.
对于这样的定义方式,一旦应用系统进行业务规则调整,势必会改动SQL,Hibernate框架中则需要修改代码,重新编译和分发;MyBatis框架中则需要修改配置文件,重新启动Web服务,以便重新加载配置定义。重新启动服务和重新分发代码,这些操作对于信息化系统而言,都会影响服务的提供,算是重大的影响。For such a definition method, once the application system adjusts the business rules, it will inevitably change the SQL. In the Hibernate framework, the code needs to be modified, recompiled and distributed; in the MyBatis framework, the configuration file needs to be modified, and the Web service needs to be restarted to reload the configuration. definition. Restarting services and redistributing codes, these operations will affect the provision of services for information systems, which can be regarded as a major impact.
不仅如此,大量的SQL充斥到配置文件和代码中,会直接增加代码维护的复杂度,而且也会增加测试的难度。并且SQL语句的执行和业务逻辑处理混杂在一起,无法准确区分是数据库访问的问题还是业务逻辑的问题。Not only that, a large amount of SQL is flooded into configuration files and codes, which will directly increase the complexity of code maintenance and also increase the difficulty of testing. Moreover, the execution of SQL statements and business logic processing are mixed together, and it is impossible to accurately distinguish whether it is a problem of database access or a problem of business logic.
发明内容Contents of the invention
本发明的目的在于提供一种维护用SQL记录的管理装置及应用系统。The object of the present invention is to provide a management device and application system for maintaining SQL records.
为实现上述发明目的之一,本发明一实施方式提供一种维护用SQL记录的管理装置,所述装置包括:In order to achieve one of the above-mentioned purposes of the invention, one embodiment of the present invention provides a management device for maintaining SQL records, the device comprising:
业务数据库连接模块,其用于基于业务数据库的连接信息,定义所述业务数据库的连接接口;A business database connection module, which is used to define the connection interface of the business database based on the connection information of the business database;
模板定义模块,其用于定义维护用SQL记录模板,并为使用所述维护用SQL记录模板定义维护用SQL记录提供管理接口;Template definition module, which is used to define the SQL record template for maintenance, and provides a management interface for using the SQL record template for maintenance to define the SQL record for maintenance;
记录管理模块,其用于使用所述管理接口管理维护用SQL记录,并通过所述连接接口与对应的业务数据库进行数据交互;A record management module, which is used to manage and maintain SQL records using the management interface, and perform data interaction with the corresponding business database through the connection interface;
API接口模块,其用于根据所述维护用SQL记录为应用软件提供对应的API接口。The API interface module is used to provide corresponding API interfaces for application software according to the maintenance SQL records.
作为本发明一实施方式的进一步改进,所述连接接口为JNDI标识,所述JNDI标识为对所述业务数据库的连接信息进行定义的连接描述符。As a further improvement of an embodiment of the present invention, the connection interface is a JNDI identifier, and the JNDI identifier is a connection descriptor defining connection information of the service database.
作为本发明一实施方式的进一步改进,所述维护用SQL记录模板包括新增用SQL记录模板、更新用SQL记录模板和删除用SQL记录模板;As a further improvement of an embodiment of the present invention, the SQL record templates for maintenance include SQL record templates for new addition, SQL record templates for update, and SQL record templates for deletion;
所述维护用SQL记录包括新增用SQL记录、更新用SQL记录和删除用SQL记录。The SQL records for maintenance include SQL records for new addition, SQL records for update and SQL records for deletion.
作为本发明一实施方式的进一步改进,所述新增用SQL记录模板的参数包括新增用SQL记录标识、新增用SQL记录标题、JNDI标识和目标数据表;As a further improvement of an embodiment of the present invention, the parameters of the newly added SQL record template include the newly added SQL record identifier, the newly added SQL record title, the JNDI identifier and the target data table;
所述更新用SQL记录模板的参数包括更新用SQL记录标识、更新用SQL记录标题、JNDI标识、目标数据表和更新条件;The parameters of the SQL record template for the update include the SQL record mark for the update, the SQL record title for the update, the JNDI mark, the target data table and the update condition;
所述删除用SQL记录模板的参数包括删除用SQL记录标识、删除用SQL记录标题、JNDI标识、目标数据表和删除条件。The parameters of the deletion SQL record template include the deletion SQL record identifier, the deletion SQL record title, the JNDI identifier, the target data table and the deletion condition.
作为本发明一实施方式的进一步改进,每个所述维护用SQL记录模板的参数还包括板块标识,所述板块标识用于区分维护用SQL记录所属的业务板块。As a further improvement of an embodiment of the present invention, each parameter of the SQL record template for maintenance further includes a block identifier, and the block identifier is used to distinguish the business block to which the SQL record for maintenance belongs.
作为本发明一实施方式的进一步改进,所述维护用SQL记录模板的参数还包括记录状态,所述记录状态包括草稿、待审核、上架和下架,通过修改所述记录状态来控制对应维护用SQL记录模板的启用或停用,其中,只有记录状态为上架的维护用SQL记录模板才能 正常使用。As a further improvement of an embodiment of the present invention, the parameters of the SQL record template for maintenance also include record status, the record status includes draft, pending review, on-shelf and off-shelf, and the corresponding maintenance user can be controlled by modifying the record status. Enable or disable the SQL record template. Among them, only the maintenance SQL record template whose record status is on the shelf can be used normally.
作为本发明一实施方式的进一步改进,所述装置还包括:As a further improvement of an embodiment of the present invention, the device also includes:
记录数据库,其用于存储所述维护用SQL记录,在所述记录管理模块对维护用SQL记录进行增加、删除或者修改后,所述维护用SQL记录的增加、删除或者修改被同步保存到所述记录数据库。A record database, which is used to store the SQL record for maintenance, after the record management module adds, deletes or modifies the SQL record for maintenance, the addition, deletion or modification of the SQL record for maintenance is synchronously stored in the record database.
作为本发明一实施方式的进一步改进,所述装置包括多个记录管理模块,所述API接口模块还用于在收到应用软件对维护用SQL记录的多个请求时,根据所述多个记录管理模块的空闲状态,将所述多个请求分配给不同的记录管理模块,从而实现多个记录管理模块的负载均衡。As a further improvement of an embodiment of the present invention, the device includes a plurality of record management modules, and the API interface module is also configured to, when receiving multiple requests from application software for maintenance SQL records, In the idle state of the management module, the multiple requests are allocated to different record management modules, so as to realize load balancing of multiple record management modules.
为实现上述发明目的之一,本发明一实施方式提供一种应用系统,所述系统包括应用软件、业务数据库和如上述任一所述的维护用SQL记录的管理装置。In order to achieve one of the objectives of the above invention, an embodiment of the present invention provides an application system, which includes application software, a business database, and a management device for maintaining SQL records as described above.
作为本发明一实施方式的进一步改进,所述应用软件通过所述管理装置获取包括有所述业务数据库的连接信息的SQL命令,并将所述SQL命令下发至对应的业务数据库。As a further improvement of an embodiment of the present invention, the application software obtains an SQL command including the connection information of the business database through the management device, and issues the SQL command to the corresponding business database.
与现有技术相比,本发明的维护用SQL记录的管理装置,将维护用SQL命令或模板从代码或者配置文件中提取并封装成可以通过用户界面进行维护的记录,然后对所有记录进行统一管理,提高管理效率,降低开发维护的复杂度和成本。进一步的,由于所述管理装置具有自身的记录数据库,在维护用SQL记录发生改变后会同步保存到所述记录数据库中,因此维护用SQL记录发生改变后,无需重启应用软件,不影响应用软件服务的提供,降低了应用软件的运维成本。Compared with the prior art, the maintenance SQL record management device of the present invention extracts maintenance SQL commands or templates from codes or configuration files and packages them into records that can be maintained through the user interface, and then unifies all records Management, improve management efficiency, reduce the complexity and cost of development and maintenance. Further, since the management device has its own record database, it will be stored in the record database synchronously after the SQL records for maintenance are changed, so after the SQL records for maintenance are changed, there is no need to restart the application software, and the application software will not be affected. The provision of services reduces the operation and maintenance costs of application software.
附图说明Description of drawings
图1是本发明维护用SQL记录的管理装置的结构示意图。FIG. 1 is a schematic structural diagram of a management device for maintaining SQL records in the present invention.
图2是本发明的应用系统的结构示意图。Fig. 2 is a schematic structural diagram of the application system of the present invention.
具体实施方式Detailed ways
以下将结合附图所示的具体实施方式对本发明进行详细描述。但这些实施方式并不限制本发明,本领域的普通技术人员根据这些实施方式所做出的结构、方法、或功能上的变换均包含在本发明的保护范围内。The present invention will be described in detail below in conjunction with specific embodiments shown in the accompanying drawings. However, these embodiments do not limit the present invention, and any structural, method, or functional changes made by those skilled in the art according to these embodiments are included in the protection scope of the present invention.
维护用SQL命令是指用于维护数据库的SQL命令,包括新增用SQL命令、更新用SQL命令和删除用SQL命令。新增用SQL命令用于对目标数据库进行新增记录的操作,更新用SQL命令用于根据匹配条件对目标数据库的匹配记录进行修改,删除用SQL命令用于根据匹配条件对目标数据库的匹配记录进行删除。SQL commands for maintenance refer to SQL commands for maintaining the database, including SQL commands for adding, SQL commands for updating, and SQL commands for deleting. The SQL command for adding is used to add records to the target database, the SQL command for updating is used to modify the matching records of the target database according to the matching conditions, and the SQL command for deleting is used to match the records of the target database according to the matching conditions to delete.
维护用SQL命令模板是指不带具体参数的维护用SQL命令,例如:insert into XXX(?1,?2,?3)values。The SQL command template for maintenance refers to the SQL command for maintenance without specific parameters, for example: insert into XXX(?1,?2,?3)values.
由于大量的SQL语句(主要包括SQL命令和SQL命令模板)充斥到配置文件和代码中,会直接增加应用软件代码维护的复杂度,也会增加应用系统测试的难度。Since a large number of SQL statements (mainly including SQL commands and SQL command templates) are flooded into configuration files and codes, it will directly increase the complexity of application software code maintenance and the difficulty of application system testing.
因此,本发明提供一种维护用SQL记录的管理装置,所述装置将这些用于维护的SQL 语句从代码或者配置文件中提取并封装成维护用SQL记录,对这些记录进行统一的维护和管理,提高管理效率,降低开发维护的复杂度和成本。其中,所述维护用SQL记录是对维护用SQL命令模板进行封装。Therefore, the present invention provides a management device for maintaining SQL records. The device extracts these SQL statements used for maintenance from codes or configuration files and packages them into SQL records for maintenance, and performs unified maintenance and management on these records. , improve management efficiency, and reduce the complexity and cost of development and maintenance. Wherein, the maintenance SQL record encapsulates the maintenance SQL command template.
如图1所示,本发明的管理装置包括业务数据库连接模块、模板定义模块、记录管理模块和API接口模块。As shown in Fig. 1, the management device of the present invention includes a business database connection module, a template definition module, a record management module and an API interface module.
业务数据库连接模块Business database connection module
业务数据库连接模块用于基于业务数据库的连接信息,定义所述业务数据库的连接接口。具体的,所述连接接口为JNDI(Java Naming and Directory Interface,Java命名和目录接口)标识,所述JNDI标识为对所述业务数据库的连接信息进行定义的连接描述符。以下代码为JNDI标识的一个定义示例,定义完成后,JNDI描述字符串为java:comp/env/jdbc/FOO:The business database connection module is used to define the connection interface of the business database based on the connection information of the business database. Specifically, the connection interface is a JNDI (Java Naming and Directory Interface, Java Naming and Directory Interface) identifier, and the JNDI identifier is a connection descriptor defining the connection information of the service database. The following code is an example of defining a JNDI identifier. After the definition is complete, the JNDI description string is java:comp/env/jdbc/FOO:
<Resource name="jdbc/FOO"<Resource name="jdbc/FOO"
scope="Shareable"scope="Shareable"
auth="Container"auth="Container"
factory="org.apache.naming.factory.BeanFactory"factory="org.apache.naming.factory.BeanFactory"
type="com.mchange.v2.c3p0.ComboPooledDataSource"type="com.mchange.v2.c3p0.ComboPooledDataSource"
driverClass="com.mysql.jdbc.Driver"driverClass="com.mysql.jdbc.Driver"
jdbcUrl="jdbc:mysql://<ip>:<port>/<db>?…"jdbcUrl="jdbc:mysql://<ip>:<port>/<db>?..."
password="xxxx"password="xxxx"
user="xxxx"user="xxxx"
…/>。.../>.
需要说明的是,不同的业务数据库的连接信息被定义为不同的JNDI标识,后续通过选择不同的JNDI标识,连接对应的业务数据库,从而使本发明的装置能够支持不同的数据源和不同的数据库类型。It should be noted that the connection information of different business databases is defined as different JNDI identifiers, and subsequently by selecting different JNDI identifiers, the corresponding business databases are connected, so that the device of the present invention can support different data sources and different databases type.
模板定义模块template definition module
模板定义模块用于定义维护用SQL记录模板,并为使用所述维护用SQL记录模板定义维护用SQL记录提供管理接口。The template definition module is used for defining a maintenance SQL record template, and provides a management interface for using the maintenance SQL record template to define a maintenance SQL record.
需要说明的是,维护用SQL记录模板包括新增用SQL记录模板、更新用SQL记录模板和删除用SQL记录模板;所述维护用SQL记录包括新增用SQL记录、更新用SQL记录和删除用SQL记录。It should be noted that the SQL record templates for maintenance include SQL record templates for new addition, SQL record templates for update, and SQL record templates for deletion; the SQL records for maintenance include SQL records for new addition, SQL records for update, and SQL record templates for deletion. SQL records.
维护用SQL记录模板用于定义维护用SQL记录,每个所述维护用SQL记录模板的参数中都包括有上述JNDI标识,因此在定义维护用SQL记录时需要定义具体的JNDI标识,从而下发对应的维护用SQL命令时能够通过所述JNDI标识连接到对应的业务数据库中。The SQL record template for maintenance is used to define the SQL record for maintenance. The parameters of each SQL record template for maintenance include the above-mentioned JNDI identifier. The corresponding maintenance SQL command can be connected to the corresponding business database through the JNDI identifier.
每个所述维护用SQL记录模板的参数包括:The parameters of each SQL record template for maintenance include:
所述新增用SQL记录模板的参数包括作为主键PK(Primary Key,数据表的主关键 字,它的值用于唯一的标识表中的某一条记录)的新增用SQL记录标识、新增用SQL记录标题、JNDI标识和目标数据表;The parameter of the described new SQL record template includes the new SQL record identification, the newly added SQL record title, JNDI identifier and target data table;
所述更新用SQL记录模板的参数包括作为主键PK的更新用SQL记录标识、更新用SQL记录标题、JNDI标识、目标数据表和更新条件;The parameters of the SQL record template for the update include the SQL record mark for the update as the primary key PK, the SQL record title for the update, the JNDI mark, the target data table and the update condition;
所述删除用SQL记录模板的参数包括作为主键PK的删除用SQL记录标识、删除用SQL记录标题、JNDI标识、目标数据表和删除条件。The parameters of the deletion SQL record template include the deletion SQL record identifier as the primary key PK, the deletion SQL record title, the JNDI identifier, the target data table and the deletion condition.
进一步的,对于维护用SQL记录数量较多的情形,可以通过增加板块标识,将SQL记录按照业务板块进行隔离管理。因此。所述维护用SQL记录模板的参数还包括板块标识,所述板块标识用于区分维护用SQL记录所属的业务板块。例如:按订单和商品分成2个板块,订单板块下面归集订单相关的SQL记录,而商品板块下面归集商品相关的SQL记录。这样分隔也便于权限的扩展,例如:订单相关人员只能管理订单板块下面的SQL记录,不能涉及商品板块下面的SQL记录。Furthermore, in the case of a large number of SQL records for maintenance, SQL records can be isolated and managed according to business sectors by adding sector identifiers. therefore. The parameters of the SQL record template for maintenance also include a block ID, and the block ID is used to distinguish the business block to which the SQL record for maintenance belongs. For example: Divide into two sections by order and commodity, the SQL records related to the order are collected under the order section, and the SQL records related to the product are collected under the commodity section. This separation is also convenient for the expansion of permissions. For example, order-related personnel can only manage the SQL records under the order section, and cannot involve the SQL records under the commodity section.
进一步的,所述维护用SQL记录模板的参数还包括记录状态,所述记录状态包括草稿、待审核、上架和下架,通过修改所述记录状态来控制对应维护用SQL记录模板的启用或停用,其中,只有记录状态为上架的维护用SQL记录模板才能正常使用。维护用SQL记录生成后默认的状态为草稿,在审核通过后可以将状态修改为上架,上架后应用系统即可使用此SQL记录下发SQL命令。另外,当此SQL记录暂时不需要后,可以修改其状态为下架。Further, the parameters of the SQL record template for maintenance also include a record status, and the record status includes draft, pending review, on-shelf and off-shelf, and the activation or shutdown of the corresponding maintenance SQL record template is controlled by modifying the record status. Among them, only the SQL record templates for maintenance whose record status is listed can be used normally. After the maintenance SQL record is generated, the default status is draft. After the review is passed, the status can be changed to Shelving, and the application system can use this SQL record to issue SQL commands after being put on the shelf. In addition, when the SQL record is not needed temporarily, its status can be changed to off-shelf.
下表1为新增用SQL记录模板的一个示例:Table 1 below is an example of a newly added SQL record template:
表1:tab_insert_template(新增用SQL记录模板定义表)Table 1: tab_insert_template (newly defined table with SQL record template)
Figure PCTCN2022093284-appb-000001
Figure PCTCN2022093284-appb-000001
其中,FK具体为Foreign Key(外键),表明该项与非自身的外部数据存在引用关系。本示例中,对于表1中的板块标识(“sub_sys”),有对应的一个板块定义表,板块标识会引用板块定义表中的ID。Among them, FK is specifically a Foreign Key (foreign key), indicating that there is a reference relationship between this item and non-self external data. In this example, for the plate identifier ("sub_sys") in Table 1, there is a corresponding plate definition table, and the plate identity will refer to the ID in the plate definition table.
对于目标数据表(“tbl”),即是将要新增记录的数据表,数据表名是通过在线同步JNDI标识所定义的业务数据库连接中的数据表得到的。For the target data table ("tbl"), that is, the data table to which new records will be added, the name of the data table is obtained through online synchronization of the data table in the business database connection defined by the JNDI identifier.
记录状态(“status”)用于维护用SQL记录模板的状态控制,只有上架状态的SQL记 录模板才能引用。The record status ("status") is used to maintain the status control of the SQL record template, and only the SQL record template in the shelf state can be referenced.
根据维护用SQL记录,最终服务端会依据对应的SQL命令模板生成完整的新增用SQL命令:According to the SQL records for maintenance, the server will eventually generate a complete new SQL command according to the corresponding SQL command template:
INSERT INTO<tbl>(co11,col2,col3,…)VALUES(‘col1值’,‘col2值’,‘col3值’,…)INSERT INTO<tbl>(co11,col2,col3,...) VALUES('col1 value','col2 value','col3 value',...)
其中,“co11,col2,col3,…”为列名,“col1值’,‘col2值’,‘col3值’,…”为列值,列名和列值都是通过上下文参数传入。Among them, "co11, col2, col3, ..." are column names, "col1 value', 'col2 value', 'col3 value', ..." are column values, and both column names and column values are passed in through context parameters.
下表2为更新用SQL记录模板的一个示例:Table 2 below is an example of an SQL record template for updating:
表2:tab_update_template(更新用SQL记录模板定义表)Table 2: tab_update_template (update table with SQL record template definition)
Figure PCTCN2022093284-appb-000002
Figure PCTCN2022093284-appb-000002
对于记录更新,一般都是按筛选条件进行更新。表2中提供了两种条件方式:其一是按照指定列值筛选(例如:按照主键值);其二是按照自定义条件(例如:组合条件)。根据维护用SQL记录,最终服务端会依据对应的SQL模板生成完整的更新用SQL语句:For record update, it is generally updated according to filter conditions. Table 2 provides two condition methods: one is to filter according to specified column values (for example: according to the primary key value); the other is to filter according to user-defined conditions (for example: combined conditions). According to the maintenance SQL records, the final server will generate a complete update SQL statement according to the corresponding SQL template:
UPDATE<tbl>SET col1=‘col1值’,col2=‘col2值’,…WHERE<筛选条件>UPDATE<tbl>SET col1='col1 value', col2='col2 value',...WHERE<filter condition>
其中,列名和列值都是通过上下文参数传入;筛选条件依据上下文参数生成。Among them, the column name and column value are passed in through the context parameter; the filter condition is generated according to the context parameter.
下表3为删除用SQL记录模板的一个示例:Table 3 below is an example of a template for deleting SQL records:
表3:tab_delete_template(删除用SQL记录模板定义表)Table 3: tab_delete_template (delete table defined with SQL record template)
Figure PCTCN2022093284-appb-000003
Figure PCTCN2022093284-appb-000003
表3:tab_delete_template(删除用SQL记录模板定义表)Table 3: tab_delete_template (delete table defined with SQL record template)
Figure PCTCN2022093284-appb-000004
Figure PCTCN2022093284-appb-000004
删除用SQL模板的定义与更新用的相同。根据维护用SQL记录,最终服务端会依据对应的SQL模板生成完整的删除用SQL语句:The definition of the SQL template for deletion is the same as that for update. According to the maintenance SQL records, the final server will generate a complete delete SQL statement according to the corresponding SQL template:
DELETE FROM<tbl>WHERE<筛选条件>DELETE FROM<tbl>WHERE<filter conditions>
其中,筛选条件依据上下文参数生成。Among them, the filter condition is generated according to the context parameter.
记录管理模块Records Management Module
记录管理模块用于使用所述管理接口管理维护用SQL记录,并通过所述连接接口与对应的业务数据库进行数据交互。记录管理模块根据维护用SQL记录模板对记录进行管理(所述管理操作包括对SQL记录的增加、删除、修改和查询等),并且所述记录管理模块还能够根据通过API接口模块接收应用软件下发的具体参数,生成具体的SQL命令,返回给应用软件。The record management module is used to use the management interface to manage maintenance SQL records, and perform data interaction with the corresponding business database through the connection interface. The record management module manages the records according to the SQL record template for maintenance (the management operations include adding, deleting, modifying and querying the SQL records, etc.), and the record management module can also receive the application software downloads through the API interface module. Send specific parameters, generate specific SQL commands, and return them to the application software.
在一个优选的实施方式中,所述记录管理模块包括有可视的用户界面供管理员进行管理操作,所述用户界面优选通过网页的方式提供。In a preferred embodiment, the record management module includes a visual user interface for administrators to perform management operations, and the user interface is preferably provided through a web page.
API接口模块API interface module
API接口模块用于根据所述维护用SQL记录为应用软件提供对应的API接口。一般通过维护用SQL记录的记录标识,为应用软件提供对应的API接口。应用软件根据记录标识获取对应的SQL记录的定义信息,然后根据记录标识以及下发的具体参数,从API接口获取具体需要执行的SQL命令,下发给业务数据库。The API interface module is used for providing corresponding API interfaces for application software according to the maintenance SQL records. Generally, the corresponding API interface is provided for the application software by maintaining the record identifier of the SQL record. The application software obtains the definition information of the corresponding SQL record according to the record identifier, and then obtains the specific SQL command to be executed from the API interface according to the record identifier and the delivered specific parameters, and sends it to the business database.
在一优选的实施方式中,所述装置还包括记录数据库。In a preferred embodiment, the device further includes a record database.
记录数据库record database
记录数据库用于存储所述维护用SQL记录,在所述记录管理模块对维护用SQL记录进行增加、删除或者修改后,所述维护用SQL记录的增加、删除或者修改被同步保存到所述记录数据库。因此维护用SQL记录发生改变后,无需重启应用软件,不影响应用软件服务的提供,降低了应用软件的运维成本。The record database is used to store the SQL record for maintenance. After the record management module adds, deletes or modifies the SQL record for maintenance, the addition, deletion or modification of the SQL record for maintenance is synchronously stored in the record database. Therefore, after the SQL record for maintenance is changed, there is no need to restart the application software, which does not affect the provision of application software services, and reduces the operation and maintenance cost of the application software.
进一步的,所述装置包括多个记录管理模块,所述API接口模块还用于在收到应用软件对维护用SQL记录的多个请求时,根据所述多个记录管理模块的空闲状态,将所述多个请求分配给不同的记录管理模块,从而实现多个记录管理模块的负载均衡。Further, the device includes a plurality of record management modules, and the API interface module is also configured to, when receiving multiple requests from application software for maintaining SQL records, according to the idle status of the plurality of record management modules, set The multiple requests are allocated to different record management modules, so as to achieve load balancing among multiple record management modules.
如图2所示,本发明还提供一种应用系统,所述系统包括应用软件、业务数据库和上述所述的维护用SQL记录的管理装置,其中:As shown in Fig. 2, the present invention also provides a kind of application system, described system comprises application software, business database and the management device of above-mentioned maintenance SQL record, wherein:
所述应用软件通过所述管理装置获取包括有所述业务数据库的连接信息的SQL命令,并将所述SQL命令下发至对应的业务数据库。The application software obtains the SQL command including the connection information of the business database through the management device, and issues the SQL command to the corresponding business database.
需要说明的是,所述应用软件可以有多个,所述业务数据库也可以有多个。It should be noted that there may be multiple application software, and there may be multiple service databases.
应当理解,虽然本说明书按照实施方式加以描述,但并非每个实施方式仅包含一个独立的技术方案,说明书的这种叙述方式仅仅是为清楚起见,本领域技术人员应当将说明书作为一个整体,各实施方式中的技术方案也可以经适当组合,形成本领域技术人员可以理解的其他实施方式。It should be understood that although this description is described according to implementation modes, not each implementation mode only contains an independent technical solution, and this description in the description is only for clarity, and those skilled in the art should take the description as a whole, and each The technical solutions in the embodiments can also be properly combined to form other embodiments that can be understood by those skilled in the art.
上文所列出的一系列的详细说明仅仅是针对本发明的可行性实施方式的具体说明,它们并非用以限制本发明的保护范围,凡未脱离本发明技艺精神所作的等效实施方式或变更均应包含在本发明的保护范围之内。The series of detailed descriptions listed above are only specific descriptions for feasible implementations of the present invention, and they are not intended to limit the protection scope of the present invention. Any equivalent implementation or implementation that does not depart from the technical spirit of the present invention All changes should be included within the protection scope of the present invention.

Claims (10)

  1. 一种维护用SQL记录的管理装置,其特征在于,所述装置包括:A management device for maintaining SQL records, characterized in that the device comprises:
    业务数据库连接模块,其用于基于业务数据库的连接信息,定义所述业务数据库的连接接口;A business database connection module, which is used to define the connection interface of the business database based on the connection information of the business database;
    模板定义模块,其用于定义维护用SQL记录模板,并为使用所述维护用SQL记录模板定义维护用SQL记录提供管理接口;Template definition module, which is used to define the SQL record template for maintenance, and provides a management interface for using the SQL record template for maintenance to define the SQL record for maintenance;
    记录管理模块,其用于使用所述管理接口管理维护用SQL记录,并通过所述连接接口与对应的业务数据库进行数据交互;A record management module, which is used to manage and maintain SQL records using the management interface, and perform data interaction with the corresponding business database through the connection interface;
    API接口模块,其用于根据所述维护用SQL记录为应用软件提供对应的API接口。The API interface module is used to provide corresponding API interfaces for application software according to the maintenance SQL records.
  2. 根据权利要求1所述维护用SQL记录的管理装置,其特征在于:According to the management device of claim 1 maintenance SQL record, it is characterized in that:
    所述连接接口为JNDI标识,所述JNDI标识为对所述业务数据库的连接信息进行定义的连接描述符。The connection interface is a JNDI identifier, and the JNDI identifier is a connection descriptor defining connection information of the service database.
  3. 根据权利要求2所述维护用SQL记录的管理装置,其特征在于:According to the management device of claim 2 maintenance SQL record, it is characterized in that:
    所述维护用SQL记录模板包括新增用SQL记录模板、更新用SQL记录模板和删除用SQL记录模板;The SQL record template for maintenance includes a new SQL record template, an update SQL record template and a deletion SQL record template;
    所述维护用SQL记录包括新增用SQL记录、更新用SQL记录和删除用SQL记录。The SQL records for maintenance include SQL records for new addition, SQL records for update and SQL records for deletion.
  4. 根据权利要求3所述维护用SQL记录的管理装置,其特征在于:According to the management device of the described maintenance SQL record of claim 3, it is characterized in that:
    所述新增用SQL记录模板的参数包括新增用SQL记录标识、新增用SQL记录标题、JNDI标识和目标数据表;The parameters of the newly added SQL record template include newly added SQL record identifiers, newly added SQL record titles, JNDI identifiers and target data tables;
    所述更新用SQL记录模板的参数包括更新用SQL记录标识、更新用SQL记录标题、JNDI标识、目标数据表和更新条件;The parameters of the SQL record template for the update include the SQL record mark for the update, the SQL record title for the update, the JNDI mark, the target data table and the update condition;
    所述删除用SQL记录模板的参数包括删除用SQL记录标识、删除用SQL记录标题、JNDI标识、目标数据表和删除条件。The parameters of the deletion SQL record template include the deletion SQL record identifier, the deletion SQL record title, the JNDI identifier, the target data table and the deletion condition.
  5. 根据权利要求4所述维护用SQL记录的管理装置,其特征在于:According to the management device of claim 4 maintenance SQL records, it is characterized in that:
    每个所述维护用SQL记录模板的参数还包括板块标识,所述板块标识用于区分维护用SQL记录所属的业务板块。The parameters of each of the SQL record templates for maintenance also include a block ID, and the block ID is used to distinguish the business block to which the SQL record for maintenance belongs.
  6. 根据权利要求4所述维护用SQL记录的管理装置,其特征在于:According to the management device of claim 4 maintenance SQL records, it is characterized in that:
    所述维护用SQL记录模板的参数还包括记录状态,所述记录状态包括草稿、待审核、上架和下架,通过修改所述记录状态来控制对应维护用SQL记录模板的启用或停用,其中,只有记录状态为上架的维护用SQL记录模板才能正常使用。The parameters of the SQL record template for maintenance also include a record status, and the record status includes draft, pending, on-shelf and off-shelf, and the activation or deactivation of the corresponding maintenance SQL record template is controlled by modifying the record status, wherein , only the maintenance SQL record templates whose record status is listed can be used normally.
  7. 根据权利要求1所述维护用SQL记录的管理装置,其特征在于,所述装置还包括:The management device for maintaining SQL records according to claim 1, wherein said device also includes:
    记录数据库,其用于存储所述维护用SQL记录,在所述记录管理模块对维护用SQL记录进行增加、删除或者修改后,所述维护用SQL记录的增加、删除或者修改被同步保存到所述记录数据库。A record database, which is used to store the SQL record for maintenance, after the record management module adds, deletes or modifies the SQL record for maintenance, the addition, deletion or modification of the SQL record for maintenance is synchronously stored in the record database.
  8. 根据权利要求7所述维护用SQL记录的管理装置,其特征在于:According to the management device of the described maintenance SQL record of claim 7, it is characterized in that:
    所述装置包括多个记录管理模块,所述API接口模块还用于在收到应用软件对维护用SQL记录的多个请求时,根据所述多个记录管理模块的空闲状态,将所述多个请求分配给不同的记录管理模块,从而实现多个记录管理模块的负载均衡。The device includes a plurality of record management modules, and the API interface module is further configured to, when receiving multiple requests from application software for maintaining SQL records, according to the idle state of the plurality of record management modules, Requests are allocated to different record management modules, so as to achieve load balancing of multiple record management modules.
  9. 一种应用系统,其特征在于:An application system, characterized in that:
    所述系统包括应用软件、业务数据库和如权利要求1所述的维护用SQL记录的管理装置。The system includes application software, a business database and a management device for maintaining SQL records as claimed in claim 1 .
  10. 根据权利要求9所述的应用系统,其特征在于:The application system according to claim 9, characterized in that:
    所述应用软件通过所述管理装置获取包括有所述业务数据库的连接信息的SQL命令,并将所述SQL命令下发至对应的业务数据库。The application software obtains the SQL command including the connection information of the business database through the management device, and issues the SQL command to the corresponding business database.
PCT/CN2022/093284 2021-05-18 2022-05-17 Management device for sql records for maintenance and application system WO2022242635A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110538142.3 2021-05-18
CN202110538142.3A CN113239014A (en) 2021-05-18 2021-05-18 Management device and application system for maintaining SQL records

Publications (1)

Publication Number Publication Date
WO2022242635A1 true WO2022242635A1 (en) 2022-11-24

Family

ID=77135075

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/093284 WO2022242635A1 (en) 2021-05-18 2022-05-17 Management device for sql records for maintenance and application system

Country Status (2)

Country Link
CN (1) CN113239014A (en)
WO (1) WO2022242635A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113239014A (en) * 2021-05-18 2021-08-10 安翰科技(武汉)股份有限公司 Management device and application system for maintaining SQL records

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104252485A (en) * 2013-06-29 2014-12-31 北京新媒传信科技有限公司 Database management platform
US20160224667A1 (en) * 2015-02-04 2016-08-04 Xinyu Xingbang Information Industry Co., Ltd. Method and system of implementing an integrated interface supporting operation in multi-type databases
CN106599015A (en) * 2016-08-31 2017-04-26 重庆车杰盟科技有限公司 Data service management system and method
CN111104409A (en) * 2019-12-25 2020-05-05 上海米哈游天命科技有限公司 Database processing method and device, storage medium and electronic equipment
CN111274263A (en) * 2020-01-13 2020-06-12 平安国际智慧城市科技股份有限公司 Visual database change statement generation method and device and storage medium
CN113239014A (en) * 2021-05-18 2021-08-10 安翰科技(武汉)股份有限公司 Management device and application system for maintaining SQL records

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102426582B (en) * 2011-09-29 2016-03-30 用友软件股份有限公司 Data manipulation management devices and data manipulation management method
CN103914572A (en) * 2014-04-29 2014-07-09 福建星网视易信息系统有限公司 Database construction system, device and method
US10409586B1 (en) * 2018-02-16 2019-09-10 Wipro Limited Method and system for developing and delivering an update on human machine interface (HMI) application

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104252485A (en) * 2013-06-29 2014-12-31 北京新媒传信科技有限公司 Database management platform
US20160224667A1 (en) * 2015-02-04 2016-08-04 Xinyu Xingbang Information Industry Co., Ltd. Method and system of implementing an integrated interface supporting operation in multi-type databases
CN106599015A (en) * 2016-08-31 2017-04-26 重庆车杰盟科技有限公司 Data service management system and method
CN111104409A (en) * 2019-12-25 2020-05-05 上海米哈游天命科技有限公司 Database processing method and device, storage medium and electronic equipment
CN111274263A (en) * 2020-01-13 2020-06-12 平安国际智慧城市科技股份有限公司 Visual database change statement generation method and device and storage medium
CN113239014A (en) * 2021-05-18 2021-08-10 安翰科技(武汉)股份有限公司 Management device and application system for maintaining SQL records

Also Published As

Publication number Publication date
CN113239014A (en) 2021-08-10

Similar Documents

Publication Publication Date Title
US11120043B2 (en) Accelerator based data integration
US11615062B1 (en) Emulation of database catalog for migration to a different database
US7096231B2 (en) Export engine which builds relational database directly from object model
US8065323B2 (en) Offline validation of data in a database system for foreign key constraints
US9280568B2 (en) Zero downtime schema evolution
KR102177190B1 (en) Managing data with flexible schema
US7213208B2 (en) Data container for interaction between a client process and software applications
US9805137B2 (en) Virtualizing schema relations over a single database relation
KR20060045622A (en) Extraction, transformation and loading designer module of a computerized financial system
US9507820B1 (en) Data modeling system for runtime schema extensibility
US8838654B1 (en) Data modeling system for runtime schema extensibility
US10585909B2 (en) Task-execution in a DBMS using stored procedures
US20150317331A1 (en) Unified platform for application development
US8868597B2 (en) Directory server processing requests based on hierarchical models while using backend servers operating based on relational models
WO2022242635A1 (en) Management device for sql records for maintenance and application system
WO2022242634A1 (en) Sql record management apparatus for querying and application system
US8156091B2 (en) Method to retain an inherent and indelible item value in a relational database management system
CN100440803C (en) Gridding information model system and method for modeling processing gridding information
CN112667598B (en) Data model rapid construction system based on business demand change
US8868617B2 (en) Common connection definitions for database clients
US20040054640A1 (en) Interaction between a client process and software applications
US9026561B2 (en) Automated report of broken relationships between tables
US20020188774A1 (en) Virtualizing external data as native data
CN110737506A (en) virtual machine image version management method
US20020188727A1 (en) Method for processing external data for access and manipulation through a host operating environment

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22803955

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE