CN113688151A - Data access method, device, system, equipment and medium based on virtual database - Google Patents

Data access method, device, system, equipment and medium based on virtual database Download PDF

Info

Publication number
CN113688151A
CN113688151A CN202110980369.3A CN202110980369A CN113688151A CN 113688151 A CN113688151 A CN 113688151A CN 202110980369 A CN202110980369 A CN 202110980369A CN 113688151 A CN113688151 A CN 113688151A
Authority
CN
China
Prior art keywords
data
query
virtual database
data access
sql
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
CN202110980369.3A
Other languages
Chinese (zh)
Inventor
姚文猛
高园
刘意
马蕾
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Industrial and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN202110980369.3A priority Critical patent/CN113688151A/en
Publication of CN113688151A publication Critical patent/CN113688151A/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/24Querying
    • G06F16/242Query formulation
    • G06F16/2433Query languages
    • G06F16/2445Data retrieval commands; View definitions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24553Query execution of query operations
    • G06F16/24554Unary operations; Data partitioning operations
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/248Presentation of query results
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/25Integrating or interfacing systems involving database management systems
    • G06F16/256Integrating or interfacing systems involving database management systems in federated or virtual databases

Landscapes

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

Abstract

The disclosure provides a data access method, a data access device, a data access system, a data access device, a data access medium and a program product based on a virtual database, and relates to the technical field of databases. The method comprises the steps of receiving a SQL query request of a user layer; performing statement analysis on the SQL query request, calling preset rules in a rule base based on the result of the statement analysis to decompose the SQL query request into a plurality of local query statements, and distributing the local query statements to corresponding databases in a routing manner to obtain corresponding query data; and assembling the query data and outputting a query result to the user layer. The data access method based on the virtual database solves the problems that in the prior art, different code logics are compiled aiming at different databases to complete corresponding connection and access operations, so that the code compiling amount is large, the service logic of a request end is complex, and the maintenance is difficult.

Description

Data access method, device, system, equipment and medium based on virtual database
Technical Field
The present disclosure relates to the field of database technologies, and more particularly, to a method, an apparatus, a system, a device, a medium, and a program product for data access based on a virtual database.
Background
At present, the internal logic of mainstream large-scale enterprise-level applications is becoming more and more complex, and the types of used databases are more and more due to history or upgrading and upgrading reasons, such as mysql, oracle, informax and the like. If the data requester needs to realize connection access to the heterogeneous database, different code logics need to be written in the application program respectively aiming at different databases to complete corresponding connection and access operations. The code writing amount is large, the service logic of the request end is complex, and the maintenance is difficult.
Disclosure of Invention
In view of the foregoing, the present disclosure provides a method, apparatus, system, device, medium, and program product for data access of a virtual database.
According to a first aspect of the present disclosure, there is provided a data access method for a virtual database, applied to a virtual database layer, including: receiving an SQL query request of a user layer; performing statement analysis on the SQL query request, calling preset rules in a rule base based on the result of the statement analysis to decompose the SQL query request into a plurality of local query statements, and distributing the local query statements to a corresponding database by a route to acquire corresponding query data; and outputting a query result to the user layer after the query data are assembled.
In certain embodiments, further comprising: generating a series of preset rules by adopting a deep learning algorithm; and creating a rule base based on a series of the preset rules.
In some embodiments, the generating the series of preset rules by using the deep learning algorithm includes: creating a structured data table; extracting data information in a heterogeneous data source and storing the data information in the structured data table; collecting and matching data information in the structured data table by adopting a deep learning algorithm, and determining the similarity between different data tables; and performing corresponding rule definition according to the similarity to form the preset rule.
In certain embodiments, the data information includes a library name, a table name, and table structure information including column names, column attributes, constraints, and table data in a data table.
In some embodiments, the preset rule includes a homogeneous table operation of associating heterogeneous data sources and a homogeneous attribute data extraction association operation of a non-homogeneous table.
In certain embodiments, further comprising: and verifying the similarity by adopting an artificial error marking method, wherein the step of verifying the similarity by adopting the artificial error marking method comprises the following steps:
uploading the similarity and the relation view corresponding to the similar field to a control center; and judging the accuracy of the similarity by the administrator of the control center according to the corresponding relation view of the similar field.
In certain embodiments, further comprising: and writing the differential SQL grammar rule of the heterogeneous data source into the local rule base.
In some embodiments, said invoking a preset rule in the rule base to decompose the SQL query request into a plurality of local query statements based on the result of the statement analysis comprises: matching the preset rule according to the statement analysis result; determining a data table in a heterogeneous data source to be accessed according to the preset rule obtained by matching; determining a corresponding differentiation SQL grammar rule according to the type of the heterogeneous data source; and decomposing the SQL query request into a plurality of local query statements based on the table structure information of the data table and the differential SQL syntax rules.
In some embodiments, said assembling said query data and outputting a query result to said user layer comprises: and grouping and sorting the queried data according to the constraint rule of the SQL query request to form the query result.
A second aspect of the present disclosure provides a virtual database-based data access apparatus, including: the receiving module is used for receiving an SQL query request of a user layer; the SQL statement distribution routing module is used for carrying out statement analysis on the SQL query request, calling preset rules in a rule base based on the statement analysis result to decompose the SQL query request into a plurality of local query statements, and distributing the local query statements to a corresponding database in a routing way to obtain corresponding query data; and the data assembly module is used for assembling the query data and then outputting a query result to the user layer.
In certain embodiments, further comprising: the wrapper module is used for generating a series of preset rules by adopting a deep learning algorithm; and the rule base module is used for writing the preset rule.
In certain embodiments, further comprising: and the control center module is used for verifying the similarity by adopting a manual error marking method.
A third aspect of the present disclosure provides a virtual database-based data access system, comprising: a virtual database layer for executing any one of the above data access methods based on the virtual database; the user layer is used for sending an SQL query request to the virtual database layer; and the heterogeneous database layer is used for storing the data source and providing the data source for the virtual database layer to access and query.
A fourth aspect of the present disclosure provides an electronic device, comprising: one or more processors; a memory for storing one or more programs, wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to perform the above virtual database-based data access method.
The fifth aspect of the present disclosure also provides a computer-readable storage medium having stored thereon executable instructions, which when executed by a processor, cause the processor to perform the above-mentioned virtual database-based data access method.
A sixth aspect of the present disclosure also provides a computer program product comprising a computer program which, when executed by a processor, implements the virtual database-based data access method described above.
According to the data access method based on the virtual database, the SQL query request of a user layer is received; performing statement analysis on the SQL query request, calling preset rules in a rule base based on the result of the statement analysis to decompose the SQL query request into a plurality of local query statements, and distributing the local query statements to corresponding databases in a routing manner to obtain corresponding query data; and assembling the query data and outputting a query result to the user layer. According to the data access method based on the virtual database, data access to the bottom heterogeneous data source is completed on the virtual database layer, and meanwhile, the results obtained through the access are assembled and then fed back to the user layer in a unified mode, so that the problems that in the prior art, different code logics are compiled for different databases to complete corresponding connection and access operations, the code compiling amount is large, the service logics of a request end are complex, and maintenance is difficult are solved.
Drawings
The foregoing and other objects, features and advantages of the disclosure will be apparent from the following description of embodiments of the disclosure, which proceeds with reference to the accompanying drawings, in which:
FIG. 1 schematically illustrates an application scenario diagram of a virtual database-based data access method, apparatus, device, medium, and program product according to embodiments of the disclosure;
FIG. 2 schematically illustrates a flow diagram of a virtual database-based data access method according to an embodiment of the present disclosure;
FIG. 3 schematically illustrates another flow diagram of a virtual database-based data access method according to an embodiment of the present disclosure;
FIG. 4 schematically illustrates a block diagram of a virtual database based data access system according to an embodiment of the present disclosure;
FIG. 5 is a block diagram schematically illustrating a structure of a virtual database based data access apparatus according to an embodiment of the present disclosure;
FIG. 6 schematically illustrates a block diagram of a computer system suitable for implementing a virtual database-based data access method, in accordance with an embodiment of the present disclosure.
Detailed Description
Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. It should be understood that the description is illustrative only and is not intended to limit the scope of the present disclosure. In the following detailed description, for purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the embodiments of the disclosure. It may be evident, however, that one or more embodiments may be practiced without these specific details. Moreover, in the following description, descriptions of well-known structures and techniques are omitted so as to not unnecessarily obscure the concepts of the present disclosure.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. The terms "comprises," "comprising," and the like, as used herein, specify the presence of stated features, steps, operations, and/or components, but do not preclude the presence or addition of one or more other features, steps, operations, or components.
All terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art unless otherwise defined. It is noted that the terms used herein should be interpreted as having a meaning that is consistent with the context of this specification and should not be interpreted in an idealized or overly formal sense.
Where a convention analogous to "at least one of A, B and C, etc." is used, in general such a construction is intended in the sense one having skill in the art would understand the convention (e.g., "a system having at least one of A, B and C" would include but not be limited to systems that have a alone, B alone, C alone, a and B together, a and C together, B and C together, and/or A, B, C together, etc.).
The detailed background may include other technical problems than those which are exclusively addressed.
The embodiment of the disclosure provides a data access method based on a virtual database, which comprises the following steps: receiving an SQL query request of a user layer; performing statement analysis on the SQL query request, calling preset rules in a rule base based on the result of the statement analysis to decompose the SQL query request into a plurality of local query statements, and distributing the local query statements to corresponding databases in a routing manner to obtain corresponding query data; and assembling the query data and outputting a query result to the user layer.
It should be noted that the data access method for the virtual database provided in the embodiment of the present disclosure may be used in the aspects related to the micro service data transmission of the big data and the distributed technology, and may also be used in various fields other than the big data and the distributed technology, such as the financial field.
The data access method based on the virtual database in the embodiment of the disclosure is particularly suitable for storing queried data in heterogeneous data sources when a user side performs data query, and can improve the efficiency of data query when the types of the databases to be accessed are various.
Fig. 1 schematically illustrates an application scenario of a virtual database-based data access method according to an embodiment of the present disclosure.
As shown in fig. 1, the application scenario 100 according to this embodiment may comprise user layer terminal devices 101, 102, 103. The virtual database 104 is used to provide queries and outputs of data between the terminal devices 101, 102, 103 and the plurality of databases 105.
The user may use the terminal device 101, 102, 103 to interact with the server 105 via the virtual database 104 to query data or the like. The terminal devices 101, 102, 103 may have installed thereon various communication client applications, such as shopping-like applications, web browser applications, search-like applications, instant messaging tools, mailbox clients, social platform software, etc. (by way of example only).
The terminal devices 101, 102, 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The type of the database 105 may be mysql, oracle, informix, and data is stored inside the database 105 for the user to view.
It should be noted that the virtual database-based data access method provided by the embodiment of the present disclosure may be generally executed by the virtual database layer 104. The virtual database layer receives data query requests sent by the terminal devices 101, 102 and 103 of the user layer, obtains data queried by the user from the multi-database 105 through analysis processing of the query requests, and forms query results through assembly of the queried data to be returned to the user layer for the user to check.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
The virtual database-based data access method according to the embodiment of the present disclosure will be described in detail with reference to fig. 2 to 3 based on the scenario described in fig. 1.
FIG. 2 schematically shows a flow diagram of a virtual database-based data method according to an embodiment of the present disclosure.
As shown in fig. 2, the virtual database-based data access method of this embodiment includes operations S210 to S230.
In operation S210, an SQL query request of a user layer is received.
The user layer is the initiator of the data requirement, the user in the user layer inputs the query request on the user operation interface in the application program according to the data query requirement, and the query request is processed and then the SQL query request based on the database management language is sent to the virtual database layer. The SQL query request may be to query a specific type of table structure, query all columns in a specified data table, query a specified column or a specified row in a specified data table, query whether field contents in a specified data table are empty/non-empty, or sort the query results by field values, etc.
It is understood that the user layer may be a personal mobile terminal device of the client, such as a mobile phone, a notebook computer or a desktop computer, and may also be a workstation of the client at the enterprise end. And a data transmission channel is established between the heterogeneous data sources of the user layer and the bottom layer based on the network. The type of network may be a wired network, a wireless communication network, etc. The related application programs of the user layer can realize the access to the virtual database through a uniform SQL and XML interface so as to realize the transmission of the SQL query request to the virtual database.
In operation S220, the SQL query request is parsed, preset rules in a rule base are called based on the result of the parsing to decompose the SQL query request into a plurality of local query statements, and the local query statements are routed and distributed to a corresponding database to obtain corresponding query data.
Operations S221 through S222 are also required to be performed before operation S220 is performed, as shown in fig. 3 in particular.
In operation S221: generating a series of preset rules by adopting a deep learning algorithm;
in the embodiment of the disclosure, by creating a structured data table, the structured data table is used as a data table for temporarily storing data, which is a mapping of a formal data table stored in a database, and data information in a heterogeneous data source is extracted, for example, a common for loop is adopted, and a corresponding table is derived from the database. And storing the data information in a structured data table, the data information of the present disclosure including a library name, a table name, and table structure information including a column name, a column attribute, a constraint, and table data in the data table, examples being: the data information of table a1 is derived from database a into the structured data table, the database name of database a, the table name of table a1, and the table structure information of table a1 need to be copied into the structured data table, and the structured data table has corresponding field names, field types, field lengths, data records, and other data information in the fields. And performing collection matching on data information in the structured data table by adopting a deep learning algorithm, and determining the similarity between different data tables. As described above, the data information of the data tables of different databases is stored in the structured data table, and the data relationship between different data tables can be judged through the process of collection and matching. Examples are as follows: the field names, field types, field lengths and the like of the data table A1 in the database A and the data table B1 in the database B are the same, only the recorded data contents are different, at this time, the data table A1 and the data table B1 which are the same type can be obtained through the process of collection and matching, the rule of operation of the association heterogeneous data source isomorphism table can be created to associate the data table A1 with the data table B1, and when a user inquires the data table with the table structure, the data table A1 and the data table B1 can be obtained simultaneously. Further examples are: the field names, field types, field lengths and the like of the data table a1 in the database a and the data table B1 in the database B are different, but the recorded data contents are the same, at this time, the data table a1 and the data table B1 obtained through the process of collection and matching have the same data records, the rule for associating the heterogeneous data source non-homogeneous table operation can be created to associate the data table a1 with the data table B1, and when a user queries the data records in the above, the data records recorded in the data table a1 and the data table B1 can be simultaneously obtained. In the above determination process, different field names, field types, data records, etc. need to be matched one by one to confirm the similarity between two data tables, and then corresponding rule definition is performed according to the similarity to form a preset rule.
It can be understood that, in the embodiment of the present disclosure, in order to ensure the accuracy of the deep learning result, the method of manually correcting the similarity is further included, where the method of manually correcting the similarity includes: uploading the similarity and the relation view corresponding to the similar field to a control center; and the administrator of the control center judges the accuracy of the similarity according to the relation view corresponding to the similar fields, displays the names of two or more current data tables and the database where the data tables are located on the relation view, and simultaneously displays the similarity result and obtains the similar fields matched with the result, so that the administrator can carry out artificial similarity correction.
It can be understood that, as described above, data is obtained by querying a plurality of databases in the bottom layer, access syntax rules of different databases are different, and in order to facilitate access of the virtual database layer to the databases, in the embodiment of the present disclosure, the differentiated SQL syntax rules of the heterogeneous data sources are written into the rule base, and the syntax rules corresponding to the data sources are entered into the rule base by counting the syntax rules of the existing databases and using the database name as an identifier, so that when it is determined that a data path needs to be accessed, a corresponding syntax rule of a caller is invoked, thereby improving access efficiency.
In operation S222, a rule base is created based on a series of preset rules. It should be noted that the rule base here is equivalent to a small database built in the virtual database layer, and the creation process of the rule base is consistent with the creation process of the database, which is not described herein again. The built-in rules are equivalent to a data table in a database, and when the rules are called, the corresponding preset rules are inquired and used in the rule base according to the result of the statement analysis as an index. The preset RULEs may be created in the RULE base by using various commands such as CREATE run command, Enterprise Manager command, and the like. The created rule includes the name, creation time, owner, etc. of the rule, so as to facilitate the subsequent calling of the preset rule.
Returning to operation S220, performing statement analysis on the SQL query request, invoking preset rules in the rule base based on the result of the statement analysis to decompose the SQL query request into a plurality of local query statements, and routing and distributing the local query statements to the corresponding database to obtain corresponding query data includes:
and matching preset rules according to the result of the statement analysis, such as field names, field types and the like of data to be queried in the result of the statement analysis, and traversing all the preset rules according to the field names and the field types to find the matched preset rules. The statement analysis tool can adopt a built-in SQL parser in the database, which parses SQL statements into a parse tree to complete preprocessing of grammar sequence, query content keywords and the like.
And determining a data table in the heterogeneous data source to be accessed according to the preset rule obtained by matching, and determining that the data required to be queried by the SQL query request is distributed in a plurality of data tables according to the preset rule, wherein the data tables can be in the same database or can exist in different databases. When the data table exists in different databases, the database name of the database where the data table is located can be obtained according to preset rules, and the corresponding differentiation SQL grammar rule is determined according to the database name. The SQL query request is then decomposed into a plurality of local query statements based on the table structure information of the data table and the differential SQL syntax rules. And then distributing the local query statement route to a corresponding database to obtain corresponding query data. The process of acquiring the query data is the same as the method of accessing the database by using the SQL statement, and is not repeated.
In operation S230, the query data is assembled and then the query result is output to the user layer. And after the data inquired from the database is assembled according to the constraint rule in the SQL inquiry request, outputting the inquiry result required by the user.
Based on the data access method based on the virtual database, the disclosure also provides a data access device of the virtual database. The apparatus will be described in detail below with reference to fig. 5.
Fig. 5 schematically shows a block diagram of a virtual database based data access apparatus according to an embodiment of the present disclosure.
As shown in fig. 5, 300 of this embodiment includes a receiving module 301, an SQL statement distribution routing module 302, and a data assembling module 303.
A receiving module 301, configured to receive an SQL query request from a user layer, and adapted to execute step S210 in the foregoing;
the SQL statement distribution routing module 302 is configured to perform statement analysis on the SQL query request, invoke preset rules in a rule base based on the result of the statement analysis to decompose the SQL query request into a plurality of local query statements, and distribute the local query statements to a corresponding database by a route to obtain corresponding query data, and is adapted to perform the step 220;
a data assembling module 303, configured to assemble the query data and output a query result to the user layer, and adapted to perform step 230 in the foregoing.
For example, the data access method based on the virtual database according to the embodiment of the present disclosure further includes: a wrapper module for generating a series of preset rules using a deep learning algorithm, adapted to perform step 221 above.
For example, the data access method based on the virtual database according to the embodiment of the present disclosure further includes: the rule base module is used for writing preset rules and is suitable for executing the step 222 in the above.
For example, the data access method based on the virtual database according to the embodiment of the present disclosure further includes: and the control center module is used for verifying the similarity by adopting a manual error marking method.
According to the data access method based on the virtual database, the SQL query request of a user layer is received; performing statement analysis on the SQL query request, calling preset rules in a rule base based on the result of the statement analysis to decompose the SQL query request into a plurality of local query statements, and distributing the local query statements to corresponding databases in a routing manner to obtain corresponding query data; and assembling the query data and outputting a query result to the user layer. According to the data access method based on the virtual database, data access to the bottom heterogeneous data source is completed on the virtual database layer, and meanwhile, the results obtained through the access are assembled and then fed back to the user layer in a unified mode, so that the problems that in the prior art, different code logics are compiled for different databases to complete corresponding connection and question-asking operations, so that the code compiling amount is large, the service logics of a request end are complex, and the maintenance is difficult are solved. Meanwhile, the data access method based on the virtual database disclosed by the invention also has the following advantages: the access channel does not need to control the connection and access strategy of each heterogeneous data source, the logic complexity is reduced, and the maintainability is improved; data access and integration strategies are uniformly placed in a virtual database layer for implementation, so that the coupling degree of channels and various downstream data sources is reduced; the unified management of data access is realized, the expansibility of external services is improved, and the virtual database layer can integrate and access the data of various heterogeneous data sources, so that a complete basic platform is provided for the subsequent service scene expansion based on big data.
According to the embodiment of the present disclosure, any multiple modules of the receiving module 301, the SQL statement distribution routing module 302, and the data assembling module 303 may be combined and implemented in one module, or any one of the modules may be split into multiple modules. Alternatively, at least part of the functionality of one or more of these modules may be combined with at least part of the functionality of the other modules and implemented in one module. According to the embodiment of the present disclosure, at least one of the receiving module 301, the SQL statement distribution routing module 302, and the data assembling module 303 may be at least partially implemented as a hardware circuit, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system on a chip, a system on a substrate, a system on a package, an Application Specific Integrated Circuit (ASIC), or may be implemented by hardware or firmware in any other reasonable manner of integrating or packaging a circuit, or implemented by any one of three implementations of software, hardware, and firmware, or implemented by a suitable combination of any several of them. Alternatively, at least one of the receiving module 301, the SQL statement distribution routing module 302, and the data assembling module 303 may be at least partially implemented as a computer program module that, when executed, may perform a corresponding function.
Fig. 4 schematically shows a block diagram of a virtual database-based data access system according to an embodiment of the present disclosure.
As shown in fig. 4, this embodiment includes: the virtual database layer is used for executing the data access method based on the virtual database in the embodiment; the virtual database layer in the embodiment comprises an SQL statement distribution routing module, an SQL query request sent by a user layer is received by the SQL statement distribution routing module, the SQL statement distribution routing module performs statement analysis on the SQL query request, preset rules in a rule base are called according to the result of the statement analysis to decompose the SQL query into a plurality of local query statements, access to a plurality of databases is achieved through the local query statements to return query data, the returned question prevention result enters a data assembly module from the SQL statement distribution routing module, the data assembly module performs operations such as sorting on the query data according to the constraint rules of the SQL query request, and the query result is formed and sent to the user layer. The preset rule is obtained by performing collection matching on different bottom databases by a wrapper module by adopting a deep learning algorithm.
The user layer is used for sending an SQL query request to the virtual database layer;
and the heterogeneous database layer is used for storing the data source and providing the data source for the virtual database layer to access and query.
Fig. 6 schematically shows a block diagram of an electronic device adapted to implement a virtual database based data access method according to an embodiment of the present disclosure.
As shown in fig. 6, an electronic device 400 according to an embodiment of the present disclosure includes a processor 401 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)402 or a program loaded from a storage section 408 into a Random Access Memory (RAM) 403. Processor 401 may include, for example, a general purpose microprocessor (e.g., a CPU), an instruction set processor and/or associated chipset, and/or a special purpose microprocessor (e.g., an Application Specific Integrated Circuit (ASIC)), among others. The processor 401 may also include onboard memory for caching purposes. Processor 401 may include a single processing unit or multiple processing units for performing the different actions of the method flows in accordance with embodiments of the present disclosure.
In the RAM 403, various programs and data necessary for the operation of the electronic apparatus 400 are stored. The processor 401, ROM 402 and RAM 403 are connected to each other by a bus 404. The processor 401 performs various operations of the method flows according to the embodiments of the present disclosure by executing programs in the ROM 402 and/or the RAM 403. Note that the program may also be stored in one or more memories other than the ROM 402 and the RAM 403. The processor 401 may also perform various operations of the method flows according to embodiments of the present disclosure by executing programs stored in the one or more memories.
According to an embodiment of the present disclosure, electronic device 400 may also include an input/output (I/O) interface 405, input/output (I/O) interface 405 also being connected to bus 404. Electronic device 400 may also include one or more of the following components connected to I/O interface 405: an input section 406 including a keyboard, a mouse, and the like; an output section 407 including a display device such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 408 including a hard disk and the like; and a communication section 405 including a network interface card such as a LAN card, a modem, or the like. The communication section 405 performs communication processing via a network such as the internet. A driver 410 is also connected to the I/O interface 405 as needed. A removable medium 411 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 410 as necessary, so that a computer program read out therefrom is mounted into the storage section 408 as necessary.
The present disclosure also provides a computer-readable storage medium, which may be contained in the apparatus/device/system described in the above embodiments; or may exist separately and not be assembled into the device/apparatus/system. The computer-readable storage medium carries one or more programs which, when executed, implement the method according to an embodiment of the disclosure.
According to embodiments of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium, which may include, for example but is not limited to: a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. For example, according to embodiments of the present disclosure, a computer-readable storage medium may include ROM 402 and/or RAM 403 and/or one or more memories other than ROM 402 and RAM 403 described above.
Embodiments of the present disclosure also include a computer program product comprising a computer program containing program code for performing the method illustrated in the flow chart. When the computer program product runs in a computer system, the program code is used for causing the computer system to realize the item recommendation method provided by the embodiment of the disclosure.
The computer program performs the above-described functions defined in the system/apparatus of the embodiments of the present disclosure when executed by the processor 401. The systems, apparatuses, modules, units, etc. described above may be implemented by computer program modules according to embodiments of the present disclosure.
In one embodiment, the computer program may be hosted on a tangible storage medium such as an optical storage device, a magnetic storage device, or the like. In another embodiment, the computer program may also be transmitted, distributed in the form of a signal on a network medium, downloaded and installed through the communication section 405, and/or installed from the removable medium 411. The computer program containing program code may be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the foregoing.
In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 405 and/or installed from the removable medium 411. The computer program, when executed by the processor 401, performs the above-described functions defined in the system of the embodiments of the present disclosure. The systems, devices, apparatuses, modules, units, etc. described above may be implemented by computer program modules according to embodiments of the present disclosure.
In accordance with embodiments of the present disclosure, program code for executing computer programs provided by embodiments of the present disclosure may be written in any combination of one or more programming languages, and in particular, these computer programs may be implemented using high level procedural and/or object oriented programming languages, and/or assembly/machine languages. The programming language includes, but is not limited to, programming languages such as Java, C + +, python, the "C" language, or the like. The program code may execute entirely on the user computing device, partly on the user device, partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., through the internet using an internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
Those skilled in the art will appreciate that various combinations and/or combinations of features recited in the various embodiments and/or claims of the present disclosure can be made, even if such combinations or combinations are not expressly recited in the present disclosure. In particular, various combinations and/or combinations of the features recited in the various embodiments and/or claims of the present disclosure may be made without departing from the spirit or teaching of the present disclosure. All such combinations and/or associations are within the scope of the present disclosure.
The embodiments of the present disclosure have been described above. However, these examples are for illustrative purposes only and are not intended to limit the scope of the present disclosure. Although the embodiments are described separately above, this does not mean that the measures in the embodiments cannot be used in advantageous combination. The scope of the disclosure is defined by the appended claims and equivalents thereof. Various alternatives and modifications can be devised by those skilled in the art without departing from the scope of the present disclosure, and such alternatives and modifications are intended to be within the scope of the present disclosure.

Claims (16)

1. A data access method based on a virtual database is applied to a virtual database layer and is characterized by comprising the following steps:
receiving an SQL query request of a user layer;
performing statement analysis on the SQL query request, calling preset rules in a rule base based on the result of the statement analysis to decompose the SQL query request into a plurality of local query statements, and distributing the local query statements to a corresponding database by a route to acquire corresponding query data; and
and after the query data are assembled, outputting a query result to the user layer.
2. The virtual database-based data access method of claim 1, further comprising:
generating a series of preset rules by adopting a deep learning algorithm; and
creating the rule base based on a series of the preset rules.
3. The virtual database-based data access method of claim 2, wherein the generating a series of the preset rules by using a deep learning algorithm comprises:
creating a structured data table;
extracting data information in a heterogeneous data source and storing the data information in the structured data table;
collecting and matching data information in the structured data table by adopting a deep learning algorithm, and determining the similarity between different data tables; and
and performing corresponding rule definition according to the similarity to form the preset rule.
4. The virtual database-based data access method of claim 3, wherein the data information comprises a library name, a table name, and table structure information comprising a column name, a column attribute, a constraint, and table data in a data table.
5. The virtual database-based data access method of claim 3, wherein the preset rules include operations of associating isomorphic tables of heterogeneous data sources and operations of extracting and associating isomorphic data of non-isomorphic tables.
6. The virtual database-based data access method of claim 3, further comprising: and verifying the similarity by adopting an artificial error marking method, wherein the step of verifying the similarity by adopting the artificial error marking method comprises the following steps:
uploading the similarity and the relation view corresponding to the similar field to a control center; and
and judging the accuracy of the similarity by the administrator of the control center according to the relation view corresponding to the similar field.
7. The virtual database-based data access method of claim 2, further comprising: and writing the differential SQL grammar rule of the heterogeneous data source into the local rule base.
8. The virtual database-based data access method of claim 7, wherein said invoking a preset rule in the rule base to decompose the SQL query request into a plurality of local query statements based on the result of the statement analysis comprises:
matching the preset rule according to the statement analysis result;
determining a data table in a heterogeneous data source to be accessed according to the preset rule obtained by matching;
determining a corresponding differentiation SQL grammar rule according to the type of the heterogeneous data source; and
and decomposing the SQL query request into a plurality of local query statements based on the table structure information of the data table and the differential SQL grammar rules.
9. The virtual database-based data access method of claim 1, wherein the assembling the query data and outputting the query result to the user layer comprises:
and grouping and sorting the queried data according to the constraint rule of the SQL query request to form the query result.
10. A virtual database-based data access apparatus, comprising:
the receiving module is used for receiving an SQL query request of a user layer;
the SQL statement distribution routing module is used for carrying out statement analysis on the SQL query request, calling preset rules in a rule base based on the statement analysis result to decompose the SQL query request into a plurality of local query statements, and distributing the local query statements to a corresponding database in a routing way to obtain corresponding query data;
and the data assembly module is used for assembling the query data and then outputting a query result to the user layer.
11. The virtual database-based data access apparatus of claim 10, further comprising:
the wrapper module is used for generating a series of preset rules by adopting a deep learning algorithm;
and the rule base module is used for writing the preset rule.
12. The virtual database-based data access apparatus of claim 10, further comprising:
and the control center module is used for verifying the similarity by adopting a manual error marking method.
13. A virtual database-based data access system, comprising:
a virtual database layer for executing the virtual database-based data access method of any one of claims 1 to 9;
the user layer is used for sending an SQL query request to the virtual database layer;
and the heterogeneous database layer is used for storing the data source and providing the data source for the virtual database layer to access and query.
14. An electronic device, comprising:
one or more processors;
a storage device for storing one or more programs,
wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to perform the method of any of claims 1-9.
15. A computer readable storage medium having stored thereon executable instructions which, when executed by a processor, cause the processor to perform the method of any one of claims 1 to 9.
16. A computer program product comprising a computer program which, when executed by a processor, implements a method according to any one of claims 1 to 9.
CN202110980369.3A 2021-08-25 2021-08-25 Data access method, device, system, equipment and medium based on virtual database Pending CN113688151A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110980369.3A CN113688151A (en) 2021-08-25 2021-08-25 Data access method, device, system, equipment and medium based on virtual database

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110980369.3A CN113688151A (en) 2021-08-25 2021-08-25 Data access method, device, system, equipment and medium based on virtual database

Publications (1)

Publication Number Publication Date
CN113688151A true CN113688151A (en) 2021-11-23

Family

ID=78582397

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110980369.3A Pending CN113688151A (en) 2021-08-25 2021-08-25 Data access method, device, system, equipment and medium based on virtual database

Country Status (1)

Country Link
CN (1) CN113688151A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117453731A (en) * 2023-12-22 2024-01-26 北京宇信科技集团股份有限公司 Multi-source data query system and multi-source data query method

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117453731A (en) * 2023-12-22 2024-01-26 北京宇信科技集团股份有限公司 Multi-source data query system and multi-source data query method

Similar Documents

Publication Publication Date Title
US8655861B2 (en) Query metadata engine
CN111177231A (en) Report generation method and report generation device
US20100228764A1 (en) Offline Validation of Data in a Database System for Foreign Key Constraints
US10102269B2 (en) Object query model for analytics data access
CN111949541A (en) Multi-source database statement checking method and device
CN107291471B (en) Meta-model framework system supporting customizable data acquisition
CN110019314B (en) Dynamic data packaging method based on data item analysis, client and server
US20150269234A1 (en) User Defined Functions Including Requests for Analytics by External Analytic Engines
US20170139989A1 (en) Pruning of Table Partitions from a Calculation Scenario for Executing a Query
CN109710220B (en) Relational database query method, relational database query device, relational database query equipment and storage medium
CN114064690A (en) Data processing method and device
CN116594683A (en) Code annotation information generation method, device, equipment and storage medium
CN115599386A (en) Code generation method, device, equipment and storage medium
US10503823B2 (en) Method and apparatus providing contextual suggestion in planning spreadsheet
CN113688151A (en) Data access method, device, system, equipment and medium based on virtual database
CN112650526B (en) Method, device, electronic equipment and medium for detecting version consistency
CN113419740A (en) Program data stream analysis method and device, electronic device and readable storage medium
US20140122158A1 (en) License Meta-Model for Automatic License Reasoning
US20150169675A1 (en) Data access using virtual retrieve transformation nodes
US9135302B2 (en) Query rewrite with a nested materialized view
CN117009397A (en) Data query method, data query device, electronic equipment and storage medium
US9053151B2 (en) Dynamically joined fast search views for business objects
CN115357606A (en) Data source query method, system, computer equipment and storage medium
US11113664B2 (en) Data provisioning system and method
CN114677114A (en) Approval process generation method and device based on graph dragging

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