+

CN116955314A - Unified database maintenance and control methods, devices, equipment and storage media - Google Patents

Unified database maintenance and control methods, devices, equipment and storage media Download PDF

Info

Publication number
CN116955314A
CN116955314A CN202310813396.0A CN202310813396A CN116955314A CN 116955314 A CN116955314 A CN 116955314A CN 202310813396 A CN202310813396 A CN 202310813396A CN 116955314 A CN116955314 A CN 116955314A
Authority
CN
China
Prior art keywords
metadata
mapping relationship
computing node
execution
database
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
CN202310813396.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.)
Jinzhuan Xinke Co Ltd
Original Assignee
Jinzhuan Xinke Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Jinzhuan Xinke Co Ltd filed Critical Jinzhuan Xinke Co Ltd
Priority to CN202310813396.0A priority Critical patent/CN116955314A/en
Publication of CN116955314A publication Critical patent/CN116955314A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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
    • G06F16/219Managing data history or versioning
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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/22Indexing; Data structures therefor; Storage structures
    • G06F16/2282Tablespace storage structures; Management thereof
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/242Query formulation
    • G06F16/2433Query languages
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • G06F16/275Synchronous replication

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Computational Linguistics (AREA)
  • Software Systems (AREA)
  • Computing Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application discloses a method, a device, equipment and a storage medium for unified maintenance and control of a database, which relate to the technical field of databases and comprise the following steps: configuring a mapping relation between metadata, storing the mapping relation into a metadata base, and synchronizing the mapping relation to a computing node; inputting SQL sentences; the computing node analyzes metadata information in the SQL sentence, generates a grammar tree, updates the grammar tree according to the locally stored metadata mapping relation, generates an execution tree according to the grammar tree, and executes the SQL sentence according to the execution tree. According to the method, the mapping relation is added to metadata information in tenants to achieve logical unification of metadata, then the syntax analysis module is used for analyzing the metadata information in SQL sentences, metadata information conversion is completed according to the mapping relation, and finally the syntax execution module is used for completing execution of the SQL sentences, so that the problem of metadata compatibility after upgrading of a database version can be solved, and the practicability is improved while the compatibility cost is reduced.

Description

数据库统一维护管控方法、装置、设备及存储介质Unified database maintenance and control methods, devices, equipment and storage media

技术领域Technical field

本发明涉及数据库技术领域,特别是涉及一种数据库统一维护管控方法、装置、设备及存储介质。The present invention relates to the field of database technology, and in particular to a method, device, equipment and storage medium for unified maintenance and control of a database.

背景技术Background technique

数据库系统中含有多个租户,每个租户含有多个库表。随着数据库版本迭代更新,需要修改各个租户中原有库表结构来实现兼容。同时,租户内的SQL语句错综复杂,不仅限于单表的操作,还会存在大量的关联表的操作。目前业界基本是对业务进行改造,这样会导致业务的改造成本很高。The database system contains multiple tenants, and each tenant contains multiple database tables. As the database version is updated iteratively, the original database table structure in each tenant needs to be modified to achieve compatibility. At the same time, the SQL statements within the tenant are complex and are not limited to single-table operations, but also include a large number of related table operations. At present, the industry is basically transforming its business, which will lead to high business transformation costs.

发明内容Contents of the invention

本发明所要解决的技术问题是,克服现有技术的缺点,提供一种数据库统一维护管控方法、装置、设备及存储介质。The technical problem to be solved by the present invention is to overcome the shortcomings of the existing technology and provide a unified maintenance and control method, device, equipment and storage medium for a database.

为了解决以上技术问题,本发明的技术方案如下:In order to solve the above technical problems, the technical solutions of the present invention are as follows:

本发明提供了一种数据库统一维护管控的方法,包括:The present invention provides a method for unified maintenance and control of a database, which includes:

配置元数据间的映射关系,将其保存至元数据库中,并同步至计算节点;Configure the mapping relationship between metadata, save it in the metadata database, and synchronize it to the computing node;

输入SQL语句;Enter the SQL statement;

计算节点解析SQL语句中的元数据信息,生成语法树,并根据本地存储的元数据映射关系更新语法树,然后根据语法树生成执行树,并根据执行树执行SQL语句。The computing node parses the metadata information in the SQL statement, generates a syntax tree, updates the syntax tree based on the locally stored metadata mapping relationship, then generates an execution tree based on the syntax tree, and executes the SQL statement based on the execution tree.

本发明还提供了一种数据库统一维护管控装置,包括:The invention also provides a unified database maintenance and control device, which includes:

统一维护模块,用于配置元数据间的映射关系,并将其保存至元数据管理模块;The unified maintenance module is used to configure the mapping relationship between metadata and save it to the metadata management module;

元数据管理模块,用于保存数据库中所有的元数据信息,并将元数据库中元数据间的映射关系同步至计算节点;The metadata management module is used to save all metadata information in the database and synchronize the mapping relationships between metadata in the metadata database to the computing nodes;

计算节点模块,用于解析SQL语句中的元数据信息,生成语法树,并根据本地存储的元数据映射关系更新语法树,然后根据语法树生成执行树,并根据执行树执行SQL语句。The computing node module is used to parse the metadata information in the SQL statement, generate a syntax tree, update the syntax tree based on the locally stored metadata mapping relationship, then generate an execution tree based on the syntax tree, and execute the SQL statement based on the execution tree.

本发明还提供了一种计算机设备,包括存储器、处理器及存储在所述存储器上并可在所述处理器上运行的计算机程序,所述处理器执行所述程序时实现如上述的数据库统一维护管控的方法。The present invention also provides a computer device, including a memory, a processor and a computer program stored in the memory and executable on the processor. When the processor executes the program, the above-mentioned database unification is realized. Methods of maintenance and control.

本发明还提供了一种计算机可读存储介质,其上存储有计算机程序,所述程序被处理器执行时实现如上述的数据库统一维护管控的方法。The present invention also provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the above-mentioned method for unified maintenance and control of the database is implemented.

本发明的有益效果是:The beneficial effects of the present invention are:

本发明先通过对租户内元数据信息添加映射关系,实现元数据逻辑上的统一,之后通过语法解析模块解析出SQL语句中的元数据信息,然后根据映射关系完成元数据信息转换,最后通过语法执行模块完成SQL语句的执行,能够解决数据库版本升级后元数据兼容性问题,在整个实现过程中用户无感知,且不影响业务的正常执行,在降低兼容成本的同时提高实用性。This invention first realizes the logical unification of metadata by adding a mapping relationship to the metadata information in the tenant, and then parses the metadata information in the SQL statement through the grammar parsing module, and then completes the metadata information conversion according to the mapping relationship, and finally uses the grammar The execution module completes the execution of SQL statements, which can solve the problem of metadata compatibility after database version upgrade. Users are not aware of it during the entire implementation process, and it does not affect the normal execution of the business. It reduces compatibility costs while improving practicality.

附图说明Description of the drawings

为了更清楚地说明本发明实施例的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其它的附图。In order to explain the technical solutions of the embodiments of the present invention more clearly, the drawings needed to be used in the description of the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention. Those of ordinary skill in the art can also obtain other drawings based on these drawings without exerting any creative effort.

图1为本发明提供的数据库统一维护管控的方法的流程示意图;Figure 1 is a schematic flow chart of the unified database maintenance and control method provided by the present invention;

图2为本发明提供的数据库统一维护管控装置的结构示意图;Figure 2 is a schematic structural diagram of the unified database maintenance and control device provided by the present invention;

图3为本发明提供的数据库统一维护管控装置中语法解析模块的工作流程图;Figure 3 is a work flow chart of the syntax parsing module in the unified database maintenance and control device provided by the present invention;

图4为本发明提供的数据库统一维护管控装置中语法执行模块的工作流程图;Figure 4 is a work flow chart of the syntax execution module in the unified database maintenance and control device provided by the present invention;

图5为本发明提供的计算机设备的示意图。Figure 5 is a schematic diagram of the computer equipment provided by the present invention.

具体实施方式Detailed ways

为使本发明的内容更容易被清楚地理解,下面根据具体实施方式并结合附图,对本发明作出进一步详细的说明。In order to make the content of the present invention easier to understand clearly, the present invention will be described in further detail below based on specific embodiments and in conjunction with the accompanying drawings.

本发明提供了一种数据库统一维护管控方法、装置、设备及存储介质。通过对租户内元数据信息(表名、字段名)添加映射关系,实现元数据逻辑上的统一,其次通过语法解析模块解析出SQL语句中元数据信息,然后根据映射关系完成元数据信息转换,最后通过语法执行模块完成SQL语句的执行。因此,本发明实施例的技术方案能够解决数据库版本升级后元数据兼容性问题,在整个实现过程中用户无感知,且不影响业务的正常执行,在降低兼容成本的同时提高实用性。The invention provides a method, device, equipment and storage medium for unified maintenance and control of a database. By adding mapping relationships to the metadata information (table names, field names) within the tenant, the metadata is logically unified. Secondly, the metadata information in the SQL statement is parsed through the syntax parsing module, and then the metadata information is converted according to the mapping relationship. Finally, the execution of the SQL statement is completed through the syntax execution module. Therefore, the technical solutions of the embodiments of the present invention can solve the problem of metadata compatibility after database version upgrade. Users are not aware of the problem during the entire implementation process, and do not affect the normal execution of the business, thereby reducing compatibility costs while improving practicability.

下面结合附图,对本发明进一步阐述。The present invention will be further described below in conjunction with the accompanying drawings.

参见图1,本申请实施例提供了一种数据库统一维护管控的方法,该方法包括步骤S101-步骤S103,具体步骤说明如下:Referring to Figure 1, the embodiment of the present application provides a method for unified maintenance and control of a database. The method includes steps S101 to S103. The specific steps are described as follows:

步骤S101:配置元数据间的映射关系,将其保存至元数据库中,并同步至计算节点。Step S101: Configure the mapping relationship between metadata, save it in the metadata database, and synchronize it to the computing node.

具体的,首先,通过统一维护模块配置元数据间的映射关系,然后将其保存至元数据库中。若保存失败,则上报入库异常。若保存成功,则将元数据间的映射关系同步至各计算节点。各计算节点在接收到元数据间的映射关系后,将映射关系保存在本地元数据中。Specifically, first, configure the mapping relationship between metadata through the unified maintenance module, and then save it to the metadata database. If the save fails, a warehousing exception will be reported. If the save is successful, the mapping relationship between metadata will be synchronized to each computing node. After receiving the mapping relationship between metadata, each computing node saves the mapping relationship in local metadata.

步骤S102:输入SQL语句。Step S102: Enter the SQL statement.

可以理解的是,上述的输入SQL语句是向数据库后端输入SQL语句。It can be understood that the above input SQL statement is to input the SQL statement to the database backend.

步骤S103:计算节点解析SQL语句中的元数据信息,生成语法树,并根据本地存储的元数据映射关系更新语法树,然后根据语法树生成执行树,并根据执行树执行SQL语句。Step S103: The computing node parses the metadata information in the SQL statement, generates a syntax tree, updates the syntax tree based on the locally stored metadata mapping relationship, then generates an execution tree based on the syntax tree, and executes the SQL statement based on the execution tree.

具体的,数据库后端接收到输入的SQL语句后,首先,各计算节点会对SQL语句进行解析,生成对应的语法树。Specifically, after the database backend receives the input SQL statement, first, each computing node will parse the SQL statement and generate the corresponding syntax tree.

需要说明的是,若输入的SQL语句有误,或者输入的SQL语句是不支持的语句,则无法进行解析,无法获取SQL中元数据信息,此时会上报解析失败。若成功解析,则可获取SQL中元数据信息,并生成对应字段名和表名之间的映射关系。It should be noted that if the entered SQL statement is incorrect, or the entered SQL statement is an unsupported statement, parsing cannot be performed and the metadata information in the SQL cannot be obtained. In this case, a parsing failure will be reported. If parsed successfully, the metadata information in SQL can be obtained and the mapping relationship between the corresponding field names and table names can be generated.

在完成SQL语句的解析和语法树的生成后,各计算节点会查找本地存储的元数据映射关系,判断是否有相应的表名和字段名的映射关系,若有,则根据本地储存的元数据映射关系生成新的语法树,然后根据新的语法树生成执行树;若没有,则直接根据之前生成的语法树生成相应的执行树。After completing the parsing of the SQL statement and the generation of the syntax tree, each computing node will search for the locally stored metadata mapping relationship to determine whether there is a corresponding mapping relationship between table names and field names. If so, it will use the locally stored metadata mapping relationship. The relationship generates a new syntax tree, and then generates an execution tree based on the new syntax tree; if not, the corresponding execution tree is directly generated based on the previously generated syntax tree.

在生成执行树之后,各计算节点执行SQL语句。After generating the execution tree, each computing node executes the SQL statement.

由此,上述方法可在不改变库表结构的情况下,对租户中原有的表名和字段名实现逻辑上统一的新表名和新字段名,从而大大减少兼容成本。Therefore, the above method can achieve logically unified new table names and new field names for the original table names and field names in the tenant without changing the library table structure, thereby greatly reducing compatibility costs.

为实现本申请实施例的方法,基于统一发明构思,本申请实施例还提供了一种数据库统一维护管控装置。图2为本申请实施例中数据库统一维护管控装置的结构示意图。In order to implement the methods of the embodiments of the present application, based on the unified inventive concept, the embodiments of the present application also provide a unified database maintenance and control device. Figure 2 is a schematic structural diagram of a unified database maintenance and control device in an embodiment of the present application.

如2所示,该数据库统一维护管控装置具体包括统一维护模块201、元数据管理模块202、计算节点模块203。As shown in 2, the unified database maintenance and control device specifically includes a unified maintenance module 201, a metadata management module 202, and a computing node module 203.

统一维护模块201用于配置元数据间的映射关系,并将其保存至元数据管理模块。在本实施例中,统一维护模块201是一个web端的管理平台,负责登记配置元数据间的映射关系。The unified maintenance module 201 is used to configure the mapping relationship between metadata and save it to the metadata management module. In this embodiment, the unified maintenance module 201 is a web-side management platform that is responsible for registering the mapping relationship between configuration metadata.

元数据管理模块202用于保存数据库中所有的元数据信息,并将元数据库中元数据间的映射关系同步至计算节点。The metadata management module 202 is used to save all metadata information in the database and synchronize the mapping relationships between metadata in the metadata database to the computing nodes.

计算节点模块203,用于解析SQL语句中的元数据信息,生成语法树,并根据本地存储的元数据映射关系更新语法树,然后根据语法树生成执行树,并根据执行树执行SQL语句。The computing node module 203 is used to parse the metadata information in the SQL statement, generate a syntax tree, update the syntax tree according to the locally stored metadata mapping relationship, then generate an execution tree based on the syntax tree, and execute the SQL statement based on the execution tree.

其中,计算节点模块203包括语法解析模块和语法执行模块。语法解析模块在数据库后端接收到SQL语句后,获取SQL语句中的元数据信息(表名、字段名),生成语法树,然后根据本地存储的映射关系转换成新的语法树。语法解析模块的工作流程图参见图3。语法执行模块负责生成执行树,并根据映射关系执行SQL语句。语法执行模块的工作流程图参见图4。Among them, the computing node module 203 includes a grammar parsing module and a grammar execution module. After receiving the SQL statement at the database backend, the syntax parsing module obtains the metadata information (table name, field name) in the SQL statement, generates a syntax tree, and then converts it into a new syntax tree based on the locally stored mapping relationship. See Figure 3 for the workflow diagram of the syntax parsing module. The syntax execution module is responsible for generating execution trees and executing SQL statements according to the mapping relationship. The workflow diagram of the syntax execution module is shown in Figure 4.

参见图5,本实施例还提供了一种计算机设备,计算机设备的组件可以包括但不限于:一个或者多个处理器或者处理单元,系统存储器,连接不同系统组件(包括系统存储器和处理单元)的总线。Referring to Figure 5, this embodiment also provides a computer device. The components of the computer device may include but are not limited to: one or more processors or processing units, system memory, connecting different system components (including system memory and processing units) bus.

总线表示几类总线结构中的一种或多种,包括存储器总线或者存储器控制器,外围总线,图形加速端口,处理器或者使用多种总线结构中的任意总线结构的局域总线。举例来说,这些体系结构包括但不限于工业标准体系结构(ISA)总线,微通道体系结构(MAC)总线,增强型ISA总线、视频电子标准协会(VESA)局域总线以及外围组件互连(PCI)总线。A bus represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any of a variety of bus structures. For example, these architectures include, but are not limited to, the Industry Standard Architecture (ISA) bus, the Micro Channel Architecture (MAC) bus, the Enhanced ISA bus, the Video Electronics Standards Association (VESA) local bus, and the Peripheral Component Interconnect ( PCI) bus.

计算机系统/服务器典型地包括多种计算机系统可读介质。这些介质可以是任何能够被计算机系统/服务器访问的可用介质,包括易失性和非易失性介质,可移动的和不可移动的介质。Computer systems/servers typically include a variety of computer system readable media. These media can be any available media that can be accessed by the computer system/server, including volatile and non-volatile media, removable and non-removable media.

系统存储器可以包括易失性存储器形式的计算机系统可读介质,例如随机存取存储器(RAM)和/或高速缓存存储器。计算机设备可以进一步包括其它可移动/不可移动的、易失性/非易失性计算机系统存储介质。仅作为举例,存储系统可以用于读写不可移动的、非易失性磁介质。可以提供用于对可移动非易失性磁盘(例如“软盘”)读写的磁盘驱动器,以及对可移动非易失性光盘(例如CD-ROM,DVD-ROM或者其它光介质)读写的光盘驱动器。在这些情况下,每个驱动器可以通过一个或者多个数据介质接口与总线相连。存储器可以包括至少一个程序产品,该程序产品具有一组(例如至少一个)程序模块,这些程序模块被配置以执行本发明各实施例的功能。System memory may include computer system readable media in the form of volatile memory, such as random access memory (RAM) and/or cache memory. Computer equipment may further include other removable/non-removable, volatile/non-volatile computer system storage media. By way of example only, the storage system may be used to read and write non-removable, non-volatile magnetic media. Disk drives may be provided for reading and writing from removable non-volatile disks (such as "floppy disks") and for reading and writing from removable non-volatile optical disks (such as CD-ROM, DVD-ROM or other optical media) CD-ROM drive. In these cases, each drive can be connected to the bus through one or more data media interfaces. The memory may include at least one program product having a set of (eg, at least one) program modules configured to perform the functions of embodiments of the invention.

具有一组(至少一个)程序模块的程序/实用工具,可以存储在例如存储器中,这样的程序模块包括——但不限于——操作系统、一个或者多个应用程序、其它程序模块以及程序数据,这些示例中的每一个或某种组合中可能包括网络环境的实现。程序模块通常执行本发明所描述的实施例中的功能和/或方法。A program/utility having a set of (at least one) program modules, which may be stored, for example, in memory, such program modules including but not limited to an operating system, one or more application programs, other program modules, and program data , each of these examples or some combination may include the implementation of a network environment. Program modules generally perform functions and/or methods in the described embodiments of the invention.

计算机设备也可以与一个或多个外部设备例如键盘、指向设备、显示器等)通信。这种通信可以通过输入/输出(I/O)接口进行。并且,计算机设备还可以通过网络适配器与一个或者多个网络(例如局域网(LAN),广域网(WAN)和/或公共网络,例如因特网)通信。The computer device may also communicate with one or more external devices (eg, keyboard, pointing device, display, etc.). This communication can occur through input/output (I/O) interfaces. Furthermore, the computer device may also communicate with one or more networks (eg, a local area network (LAN), a wide area network (WAN), and/or a public network, such as the Internet) through a network adapter.

处理单元通过运行存储在系统存储器中的程序,从而执行本发明所描述的实施例中的功能和/或方法。The processing unit executes the functions and/or methods in the described embodiments of the present invention by running programs stored in the system memory.

上述的计算机程序可以设置于计算机存储介质中,即该计算机存储介质被编码有计算机程序,该程序在被一个或多个计算机执行时,使得一个或多个计算机执行本发明上述实施例中所示的方法流程和/或装置操作。The above-mentioned computer program can be provided in a computer storage medium, that is, the computer storage medium is encoded with a computer program. When the program is executed by one or more computers, it causes one or more computers to execute what is shown in the above-mentioned embodiments of the present invention. method flow and/or device operation.

随着时间、技术的发展,介质含义越来越广泛,计算机程序的传播途径不再受限于有形介质,还可以直接从网络下载等。可以采用一个或多个计算机可读的介质的任意组合。计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子(非穷举的列表)包括:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本文件中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。With the development of time and technology, the meaning of media has become more and more extensive. The spread of computer programs is no longer limited to tangible media, and can also be downloaded directly from the Internet. Any combination of one or more computer-readable media may be employed. The computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium may be, for example, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus or device, or any combination thereof. More specific examples (non-exhaustive list) of computer readable storage media include: electrical connections having one or more conductors, portable computer disks, hard drives, random access memory (RAM), read only memory (ROM), Erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above. As used herein, a computer-readable storage medium may be any tangible medium that contains or stores a program for use by or in connection with an instruction execution system, apparatus, or device.

计算机可读的信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括——但不限于——电磁信号、光信号或上述的任意合适的组合。计算机可读的信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。A computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave carrying computer-readable program code therein. Such propagated data signals may take a variety of forms, including - but not limited to - electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device .

计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括——但不限于——无线、电线、光缆、RF等等,或者上述的任意合适的组合。Program code embodied on a computer-readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

可以以一种或多种程序设计语言或其组合来编写用于执行本发明操作的计算机程序代码,所述程序设计语言包括面向对象的程序设计语言—诸如Java、Smalltalk、C++,还包括常规的过程式程序设计语言—诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络——包括局域网(LAN)或广域网(WAN)连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。Computer program code for performing the operations of the present invention may be written in one or more programming languages, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional Procedural programming language—such as "C" or a similar programming language. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In situations involving remote computers, the remote computer can be connected to the user's computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (such as an Internet service provider through the Internet). connect).

除上述实施例外,本发明还可以有其他实施方式;凡采用等同替换或等效变换形成的技术方案,均落在本发明要求的保护范围。In addition to the above-mentioned embodiments, the present invention can also have other implementations; any technical solutions formed by equivalent substitutions or equivalent transformations fall within the protection scope of the present invention.

Claims (9)

1.一种数据库统一维护管控的方法,其特征在于:包括:1. A method for unified database maintenance and control, which is characterized by: including: 配置元数据间的映射关系,将其保存至元数据库中,并同步至计算节点;Configure the mapping relationship between metadata, save it in the metadata database, and synchronize it to the computing node; 输入SQL语句;Enter the SQL statement; 计算节点解析SQL语句中的元数据信息,生成语法树,并根据本地存储的元数据映射关系更新语法树,然后根据语法树生成执行树,并根据执行树执行SQL语句。The computing node parses the metadata information in the SQL statement, generates a syntax tree, updates the syntax tree based on the locally stored metadata mapping relationship, then generates an execution tree based on the syntax tree, and executes the SQL statement based on the execution tree. 2.根据权利要求1所述的数据库统一维护管控方法,其特征在于:所述配置元数据间的映射关系,将其保存至元数据库中,并同步至计算节点包括:2. The unified database maintenance and control method according to claim 1, characterized in that: configuring the mapping relationship between metadata, saving it in the metadata database, and synchronizing it to the computing node includes: 配置元数据间的映射关系;Configure the mapping relationship between metadata; 将配置好的元数据间的映射关系保存至元数据库中,若保存失败则上报入库异常,若保存成功则将元数据间的映射关系同步至计算节点。Save the configured mapping relationship between metadata to the metadata database. If the saving fails, a storage exception will be reported. If the saving is successful, the mapping relationship between metadata will be synchronized to the computing node. 3.根据权利要求1所述的数据库统一维护管控方法,其特征在于:在所述配置元数据间的映射关系,将其保存至元数据库中,并同步至计算节点之后,还包括:3. The unified database maintenance and control method according to claim 1, characterized in that: after the mapping relationship between the configuration metadata is saved in the metadata database and synchronized to the computing node, it also includes: 计算节点将元数据间的映射关系加载至本地元数据信息中。The computing node loads the mapping relationship between metadata into local metadata information. 4.根据权利要求1所述的数据库统一维护管控方法,其特征在于:所述计算节点解析SQL语句中的元数据信息,生成语法树包括:4. The unified database maintenance and control method according to claim 1, characterized in that: the computing node parses the metadata information in the SQL statement and generates a syntax tree including: 计算节点对SQL语句的语法进行解析,获取SQL中元数据信息,若失败,则上报解析失败,若成功则进行下一步;The computing node parses the syntax of the SQL statement and obtains the metadata information in the SQL. If it fails, it reports a parsing failure. If it succeeds, it proceeds to the next step; 计算节点根据解析后的元数据信息生成对应字段名和表名之间的映射关系。The computing node generates the mapping relationship between the corresponding field names and table names based on the parsed metadata information. 5.根据权利要求4所述的数据库统一维护管控方法,其特征在于:所述计算节点根据本地存储的元数据映射关系更新语法树包括:5. The unified database maintenance and control method according to claim 4, characterized in that: the computing node updating the syntax tree according to the locally stored metadata mapping relationship includes: 计算节点查找本地存储的元数据中是否存在相应字段名和表名之间的映射关系,若存在,则根据本地储存的元数据映射关系生成新的语法树;若不存在,则进行下一步。The calculation node searches for the mapping relationship between the corresponding field name and the table name in the locally stored metadata. If it exists, a new syntax tree is generated based on the locally stored metadata mapping relationship; if it does not exist, proceed to the next step. 6.一种数据库统一维护管控装置,其特征在于:包括:6. A unified database maintenance and control device, characterized by: including: 统一维护模块,用于配置元数据间的映射关系,并将其保存至元数据管理模块;The unified maintenance module is used to configure the mapping relationship between metadata and save it to the metadata management module; 元数据管理模块,用于保存数据库中所有的元数据信息,并将元数据库中元数据间的映射关系同步至计算节点;The metadata management module is used to save all metadata information in the database and synchronize the mapping relationships between metadata in the metadata database to the computing nodes; 计算节点模块,用于解析SQL语句中的元数据信息,生成语法树,并根据本地存储的元数据映射关系更新语法树,然后根据语法树生成执行树,并根据执行树执行SQL语句。The computing node module is used to parse the metadata information in the SQL statement, generate a syntax tree, update the syntax tree based on the locally stored metadata mapping relationship, then generate an execution tree based on the syntax tree, and execute the SQL statement based on the execution tree. 7.根据权利要求6所述的数据库统一维护管控装置,其特征在于:所述计算节点模块包括语法解析模块和语法执行模块;7. The unified database maintenance and control device according to claim 6, characterized in that: the computing node module includes a grammar parsing module and a grammar execution module; 所述语法解析模块用于解析SQL语句中的元数据信息,生成语法树;The syntax parsing module is used to parse the metadata information in the SQL statement and generate a syntax tree; 所述语法执行模块用于根据语法树生成执行树,并根据执行书执行SQL语句。The syntax execution module is used to generate an execution tree according to the syntax tree and execute the SQL statement according to the execution document. 8.一种计算机设备,包括存储器、处理器及存储在所述存储器上并可在所述处理器上运行的计算机程序,其特征在于:所述处理器执行所述程序时实现如权利要求1-5中任一项所述的方法。8. A computer device, comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that: when the processor executes the program, it implements claim 1 -The method described in any one of 5. 9.一种计算机可读存储介质,其上存储有计算机程序,其特征在于:所述程序被处理器执行时实现如权利要求1-5中任一项所述的方法。9. A computer-readable storage medium on which a computer program is stored, characterized in that: when the program is executed by a processor, the method according to any one of claims 1-5 is implemented.
CN202310813396.0A 2023-07-05 2023-07-05 Unified database maintenance and control methods, devices, equipment and storage media Pending CN116955314A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310813396.0A CN116955314A (en) 2023-07-05 2023-07-05 Unified database maintenance and control methods, devices, equipment and storage media

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310813396.0A CN116955314A (en) 2023-07-05 2023-07-05 Unified database maintenance and control methods, devices, equipment and storage media

Publications (1)

Publication Number Publication Date
CN116955314A true CN116955314A (en) 2023-10-27

Family

ID=88459556

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310813396.0A Pending CN116955314A (en) 2023-07-05 2023-07-05 Unified database maintenance and control methods, devices, equipment and storage media

Country Status (1)

Country Link
CN (1) CN116955314A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118410068A (en) * 2024-07-02 2024-07-30 天津南大通用数据技术股份有限公司 Database SQL query optimization method, terminal and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110874364A (en) * 2019-11-19 2020-03-10 北京启迪区块链科技发展有限公司 Query statement processing method, device, equipment and storage medium
CN112527815A (en) * 2020-12-02 2021-03-19 平安医疗健康管理股份有限公司 Script migration method and device for database, computer equipment and storage medium
CN114756569A (en) * 2022-03-25 2022-07-15 北京友友天宇系统技术有限公司 Multi-layer parsing method of structured query statement, computer device and storage medium
CN115130433A (en) * 2022-06-22 2022-09-30 浪潮通用软件有限公司 Method and device for generating data conversion statement
CN115269632A (en) * 2022-07-20 2022-11-01 天翼云科技有限公司 SQL statement processing method and device, electronic equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110874364A (en) * 2019-11-19 2020-03-10 北京启迪区块链科技发展有限公司 Query statement processing method, device, equipment and storage medium
CN112527815A (en) * 2020-12-02 2021-03-19 平安医疗健康管理股份有限公司 Script migration method and device for database, computer equipment and storage medium
CN114756569A (en) * 2022-03-25 2022-07-15 北京友友天宇系统技术有限公司 Multi-layer parsing method of structured query statement, computer device and storage medium
CN115130433A (en) * 2022-06-22 2022-09-30 浪潮通用软件有限公司 Method and device for generating data conversion statement
CN115269632A (en) * 2022-07-20 2022-11-01 天翼云科技有限公司 SQL statement processing method and device, electronic equipment and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118410068A (en) * 2024-07-02 2024-07-30 天津南大通用数据技术股份有限公司 Database SQL query optimization method, terminal and storage medium

Similar Documents

Publication Publication Date Title
CN110647579A (en) Data synchronization method and apparatus, computer equipment and readable medium
US8321450B2 (en) Standardized database connectivity support for an event processing server in an embedded context
CN111709527A (en) Operation and maintenance knowledge map library establishing method, device, equipment and storage medium
CN112231407B (en) DDL synchronization method, device, equipment and medium of PostgreSQL database
CN106997393A (en) Data query method, device, server and storage medium
CN114356964A (en) Data lineage construction method, device, storage medium and electronic device
CN112235311A (en) OVSDB client code automatic generation method, system, device and medium
CN113641700A (en) Data processing method and device based on Spring boot frame
CN108108392B (en) Commodity data management method, device, computer equipment and storage medium
CN111753140A (en) XML file parsing method and related equipment
CN113962597A (en) A data analysis method, device, electronic device and storage medium
WO2023056946A1 (en) Data caching method and apparatus, and electronic device
CN114036183A (en) A data ETL processing method, device, equipment and medium
WO2021259290A1 (en) Stored procedure conversion method and apparatus, and device and storage medium
WO2024041022A1 (en) Database table alteration method and apparatus, device and storage medium
CN116955314A (en) Unified database maintenance and control methods, devices, equipment and storage media
CN116028028A (en) Request function generation method, device, equipment and storage medium
CN119441262A (en) A script conversion method and related device
CN117171165A (en) A data logging method, device, electronic equipment and storage medium
CN117271554A (en) A distributed database view processing method, device, equipment and storage medium
CN117235177A (en) Database synchronization operation method, device, equipment and computer medium
WO2024016594A1 (en) Pseudo column implementation method and apparatus, electronic device, and storage medium
CN112181519B (en) A method, device, equipment and storage medium for data processing
CN113127496B (en) Method and device for determining change data in database, medium and equipment
CN113886429A (en) Cluster-based database query method and system, electronic device and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载