[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN110716960B - Database query method, device, equipment and storage medium - Google Patents

Database query method, device, equipment and storage medium Download PDF

Info

Publication number
CN110716960B
CN110716960B CN201911007577.4A CN201911007577A CN110716960B CN 110716960 B CN110716960 B CN 110716960B CN 201911007577 A CN201911007577 A CN 201911007577A CN 110716960 B CN110716960 B CN 110716960B
Authority
CN
China
Prior art keywords
database
connection
connection pool
user side
target database
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
CN201911007577.4A
Other languages
Chinese (zh)
Other versions
CN110716960A (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.)
Beijing Ruian Technology Co Ltd
Original Assignee
Beijing Ruian Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Ruian Technology Co Ltd filed Critical Beijing Ruian Technology Co Ltd
Priority to CN201911007577.4A priority Critical patent/CN110716960B/en
Publication of CN110716960A publication Critical patent/CN110716960A/en
Application granted granted Critical
Publication of CN110716960B publication Critical patent/CN110716960B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

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/245Query processing
    • G06F16/2455Query execution
    • G06F16/24553Query execution of query operations
    • G06F16/24558Binary matching operations
    • G06F16/2456Join 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/21Design, administration or maintenance of databases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2452Query translation

Landscapes

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

Abstract

The embodiment of the invention discloses a database query method, a database query device, database query equipment and a storage medium. Wherein, the method comprises the following steps: acquiring a target database selected by a user from databases to be queried in a connection pool; establishing communication connection between a user side and a target database through a communication channel which is distributed for the user side and the target database in advance in a connection pool, and enabling the user side to inquire the target database based on the established communication connection. According to the embodiment of the invention, the target database is selected from the databases to be inquired in the connection pool, so that the cache space for storing the selected target database is provided, and the pertinence of database selection is improved; and the communication connection between the user side and the target database is established through the connection pool, so that the query efficiency of the database is improved.

Description

Database query method, device, equipment and storage medium
Technical Field
The embodiment of the invention relates to the internet technology, in particular to a database query method, a database query device, database query equipment and a storage medium.
Background
With the development of computers and information technology, the use of databases for data storage of different services has become a necessary trend and has been widely used.
In the prior art, when a database is queried and used, the database is usually manually screened according to actual requirements or screened by compiling codes, and then a large amount of data is queried in different operations by compiling the codes.
However, when the existing database Query method performs Query operation on a database, a professional programmer is usually required to inject SQL (Structured Query Language) statements to implement the Query operation, and a large amount of databases open resources at the same time, which causes waste of storage space, and the specialties of writing codes and Query statements are strong, which needs to consume a large amount of time and energy, and is poor in operability of database Query and low in efficiency of data Query.
Disclosure of Invention
The embodiment of the invention provides a database query method, a database query device and a storage medium, wherein the target database is selected from databases to be queried in a connection pool, and communication connection between a user side and the target database is established according to a selection result, so that the target database selection is targeted, and the data query efficiency is improved.
In a first aspect, an embodiment of the present invention provides a database query method, where the method includes:
acquiring a target database selected by a user from databases to be queried in a connection pool;
establishing communication connection between a user side and a target database through a communication channel which is distributed for the user side and the target database in advance in a connection pool, and enabling the user side to inquire the target database based on the established communication connection.
Optionally, before obtaining the target database selected by the user from the databases to be queried in the connection pool, the method further includes:
responding to a connection request of any database to be connected in a connection pool, and verifying configuration information of the database to be connected in the connection pool;
if the database to be connected passes the verification, a communication channel is allocated to the user side and the database to be connected in the connection pool through the connection between the user side and the connection pool, so that the database to be connected is used as the database to be queried in the connection pool.
Optionally, the checking the configuration information of the database to be connected in the connection pool includes:
and matching the configuration information of the database to be connected in the connection pool with the configuration information of a legal database in the server to obtain a verification result.
Optionally, the method further includes:
and in response to an addition request comprising the configuration information of any database, adding the configuration information of the database into the connection pool so as to use the database as a to-be-connected database of the connection pool.
Optionally, after establishing the communication connection between the user side and the target database, the method further includes:
responding to an association request for any query operation in a target database, and recording the query operation information; wherein, the query operation information at least comprises the query operation result;
and if the query operation is detected to be executed again on the target database, displaying the query operation information.
In a second aspect, an embodiment of the present invention further provides a database query apparatus, where the apparatus includes:
the target database acquisition module is used for acquiring a target database selected by a user from the databases to be queried in the connection pool;
and the target database query module is used for establishing communication connection between the user side and the target database through a communication channel which is distributed to the user side and the target database in advance in the connection pool, so that the user side queries the target database based on the established communication connection.
Optionally, the apparatus further comprises:
the database to be connected checking module is used for responding to a connection request of any database to be connected in a connection pool and checking the configuration information of the database to be connected in the connection pool;
and the communication channel distribution module is used for distributing a communication channel for the user side and the database to be connected in the connection pool through the connection between the user side and the connection pool if the verification is passed so as to take the database to be connected as the database to be inquired of the connection pool.
Optionally, the to-be-connected database checking module is specifically configured to:
and matching the configuration information of the database to be connected in the connection pool with the configuration information of the legal database in the server to obtain a verification result.
In a third aspect, an embodiment of the present invention further provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor executes the computer program to implement the database query method according to any embodiment of the present invention.
In a fourth aspect, embodiments of the present invention further provide a storage medium containing computer-executable instructions, which when executed by a computer processor, are used to perform a database query method according to any of the embodiments of the present invention.
The embodiment of the invention selects the target database from the databases to be queried in the connection pool, and establishes the communication connection between the user terminal and the target database according to the selection result, thereby solving the problem of data query through a complex program language in the prior art, realizing the pertinence of target database selection and the operability of database query, and improving the efficiency of data query.
Drawings
Fig. 1 is a schematic flowchart of a database query method according to a first embodiment of the present invention;
FIG. 2 is a schematic diagram of a database connection configuration interface according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of an operation interface for database query according to an embodiment of the present invention;
fig. 4 is a flowchart illustrating a database query method according to a second embodiment of the present invention;
fig. 5 is a block diagram of a database query apparatus according to a third embodiment of the present invention;
fig. 6 is a schematic structural diagram of a computer device in a fourth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not to be construed as limiting the invention. It should be further noted that, for the convenience of description, only some structures related to the present invention are shown in the drawings, not all of them.
Example one
Fig. 1 is a schematic flowchart of a database query method according to an embodiment of the present invention, where the method is applicable to a database query operation, and the method can be executed by a database query device. As shown in fig. 1, the method specifically includes the following steps:
and step 110, acquiring a target database selected by a user from the databases to be inquired in the connection pool.
The user inputs information such as a personal account number, a password or an authentication code and the like on computer equipment to log in a visual interface of a user side, and the computer equipment can be equipment such as a computer and the like. Connection pooling is a buffer pooling technique for creating and managing connections in which connection configurations of a database to be queried are stored. The database to be queried is a database of a communication channel existing in the connection pool, and the target database is any database to be queried in the connection pool. The user selects a target database from the database to be queried, the server obtains a selection instruction of the user, selects a communication channel corresponding to the target database from the distributed communication channels in the connection pool, and connects the communication channel to the user side to realize the operation of the target database.
Optionally, before obtaining the target database selected by the user from the databases to be queried in the connection pool, the method further includes: responding to a connection request for any database to be connected in the connection pool, and verifying the configuration information of the database to be connected in the connection pool; if the database to be connected passes the verification, a communication channel is allocated to the user side and the database to be connected in the connection pool through the connection between the user side and the connection pool, so that the database to be connected is used as a database to be queried in the connection pool.
Specifically, the configuration information of the database to be connected is stored in the connection pool, but the database to be connected is not connected with the communication channel of the user side, the user sends a connection instruction of the database to be connected to the server on the visual interface of the user side, the server responds to the connection request of the user side, connection between the user side and the connection pool is established, and the configuration information of the database to be connected in the connection pool is compared with the configuration information of the legal database in the server for verification. If the verification is passed, the server sends a mark of successful verification to the database to be connected in the connection pool, a communication channel of the database to be connected is distributed to the user side in the connection pool through the connection between the user side and the connection pool, and the database to be connected which is successfully verified in the connection pool is the database to be inquired; if the verification fails, the server sends a sign of the failure of the verification to the database to be connected in the connection pool, and the user side cannot distribute a communication channel with the database to be connected. And after the verification of the databases to be connected through the connection pool is finished, sequentially selecting target databases from the databases to be queried which are successfully verified. The communication channel from the connection pool to the target database is unique, and when multiple users use the same target database, each user is connected with the unique communication channel of the target data through the connection pool, so that the situation that each user establishes a communication channel for the target database is avoided, the resource space is saved, and the query efficiency of the database is improved.
Optionally, the checking the configuration information of the database to be connected in the connection pool includes: and matching the configuration information of the database to be connected in the connection pool with the configuration information of the legal database in the server to obtain a verification result.
Specifically, a user selects any database to be connected on a visual interface of a user side for connection inspection, whether a legal database matched with configuration information of the database to be connected exists in a server or not is determined, and if yes, the database to be connected is verified successfully; if not, the to-be-connected database fails to be checked. The configuration information of the database may include: database connection addresses, ports, remarks, database names, etc. Through pre-verification, the user is reminded of knowing whether the configuration information of the target database is correct, errors are avoided when the user carries out formal query, the error reasons are clear for the user, the query efficiency is improved, and the user experience is improved.
Optionally, in response to an addition request including configuration information of any database, adding the configuration information of the database to the connection pool to use the database as a to-be-connected database of the connection pool.
Specifically, a user sends an adding request of configuration information of a database to a server through a visual interface of a user side, the server responds to the adding request of the user, the user adds the configuration information of the database to a connection pool, and the added database is a database to be connected. All databases to be queried by the user can be recorded, the range of database query of the user is narrowed, and subsequent verification of the user is more targeted.
For example, fig. 2 is a schematic diagram of a database connection configuration interface according to a first embodiment of the present invention. The user clicks a 'newly added' control on the interface, and adds configuration information of the database to be connected, wherein the configuration information can be that the database connection address is 192.168.56.11, the port is 1880, the remark is test information, and the name is a certain sql database. The user can add a plurality of databases to be connected, and after the user adds all the databases to be connected, the user can select one of the databases to be connected, click the 'test' control on the interface, and perform connection verification of the configuration information on the databases to be connected. If the configuration information of the database to be connected is matched with the configuration information of the legal database of the server, the verification is successful, the server sends a mark of successful verification to the database to be connected, the database to be connected is the database to be queried, communication channels are distributed for the user side and the database to be queried in the connection pool through the connection between the user side and the connection pool, and the user can select a target database from the data center to be queried to perform sequential query operation.
And 120, establishing communication connection between the user side and the target database through communication channels which are distributed to the user side and the target database in advance in the connection pool, and enabling the user side to inquire the target database based on the established communication connection.
The server obtains an instruction of a user for selecting a target database from the database to be queried, searches communication channels between the connection pool and the target database from the communication channels between the connection pool and the database to be queried to establish communication connection, and enables the user to query the target database based on the established communication connection. The user can select the data table in the target database to perform data query, sorting, merging and the like. For example, fig. 3 is a schematic diagram of a database query operation interface in the first embodiment of the present invention. The user can perform operations such as single operation action and multi-operation action on the data table in the target database through the visual interface. The server obtains an input operation of a user on the visual interface, for example, the user performs a data sorting operation on a selected data table, the server forms an SQL variable for the input operation of the user, the SQL variable is a key for executing a corresponding input operation, and the key for the data sorting operation may be an Order by, a query object, a sorting sequence, and the like.
The server translates the SQL variables into encapsulated SQL language structures that the database can recognize. The packaged SQL language structure can be divided into four parts, the first part is a data definition language, common keywords of the data definition language include create, drop and alter, and the common keywords are directed at the operation of a database logic structure; the second part is a data operation language, and commonly used keywords are insert, update and delete, and specific data change is aimed at; the third part is data query language, common keywords comprise select query statement, and specific data screening and filtering are aimed at; the fourth part is data management language, the common keywords have grant (assigned authority), and the authority management of specific data is aimed at. The packaged SQL language structure can construct a visual graph and display the visual graph in a visual interface, so that a universal standard SQL language structure is convenient to use. And the user side and the target database are transmitted and delivered through the packaged SQL language structure, the target database returns the result of successful execution to the user side and displays the result on the visual interface, and if the packaged SQL language structure is not successfully executed, the result is fed back to the visual interface and prompt information of failed execution is generated. For example, the language structure of a correct encapsulated SQL is:
select count(*)from S003.WA_SOURCE_Z002_9998where(“101200Z”=’13992777199’or”220040B”=’13992777199’)and H010014between’1534521600’and’1535126400’。
according to the technical scheme of the embodiment, the target database is selected from the databases to be queried in the connection pool by the user, so that the target database is selected in a targeted manner, the operation is convenient, and codes do not need to be compiled; the communication connection between the user side and the target database is established through the communication channels which are distributed to the user side and the target database in advance in the connection pool, the connection pool provides a cache space for connection between the user side and the target database, the phenomenon that the user reestablishes the communication connection channel every time the user connects the target database is avoided, waste of storage space is reduced, and operability and query efficiency of data query are improved.
Example two
Fig. 4 is a flowchart illustrating a database query method according to a second embodiment of the present invention, which is further optimized based on the first embodiment and can be executed by a database query device. As shown in fig. 4, the database query method provided in this embodiment specifically includes the following steps:
and step 410, acquiring a target database selected by the user from the databases to be queried in the connection pool.
The method comprises the steps of adding a database to be connected into a connection pool from a user side, checking configuration information of the database to be connected, taking the database to be connected which passes the checking as a database to be inquired, distributing a communication channel between the user side and the database to be inquired through the connection pool, and selecting a target database to be inquired from the database to be inquired.
Step 420, establishing a communication connection between the user side and the target database through a communication channel pre-allocated to the user side and the target database in the connection pool, so that the user side queries the target database based on the established communication connection.
After the user selects the target database at the user side, the connection pool selects the target database from the communication channels of the database to be queried and the user side to establish communication connection with the communication channel of the user side, and the user side queries the target database based on the communication connection established by the connection pool.
Step 430, responding to the association request of any query operation in the target database, and recording the query operation information; wherein, the query operation information at least comprises the query operation result; and if the query operation is detected to be executed again on the target database, displaying the query operation information.
After a user opens a query operation interface of the target database at a user side, data query and other operations are performed on a data table of the target database. And the server calculates or confirms the data in the data table according to the query operation of the user, so that a query operation result is obtained. The user can associate the specific query operation and the query result on the data table, and memorize the query operation information of the user. The query operation information may include a query operation input by a user, a query operation result, and an operation object, and the operation object may be any data table. The server receives the association request of the user, stores the query operation result corresponding to the query operation in the operated data table, and directly calls the query operation result to be displayed on the visual interface without recalculation if the user wants to review the query operation result in the data table.
For example, the server performs an operation of adding the data of the first column and the data of the second column in the data table 1 by the user side, where the data of the first column is 10 and 20, the data of the second column is 15 and 15, the server receives an addition request of the user side for the data of the first column and the data of the second column, and calculates to obtain data results after the data of the two columns are added, and the results are 25 and 35. The user end sends out the association request of the operation and the operation result, the server receives the association request of the user end, and the added results of the first column and the second column of the data table are stored as 25 and 35. If the user wants to check the result of the addition of the first column and the second column of the data table again after performing a series of other query operations on the data table, the server receives an operation request of the user for the addition of the first column and the second column of the data table, and directly displays the results 25 and 35 on the interface without recalculation, thereby saving the query operation time of the user and improving the query operation efficiency of the data.
According to the embodiment of the invention, the target database selected by the user from the databases to be queried in the connection pool is obtained, and then the communication connection between the user side and the target database is established through the connection pool, so that the user queries the target database. The targeted selection of the target database is realized, and the operability of data query is improved. By associating the query operation of the user on the specific data table with the query operation result, the calculation time of the server for repeating the query operation is saved, and the efficiency of data query is improved.
EXAMPLE III
Fig. 5 is a block diagram of a database query apparatus according to a third embodiment of the present invention, which is capable of executing a database query method according to any embodiment of the present invention, and has functional modules and beneficial effects corresponding to the execution method. As shown in fig. 5, the apparatus specifically includes:
a target database obtaining module 501, configured to obtain a target database selected by a user from databases to be queried in a connection pool;
the target database query module 502 is configured to establish a communication connection between the user side and the target database through a communication channel pre-allocated to the user side and the target database in the connection pool, so that the user side queries the target database based on the established communication connection.
Optionally, the apparatus further comprises:
the database to be connected checking module is used for responding to a connection request of any database to be connected in the connection pool and checking the configuration information of the database to be connected in the connection pool;
and the communication channel distribution module is used for distributing communication channels for the user side and the database to be connected in the connection pool through the connection between the user side and the connection pool if the verification is passed so as to take the database to be connected as the database to be inquired of the connection pool.
Optionally, the to-be-connected database checking module is specifically configured to:
and matching the configuration information of the database to be connected in the connection pool with the configuration information of the legal database in the server to obtain a verification result.
Optionally, the apparatus further comprises:
and the database to be connected adding module is used for responding to an adding request comprising the configuration information of any database, adding the configuration information of the database into the connection pool, and taking the database as the database to be connected of the connection pool.
Optionally, the apparatus further comprises:
the query operation association module is used for responding to an association request of any query operation in the target database and recording the query operation information; wherein, the query operation information at least comprises the query operation result;
and the query operation information display module is used for displaying the query operation information if the query operation is detected to be executed again on the target database.
The embodiment of the invention determines the target database according to the selection operation of the user from the database to be queried in the connection pool, establishes the communication connection between the user side and the target database through the communication channel which is pre-distributed for the user side and the target database in the connection pool, provides the cache space for connecting the user side and the target database by the connection pool, realizes the targeted selection of the target database, is convenient to operate, avoids the problem that the user needs to reestablish the communication connection channel when connecting the target database every time, reduces the waste of storage space, and improves the efficiency of data query.
Example four
Fig. 6 is a schematic structural diagram of a computer device according to a fourth embodiment of the present invention. FIG. 6 illustrates a block diagram of an exemplary computer device 600 suitable for use in implementing embodiments of the invention. The computer device 600 shown in fig. 6 is only an example and should not bring any limitations to the function and scope of use of the embodiments of the present invention.
As shown in fig. 6, computer device 600 is in the form of a general purpose computing device. The components of computer device 600 may include, but are not limited to: one or more processors or processing units 601, a system memory 602, and a bus 603 that couples various system components including the system memory 602 and the processing unit 601.
Bus 603 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. By way of example, such architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, micro-channel architecture (MAC) bus, enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
Computer device 600 typically includes a variety of computer system readable media. Such media can be any available media that is accessible by computer device 600 and includes both volatile and nonvolatile media, removable and non-removable media.
The system memory 602 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM)604 and/or cache memory 605. The computer device 600 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 606 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 6, commonly referred to as a "hard drive"). Although not shown in FIG. 6, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to the bus 603 by one or more data media interfaces. Memory 602 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the invention.
A program/utility 608 having a set (at least one) of program modules 607 may be stored, for example, in memory 602, such program modules 607 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which examples or some combination thereof may comprise an implementation of a network environment. The program modules 607 generally perform the functions and/or methods of the described embodiments of the invention.
The computer device 600 may also communicate with one or more external devices 609 (e.g., keyboard, pointing device, display 610, etc.), with one or more devices that enable a user to interact with the computer device 600, and/or with any devices (e.g., network card, modem, etc.) that enable the computer device 600 to communicate with one or more other computing devices. Such communication may occur via an input/output (I/O) interface 611. Moreover, the computer device 600 may also communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network such as the Internet via the network adapter 612). As shown, the network adapter 612 communicates with the other modules of the computer device 600 over the bus 603. It should be appreciated that although not shown in the figures, other hardware and/or software modules may be used in conjunction with the computer device 600, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, to name a few.
The processing unit 601 executes various functional applications and data processing by running the program stored in the system memory 602, for example, implementing the database query method provided by the embodiment of the present invention, including:
acquiring a target database selected by a user from the databases to be queried in the connection pool;
and establishing communication connection between the user side and the target database through a communication channel which is distributed to the user side and the target database in advance in the connection pool, and enabling the user side to inquire the target database based on the established communication connection.
EXAMPLE five
The fifth embodiment of the present invention further provides a storage medium containing computer executable instructions, where a computer program is stored on the storage medium, and when the computer program is executed by a processor, the method for querying a database provided in the fifth embodiment of the present invention is implemented, where the method includes:
acquiring a target database selected by a user from databases to be queried in a connection pool;
and establishing communication connection between the user side and the target database through a communication channel which is distributed for the user side and the target database in advance in the connection pool, and enabling the user side to inquire the target database based on the established communication connection.
Computer storage media for embodiments of the invention may employ any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, 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), an optical fiber, 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 context of this document, 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.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or computer device. In the latter scenario, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
It is to be noted that the foregoing description is only exemplary of the invention and that the principles of the technology may be employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (6)

1. A database query method, comprising:
acquiring a target database selected by a user from the databases to be queried in the connection pool;
establishing communication connection between a user side and a target database through a communication channel which is distributed for the user side and the target database in advance in a connection pool, and enabling the user side to inquire the target database based on the established communication connection;
the communication channel from the connection pool to the target database is unique;
before obtaining a target database selected by a user from the databases to be queried in the connection pool, the method further comprises the following steps:
responding to a connection request of any database to be connected in a connection pool, and verifying configuration information of the database to be connected in the connection pool, wherein the configuration information of the database comprises: database connection address, port, remark and database name;
if the verification is passed, distributing a communication channel for the user side and the database to be connected in the connection pool through the connection between the user side and the connection pool so as to take the database to be connected as the database to be inquired of the connection pool;
checking the configuration information of the database to be connected in the connection pool, including:
and matching the configuration information of the database to be connected in the connection pool with the configuration information of the legal database in the server to obtain a verification result.
2. The method of claim 1, further comprising:
and in response to an addition request comprising the configuration information of any database, adding the configuration information of the database into the connection pool so as to use the database as a to-be-connected database of the connection pool.
3. The method of claim 1, further comprising, after establishing the communication connection between the user terminal and the target database:
responding to an association request for any query operation in a target database, and recording the query operation information; wherein, the query operation information at least comprises the result of the query operation;
and if the query operation is detected to be re-executed on the target database, displaying the query operation information.
4. A database query device, comprising:
the target database acquisition module is used for acquiring a target database selected by a user from the databases to be queried in the connection pool;
the target database query module is used for establishing communication connection between the user side and the target database through communication channels which are distributed to the user side and the target database in advance in a connection pool, so that the user side queries the target database based on the established communication connection;
the communication channel from the connection pool to the target database is unique;
a database to be connected checking module, configured to respond to a connection request for any database to be connected in a connection pool, and check configuration information of the database to be connected in the connection pool, where the configuration information of the database includes: database connection addresses, ports, remarks and database names;
a communication channel distribution module, configured to, if the check passes, distribute a communication channel for the user side and the database to be connected in the connection pool through connection between the user side and the connection pool, so as to use the database to be connected as a database to be queried in the connection pool;
the to-be-connected database checking module is specifically used for:
and matching the configuration information of the database to be connected in the connection pool with the configuration information of the legal database in the server to obtain a verification result.
5. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the database query method of any of claims 1-3 when executing the program.
6. A storage medium containing computer-executable instructions for performing the database query method of any one of claims 1-3 when executed by a computer processor.
CN201911007577.4A 2019-10-22 2019-10-22 Database query method, device, equipment and storage medium Expired - Fee Related CN110716960B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911007577.4A CN110716960B (en) 2019-10-22 2019-10-22 Database query method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911007577.4A CN110716960B (en) 2019-10-22 2019-10-22 Database query method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN110716960A CN110716960A (en) 2020-01-21
CN110716960B true CN110716960B (en) 2022-07-15

Family

ID=69214006

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911007577.4A Expired - Fee Related CN110716960B (en) 2019-10-22 2019-10-22 Database query method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110716960B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111898910A (en) * 2020-07-30 2020-11-06 上海新朋程信息科技有限公司 Data acquisition method
CN113760986A (en) * 2021-01-29 2021-12-07 北京沃东天骏信息技术有限公司 Data query method, device, equipment and storage medium
CN112860705A (en) * 2021-03-09 2021-05-28 上海华客信息科技有限公司 Database connection configuration information management method, system, device and storage medium
CN114416774A (en) * 2022-01-05 2022-04-29 深圳萨摩耶数字科技有限公司 Cross-platform multi-data-source data fetching method and device, electronic equipment and storage medium

Family Cites Families (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007226398A (en) * 2006-02-22 2007-09-06 Hitachi Ltd Database connection management method and computer system
US8666764B2 (en) * 2006-10-27 2014-03-04 Purdue Pharma L.P. Adverse event data capture software, systems and methodologies
CN102117309B (en) * 2010-01-06 2013-04-17 卓望数码技术(深圳)有限公司 Data caching system and data query method
US9129000B2 (en) * 2010-04-30 2015-09-08 International Business Machines Corporation Method and system for centralized control of database applications
US8543554B1 (en) * 2010-08-10 2013-09-24 ScalArc Inc. Method and system for transparent database query caching
US8484242B1 (en) * 2010-08-24 2013-07-09 ScalArc, Inc. Method and system for transparent database connection pooling and query queuing
CN102982141B (en) * 2012-11-20 2016-01-20 北京搜狐新媒体信息技术有限公司 A kind of method and device realizing distributed data base agency
CN103064960B (en) * 2012-12-31 2016-09-07 华为技术有限公司 Data base query method and equipment
CN104252501B (en) * 2013-06-29 2018-08-21 华为技术有限公司 A kind of computing device and method executing database manipulation order
US10389652B2 (en) * 2014-12-19 2019-08-20 International Business Machines Corporation Connection pool management
CN107423303B (en) * 2016-05-24 2021-02-26 北京京东尚科信息技术有限公司 Method and system for data synchronization
CN108733720B (en) * 2017-04-24 2021-02-26 北京京东尚科信息技术有限公司 On-line checking method and checking system for SQL (structured query language) query of multiple database types
CN107357831A (en) * 2017-06-21 2017-11-17 信雅达系统工程股份有限公司 Configurable flow instance data distribution formula storage method and system
CN110019350B (en) * 2017-07-28 2021-06-29 北京京东尚科信息技术有限公司 Data query method and device based on configuration information
CN109522321A (en) * 2018-11-15 2019-03-26 北京锐安科技有限公司 A kind of data base query method, device, server and storage medium
CN109766362B (en) * 2018-12-28 2021-07-20 北京字节跳动网络技术有限公司 Data processing method and device
CN110191428B (en) * 2019-05-27 2021-10-12 北京鸿联九五信息产业有限公司 Data distribution method based on intelligent cloud platform

Also Published As

Publication number Publication date
CN110716960A (en) 2020-01-21

Similar Documents

Publication Publication Date Title
CN110716960B (en) Database query method, device, equipment and storage medium
CN108519967B (en) Chart visualization method and device, terminal and storage medium
CN108319575B (en) Page component checking method, device, server and storage medium
CN112860798B (en) Data processing method and device, electronic equipment and storage medium
CN110502519B (en) Data aggregation method, device, equipment and storage medium
US10324931B2 (en) Dynamic combination of processes for sub-queries
CN110428319B (en) Data comparison platform, method, equipment and storage medium
CN114528044B (en) Interface calling method, device, equipment and medium
CN110321694B (en) Operation authority allocation method based on label updating system and related equipment
CN110704476A (en) Data processing method, device, equipment and storage medium
CN111680313B (en) Data processing method, device, equipment and storage medium
CN112363753A (en) Data verification method and device, electronic equipment and storage medium
CN110555150B (en) Data monitoring method, device, equipment and storage medium
CN114281803A (en) Data migration method, device, equipment, medium and program product
CN110688111A (en) Configuration method, device, server and storage medium of business process
CN111586177B (en) Cluster session loss prevention method and system
CN113792138B (en) Report generation method and device, electronic equipment and storage medium
CN110515954B (en) Data processing method, device, equipment and storage medium
CN112799760A (en) Form rendering method and device
US9208046B2 (en) Method and system for optimizing testing efforts in system of systems testing
CN107992457B (en) Information conversion method, device, terminal equipment and storage medium
CN110958243A (en) Network vulnerability submitting method and device, storage medium and electronic equipment
CN114238391A (en) Data paging query method and device, electronic equipment and storage medium
WO2021043091A1 (en) Intelligent import method and apparatus for template table, and electronic device and computer readable storage medium
CN112801772B (en) Trusted method, trusted processing system, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20220715