CN110413676B - Database access method and device, electronic equipment and medium - Google Patents

Database access method and device, electronic equipment and medium Download PDF

Info

Publication number
CN110413676B
CN110413676B CN201910679775.9A CN201910679775A CN110413676B CN 110413676 B CN110413676 B CN 110413676B CN 201910679775 A CN201910679775 A CN 201910679775A CN 110413676 B CN110413676 B CN 110413676B
Authority
CN
China
Prior art keywords
access
access request
database
jdbc
request data
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.)
Active
Application number
CN201910679775.9A
Other languages
Chinese (zh)
Other versions
CN110413676A (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.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Industrial and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN201910679775.9A priority Critical patent/CN110413676B/en
Publication of CN110413676A publication Critical patent/CN110413676A/en
Application granted granted Critical
Publication of CN110413676B publication Critical patent/CN110413676B/en
Active 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/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/25Integrating or interfacing systems involving database management systems

Landscapes

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

Abstract

The present disclosure provides a method for accessing a database, which is performed by a Java database connection (JDBC) server, where the JDBC server and the database are deployed in the same network area, and the method includes: receiving access request data from an application program, wherein the access request data is sent by a JDBC client in response to an access request of the application program to a database, and the access request data is obtained by encrypting and/or compressing a structured query statement and an access parameter carried in the access request by the JDBC client; responding to the access request data, and acquiring access response data corresponding to the access request data from the database; and sending the access response data to the JDBC client so that the application realizes the access to the database based on the access response data from the JDBC client. The disclosure also provides an access device of the database, which is applied to the JDBC server, an electronic device and a computer readable storage medium.

Description

Database access method and device, electronic equipment and medium
Technical Field
The present disclosure relates to the field of network technologies, and in particular, to a database access method and apparatus, an electronic device, and a medium.
Background
With the development of financial technology, more and more financial institutions implement multi-place and multi-center high availability schemes, such as two places, three places, and four places. In order to achieve simultaneous access of applications in multiple places and deployment of a multi-campus and multi-active architecture, optimization and transformation of the applications are required to reduce dependency on centralized resources.
However, no matter how optimized, in the financial industry as an example, there is always a part of data with very high consistency requirement to be shared in real time (such as accounting data), and these single-point databases still cannot be completely removed (or too high in modification cost), and multiple campus applications are required to access the databases of the same campus. Thus, there is a need for ultra-remote access to critical databases.
In a multi-park and multi-activity architecture, the distance between the parks is far, and some parks even reach thousands of kilometers. The delay and instability of the network bring great performance loss and potential safety hazard to the direct access of the database, and certain pressure is brought to the normal operation of the application program.
Disclosure of Invention
In view of this, the problem of instability such as performance loss and potential safety hazard brought by directly accessing the database at an ultra-long distance in the prior art is solved. The disclosure provides a database access method and device, an electronic device and a medium.
To achieve the above object, one aspect of the present disclosure provides a method for accessing a database, which is performed by a Java database connectivity (JDBC) server, where the JDBC server and the database are deployed in a same network area, and the method includes: receiving access request data from an application, wherein the access request data is sent by a JDBC client in response to an access request of the application to the database, the access request data is obtained by encrypting and/or compressing a structured query statement and an access parameter carried in the access request by the JDBC client, acquiring access response data corresponding to the access request data from the database in response to the access request data, and sending the access response data to the JDBC client, so that the application realizes access to the database based on the access response data from the JDBC client.
According to an embodiment of the present disclosure, the obtaining, in response to the access request data, access response data corresponding to the access request data from the database includes: in response to the access request data, performing decryption and/or decompression processing to obtain the structured query statement and the access parameter, executing the structured query statement in the database to obtain query data matching the access parameter, and performing encryption and/or compression processing on the query data to obtain the access response data.
According to an embodiment of the present disclosure, the obtaining the challenge response data corresponding to the access request data from the database includes: and detecting whether the JDBC client passes the identity authentication or not, and acquiring access response data corresponding to the access request data from the database under the condition that the JDBC client passes the identity authentication.
According to an embodiment of the present disclosure, the receiving access request data from an application includes: the method comprises the steps of obtaining a first network quality parameter of a network between the JDBC server and the JDBC client, detecting whether the first network quality parameter meets a first preset condition, and receiving access request data from an application program through long connection under the condition that the first network quality parameter meets the first preset condition.
According to an embodiment of the present disclosure, the method further includes: and receiving access request data from an application program through a short connection under the condition that the first network quality parameter does not meet the first preset condition.
To achieve the above object, another aspect of the present disclosure provides a method for accessing a database, performed by a JDBC client, the method comprising: receiving an access request aiming at the database sent by an application program, wherein for a structured query statement and an access parameter carried in the access request, responding to the access request, generating access request data, sending the access request data to a JDBC server, so that the JDBC server can respond to the access request data, acquiring access response data corresponding to the access request data from the database, sending the access response data to the JDBC client, receiving the access response data, and sending the access response data to the application program, so that the application program realizes access to the database.
According to an embodiment of the present disclosure, the generating access request data in response to the access request includes: and responding to the access request, acquiring the structured query statement and the access parameter, and performing encryption and/or compression processing on the structured query statement and the access parameter to generate the access request data.
According to an embodiment of the present disclosure, the sending the access request data to the JDBC server includes: the method comprises the steps of obtaining a second network quality parameter of a network between the JDBC client and the JDBC server, detecting whether the second network quality parameter meets a second preset condition, and sending the access request data to the JDBC server through long connection under the condition that the second network quality parameter meets the second preset condition.
According to an embodiment of the present disclosure, the method further includes: and sending the access request data to the JDBC server through short connection under the condition that the second network quality parameter does not meet the second preset condition.
In order to achieve the above object, another aspect of the present disclosure provides an apparatus for accessing a database, where the apparatus is applied to a JDBC server, and the JDBC server and the database are deployed in a same network area, and the apparatus includes: the device comprises a first receiving module, a first sending module and a second receiving module, wherein the first receiving module is configured to receive access request data from an application program, the access request data is sent by a JDBC client in response to an access request of the application program to the database, the access request data is obtained by encrypting and/or compressing a structured query statement and an access parameter carried in the access request by the JDBC client, the obtaining module is configured to obtain access response data corresponding to the access request data from the database in response to the access request data, and the first sending module is configured to send the access response data to the JDBC client so that the application program realizes access to the database based on the access response data from the JDBC client.
According to an embodiment of the present disclosure, the obtaining module includes: a first obtaining sub-module configured to perform decryption and/or decompression processing in response to the access request data to obtain the structured query statement and the access parameter, a second obtaining sub-module configured to perform the structured query statement in the database to obtain query data matching the access parameter, and a third obtaining sub-module configured to perform encryption and/or compression processing on the query data to obtain the access response data.
According to an embodiment of the present disclosure, the obtaining module includes: the JDBC client includes a first detection submodule configured to detect whether the JDBC client passes identity authentication, and a fourth acquisition submodule configured to acquire access response data corresponding to the access request data from the database when the JDBC client passes identity authentication.
According to an embodiment of the present disclosure, the first receiving module includes: the JDBC server comprises a first obtaining submodule configured to obtain a first network quality parameter of a network between the JDBC server and the JDBC client, a second detecting submodule configured to detect whether the first network quality parameter meets a first preset condition, and a first receiving submodule configured to receive access request data from an application program through a long connection if the first network quality parameter meets the first preset condition.
According to an embodiment of the present disclosure, the first receiving module further includes: and the second receiving submodule is configured to receive the access request data from the application program through the short connection under the condition that the first network quality parameter does not meet the first preset condition.
To achieve the above object, another aspect of the present disclosure provides an apparatus for accessing a database, which is applied to a JDBC client, the apparatus including: a second receiving module configured to receive an access request for the database sent by an application program, wherein, for the structured query statement and the access parameter carried in the access request, the generating module is configured to respond to the access request and generate access request data, the second sending module is configured to send the access request data to the JDBC server, so that the JDBC server can respond to the access request data and acquire access response data corresponding to the access request data from the database, and transmitting the access response data to the JDBC client, a third receiving module configured to receive the access response data, and a third sending module configured to send the access response data to the application program so that the application program realizes access to the database.
According to an embodiment of the present disclosure, the generating module includes: a sixth obtaining sub-module configured to obtain the structured query statement and the access parameter in response to the access request, and a generating sub-module configured to perform encryption and/or compression processing on the structured query statement and the access parameter to generate the access request data.
According to an embodiment of the present disclosure, the second sending module includes: a seventh obtaining sub-module configured to obtain a second network quality parameter of the network between the JDBC client and the JDBC server, a second detecting sub-module configured to detect whether the second network quality parameter meets a second preset condition, and a third receiving sub-module configured to send the access request data to the JDBC server through a long connection under the condition that the second network quality parameter meets the second preset condition.
According to an embodiment of the present disclosure, the method further includes: and the third receiving submodule is configured to send the access request data to the JDBC server through short connection under the condition that the second network quality parameter does not satisfy the second preset condition.
To achieve the above object, another aspect of the present disclosure provides an electronic device including: one or more processors, a memory for storing one or more programs, wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method as described above.
To achieve the above object, another aspect of the present disclosure provides a computer-readable storage medium storing computer-executable instructions for implementing the method as described above when executed.
To achieve the above object, another aspect of the present disclosure provides a computer program comprising computer executable instructions for implementing the method as described above when executed.
As can be seen from the above, compared with the prior art, the access method and the access device for the database provided by the embodiment of the present disclosure are executed by the JDBC server, and the JDBC server and the database are deployed in the same network area. Acquiring access response data corresponding to the access request data from a database by responding to the access request data; and sending the access response data to the JDBC client so that the application realizes the access to the database based on the access response data from the JDBC client, and can at least partially overcome the technical problems of unstable performance loss, potential safety hazards and the like caused by directly accessing the database at an ultra-long distance in the related art. In an ultra-long distance scene, the application server accesses the database, adopts light-weight network connection, can complete one request execution only by once interaction, can reduce network overhead, has less transmitted data volume, and reduces network transmission volume. In addition, the method can realize transmission encryption and authentication, improve the safety, improve the utilization rate of database connection, reduce the occupation of resources such as database memory and the like, reduce the risk of a connection storm to the database, and avoid the avalanche phenomenon caused by vicious circle of the database.
Drawings
For a more complete understanding of the present disclosure and the advantages thereof, reference is now made to the following descriptions taken in conjunction with the accompanying drawings, in which:
fig. 1 schematically illustrates a system architecture of the database access method and apparatus of the embodiment of the present disclosure;
FIG. 2 schematically illustrates an application scenario of the database access method and apparatus suitable for use in embodiments of the present disclosure;
FIG. 3 schematically shows a flow chart of a method of accessing a database performed by a JDBC server according to an embodiment of the present disclosure;
FIG. 4 schematically illustrates a flow chart for obtaining access response data corresponding to access request data from a database in response to the access request data according to an embodiment of the disclosure;
FIG. 5 schematically illustrates a flow diagram for retrieving access response data corresponding to access request data from a database according to an embodiment of the disclosure;
FIG. 6 schematically shows a flow diagram for receiving access request data from an application in accordance with an embodiment of the disclosure;
FIG. 7 schematically shows a flow diagram of access of a database performed by a JDBC client according to an embodiment of the present disclosure;
FIG. 8 schematically illustrates a flow diagram for generating access request data in response to an access request according to an embodiment of the disclosure;
FIG. 9 schematically shows a flow diagram for sending access request data to a JDBC server according to an embodiment of the present disclosure;
fig. 10 schematically shows a block diagram of an access device applied to a database of a JDBC server according to an embodiment of the present disclosure;
fig. 11 schematically shows a block diagram of an access device applied to a database of a JDBC server according to an embodiment of the present disclosure;
FIG. 12 schematically shows a block diagram of an access device applied to a database of a JDBC client according to yet another embodiment of the present disclosure;
fig. 13 schematically shows a block diagram of an access device applied to a database of a JDBC server according to yet another embodiment of the present disclosure; and
fig. 14 schematically illustrates a block diagram of an electronic device suitable for implementing the database access method and apparatus described above according to an embodiment of the present disclosure.
Detailed Description
Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. It should be understood that the description is illustrative only and is not intended to limit the scope of the present disclosure. In the following detailed description, for purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the embodiments of the disclosure. It may be evident, however, that one or more embodiments may be practiced without these specific details. Moreover, in the following description, descriptions of well-known structures and techniques are omitted so as to not unnecessarily obscure the concepts of the present disclosure.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. The terms "comprises," "comprising," and the like, as used herein, specify the presence of stated features, steps, operations, and/or components, but do not preclude the presence or addition of one or more other features, steps, operations, or components.
All terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art unless otherwise defined. It is noted that the terms used herein should be interpreted as having a meaning that is consistent with the context of this specification and should not be interpreted in an idealized or overly formal sense.
Where a convention analogous to "at least one of A, B and C, etc." is used, in general such a construction is intended in the sense one having skill in the art would understand the convention (e.g., "a system having at least one of A, B and C" would include but not be limited to systems that have a alone, B alone, C alone, a and B together, a and C together, B and C together, and/or A, B, C together, etc.). Where a convention analogous to "A, B or at least one of C, etc." is used, in general such a construction is intended in the sense one having skill in the art would understand the convention (e.g., "a system having at least one of A, B or C" would include but not be limited to systems that have a alone, B alone, C alone, a and B together, a and C together, B and C together, and/or A, B, C together, etc.).
Some block diagrams and/or flow diagrams are shown in the figures. It will be understood that some blocks of the block diagrams and/or flowchart illustrations, or combinations thereof, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the instructions, which execute via the processor, create means for implementing the functions/acts specified in the block diagrams and/or flowchart block or blocks. The techniques of this disclosure may be implemented in hardware and/or software (including firmware, microcode, etc.). In addition, the techniques of this disclosure may take the form of a computer program product on a computer-readable storage medium having instructions stored thereon for use by or in connection with an instruction execution system.
After the data is concentrated greatly, the operation activities of enterprises increasingly depend on IT infrastructures such as data centers and networks, and the continuous operation of 7-24 all-day services of the IT infrastructures becomes the target of the IT construction operation and enterprise operation pursuit of large enterprises. How to reduce or even eliminate the influence of normal and abnormal shutdown on service availability is not only the goal of IT construction and operation and maintenance teams, but also becomes a concern of enterprise decision layers.
For disaster recovery purposes, enterprises typically build two or more data centers. The main data center bears the core service of the user, and other data centers mainly bear some non-key services and simultaneously back up the data, configuration, service and the like of the main center. Normally, the main center and the standby center respectively perform their own functions, and when a disaster occurs, the main data center is down and the backup data center can quickly recover data and application, so that the loss of users caused by the disaster is reduced. Because the disaster is a small-probability event, the backup data center can only play a role when the disaster occurs by adopting a primary-backup mode, and with the improvement of the disaster tolerance construction standard of enterprises, the backup IT resources and capital are more and more invested and can not be reused directly, thereby causing waste. In addition, due to the application of the main-standby mode, the standby center needs a long time to take over the main center, and the relationship is complex, which often seriously affects the service handling of the user.
In a multi-park and multi-activity architecture, distances between parks are far, and some parks reach thousands of kilometers. The delay and instability of the network bring great performance loss and potential safety hazard to the direct access of the database, and certain pressure is brought to the normal operation of the application program.
Based on this, embodiments of the present disclosure provide an access method of a DataBase performed by a Java DataBase Connectivity (JDBC for short) server. In particular, the JDBC server is deployed in the same network area as the database, and the method includes: firstly, receiving access request data from an application program, wherein the access request data is sent by a JDBC client in response to an access request of the application program to a database, the access request data is obtained by encrypting and/or compressing a structured query statement and an access parameter carried in the access request by the JDBC client, then, responding to the access request data, obtaining access response data corresponding to the access request data from the database, and finally sending the access response data to the JDBC client so that the application program realizes access to the database based on the access response data from the JDBC client.
JDBC is composed of a group of classes and interfaces written in Java language, is a Java Application Programming Interface (API for short) for executing SQL statements, and can provide unified access to multiple relational databases. JDBC provides a benchmark by which more advanced tools and interfaces can be built to enable database developers to write database applications.
Compared with the traditional scheme, in the ultra-long distance scene, the application server accesses the database server, and adopts light-weight network connection, so that one request can be executed only by once interaction, the network overhead is reduced, the transmitted data volume is small, and the network transmission volume can be reduced; the method and the system realize transmission encryption and authentication, improve safety, improve the utilization rate of database server connection, reduce the occupation of resources such as database memory and the like, reduce the risk of a connection storm to the database server, and avoid an avalanche phenomenon caused by vicious circle of the database server.
Fig. 1 schematically shows a system architecture of the database access method and apparatus according to the embodiment of the present disclosure. It should be noted that fig. 1 is only an example of a system architecture to which the embodiments of the present disclosure may be applied to help those skilled in the art understand the technical content of the present disclosure, but does not mean that the embodiments of the present disclosure may not be applied to other devices, systems, environments or scenarios.
The database access method and device of the embodiment of the disclosure can be used in a system architecture of multiple places and multiple centers. Fig. 1 shows only a "two-place-three-center" system architecture 100. The 'two places and three centers' is that on the basis of the same city double lives, a different-place data center is added and is synchronized with the same city double lives, namely, a commercial disaster recovery backup solution for the same city double centers and the different-place one centers is realized, and the solution has high availability and disaster backup capability. It will be appreciated that the offsite production center serves as a data backup for the same city dual activity/dual center. When the double centers have faults due to natural disasters and the like, the remote production center can realize data recovery and ensure normal operation of services.
The term "two places" in "two places and three centers" refers to the same city and different places. For example, the Beijing Homophore (including the A and B sites) and Shanghai allopatric (including the C site) are shown in FIG. 1. The distance between the place A of the same Beijing city and the place B of the same Beijing city is 55 kilometers, the distance between the place A of the same Beijing city and the place C of the different place center of Shanghai is 1500 kilometers, and the distance between the place B of the same Beijing city and the place C of the different place center of Shanghai is 1200 kilometers.
"three centers" in "two places and three centers" refers to a production center, a same city double-living (disaster recovery) center, and an off-site production center. For example, the production center a located in the same city as a in beijing, the double living center B located in the same city as B in beijing, and the offsite production center C located in the offsite center C in shanghai are shown in fig. 1. The production center A has the functions of core production and system operation, the double-activity center B in the same city has the functions of separable inquiry transaction operation, batch operation and basic service provision, and the remote production center C has the functions of remote production, disaster recovery, basic technology research and development and system and application version test.
Under the system architecture shown in fig. 1, a plurality of data centers included in the "three centers" are in a primary-secondary relationship with each other, that is, there is a primary-secondary relationship, there is a difference in service deployment priority, the response to a disaster and the switching period are very long, the Recovery time Object (RTO for short) and the Recovery Point Object (RPO for short) cannot realize zero interruption of a service, the resource utilization rate is low, and the return on investment cannot reach an expected value.
The RTO refers to the time required for restoring the information system from a failure or paralysis state caused by a disaster to a normal operation state and for restoring the service functions supported by the information system from an abnormal state caused by a disaster to an acceptable state, wherein the time required for restoring backup data to an available state, the application system switching time, the standby network switching time and the like are included. For example, if recovery is required within half a day after the disaster, the RTO value is twelve hours. The RPO refers to the maximum data loss (measured in time) in the disaster process allowed by the service system, and is an indicator that the data replication technology selected by the disaster recovery system has close relation, so as to measure the data redundancy backup capability of the disaster recovery scheme.
The present disclosure will be described in detail below, taking the financial industry as an example. It is to be understood that this scenario is not a limitation of the application scenario.
Fig. 2 schematically illustrates an application scenario of the database access method and apparatus suitable for the embodiment of the present disclosure. It should be noted that fig. 2 is only an example of an application scenario in which the embodiments of the present disclosure may be applied to help those skilled in the art understand the technical content of the present disclosure, but does not mean that the embodiments of the present disclosure may not be applied to other devices, systems, environments or scenarios.
As shown in fig. 2, an application scenario 200 applicable to the database access method and apparatus of the present disclosure may include a plurality of application programs 210, a JDBC server 220, and a database server 230.
In the financial industry as an example, a part of the data stored in the database with very high consistency requirements is required to be shared in real time, for example, accounting data, and these single-point databases still cannot be completely removed (or are too costly to be modified). Thus, multiple applications 210 on multiple parks are required to access data on a single park database server 230, and there is a need for ultra-remote access to critical databases.
In the related art, the application 210 directly accesses the database server 230, and although a certain degree of optimization can be performed by using the data source connection pool, the following disadvantages still exist in the process of accessing at an ultra-long distance:
1. when a Structured Query Language (SQL) is executed, interaction between the database driver and the database needs to be performed many times, so that network delay is amplified, which leads to inefficiency and affects performance of the application 210.
2. The network environment at an ultra-long distance is not comparable to the network quality of the local area network, and has a large instability, the network jitter may cause all the links in the connection pool to be cleared or dirty links to appear, all the links are cleared, a large number of links are created in a short time, the performance of the database is affected, and the dirty links may cause an application transaction to report an error, thereby affecting the normal operation of the application program 210.
3. The utilization rate of database connection is low, which results in the increase of database end connection and more occupation of resources such as database memory.
4. The performance and efficiency problems of the database can be magnified. When the performance of the database is slightly deteriorated due to the bottom layer, resources and the like, the execution time of the SQL is long, and the database connection is inevitably increased under the condition that the pressure of the front-end application is not reduced, while the performance of the database is affected by the increase of the database connection in a short time, so that a vicious circle is formed, and finally, an avalanche effect may be caused, and a systematic fault is caused.
According to the database access method provided by the present disclosure, by adding a layer of access agent between the application 210 and the database server 230, that is, the JDBC server 220, and deploying the JDBC server 220 in the same campus as the database server 230, the application 210 can complete access to the database server 230 through the JDBC server 220 by using the JDBC client interface provided, thereby avoiding problems such as network delay caused by directly accessing the database server 230.
It should be understood that the number of applications, JDBC servers, and database servers in fig. 2 are merely illustrative. There may be any number of applications, JDBC servers, and database servers, as desired for an implementation.
The present disclosure is described in detail below with reference to the accompanying drawings in conjunction with specific embodiments.
Fig. 3 schematically shows a flowchart of a database access method performed by a JDBC server according to an embodiment of the present disclosure.
According to the embodiment of the disclosure, the JDBC server is deployed with the database server, which can provide proxy service for accessing the database server for the front end (application program), and meanwhile, the JDBC server supports client authentication, data compression and encryption functions and supports load balancing. As shown in fig. 3, the database access method may include operations S310 to S330.
First, in operation S310, access request data from an application program is received.
Next, in operation S320, access response data corresponding to the access request data is acquired from the database in response to the access request data.
Then, in operation S330, access response data is sent to the JDBC client, so that the application realizes access to the database based on the access response data from the JDBC client.
According to the embodiment of the disclosure, the access request data from the application program is sent by the JDBC client in response to the access request of the application program to the database, and the access request data is obtained by encrypting and/or compressing the structured query statement and the access parameter carried in the access request by the JDBC client.
The JDBC client may be embedded inside an Application program as an Application Programming Interface (SDK) for accessing the JDBC server by the Application program. The JDBC client encapsulates the SDK with the functions of access, compression, encryption, decryption and the like of the JDBC server, provides a simple access interface of the JDBC server for an application program, and supports two access modes of long connection and short connection.
By the embodiment of the disclosure, in the access scene of the database at an ultra-long distance, the JDBC server is added as a proxy service to buffer the network pressure, the access response data corresponding to the access request data is obtained from the database in response to the access request data from the application program, and the access response data is sent to the JDBC client, such that the application implements access to the database based on access response data from the JDBC client, the method can realize indirect access to the database server, improve the utilization rate of physical connection of the database server, reduce the number of physical connections of the database server, reduce the resource occupancy rate of the database server, avoid the problem of performance deterioration of the database server caused by connection storm, and at least partially solve the problems of performance reduction and low efficiency caused by network delay and network instability in ultra-long distance database access.
Fig. 4 schematically shows a flowchart for obtaining access response data corresponding to access request data from a database in response to the access request data according to an embodiment of the present disclosure.
As shown in fig. 4, the aforementioned operation S320 may include operations S410 to S430.
In operation S410, decryption and/or decompression processing is performed in response to the access request data to obtain the structured query statement and the access parameter.
In operation S420, the structured query statement is executed in the database to obtain query data matching the access parameter.
In operation S430, encryption and/or compression processing is performed with respect to the query data to obtain access response data.
According to the embodiment of the disclosure, after receiving access request data from an application program, the JDBC server may complete restoration of the request data, obtain data such as SQL statements and parameters, connect to the database server to complete execution of the SQL statements, and send an execution result returned by the database server, that is, access response data. Then, after encryption and Gzip compression processing, the data are returned to the JDBC client side, and the access call of the data can be completed.
Fig. 5 schematically shows a flowchart for obtaining access response data corresponding to access request data from a database according to an embodiment of the present disclosure.
As shown in fig. 5, the aforementioned operation S320 may further include operations S510 and S520.
In operation S510, it is detected whether the JDBC client passes identity authentication.
In operation S520, in the case that the JDBC client passes the identity authentication, access response data corresponding to the access request data is acquired from the database.
According to the embodiment of the disclosure, the JDBC server may also complete the client identity authentication first after receiving the access request data from the application program, and after the authentication is successful, may complete the restoration of the request data, obtain data such as SQL statements and parameters, connect to the database server to complete the execution of the SQL statements, and return the execution result, i.e., access response data, from the database server. And then, after encryption and Gzip compression processing, returning the data to the JDBC client side to finish the access call of the data. If the authentication is not successful, indicating that the identity of the JDBC client does not conform to the authentication rule, and not executing subsequent operation.
By the embodiment of the disclosure, when the access response data corresponding to the access request data is acquired from the database, the identity of the JDBC client can be verified, so that the JDBC client with illegal identity can be prevented from accessing the database server, and the access security of the database server can be effectively maintained.
Fig. 6 schematically shows a flow chart for receiving access request data from an application according to an embodiment of the present disclosure.
As shown in fig. 6, the aforementioned operation S310 may include operations S610 to S640.
In operation S610, a first network quality parameter of a network between a JDBC server and a JDBC client is obtained.
In operation S620, it is detected whether the first network quality parameter satisfies a first preset condition.
In operation S630, in case that the first network quality parameter satisfies the first preset condition, access request data from the application program is received through the long connection.
In operation S640, in case the first network quality parameter does not satisfy the first preset condition, access request data from the application program is received through the short connection. According to the embodiment of the disclosure, the access between the JDBC server and the JDBC client supports two modes of long connection and short connection, and the long connection is used under the condition of higher network quality, otherwise, the short connection is used. Therefore, the network connection mode for receiving the access request data from the application program can be determined according to the first network quality parameter of the network between the JDBC server and the JDBC client.
According to the embodiment of the disclosure, multiple connection modes are provided according to the network connection quality parameters so as to receive the access request data from the application program and improve the user experience.
Fig. 7 schematically shows a flow diagram of access of a database performed by a JDBC client according to an embodiment of the present disclosure.
As shown in fig. 7, the method may include operations S710 to S750.
In operation S710, an access request for a database transmitted by an application is received.
In operation S720, access request data is generated in response to the access request.
In operation S730, the access request data is sent to the JDBC server, so that the JDBC server can respond to the access request data, obtain access response data corresponding to the access request data from the database, and send the access response data to the JDBC client.
In operation S740, access response data is received.
In operation S750, the access response data is transmitted to the application program to enable the application program to implement access to the database.
According to the embodiment of the disclosure, the JDBC client as an SDK for accessing the JDBC server by the application program may be embedded in the application program, and generate access request data in response to a received access request for the database sent by the application program, send the access request data to the JDBC server, and receive and send access response data returned by the JDBC server to the application program, so that the application program realizes access to the database. It should be noted that the access request carries a structured query statement and an access parameter, so as to execute an access behavior.
Through the embodiment of the disclosure, the JDBC client embedded in the application program is used for sending and receiving data of the JDBC server, so that the buffering of the JDBC server can be increased, and the efficiency of database access is improved.
FIG. 8 schematically shows a flow diagram for generating access request data in response to an access request according to an embodiment of the disclosure.
As shown in fig. 8, the aforementioned operation S720 may include operations S810 and S820.
In operation S810, in response to the access request, a structured query statement and an access parameter are obtained.
In operation S820, encryption and/or compression processing is performed with respect to the structured query statement and the access parameter to generate access request data. According to the embodiment of the disclosure, before transmitting data to the JDBC server, the JDBC client may perform Gzip compression and encryption on data such as SQL statements and parameters, send the data and authentication information to the JDBC server to complete the request call, decrypt and compress a result returned by the JDBC server, and return the result to the application program, thereby completing the whole call.
Through the embodiment of the disclosure, data encryption and safety management and control of remote database access can be realized, and the safety level of data is improved.
Fig. 9 schematically shows a flowchart for sending access request data to a JDBC server according to an embodiment of the present disclosure.
As shown in fig. 9, the aforementioned operation S730 may include operations S910 to S940.
In operation S910, a second network quality parameter of the network between the JDBC client and the JDBC server is obtained.
In operation S920, it is detected whether the second network quality parameter satisfies a second preset condition.
In operation S930, in the case where the second network quality parameter satisfies the second preset condition, the access request data is transmitted to the JDBC server through the long connection.
In operation S940, the access request data is transmitted to the JDBC server through the short connection under the condition that the second network quality parameter does not satisfy the second preset condition.
According to the embodiment of the disclosure, the access between the JDBC client and the JDBC server supports two modes of long connection and short connection, and the long connection is used under the condition of higher network quality, otherwise, the short connection is used. Therefore, the network connection mode for sending the access request data to the JDBC server can be determined according to the first network quality parameter of the network between the JDBC client and the JDBC server.
Through the embodiment of the disclosure, various connection modes are provided according to the network connection quality parameters so as to send the access request data to the JDBC server, and the user experience is improved.
Fig. 10 schematically shows a block diagram of an access device applied to a database of a JDBC server according to an embodiment of the present disclosure.
As shown in fig. 10, the apparatus 1000 may include a first receiving module 1010, an obtaining module 1020, and a first sending module 1030.
The first receiving module 1010 is configured to perform, for example, the aforementioned operation S310, and receive access request data from an application program. The access request data is sent by the JDBC client in response to an access request of an application program for the database, wherein the access request data is obtained by encrypting and/or compressing a structured query statement and an access parameter carried in the access request by the JDBC client.
The obtaining module 1020 is configured to perform, for example, the aforementioned operation S320, and obtain, in response to the access request data, access response data corresponding to the access request data from the database.
A first sending module 1030 configured to perform, for example, the aforementioned operation S330, and send the access response data to the JDBC client, so that the application realizes access to the database based on the access response data from the JDBC client.
According to an embodiment of the present disclosure, the obtaining module includes: a first obtaining sub-module configured to perform decryption and/or decompression processing in response to the access request data to obtain the structured query statement and the access parameter, a second obtaining sub-module configured to perform the structured query statement in the database to obtain query data matching the access parameter, and a third obtaining sub-module configured to perform encryption and/or compression processing on the query data to obtain the access response data.
According to an embodiment of the present disclosure, the obtaining module includes: the JDBC client includes a first detection submodule configured to detect whether the JDBC client passes identity authentication, and a fourth acquisition submodule configured to acquire access response data corresponding to the access request data from the database when the JDBC client passes identity authentication.
According to an embodiment of the present disclosure, the first receiving module includes: the JDBC server comprises a first obtaining submodule configured to obtain a first network quality parameter of a network between the JDBC server and the JDBC client, a second detecting submodule configured to detect whether the first network quality parameter meets a first preset condition, and a first receiving submodule configured to receive access request data from an application program through a long connection if the first network quality parameter meets the first preset condition.
According to an embodiment of the present disclosure, the first receiving module further includes: and the second receiving submodule is configured to receive the access request data from the application program through the short connection under the condition that the first network quality parameter does not meet the first preset condition.
By the embodiment of the disclosure, in the access scene of the database at an ultra-long distance, the JDBC server is added as a proxy service to buffer the network pressure, the access response data corresponding to the access request data is obtained from the database in response to the access request data from the application program, and the access response data is sent to the JDBC client, such that the application implements access to the database based on access response data from the JDBC client, the method can realize indirect access to the database server, improve the utilization rate of physical connection of the database server, reduce the number of physical connections of the database server, reduce the resource occupancy rate of the database server, avoid the problem of performance deterioration of the database server caused by connection storm, and at least partially solve the problems of performance reduction and low efficiency caused by network delay and network instability in ultra-long distance database access.
Fig. 11 schematically shows a block diagram of an access device applied to a database of a JDBC client according to an embodiment of the present disclosure.
As shown in fig. 11, the apparatus 1100 may include a second receiving module 1110, a generating module 1120, a second transmitting module 1130, a third receiving module 1140, and a third transmitting module 1150.
The second receiving module 1110 is configured to perform, for example, the aforementioned operation S710, and receive an access request for a database sent by an application program. The access request carries a structured query statement and an access parameter.
The generating module 1120 is configured to perform, for example, the aforementioned operation S720, and generate the access request data in response to the access request.
A second sending module 1130 is configured to execute, for example, the aforementioned operation S730, send the access request data to the JDBC server, so that the JDBC server can obtain, in response to the access request data, access response data corresponding to the access request data from the database, and send the access response data to the JDBC client.
The third receiving module 1140, configured to perform, for example, the aforementioned operation S740, receives the access response data.
A third sending module 1150 configured to perform, for example, the aforementioned operation S750, and send the access response data to the application program so that the application program realizes access to the database.
According to an embodiment of the present disclosure, the generating module includes: a sixth obtaining sub-module configured to obtain the structured query statement and the access parameter in response to the access request, and a generating sub-module configured to perform encryption and/or compression processing on the structured query statement and the access parameter to generate the access request data.
According to an embodiment of the present disclosure, the second sending module includes: a seventh obtaining sub-module configured to obtain a second network quality parameter of the network between the JDBC client and the JDBC server, a second detecting sub-module configured to detect whether the second network quality parameter meets a second preset condition, and a third receiving sub-module configured to send the access request data to the JDBC server through a long connection under the condition that the second network quality parameter meets the second preset condition.
According to an embodiment of the present disclosure, the method further includes: and the third receiving submodule is configured to send the access request data to the JDBC server through short connection under the condition that the second network quality parameter does not satisfy the second preset condition.
Through the embodiment of the disclosure, the JDBC client embedded in the application program is used for sending and receiving data of the JDBC server, so that the buffering of the JDBC server can be increased, and the efficiency of database access is improved.
Fig. 12 schematically shows a block diagram of an access device applied to a database of a JDBC client according to yet another embodiment of the present disclosure.
As shown in fig. 12, the apparatus 1200 may include a compression processing module 1210, an encryption/decryption module 1220, and a network connection module 1230.
According to the embodiment of the disclosure, before transmitting access request data to the JDBC server, the JDBC client may perform Gzip compression and encryption on data such as SQL statements and parameters through the compression processing module 1210 and the encryption and decryption module 1220, send the data and authentication information to the JDBC server through the network connection module 1230 to complete the request call, and then after receiving access response data returned by the DBC database server, perform decryption and compression processing on the access response data, return to the application program, and complete the whole call.
Fig. 13 schematically shows a block diagram of an access device applied to a database of a JDBC server according to yet another embodiment of the present disclosure.
As shown in fig. 13, the apparatus 1300 may include a network connection module 1310, an encryption/decryption module 1320, a compression processing module 1330, a database operation module 1340, and an authentication module 1350.
According to the embodiment of the present disclosure, after receiving data, the JDBC server first completes client identity authentication of the JDBC client through the authentication module 1350, and in the case of successful authentication, invokes the encryption/decryption module 1320 and the compression processing module 1330 to complete restoration of access request data, obtain data such as SQL statements and parameters, connect to the database server to complete execution of the SQL statements, and return access response data returned by the database server to the JDBC client after performing encryption and Gzip compression processing, and complete data invocation by the database operation module 1340.
It should be noted that, the embodiment of the data access apparatus portion is similar to that of the data access method portion, and the achieved technical effects are also similar, which are not described herein again.
Any of the modules, units, or at least part of the functionality of any of them according to embodiments of the present disclosure may be implemented in one module. Any one or more of the modules and units according to the embodiments of the present disclosure may be implemented by being split into a plurality of modules. Any one or more of the modules, units according to the embodiments of the present disclosure may be implemented at least partially as a hardware circuit, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system on a chip, a system on a substrate, a system on a package, an Application Specific Integrated Circuit (ASIC), or may be implemented by any other reasonable means of hardware or firmware by integrating or packaging the circuits, or in any one of three implementations of software, hardware and firmware, or in any suitable combination of any of them. Alternatively, one or more of the modules, units according to embodiments of the present disclosure may be implemented at least partly as computer program modules, which, when executed, may perform the respective functions.
For example, any plurality of the first receiving module 1010, the obtaining module 1020, the first sending module 1030, the second receiving module 1110, the generating module 1120, the second sending module 1130, the third receiving module 1140 and the third sending module 1150 may be combined and implemented in one module, or any one of them may be split into a plurality of modules. Alternatively, at least part of the functionality of one or more of these modules may be combined with at least part of the functionality of the other modules and implemented in one module. According to an embodiment of the present disclosure, at least one of the first receiving module 1010, the obtaining module 1020, the first sending module 1030, the second receiving module 1110, the generating module 1120, the second sending module 1130, the third receiving module 1140 and the third sending module 1150 may be at least partially implemented as a hardware circuit, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system on a chip, a system on a substrate, a system on a package, an Application Specific Integrated Circuit (ASIC), or may be implemented by hardware or firmware in any other reasonable manner of integrating or packaging a circuit, or implemented by any one of or a suitable combination of software, hardware and firmware implementations. Alternatively, at least one of the first receiving module 1010, the obtaining module 1020, the first transmitting module 1030, the second receiving module 1110, the generating module 1120, the second transmitting module 1130, the third receiving module 1140 and the third transmitting module 1150 may be at least partially implemented as a computer program module, which may perform corresponding functions when executed.
Fig. 14 schematically illustrates a block diagram of an electronic device suitable for implementing the database access method and apparatus described above according to an embodiment of the present disclosure. The electronic device shown in fig. 14 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 14, a computer system 1400 according to an embodiment of the present disclosure includes a processor 1401, which can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)1402 or a program loaded from a storage portion 1408 into a Random Access Memory (RAM) 1403. Processor 1401 may comprise, for example, a general purpose microprocessor (e.g., a CPU), an instruction set processor and/or associated chipset, and/or a special purpose microprocessor (e.g., an Application Specific Integrated Circuit (ASIC)), among others. The processor 1401 may also include onboard memory for caching purposes. Processor 1401 may include a single processing unit or multiple processing units for performing different actions of a method flow according to embodiments of the present disclosure.
In the RAM 1403, various programs and data necessary for the operation of the system 1400 are stored. The processor 1401, the ROM 1402, and the RAM 1403 are connected to each other by a bus 1404. The processor 1401 performs various operations of the method flow according to the embodiments of the present disclosure by executing programs in the ROM 1402 and/or the RAM 1403. Note that the programs may also be stored in one or more memories other than ROM 1402 and RAM 1403. The processor 1401 may also perform various operations of the method flows according to the embodiments of the present disclosure by executing programs stored in the one or more memories.
According to an embodiment of the present disclosure, system 1400 may also include an input/output (I/O) interface 1405, which input/output (I/O) interface 1405 is also connected to bus 1404. The system 1400 may also include one or more of the following components connected to the I/O interface 1405: an input portion 1406 including a keyboard, a mouse, and the like; an output portion 1407 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker and the like; a storage portion 1408 including a hard disk and the like; and a communication portion 1409 including a network interface card such as a LAN card, a modem, or the like. The communication section 1409 performs communication processing via a network such as the internet. The driver 1410 is also connected to the I/O interface 1405 as necessary. A removable medium 1411 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 1410 as necessary, so that a computer program read out therefrom is installed into the storage section 1408 as necessary.
According to embodiments of the present disclosure, method flows according to embodiments of the present disclosure may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable storage medium, the computer program containing program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication portion 1409 and/or installed from the removable medium 1411. The computer program, when executed by the processor 1401, performs the above-described functions defined in the system of the embodiment of the present disclosure. The systems, devices, apparatuses, modules, units, etc. described above may be implemented by computer program modules according to embodiments of the present disclosure.
The present disclosure also provides a computer-readable storage medium, which may be contained in the apparatus/device/system described in the above embodiments; or may exist separately and not be assembled into the device/apparatus/system. The computer-readable storage medium carries one or more programs which, when executed, implement the method according to an embodiment of the disclosure.
According to embodiments of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium, which may include, for example but is not limited to: a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. For example, according to embodiments of the present disclosure, a computer-readable storage medium may include one or more memories other than ROM 1402 and/or RAM 1403 and/or ROM 1402 and RAM 1403 described above.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
Those skilled in the art will appreciate that various combinations and/or combinations of features recited in the various embodiments and/or claims of the present disclosure can be made, even if such combinations or combinations are not expressly recited in the present disclosure. In particular, various combinations and/or combinations of the features recited in the various embodiments and/or claims of the present disclosure may be made without departing from the spirit or teaching of the present disclosure. All such combinations and/or associations are within the scope of the present disclosure.
The embodiments of the present disclosure have been described above. However, these examples are for illustrative purposes only and are not intended to limit the scope of the present disclosure. Although the embodiments are described separately above, this does not mean that the measures in the embodiments cannot be used in advantageous combination. The scope of the disclosure is defined by the appended claims and equivalents thereof. Various alternatives and modifications can be devised by those skilled in the art without departing from the scope of the present disclosure, and such alternatives and modifications are intended to be within the scope of the present disclosure.

Claims (11)

1. A method for accessing a database, performed by a Java database connectivity (JDBC) server deployed in the same network area as the database, the method comprising:
receiving access request data from an application program, wherein the access request data is sent by a JDBC client in response to an access request of the application program to the database, and the access request data is obtained by encrypting and/or compressing a structured query statement and an access parameter carried in the access request by the JDBC client;
responding to the access request data, and acquiring access response data corresponding to the access request data from the database; and
sending the access response data to the JDBC client to cause the application to implement access to the database based on the access response data from the JDBC client,
wherein the receiving access request data from an application comprises:
acquiring a first network quality parameter of a network between the JDBC server and the JDBC client;
detecting whether the first network quality parameter meets a first preset condition; and
and receiving access request data from an application program through a long connection under the condition that the first network quality parameter meets the first preset condition.
2. The method of claim 1, wherein the retrieving, from the database, access response data corresponding to the access request data in response to the access request data comprises:
performing decryption and/or decompression processing in response to the access request data to obtain the structured query statement and the access parameter;
executing the structured query statement in the database to obtain query data matching the access parameter; and
and performing encryption and/or compression processing on the query data to acquire the access response data.
3. The method of claim 1, wherein the retrieving access response data corresponding to the access request data from the database comprises:
detecting whether the JDBC client passes identity authentication; and
and under the condition that the JDBC client passes the identity authentication, acquiring access response data corresponding to the access request data from the database.
4. The method of claim 1, wherein the method further comprises:
and receiving access request data from an application program through a short connection under the condition that the first network quality parameter does not meet the first preset condition.
5. A method of accessing a database, performed by a JDBC client, the method comprising:
receiving an access request aiming at the database sent by an application program, wherein the access request carries a structured query statement and an access parameter;
generating access request data in response to the access request;
sending the access request data to a JDBC server so that the JDBC server can respond to the access request data, obtain access response data corresponding to the access request data from the database, and send the access response data to the JDBC client, wherein the sending the access request data to the JDBC server comprises:
acquiring a second network quality parameter of the network between the JDBC client and the JDBC server;
detecting whether the second network quality parameter meets a second preset condition; and
under the condition that the second network quality parameter meets the second preset condition, sending the access request data to a JDBC server through a long connection;
receiving the access response data; and
and sending the access response data to the application program so that the application program realizes the access to the database.
6. The method of claim 5, wherein the generating access request data in response to the access request comprises:
responding to the access request, and acquiring the structured query statement and the access parameter; and
performing encryption and/or compression processing on the structured query statement and the access parameter to generate the access request data.
7. The method of claim 5, wherein the method further comprises:
and sending the access request data to the JDBC server through short connection under the condition that the second network quality parameter does not meet the second preset condition.
8. An access device for a database, applied to a JDBC server deployed in the same network area as the database, the device comprising:
a first receiving module, configured to receive access request data from an application, where the access request data is sent by a JDBC client in response to an access request of the application to the database, and the access request data is obtained by encrypting and/or compressing a structured query statement and an access parameter carried in the access request by the JDBC client, and the receiving the access request data from the application includes: acquiring a first network quality parameter of a network between the JDBC server and the JDBC client; detecting whether the first network quality parameter meets a first preset condition; and receiving access request data from an application program through a long connection under the condition that the first network quality parameter meets the first preset condition;
the acquisition module is configured to respond to the access request data and acquire access response data corresponding to the access request data from the database; and
a first sending module configured to send the access response data to the JDBC client to cause the application to implement access to the database based on the access response data from the JDBC client.
9. An access device of a database, applied to a JDBC client, comprising:
the second receiving module is configured to receive an access request which is sent by an application program and aims at the database, wherein the access request carries a structured query statement and an access parameter;
a generation module configured to generate access request data in response to the access request;
a second sending module, configured to send the access request data to a JDBC server, so that the JDBC server can obtain, in response to the access request data, access response data corresponding to the access request data from the database, and send the access response data to the JDBC client, where the sending the access request data to the JDBC server includes: acquiring a second network quality parameter of the network between the JDBC client and the JDBC server; detecting whether the second network quality parameter meets a second preset condition; and sending the access request data to the JDBC server through a long connection under the condition that the second network quality parameter meets the second preset condition;
a third receiving module configured to receive the access response data; and
a third sending module configured to send the access response data to the application program so that the application program realizes access to the database.
10. An electronic device, comprising:
one or more processors; and
a memory for storing one or more programs,
wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method of any of claims 1-7.
11. A computer-readable storage medium storing computer-executable instructions for implementing the method of any one of claims 1 to 7 when executed.
CN201910679775.9A 2019-07-25 2019-07-25 Database access method and device, electronic equipment and medium Active CN110413676B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910679775.9A CN110413676B (en) 2019-07-25 2019-07-25 Database access method and device, electronic equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910679775.9A CN110413676B (en) 2019-07-25 2019-07-25 Database access method and device, electronic equipment and medium

Publications (2)

Publication Number Publication Date
CN110413676A CN110413676A (en) 2019-11-05
CN110413676B true CN110413676B (en) 2022-03-11

Family

ID=68363468

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910679775.9A Active CN110413676B (en) 2019-07-25 2019-07-25 Database access method and device, electronic equipment and medium

Country Status (1)

Country Link
CN (1) CN110413676B (en)

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111090667A (en) * 2019-12-04 2020-05-01 北京奇艺世纪科技有限公司 Data processing method, device, server and storage medium
CN111339552B (en) * 2020-02-12 2022-05-17 厦门网宿有限公司 Database access method and device
CN111786809A (en) * 2020-05-11 2020-10-16 北京奇艺世纪科技有限公司 Client software network optimization method, system, device and storage medium
CN113296974B (en) * 2020-08-31 2022-04-26 阿里巴巴集团控股有限公司 Database access method and device, electronic equipment and readable storage medium
CN112162996A (en) * 2020-09-23 2021-01-01 金现代信息产业股份有限公司 Database access method and system for in-station graph editor
CN112000444B (en) * 2020-10-27 2021-06-22 财付通支付科技有限公司 Database transaction processing method and device, storage medium and electronic equipment
CN112364087A (en) * 2020-11-26 2021-02-12 亚信科技(中国)有限公司 Method and system for accessing database by C/C + + application program of ARM platform
CN112910980B (en) * 2021-01-27 2022-11-15 中国银联股份有限公司 Database access system and method
CN113688182A (en) * 2021-10-26 2021-11-23 深圳市明源云科技有限公司 Database automatic switching method and device and computer readable storage medium
CN115687391A (en) * 2022-10-28 2023-02-03 蚂蚁区块链科技(上海)有限公司 Database access method, computing device and server

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109525620A (en) * 2017-09-20 2019-03-26 中移(杭州)信息技术有限公司 A kind of message push system, method and device
CN110019484A (en) * 2018-01-04 2019-07-16 腾讯科技(深圳)有限公司 Database Systems and implementation method, management equipment, data interface unit and medium

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102739560B (en) * 2011-04-13 2015-09-09 腾讯科技(深圳)有限公司 Instant communication method, system and device
CN102546810A (en) * 2012-01-16 2012-07-04 广州市新信荟智信息产业有限公司 Remote access method of database
CN103365979A (en) * 2013-07-03 2013-10-23 交通银行股份有限公司 Long-distance double-center online processing method and system based on open database
CN104955171A (en) * 2014-03-26 2015-09-30 中兴通讯股份有限公司 Method and device for controlling establishment of mobile communication network connection
CN106209951A (en) * 2015-05-08 2016-12-07 北京娜迦信息科技发展有限公司 Information transferring method, client and server
CN106911732A (en) * 2015-12-22 2017-06-30 阿里巴巴集团控股有限公司 A kind of website visiting accelerating method and device

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109525620A (en) * 2017-09-20 2019-03-26 中移(杭州)信息技术有限公司 A kind of message push system, method and device
CN110019484A (en) * 2018-01-04 2019-07-16 腾讯科技(深圳)有限公司 Database Systems and implementation method, management equipment, data interface unit and medium

Also Published As

Publication number Publication date
CN110413676A (en) 2019-11-05

Similar Documents

Publication Publication Date Title
CN110413676B (en) Database access method and device, electronic equipment and medium
US10482104B2 (en) Zero-data loss recovery for active-active sites configurations
US11640247B2 (en) Providing service address space for diagnostics collection
US8375200B2 (en) Embedded device and file change notification method of the embedded device
US9798639B2 (en) Failover system and method replicating client message to backup server from primary server
US9912474B2 (en) Performing telemetry, data gathering, and failure isolation using non-volatile memory
US20130268495A1 (en) Split brain protection in computer clusters
US8682954B2 (en) Replication in a network environment
US9588780B2 (en) Maintaining state information in a multi-component, event-driven state machine
US9436539B2 (en) Synchronized debug information generation
GB2529246A (en) Method for securing integrity and consistency of a cloud storage service with efficient client operations
US20130332507A1 (en) Highly available servers
US20190324861A1 (en) Backup and restore validation
US10873628B2 (en) System and method for non-intrusive context correlation across cloud services
CN110896489B (en) Authentication method, device, equipment and storage medium
US20150006481A1 (en) Reliable Asynchronous Processing of a Synchronous Request
US9384120B2 (en) Testing of transaction tracking software
US9959097B2 (en) SVN interface system for heterogeneous development environments
CN115374098A (en) High concurrent payment order anti-duplication method, apparatus, system, device, medium, and program product
JP6309432B2 (en) Secret calculation system and method, management server and program
US10671505B2 (en) System and method for monitoring service
CN115484149B (en) Network switching method, network switching device, electronic equipment and storage medium
US11210129B2 (en) Extended architecture as a service to integrate resource and transaction managers
US10831508B2 (en) Embedded system application installation and execution method and apparatus
WO2024107280A1 (en) Secure data ingestion with edge computing

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