CN116266185A - Data processing method and device - Google Patents

Data processing method and device Download PDF

Info

Publication number
CN116266185A
CN116266185A CN202111540679.XA CN202111540679A CN116266185A CN 116266185 A CN116266185 A CN 116266185A CN 202111540679 A CN202111540679 A CN 202111540679A CN 116266185 A CN116266185 A CN 116266185A
Authority
CN
China
Prior art keywords
request
transaction
management system
database management
transaction processing
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
CN202111540679.XA
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.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies 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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN202111540679.XA priority Critical patent/CN116266185A/en
Publication of CN116266185A publication Critical patent/CN116266185A/en
Pending legal-status Critical Current

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/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/466Transaction processing

Landscapes

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

Abstract

本发明公开了一种数据处理方法及装置。其中方法为:接收数据操作语言DML请求,所述DML请求用于请求对目标数据进行操作,所述DML请求与数据库类型无关;根据所述DML请求,生成用于OLTP数据库管理系统的第一事务处理请求;向所述OLTP数据库管理系统发送所述第一事务处理请求;获取所述OLTP数据库管理系统响应于所述第一事务处理请求生成的事务处理日志;根据所述事务处理日志,生成用于OLAP数据库管理系统的第二事务处理请求;向所述OLAP数据库管理系统发送所述第二事务处理请求。

Figure 202111540679

The invention discloses a data processing method and device. The method is: receiving a data manipulation language DML request, the DML request is used to request to operate on the target data, and the DML request has nothing to do with the database type; according to the DML request, generate the first transaction for the OLTP database management system Processing a request; sending the first transaction processing request to the OLTP database management system; obtaining a transaction processing log generated by the OLTP database management system in response to the first transaction processing request; according to the transaction processing log, generating a user A second transaction processing request from the OLAP database management system; sending the second transaction processing request to the OLAP database management system.

Figure 202111540679

Description

一种数据处理方法及装置A data processing method and device

技术领域technical field

本申请涉及数据库领域,尤其涉及一种数据处理方法及装置。The present application relates to the field of databases, in particular to a data processing method and device.

背景技术Background technique

目前一些软件应用服务由于其应用范围较广,如软件即服务(Software-as-a-Service,SaaS)。这些软件应用服务为了满足全面的业务需求,常会同时部署联机事务处理(On-Line Transaction Processing,OLTP)数据库和联机分析处理(On-Line AnalyticalProcessing,OLAP)数据库。At present, some software application services, such as Software-as-a-Service (SaaS), have a wide range of applications. In order to meet comprehensive business requirements, these software application services often deploy an On-Line Transaction Processing (OLTP) database and an On-Line Analytical Processing (OLAP) database at the same time.

然而,虽然软件应用服务上同时部署了这两种数据库,但两种数据库的具体应用方式是相互独立的,需要通过单独操作实现同步,不能实现业务上的有效融合,使得目前数据库的使用效率较低,这是一个亟待解决的问题。However, although these two databases are deployed on the software application service at the same time, the specific application methods of the two databases are independent of each other and need to be synchronized through separate operations, which cannot achieve effective business integration, making the current use of the database relatively inefficient. Low, this is a burning problem.

发明内容Contents of the invention

本申请提供了一种数据处理方法及装置,用以实现OLTP数据库与OLAP数据库在业务上的有效融合,提升目前数据库的使用效率。The present application provides a data processing method and device, which are used to realize the effective integration of OLTP database and OLAP database in business, and improve the use efficiency of the current database.

第一方面,本申请实施例提供一种数据处理方法,该方法可以应用于本申请第三方面提供的数据处理装置,该方法包括:In the first aspect, the embodiment of the present application provides a data processing method, which can be applied to the data processing device provided in the third aspect of the present application, and the method includes:

接收数据操作语言DML请求,所述DML请求用于请求对目标数据进行操作,所述DML请求与数据库类型无关;根据所述DML请求,生成用于OLTP数据库管理系统的第一事务处理请求,所述第一事务处理请求用于请求对OLTP数据库中的所述目标数据进行操作;向所述OLTP数据库管理系统发送所述第一事务处理请求;获取所述OLTP数据库管理系统响应于所述第一事务处理请求生成的事务处理日志,所述事务处理日志包括所述OLTP数据库管理系统对所述目标数据进行操作的信息;根据所述事务处理日志,生成用于OLAP数据库管理系统的第二事务处理请求,所述第二事务处理请求用于请求对OLAP数据库中的所述目标数据进行操作;向所述OLAP数据库管理系统发送所述第二事务处理请求。Receive a data manipulation language DML request, the DML request is used to request an operation on the target data, the DML request has nothing to do with the database type; according to the DML request, generate a first transaction processing request for the OLTP database management system, the The first transaction processing request is used to request to operate on the target data in the OLTP database; send the first transaction processing request to the OLTP database management system; obtain the response from the OLTP database management system to the first A transaction processing log generated by a transaction processing request, the transaction processing log including information that the OLTP database management system operates on the target data; according to the transaction processing log, generate a second transaction processing for the OLAP database management system request, the second transaction processing request is used to request to operate on the target data in the OLAP database; and send the second transaction processing request to the OLAP database management system.

上述方法中,由于所述DML请求与数据库类型无关,所述DML请求用于请求对目标数据进行操作,因为OLTP数据库具备事务性,那么可以生成用于OLTP数据库管理系统的第一事务处理请求,并在得到所述OLTP数据库管理系统发送的事务处理日志后,便可以确定OLTP数据库第一事务处理请求必定已执行成功,所以可以根据所述事务处理日志生成第二事务处理请求,并向所述OLAP数据库管理系统发送所述第二事务处理请求,使得OLAP数据库可以与OLTP数据库同步,从而使得两种数据库实现了业务上的有效融合,提升了数据库的使用效率。In the above method, since the DML request has nothing to do with the database type, the DML request is used to request to operate on the target data, because the OLTP database is transactional, so the first transaction processing request for the OLTP database management system can be generated, And after obtaining the transaction processing log sent by the OLTP database management system, it can be determined that the first transaction processing request of the OLTP database must be executed successfully, so the second transaction processing request can be generated according to the transaction processing log, and sent to the The OLAP database management system sends the second transaction processing request, so that the OLAP database can be synchronized with the OLTP database, so that the two databases can be effectively integrated in business, and the use efficiency of the database can be improved.

在一种可能的设计中,所述根据所述DML请求,生成用于OLTP数据库管理系统的第一事务处理请求,包括:In a possible design, the generating the first transaction processing request for the OLTP database management system according to the DML request includes:

对所述DML请求进行语法解析,获得所述DML请求对应的第一语法树,所述第一语法树包括至少一个节点,所述至少一个节点中的任意一个节点用于存储DML指令关键字与结构化查询语言SQL指令关键字之间的对应关系;根据所述第一语法树中的节点对应的SQL关键字生成所述第一事务处理请求。Perform grammatical analysis on the DML request to obtain a first grammatical tree corresponding to the DML request, the first grammatical tree includes at least one node, and any node in the at least one node is used to store the DML instruction keyword and Correspondence between structured query language SQL instruction keywords; generating the first transaction processing request according to the SQL keywords corresponding to the nodes in the first syntax tree.

采用该方案,由于语法树中的节点间具备确定的位置关系,且所述至少一个节点中的任意一个节点用于存储DML指令关键字与结构化查询语言SQL指令关键字之间的对应关系,从而可以准确地根据所述第一语法树中的节点对应的SQL关键字生成所述第一事务处理请求。With this solution, since the nodes in the syntax tree have a definite positional relationship, and any node in the at least one node is used to store the corresponding relationship between the DML instruction keyword and the structured query language SQL instruction keyword, Therefore, the first transaction processing request can be accurately generated according to the SQL keywords corresponding to the nodes in the first syntax tree.

在一种可能的设计中,所述第二事务处理请求为单个混合型事务处理请求,所述根据所述事务处理日志,生成用于OLAP数据库管理系统的第二事务处理请求,包括:In a possible design, the second transaction processing request is a single hybrid transaction processing request, and the generating the second transaction processing request for the OLAP database management system according to the transaction processing log includes:

根据所述事务处理日志,生成用于所述OLAP数据库管理系统的单个混合型事务处理请求,所述混合型事务处理请求用于请求对所述OLAP数据库中的所述目标数据进行至少一种类型的数据操作。According to the transaction processing log, a single mixed transaction processing request for the OLAP database management system is generated, and the mixed type transaction processing request is used to request at least one type of processing of the target data in the OLAP database data manipulation.

采用该方案,仅需要一个混合型事务处理请求便可以请求对所述目标数据进行至少一种类型的数据操作,从而可以高效地对OLAP数据库进行操作。With this solution, at least one type of data operation can be requested on the target data with only one mixed transaction processing request, so that the OLAP database can be efficiently operated.

在一种可能的设计中,所述第二事务处理请求为至少一个单类型事务处理请求,所述根据所述事务处理日志,生成用于OLAP数据库管理系统的第二事务处理请求,包括:In a possible design, the second transaction processing request is at least one single-type transaction processing request, and generating the second transaction processing request for the OLAP database management system according to the transaction processing log includes:

根据所述事务处理日志,生成用于所述OLAP数据库管理系统的至少一个单类型事务处理请求,任一单类型事务处理请求用于请求对所述OLAP数据库中的所述目标数据进行一种类型的数据操作。According to the transaction processing log, generate at least one single-type transaction processing request for the OLAP database management system, any single-type transaction processing request is used to request one type of the target data in the OLAP database data manipulation.

采用该方案,任一单类型事务处理请求用于请求对所述目标数据进行一种类型的数据操作,从而可以更为准确地对OLAP数据库进行操作。With this solution, any single-type transaction processing request is used to request one type of data operation on the target data, so that the OLAP database can be operated more accurately.

第二方面,本申请实施例提供一种数据处理方法,该方法可以应用于本申请第四方面提供的数据处理装置,该方法包括:In the second aspect, the embodiment of the present application provides a data processing method, which can be applied to the data processing device provided in the fourth aspect of the present application, and the method includes:

接收数据查询语言DQL请求,所述DQL请求用于请求查询目标数据,所述DQL请求与数据库类型无关;根据所述DQL请求,获取对应的事务处理请求,所述事务处理请求包括用于OLTP数据库管理系统的第一事务处理请求或用于OLAP数据库管理系统的第二事务处理请求,所述第一事务处理请求用于请求查询OLTP数据库中存储的所述目标数据,所述第二事务处理请求用于请求查询OLAP数据库中存储的所述目标数据;向所述事务处理请求对应的数据库管理系统发送所述事务处理请求。Receive a data query language DQL request, the DQL request is used to request query target data, the DQL request has nothing to do with the database type; according to the DQL request, obtain the corresponding transaction processing request, the transaction processing request includes the OLTP database The first transaction processing request of the management system or the second transaction processing request for the OLAP database management system, the first transaction processing request is used to query the target data stored in the OLTP database, and the second transaction processing request It is used to request to query the target data stored in the OLAP database; and send the transaction processing request to the database management system corresponding to the transaction processing request.

上述方法中,所述DQL请求用于请求查询目标数据,且与数据库类型无关,那么可以直接根据所述DQL请求,获取对应的事务处理请求,再向对应的数据库管理系统发送所述事务处理请求,即可以灵活地选取对应的数据库管理系统,提升了数据处理效率。In the above method, the DQL request is used to request query target data and has nothing to do with the database type, then the corresponding transaction processing request can be obtained directly according to the DQL request, and then the transaction processing request is sent to the corresponding database management system , that is, the corresponding database management system can be flexibly selected, which improves the efficiency of data processing.

在一种可能的设计中,所述根据所述DQL请求,获取对应的事务处理请求,包括:In a possible design, the acquiring a corresponding transaction processing request according to the DQL request includes:

获取执行信息集合,所述执行信息集合中包括至少一个执行信息,任一执行信息包括DQL请求以及对应的事务处理请求;若所述执行信息集合中存在第一执行信息,所述第一执行信息中包括接收到的所述DQL请求,则从所述第一执行信息中获取事务处理请求。Obtain an execution information set, the execution information set includes at least one execution information, and any execution information includes a DQL request and a corresponding transaction processing request; if there is first execution information in the execution information set, the first execution information If the received DQL request is included in the received DQL request, then the transaction processing request is obtained from the first execution information.

采用该方案,由于预先收集了执行信息集合,任一执行信息包括DQL请求以及对应的事务处理请求,从而可以在接收到DQL请求时,直接在所述执行信息集合中查找,是否存在第一执行信息,那么便获取到了DQL请求对应的事务处理请求。With this solution, since the execution information set is collected in advance, any execution information includes a DQL request and a corresponding transaction processing request, so that when a DQL request is received, it can be directly searched in the execution information set, whether there is a first execution information, then the transaction processing request corresponding to the DQL request is obtained.

在一种可能的设计中,若所述执行信息集合中不存在所述第一执行信息,则还包括:In a possible design, if the first execution information does not exist in the execution information set, further include:

根据所述DQL请求,生成所述OLTP数据库管理系统的所述第一事务处理请求,以及所述OLAP数据库管理系统的所述第二事务处理请求;向所述OLTP数据库管理系统发送所述第一事务处理请求,确定所述第一事务处理请求相应事务处理操作执行过程的第一性能指标,向所述OLAP数据库管理系统发送所述第二事务处理请求,确定所述第二事务处理请求相应事务处理操作执行过程的第二性能指标;将所述第一性能指标和所述第二性能指标中最高性能指标对应的事务处理请求作为所述DQL请求对应的事务处理请求;根据所述DQL请求以及所述DQL请求对应的事务处理请求,生成所述DQL请求的执行信息。According to the DQL request, generate the first transaction processing request of the OLTP database management system, and the second transaction processing request of the OLAP database management system; send the first transaction processing request to the OLTP database management system A transaction processing request, determining a first performance index of a transaction processing operation execution process corresponding to the first transaction processing request, sending the second transaction processing request to the OLAP database management system, and determining a transaction corresponding to the second transaction processing request Processing the second performance index of the operation execution process; using the transaction processing request corresponding to the highest performance index among the first performance index and the second performance index as the transaction processing request corresponding to the DQL request; according to the DQL request and The transaction processing request corresponding to the DQL request generates execution information of the DQL request.

采用该方案,通过对第一事务处理请求和第二事务处理请求的实际执行,确定第一性能指标和第二性能指标,从而可以将较高性能指标对应数据库管理系统的事务处理请求记录在执行信息中。With this solution, the first performance index and the second performance index are determined through the actual execution of the first transaction processing request and the second transaction processing request, so that the transaction processing request corresponding to the higher performance index of the database management system can be recorded in the execution information.

在一种可能的设计中,所述第一事务处理请求对应第一进程,所述第一进程创建了所述OLTP数据库管理系统的第一基于成本优化CBO请求,所述第一CBO请求用于获得第一CBO结果,所述第一CBO结果为所述第一性能指标;所述第二事务处理请求对应第二进程,所述第二进程创建了所述OLAP数据库管理系统的第二CBO请求,所述第二CBO请求用于获得第二CBO结果,所述第二CBO结果为所述第二性能指标;所述第一进程与所述第二进程并行执行。In a possible design, the first transaction processing request corresponds to a first process, and the first process creates a first cost-optimized CBO request of the OLTP database management system, and the first CBO request is used for Obtain a first CBO result, the first CBO result being the first performance index; the second transaction processing request corresponds to a second process, and the second process creates a second CBO request of the OLAP database management system , the second CBO request is used to obtain a second CBO result, where the second CBO result is the second performance indicator; the first process and the second process are executed in parallel.

采用该方案,可以并行执行第一进程和第二进程,从而可以同时测试第一性能指标和第二性能指标,并且采用了基于成本优化的测试方案,可以更准确地对测试性能进行评估,能够更高效、准确地获得第一性能指标和第二性能指标。With this scheme, the first process and the second process can be executed in parallel, so that the first performance index and the second performance index can be tested at the same time, and the cost-optimized test scheme can be used to evaluate the test performance more accurately. The first performance index and the second performance index are obtained more efficiently and accurately.

在一种可能的设计中,若所述执行信息集合中不存在所述第一执行信息,则还包括:In a possible design, if the first execution information does not exist in the execution information set, further include:

确定所述DQL请求的查询类型;确定所述DQL请求的查询类型匹配的数据库管理系统,所述匹配的数据库管理系统为所述OLTP数据库管理系统或所述OLAP数据库管理系统;根据所述DQL请求,生成所述匹配的数据库管理系统对应的事务处理请求,并将该事务处理请求发送至所述匹配的数据库管理系统。Determine the query type of the DQL request; determine the database management system matching the query type of the DQL request, the matching database management system is the OLTP database management system or the OLAP database management system; according to the DQL request , generating a transaction processing request corresponding to the matching database management system, and sending the transaction processing request to the matching database management system.

采用该方案,通过引入查询类型,可以预先设置查询类型相匹配的数据库管理系统,那么即便执行信息集合中不存在所述第一执行信息,也可以针对其查询特性,生成基于查询类型更适合的数据库管理系统,从而提升其查询效率。With this solution, by introducing query types, a database management system that matches the query types can be pre-set. Even if the first execution information does not exist in the execution information set, a more suitable query type based on the query characteristics can be generated. database management system, thereby improving its query efficiency.

在一种可能的设计中,所述根据所述目标DQL请求,生成所述匹配的数据库管理系统对应的事务处理请求,包括:In a possible design, the generating a transaction processing request corresponding to the matching database management system according to the target DQL request includes:

对所述目标DQL请求进行语法解析,获得所述DQL请求对应的第二语法树,所述第二语法树包括至少一个节点,所述至少一个节点中的任意一个节点用于存储DQL指令关键字与结构化查询语言SQL指令关键字之间的对应关系;根据所述第二语法树中的节点对应的SQL关键字生成所述第二事务处理请求。Perform grammatical analysis on the target DQL request to obtain a second grammatical tree corresponding to the DQL request, the second grammatical tree includes at least one node, and any node in the at least one node is used to store the DQL instruction keyword Correspondence with structured query language SQL instruction keywords; generate the second transaction processing request according to the SQL keywords corresponding to the nodes in the second syntax tree.

采用该方案,由于语法树中的节点间具备确定的位置关系,且所述至少一个节点中的任意一个节点用于存储DQL指令关键字与结构化查询语言SQL指令关键字之间的对应关系,从而可以准确地根据所述第二语法树中的节点对应的SQL关键字生成所述第二事务处理请求。With this scheme, since the nodes in the syntax tree have a definite positional relationship, and any node in the at least one node is used to store the corresponding relationship between the DQL instruction keyword and the structured query language SQL instruction keyword, Therefore, the second transaction processing request can be accurately generated according to the SQL keywords corresponding to the nodes in the second syntax tree.

第三方面,本申请实施例提供一种数据处理装置,该装置包括:In a third aspect, an embodiment of the present application provides a data processing device, the device comprising:

获取模块,用于接收数据操作语言DML请求,所述DML请求用于请求对目标数据进行操作,所述DML请求与数据库类型无关;An acquisition module, configured to receive a data manipulation language DML request, the DML request is used to request an operation on the target data, and the DML request has nothing to do with the database type;

处理模块,用于根据所述DML请求,生成用于OLTP数据库管理系统的第一事务处理请求,所述第一事务处理请求用于请求对OLTP数据库中的所述目标数据进行操作;A processing module, configured to generate a first transaction processing request for an OLTP database management system according to the DML request, where the first transaction processing request is used to request to operate on the target data in the OLTP database;

发送模块,用于向所述OLTP数据库管理系统发送所述第一事务处理请求;A sending module, configured to send the first transaction processing request to the OLTP database management system;

所述获取模块,还用于获取所述OLTP数据库管理系统响应于所述第一事务处理请求生成的事务处理日志,所述事务处理日志包括所述OLTP数据库管理系统对所述目标数据进行操作的信息;The acquisition module is further configured to acquire a transaction processing log generated by the OLTP database management system in response to the first transaction processing request, the transaction processing log including the operation of the target data by the OLTP database management system information;

所述处理模块,用于根据所述事务处理日志,生成用于OLAP数据库管理系统的第二事务处理请求,所述第二事务处理请求用于请求对OLAP数据库中的所述目标数据进行操作;The processing module is configured to generate a second transaction processing request for the OLAP database management system according to the transaction processing log, and the second transaction processing request is used to request to operate on the target data in the OLAP database;

所述发送模块,用于向所述OLAP数据库管理系统发送所述第二事务处理请求。The sending module is configured to send the second transaction processing request to the OLAP database management system.

在一种可能的设计中,所述处理模块具体用于:In a possible design, the processing module is specifically used for:

对所述DML请求进行语法解析,获得所述DML请求对应的第一语法树,所述第一语法树包括至少一个节点,所述至少一个节点中的任意一个节点用于存储DML指令关键字与结构化查询语言SQL指令关键字之间的对应关系;根据所述第一语法树中的节点对应的SQL关键字生成所述第一事务处理请求。Perform grammatical analysis on the DML request to obtain a first grammatical tree corresponding to the DML request, the first grammatical tree includes at least one node, and any node in the at least one node is used to store the DML instruction keyword and Correspondence between structured query language SQL instruction keywords; generating the first transaction processing request according to the SQL keywords corresponding to the nodes in the first syntax tree.

在一种可能的设计中,所述第二事务处理请求为单个混合型事务处理请求,所述处理模块具体用于:In a possible design, the second transaction processing request is a single mixed transaction processing request, and the processing module is specifically configured to:

根据所述事务处理日志,生成用于所述OLAP数据库管理系统的单个混合型事务处理请求,所述混合型事务处理请求用于请求对所述OLAP数据库中的所述目标数据进行至少一种类型的数据操作。According to the transaction processing log, a single mixed transaction processing request for the OLAP database management system is generated, and the mixed type transaction processing request is used to request at least one type of processing of the target data in the OLAP database data manipulation.

在一种可能的设计中,所述第二事务处理请求为至少一个单类型事务处理请求,所述处理模块具体用于:In a possible design, the second transaction processing request is at least one single-type transaction processing request, and the processing module is specifically configured to:

根据所述事务处理日志,生成用于所述OLAP数据库管理系统的至少一个单类型事务处理请求,任一单类型事务处理请求用于请求对所述OLAP数据库中的所述目标数据进行一种类型的数据操作。According to the transaction processing log, generate at least one single-type transaction processing request for the OLAP database management system, any single-type transaction processing request is used to request one type of the target data in the OLAP database data manipulation.

第四方面,本申请实施例提供一种数据处理装置,该装置包括:In a fourth aspect, the embodiment of the present application provides a data processing device, which includes:

获取模块,用于接收数据查询语言DQL请求,所述DQL请求用于请求查询目标数据,所述DQL请求与数据库类型无关;An acquisition module, configured to receive a data query language DQL request, the DQL request is used to request query target data, and the DQL request has nothing to do with the database type;

以及用于根据所述DQL请求,获取对应的事务处理请求,所述事务处理请求包括用于OLTP数据库管理系统的第一事务处理请求或用于OLAP数据库管理系统的第二事务处理请求,所述第一事务处理请求用于请求查询OLTP数据库中存储的所述目标数据,所述第二事务处理请求用于请求查询OLAP数据库中存储的所述目标数据;And for obtaining a corresponding transaction processing request according to the DQL request, the transaction processing request includes a first transaction processing request for an OLTP database management system or a second transaction processing request for an OLAP database management system, the The first transaction processing request is used to request to query the target data stored in the OLTP database, and the second transaction processing request is used to request to query the target data stored in the OLAP database;

发送模块,用于向所述事务处理请求对应的数据库管理系统发送所述事务处理请求。A sending module, configured to send the transaction processing request to the database management system corresponding to the transaction processing request.

在一种可能的设计中,所述获取模块具体用于:In a possible design, the acquiring module is specifically used for:

获取执行信息集合,所述执行信息集合中包括至少一个执行信息,任一执行信息包括DQL请求以及对应的事务处理请求;若所述执行信息集合中存在第一执行信息,所述第一执行信息中包括接收到的所述DQL请求,则从所述第一执行信息中获取事务处理请求。Obtain an execution information set, the execution information set includes at least one execution information, and any execution information includes a DQL request and a corresponding transaction processing request; if there is first execution information in the execution information set, the first execution information If the received DQL request is included in the received DQL request, then the transaction processing request is obtained from the first execution information.

在一种可能的设计中,所述装置还包括处理模块,若所述执行信息集合中不存在所述第一执行信息,则所述处理模块具体用于:In a possible design, the device further includes a processing module, and if the first execution information does not exist in the execution information set, the processing module is specifically configured to:

根据所述DQL请求,生成所述OLTP数据库管理系统的所述第一事务处理请求,以及所述OLAP数据库管理系统的所述第二事务处理请求;向所述OLTP数据库管理系统发送所述第一事务处理请求,确定所述第一事务处理请求相应事务处理操作执行过程的第一性能指标,向所述OLAP数据库管理系统发送所述第二事务处理请求,确定所述第二事务处理请求相应事务处理操作执行过程的第二性能指标;将所述第一性能指标和所述第二性能指标中最高性能指标对应的事务处理请求作为所述DQL请求对应的事务处理请求;根据所述DQL请求以及所述DQL请求对应的事务处理请求,生成所述DQL请求的执行信息。According to the DQL request, generate the first transaction processing request of the OLTP database management system, and the second transaction processing request of the OLAP database management system; send the first transaction processing request to the OLTP database management system A transaction processing request, determining a first performance index of a transaction processing operation execution process corresponding to the first transaction processing request, sending the second transaction processing request to the OLAP database management system, and determining a transaction corresponding to the second transaction processing request Processing the second performance index of the operation execution process; using the transaction processing request corresponding to the highest performance index among the first performance index and the second performance index as the transaction processing request corresponding to the DQL request; according to the DQL request and The transaction processing request corresponding to the DQL request generates execution information of the DQL request.

在一种可能的设计中,所述第一事务处理请求对应第一进程,所述第一进程创建了所述OLTP数据库管理系统的第一基于成本优化CBO请求,所述第一CBO请求用于获得第一CBO结果,所述第一CBO结果为所述第一性能指标;所述第二事务处理请求对应第二进程,所述第二进程创建了所述OLAP数据库管理系统的第二CBO请求,所述第二CBO请求用于获得第二CBO结果,所述第二CBO结果为所述第二性能指标;所述第一进程与所述第二进程并行执行。In a possible design, the first transaction processing request corresponds to a first process, and the first process creates a first cost-optimized CBO request of the OLTP database management system, and the first CBO request is used for Obtain a first CBO result, the first CBO result being the first performance index; the second transaction processing request corresponds to a second process, and the second process creates a second CBO request of the OLAP database management system , the second CBO request is used to obtain a second CBO result, where the second CBO result is the second performance indicator; the first process and the second process are executed in parallel.

在一种可能的设计中,所述装置还包括处理模块,若所述执行信息集合中不存在所述第一执行信息,则所述处理模块还用于:In a possible design, the device further includes a processing module, and if the first execution information does not exist in the execution information set, the processing module is further configured to:

确定所述DQL请求的查询类型;确定所述DQL请求的查询类型匹配的数据库管理系统,所述匹配的数据库管理系统为所述OLTP数据库管理系统或所述OLAP数据库管理系统;根据所述DQL请求,生成所述匹配的数据库管理系统对应的事务处理请求;Determine the query type of the DQL request; determine the database management system matching the query type of the DQL request, the matching database management system is the OLTP database management system or the OLAP database management system; according to the DQL request , generating a transaction processing request corresponding to the matching database management system;

所述发送模块还用于:The sending module is also used for:

将该事务处理请求发送至所述匹配的数据库管理系统。The transaction processing request is sent to the matching database management system.

在一种可能的设计中,所述处理模块具体用于:In a possible design, the processing module is specifically used for:

对所述目标DQL请求进行语法解析,获得所述DQL请求对应的第二语法树,所述第二语法树包括至少一个节点,所述至少一个节点中的任意一个节点用于存储DQL指令关键字与结构化查询语言SQL指令关键字之间的对应关系;根据所述第二语法树中的节点对应的SQL关键字生成所述第二事务处理请求。Perform grammatical analysis on the target DQL request to obtain a second grammatical tree corresponding to the DQL request, the second grammatical tree includes at least one node, and any node in the at least one node is used to store the DQL instruction keyword Correspondence with structured query language SQL instruction keywords; generate the second transaction processing request according to the SQL keywords corresponding to the nodes in the second syntax tree.

第五方面,提供一种电子设备,所述电子设备包括:一个或多个处理器;一个或多个存储器;其中,所述一个或多个存储器存储有一个或多个计算机指令,当所述一个或多个计算机指令被所述一个或多个处理器执行时,使得所述电子设备执行如上述第一方面、第二方面中任一项所述的方法。In a fifth aspect, an electronic device is provided, and the electronic device includes: one or more processors; one or more memories; wherein, the one or more memories store one or more computer instructions, when the When the one or more computer instructions are executed by the one or more processors, the electronic device is made to execute the method described in any one of the first aspect and the second aspect above.

第六方面,提供一种计算机可读存储介质,所述计算机可读存储介质包括计算机指令,当计算机指令在计算机上运行时,使得所述计算机执行如上述第一方面或第二方面中任一项所述的方法。In a sixth aspect, a computer-readable storage medium is provided, the computer-readable storage medium includes computer instructions, and when the computer instructions are run on a computer, the computer executes any one of the above-mentioned first aspect or second aspect. method described in the item.

以上第三方面到第六方面的有益效果,请参见第一方面或第二方面的有益效果,不重复赘述。For the beneficial effects of the above third aspect to the sixth aspect, please refer to the beneficial effects of the first aspect or the second aspect, and will not be repeated.

附图说明Description of drawings

图1为本申请实施例提供的一种数据处理方法适用的系统架构示意图;FIG. 1 is a schematic diagram of a system architecture applicable to a data processing method provided in an embodiment of the present application;

图2为本申请实施例提供的一种数据处理方法适用的系统架构中服务端的示意图;FIG. 2 is a schematic diagram of a server in a system architecture applicable to a data processing method provided by an embodiment of the present application;

图3为本申请实施例提供的一种数据处理方法的步骤流程示意图;FIG. 3 is a schematic flow chart of the steps of a data processing method provided in an embodiment of the present application;

图4为本申请实施例提供的一种数据处理方法中处理DML请求的具体步骤流程示意图;FIG. 4 is a schematic flowchart of specific steps for processing a DML request in a data processing method provided in an embodiment of the present application;

图5为本申请实施例提供的一种数据处理方法中处理DQL请求一种情形的具体步骤流程示意图;FIG. 5 is a schematic flow chart of specific steps in a situation of processing a DQL request in a data processing method provided by an embodiment of the present application;

图6为本申请实施例提供的一种数据处理方法中处理DQL请求另一种情形的具体步骤流程示意图;FIG. 6 is a schematic flowchart of specific steps in another situation of processing a DQL request in a data processing method provided by an embodiment of the present application;

图7为本申请实施例提供的一种数据处理方法中生成执行信息的具体步骤流程示意图;FIG. 7 is a schematic flowchart of specific steps for generating execution information in a data processing method provided in an embodiment of the present application;

图8为本申请实施例提供的一种数据处理装置的结构示意图;FIG. 8 is a schematic structural diagram of a data processing device provided in an embodiment of the present application;

图9为本申请实施例提供的一种电子设备的结构示意图。FIG. 9 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.

具体实施方式Detailed ways

下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述。The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.

以下实施例中所使用的术语只是为了描述特定实施例的目的,而并非旨在作为对本申请的限制。如在本申请的说明书和所附权利要求书中所使用的那样,单数表达形式“一个”、“一种”、“所述”、“上述”、“该”和“这一”旨在也包括例如“一个或多个”这种表达形式,除非其上下文中明确地有相反指示。还应当理解,在本申请实施例中,“一个或多个”是指一个或两个以上(包含两个);“和/或”,描述关联对象的关联关系,表示可以存在三种关系;例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B的情况,其中A、B可以是单数或者复数。字符“/”一般表示前后关联对象是一种“或”的关系。The terms used in the following examples are for the purpose of describing particular examples only, and are not intended to limit the application. As used in the specification and appended claims of this application, the singular expressions "a", "an", "said", "above", "the" and "this" are intended to also Expressions such as "one or more" are included unless the context clearly dictates otherwise. It should also be understood that in the embodiments of the present application, "one or more" refers to one or more than two (including two); "and/or" describes the association relationship of associated objects, indicating that there may be three relationships; For example, A and/or B may mean: A exists alone, A and B exist simultaneously, and B exists alone, wherein A and B may be singular or plural. The character "/" generally indicates that the contextual objects are an "or" relationship.

在本说明书中描述的参考“一个实施例”或“一些实施例”等意味着在本申请的一个或多个实施例中包括结合该实施例描述的特定特征、结构或特点。由此,在本说明书中的不同之处出现的语句“在一个实施例中”、“在一些实施例中”、“在其他一些实施例中”、“在另外一些实施例中”等不是必然都参考相同的实施例,而是意味着“一个或多个但不是所有的实施例”,除非是以其他方式另外特别强调。术语“包括”、“包含”、“具有”及它们的变形都意味着“包括但不限于”,除非是以其他方式另外特别强调。Reference to "one embodiment" or "some embodiments" or the like in this specification means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in other embodiments," etc. in various places in this specification are not necessarily All refer to the same embodiment, but mean "one or more but not all embodiments" unless specifically stated otherwise. The terms "including", "comprising", "having" and variations thereof mean "including but not limited to", unless specifically stated otherwise.

本申请实施例中的术语多个”是指两个或两个以上,鉴于此,本申请实施例中也可以将“多个”理解为“至少两个”。“至少一个”,可理解为一个或多个,例如理解为一个、两个或更多个。例如,包括至少一个,是指包括一个、两个或更多个,而且不限制包括的是哪几个。例如,包括A、B和C中的至少一个,那么包括的可以是A、B、C,A和B,A和C,B和C,或A和B和C。同理,对于“至少一种”等描述的理解,也是类似的。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,字符“/”,如无特殊说明,一般表示前后关联对象是一种“或”的关系。The term "multiple" in the embodiments of the present application refers to two or more than two. In view of this, "multiple" can also be understood as "at least two" in the embodiments of the present application. "At least one" can be understood as One or more, such as being understood as one, two or more. For example, including at least one means including one, two or more, and does not limit which several are included. For example, including A, At least one of B and C, then it may include A, B, C, A and B, A and C, B and C, or A and B and C. Similarly, for "at least one" and other descriptions Understanding is also similar. "And/or" describes the relationship between associated objects, indicating that there can be three relationships, for example, A and/or B, which can mean: A exists alone, A and B exist at the same time, and B exists alone These three situations. In addition, the character "/", unless otherwise specified, generally indicates that the contextual objects are an "or" relationship.

除非有相反的说明,本申请实施例提及“第一”、“第二”等序数词用于对多个对象进行区分,不用于限定多个对象的顺序、时序、优先级或者重要程度。Unless otherwise specified, ordinal numerals such as "first" and "second" mentioned in the embodiments of the present application are used to distinguish multiple objects, and are not used to limit the sequence, timing, priority or importance of multiple objects.

目前常用的数据库分为两类:联机事务处理(On-Line Transaction Processing,OLTP)数据库和联机分析处理(On-Line Analytical Processing,OLAP)数据库。OLTP数据库与OLAP数据库在业务特性和技术运用层面都各有所长。在一些场景下,常同时部署这两个数据库。如在软件即服务(Software-as-a-Service,SaaS)场景,SaaS在应用时,可以由厂商统一部署应用软件,用户可以根据实际需求向SaaS厂商订购SaaS,获得SaaS的相关业务服务。如此,用户便不再需要在本地部署数据库的基础设施,从而可以有效节省运维成本。Currently commonly used databases are divided into two categories: On-Line Transaction Processing (OLTP) databases and On-Line Analytical Processing (On-Line Analytical Processing, OLAP) databases. Both OLTP database and OLAP database have their own strengths in terms of business characteristics and technical application. In some scenarios, these two databases are often deployed at the same time. For example, in the Software-as-a-Service (SaaS) scenario, when SaaS is applied, the application software can be uniformly deployed by the manufacturer, and users can order SaaS from the SaaS manufacturer according to actual needs to obtain SaaS-related business services. In this way, users no longer need to deploy database infrastructure locally, which can effectively save operation and maintenance costs.

SaaS目前已经发展较为成熟,可以实现多租共享,多租共享的情形下,为满足不同用户的业务需求,SaaS上可以同时部署OLTP数据库与OLAP数据库。SaaS的数据库中以物理表(Physical Table)的形式存储了多个用户的数据记录,而向用户呈现的形式为逻辑表(Logical table)。采用本申请提供的数据处理方法时,可以通过该用户的用户端向SaaS服务端发送逻辑表的数据处理请求,SaaS服务端再根据数据处理请求生成物理表相应的事务处理请求。其中,物理表指SaaS的数据库中实际创建并用于数据记录存储的数据表,逻辑表指用户根据自身业务自定义的数据表,在SaaS的数据库中逻辑表并不存在,通过对逻辑表与物理表间的映射,可以实现数据处理请求到事务处理请求的转换。其中,数据处理请求可以为数据操作语言(Data Manipulation Language,DML)请求或数据查询语言(Data QueryLanguage,DQL)请求,DML请求或DQL请求与数据库类型无关,均可以通过生成不同类型的数据库管理系统的相应事务处理请求访问物理表,从而实现对DML请求或DQL请求的处理。SaaS has developed relatively maturely and can realize multi-tenant sharing. In the case of multi-tenant sharing, in order to meet the business needs of different users, OLTP database and OLAP database can be deployed on SaaS at the same time. The SaaS database stores data records of multiple users in the form of physical tables (Physical Table), and presents them to users in the form of Logical tables. When using the data processing method provided by this application, the user's client can send a data processing request for the logical table to the SaaS server, and the SaaS server can generate a corresponding transaction processing request for the physical table according to the data processing request. Among them, the physical table refers to the data table actually created in the SaaS database and used for data record storage, and the logical table refers to the data table customized by the user according to its own business. The logical table does not exist in the SaaS database. The mapping between tables can realize the conversion of data processing requests to transaction processing requests. Among them, the data processing request can be a Data Manipulation Language (Data Manipulation Language, DML) request or a Data Query Language (Data Query Language, DQL) request, and the DML request or DQL request has nothing to do with the database type, and can be generated by different types of database management systems. The corresponding transaction processing request accesses the physical table, so as to realize the processing of DML request or DQL request.

具体来说,物理表可以如下表1-1所示:Specifically, the physical table can be as shown in Table 1-1 below:

表1-1:物理表(表名Data)Table 1-1: Physical table (table name Data)

Figure BDA0003413979920000071
Figure BDA0003413979920000071

其中,GUID、Tenant、Object、Field1、Field2、Field3和Field4均为数据表Data的字段,具体来说,GUID为编号;Tenant为用户名,如Tenant_A即是具体的用户名;Object为表对象,如Customer,Company指表对象的具体逻辑表的表名,Field1、Field2、Field3和Field4均为无类型字段,可以存储各种类型的字段。用户可以对字段进行灵活自定义,映射到物理表中的Field1~Field4。Among them, GUID, Tenant, Object, Field1, Field2, Field3 and Field4 are the fields of the data table Data, specifically, GUID is the number; Tenant is the user name, such as Tenant_A is the specific user name; Object is the table object, For example, Customer and Company refer to the table name of the specific logical table of the table object, and Field1, Field2, Field3, and Field4 are untyped fields that can store various types of fields. Users can flexibly customize the fields and map them to Field1~Field4 in the physical table.

需要说明的是,还可以根据表对象中每个逻辑表中索引的类型建立物理表的索引表(表名Index_Data),如表1-2:It should be noted that the index table (table name Index_Data) of the physical table can also be established according to the type of index in each logical table in the table object, as shown in Table 1-2:

表1-2索引表(表名Index_Data)Table 1-2 Index table (table name Index_Data)

Figure BDA0003413979920000081
Figure BDA0003413979920000081

其中,GUID、Tenant、Object、String、Number均为索引表Index_Data的字段。String为逻辑表Company的索引,Number为逻辑表Customer的索引。Among them, GUID, Tenant, Object, String, and Number are all fields of the index table Index_Data. String is the index of the logical table Company, and Number is the index of the logical table Customer.

SaaS的数据库中还可以通过对象元数据表描述表对象的基本信息,以及通过字段元数据表描述表对象中每个字段的基本信息,其中,对象元数据表可以如表2-1所示,字段元数据表可以如表2-2所示。In the SaaS database, the basic information of the table object can also be described through the object metadata table, and the basic information of each field in the table object can be described through the field metadata table. The object metadata table can be shown in Table 2-1. The field metadata table can be shown in Table 2-2.

表2-1对象元数据表(表名Objects)Table 2-1 Object metadata table (table name Objects)

Figure BDA0003413979920000082
Figure BDA0003413979920000082

其中,Name,Tenant为对象元数据表Objects的字段,Name表示表对象的表名,Tenant表示用户名。Among them, Name and Tenant are the fields of the object metadata table Objects, Name indicates the table name of the table object, and Tenant indicates the user name.

表2-2字段元数据表(表名Fields)Table 2-2 Field metadata table (table name Fields)

Figure BDA0003413979920000083
Figure BDA0003413979920000083

其中,Name、Tenant、Object、Type、Field_No和Index均为字段元数据表Fields的字段。Name表示表对象中所定义字段的字段名,Tenant表示字段对应的用户名,Object表示字段所属表对象名,Type表示字段的具体类型,Field_No表示字段在物理表Data所映射的无类型字段编号,如Field_No取1对应Field1,Index表示字段是否为索引。显然,用户可以根据需要修改字段元数据表中的定义,而不影响其他用户。Among them, Name, Tenant, Object, Type, Field_No and Index are fields of the field metadata table Fields. Name indicates the field name of the field defined in the table object, Tenant indicates the user name corresponding to the field, Object indicates the name of the table object to which the field belongs, Type indicates the specific type of the field, and Field_No indicates the number of the untyped field mapped to the physical table Data. For example, Field_No takes 1 to correspond to Field1, and Index indicates whether the field is an index. Obviously, users can modify the definitions in the field metadata table as needed without affecting other users.

通过表1-1~表1-2,以及表2-1~表2-2,可以将逻辑表呈现给用户,即表3-1以及表3-2,表3-1为用户逻辑表(表名Customer),表3-2为机构逻辑表(表名Company)。Through Table 1-1 to Table 1-2, and Table 2-1 to Table 2-2, the logic table can be presented to the user, that is, Table 3-1 and Table 3-2. Table 3-1 is the user logic table ( The table name is Customer), and Table 3-2 is the organization logic table (table name Company).

表3-1用户逻辑表(表名Customer)Table 3-1 User logic table (table name Customer)

Figure BDA0003413979920000091
Figure BDA0003413979920000091

其中,name、id、type和company为表Customer中定义的字段,已在表2-2中定义,name表示用户名,id表示用户编号,type表示用户类型,company表示用户对应的机构名。Among them, name, id, type, and company are the fields defined in the table Customer, which have been defined in Table 2-2. name indicates the user name, id indicates the user number, type indicates the user type, and company indicates the organization name corresponding to the user.

表3-2机构逻辑表(表名company)Table 3-2 Organization logic table (table name company)

Figure BDA0003413979920000092
Figure BDA0003413979920000092

其中,name、code、category和Staff_num为表company中定义的字段,已在表2-2中定义,name表示机构名,code表示机构代码,category表示机构类型,Staff_num表示机构的人数。Among them, name, code, category, and Staff_num are the fields defined in the table company, which have been defined in Table 2-2. name indicates the organization name, code indicates the organization code, category indicates the type of organization, and Staff_num indicates the number of people in the organization.

需要说明的是,表1-1~表1-2,以及表2-1~表2-2是在数据库中实际定义的数据表,表3-1以及表3-2并不是在数据库中实际定义的数据表,可以呈现给用户,方便用户进行操作。在实际应用过程中,可以将用户对表3-1~3-2的虚拟访问,转换为对表1-1~表1-2的实际访问,但对用户而言,这一过程并不可见。It should be noted that Table 1-1 to Table 1-2 and Table 2-1 to Table 2-2 are data tables actually defined in the database, while Table 3-1 and Table 3-2 are not actually defined in the database. The defined data table can be presented to the user, which is convenient for the user to operate. In the actual application process, the user's virtual access to Table 3-1~3-2 can be converted into actual access to Table 1-1~Table 1-2, but this process is not visible to the user .

通过上述SaaS的例子可知,针对SaaS的多租共享场景,通过同时部署OLTP数据库与OLTP数据库,可以满足不同用户的业务需求,处理不同的数据处理请求。Through the above SaaS example, we can see that for the SaaS multi-tenant sharing scenario, by deploying OLTP database and OLTP database at the same time, it can meet the business needs of different users and process different data processing requests.

下面详细描述本申请提供的一种数据处理方法,该方法可以应用于图1示出的系统架构,图1示出的系统架构包括用户端100、服务端200和存储端300。应理解,图1示出的系统架构仅为一个示例,在一些实施例中,可以具有比图1中所示出系统架构中更多的或者更少的部件,可以组合两个或更多的部件,或者可以具有不同的部件配置。图1中所示出的各种部件可以在包括一个或多个硬件、软件、或硬件和软件的组合中实现。数据处理方法可应用的系统架构也可以仅包括用户端100和服务端200,可以将存储端300的功能转移到服务端200。图1示出的系统架构具体如下:A data processing method provided by the present application will be described in detail below. The method can be applied to the system architecture shown in FIG. 1 . The system architecture shown in FIG. It should be understood that the system architecture shown in FIG. 1 is only an example. In some embodiments, there may be more or fewer components than the system architecture shown in FIG. 1, and two or more components may be combined. components, or may have different component configurations. The various components shown in FIG. 1 may be implemented in one or more hardware, software, or a combination of hardware and software. The applicable system architecture of the data processing method may also include only the client 100 and the server 200 , and the functions of the storage 300 may be transferred to the server 200 . The system architecture shown in Figure 1 is specifically as follows:

用户端100用于获取数据处理请求,如可以根据用户输入的数据库操作命令生成数据处理请求,也可以从其他设备接收。数据处理请求可以为DML请求或DQL请求。用户端100还可以用于将数据处理请求发送至服务端200。本申请中对实现用户端100的具体物理设备不做限定,能发起数据处理请求的物理设备均可,如用户端100可以为主机设备。The client 100 is used to obtain data processing requests, for example, the data processing requests may be generated according to the database operation commands input by the users, or may be received from other devices. The data processing request can be a DML request or a DQL request. The client 100 can also be used to send a data processing request to the server 200 . In this application, there is no limitation on the specific physical device for implementing the client 100, any physical device capable of initiating a data processing request may be used, for example, the client 100 may be a host device.

服务端200用于获取来自用户端100的数据处理请求,并对数据处理请求进行处理。需要说明的是,在对数据处理请求进行处理的过程中,可能会访问数据库。图1示出的系统架构中可以同时部署OLTP数据库和OLAP数据库。服务端200可以根据OLTP数据库和\或OLAP数据库对数据处理请求进行处理。本申请中对实现服务端200的具体物理设备不做限定,如服务端200可以为服务器。The server 200 is configured to acquire a data processing request from the client 100 and process the data processing request. It should be noted that during the process of processing the data processing request, the database may be accessed. OLTP database and OLAP database can be deployed at the same time in the system architecture shown in FIG. 1 . The server 200 can process the data processing request according to the OLTP database and/or the OLAP database. In this application, there is no limitation on the specific physical device for realizing the server 200, for example, the server 200 may be a server.

存储端300用于部署OLTP数据库以及OLAP数据库,运行数据库管理系统(DatabaseManagement System,DBMS),以及存储数据库的日志文件。需要说明的是,图1的实例中,仅示出一个存储端300,这个存储端300既部署了OLTP数据库又部署了OLAP数据库。但还可以有其它灵活的部署方式,如可以采用两个存储端300,其中一个存储端300署OLTP数据库,另一个部署OLAP数据库。在一些其他的实例中,还可以不设置存储端300,在服务器上部署数据库。本申请中对实现服务端200的具体物理设备不做限定,如存储端300可以为运行随机存储器(Random Access Memory,RAM)的主机设备。The storage terminal 300 is used for deploying OLTP database and OLAP database, running a database management system (Database Management System, DBMS), and storing log files of the database. It should be noted that, in the example of FIG. 1 , only one storage terminal 300 is shown, and this storage terminal 300 deploys both OLTP database and OLAP database. However, other flexible deployment methods are also possible. For example, two storage terminals 300 may be used, one of which is deployed with an OLTP database, and the other is deployed with an OLAP database. In some other instances, it is also possible to deploy the database on the server without setting the storage terminal 300 . In this application, the specific physical device for implementing the server 200 is not limited. For example, the storage device 300 may be a host device running Random Access Memory (RAM).

图1示出的系统架构中,服务端200的具体架构还可以如图2所示。服务端200中的功能模块具体可以如下:In the system architecture shown in FIG. 1 , the specific architecture of the server 200 may also be shown in FIG. 2 . The functional modules in the server 200 may specifically be as follows:

执行信息生成器201,可以包括处理请求解析器2011、处理请求翻译器2012和执行信息缓存2013。其中,处理请求解析器2011用于对数据处理请求进行解析,如将数据处理请求解析为语法树,还可以有其它解析方式以及解析内容,如将数据处理请求解析为正则表达式等,数据处理请求可以为用于操作用户逻辑表的处理请求;处理请求翻译器2012用于对解析内容(图2中以语法树为例)进行翻译,得到相应的事务处理请求,事务处理请求可以为用于操作用户物理表的处理请求;执行信息缓存2013,用于存储事务处理请求相应事务处理过程的执行信息,执行信息的格式可以多种,如可以为数据处理请求以及对应数据库的事务处理请求。在一些情形中,执行信息生成器201还可以包括语义分析器2014,用于确定DQL请求的查询类型。The execution information generator 201 may include a processing request parser 2011 , a processing request translator 2012 and an execution information cache 2013 . Among them, the processing request parser 2011 is used to parse the data processing request, such as parsing the data processing request into a syntax tree, and other parsing methods and parsing content, such as parsing the data processing request into a regular expression, etc. The request can be a processing request for operating the user logic table; the processing request translator 2012 is used to translate the parsed content (taking the syntax tree as an example in FIG. 2 ) to obtain a corresponding transaction processing request, and the transaction processing request can be used for The processing request for operating the user's physical table; the execution information cache 2013 is used to store the execution information of the transaction processing process corresponding to the transaction processing request. The execution information can be in various formats, for example, it can be a data processing request and a transaction processing request corresponding to a database. In some cases, the execution information generator 201 may also include a semantic analyzer 2014 for determining the query type of the DQL request.

事务处理执行器202,用于连接数据库,并向相应数据库发送事务处理请求;事务处理执行器202可以包括DML执行器2021和DQL执行器2022,DML执行器用于发送DML类型的事务处理请求,DQL执行器用于发送DQL类型的事务处理请求。The transaction processing executor 202 is used to connect to the database and send a transaction processing request to the corresponding database; the transaction processing executor 202 may include a DML executor 2021 and a DQL executor 2022, and the DML executor is used to send a DML type transaction processing request, DQL Executors are used to send transaction processing requests of DQL type.

数据同步器203,可以包括日志解析器2031和OLAP执行器2032。日志解析器用于获取OLTP数据库管理系统的事务处理日志,并根据OLTP数据库管理系统的事务处理日志,生成OLAP数据库管理系统的事务处理请求,从而使得OLTP数据库与OLAP数据库保持一致。The data synchronizer 203 may include a log parser 2031 and an OLAP executor 2032 . The log parser is used to obtain the transaction processing log of the OLTP database management system, and generate a transaction processing request of the OLAP database management system according to the transaction processing log of the OLTP database management system, so that the OLTP database is consistent with the OLAP database.

执行优化器204,用于OLAP数据库管理系统的事务处理请求以及OLTP数据库管理系统的事务处理请求中选择事务处理请求,如可以采用基于成本优化(Cost-BasedOptimization,CBO)方式,分别确定两个事务处理请求对应事务处理过程的性能指标。执行优化器204可以包括OLAP优化器2041和OLTP优化器2042,分别用于发送相应事务处理请求以及CBO请求,确定两个数据库的事务处理请求对应事务处理过程的性能指标。The execution optimizer 204 is used to select the transaction processing request from the transaction processing request of the OLAP database management system and the transaction processing request of the OLTP database management system. For example, a Cost-Based Optimization (CBO) method can be used to determine two transactions respectively The processing request corresponds to the performance index of the transaction processing process. The execution optimizer 204 may include an OLAP optimizer 2041 and an OLTP optimizer 2042, which are respectively configured to send corresponding transaction processing requests and CBO requests, and determine the performance indicators of the transaction processing processes corresponding to the transaction processing requests of the two databases.

可以采用图2示出的服务端200执行本申请提供的一种数据处理方法。参见图3,下面详细描述本申请提供的一种数据处理方法。The server 200 shown in FIG. 2 can be used to execute a data processing method provided in this application. Referring to FIG. 3 , a data processing method provided by the present application will be described in detail below.

步骤301:接收数据处理请求。Step 301: Receive a data processing request.

若数据处理请求为DML请求,则执行DML请求的处理方法,即步骤302~步骤306;若数据处理请求为DQL请求,则执行DQL请求的处理方法,即步骤307~步骤308。DML请求用于请求对目标数据进行操作,DML请求与数据库类型无关;DQL请求用于请求查询目标数据,DQL请求与数据库类型无关。If the data processing request is a DML request, execute the processing method for the DML request, namely steps 302 to 306; DML requests are used to request operations on target data, and DML requests have nothing to do with database types; DQL requests are used to request query target data, and DQL requests have nothing to do with database types.

步骤302:根据DML请求,生成用于OLTP数据库管理系统的第一事务处理请求。Step 302: Generate a first transaction processing request for the OLTP database management system according to the DML request.

步骤303:向OLTP数据库管理系统发送第一事务处理请求。Step 303: Send the first transaction processing request to the OLTP database management system.

步骤304:获取OLTP数据库管理系统响应于第一事务处理请求生成的事务处理日志。Step 304: Obtain a transaction processing log generated by the OLTP database management system in response to the first transaction processing request.

其中,事务处理日志包括OLTP数据库管理系统对目标数据进行操作的信息。Wherein, the transaction processing log includes information about the operation of the OLTP database management system on the target data.

步骤305:根据事务处理日志,生成用于OLAP数据库管理系统的第二事务处理请求。Step 305: Generate a second transaction processing request for the OLAP database management system according to the transaction processing log.

步骤306:向OLAP数据库管理系统发送第二事务处理请求。Step 306: Send a second transaction processing request to the OLAP database management system.

步骤307:根据DQL请求,获取对应的事务处理请求。Step 307: Obtain a corresponding transaction processing request according to the DQL request.

事务处理请求包括用于OLTP数据库管理系统的第一事务处理请求或用于OLAP数据库管理系统的第二事务处理请求。The transaction request includes a first transaction request for an OLTP database management system or a second transaction request for an OLAP database management system.

步骤308:向事务处理请求对应的数据库管理系统发送事务处理请求。Step 308: Send the transaction processing request to the database management system corresponding to the transaction processing request.

需要说明的是,步骤302~步骤306中,第一事务处理请求用于请求对OLTP数据库中的目标数据进行操作,第二事务处理请求用于请求对OLAP数据库中的目标数据进行操作;而在步骤307~步骤308中,第一事务处理请求用于请求查询OLTP数据库中存储的目标数据,第二事务处理请求用于请求查询OLAP数据库中存储的目标数据。It should be noted that, in steps 302 to 306, the first transaction processing request is used to request to operate on the target data in the OLTP database, and the second transaction processing request is used to request to operate on the target data in the OLAP database; In steps 307 to 308, the first transaction processing request is used to request to query the target data stored in the OLTP database, and the second transaction processing request is used to request to query the target data stored in the OLAP database.

步骤302~步骤306为DML请求的处理方法,步骤307~步骤308为DQL请求的处理方法,下面详细描述相关步骤。Steps 302 to 306 are the processing methods of the DML request, and steps 307 to 308 are the processing methods of the DQL request. The relevant steps will be described in detail below.

DML请求的处理方法:DML request processing method:

步骤302中,一种可能的实施方式可以如下:In step 302, a possible implementation manner may be as follows:

对DML请求进行语法解析,获得DML请求对应的第一语法树,根据第一语法树中的节点对应的结构化查询语言(Structured Query Language,SQL)关键字生成第一事务处理请求。Perform grammatical analysis on the DML request to obtain a first grammatical tree corresponding to the DML request, and generate a first transaction processing request according to a structured query language (Structured Query Language, SQL) keyword corresponding to a node in the first grammatical tree.

第一语法树包括至少一个节点,至少一个节点中的任意一个节点用于存储DML指令关键字与结构化查询语言SQL指令关键字之间的对应关系。The first syntax tree includes at least one node, and any node in the at least one node is used to store the corresponding relationship between DML instruction keywords and structured query language SQL instruction keywords.

举例来说,针对表1-1~表3-2的示例,DML请求具体为:For example, for the examples in Table 1-1 to Table 3-2, the specific DML request is:

INSERT INTO Customer(name,id,type,company)VALUES(‘Mary’,10022,‘VIP1’,‘CompanyA’);INSERT INTO Customer(name,id,type,company) VALUES('Mary',10022,'VIP1','CompanyA');

由于所述DML请求是对用户逻辑表的处理请求,而用户逻辑表实际上并没有在数据库中创建,需要将DML请求转换为第一事务处理请求,才能对物理表Data进行操作,第一事务处理请求具体为:Since the DML request is a processing request for the user logical table, and the user logical table is not actually created in the database, the DML request needs to be converted into the first transaction processing request before the physical table Data can be operated. The first transaction The processing request is specifically:

INSERT INTO Data(GUID,Tenant,Objects,Filed1,Filed2,Filed3,Filed4)VALUES(GUID,‘Tenant_A’,Customer,‘Mary’,10022,‘VIP1’,‘CompanyA’);INSERT INTO Data(GUID,Tenant,Objects,Filed1,Filed2,Filed3,Filed4) VALUES(GUID,'Tenant_A',Customer,'Mary',10022,'VIP1','CompanyA');

DML请求、第一事务处理请求均由多个关键字组成,第一语法树的节点存储了DML指令关键字与SQL指令关键字之间的对应关系,并且第一语法树的树结构也可以指示出SQL指令关键字的顺序,从而可以通过第一语法树实现DML请求到第一事务处理请求转换,举例来说,第一语法树中的节点存储了Filed1与name之间的对应关系,可以将Filed1转换为name。本申请中对第一语法树的形式不做限定,可以生成第一事务处理请求,实现DML请求到第一事务处理请求的形式均可。Both the DML request and the first transaction processing request are composed of multiple keywords, and the nodes of the first syntax tree store the corresponding relationship between the DML instruction keywords and the SQL instruction keywords, and the tree structure of the first syntax tree can also indicate The order of the keywords of the SQL instruction is displayed, so that the conversion of the DML request to the first transaction processing request can be realized through the first syntax tree. For example, the nodes in the first syntax tree store the corresponding relationship between Filed1 and name, and the Filed1 is converted to name. In the present application, the form of the first syntax tree is not limited, and the first transaction processing request may be generated, and any form from the implementation of the DML request to the first transaction processing request may be used.

步骤304中,一种可能的实现方式中,可以监听所述OLTP数据库管理系统的事务处理日志,并获取步骤303执行后OLTP数据库管理系统的事务处理日志中的变更日志,将变更日志作为所述OLTP数据库管理系统响应于所述第一事务处理请求生成的事务处理日志;还可以OLTP数据库管理系统在响应所述第一事务处理请求成功后,接收OLTP数据库管理系统发送的相应事务处理日志,在此不做限定。In step 304, in a possible implementation, the transaction log of the OLTP database management system can be monitored, and the change log in the transaction log of the OLTP database management system after step 303 is executed is obtained, and the change log is used as the The transaction processing log generated by the OLTP database management system in response to the first transaction processing request; it is also possible that the OLTP database management system receives the corresponding transaction processing log sent by the OLTP database management system after successfully responding to the first transaction processing request. This is not limited.

由于OLTP数据库管理系统满足事务性,即原子性、一致性、隔离性和持久性(Aomicity/Consistency/Isolation/Durability,ACID)。因此,若步骤304执行成功,说明OLTP数据库管理系统必然已经执行成功,即OLTP数据库已经按照第一事务处理请求的预期进行了数据操作。即便304执行失败,OLTP数据库也可以回滚到步骤303的状态重新执行,不会造成数据污染。因此,先发送第一事务处理请求,再发送第二事务处理请求,可以增加数据操作的容错性。Because the OLTP database management system satisfies transactionality, that is, atomicity, consistency, isolation and persistence (Aomicity/Consistency/Isolation/Durability, ACID). Therefore, if step 304 is executed successfully, it means that the OLTP database management system must have executed successfully, that is, the OLTP database has performed data operations as expected in the first transaction processing request. Even if the execution of step 304 fails, the OLTP database can be rolled back to the state of step 303 and executed again without causing data pollution. Therefore, sending the first transaction processing request first, and then sending the second transaction processing request can increase the fault tolerance of the data operation.

步骤305的一种可能的实施方式,第二事务处理请求为单个混合型事务处理请求,步骤305具体可以按照以下方式执行:In a possible implementation manner of step 305, the second transaction processing request is a single hybrid transaction processing request, and step 305 can be specifically performed in the following manner:

根据事务处理日志,生成用于OLAP数据库管理系统的单个混合型事务处理请求。From the transaction log, generate a single mixed transaction request for the OLAP database management system.

混合型事务处理请求用于请求对OLAP数据库中的目标数据进行至少一种类型的数据操作,举例来说,至少一种类型的数据操作可以为:数据插入操作、数据删除操作以及数据修改操作中的至少一项。The mixed transaction processing request is used to request at least one type of data operation on the target data in the OLAP database. For example, at least one type of data operation can be: data insertion operation, data deletion operation, and data modification operation at least one of the .

步骤305的另一种可能的实施方式,第二事务处理请求为至少一个单类型事务处理请求,步骤305具体可以按照以下方式执行:In another possible implementation manner of step 305, the second transaction processing request is at least one single-type transaction processing request, and step 305 may be specifically performed in the following manner:

根据事务处理日志,生成用于OLAP数据库管理系统的至少一个单类型事务处理请求。Based on the transaction log, at least one single-type transaction processing request for the OLAP database management system is generated.

其中,任一单类型事务处理请求用于请求对OLAP数据库中的目标数据进行一种类型的数据操作,任一单类型事务处理请求的数据操作可以为:数据插入操作、数据删除操作以及数据修改操作中的任意一项。Among them, any single-type transaction processing request is used to request a type of data operation on the target data in the OLAP database, and the data operation of any single-type transaction processing request can be: data insertion operation, data deletion operation and data modification any of the operations.

若采用图1示出的系统架构,服务端200采用图2示出的架构,处理DML请求的具体交互流程可以如图4所示。If the system architecture shown in FIG. 1 is adopted, and the server 200 adopts the architecture shown in FIG. 2 , the specific interaction process for processing a DML request may be shown in FIG. 4 .

步骤401:用户端100发送DML请求至服务端200的处理请求解析器2011。Step 401 : the client 100 sends a DML request to the processing request parser 2011 of the server 200 .

步骤402:服务端200的处理请求解析器2011对DML请求进行语法解析,获得DML请求对应的第一语法树。Step 402: The processing request parser 2011 of the server 200 parses the DML request to obtain a first syntax tree corresponding to the DML request.

步骤403:服务端200的处理请求解析器2011将第一语法树发送至服务端200的处理请求翻译器2012。Step 403 : the processing request parser 2011 of the server 200 sends the first syntax tree to the processing request translator 2012 of the server 200 .

步骤404:服务端200的处理请求翻译器2012根据第一语法树中的节点对应的SQL关键字生成第一事务处理请求。Step 404: The processing request translator 2012 of the server 200 generates a first transaction processing request according to the SQL keywords corresponding to the nodes in the first syntax tree.

步骤405:服务端200的处理请求翻译器2012将第一事务处理请求发送给服务端200的事务处理执行器202。Step 405 : the processing request translator 2012 of the server 200 sends the first transaction processing request to the transaction executor 202 of the server 200 .

步骤406:服务端200的事务处理执行器202将第一事务处理请求发送给存储端300中的OLTP数据库管理系统。Step 406 : the transaction executor 202 of the server 200 sends the first transaction request to the OLTP database management system in the storage 300 .

步骤407:OLTP数据库管理系统执行第一事务处理请求。Step 407: The OLTP database management system executes the first transaction processing request.

步骤408:OLTP数据库管理系统将第一事务处理请求的执行结果发送至服务端200的事务处理执行器202。Step 408 : The OLTP database management system sends the execution result of the first transaction processing request to the transaction processing executor 202 of the server 200 .

步骤409:服务端200的事务处理执行器202根据第一事务处理请求的执行结果,确定第一事务处理请求是否执行成功。Step 409: The transaction executor 202 of the server 200 determines whether the first transaction request is executed successfully according to the execution result of the first transaction request.

若执行不成功,则执行步骤410;否则,执行步骤411。If the execution is unsuccessful, go to step 410; otherwise, go to step 411.

步骤410:服务端200的事务处理执行器202将执行失败消息返回给用户100。Step 410: The transaction executor 202 of the server 200 returns an execution failure message to the user 100.

步骤411:服务端200的事务处理执行器202将第一事务处理请求的执行结果返回给用户100。Step 411 : the transaction executor 202 of the server 200 returns the execution result of the first transaction request to the user 100 .

步骤412:OLTP数据库管理系统根据第一事务处理请求的执行结果,生成第一事务处理请求对应的事务处理日志。Step 412: The OLTP database management system generates a transaction processing log corresponding to the first transaction processing request according to the execution result of the first transaction processing request.

步骤413:OLTP数据库管理系统将第一事务处理请求对应的事务处理日志发送至服务端200的数据同步器203。Step 413 : the OLTP database management system sends the transaction processing log corresponding to the first transaction processing request to the data synchronizer 203 of the server 200 .

步骤414:服务端200的数据同步器203根据事务处理日志,生成用于OLAP数据库管理系统的第二事务处理请求。Step 414: The data synchronizer 203 of the server 200 generates a second transaction processing request for the OLAP database management system according to the transaction processing log.

步骤415:服务端200的数据同步器203将第二事务处理请求发送至服务端200的事务处理执行器202。Step 415 : the data synchronizer 203 of the server 200 sends the second transaction processing request to the transaction executor 202 of the server 200 .

步骤416:服务端200的事务处理执行器202向OLAP数据库管理系统发送第二事务处理请求。Step 416: The transaction executor 202 of the server 200 sends a second transaction request to the OLAP database management system.

步骤417:OLAP数据库管理系统执行第二事务处理请求。Step 417: The OLAP database management system executes the second transaction processing request.

DQL请求的处理方法:The processing method of DQL request:

步骤307的一种可能的实施方式可以如下:A possible implementation manner of step 307 may be as follows:

获取执行信息集合,若所述执行信息集合中存在第一执行信息,则从所述第一执行信息中获取事务处理请求。An execution information set is acquired, and if first execution information exists in the execution information set, a transaction processing request is acquired from the first execution information.

所述执行信息集合中包括至少一个执行信息,任一执行信息包括DQL请求以及对应的事务处理请求,所述第一执行信息中包括接收到的所述DQL请求。The execution information set includes at least one execution information, any execution information includes a DQL request and a corresponding transaction processing request, and the first execution information includes the received DQL request.

若所述执行信息集合中存在第一执行信息,在采用图1示出的系统架构且服务端200采用图2示出的架构时,可以按照图5示出的交互流程对DQL请求进行处理:If the first execution information exists in the execution information set, when the system architecture shown in FIG. 1 is adopted and the server 200 adopts the architecture shown in FIG. 2, the DQL request can be processed according to the interaction process shown in FIG. 5:

步骤501:用户100发送DQL请求至服务端200的处理请求解析器2011。Step 501 : the user 100 sends a DQL request to the processing request resolver 2011 of the server 200 .

步骤502:服务端200的处理请求解析器2011确定执行信息集合中存在第一执行信息。Step 502: The processing request parser 2011 of the server 200 determines that the first execution information exists in the execution information set.

步骤503:服务端200的处理请求解析器2011将第一执行信息中的事务处理请求发送至服务端200的事务处理执行器202。Step 503 : the processing request parser 2011 of the server 200 sends the transaction processing request in the first execution information to the transaction processing executor 202 of the server 200 .

若第一执行信息中DQL请求对应的事务处理请求为第一事务处理请求,则执行步骤504~步骤506;否则,若第一执行信息中DQL请求对应的事务处理请求为第二事务处理请求,执行步骤507~步骤509。If the transaction processing request corresponding to the DQL request in the first execution information is the first transaction processing request, execute steps 504 to 506; otherwise, if the transaction processing request corresponding to the DQL request in the first execution information is the second transaction processing request, Execute steps 507 to 509.

DQL请求的处理方法中,第一事务处理请求用于请求查询OLTP数据库中存储的目标数据,第二事务处理请求用于请求查询OLAP数据库中存储的目标数据。In the processing method of the DQL request, the first transaction processing request is used to request to query the target data stored in the OLTP database, and the second transaction processing request is used to request to query the target data stored in the OLAP database.

步骤504:服务端200的事务处理执行器202发送第一事务处理请求至OLTP数据库管理系统。Step 504: The transaction executor 202 of the server 200 sends a first transaction request to the OLTP database management system.

步骤505:OLTP数据库管理系统执行第一事务处理请求。Step 505: The OLTP database management system executes the first transaction processing request.

步骤506:OLTP数据库管理系统将第一事务处理请求的执行结果发送至服务端200的事务处理执行器202。Step 506 : The OLTP database management system sends the execution result of the first transaction processing request to the transaction processing executor 202 of the server 200 .

步骤507:服务端200的事务处理执行器202发送第二事务处理请求至OLAP数据库管理系统。Step 507: The transaction executor 202 of the server 200 sends a second transaction request to the OLAP database management system.

步骤508:OLAP数据库管理系统执行第二事务处理请求。Step 508: the OLAP database management system executes the second transaction processing request.

步骤509:OLAP数据库管理系统将第二事务处理请求的执行结果发送至服务端200的事务处理执行器202。Step 509 : The OLAP database management system sends the execution result of the second transaction processing request to the transaction executor 202 of the server 200 .

若所述执行信息集合中不存在所述第一执行信息,还可以按照如下方式处理DQL请求:If the first execution information does not exist in the execution information set, the DQL request may also be processed in the following manner:

确定所述DQL请求的查询类型;确定所述DQL请求的查询类型匹配的数据库管理系统;根据所述DQL请求,生成所述匹配的数据库管理系统对应的事务处理请求,并将该事务处理请求发送至所述匹配的数据库管理系统。Determine the query type of the DQL request; determine the database management system that matches the query type of the DQL request; generate a transaction processing request corresponding to the matching database management system according to the DQL request, and send the transaction processing request to the matching database management system.

举例来说,所述DQL请求的查询类型可以包括联合查询、条件查询和分组查询等,可以根据数据库管理系统的特性,预设每种查询类型对应的数据库管理系统,如分组查询对应OLAP数据库管理系统,这是因为分组查询中,会统计数据表中大批量数据记录的列。对查询结果集进行分组,而OLAP数据库管理系统中含有较多索引且采用并行技术,那么采用OLAP数据库管理系统执行相应的事务处理请求,可以使得事务处理执行过程的性能更高。For example, the query type of the DQL request may include joint query, conditional query and group query, etc., and the database management system corresponding to each query type may be preset according to the characteristics of the database management system, such as group query corresponding to OLAP database management System, this is because in the group query, the columns of a large number of data records in the data table will be counted. Group the query result set, and the OLAP database management system contains many indexes and adopts parallel technology, then using the OLAP database management system to execute the corresponding transaction processing request can make the performance of the transaction processing execution process higher.

一种可能的实现方式中,生成所述匹配的数据库管理系统对应的事务处理请求的步骤具体可以如下:In a possible implementation manner, the step of generating the transaction processing request corresponding to the matching database management system may specifically be as follows:

对所述DQL请求进行语法解析,获得所述DQL请求对应的第二语法树,所述第二语法树包括至少一个节点,所述至少一个节点中的任意一个节点用于存储DQL指令关键字与结构化查询语言SQL指令关键字之间的对应关系;根据所述第二语法树中的节点对应的SQL关键字生成所述第二事务处理请求。Perform grammatical analysis on the DQL request to obtain a second grammatical tree corresponding to the DQL request, the second grammatical tree includes at least one node, and any node in the at least one node is used to store the DQL instruction keyword and Correspondence between structured query language SQL instruction keywords; generating the second transaction processing request according to the SQL keywords corresponding to the nodes in the second syntax tree.

上述生成所述第二事务处理请求的过程实质与生成所述第一事务处理请求的过程相同,可以参照生成所述第一事务处理请求的描述,在此不再赘述。The above process of generating the second transaction processing request is substantially the same as the process of generating the first transaction processing request, and reference may be made to the description of generating the first transaction processing request, which will not be repeated here.

对于执行信息集合中不存在所述第一执行信息的情形,对DQL请求进行处理的实施方式还可以有多种,如可以预设事务处理请求对应的数据库管理系统为OLAP数据库管理系统,随机选取一个数据库管理系统等。For the situation where the first execution information does not exist in the execution information set, there may be multiple implementations for processing the DQL request. For example, the database management system corresponding to the transaction processing request can be preset as an OLAP database management system, and randomly selected A database management system, etc.

对于执行信息集合中不存在第一执行信息的情形,若采用图1示出的系统架构,且采用图2示出的服务端200,图2示出的服务端200还可以设置语义分析器2014,可以按照图6示出的交互流程对DQL请求进行处理:For the situation where the first execution information does not exist in the execution information set, if the system architecture shown in FIG. 1 is adopted, and the server 200 shown in FIG. 2 is used, the server 200 shown in FIG. 2 can also be provided with a semantic analyzer 2014 , the DQL request can be processed according to the interaction process shown in Figure 6:

步骤601:用户100发送DQL请求至服务端200的处理请求解析器2011。Step 601 : the user 100 sends a DQL request to the processing request resolver 2011 of the server 200 .

步骤602:服务端200的处理请求解析器2011确定执行信息集合中不存在第一执行信息。Step 602: The processing request resolver 2011 of the server 200 determines that the first execution information does not exist in the execution information set.

步骤603:服务端200的处理请求解析器2011发送DQL请求至服务端200的语义分析器2014。Step 603 : the processing request parser 2011 of the server 200 sends the DQL request to the semantic analyzer 2014 of the server 200 .

步骤604:服务端200的语义分析器2014确定DQL请求的查询类型,以及确定DQL请求的查询类型匹配的数据库管理系统。Step 604: The semantic analyzer 2014 of the server 200 determines the query type of the DQL request, and determines the database management system that matches the query type of the DQL request.

若匹配的数据库管理系统为OLTP数据库管理系统,执行步骤605~步骤609;若匹配的数据库管理系统为OLAP数据库管理系统,执行步骤610~步骤614。If the matched database management system is an OLTP database management system, execute steps 605 to 609; if the matched database management system is an OLAP database management system, execute steps 610 to 614.

步骤605:服务端200的处理请求翻译器2012根据所述DQL请求,生成OLTP数据库管理系统对应的第一事务处理请求。Step 605: The processing request translator 2012 of the server 200 generates a first transaction processing request corresponding to the OLTP database management system according to the DQL request.

步骤606:服务端200的处理请求翻译器2012将第一事务处理请求发送至服务端200的事务处理执行器202。Step 606 : the processing request translator 2012 of the server 200 sends the first transaction request to the transaction executor 202 of the server 200 .

步骤607:服务端200的事务处理执行器202发送第一事务处理请求至OLTP数据库管理系统。Step 607: The transaction executor 202 of the server 200 sends the first transaction request to the OLTP database management system.

步骤608:OLTP数据库管理系统执行第一事务处理请求。Step 608: The OLTP database management system executes the first transaction processing request.

步骤609:OLTP数据库管理系统将第一事务处理请求的执行结果发送至服务端200的事务处理执行器202。Step 609 : The OLTP database management system sends the execution result of the first transaction processing request to the transaction processing executor 202 of the server 200 .

步骤610:服务端200的处理请求翻译器2012根据所述DQL请求,生成OLAP数据库管理系统对应的第二事务处理请求。Step 610: The processing request translator 2012 of the server 200 generates a second transaction processing request corresponding to the OLAP database management system according to the DQL request.

步骤611:服务端200的处理请求翻译器2012将第二事务处理请求发送至服务端200的事务处理执行器202。Step 611 : the processing request translator 2012 of the server 200 sends the second transaction request to the transaction executor 202 of the server 200 .

步骤612:服务端200的事务处理执行器202发送第二事务处理请求至OLAP数据库管理系统。Step 612: The transaction executor 202 of the server 200 sends a second transaction request to the OLAP database management system.

步骤613:OLAP数据库管理系统执行第二事务处理请求。Step 613: the OLAP database management system executes the second transaction processing request.

步骤614:OLAP数据库管理系统将第二事务处理请求的执行结果发送至服务端200的事务处理执行器202。Step 614 : The OLAP database management system sends the execution result of the second transaction processing request to the transaction processing executor 202 of the server 200 .

需要说明的是,对于所述执行信息集合中不存在所述第一执行信息的情形,还可以按照以下步骤生成所述DQL请求的执行信息:It should be noted that, for the situation that the first execution information does not exist in the execution information set, the execution information of the DQL request may also be generated according to the following steps:

步骤(1):根据所述DQL请求,生成所述OLTP数据库管理系统的所述第一事务处理请求,以及所述OLAP数据库管理系统的所述第二事务处理请求。Step (1): Generate the first transaction processing request of the OLTP database management system and the second transaction processing request of the OLAP database management system according to the DQL request.

步骤(2):向所述OLTP数据库管理系统发送所述第一事务处理请求,确定所述第一事务处理请求相应事务处理操作执行过程的第一性能指标,向所述OLAP数据库管理系统发送所述第二事务处理请求,确定所述第二事务处理请求相应事务处理操作执行过程的第二性能指标。Step (2): Send the first transaction processing request to the OLTP database management system, determine the first performance index of the execution process of the transaction processing operation corresponding to the first transaction processing request, and send the first transaction processing request to the OLAP database management system The second transaction processing request is used to determine a second performance indicator of a transaction processing operation execution process corresponding to the second transaction processing request.

步骤(3):将所述第一性能指标和所述第二性能指标中最高性能指标对应的事务处理请求作为所述DQL请求对应的事务处理请求。Step (3): taking the transaction processing request corresponding to the highest performance index among the first performance index and the second performance index as the transaction processing request corresponding to the DQL request.

步骤(4):根据所述DQL请求以及所述DQL请求对应的事务处理请求,生成所述DQL请求的执行信息。Step (4): Generate execution information of the DQL request according to the DQL request and the transaction processing request corresponding to the DQL request.

步骤(1)~步骤(4)中的性能指标在此不做限定。举例来说,可以为事务处理操作执行过程的执行时长、内存占用量等。The performance indicators in steps (1) to (4) are not limited here. For example, it may be the execution time, memory usage, etc. of the execution process of the transaction processing operation.

第一性能指标和第二性能指标可以按照如下方式得到:The first performance index and the second performance index can be obtained in the following manner:

创建第一进程与第二进程;执行第一进程与第二进程。Create a first process and a second process; execute the first process and the second process.

其中,第一事务处理请求对应第一进程,所述第一进程创建了所述OLTP数据库管理系统的第一基于成本优化(Cost-Based Optimization,CBO)请求,所述第一CBO请求用于获得第一CBO结果,所述第一CBO结果为所述第一性能指标;所述第二事务处理请求对应第二进程,所述第二进程创建了所述OLAP数据库管理系统的第二CBO请求,所述第二CBO请求用于获得第二CBO结果,所述第二CBO结果为所述第二性能指标。Wherein, the first transaction processing request corresponds to a first process, and the first process creates a first cost-based optimization (Cost-Based Optimization, CBO) request of the OLTP database management system, and the first CBO request is used to obtain The first CBO result, the first CBO result is the first performance indicator; the second transaction processing request corresponds to a second process, and the second process creates a second CBO request of the OLAP database management system, The second CBO request is used to obtain a second CBO result, where the second CBO result is the second performance indicator.

需要说明的是,所述第一进程与所述第二进程的执行并无先后约束关系,可以并行执行,也可以异步执行。当所述第一进程与所述第二进程并行执行时,从而使得两个性能指标的测试时长重叠,减少了性能指标测试的总时长。It should be noted that, the execution of the first process and the second process has no sequence constraint relationship, and may be executed in parallel or asynchronously. When the first process and the second process are executed in parallel, the test durations of the two performance indicators overlap, reducing the total test duration of the performance indicators.

对于所述执行信息集合中不存在所述第一执行信息的情形,若采用图1示出的系统架构,服务端200采用图2示出的架构,可以按照图7示出的交互流程获得DQL请求的执行信息:For the situation where the first execution information does not exist in the execution information set, if the system architecture shown in FIG. 1 is adopted, the server 200 adopts the architecture shown in FIG. 2 , and the DQL can be obtained according to the interaction process shown in FIG. 7 Requested execution information:

步骤701:用户100发送DQL请求至服务端200的处理请求解析器2011。Step 701 : the user 100 sends a DQL request to the processing request resolver 2011 of the server 200 .

步骤702:服务端200的处理请求解析器2011将DQL请求发送至服务端200的处理请求翻译器2012。Step 702 : the processing request parser 2011 of the server 200 sends the DQL request to the processing request translator 2012 of the server 200 .

步骤703:服务端200的处理请求翻译器2012根据DQL请求生成OLTP数据库管理系统对应的第一事务处理请求以及OLAP数据库管理系统对应的第二事务处理请求。Step 703: The processing request translator 2012 of the server 200 generates a first transaction processing request corresponding to the OLTP database management system and a second transaction processing request corresponding to the OLAP database management system according to the DQL request.

步骤704:服务端200的处理请求翻译器2012将第一事务处理请求和第二事务处理请求发送至服务端200的执行优化器204。Step 704 : the processing request translator 2012 of the server 200 sends the first transaction processing request and the second transaction processing request to the execution optimizer 204 of the server 200 .

步骤705:服务端200的执行优化器204创建第一事务处理请求的第一CBO请求,以及第二事务处理请求的第二CBO请求。Step 705: The execution optimizer 204 of the server 200 creates a first CBO request of the first transaction processing request, and a second CBO request of the second transaction processing request.

步骤706:服务端200的执行优化器204发送第一事务处理请求以及第一CBO请求至OLTP数据库管理系统。Step 706: The execution optimizer 204 of the server 200 sends the first transaction processing request and the first CBO request to the OLTP database management system.

步骤707:OLTP数据库管理系统执行第一事务处理请求以及第一CBO请求,获得第一CBO结果。Step 707: The OLTP database management system executes the first transaction processing request and the first CBO request, and obtains the first CBO result.

步骤708:OLTP数据库管理系统将第一CBO结果发送至服务端200的执行优化器204。Step 708 : The OLTP database management system sends the first CBO result to the execution optimizer 204 of the server 200 .

步骤709:服务端200的执行优化器204发送第二事务处理请求以及第二CBO请求至OLAP数据库管理系统。Step 709: The execution optimizer 204 of the server 200 sends the second transaction processing request and the second CBO request to the OLAP database management system.

步骤710:OLAP数据库管理系统执行第二事务处理请求以及第二CBO请求,获得第二CBO结果。Step 710: The OLAP database management system executes the second transaction processing request and the second CBO request, and obtains the second CBO result.

步骤711:OLTP数据库管理系统将第二CBO结果发送至服务端200的执行优化器204。Step 711 : The OLTP database management system sends the second CBO result to the execution optimizer 204 of the server 200 .

需要说明的是,步骤706~步骤708与步骤709~步骤711之间的执行顺序并无约束关系,步骤706~步骤708也可以与步骤709~步骤711并行执行。It should be noted that there is no restriction on the execution order of steps 706 to 708 and steps 709 to 711 , and steps 706 to 708 may also be executed in parallel with steps 709 to 711 .

步骤712:服务端200的执行优化器204将第一CBO结果和第二CBO结果中最高性能CBO结果对应的事务处理请求作为DQL请求对应的事务处理请求,并生成所述DQL请求的执行信息。Step 712: The execution optimizer 204 of the server 200 takes the transaction processing request corresponding to the highest performance CBO result among the first CBO result and the second CBO result as the transaction processing request corresponding to the DQL request, and generates execution information of the DQL request.

步骤713:服务端200的执行优化器204将所述DQL请求的执行信息发送至服务端200的执行信息缓存2013。Step 713 : the execution optimizer 204 of the server 200 sends the execution information of the DQL request to the execution information cache 2013 of the server 200 .

如图8所示,本申请实施例提供一种数据处理装置。当图8示出的装置用于处理DML请求时,该装置的各模块具体用于:As shown in FIG. 8 , an embodiment of the present application provides a data processing device. When the device shown in Figure 8 is used to process the DML request, each module of the device is specifically used for:

获取模块801,用于接收数据操作语言DML请求,所述DML请求用于请求对目标数据进行操作,所述DML请求与数据库类型无关;An acquisition module 801, configured to receive a data manipulation language DML request, the DML request is used to request an operation on the target data, and the DML request has nothing to do with the database type;

处理模块802,用于根据所述DML请求,生成用于OLTP数据库管理系统的第一事务处理请求,所述第一事务处理请求用于请求对OLTP数据库中的所述目标数据进行操作;A processing module 802, configured to generate a first transaction processing request for an OLTP database management system according to the DML request, where the first transaction processing request is used to request to operate on the target data in the OLTP database;

发送模块803,用于向所述OLTP数据库管理系统发送所述第一事务处理请求;A sending module 803, configured to send the first transaction processing request to the OLTP database management system;

所述获取模块801,还用于获取所述OLTP数据库管理系统响应于所述第一事务处理请求生成的事务处理日志,所述事务处理日志包括所述OLTP数据库管理系统对所述目标数据进行操作的信息;The obtaining module 801 is further configured to obtain a transaction processing log generated by the OLTP database management system in response to the first transaction processing request, and the transaction processing log includes operations performed by the OLTP database management system on the target data Information;

所述处理模块802,用于根据所述事务处理日志,生成用于OLAP数据库管理系统的第二事务处理请求,所述第二事务处理请求用于请求对OLAP数据库中的所述目标数据进行操作;The processing module 802 is configured to generate a second transaction processing request for the OLAP database management system according to the transaction processing log, and the second transaction processing request is used to request to operate on the target data in the OLAP database ;

所述发送模块803,用于向所述OLAP数据库管理系统发送所述第二事务处理请求。The sending module 803 is configured to send the second transaction processing request to the OLAP database management system.

在一种可能的设计中,所述处理模块802具体用于:In a possible design, the processing module 802 is specifically configured to:

对所述DML请求进行语法解析,获得所述DML请求对应的第一语法树,所述第一语法树包括至少一个节点,所述至少一个节点中的任意一个节点用于存储DML指令关键字与结构化查询语言SQL指令关键字之间的对应关系;根据所述第一语法树中的节点对应的SQL关键字生成所述第一事务处理请求。Perform grammatical analysis on the DML request to obtain a first grammatical tree corresponding to the DML request, the first grammatical tree includes at least one node, and any node in the at least one node is used to store the DML instruction keyword and Correspondence between structured query language SQL instruction keywords; generating the first transaction processing request according to the SQL keywords corresponding to the nodes in the first syntax tree.

在一种可能的设计中,所述第二事务处理请求为单个混合型事务处理请求,所述处理模块802具体用于:In a possible design, the second transaction processing request is a single mixed transaction processing request, and the processing module 802 is specifically configured to:

根据所述事务处理日志,生成用于所述OLAP数据库管理系统的单个混合型事务处理请求,所述混合型事务处理请求用于请求对所述OLAP数据库中的所述目标数据进行至少一种类型的数据操作。According to the transaction processing log, a single mixed transaction processing request for the OLAP database management system is generated, and the mixed type transaction processing request is used to request at least one type of processing of the target data in the OLAP database data manipulation.

在一种可能的设计中,所述第二事务处理请求为至少一个单类型事务处理请求,所述处理模块802具体用于:In a possible design, the second transaction processing request is at least one single-type transaction processing request, and the processing module 802 is specifically configured to:

根据所述事务处理日志,生成用于所述OLAP数据库管理系统的至少一个单类型事务处理请求,任一单类型事务处理请求用于请求对所述OLAP数据库中的所述目标数据进行一种类型的数据操作。According to the transaction processing log, generate at least one single-type transaction processing request for the OLAP database management system, any single-type transaction processing request is used to request one type of the target data in the OLAP database data manipulation.

当图8示出的装置用于处理DQL请求时,该装置的各模块具体用于:When the device shown in Figure 8 is used for processing DQL requests, each module of the device is specifically used for:

获取模块801,用于接收数据查询语言DQL请求,所述DQL请求用于请求查询目标数据,所述DQL请求与数据库类型无关;The acquisition module 801 is configured to receive a data query language DQL request, the DQL request is used to request query target data, and the DQL request has nothing to do with the database type;

以及用于根据所述DQL请求,获取对应的事务处理请求,所述事务处理请求包括用于OLTP数据库管理系统的第一事务处理请求或用于OLAP数据库管理系统的第二事务处理请求,所述第一事务处理请求用于请求查询OLTP数据库中存储的所述目标数据,所述第二事务处理请求用于请求查询OLAP数据库中存储的所述目标数据;And for obtaining a corresponding transaction processing request according to the DQL request, the transaction processing request includes a first transaction processing request for an OLTP database management system or a second transaction processing request for an OLAP database management system, the The first transaction processing request is used to request to query the target data stored in the OLTP database, and the second transaction processing request is used to request to query the target data stored in the OLAP database;

发送模块803,用于向所述事务处理请求对应的数据库管理系统发送所述事务处理请求。The sending module 803 is configured to send the transaction processing request to the database management system corresponding to the transaction processing request.

在一种可能的设计中,所述获取模块801具体用于:In a possible design, the acquiring module 801 is specifically configured to:

获取执行信息集合,所述执行信息集合中包括至少一个执行信息,任一执行信息包括DQL请求以及对应的事务处理请求;若所述执行信息集合中存在第一执行信息,所述第一执行信息中包括接收到的所述DQL请求,则从所述第一执行信息中获取事务处理请求。Obtain an execution information set, the execution information set includes at least one execution information, and any execution information includes a DQL request and a corresponding transaction processing request; if there is first execution information in the execution information set, the first execution information If the received DQL request is included in the received DQL request, then the transaction processing request is obtained from the first execution information.

在一种可能的设计中,所述装置还包括处理模块802,若所述执行信息集合中不存在所述第一执行信息,则所述处理模块802具体用于:In a possible design, the device further includes a processing module 802. If the first execution information does not exist in the execution information set, the processing module 802 is specifically configured to:

根据所述DQL请求,生成所述OLTP数据库管理系统的所述第一事务处理请求,以及所述OLAP数据库管理系统的所述第二事务处理请求;向所述OLTP数据库管理系统发送所述第一事务处理请求,确定所述第一事务处理请求相应事务处理操作执行过程的第一性能指标,向所述OLAP数据库管理系统发送所述第二事务处理请求,确定所述第二事务处理请求相应事务处理操作执行过程的第二性能指标;将所述第一性能指标和所述第二性能指标中最高性能指标对应的事务处理请求作为所述DQL请求对应的事务处理请求;根据所述DQL请求以及所述DQL请求对应的事务处理请求,生成所述DQL请求的执行信息。According to the DQL request, generate the first transaction processing request of the OLTP database management system, and the second transaction processing request of the OLAP database management system; send the first transaction processing request to the OLTP database management system A transaction processing request, determining a first performance index of a transaction processing operation execution process corresponding to the first transaction processing request, sending the second transaction processing request to the OLAP database management system, and determining a transaction corresponding to the second transaction processing request Processing the second performance index of the operation execution process; using the transaction processing request corresponding to the highest performance index among the first performance index and the second performance index as the transaction processing request corresponding to the DQL request; according to the DQL request and The transaction processing request corresponding to the DQL request generates execution information of the DQL request.

在一种可能的设计中,所述第一事务处理请求对应第一进程,所述第一进程创建了所述OLTP数据库管理系统的第一基于成本优化CBO请求,所述第一CBO请求用于获得第一CBO结果,所述第一CBO结果为所述第一性能指标;所述第二事务处理请求对应第二进程,所述第二进程创建了所述OLAP数据库管理系统的第二CBO请求,所述第二CBO请求用于获得第二CBO结果,所述第二CBO结果为所述第二性能指标;所述第一进程与所述第二进程并行执行。In a possible design, the first transaction processing request corresponds to a first process, and the first process creates a first cost-optimized CBO request of the OLTP database management system, and the first CBO request is used for Obtain a first CBO result, the first CBO result being the first performance index; the second transaction processing request corresponds to a second process, and the second process creates a second CBO request of the OLAP database management system , the second CBO request is used to obtain a second CBO result, where the second CBO result is the second performance indicator; the first process and the second process are executed in parallel.

在一种可能的设计中,所述装置还包括处理模块802,若所述执行信息集合中不存在所述第一执行信息,则所述处理模块802还用于:In a possible design, the device further includes a processing module 802, and if the first execution information does not exist in the execution information set, the processing module 802 is further configured to:

确定所述DQL请求的查询类型;确定所述DQL请求的查询类型匹配的数据库管理系统,所述匹配的数据库管理系统为所述OLTP数据库管理系统或所述OLAP数据库管理系统;根据所述DQL请求,生成所述匹配的数据库管理系统对应的事务处理请求;Determine the query type of the DQL request; determine the database management system matching the query type of the DQL request, the matching database management system is the OLTP database management system or the OLAP database management system; according to the DQL request , generating a transaction processing request corresponding to the matching database management system;

所述发送模块803还用于:The sending module 803 is also used for:

将该事务处理请求发送至所述匹配的数据库管理系统。The transaction processing request is sent to the matching database management system.

在一种可能的设计中,所述处理模块802具体用于:In a possible design, the processing module 802 is specifically configured to:

对所述目标DQL请求进行语法解析,获得所述DQL请求对应的第二语法树,所述第二语法树包括至少一个节点,所述至少一个节点中的任意一个节点用于存储DQL指令关键字与结构化查询语言SQL指令关键字之间的对应关系;根据所述第二语法树中的节点对应的SQL关键字生成所述第二事务处理请求。Perform grammatical analysis on the target DQL request to obtain a second grammatical tree corresponding to the DQL request, the second grammatical tree includes at least one node, and any node in the at least one node is used to store the DQL instruction keyword Correspondence with structured query language SQL instruction keywords; generate the second transaction processing request according to the SQL keywords corresponding to the nodes in the second syntax tree.

本申请实施例还提供一种电子设备,该电子设备可以具有如图9所示的结构,该电子设备可以是计算机设备,也可以是能够支持计算机设备实现上述方法的芯片或芯片系统。The embodiment of the present application also provides an electronic device. The electronic device may have the structure shown in FIG. 9 . The electronic device may be a computer device, or may be a chip or a chip system capable of supporting the computer device to implement the above method.

如图9所示的电子设备可以包括至少一个处理器901,所述至少一个处理器901用于与存储器耦合,读取并执行所述存储器中的指令以实现本申请实施例提供的数据处理的步骤。可选的,该电子设备还可以包括通信接口902,用于支持该电子设备进行信令或者数据的接收或发送。电子设备中的通信接口902,可用于实现与其他电子设备的进行交互。处理器901可用于实现电子设备执行数据处理的步骤。可选的,该电子设备通还可以包括存储器903,其中存储有计算机指令,存储器903可以与处理器901和/或通信接口902耦合,用于支持处理器901调用存储器903中的计算机指令以实现数据处理的步骤;另外,存储器903还可以用于存储本申请方法实施例所涉及的数据,例如,用于存储支持通信接口902实现交互所必须的数据、指令,和/或,用于存储电子设备执行本申请实施例所述方法所必须的配置信息。The electronic device shown in FIG. 9 may include at least one processor 901, and the at least one processor 901 is used to be coupled with a memory, read and execute instructions in the memory to implement the data processing provided by the embodiment of the present application. step. Optionally, the electronic device may further include a communication interface 902, configured to support the electronic device in receiving or sending signaling or data. The communication interface 902 in the electronic device can be used to realize interaction with other electronic devices. The processor 901 may be used to implement the steps of electronic equipment performing data processing. Optionally, the electronic device may also include a memory 903, in which computer instructions are stored, and the memory 903 may be coupled with the processor 901 and/or the communication interface 902, and is used to support the processor 901 to call the computer instructions in the memory 903 to implement Steps of data processing; in addition, the memory 903 can also be used to store the data involved in the method embodiment of the present application, for example, to store the data and instructions necessary to support the communication interface 902 to realize interaction, and/or to store the electronic Configuration information necessary for the device to execute the method described in the embodiment of the present application.

本申请实施例还提供了一种计算机可读存储介质,计算机可读存储介质上存储有计算机指令,这些计算机指令被计算机调用执行时,可以使得计算机完成上述方法实施例、方法实施例的任意一种可能的设计中所涉及的方法。本申请实施例中,对计算机可读存储介质不做限定,例如,可以是RAM(random-access memory,随机存取存储器)、ROM(read-only memory,只读存储器)等。The embodiment of the present application also provides a computer-readable storage medium. Computer instructions are stored on the computer-readable storage medium. When these computer instructions are called and executed by a computer, the computer can complete any one of the above-mentioned method embodiments and method embodiments. methods involved in a possible design. In this embodiment of the present application, the computer-readable storage medium is not limited, for example, it may be RAM (random-access memory, random access memory), ROM (read-only memory, read-only memory), and the like.

本申请还提供一种芯片,该芯片可以包括处理器以及接口电路,用于完成上述方法实施例、方法实施例的任意一种可能的实现方式中所涉及的方法,其中,“耦合”是指两个部件彼此直接或间接地结合,这种结合可以是固定的或可移动性的。The present application also provides a chip, which may include a processor and an interface circuit, for completing the methods involved in any of the above method embodiments and any possible implementation of the method embodiments, wherein "coupling" means Two parts are directly or indirectly coupled to each other, and this coupling can be fixed or movable.

在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机指令的形式实现。在计算机上加载和执行所述计算机指令时,全部或部分地产生按照本发明实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤)或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如固态硬盘(Solid State Disk,SSD))等。In the above embodiments, all or part of them may be implemented by software, hardware, firmware or any combination thereof. When implemented in software, it may be implemented in whole or in part in the form of computer instructions. When the computer instructions are loaded and executed on the computer, the procedures or functions according to the embodiments of the present invention will be generated in whole or in part. The computer can be a general purpose computer, a special purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website, computer, server or data center Transmission to another website site, computer, server, or data center by wired (eg, coaxial cable, optical fiber) or wireless (eg, infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that can be accessed by a computer, or a data storage device such as a server or a data center integrated with one or more available media. The available medium may be a magnetic medium (for example, a floppy disk, a hard disk, or a magnetic tape), an optical medium (for example, DVD), or a semiconductor medium (for example, a solid state disk (Solid State Disk, SSD)) and the like.

本申请实施例中所描述的方法或算法的步骤可以直接嵌入硬件、处理器执行的软件单元、或者这两者的结合。软件单元可以存储于RAM存储器、闪存、ROM存储器、EPROM存储器、EEPROM存储器、寄存器、硬盘、可移动磁盘、CD-ROM或本领域中其它任意形式的存储媒介中。示例性地,存储媒介可以与处理器连接,以使得处理器可以从存储媒介中读取信息,并可以向存储媒介存写信息。可选地,存储媒介还可以集成到处理器中。处理器和存储媒介可以设置于ASIC中,ASIC可以设置于终端设备中。可选地,处理器和存储媒介也可以设置于终端设备中的不同的部件中。The steps of the method or algorithm described in the embodiments of the present application may be directly embedded in hardware, a software unit executed by a processor, or a combination of both. The software unit may be stored in RAM memory, flash memory, ROM memory, EPROM memory, EEPROM memory, registers, hard disk, removable disk, CD-ROM or any other storage medium in the art. Exemplarily, the storage medium can be connected to the processor, so that the processor can read information from the storage medium, and can write information to the storage medium. Optionally, the storage medium can also be integrated into the processor. The processor and the storage medium can be set in the ASIC, and the ASIC can be set in the terminal device. Optionally, the processor and the storage medium may also be disposed in different components in the terminal device.

这些计算机指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer instructions may also be loaded onto a computer or other programmable data processing device so that a series of operational steps are performed on the computer or other programmable device to produce a computer-implemented process, whereby the instructions executed on the computer or other programmable device Steps are provided for implementing the functions specified in the flow chart or flow charts and/or block diagram block or blocks.

尽管结合具体特征及其实施例对本发明进行了描述,显而易见的,在不脱离本发明的范围的情况下,可对其进行各种修改和组合。相应地,本说明书和附图仅仅是所附权利要求所界定的本发明的示例性说明,且视为已覆盖本发明范围内的任意和所有修改、变化、组合或等同物。显然,本领域的技术人员可以对本发明进行各种改动和变型而不脱离本发明的精神和范围。这样,倘若本发明的这些修改和变型属于本发明权利要求及其等同技术的范围之内,则本发明也意图包含这些改动和变型在内。Although the invention has been described in conjunction with specific features and embodiments thereof, it is obvious that various modifications and combinations can be made thereto without departing from the scope of the invention. Accordingly, the specification and drawings are merely illustrative of the invention as defined by the appended claims and are deemed to cover any and all modifications, variations, combinations or equivalents within the scope of the invention. Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalent technologies, the present invention also intends to include these modifications and variations.

Claims (14)

1. A method of data processing, comprising:
receiving a data operation language (DML) request, wherein the DML request is used for requesting to operate on target data, and is irrelevant to a database type;
generating a first transaction request for an OLTP database management system according to the DML request, wherein the first transaction request is used for requesting to operate on the target data in an OLTP database;
Sending the first transaction request to the OLTP database management system;
acquiring a transaction log generated by the OLTP database management system in response to the first transaction request, wherein the transaction log comprises information of operations of the OLTP database management system on the target data;
generating a second transaction request for the OLAP database management system according to the transaction log, wherein the second transaction request is used for requesting to operate on the target data in the OLAP database;
and sending the second transaction request to the OLAP database management system.
2. The method of claim 1, wherein generating a first transaction request for an OLTP database management system based on the DML request comprises:
carrying out grammar analysis on the DML request to obtain a first grammar tree corresponding to the DML request, wherein the first grammar tree comprises at least one node, and any one node in the at least one node is used for storing the corresponding relation between a DML instruction keyword and a structured query language SQL instruction keyword;
and generating the first transaction processing request according to the SQL keywords corresponding to the nodes in the first grammar tree.
3. The method of claim 1 or 2, wherein the second transaction request is a single hybrid transaction request, the generating a second transaction request for an OLAP database management system from the transaction log comprising:
a single hybrid transaction request for the OLAP database management system is generated from the transaction log, the hybrid transaction request requesting at least one type of data operation on the target data in the OLAP database.
4. The method of claim 1 or 2, wherein the second transaction request is at least one single type of transaction request, the generating a second transaction request for an OLAP database management system from the transaction log comprising:
generating at least one single type transaction request for the OLAP database management system based on the transaction log, any single type transaction request being used to request one type of data operation on the target data in the OLAP database.
5. A method of data processing, comprising:
Receiving a data query language, DQL, request for requesting query target data, the DQL request being independent of database type;
acquiring corresponding transaction requests according to the DQL request, wherein the transaction requests comprise a first transaction request for an OLTP database management system or a second transaction request for an OLAP database management system, the first transaction request is used for requesting to query the target data stored in the OLTP database, and the second transaction request is used for requesting to query the target data stored in the OLAP database;
and sending the transaction request to a database management system corresponding to the transaction request.
6. The method of claim 5, wherein the obtaining the corresponding transaction request from the DQL request comprises:
acquiring an execution information set, wherein the execution information set comprises at least one piece of execution information, and any piece of execution information comprises a DQL request and a corresponding transaction processing request;
and if the first execution information exists in the execution information set, the first execution information comprises the received DQL request, and a transaction processing request is acquired from the first execution information.
7. The method of claim 6, wherein if the first execution information is not present in the execution information set, further comprising:
generating the first transaction request of the OLTP database management system and the second transaction request of the OLAP database management system from the DQL request;
sending the first transaction request to the OLTP database management system, determining a first performance index of an execution process of a corresponding transaction operation of the first transaction request, sending the second transaction request to the OLAP database management system, and determining a second performance index of an execution process of a corresponding transaction operation of the second transaction request;
taking a transaction request corresponding to the highest performance index in the first performance index and the second performance index as a transaction request corresponding to the DQL request;
and generating the execution information of the DQL request according to the DQL request and the transaction request corresponding to the DQL request.
8. The method of claim 7, wherein,
the first transaction processing request corresponds to a first process, the first process creates a first cost-optimized CBO request of the OLTP database management system, the first CBO request is used for obtaining a first CBO result, and the first CBO result is the first performance index;
The second transaction request corresponds to a second process, the second process creates a second CBO request of the OLAP database management system, the second CBO request is used to obtain a second CBO result, and the second CBO result is the second performance index;
the first process is executed in parallel with the second process.
9. The method of any of claims 6 to 8, further comprising, if the first execution information is not present in the set of execution information:
determining a query type of the DQL request;
determining a database management system with matched query types of the DQL requests, wherein the matched database management system is the OLTP database management system or the OLAP database management system;
and generating a transaction request corresponding to the matched database management system according to the DQL request, and sending the transaction request to the matched database management system.
10. The method of claim 9, wherein generating the transaction request corresponding to the matching database management system from the target DQL request comprises:
the DQL request is subjected to grammar parsing to obtain a second grammar tree corresponding to the DQL request, wherein the second grammar tree comprises at least one node, and any one node in the at least one node is used for storing the corresponding relation between the DQL instruction keywords and the structured query language SQL instruction keywords;
And generating the second transaction processing request according to the SQL keywords corresponding to the nodes in the second grammar tree.
11. A data processing apparatus, comprising:
the acquisition module is used for receiving a data operation language (DML) request, wherein the DML request is used for requesting to operate on target data, and the DML request is irrelevant to the type of a database;
the processing module is used for generating a first transaction processing request for the OLTP database management system according to the DML request, wherein the first transaction processing request is used for requesting to operate on the target data in the OLTP database;
a sending module, configured to send the first transaction processing request to the OLTP database management system;
the obtaining module is further configured to obtain a transaction log generated by the OLTP database management system in response to the first transaction request, where the transaction log includes information that the OLTP database management system operates on the target data;
the processing module is used for generating a second transaction request for the OLAP database management system according to the transaction log, wherein the second transaction request is used for requesting to operate on the target data in the OLAP database;
And the sending module is used for sending the second transaction processing request to the OLAP database management system.
12. A data processing apparatus, comprising:
an acquisition module for receiving a data query language, DQL, request for requesting query of target data, the DQL request being independent of database type;
and obtaining a corresponding transaction request according to the DQL request, the transaction request including a first transaction request for an OLAP database management system or a second transaction request for an OLAP database management system, the first transaction request being for requesting to query the target data stored in the OLAP database, the second transaction request being for requesting to query the target data stored in the OLAP database;
and the sending module is used for sending the transaction request to a database management system corresponding to the transaction request.
13. An electronic device, the electronic device comprising: one or more processors; one or more memories; wherein the one or more memories store one or more computer instructions that, when executed by the one or more processors, cause the electronic device to perform the method of any of claims 1-4 or 5-10.
14. A computer readable storage medium comprising computer instructions which, when run on a computer, cause the computer to perform the method of any of claims 1-4 or 5-10.
CN202111540679.XA 2021-12-16 2021-12-16 Data processing method and device Pending CN116266185A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111540679.XA CN116266185A (en) 2021-12-16 2021-12-16 Data processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111540679.XA CN116266185A (en) 2021-12-16 2021-12-16 Data processing method and device

Publications (1)

Publication Number Publication Date
CN116266185A true CN116266185A (en) 2023-06-20

Family

ID=86743027

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111540679.XA Pending CN116266185A (en) 2021-12-16 2021-12-16 Data processing method and device

Country Status (1)

Country Link
CN (1) CN116266185A (en)

Similar Documents

Publication Publication Date Title
CN107506451B (en) Abnormal information monitoring method and device for data interaction
CN107273506B (en) A method for joint query of multiple tables in a database
CN111708804B (en) Data processing method, device, equipment and medium
US9594828B2 (en) Executing structured queries on text records of unstructured data
US8793225B1 (en) Processing a system search request including external data sources and mixed modes
US8738629B1 (en) External Result Provided process for retrieving data stored using a different configuration or protocol
US8224807B2 (en) Enhanced utilization of query optimization
CN109766345B (en) Metadata processing method and device, equipment and readable storage medium
WO2020228801A1 (en) Multi-language fusion query method and multi-model database system
CN113051268A (en) Data query method, data query device, electronic equipment and storage medium
CN109947796B (en) Caching method for query intermediate result set of distributed database system
US10585720B1 (en) Method and system for executing application programming interface (API) requests based on union relationships between objects
CN111966692A (en) Data processing method, medium, device and computing equipment for data warehouse
CN114356921A (en) Data processing method, device, server and storage medium
US11507555B2 (en) Multi-layered key-value storage
CN107103067A (en) A kind of method of data synchronization and system based on search engine
US7546311B2 (en) Optimization of left and right outer join operations in database management systems
CN114691704A (en) A metadata synchronization method based on MySQL binlog
CN113934750A (en) Data blood relationship analysis method based on compiling mode
US9053207B2 (en) Adaptive query expression builder for an on-demand data service
US9047354B2 (en) Statement categorization and normalization
CN113962597A (en) Data analysis method and device, electronic equipment and storage medium
CN111752920A (en) Method, system and storage medium for managing metadata
CN114443699A (en) Information query method, apparatus, computer equipment, and computer-readable storage medium
WO2024239782A1 (en) Query plan construction method and apparatus, 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