CN117033748A - Service query information acquisition method, service data query method and device - Google Patents

Service query information acquisition method, service data query method and device Download PDF

Info

Publication number
CN117033748A
CN117033748A CN202311290005.8A CN202311290005A CN117033748A CN 117033748 A CN117033748 A CN 117033748A CN 202311290005 A CN202311290005 A CN 202311290005A CN 117033748 A CN117033748 A CN 117033748A
Authority
CN
China
Prior art keywords
service
database
query
driving
target
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.)
Granted
Application number
CN202311290005.8A
Other languages
Chinese (zh)
Other versions
CN117033748B (en
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.)
Hundsun Technologies Inc
Original Assignee
Hundsun Technologies Inc
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 Hundsun Technologies Inc filed Critical Hundsun Technologies Inc
Priority to CN202311290005.8A priority Critical patent/CN117033748B/en
Publication of CN117033748A publication Critical patent/CN117033748A/en
Application granted granted Critical
Publication of CN117033748B publication Critical patent/CN117033748B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/953Querying, e.g. by the use of web search engines
    • G06F16/9532Query formulation
    • 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
    • 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/24552Database cache management
    • 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
    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1097Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

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

Abstract

The embodiment of the invention provides a method for acquiring service inquiry information, a method, a device, equipment and a medium for inquiring service data, wherein the method for acquiring the service inquiry information comprises the following steps: receiving an acquisition request of service inquiry information sent by a requesting party, wherein the acquisition request carries a service identifier of a target service; calling a driving hosting unit to acquire target business query information corresponding to the business identifier, wherein the driving hosting unit is arranged between a database programming interface and a database driving unit, and the business query information recorded by the driving hosting unit comprises: the driving hosting unit obtains business query sentences from the database programming interface and/or business data query results from the database driving unit in the business data query process; and sending the target service query information to the requester.

Description

Service query information acquisition method, service data query method and device
Technical Field
The embodiment of the invention relates to the technical field of computers, in particular to a service query information acquisition method and a service data query method. The invention also relates to a service data query device, a computing device and a computer readable storage medium.
Background
With the increase of business demands of various industries, enterprises often need to acquire complete business SQL (Structured Query Language ) when accessing databases in actual businesses so as to achieve the purpose of business monitoring, such as database SQL adaptive scanning, dynamic SQL execution monitoring, SQL interception, SQL execution statistics and the like.
In the related art, data query is performed through an ORM (Object Relational Mapping, object relation mapping) framework, and an operation of intercepting SQL is performed in the query process. However, the types of the ORM frameworks are various, the implementation modes of different ORM frameworks are different, the universality of obtaining the SQL is poor under the condition that different business of enterprises use different ORM frameworks, and in general, the SQL obtained through the ORM frameworks is not a complete SQL sentence because of the object-oriented characteristic of the ORM frameworks, and if the complete SQL needs to be obtained, the code needs to be modified generally, so that the code intrusion problem is caused.
Therefore, there is a need for an access processing method that improves the versatility of obtaining SQL and solves the code intrusion problem caused by modifying the code.
Disclosure of Invention
In view of this, the embodiment of the invention provides a method for acquiring service query information, and a method for querying service data. One or more embodiments of the present invention also relate to a service data query apparatus, a computing device, a computer-readable storage medium, and a computer program, which solve the technical drawbacks of the prior art.
According to a first aspect of an embodiment of the present invention, there is provided a method for acquiring service query information, including:
receiving an acquisition request of service inquiry information sent by a requesting party, wherein the acquisition request carries a service identifier of a target service;
calling a driving hosting unit to acquire target business query information corresponding to the business identifier, wherein the driving hosting unit is arranged between a database programming interface and a database driving unit, and the business query information recorded by the driving hosting unit comprises: the driving hosting unit obtains business query sentences from the database programming interface and/or business data query results from the database driving unit in the business data query process;
and sending the target service query information to the requester.
According to a second aspect of an embodiment of the present invention, there is provided a service data query method, including:
receiving a target service query request initiated by a query party, wherein the target service query request carries a service identifier and a service query statement of a target service;
invoking a database programming interface and forwarding the target service query request;
Calling a driving hosting unit to obtain the target service query request forwarded by the database programming interface, and determining a target database driving unit based on the target service query request, wherein the driving hosting unit is arranged between the database programming interface and the database driving unit;
invoking the target database driving unit, executing the target service query request, and obtaining a data query result of the target service from a target database corresponding to the target database driving unit;
and calling the driving hosting unit to obtain the data query result obtained by the target database driving unit, and feeding back the data query result to the querying party.
According to a third aspect of an embodiment of the present invention, there is provided a service data query device, including: the device comprises a database programming interface, a driving hosting unit and a database driving unit, wherein the driving hosting unit is arranged between the database programming interface and the database driving unit;
the database programming interface is configured to receive a target service query request initiated by a query party and forward the target service query request, wherein the target service query request carries a service identifier and a service query statement of a target service;
The drive hosting unit is configured to obtain the target service query request forwarded by the database programming interface, and determine a target database drive unit based on the target service query request;
the database driving unit is configured to execute the target service query request and obtain a data query result of the target service from a target database corresponding to the target database driving unit;
the driving hosting unit is further configured to obtain the data query result obtained by the target database driving unit, and feed back the data query result to the querying party.
According to a fourth aspect of embodiments of the present invention, there is provided a computing device comprising:
a memory and a processor;
the memory is configured to store computer executable instructions, and the processor is configured to execute the computer executable instructions, where the computer executable instructions when executed by the processor implement the method for acquiring service query information or the steps of the method for querying service data.
According to a fifth aspect of embodiments of the present invention, there is provided a computer-readable storage medium storing computer-executable instructions which, when executed by a processor, implement the above-described service query information acquisition method or the above-described service data query method steps.
According to a sixth aspect of the embodiments of the present invention, there is provided a computer program, wherein the computer program, when executed in a computer, causes the computer to execute the steps of the above-described service query information acquisition method or the above-described service data query method.
The method for acquiring the service inquiry information provided by the invention receives the acquisition request of the service inquiry information sent by the requesting party, wherein the acquisition request carries the service identifier of the target service; calling a driving hosting unit to acquire target business query information corresponding to the business identifier, wherein the driving hosting unit is arranged between a database programming interface and a database driving unit, and the business query information recorded by the driving hosting unit comprises: the driving hosting unit obtains business query sentences from the database programming interface and/or business data query results from the database driving unit in the business data query process; and sending the target service query information to the requester.
According to the embodiment of the invention, the driving hosting unit is added between the database programming interface and the database driving unit, so that the driving hosting unit can acquire the service query statement forwarded by the database programming interface and can also receive the service data query result returned by the database driving unit, and on the basis, the driving hosting unit is called to acquire the service query information corresponding to the service identifier of the target service, wherein the service query information comprises the complete service query statement acquired from the database programming interface and/or the service data query result acquired from the database driving unit. Because the top-layer frames adopt the same database programming interface no matter what frame type, the complete service query statement is acquired from the bottom-layer database programming interface, the frame type is not considered, the universality of acquiring the service query information is improved, meanwhile, the code is not required to be modified, and the code invasiveness is reduced.
Drawings
FIG. 1 is a schematic diagram of an ORM framework of the related art;
FIG. 2 (a) is a schematic diagram of a centralized access service in the related art;
FIG. 2 (b) is another schematic diagram of a centralized access service in the related art;
FIG. 3 is a schematic diagram of an interaction flow of a business data query system architecture according to an embodiment of the present invention;
FIG. 4 is a flowchart of a method for acquiring service query information according to an embodiment of the present invention;
FIG. 5 is a flow chart of a business data query method according to an embodiment of the present invention;
FIG. 6 is a process flow diagram of an acquisition method for acquiring full SQL business query information according to one embodiment of the invention;
FIG. 7 is a schematic diagram of an ORM framework in an obtaining method for obtaining service query information of complete SQL according to an embodiment of the present invention;
fig. 8 is a schematic structural diagram of a service data query device according to an embodiment of the present invention;
FIG. 9 is a block diagram of a computing device provided by one embodiment of the invention.
Detailed Description
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present invention. The present invention may be embodied in many other forms than those herein described, and those skilled in the art will readily appreciate that the present invention may be similarly embodied without departing from the spirit or essential characteristics thereof, and therefore the present invention is not limited to the specific embodiments disclosed below.
The terminology used in the one or more embodiments of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the one or more embodiments of the invention. As used in one or more embodiments of the invention and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used in one or more embodiments of the present invention means and includes any or all of the one or more associated listed items may be combined.
It should be understood that, although the terms first, second, etc. may be used in one or more embodiments of the invention to describe various information, these information should not be limited by these terms. These terms are only used to distinguish one type of information from another. For example, a first may also be referred to as a second, and similarly, a second may also be referred to as a first, without departing from the scope of one or more embodiments of the invention. The word "if" as used herein may be interpreted as "at … …" or "at … …" or "responsive to a determination", depending on the context.
Furthermore, it should be noted that, the user information (including, but not limited to, user equipment information, user personal information, etc.) and the data (including, but not limited to, data for analysis, stored data, presented data, etc.) according to one or more embodiments of the present invention are information and data authorized by the user or sufficiently authorized by each party, and the collection, use and processing of the relevant data is required to comply with relevant laws and regulations and standards of relevant countries and regions, and is provided with corresponding operation entries for the user to select authorization or rejection.
First, terms related to one or more embodiments of the present invention will be explained.
SQL: the structure query language is a language for managing and operating the database, and the operations of querying, inserting, updating, deleting and the like of the database are realized through specific commands and grammar. In the embodiment of the invention, acquiring the service SQL refers to acquiring SQL sentences operating on a database in the service execution process so as to monitor all operations of the service on the database.
Database SQL adaptation scan: a technique for optimizing query execution dynamically adjusts a scanning strategy according to the distribution of data and query conditions when executing a query to improve query performance. In this technique, in order to fully analyze and optimize a query, it is necessary to obtain complete SQL to provide accurate query semantic information.
Execution monitoring of dynamic SQL: a technique for monitoring and analyzing execution of dynamically generated SQL statements. In this technique, it is necessary to obtain complete SQL for monitoring and analysis.
SQL interception: a technique for capturing and processing SQL statements sent to a database in an application program can intercept SQL statements generated in the application program and process, modify, or monitor them. In this technique, the complete SQL needs to be intercepted for subsequent processing, modification or monitoring of the SQL statement.
SQL execution statistics: techniques for collecting and analyzing performance metrics and statistical information during execution of SQL queries. By analyzing the statistics of SQL execution, the performance of the query can be evaluated, potential bottlenecks identified, and the query optimized and adjusted. In this technique, it is necessary to obtain the complete SQL.
JDBC (Java Database Connectivity) API: i.e. the Java database programming interface, is an interface and class in a set of standard Java languages with which Java client programs can access various different types of databases. Such as establishing a database connection, executing an SQL statement to perform data access operations.
ORM framework: for mapping data in a database with objects in an object-oriented programming language. Its goal is to operate the database by using an object-oriented approach, enabling developers to do database operations by directly manipulating objects, rather than writing and executing SQL statements. Common ORM frameworks are Hibernate, myBatis, spring Data JPA, apache Cayenne, etc. For SQL acquisition, different ORM frameworks have different practices.
mycat (MySQL Cluster Autonomic Tuning): an open source database middleware is aimed at providing simplified and automated management of large-scale MySQL clusters.
drds (distributed relational database service): the distributed relational database service provides a unified SQL access interface, can distribute data on a plurality of nodes, and ensures the consistency of the data through distributed transactions.
DVU (Driver virtualization unit): the hosting unit is driven.
With the increase of business demands of various industries, enterprises often need to acquire complete business SQL (structured query language) when accessing databases in actual businesses so as to achieve the purpose of business monitoring, such as database SQL adaptive scanning, dynamic SQL execution monitoring, SQL interception, SQL execution statistics and the like.
In the prior art, SQL is not obtained directly through JDBC, but is obtained through an ORM framework to simplify service development. Illustratively, referring to FIG. 1, FIG. 1 is a schematic diagram of an ORM framework in the related art, where the ORM framework is used in an application, the ORM framework includes a JDBC interface connected to an oracle JDBC driver, a mysql JDBC driver, a postgresQL JDBC driver, the oracle JDBC driver connected to an oracle database outside the application, the mysql JDBC driver connected to a mysql database outside the application, and a postgresQL JDBC driver connected to a postgresQL database outside the application. And the developer calls the JDBC interface through the ORM framework to generate an SQL instruction and sends the SQL instruction to the corresponding JDBC driver, and the JDBC driver executes the SQL statement to finish operations such as data query, data writing, data query and the like in the database.
SQL is obtained through an ORM framework, taking the ORM framework as an example of a MyBatis framework, the SQL can be obtained through an Interceptor (Interceptor) of MyBatis, the Interceptor is a mechanism provided by MyBatis, and some operations can be performed before and after SQL is executed, such as recording and obtaining the SQL. The specific process is as follows: firstly, a developer writes a class inherited from a MyBatis interceptor interface to realize an interactive () method therein, the method can be called to record SQL sentences before SQL execution, and the SQL sentences are called to calculate the execution time of the SQL sentences after SQL execution; secondly, an interceptor is configured in MyBatis-config.xml and added into an SQL execution chain, so that when MyBatis executes SQL, the interceptor records SQL sentences before SQL execution, and calculates and outputs execution time after SQL execution. The developer can also modify the interceptor according to the actual requirement to realize other functions, such as recording SQL execution times, recording SQL start execution time and the like. It is understood that other ORM frameworks such as Hibernate can also implement the retrieval of SQL in a similar manner.
However, the types of the ORM frameworks are various, the implementation manners of different ORM frameworks are different, the universality of obtaining the SQL is poor under the condition that different business of enterprises use different ORM frameworks, and in general, the SQL obtained by the ORM frameworks is not a complete SQL sentence or even an escape non-SQL sentence because of the object-oriented characteristic of the ORM, if the complete SQL needs to be obtained, the code needs to be modified, and the code intrusion problem is caused.
Taking MyBatis framework as an example, if the most commonly used MyBatis framework needs to obtain complete SQL with parameters, the SQL with placeholders can be obtained respectively before and after the execution of the method by intercepting query and update methods of an Executor object (a component for specifically executing SQL), and then the original SQL placeholders are converted into parameter values through multi-step parameter conversion and filling, but the original SQL performance and parameter resource release are easily affected in the processing process.
In addition, centralized access services employed in the ORM framework, such as mycat, drds, mysql, proxy, are limited and protocol, are poorly versatile, and can cause access latency and throughput limitations. Referring to FIG. 2 (a), FIG. 2 (a) is a schematic diagram of a centralized access service in the related art, and a mycat component is located between the database and the distributed application. FIG. 2 (b) is another schematic diagram of a centralized access service in the related art, drds is located in the cloud, and is between rds, which is also located in the cloud, and a distributed application, which is located outside the cloud. The two centralized access services in fig. 2 (a) and fig. 2 (b) are different in protocol, so that the universality is poor, and access delay and throughput limitation are caused by acquiring the SQL.
In view of the foregoing, in the present invention, a method for acquiring service query information, a service data query method, and a service data query device, a computing device, and a computer-readable storage medium are provided, and the following embodiments are described in detail one by one.
Referring to fig. 3, fig. 3 is an interactive flow diagram of a service data query system architecture according to an embodiment of the present invention, where the service data query system includes a database programming interface, a driving hosting unit and a database driving unit, and includes a query party, a request party and a database in addition to the service data query system. The inquiring party is used for sending an acquiring request of the service inquiring information to the service inquiring system. The database programming interface is used for generating a service inquiry statement based on the acquisition request of the service inquiry information and sending the service inquiry statement to the driving hosting unit. The drive hosting unit is used for sending the business query statement to the database drive unit and recording the business query statement; the driving hosting unit is also used for receiving a request for acquiring the service query information initiated by the requester and returning a service query statement to the requester in response to the request for acquiring the service query information initiated by the requester. The database driving unit is provided with an execution service query statement, acquires a service data query result from the database, and returns the service data query result to the service data query system, so that the service data query system returns the service data query result to the query party.
It will be appreciated that the requestor and the inquirer may be the same port.
According to the business data query system, the driving hosting unit is added between the database programming interface and the database driving unit, so that the driving hosting unit can acquire business query sentences forwarded by the database programming interface and can also receive business data query results returned by the database driving unit, and on the basis, the driving hosting unit is called to acquire business query information corresponding to business identifications of target businesses, wherein the business query information comprises complete business query sentences acquired from the database programming interface and/or business data query results acquired from the database driving unit. Because the top-layer frames adopt the same database programming interface no matter what frame type, the complete service query statement is acquired from the bottom-layer database programming interface, the frame type is not considered, the universality of acquiring the service query information is improved, meanwhile, the code is not required to be modified, and the code invasiveness is reduced.
Referring to fig. 4, fig. 4 is a flowchart of a method for acquiring service query information according to an embodiment of the present invention, which specifically includes the following steps.
Step 402: and receiving an acquisition request of service inquiry information sent by a requester, wherein the acquisition request carries a service identifier of a target service.
The service query information is related information in the service data query process, for example, the service query information may be an SQL statement in the service data query process. The service identifier is an identifier for indicating a target service, and can be a numerical identifier, a character string identifier or a combination identifier of a number and a character string.
In practical application, a requester may send an acquisition request of service query information to a service data query system through HTTP (Hypertext Transfer Protocol ) or other communication protocols, where the request content includes a service identifier of an acquisition target service, and after the service data query receives the acquisition request of the service query information, the acquisition request of the service query information is parsed to obtain the service identifier of the target service.
In a specific embodiment of the present invention, taking service query information as an example of an SQL statement, a request is sent to a service data query system to obtain a request of an SQL statement of a target service, and after receiving the request of the SQL statement of the target service, the service query system first analyzes to determine a service identifier of the target service.
Further, before the receiving the request for acquiring the service query information sent by the requesting party, the method further includes: acquiring a sample service query request, calling a database programming interface, and forwarding the sample service query request; and calling a driving hosting unit to obtain the sample service query request forwarded by the database programming interface, analyzing the sample service query request to obtain a service identifier and a service query statement of the sample service, and recording the service identifier and the service query statement of the sample service.
Wherein the sample service query request carries a service identifier and a service query statement of a sample service,
in practical applications, the service data query system needs to first obtain a sample service query request before receiving an obtaining request for sending service query information by a requester. After the sample service query request is obtained, the service data query system calls the database programming interface to forward the sample service query request to the database programming interface, so that the content of the sample request is transferred to the database programming interface. The database programming interface communicates the sample business query request to the drive hosting unit for processing the sample business query request at the drive hosting unit. The drive hosting unit is located between the database programming interface and the database drive unit and is responsible for coordinating the access and query processes of the database. After obtaining the sample request, the drive hosting unit analyzes the sample request. And extracting the service identification and the service query statement of the sample service from the sample service query request. After analyzing the sample service query request, the driving hosting unit records the service identification and the service query statement of the sample service for subsequent query analysis, performance optimization or other scenes needing to use the sample service information.
Based on this, the sample business information can be used as a reference in the actual business query, further optimizing the query logic and results. Meanwhile, the recording of sample service information is also beneficial to subsequent data analysis, problem investigation and other works.
Further, before the recording of the service identifier and the service query statement of the sample service, the method further comprises: responding to a processing instruction of a service query statement of the sample service, calling a driving hosting unit, and processing the service query statement of the sample service to obtain a processed service query statement of the sample service; the recording the service identification and service query statement of the sample service comprises the following steps: and recording the service identification of the sample service and the service query statement of the processed sample service.
The processing instructions may include processing operation instructions such as recording, copying, forwarding, and rewriting of the service query statement.
In practical application, in response to a processing instruction of a service query statement for a sample service, before recording a service identifier and the service query statement of the sample service, the driving hosting unit needs to copy, forward, rewrite and the like the service query statement for the sample service to obtain a processed sample service query statement so as to meet specific requirements and targets of an initiator of the processing instruction. After the processed sample service query statement is obtained, the service identification of the sample service and the processed sample service query statement are recorded. This allows the key information of the sample service to be saved for later reference, analysis or other purposes requiring the use of the sample service information.
Based on this, additional processing can be performed on the service query statement of the sample service, and the processed sample service information is retained for subsequent query and analysis.
Further, before the receiving the request for acquiring the service query information sent by the requesting party, the method further includes: receiving registration information of the database driving unit; and calling the driving hosting unit, and performing registration operation on the database driving unit based on the registration information of the database driving unit.
The registration information may include information such as a host name, a port number, a database name, a user name, and a password of the database, and may further include a name and a version number designating a database drive unit to be used, for example: drive unit name: mySQL JDBC Driver, version number: 8.0.23. the registration operation may include verifying the identity of the database driver unit, establishing a connection with the database, loading necessary configurations, setting the required permissions, etc.
In practical application, before receiving a service query information acquisition request sent by a requester, first, registration information of a database driving unit needs to be received. These registration information are identity information provided by the database driver unit in relation to the database driver unit or the database itself for the database driver unit to register with the driver hosting unit for establishing a connection and interaction with the database. And after receiving the registration information of the database driving unit, calling the driving hosting unit to perform registration operation.
In one embodiment of the present invention, the registration information is used as the name of the database driving unit: mySQL JDBC Driver, version number: 8.0.23, the driving hosting unit is used for driving the database according to the received registration information to name the database driving unit: mySQL JDBC Driver, version number: the 8.0.23 database driving unit performs registration operation, and establishes a link and interaction between the driving hosting unit and the MySQL database.
Based on the method, the database driving unit and the driving hosting unit are ensured to establish correct connection, necessary support and functions are provided in subsequent query operation, the database query can be smoothly carried out, and the database driving unit can correctly communicate and interact with the database.
Further, before the receiving the registration information of the database driving unit, the method further includes: acquiring registration information of the driving hosting unit; and sending the registration information of the driving hosting unit to a registration management end so that the registration management end carries out registration operation on the driving hosting unit based on the registration information of the driving hosting unit.
The registration management end may be a driver manager located in the application program, and the registration information of the driver hosting unit may include information such as identity, configuration parameters, rights and the like of the driver hosting unit. The registration operation may include operations of verifying the identity of the drive hosting unit, establishing a connection with the drive hosting unit, loading necessary configurations, setting required rights, and the like.
In practical applications, before receiving registration information of the database driving unit, it is necessary to first obtain registration information of the driving hosting unit, where the registration information may include content such as identity, configuration parameters, available functions, required rights, and the like of the driving hosting unit. After obtaining the registration information of the driving managed unit, the registration information is sent to a registration management end, and the registration management end can be a service end specially responsible for managing and maintaining the registration information and can be used for coordinating and managing the registration operation of the driving managed unit.
In a specific embodiment of the present invention, the registration information is taken as an identity, a configuration parameter, an available function and a required authority of the driving hosting unit, and the registration management end is taken as a driving manager located in the application program as an example. Before receiving the registration information of the database driving unit, the driving hosting unit needs to send the identity of the driving hosting unit, the configuration parameters, the available functions and the required rights to a driving manager located in the application program. The drive manager performs operations such as verifying the identity of the drive hosting unit, establishing connection with the drive hosting unit, loading necessary configuration, setting required rights and the like according to the received identity, configuration parameters, available functions and required rights of the drive hosting unit, so as to establish a link with the drive hosting unit.
Based on this, registering the drive hosting unit to the drive management end ensures the correct connection and co-operation between the drive hosting unit and the database drive unit, while ensuring consistency between the drive hosting unit and the database drive unit.
Step 404: calling a driving hosting unit to acquire target business query information corresponding to the business identifier, wherein the driving hosting unit is arranged between a database programming interface and a database driving unit, and the business query information recorded by the driving hosting unit comprises: and in the service data query process, the driving hosting unit obtains service query sentences from the database programming interface and/or service data query results from the database driving unit.
The database programming interface is a program interface or programming interface for interacting with a database, and provides a set of methods, classes, functions or protocols, so that an application program can communicate with the database through a programming language, perform operations such as querying, inserting or updating data. The database driver unit is a software component for interfacing with and communicating with a particular database, acting as a bridge between the application and the database, enabling the application to interact with the database in a standardized manner by providing interfaces and functionality.
In practical application, after receiving the acquisition request, the service data query system firstly analyzes the request content to obtain the service identifier of the target service; secondly, calling a driving hosting unit to acquire service query information of the target service, wherein the driving hosting unit is positioned between a database programming interface and a database driving unit and is responsible for coordinating access and query processes of a database, and the calling of the driving hosting unit to acquire the service query information of the target service specifically comprises the following steps: the driving host unit obtains a business query statement from the database programming interface according to the business identifier, the driving host unit can record the business query statement and transmit the business query statement to the database driving unit, and the database driving unit obtains a business data query result and returns the business data query result to the driving host unit. Through the steps, the driving hosting unit acquires the service query information related to the target service.
In a specific embodiment of the present invention, taking service query information as an example of an SQL statement, after receiving an acquisition request, a service data query system first analyzes the request content to obtain a service identifier of a target service; and secondly, calling the driving hosting unit to acquire SQL sentences from the database programming interface according to the service identification, and recording the SQL sentences.
Further, after the call driving hosting unit obtains the sample service query request forwarded by the database programming interface, the method further includes: invoking the driving hosting unit, and determining a target database driving unit based on the sample service query request; invoking the target database driving unit, executing the sample service query statement, and obtaining a data query result of the sample service from a target database corresponding to the target database driving unit; and calling the driving hosting unit to obtain the data query result obtained by the target database driving unit, and recording the data query result.
In practical application, first, the drive hosting unit receives a sample service query request forwarded by the database programming interface. This request may contain business query statements, parameters, and other necessary information; secondly, the driving hosting unit determines a target database driving unit which needs to execute the sample service query request according to the content of the sample service query request; then, the driving hosting unit calls a target database driving unit and transmits a sample service query statement to the target database driving unit, and the target database driving unit executes the sample service query statement and establishes connection with a corresponding target database; and finally, the target database driving unit executes the sample business query statement, obtains the data query result from the target database, returns the query result to the driving hosting unit, and records the data query result by the driving hosting unit.
Based on the method, the query operation of the sample service is realized.
Further, before the calling the target database driving unit and executing the sample service query statement, the method further comprises: and calling the driving hosting unit, and constructing an access link with the target database through the target database driving unit.
The access link is a link for data transfer and communication between the database driving unit and the database.
In practical application, before executing a sample service query statement, firstly, configuring parameters required for constructing an access link, such as a host name, a port number, a database name, a user name, a password and the like of a database; secondly, calling a database driver to establish connection between a database driver unit and a database; then, the database performs identity verification and authority verification on the connection, wherein the identity verification and the authority verification generally relate to verification of a user name and a password; finally, optionally, when the application program no longer needs to communicate with the database, the database connection can be closed, so that the resources and connections with the database can be released, and the resource leakage and performance problems can be prevented.
Based on this, the construction of the access link provides a basis for the interaction and data transfer of the database driver unit with the database
Step 406: and sending the target service query information to the requester.
In practical application, the driving hosting unit sends the target service query information to the requester after acquiring the target service query information.
In a specific embodiment of the present invention, taking the target service query information as an SQL statement as an example, the driving hosting unit sends the SQL statement to the requester after obtaining the SQL statement.
Further, the sending the target service query information to the requester includes: caching the target service query information into an asynchronous queue; and forwarding the target service query information to the requester by using the asynchronous queue.
The asynchronous queue is a data structure for storing and managing tasks to be processed, and caching the target service query information into the asynchronous queue can ensure that the target service query information can be effectively processed in a subsequent processing process.
In practical application, firstly, storing target service inquiry information into an asynchronous queue for caching; secondly, the asynchronous queue is used as a middle layer, and the cached target service query information is sent to a requester from the drive hosting unit.
Based on the method, safe and efficient forwarding and processing between the target service query information transferred from the driver to the requester are ensured.
According to the embodiment of the invention, the driving hosting unit is added between the database programming interface and the database driving unit, so that the driving hosting unit can acquire the service query statement forwarded by the database programming interface and can also receive the service data query result returned by the database driving unit, and on the basis, the driving hosting unit is called to acquire the service query information corresponding to the service identifier of the target service, wherein the service query information comprises the complete service query statement acquired from the database programming interface and/or the service data query result acquired from the database driving unit. Because the top-layer frames adopt the same database programming interface no matter what frame type, the complete service query statement is acquired from the bottom-layer database programming interface, the frame type is not considered, the universality of acquiring the service query information is improved, the code is not required to be modified, and the code invasiveness is reduced
Referring to fig. 5, fig. 5 is a flowchart of a service data query method according to an embodiment of the present invention, which specifically includes the following steps.
Step 502: and receiving a target service query request initiated by a query party, wherein the target service query request carries a service identifier and a service query statement of a target service.
Wherein a business query statement is a statement or language for a database query that describes the query operation to be performed in the database, typically an SQL statement or similar query language, that describes the conditions, parameters, and data to be returned, etc. of the query.
In practical application, the querying party can send a service data query request to the service data query system through HTTP or other communication protocols, wherein the request content comprises a service identifier and a service query statement for acquiring the target service, and after the service data query receives the service data query request, the service data query request is analyzed to obtain the service identifier and the service query statement of the target service.
In a specific embodiment of the present invention, taking a service query statement as an example, a request sends a request for querying service data to a service data query system, and after receiving the request for querying service data, the service query system first analyzes the request to determine a service identifier and a service query statement of a target service.
Step 504: and calling a database programming interface and forwarding the target service query request.
Wherein the database programming interface is a program interface or programming interface for interacting with the database, such as a JDBC interface.
In practical application, before the database programming interface is called, the connection between the database programming interface and the forwarding object can be established, and then the target service query request is forwarded by calling the database programming interface.
Step 506: and calling a driving hosting unit to obtain the target service query request forwarded by the database programming interface, and determining a target database driving unit based on the target service query request, wherein the driving hosting unit is arranged between the database programming interface and the database driving unit.
The database programming interface is a program interface or programming interface for interacting with a database, and provides a set of methods, classes, functions or protocols, so that an application program can communicate with the database through a programming language, perform operations such as querying, inserting or updating data. The database driver unit is a software component for interfacing with and communicating with a particular database, acting as a bridge between the application and the database, enabling the application to interact with the database in a standardized manner by providing interfaces and functionality.
In practical application, the database programming interface calls the driving hosting unit, receives the target service query request and transmits the target service query request to the driving hosting unit, and the driving hosting unit is responsible for coordinating the access and query processes of the database and is arranged between the database programming interface and the database driving unit.
Step 508: and calling the target database driving unit, executing the target service query request, and obtaining a data query result of the target service from a target database corresponding to the target database driving unit.
In practical application, based on the target service query request, the driving hosting unit determines the target database driving unit according to the service identification and the specific requirement of the query statement. The target database driver unit is a component that specifically performs database queries and operations, and is associated with a particular database management system. After receiving the target service query request, the target database driving unit executes specific query operation in the database according to the service identification and query statement in the query request.
Step 510: and calling the driving hosting unit to obtain the data query result obtained by the target database driving unit, and feeding back the data query result to the querying party.
In practical applications, once the query operation of the target database driving unit is completed, the target database driving unit returns the query result to the driving hosting unit. The query results may be a dataset, cursor, or other suitable representation of the data of the query.
In order to more clearly illustrate the technical solution provided by the embodiment of the present invention, taking an acquisition method applied to acquiring service query information of complete SQL as an example, referring to fig. 6, fig. 6 is a process flow chart of an acquisition method applied to acquiring service query information of complete SQL provided by one embodiment of the present invention, specifically including:
in step 602, the dvu registers with the drive manager.
In one implementation manner, referring to fig. 7, fig. 7 is a schematic structural diagram of an ORM framework in an obtaining method applied to obtaining service query information of complete SQL according to an embodiment of the present invention, which specifically includes:
JDBC interface: for communication between Java applications and DVU.
DVU: the device comprises a DVU JDBC, a drive hosting component, an SQL routing component and an expansion unit, wherein the DVU JDBC is used for being linked with a JDBC interface and receiving content or a request forwarded by the JDBC interface; the driving hosting component is used for registering the database driving unit, constructing a communication link between the database driving unit and the database and storing SQL sentences; the SQL routing component is used for executing operations such as overwriting, copying, forwarding and the like on the recorded SQL sentences, and the expansion unit is used for adding functions of the DVU.
Oracle jdbc drive, mysql jdbc drive, postgresQL jdbc drive: the driver of Oracle database, the driver of mysql database and the driver of postgresQL database are respectively adopted.
The DVU registering with the driver manager specifically includes: upon application launch, DVU JDBC is registered in the JDBC driver manager located in the application. The specific registration process is described with reference to the above embodiments, and will not be described here again.
In step 604, the database driver registers with the DVU.
In one implementation, referring to FIG. 7, the Oracle jdbc driver, the mysql jdbc driver, the postgresQL jdbc driver are registered with a driver hosting component in the DVU, the lifecycle of the Oracle jdbc driver, the mysql jdbc driver, the postgresQL jdbc driver is managed by the DVU, and a communication connection is established between the Oracle jdbc driver, the mysql jdbc driver, the postgresQL jdbc driver and the Oracle database, the mysql database, and the postgresQL database. The specific registration process and the communication connection construction process are described with reference to the above embodiments, and are not described herein.
Step 606, forward the database access request to the DVU.
In one implementation, referring to FIG. 7, when an application accesses a database using a JDBC interface, the JDBC driver manager forwards a request for database access to the DVU via the JDBC interface, and specifically to the DVU via the DVU JDBC. The specific forwarding process is described with reference to the above embodiments, and will not be described herein.
At step 608, a target database driver unit is determined.
In one implementation, referring to fig. 7, the DVU looks for a jdbc driver corresponding to a database access request, constructs a database access link, and distributes the database access request through an SQL routing component. The SQL routing component can do things related to SQL including SQL analysis, recording, forwarding, overwriting, copying, etc. The process of determining the target data driving unit specifically is described with reference to the above embodiments, and will not be described herein.
Step 610, the forwarding database access request is sent to the target database drive unit.
In one implementation, referring to FIG. 7, the DVU distributes SQL statements and parameter values of the SQL statements in the access database request to the target jdbc driver, which executes the SQL statements. The specific distribution process and the execution process are described with reference to the above embodiments, and are not described herein.
In step 612, the database driver unit executes the SQL statement and returns the query result.
In one implementation, referring to FIG. 7, the target jdbc driver returns the query result to the DVU after the SQL statement has been executed. The return process is described with reference to the above embodiments, and will not be described here again.
In step 614, the dvu returns the query results to the application.
In one implementation, referring to FIG. 7, the DVU forwards the query results to the application. The forwarding process is described with reference to the above embodiments, and will not be described here again.
Through the above procedure, the drive hosting unit can monitor and record SQL statements and parameter values of the application access database without modifying the application code.
When the method is used, only a driving package for driving the virtualization unit is needed to be added, the JDBC driver of the service is directed to the driving virtualization unit, then the normal database driving configuration is put into the management_config.properties in the Managed driving configuration file of the virtualization unit, and the service is restarted.
Because the method is only used for recording complete SQL, the asynchronous queue is pushed and forwarded after the complete SQL is obtained in an SQL execution interface of the virtualization unit, the operation is completed in a JVM memory, no data copying process is performed, the life cycle of SQL data is only delayed, and a local file is output from the asynchronous queue or is recovered through a pipeline after consumption. The whole process does not affect the existing SQL access.
Corresponding to the above method embodiment, the present invention further provides an embodiment of a service data query device, and fig. 8 is a schematic structural diagram of a service data query device according to one embodiment of the present invention. As shown in fig. 8, the apparatus includes:
A database programming interface 802 configured to receive a target service query request initiated by a querying party, and forward the target service query request, where the target service query request carries a service identifier and a service query statement of a target service.
A drive hosting unit 804 configured to obtain the target business query request forwarded by the database programming interface 802, determine a target database drive unit based on the target business query request.
The database driving unit 806 is configured to execute the target service query request, and obtain a data query result of the target service from a target database corresponding to the target database driving unit.
The driving hosting unit 804 is further configured to obtain the data query result obtained by the target database driving unit, and feed back the data query result to the querying party.
Further, the driving hosting unit 804 is further configured to parse the target service query request to obtain a service identifier and a service query statement of the target service, and record the service identifier and the service query statement of the target service.
In practical applications, the driving hosting unit 804 parses the sample request after obtaining it. And extracting the service identification and the service query statement of the sample service from the sample service query request. After parsing the sample service query request, the driving hosting unit 804 records the service identifier and the service query statement of the sample service for subsequent query analysis, performance optimization, or other scenarios requiring use of sample service information.
Further, the driving hosting unit 804 is further configured to record the data query result.
In practical application, after the target database driving unit executes the sample business query statement, the data query result is obtained from the target database, and the query result is returned to the driving hosting unit 804, the driving hosting unit 804 records the data query result.
Further, the driving hosting unit 804 is further configured to receive an acquisition request of service query information sent by a requester, where the acquisition request carries a service identifier of the target service; and acquiring target service query information corresponding to the service identifier, and sending the target service query information to the requester.
In practical application, the driving hosting unit 804 obtains a service query statement from the database programming interface 802 according to the service identifier, the driving hosting unit 804 can record the service query statement and transmit the service query statement to the database driving unit, and the database driving unit obtains a service data query result and returns the service data query result to the driving hosting unit 804. At this time, the driving hosting unit 804 acquires the service query statement and the service data query result, and then, the driving hosting unit 804 receives an acquisition request of the service query information sent by the requester, and returns the service data query result and/or the service query statement according to the acquisition request of the service query information.
The foregoing is a schematic solution of a service data query device in this embodiment. It should be noted that, the technical solution of the service data query device and the technical solution of the service data query method belong to the same concept, and details of the technical solution of the service data query device, which are not described in detail, can be referred to the description of the technical solution of the service data query method.
The service data query device comprises a database programming interface, a database driving unit, a driving host unit, a database data query unit and a service data query unit, wherein the driving host unit is arranged between the database programming interface and the database driving unit, so that the driving host unit can acquire service query sentences forwarded by the database programming interface and can also receive service data query results returned by the database driving unit, and on the basis, the driving host unit is called to acquire service query information corresponding to service identifiers of target services, and the service query information comprises complete service query sentences acquired from the database programming interface and/or service data query results acquired from the database driving unit. Because the top-layer frames adopt the same database programming interface no matter what frame type, the complete service query statement is acquired from the bottom-layer database programming interface, the frame type is not considered, the universality of acquiring the service query information is improved, meanwhile, the code is not required to be modified, and the code invasiveness is reduced.
Fig. 9 illustrates a block diagram of a computing device 900 provided in accordance with one embodiment of the present invention. The components of computing device 900 include, but are not limited to, memory 910 and processor 920. Processor 920 is coupled to memory 910 via bus 930 with database 950 configured to hold data.
Computing device 900 also includes an access device 940, access device 940 enabling computing device 900 to communicate via one or more networks 960. Examples of such networks include public switched telephone networks (PSTN, public Switched Telephone Network), local area networks (LAN, local Area Network), wide area networks (WAN, wide Area Network), personal area networks (PAN, personal Area Network), or combinations of communication networks such as the internet. Access device 940 may include one or more of any type of network interface, wired or wireless, such as a network interface card (NIC, network interface controller), such as an IEEE802.11 wireless local area network (WLAN, wireless Local Area Network) wireless interface, a worldwide interoperability for microwave access (Wi-MAX, worldwide Interoperability for Microwave Access) interface, an ethernet interface, a universal serial bus (USB, universal Serial Bus) interface, a cellular network interface, a bluetooth interface, near field communication (NFC, near Field Communication).
In one embodiment of the invention, the above-described components of computing device 900, as well as other components not shown in FIG. 9, may also be connected to each other, such as by a bus. It should be understood that the block diagram of the computing device illustrated in FIG. 9 is for exemplary purposes only and is not intended to limit the scope of the present invention. Those skilled in the art may add or replace other components as desired.
Computing device 900 may be any type of stationary or mobile computing device including a mobile computer or mobile computing device (e.g., tablet, personal digital assistant, laptop, notebook, netbook, etc.), mobile phone (e.g., smart phone), wearable computing device (e.g., smart watch, smart glasses, etc.), or other type of mobile device, or a stationary computing device such as a desktop computer or personal computer (PC, personal Computer). Computing device 900 may also be a mobile or stationary server.
The processor 920 is configured to execute computer-executable instructions that, when executed by the processor, implement the method for acquiring service query information or the steps of the service data query method.
The foregoing is a schematic illustration of a computing device of this embodiment. It should be noted that, the technical solution of the computing device and the above-mentioned method for obtaining service query information or the technical solution of the above-mentioned service data query method belong to the same concept, and details of the technical solution of the computing device that are not described in detail may refer to the description of the above-mentioned method for obtaining service query information or the above-mentioned method for obtaining service data query.
An embodiment of the present invention further provides a computer-readable storage medium storing computer-executable instructions that, when executed by a processor, implement the method for acquiring service query information or the steps of the service data query method.
The above is an exemplary version of a computer-readable storage medium of the present embodiment. It should be noted that, the technical solution of the storage medium and the above-mentioned method for acquiring service query information or the technical solution of the above-mentioned service data query method belong to the same concept, and details of the technical solution of the storage medium that are not described in detail may refer to the description of the above-mentioned method for acquiring service query information or the above-mentioned technical solution of the service data query method.
An embodiment of the present invention further provides a computer program, where when the computer program is executed in a computer, the computer is caused to execute the above method for acquiring service query information or the above method for querying service data.
The above is an exemplary version of a computer program of the present embodiment. It should be noted that, the technical solution of the computer program and the technical solution of the service query information acquiring method or the service data query method belong to the same concept, and details of the technical solution of the computer program, which are not described in detail, can be referred to the description of the service query information acquiring method or the service data query method.
The foregoing describes certain embodiments of the present invention. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims can be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
The computer instructions include computer program code that may be in source code form, object code form, executable file or some intermediate form, etc. The computer readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer Memory, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), an electrical carrier signal, a telecommunications signal, a software distribution medium, and so forth. It should be noted that the content of the computer readable medium can be increased or decreased appropriately according to the requirements of the patent practice, for example, in some areas, according to the patent practice, the computer readable medium does not include an electric carrier signal and a telecommunication signal.
It should be noted that, for simplicity of description, the foregoing method embodiments are all described as a series of combinations of actions, but it should be understood by those skilled in the art that the embodiments of the present invention are not limited by the order of actions described, as some steps may be performed in other order or simultaneously in accordance with the embodiments of the present invention. Further, those skilled in the art will appreciate that the embodiments described in the specification are presently preferred, and that the acts and modules referred to are not necessarily all required in the embodiments of the invention.
In the foregoing embodiments, the descriptions of the embodiments are emphasized, and for parts of one embodiment that are not described in detail, reference may be made to the related descriptions of other embodiments.
The preferred embodiments of the invention disclosed above are intended only to assist in the explanation of the invention. Alternative embodiments are not intended to be exhaustive or to limit the invention to the precise form disclosed. Obviously, many modifications and variations are possible in light of the teachings of the embodiments of the present invention. The embodiments were chosen and described in order to best explain the principles of the embodiments and the practical application, to thereby enable others skilled in the art to best understand and utilize the invention. The invention is limited only by the claims and the full scope and equivalents thereof.

Claims (15)

1. The method for acquiring the service query information is characterized by comprising the following steps:
receiving an acquisition request of service inquiry information sent by a requesting party, wherein the acquisition request carries a service identifier of a target service;
calling a driving hosting unit to acquire target business query information corresponding to the business identifier, wherein the driving hosting unit is arranged between a database programming interface and a database driving unit, and the business query information recorded by the driving hosting unit comprises: the driving hosting unit obtains business query sentences from the database programming interface and/or business data query results from the database driving unit in the business data query process;
And sending the target service query information to the requester.
2. The method of claim 1, wherein said sending the target service query information to the requestor comprises:
caching the target service query information into an asynchronous queue;
and forwarding the target service query information to the requester by using the asynchronous queue.
3. The method of claim 1, further comprising, prior to receiving the request for acquisition of the service query information sent by the requesting party:
acquiring a sample service query request, wherein the sample service query request carries a service identifier and a service query statement of a sample service;
invoking a database programming interface and forwarding the sample service query request;
and calling a driving hosting unit to obtain the sample service query request forwarded by the database programming interface, analyzing the sample service query request to obtain a service identifier and a service query statement of the sample service, and recording the service identifier and the service query statement of the sample service.
4. A method according to claim 3, further comprising, prior to said recording the service identification and service query statement of the sample service:
Responding to a processing instruction of a service query statement of the sample service, calling a driving hosting unit, and processing the service query statement of the sample service to obtain a processed service query statement of the sample service;
the recording the service identification and service query statement of the sample service comprises the following steps:
and recording the service identification of the sample service and the service query statement of the processed sample service.
5. A method according to claim 3, further comprising, after the call-driven hosting unit obtains the sample service query request forwarded by the database programming interface:
invoking the driving hosting unit, and determining a target database driving unit based on the sample service query request;
invoking the target database driving unit, executing the sample service query statement, and obtaining a data query result of the sample service from a target database corresponding to the target database driving unit;
and calling the driving hosting unit to obtain the data query result obtained by the target database driving unit, and recording the data query result.
6. The method of claim 5, further comprising, prior to said invoking said target database driver unit to obtain said data query result from said target database driver unit and recording said data query result:
And calling the driving hosting unit, and constructing an access link with the target database through the target database driving unit.
7. The method according to any one of claims 1-6, further comprising, prior to said receiving the request for acquisition of the service query information sent by the requesting party:
receiving registration information of the database driving unit;
and calling the driving hosting unit, and performing registration operation on the database driving unit based on the registration information of the database driving unit.
8. The method of claim 7, further comprising, prior to said receiving registration information for the database driver unit:
acquiring registration information of the driving hosting unit;
and sending the registration information of the driving hosting unit to a registration management end so that the registration management end carries out registration operation on the driving hosting unit based on the registration information of the driving hosting unit.
9. A business data query method, comprising:
receiving a target service query request initiated by a query party, wherein the target service query request carries a service identifier and a service query statement of a target service;
Invoking a database programming interface and forwarding the target service query request;
calling a driving hosting unit to obtain the target service query request forwarded by the database programming interface, and determining a target database driving unit based on the target service query request, wherein the driving hosting unit is arranged between the database programming interface and the database driving unit;
invoking the target database driving unit, executing the target service query request, and obtaining a data query result of the target service from a target database corresponding to the target database driving unit;
and calling the driving hosting unit to obtain the data query result obtained by the target database driving unit, and feeding back the data query result to the querying party.
10. A business data query device, comprising: the device comprises a database programming interface, a driving hosting unit and a database driving unit, wherein the driving hosting unit is arranged between the database programming interface and the database driving unit;
the database programming interface is configured to receive a target service query request initiated by a query party and forward the target service query request, wherein the target service query request carries a service identifier and a service query statement of a target service;
The drive hosting unit is configured to obtain the target service query request forwarded by the database programming interface, and determine a target database drive unit based on the target service query request;
the database driving unit is configured to execute the target service query request and obtain a data query result of the target service from a target database corresponding to the target database driving unit;
the driving hosting unit is further configured to obtain the data query result obtained by the target database driving unit, and feed back the data query result to the querying party.
11. The apparatus of claim 10, wherein the drive hosting unit is further configured to parse the target service query request to obtain a service identification and a service query statement for the target service, and record the service identification and the service query statement for the target service.
12. The apparatus of claim 10, wherein the drive hosting unit is further configured to record the data query results.
13. The apparatus according to claim 11 or 12, wherein the drive hosting unit is further configured to receive an acquisition request of service query information sent by a requester, wherein the acquisition request carries a service identifier of the target service; and acquiring target service query information corresponding to the service identifier, and sending the target service query information to the requester.
14. A computing device, comprising:
a memory and a processor;
the memory is configured to store computer executable instructions, and the processor is configured to execute the computer executable instructions, which when executed by the processor implement the steps of the service query information acquisition method according to any one of claims 1 to 8 or the service data query method according to claim 9.
15. A computer readable storage medium storing computer executable instructions which when executed by a processor implement the steps of the service query information acquisition method of any one of claims 1 to 8 or the service data query method of claim 9.
CN202311290005.8A 2023-10-08 2023-10-08 Service query information acquisition method, service data query method and device Active CN117033748B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311290005.8A CN117033748B (en) 2023-10-08 2023-10-08 Service query information acquisition method, service data query method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311290005.8A CN117033748B (en) 2023-10-08 2023-10-08 Service query information acquisition method, service data query method and device

Publications (2)

Publication Number Publication Date
CN117033748A true CN117033748A (en) 2023-11-10
CN117033748B CN117033748B (en) 2024-02-06

Family

ID=88641538

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311290005.8A Active CN117033748B (en) 2023-10-08 2023-10-08 Service query information acquisition method, service data query method and device

Country Status (1)

Country Link
CN (1) CN117033748B (en)

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110321010A1 (en) * 2010-06-24 2011-12-29 Yifei Wang Web application framework based on object oriented class mapping
US20130054630A1 (en) * 2011-08-30 2013-02-28 International Business Machines Corporation Pre-generation of structured query language (sql) from application programming interface (api) defined query systems
CN103699620A (en) * 2013-12-19 2014-04-02 珠海世纪鼎利通信科技股份有限公司 Method and system for achieving database operation by utilizing object relational mapping (ORM) frame in object orientation
US9507820B1 (en) * 2012-10-23 2016-11-29 Dell Software Inc. Data modeling system for runtime schema extensibility
CN107818127A (en) * 2017-09-09 2018-03-20 国网浙江省电力公司 A kind of querying method and system for multi-source data
US20190026330A1 (en) * 2017-07-24 2019-01-24 Jpmorgan Chase Bank, N.A. System and method for implementing query tagging
CN111400388A (en) * 2020-03-20 2020-07-10 北京东方金信科技有限公司 Method and system for uniformly connecting and sharing multiple data sources
CN114153870A (en) * 2021-12-02 2022-03-08 中国建设银行股份有限公司 JDBC-based data query method, device, server and medium
CN114416773A (en) * 2021-12-30 2022-04-29 联通智网科技股份有限公司 Data processing method, device, storage medium and server
US20220405296A1 (en) * 2021-06-17 2022-12-22 Sap Se Importing data objects metadata based on application interface to service entity mappings
CN116561208A (en) * 2023-05-10 2023-08-08 上海中通吉网络技术有限公司 Method, device and equipment for unifying OpenAPI query interfaces

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110321010A1 (en) * 2010-06-24 2011-12-29 Yifei Wang Web application framework based on object oriented class mapping
US20130054630A1 (en) * 2011-08-30 2013-02-28 International Business Machines Corporation Pre-generation of structured query language (sql) from application programming interface (api) defined query systems
US9507820B1 (en) * 2012-10-23 2016-11-29 Dell Software Inc. Data modeling system for runtime schema extensibility
CN103699620A (en) * 2013-12-19 2014-04-02 珠海世纪鼎利通信科技股份有限公司 Method and system for achieving database operation by utilizing object relational mapping (ORM) frame in object orientation
US20190026330A1 (en) * 2017-07-24 2019-01-24 Jpmorgan Chase Bank, N.A. System and method for implementing query tagging
CN107818127A (en) * 2017-09-09 2018-03-20 国网浙江省电力公司 A kind of querying method and system for multi-source data
CN111400388A (en) * 2020-03-20 2020-07-10 北京东方金信科技有限公司 Method and system for uniformly connecting and sharing multiple data sources
US20220405296A1 (en) * 2021-06-17 2022-12-22 Sap Se Importing data objects metadata based on application interface to service entity mappings
CN114153870A (en) * 2021-12-02 2022-03-08 中国建设银行股份有限公司 JDBC-based data query method, device, server and medium
CN114416773A (en) * 2021-12-30 2022-04-29 联通智网科技股份有限公司 Data processing method, device, storage medium and server
CN116561208A (en) * 2023-05-10 2023-08-08 上海中通吉网络技术有限公司 Method, device and equipment for unifying OpenAPI query interfaces

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
伍文彬;: "Spring环境下的敏捷ORM框架设计与实现", 软件导刊, no. 05, pages 140 - 142 *
杨葶;: "基于深证通FDEP平台的电子指令管理系统设计", 电子技术与软件工程, no. 12, pages 162 - 163 *
温皓晴;靳晓松;: "轻量级ORM数据访问框架SqlBuilder.NET的设计与实现", 计算机与网络, no. 03, pages 75 - 77 *

Also Published As

Publication number Publication date
CN117033748B (en) 2024-02-06

Similar Documents

Publication Publication Date Title
US11392586B2 (en) Data protection method and device and storage medium
US8321450B2 (en) Standardized database connectivity support for an event processing server in an embedded context
US10749990B1 (en) Automatic discovery of API information
US8387076B2 (en) Standardized database connectivity support for an event processing server
US7640230B2 (en) Query plan selection control using run-time association mechanism
US9081835B2 (en) Edge deployed database proxy driver
WO2015101151A1 (en) Session processing method, device and system
WO2018035799A1 (en) Data query method, application and database servers, middleware, and system
US20160034582A1 (en) Computing device and method for executing database operation command
US11243921B2 (en) Database expansion system, equipment, and method of expanding database
WO2020238597A1 (en) Hadoop-based data updating method, device, system and medium
US20230092752A1 (en) System and method for development of gateway policies in an application programming interface environment
CN114356971A (en) Data processing method, device and system
US11689626B2 (en) Transport channel via web socket for ODATA
US11755744B2 (en) Application programming interface specification inference
CN108509453B (en) Information processing method and device
CN113886485A (en) Data processing method, device, electronic equipment, system and storage medium
CN114553960A (en) Data caching method, device, equipment and storage medium
CN114900448A (en) Micro-service gateway flow management method and device and electronic equipment
CN116204239A (en) Service processing method, device and computer readable storage medium
CN117033748B (en) Service query information acquisition method, service data query method and device
CN112883088B (en) Data processing method, device, equipment and storage medium
WO2023092981A1 (en) Streaming data processing method, rule plug-in, and streaming data processing module and system
CN113515306B (en) System transplanting method and device
CN112202598B (en) Log recording method and device

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
GR01 Patent grant
GR01 Patent grant