CN110413676A - The access method and its device of database, electronic equipment and medium - Google Patents

The access method and its device of database, electronic equipment and medium Download PDF

Info

Publication number
CN110413676A
CN110413676A CN201910679775.9A CN201910679775A CN110413676A CN 110413676 A CN110413676 A CN 110413676A CN 201910679775 A CN201910679775 A CN 201910679775A CN 110413676 A CN110413676 A CN 110413676A
Authority
CN
China
Prior art keywords
access
access request
database
jdbc
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.)
Granted
Application number
CN201910679775.9A
Other languages
Chinese (zh)
Other versions
CN110413676B (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

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

Present disclose provides a kind of access methods of database, it is executed by Java database connection (JDBC) server, JDBC server and database are deployed in consolidated network region, this method comprises: receiving the access request data from application program, wherein, access request data is that JDBC client end response is sent in application program for the access request of database, and access request data is JDBC client to the structured query sentence carried in access request and access parameter carries out encryption and/or compression processing obtains;In response to access request data, access response data corresponding with access request data are obtained from database;And access response data are sent to JDBC client, so that application program realizes the access for being directed to database based on the access response data from JDBC client.The disclosure additionally provides a kind of access mechanism of database, is applied to JDBC server, a kind of electronic equipment and a kind of computer readable storage medium.

Description

The access method and its device of database, electronic equipment and medium
Technical field
This disclosure relates to network technique field, access method and its device more particularly to a kind of database, electronics are set Standby and medium.
Background technique
With the development of financial technology, more and more finance units implement mostly polycentric high availability scheme, for example, Three center of two places, three ground, four center.In order to realize that application program mostly while accessing, framework deployment living more than more gardens, need Transformation is optimized to application program, to reduce the dependence to pooling of resources.
But optimize anyway, by taking financial industry as an example, the very high data demand of some total coherence request Real-Time Sharing (such as accounting data), and these one point data libraries still can not completely remove (or improvement cost is too high), need The application program of more gardens accesses the database of the same garden.Accordingly, there exist the overlength distance requirements for access in critical data library.
In more gardens framework mostly living, the distance between garden and garden are apart from each other, and some has been even up to thousands of kilometers. The delay of network and unstable brings biggish performance loss and security risk to the direct access of database, to application program Normal operation bring certain pressure.
Summary of the invention
In view of this, in order to solve directly to access in the prior art performance loss brought by the database of overlength distance and The instability problems such as security risk.Present disclose provides a kind of access method of database and its device, electronic equipment and medium.
To achieve the above object, an aspect of this disclosure provides a kind of access method of database, by Java data Library connects (JDBC) server and executes, and above-mentioned JDBC server and above-mentioned database are deployed in consolidated network region, the above method It include: to receive the access request data from application program, wherein above-mentioned access request data is JDBC client end response in upper State what application program was sent for the access request of above-mentioned database, above-mentioned access request data is above-mentioned JDBC client to upper It states the structured query sentence that carries in access request and access parameter carries out encryption and/or compression processing obtains, in response to Above-mentioned access request data obtains access response data corresponding with above-mentioned access request data from above-mentioned database, and Above-mentioned access response data are sent to above-mentioned JDBC client, so that above-mentioned application program is based on from above-mentioned JDBC client Above-mentioned access response data realize the access for being directed to above-mentioned database.
In accordance with an embodiment of the present disclosure, above-mentioned in response to above-mentioned access request data, obtained from above-mentioned database with it is upper Stating the corresponding access response data of access request data includes: to execute decryption and/or decompression in response to above-mentioned access request data Contracting processing executes above structure in above-mentioned database and looks into obtain above structure query statement and above-mentioned access parameter Ask sentence, with obtain with the matched inquiry data of above-mentioned access parameter, and be directed to above-mentioned inquiry data, execute encryption and/or Compression processing, to obtain above-mentioned access response data.
In accordance with an embodiment of the present disclosure, the above-mentioned acquisition from above-mentioned database is corresponding with above-mentioned access request data prevents asking Response data includes: detecting whether above-mentioned JDBC client passes through authentication, and passes through identity in above-mentioned JDBC client In the case where certification, access response data corresponding with above-mentioned access request data are obtained from above-mentioned database.
In accordance with an embodiment of the present disclosure, access request data of the above-mentioned reception from application program includes: that acquisition is above-mentioned The first network mass parameter of network between JDBC server and above-mentioned JDBC client, detects above-mentioned first network mass parameter Whether first preset condition is met, and in the case where above-mentioned first network mass parameter meets above-mentioned first preset condition, The access request data from application program is received by long connect.
In accordance with an embodiment of the present disclosure, the above method further include: be unsatisfactory for above-mentioned in above-mentioned first network mass parameter In the case where one preset condition, the access request data from application program is received by short connection.
To achieve the above object, another aspect of the disclosure provides a kind of access method of database, by JDBC visitor Family end executes, and the above method includes: the access request for above-mentioned database for receiving application program and sending, wherein to above-mentioned The structured query sentence and access parameter carried in access request generates access request data in response to above-mentioned access request, Above-mentioned access request data is sent to JDBC server so that above-mentioned JDBC server can in response to above-mentioned access request data, Access response data corresponding with above-mentioned access request data are obtained from above-mentioned database, are concurrently served and are stated access response data To above-mentioned JDBC client, above-mentioned access response data are received, and send above-mentioned access response data to above-mentioned application program, So that above-mentioned application program realizes the access for being directed to above-mentioned database.
In accordance with an embodiment of the present disclosure, above-mentioned in response to above-mentioned access request, generate access request data include: in response to Above-mentioned access request obtains above structure query statement and above-mentioned access parameter, and is directed to above structure query statement With above-mentioned access parameter, encryption and/or compression processing are executed, to generate above-mentioned access request data.
In accordance with an embodiment of the present disclosure, the above-mentioned access request data of above-mentioned transmission to JDBC server includes: that acquisition is above-mentioned Second network quality parameters of network between JDBC client and above-mentioned JDBC server detect above-mentioned second network quality parameters Whether second preset condition is met, and in the case where above-mentioned second network quality parameters meet above-mentioned second preset condition, Above-mentioned access request data is sent to JDBC server by long connection.
In accordance with an embodiment of the present disclosure, the above method further include: be unsatisfactory for above-mentioned in above-mentioned second network quality parameters In the case where two preset conditions, above-mentioned access request data is sent to JDBC server by short connection.
To achieve the above object, another aspect of the disclosure provides a kind of access mechanism of database, is applied to JDBC server, above-mentioned JDBC server and above-mentioned database are deployed in consolidated network region, and above-mentioned apparatus includes: the first reception Module is configured as receiving the access request data from application program, wherein above-mentioned access request data is JDBC client It is sent in response to above-mentioned application program for the access request of above-mentioned database, above-mentioned access request data is above-mentioned JDBC visitor Family end is to the structured query sentence carried in above-mentioned access request and access parameter carries out encryption and/or compression processing obtains , module is obtained, above-mentioned access request data is configured to respond to, is obtained and above-mentioned access request number from above-mentioned database According to corresponding access response data and the first sending module, it is configured as sending above-mentioned access response data to above-mentioned JDBC Client, so that above-mentioned application program is realized based on the above-mentioned access response data from above-mentioned JDBC client is directed to above-mentioned number According to the access in library.
In accordance with an embodiment of the present disclosure, above-mentioned acquisition module includes: the first acquisition submodule, is configured to respond to above-mentioned Access request data executes decryption and/or decompression, to obtain above structure query statement and above-mentioned access parameter, Second acquisition submodule is configured as executing above structure query statement in above-mentioned database, to obtain and above-mentioned access The matched inquiry data of parameter and third acquisition submodule, are configured as above-mentioned inquiry data, execute encryption and/or Compression processing, to obtain above-mentioned access response data.
In accordance with an embodiment of the present disclosure, above-mentioned acquisition module includes: the first detection sub-module, is configured as detecting above-mentioned Whether JDBC client passes through authentication and the 4th acquisition submodule, is configured as passing through body in above-mentioned JDBC client In the case where part certification, access response data corresponding with above-mentioned access request data are obtained from above-mentioned database.
In accordance with an embodiment of the present disclosure, above-mentioned first receiving module includes: the 5th acquisition submodule, is configured as in acquisition The first network mass parameter of network between JDBC server and above-mentioned JDBC client is stated, the second detection sub-module is configured To detect whether above-mentioned first network mass parameter meets the first preset condition and the first receiving submodule, it is configured as In the case that above-mentioned first network mass parameter meets above-mentioned first preset condition, received by long connection from application program Access request data.
In accordance with an embodiment of the present disclosure, above-mentioned first receiving module further include: the second receiving submodule is configured as upper It states in the case that first network mass parameter is unsatisfactory for above-mentioned first preset condition, is received by short connection from application program Access request data.
To achieve the above object, another aspect of the disclosure provides a kind of access mechanism of database, is applied to JDBC client, above-mentioned apparatus include: the second receiving module, and be configured as reception application program transmission is directed to above-mentioned database Access request, wherein to the structured query sentence that carries in above-mentioned access request and access parameter, generation module is matched It is set in response to above-mentioned access request, generates access request data, the second sending module is configured as sending above-mentioned access request Data are to JDBC server, so that above-mentioned JDBC server can be obtained from above-mentioned database in response to above-mentioned access request data Access response data corresponding with above-mentioned access request data are taken, concurrently serves and states access response data to above-mentioned JDBC client End, third receiving module are configured as receiving above-mentioned access response data and third sending module, be configured as in transmission Access response data are stated to above-mentioned application program, so that above-mentioned application program realizes the access for being directed to above-mentioned database.
In accordance with an embodiment of the present disclosure, above-mentioned generation module includes: the 6th acquisition submodule, is configured to respond to above-mentioned Access request obtains above structure query statement and above-mentioned access parameter, and generates submodule, is configured as above-mentioned Structured query sentence and above-mentioned access parameter execute encryption and/or compression processing, to generate above-mentioned access request data.
In accordance with an embodiment of the present disclosure, above-mentioned second sending module includes: the 7th acquisition submodule, is configured as in acquisition The second network quality parameters of network between JDBC client and above-mentioned JDBC server are stated, the second detection sub-module is configured To detect whether above-mentioned second network quality parameters meet the second preset condition and third receiving submodule, it is configured as In the case that above-mentioned second network quality parameters meet above-mentioned second preset condition, above-mentioned access request number is sent by long connection According to JDBC server.
In accordance with an embodiment of the present disclosure, the above method further include: third receiving submodule is configured as in above-mentioned second net In the case that network mass parameter is unsatisfactory for above-mentioned second preset condition, above-mentioned access request data is sent to JDBC by short connection Server.
To achieve the above object, another aspect of the present disclosure provides a kind of electronic equipment, comprising: one or more processing Device, memory, for storing one or more programs, wherein when said one or multiple programs are by said one or multiple places When managing device execution, so that said one or multiple processors realize method as described above.
To achieve the above object, another aspect of the present disclosure provides a kind of computer readable storage medium, is stored with meter Calculation machine executable instruction, above-metioned instruction is when executed for realizing method as described above.
To achieve the above object, another aspect of the present disclosure provides a kind of computer program, above-mentioned computer program packet Computer executable instructions are included, above-metioned instruction is when executed for realizing method as described above.
Therefore compared with prior art, the access method and its device for the database that the embodiment of the present disclosure provides, by JDBC server executes, and the JDBC server and database are deployed in consolidated network region.By in response to access request number According to the acquisition access response data corresponding with access request data from database;And access response data are sent to JDBC Client, so that application program realizes the access for being directed to database based on the access response data from JDBC client, it can be with At least partly overcome in the related technology and directly accesses performance loss brought by the database of overlength distance and security risk Etc. unstable technical problem.In overlength distance scene, application server access database is connected using the network of lightweight It connects, it is only necessary to which carrying out primary interaction can be completed a request execution, it is possible to reduce the data volume of network overhead, transmission is few, subtracts Few network transmission volume.Furthermore, it is possible to realize transmission encryption and certification, the safety is improved, improves the utilization rate of database connection, subtracts The occupancy of the resources such as few databases, while " connection storm " is reduced to the risk of database, avoid database vicious circle Cause snowslide phenomenon.
Detailed description of the invention
In order to which the disclosure and its advantage is more fully understood, referring now to being described below in conjunction with attached drawing, in which:
Fig. 1 diagrammatically illustrates the access method of the database of the embodiment of the present disclosure and the system architecture of device;
Fig. 2 diagrammatically illustrates the access method of the database suitable for the embodiment of the present disclosure and the application scenarios of device;
Fig. 3 diagrammatically illustrates the access method of the database executed by JDBC server according to the embodiment of the present disclosure Flow chart;
Fig. 4 is diagrammatically illustrated according to the embodiment of the present disclosure in response to access request data, obtain from the database with The flow chart of the corresponding access response data of access request data;
Fig. 5, which is diagrammatically illustrated, obtains visit corresponding with access request data in the slave database according to the embodiment of the present disclosure Ask the flow chart of response data;
Fig. 6 diagrammatically illustrates the reception according to the embodiment of the present disclosure from the process of the access request data of application program Figure;
Fig. 7 diagrammatically illustrates the process of the access of the database by JDBC client executing according to the embodiment of the present disclosure Figure;
Fig. 8 is diagrammatically illustrated according to the embodiment of the present disclosure in response to access request, generates the stream of access request data Cheng Tu;
Fig. 9 diagrammatically illustrates the process according to the transmission access request data of the embodiment of the present disclosure to JDBC server Figure;
Figure 10 diagrammatically illustrates the access mechanism of the database applied to JDBC server according to the embodiment of the present disclosure Block diagram;
Figure 11 diagrammatically illustrates the access mechanism of the database applied to JDBC server according to the embodiment of the present disclosure Block diagram;
Figure 12 diagrammatically illustrates the access of the database applied to JDBC client according to disclosure another embodiment The block diagram of device;
Figure 13 diagrammatically illustrates the access of the database applied to JDBC server according to disclosure another embodiment The block diagram of device;And
Figure 14 diagrammatically illustrate according to the embodiment of the present disclosure be adapted for carrying out database described above access method and The block diagram of the electronic equipment of device.
Specific embodiment
Hereinafter, will be described with reference to the accompanying drawings embodiment of the disclosure.However, it should be understood that these descriptions are only exemplary , and it is not intended to limit the scope of the present disclosure.In the following detailed description, to elaborate many specific thin convenient for explaining Section is to provide the comprehensive understanding to the embodiment of the present disclosure.It may be evident, however, that one or more embodiments are not having these specific thin It can also be carried out in the case where section.In addition, in the following description, descriptions of well-known structures and technologies are omitted, to avoid Unnecessarily obscure the concept of the disclosure.
Term as used herein is not intended to limit the disclosure just for the sake of description specific embodiment.It uses herein The terms "include", "comprise" etc. show the presence of features described above, step, operation and/or component, but it is not excluded that in the presence of Or add other one or more features, step, operation or component.
There are all terms (including technical and scientific term) as used herein those skilled in the art to be generally understood Meaning, unless otherwise defined.It should be noted that term used herein should be interpreted that with consistent with the context of this specification Meaning, without that should be explained with idealization or excessively mechanical mode.
It, in general should be according to this using statement as " at least one in A, B and C etc. " is similar to Field technical staff is generally understood the meaning of the statement to make an explanation (for example, " system at least one in A, B and C " Should include but is not limited to individually with A, individually with B, individually with C, with A and B, with A and C, have B and C, and/or System etc. with A, B, C).Using statement as " at least one in A, B or C etc. " is similar to, generally come Saying be generally understood the meaning of the statement according to those skilled in the art to make an explanation (for example, " having in A, B or C at least One system " should include but is not limited to individually with A, individually with B, individually with C, with A and B, have A and C, have B and C, and/or the system with A, B, C etc.).
Shown in the drawings of some block diagrams and/or flow chart.It should be understood that some sides in block diagram and/or flow chart Frame or combinations thereof can be realized by computer program instructions.These computer program instructions can be supplied to general purpose computer, The processor of special purpose computer or other programmable data processing units, so that these instructions are when executed by this processor can be with Creation is for realizing function/operation device illustrated in these block diagrams and/or flow chart.The technology of the disclosure can be hard The form of part and/or software (including firmware, microcode etc.) is realized.In addition, the technology of the disclosure, which can be taken, is stored with finger The form of computer program product on the computer readable storage medium of order, the computer program product is for instruction execution system System uses or instruction execution system is combined to use.
After data centralization, the business activities of enterprise are increasingly dependent on the IT infrastructure such as data center and network, The 7*24 whole day business continuity operation of IT infrastructure becomes the target that the operation of large enterprise's IT construction and enterprise operation are pursued.Such as What, which is realized, decreases or even eliminates normal and improper shutdown influence caused by service availability, is not only IT construction and O&M It is of interest more to become business decision layer for the target of team.
For the standby purpose of calamity, enterprise generally can all build two or more data centers.Primary data center undertakes user Core business, other data centers mainly undertake some non-key business and back up data, configuration, the industry at main center simultaneously Business etc..Under normal circumstances, Each performs its own functions for main center and standby center, when disaster occurs, primary data center delay machine, Backup Data center Can fast quick-recovery data and application, to mitigate because disaster gives the loss of user's bring.Since disaster is small probability event, and Using one main one for this mode, Backup Data center only occurs Shi Caineng in disaster and plays a role, and with enterprise's disaster tolerance The promotion of construction criteria, backup IT resource and fund can put into it is increasing, mutually directly again can not be multiplexed, to cause wave Take.In addition the application of active-standby mode, standby center is takeed a long time when taking over main center, relationship is complicated, often seriously Influence the business handling of user.
In more gardens framework mostly living, distance is apart from each other between garden, and some has reached thousands of kilometers.The delay of network and It is unstable, biggish performance loss and security risk are brought to the direct access of database, to the normal operation band of application program Carry out certain pressure.
Based on this, embodiment of the disclosure provides a kind of by Java database connection (Java DataBase Connectivity, referred to as JDBC) server execute database access method.Particularly, the JDBC server and number It is deployed in consolidated network region according to library, this method comprises: firstly, receiving the access request data from application program, the access Request data is that JDBC client end response is sent in application program for the access request of database, and access request data is JDBC client is to the structured query sentence carried in access request and access parameter carries out encryption and/or compression processing obtains , then, in response to access request data, access response data corresponding with access request data are obtained from database, most Access response data are sent afterwards to JDBC client, so that application program is real based on the access response data from JDBC client Now it is directed to the access of database.
The class and interface that JDBC is write by one group with Java language form, and are that a kind of Java for executing SQL statement is answered With routine interface (Application Programming Interface, abbreviation API), can be mentioned for a variety of relational databases It is accessed for unified.JDBC provides a kind of benchmark, can construct more advanced tool and interface accordingly, make database development personnel Database application can be write.
Compared to traditional scheme, in overlength distance scene, application server access database server, using lightweight Network connection, it is only necessary to carrying out primary interaction can be completed a request execution, reduce network overhead, and the data volume of transmission is few, Network transmission volume can be reduced;Transmission encryption and certification are realized, the safety is improved, can also be improved database server connection Utilization rate, reduce the occupancy of the resources such as databases, " connection storm " can also be reduced to the risk of database server, Database server vicious circle is avoided to cause snowslide phenomenon.
Fig. 1 diagrammatically illustrates the access method of the database of the embodiment of the present disclosure and the system architecture of device.It needs Bright, being only shown in Fig. 1 can be using the example of the system architecture of the embodiment of the present disclosure, to help those skilled in the art to manage The technology contents of the disclosure are solved, but are not meant to that the embodiment of the present disclosure may not be usable for other equipment, system, environment or field Scape.
The access method and device of the database of the embodiment of the present disclosure can be used in the system architecture of " more ground multicenter ". Fig. 1 only shows the " system architecture 100 of three " center " of two places." three " center " of two places refers on the basis of same city dual-active, increases by one A strange land data center, and it is synchronous with same city dual-active realization, that is, realize a kind of commercial appearance for adding one center of strange land with the double centers in city Calamity backup solution has both the ability of high availability and disaster recovery.It is appreciated that the production center in the strange land is used as same city Dual-active/bicentric data backup.When the reasons such as natural calamity, which occur, in double centers breaks down, the strange land production center can be real The recovery of existing data guarantees that business operates normally.
" " two places " in three " center " of two places refer to same city and strange land.For example, Beijing Tong Cheng shown in Fig. 1 (including A Ground and B) and Shanghai strange land (including C).Wherein, the A of Beijing Tong Cheng between the ground B of Beijing Tong Cheng at a distance of 55 kms, The A of Beijing Tong Cheng between the ground C at Shanghai strange land center at a distance of 1500 kms, the B of Beijing Tong Cheng with Shanghai strange land center The ground C between at a distance of 1200 kms.
" in three " center " of two places " three " center "s refer to the production center, produce with city dual-active (disaster tolerance) center and strange land Center.For example, being located at the production center A on the ground Beijing Tong Cheng A shown in Fig. 1, positioned at the same city dual-active center on Beijing ground Tong Cheng B B, the strange land production center C positioned at the Shanghai strange land ground center C.Wherein, the function of production center A is core production and system fortune Row, the function with city dual-active center B is the separable inquiry transaction of operation, operation batch and provides basic service function, and strange land is raw The function of production center C is strange land production, calamity is standby, basic technology is researched and developed and system, application version test.
Under system architecture as shown in Figure 1, " multiple data centers that three " center "s include main and standby relation each other, that is, exist Primary and secondary, there are difference for service deployment priority, and the response and switching cycle for disaster are very long, recovery time target (RecoveryTime Object, referred to as RTO) and recovery point objectives (Recovery Point Object, referred to as RPO) It cannot achieve the interruption of business zero, resource utilization is low, and investment repayment is unable to reach expection.
RTO refer to information system failure or state of paralysis caused by the disaster be restored to can normal operating condition, and Time needed for the business function supported abnormal state caused by the disaster is restored to receptive phase, including standby Part data are restored to available mode required time, application system switching time and backup network switching time etc., which uses To measure the traffic restoration capability of Disaster Tolerant Scheme.For example, disaster occurs just to need to restore in afternoon, then RTO value is exactly 12 Hour.RPO refers to the maximum data amount lost (measuring with the time) during the permitted disaster of operation system, this is one Data Replication Technology in Mobile selected by a disaster recovery and backup systems has the index of substantial connection, to measure the data redundancy backup of disaster recovery solution Ability.
The disclosure will be hereafter described in detail by taking financial industry as an example.But it is to be appreciated that the scene is not Restriction to application scenarios.
Fig. 2 diagrammatically illustrates the access method of the database suitable for the embodiment of the present disclosure and the application scenarios of device. It should be noted that being only the example that can apply the application scenarios of the embodiment of the present disclosure shown in Fig. 2, to help art technology Personnel understand the technology contents of the disclosure, but are not meant to that the embodiment of the present disclosure may not be usable for other equipment, system, environment Or scene.
As shown in Fig. 2, being suitable for the access method of the database of the embodiment of the present disclosure and the application scenarios 200 of device can be with Including multiple application programs 210, JDBC server 220 and database server 230.
By taking financial industry as an example, the very high data demand of the total coherence request of some storage in the database is real When it is shared, for example, accounting data, and these one point data libraries still can not completely remove (or improvement cost is too high).Therefore, Multiple application programs 210 in more gardens are needed to access the data in a campus database server 230, there are critical datas The overlength distance requirements for access in library.
In the related technology, application program 210 directly accesses the database server 230, although data source can be used Connection pool carries out a degree of optimization, but in the access process of overlength distance, however it remains following disadvantage:
1. the execution of a structured query language (Structured Query Language, referred to as SQL), data It needs repeatedly to be interacted between library driving and database, so that network delay can be amplified, and then leads to inefficiency, influence The performance of application program 210.
2. the network environment of overlength distance and the network quality of local area network are incomparable, there are biggish unstable Property, the shake of network will cause link in connection pool whole and removes or occur dirty link, all remove that will cause the short time big Amount link creation influences database performance, and dirty link will lead to report an error using transaction, and then influences the normal of application program 210 Operation.
3. database connects, utilization rate is lower, will lead to increasing for database side connection, the resource occupation such as databases It is more.
4. the performance and efficiency of database can be amplified.Database performance slightly becomes due to bottom, resource etc. When poor, will lead to SQL, to execute the time long, in the case that front end applications pressure does not subtract, necessarily will increase database connection, and data The short time of library connection increases the performance that will affect database again, forms vicious circle, may finally will lead to avalanche effect, draw Play systematic failure.
The access method for the database that the disclosure provides, by increasing between application program 210 and database server 230 Add one layer of access agent, i.e. JDBC server 220, and is deployed in the same garden, application program with database server 230 210 can use provided JDBC client-side interface, pass through the visit of 220 database server 230 of JDBC server The problems such as asking, avoiding network delay caused by directly accessing the database server 230.
It should be understood that the number of application program, JDBC server and database server in Fig. 2 is only schematic 's.According to needs are realized, any number of application program, JDBC server and database server can have.
The disclosure is elaborated below with reference to attached drawing and in conjunction with specific embodiments.
Fig. 3 diagrammatically illustrates the access method of the database executed by JDBC server according to the embodiment of the present disclosure Flow chart.
In accordance with an embodiment of the present disclosure, JDBC server and database server are disposed together, can be front end (application Program) agency service of access database server is provided, while JDBC server is supported client certificate, data compression, is added Close function, holding load are balanced.As shown in figure 3, the access method of the database may include operation S310~operation S330.
Firstly, receiving the access request data from application program in operation S310.
Next, in response to access request data, being obtained from database corresponding with access request data in operation S320 Access response data.
Then, in operation S330, access response data are sent to JDBC client, so that application program is based on coming from JDBC The access response data of client realize the access for being directed to database.
In accordance with an embodiment of the present disclosure, the access request data from application program is JDBC client end response in using journey Sequence is sent for the access request of database, and access request data is JDBC client to the structure carried in access request Change query statement and accesses that parameter carries out encryption and/or compression processing obtains.
It should be noted that Application Programming Interface of the JDBC client as application program access JDBC server (Application Programming Interface, referred to as SDK), can be embedded in the inside of application program.JDBC visitor Family end encapsulates the SDK of the functions such as the access, compression, encryption and decryption of JDBC server, provides simple JDBC clothes for application program Business device access interface supports long connection and two kinds of access modes of short connection.
By embodiment of the disclosure, in the access scenario of the database of overlength distance, increase the conduct of JDBC server Agency service is with buffer network pressure, in response to the access request data from application program, obtains and accesses from database The corresponding access response data of request data, and access response data are sent to JDBC client, so that application program is based on coming The access for being directed to database is realized from the access response data of JDBC client, may be implemented between receiving database server It asks, improves the utilization rate to database server physical connection, reduce the number of database server physical connection, reduce data The resources occupation rate of library server, can also be to avoid database server due to connecting the problem of storm lead to penalty, also The decline of overlength distance database access performance as caused by network delay, unstable networks and efficiency can at least partly be solved Low problem.
Fig. 4 is diagrammatically illustrated according to the embodiment of the present disclosure in response to access request data, obtain from the database with The flow chart of the corresponding access response data of access request data.
As shown in figure 4, aforementioned operation S320 may include operation S410~operation S430.
Decryption and/or decompression are executed, is looked into obtaining structuring in response to access request data in operation S410 Ask sentence and access parameter.
In operation S420, structured query sentence is executed, in the database to obtain and access the matched inquiry number of parameter According to.
Encryption and/or compression processing are executed, to obtain access response data for inquiry data in operation S430.
In accordance with an embodiment of the present disclosure, JDBC server is after receiving the access request data from application program, The reduction of request data can be completed first, obtains the data such as SQL statement, parameter, connect database server to complete SQL language Sentence executes, and the implementing result that database server is returned, i.e. access response data.Then, it is encrypted, at Gzip compression After reason, JDBC client is returned to, the access that can complete data is called.
Fig. 5, which is diagrammatically illustrated, obtains visit corresponding with access request data in the slave database according to the embodiment of the present disclosure Ask the flow chart of response data.
As shown in figure 5, aforementioned operation S320 can also include operation S510 and operation S520.
In operation S510, whether detection JDBC client passes through authentication.
In operation S520, in the case where JDBC client passes through authentication, acquisition and access request from database The corresponding access response data of data.
In accordance with an embodiment of the present disclosure, JDBC server is after receiving the access request data from application program, Client identity certification can also be completed first, after authenticating successfully, can be completed the reduction of request data, be obtained SQL language The data such as sentence, parameter connect database server to complete SQL statement execution, and the execution knot that database server is returned Fruit, i.e. access response data.Then it is encrypted, after Gzip compression processing, returns to JDBC client, data can be completed Access is called.If certification is failed, indicates that the identity of the JDBC client does not meet certification rule, do not execute subsequent behaviour Make.
By embodiment of the disclosure, access response data corresponding with access request data are being obtained from database When, the identity of JDBC client can also be verified, database is taken to avoid the JDBC client with illegal identity The maintenance to database server access safety is effectively realized in the access of business device.
Fig. 6 diagrammatically illustrates the reception according to the embodiment of the present disclosure from the process of the access request data of application program Figure.
As shown in fig. 6, aforementioned operation S310 may include operation S610~operation S640.
In operation S610, the first network mass parameter of network between JDBC server and JDBC client is obtained.
In operation S620, whether detection first network mass parameter meets the first preset condition.
In operation S630, in the case where first network mass parameter meets the first preset condition, received by long connection Access request data from application program.
It is connect in the case where first network mass parameter is unsatisfactory for the first preset condition by short in operation S640 Receive the access request data from application program.In accordance with an embodiment of the present disclosure, between JDBC server and JDBC client Access is supported length connection and short connection two ways, is connected in the higher situation of network quality using long, otherwise use short connection. Therefore, it can determine to receive to come from and answer according to the first network mass parameter of network between JDBC server and JDBC client With the internetwork connection mode of the access request data of program.
A variety of connection types are provided according to network connection quality parameter by embodiment of the disclosure, are answered with receiving to come from With the access request data of program, user experience is promoted.
Fig. 7 diagrammatically illustrates the process of the access of the database by JDBC client executing according to the embodiment of the present disclosure Figure.
As shown in fig. 7, this method may include operation S710~operation S750.
In operation S710, the access request for database that application program is sent is received.
Access request data is generated in response to access request in operation S720.
In operation S730, access request data is sent to JDBC server, so that JDBC server can be asked in response to access Data are sought, access response data corresponding with access request data are obtained from database, and send access response data extremely JDBC client.
In operation S740, access response data are received.
In operation S750, access response data are sent to application program, so that application program realizes the visit for being directed to database It asks.
In accordance with an embodiment of the present disclosure, SDK of the JDBC client as application program access JDBC server, can be embedded in Inside application program, in response to the access request for database that the application program received is sent, access request is generated Data send access request data to JDBC server, receive and send the access response data of JDBC server return to answering With program, so that application program realizes the access for being directed to database.It is looked into it should be noted that carrying structuring in access request Sentence and access parameter are ask, to execute primary access behavior.
By embodiment of the disclosure, realized using the JDBC client being embedded in application program to JDBC server Data transmission and reception can increase the buffering of JDBC server, improve the efficiency of database access.
Fig. 8 is diagrammatically illustrated according to the embodiment of the present disclosure in response to access request, generates the stream of access request data Cheng Tu.
As shown in figure 8, aforementioned operation S720 may include operation S810 and operation S820.
Structured query sentence and access parameter are obtained in response to access request in operation S810.
Encryption and/or compression processing are executed for structured query sentence and access parameter in operation S820, to generate Access request data.In accordance with an embodiment of the present disclosure, JDBC client can incite somebody to action before transferring data to JDBC server The data such as SQL statement, parameter carry out Gzip compression, encryption, and data and authentication information are sent to JDBC server and complete request It calls, the result that JDBC server returns is decrypted with after compression processing, application program is returned, whole tune can be completed With.
By embodiment of the disclosure, data encryption, the security management and control of remote database access may be implemented, improve data Security level.
Fig. 9 diagrammatically illustrates the process according to the transmission access request data of the embodiment of the present disclosure to JDBC server Figure.
As shown in figure 9, aforementioned operation S730 may include operation S910~operation S940.
In operation S910, the second network quality parameters of network between JDBC client and JDBC server are obtained.
In operation S920, whether the second network quality parameters of detection meet the second preset condition.
In operation S930, in the case where the second network quality parameters meet the second preset condition, sent by long connection Access request data is to JDBC server.
In operation S940, in the case where the second network quality parameters are unsatisfactory for the second preset condition, sent out by short connection Send access request data to JDBC server.
In accordance with an embodiment of the present disclosure, long connection and short company are supported in the access between JDBC client and JDBC server Two ways is connect, is connected in the higher situation of network quality using long, otherwise uses short connection.It therefore, can be according to JDBC client The first network mass parameter of network between end and JDBC server, determines the net for sending access request data to JDBC server Network connection type.
A variety of connection types are provided according to network connection quality parameter by embodiment of the disclosure, are asked with sending access It asks data to JDBC server, promotes user experience.
Figure 10 diagrammatically illustrates the access mechanism of the database applied to JDBC server according to the embodiment of the present disclosure Block diagram.
As shown in Figure 10, which may include the first receiving module 1010, obtains module 1020 and the first hair Send module 1030.
First receiving module 1010 is configured as executing such as aforementioned operation S310, receives the access from application program Request data.Wherein, access request data is that JDBC client end response is sent in application program for the access request of database , wherein access request data be JDBC client to the structured query sentence carried in access request and access parameter into What row encryption and/or compression processing obtained.
Module 1020 is obtained, is configured as executing such as aforementioned operation S320, in response to access request data, from database It is middle to obtain access response data corresponding with access request data.
First sending module 1030 is configured as executing such as aforementioned operation S330, sends access response data to JDBC Client, so that application program realizes the access for being directed to database based on the access response data from JDBC client.
In accordance with an embodiment of the present disclosure, above-mentioned acquisition module includes: the first acquisition submodule, is configured to respond to above-mentioned Access request data executes decryption and/or decompression, to obtain above structure query statement and above-mentioned access parameter, Second acquisition submodule is configured as executing above structure query statement in above-mentioned database, to obtain and above-mentioned access The matched inquiry data of parameter and third acquisition submodule, are configured as above-mentioned inquiry data, execute encryption and/or Compression processing, to obtain above-mentioned access response data.
In accordance with an embodiment of the present disclosure, above-mentioned acquisition module includes: the first detection sub-module, is configured as detecting above-mentioned Whether JDBC client passes through authentication and the 4th acquisition submodule, is configured as passing through body in above-mentioned JDBC client In the case where part certification, access response data corresponding with above-mentioned access request data are obtained from above-mentioned database.
In accordance with an embodiment of the present disclosure, above-mentioned first receiving module includes: the 5th acquisition submodule, is configured as in acquisition The first network mass parameter of network between JDBC server and above-mentioned JDBC client is stated, the second detection sub-module is configured To detect whether above-mentioned first network mass parameter meets the first preset condition and the first receiving submodule, it is configured as In the case that above-mentioned first network mass parameter meets above-mentioned first preset condition, received by long connection from application program Access request data.
In accordance with an embodiment of the present disclosure, above-mentioned first receiving module further include: the second receiving submodule is configured as upper It states in the case that first network mass parameter is unsatisfactory for above-mentioned first preset condition, is received by short connection from application program Access request data.
By embodiment of the disclosure, in the access scenario of the database of overlength distance, increase the conduct of JDBC server Agency service is with buffer network pressure, in response to the access request data from application program, obtains and accesses from database The corresponding access response data of request data, and access response data are sent to JDBC client, so that application program is based on coming The access for being directed to database is realized from the access response data of JDBC client, may be implemented between receiving database server It asks, improves the utilization rate to database server physical connection, reduce the number of database server physical connection, reduce data The resources occupation rate of library server, can also be to avoid database server due to connecting the problem of storm lead to penalty, also The decline of overlength distance database access performance as caused by network delay, unstable networks and efficiency can at least partly be solved Low problem.
Figure 11 diagrammatically illustrates the access mechanism of the database applied to JDBC client according to the embodiment of the present disclosure Block diagram.
As shown in figure 11, which may include the second receiving module 1110, the transmission mould of generation module 1120, second Block 1130, third receiving module 1140 and third sending module 1150.
Second receiving module 1110 is configured as executing such as aforementioned operation S710, receives being directed to for application program transmission The access request of database.Wherein, structured query sentence and access parameter are carried in access request.
Generation module 1120 is configured as executing such as aforementioned operation S720, in response to access request, generates access request Data.
Second sending module 1130 is configured as executing such as aforementioned operation S730, sends access request data to JDBC Server, so that JDBC server can obtain corresponding with access request data in response to access request data from database Access response data, and access response data are sent to JDBC client.
Third receiving module 1140 is configured as executing such as aforementioned operation S740, receives access response data.
Third sending module 1150 is configured as executing such as aforementioned operation S750, sends access response data to application Program, so that application program realizes the access for being directed to database.
In accordance with an embodiment of the present disclosure, above-mentioned generation module includes: the 6th acquisition submodule, is configured to respond to above-mentioned Access request obtains above structure query statement and above-mentioned access parameter, and generates submodule, is configured as above-mentioned Structured query sentence and above-mentioned access parameter execute encryption and/or compression processing, to generate above-mentioned access request data.
In accordance with an embodiment of the present disclosure, above-mentioned second sending module includes: the 7th acquisition submodule, is configured as in acquisition The second network quality parameters of network between JDBC client and above-mentioned JDBC server are stated, the second detection sub-module is configured To detect whether above-mentioned second network quality parameters meet the second preset condition and third receiving submodule, it is configured as In the case that above-mentioned second network quality parameters meet above-mentioned second preset condition, above-mentioned access request number is sent by long connection According to JDBC server.
In accordance with an embodiment of the present disclosure, the above method further include: third receiving submodule is configured as in above-mentioned second net In the case that network mass parameter is unsatisfactory for above-mentioned second preset condition, above-mentioned access request data is sent to JDBC by short connection Server.
By embodiment of the disclosure, realized using the JDBC client being embedded in application program to JDBC server Data transmission and reception can increase the buffering of JDBC server, improve the efficiency of database access.
Figure 12 diagrammatically illustrates the access of the database applied to JDBC client according to disclosure another embodiment The block diagram of device.
As shown in figure 12, which may include compressing processing module 1210, encryption/decryption module 1220 and network Link block 1230.
In accordance with an embodiment of the present disclosure, JDBC client, can before access request data is transferred to JDBC server The data such as SQL statement, parameter are carried out Gzip compression, encryption by compressing processing module 1210 and encryption/decryption module 1220, Data and authentication information are sent to JDBC server by network connecting module 1230 and complete request call, are then being received DBC database server return access response data after, it is decrypted and compression processing after, return application program, Complete whole call.
Figure 13 diagrammatically illustrates the access of the database applied to JDBC server according to disclosure another embodiment The block diagram of device.
As shown in figure 13, which may include network connecting module 1310, encryption/decryption module 1320, compression processing Module 1330, database operating modules 1340 and authentication module 1350.
In accordance with an embodiment of the present disclosure, JDBC server is after receiving the data, complete by authentication module 1350 first It is authenticated at the client identity of JDBC client, in the case where authenticating successfully square situation, calls encryption/decryption module 1320 and compression processing Module 1330 completes the reduction of access request data, obtains the data such as SQL statement, parameter, connects database server to complete SQL statement executes, and the access response data that database server library is returned, and is encrypted, after Gzip compression processing, returns JDBC client is given, completes data call by database operating modules 1340.
It should be noted that the implementation of the access method part of the way of example and data of the access mechanism part of data Example mode corresponds to similar, and technical effect achieved also corresponds to similar, and details are not described herein.
Any number of or in which any number of at least partly function in module according to an embodiment of the present disclosure, unit It can be realized in a module.It can be split according to any one or more in the module of the embodiment of the present disclosure, unit It is divided into multiple modules to realize.It can be at least by portion according to any one or more in the module of the embodiment of the present disclosure, unit Ground is divided to be embodied as hardware circuit, such as field programmable gate array (FPGA), programmable logic array (PLA), system on chip, base The system in system, encapsulation, specific integrated circuit (ASIC) on plate, or can be by carrying out times that be integrated or encapsulating to circuit The hardware or firmware of what other rational method realizes, or with any one in three kinds of software, hardware and firmware implementations Kind or several appropriately combined realized with wherein any.Alternatively, according to one in the module of the embodiment of the present disclosure, unit or It is multiple to be at least implemented partly as computer program module, when the computer program module is run, can execute Corresponding function.
For example, the first receiving module 1010, obtain module 1020, the first sending module 1030, the second receiving module 1110, It is any more in generation module 1120, the second sending module 1130, third receiving module 1140 and third sending module 1150 A may be incorporated in a module is realized or any one module therein can be split into multiple modules.Alternatively, this At least partly function of one or more modules in a little modules can be combined at least partly function of other modules, and It is realized in one module.In accordance with an embodiment of the present disclosure, the first receiving module 1010, acquisition module 1020, the first sending module 1030, the second receiving module 1110, generation module 1120, the second sending module 1130, third receiving module 1140 and third At least one of sending module 1150 can at least be implemented partly as hardware circuit, such as field programmable gate array (FPGA), programmable logic array (PLA), system on chip, the system on substrate, the system in encapsulation, specific integrated circuit (ASIC), it or can be realized by carrying out the hardware such as any other rational method that is integrated or encapsulating or firmware to circuit, Or it several appropriately combined is realized with any one in three kinds of software, hardware and firmware implementations or with wherein any. Alternatively, the first receiving module 1010, acquisition module 1020, the first sending module 1030, the second receiving module 1110, generation module 1120, at least one of the second sending module 1130, third receiving module 1140 and third sending module 1150 can be down to It is implemented partly as computer program module less, when the computer program module is run, corresponding function can be executed.
Figure 14 diagrammatically illustrate according to the embodiment of the present disclosure be adapted for carrying out database described above access method and The block diagram of the electronic equipment of device.Electronic equipment shown in Figure 14 is only an example, should not be to the function of the embodiment of the present disclosure Any restrictions can be brought with use scope.
It as shown in figure 14, include processor 1401 according to the computer system of the embodiment of the present disclosure 1400, it can basis The program that is stored in read-only memory (ROM) 1402 is loaded into random access storage device (RAM) from storage section 1408 Program in 1403 and execute various movements appropriate and processing.Processor 1401 for example may include general purpose microprocessor (example Such as CPU), instruction set processor and/or related chip group and/or special microprocessor (for example, specific integrated circuit (ASIC)), Etc..Processor 1401 can also include the onboard storage device for caching purposes.Processor 1401 may include for executing According to single treatment unit either multiple processing units of the different movements of the method flow of the embodiment of the present disclosure.
In RAM 1403, it is stored with system 1400 and operates required various programs and data.Processor 1401, ROM 1402 and RAM 1403 is connected with each other by bus 1404.Processor 1401 is by executing ROM 1402 and/or RAM 1403 In program execute the various operations of the method flow according to the embodiment of the present disclosure.It is noted that described program can also deposit Storage is in one or more memories in addition to ROM 1402 and RAM 1403.Processor 1401 can also be by executing storage Program in one or more of memories executes the various operations of the method flow according to the embodiment of the present disclosure.
In accordance with an embodiment of the present disclosure, system 1400 can also include input/output (I/O) interface 1405, input/output (I/O) interface 1405 is also connected to bus 1404.System 1400 can also include being connected in lower component of I/O interface 1405 It is one or more: the importation 1406 including keyboard, mouse etc.;Including such as cathode-ray tube (CRT), liquid crystal display And the output par, c 1407 of loudspeaker etc. (LCD) etc.;Storage section 1408 including hard disk etc.;And including such as LAN card, The communications portion 1409 of the network interface card of modem etc..Communications portion 1409 executes logical via the network of such as internet Letter processing.Driver 1410 is also connected to I/O interface 1405 as needed.Detachable media 1411, such as disk, CD, magnetic CD, semiconductor memory etc. are mounted on as needed on driver 1410, in order to from the computer program read thereon It is mounted into storage section 1408 as needed.
In accordance with an embodiment of the present disclosure, computer software journey may be implemented as according to the method flow of the embodiment of the present disclosure Sequence.For example, embodiment of the disclosure includes a kind of computer program product comprising be carried on computer readable storage medium Computer program, which includes the program code for method shown in execution flow chart.In such implementation In example, which can be downloaded and installed from network by communications portion 1409, and/or from detachable media 1411 are mounted.The computer program by processor 1401 execute when, execute limited in the system of the embodiment of the present disclosure it is upper State function.In accordance with an embodiment of the present disclosure, system as described above, unit, module, unit etc. can pass through computer Program module is realized.
The disclosure additionally provides a kind of computer readable storage medium, which can be above-mentioned reality It applies included in equipment/device/system described in example;Be also possible to individualism, and without be incorporated the equipment/device/ In system.Above-mentioned computer readable storage medium carries one or more program, when said one or multiple program quilts When execution, the method according to the embodiment of the present disclosure is realized.
In accordance with an embodiment of the present disclosure, computer readable storage medium can be non-volatile computer-readable storage medium Matter, such as can include but is not limited to: portable computer diskette, hard disk, random access storage device (RAM), read-only memory (ROM), erasable programmable read only memory (EPROM or flash memory), portable compact disc read-only memory (CD-ROM), light Memory device, magnetic memory device or above-mentioned any appropriate combination.In the disclosure, computer readable storage medium can With to be any include or the tangible medium of storage program, the program can be commanded execution system, device or device use or Person is in connection.For example, in accordance with an embodiment of the present disclosure, computer readable storage medium may include above-described One or more memories other than ROM 1402 and/or RAM 1403 and/or ROM 1402 and RAM 1403.
Flow chart and block diagram in attached drawing are illustrated according to the system of the various embodiments of the disclosure, method and computer journey The architecture, function and operation in the cards of sequence product.In this regard, each box in flowchart or block diagram can generation A part of one module, program segment or code of table, a part of above-mentioned module, program segment or code include one or more Executable instruction for implementing the specified logical function.It should also be noted that in some implementations as replacements, institute in box The function of mark can also occur in a different order than that indicated in the drawings.For example, two boxes succeedingly indicated are practical On can be basically executed in parallel, they can also be executed in the opposite order sometimes, and this depends on the function involved.Also it wants It is noted that the combination of each box in block diagram or flow chart and the box in block diagram or flow chart, can use and execute rule The dedicated hardware based systems of fixed functions or operations is realized, or can use the group of specialized hardware and computer instruction It closes to realize.
It will be understood by those skilled in the art that the feature recorded in each embodiment and/or claim of the disclosure can To carry out multiple combinations and/or combination, even if such combination or combination are not expressly recited in the disclosure.Particularly, In In the case where not departing from disclosure spirit or teaching, the feature recorded in each embodiment and/or claim of the disclosure can To carry out multiple combinations and/or combination.All these combinations and/or combination each fall within the scope of the present disclosure.
Embodiment of the disclosure is described above.But the purpose that these embodiments are merely to illustrate that, and It is not intended to limit the scope of the present disclosure.Although respectively describing each embodiment above, but it is not intended that each reality Use cannot be advantageously combined by applying the measure in example.The scope of the present disclosure is defined by the appended claims and the equivalents thereof.It does not take off From the scope of the present disclosure, those skilled in the art can make a variety of alternatives and modifications, these alternatives and modifications should all fall in this Within scope of disclosure.

Claims (13)

1. a kind of access method of database, executed by Java database connection (JDBC) server, the JDBC server with The database is deployed in consolidated network region, which comprises
Receive the access request data from application program, wherein the access request data is JDBC client end response in institute State what application program was sent for the access request of the database, the access request data is the JDBC client to institute It states the structured query sentence that carries in access request and access parameter carries out encryption and/or compression processing obtains;
In response to the access request data, access response corresponding with the access request data is obtained from the database Data;And
The access response data are sent to the JDBC client, so that the application program is based on coming from the JDBC client The access response data at end realize the access for being directed to the database.
2. it is described in response to the access request data according to the method described in claim 1, wherein, from the database Obtaining access response data corresponding with the access request data includes:
In response to the access request data, execute decryption and/or decompression, with obtain the structured query sentence and The access parameter;
The structured query sentence is executed, in the database to obtain and the matched inquiry data of access parameter; And
For the inquiry data, encryption and/or compression processing are executed, to obtain the access response data.
3. described to obtain and the access request data pair from the database according to the method described in claim 1, wherein The access response data answered include:
Detect whether the JDBC client passes through authentication;And
In the case where the JDBC client passes through authentication, obtain and the access request data from the database Corresponding access response data.
4. according to the method described in claim 1, wherein, the access request data of the reception from application program includes:
Obtain the first network mass parameter of network between the JDBC server and the JDBC client;
Detect whether the first network mass parameter meets the first preset condition;And
In the case where the first network mass parameter meets first preset condition, received by long connection come self-application The access request data of program.
5. according to the method described in claim 4, wherein, the method also includes:
In the case where the first network mass parameter is unsatisfactory for first preset condition, receives to come from by short connection and answer With the access request data of program.
6. a kind of access method of database, by JDBC client executing, which comprises
Receive the access request for the database that application program is sent, wherein carry structure in the access request Change query statement and access parameter;
In response to the access request, access request data is generated;
The access request data is sent to JDBC server, so that the JDBC server can be in response to the access request number According to obtaining prevent asking request data corresponding access response data with described from the database, and send the access response Data are to the JDBC client;
Receive the access response data;And
The access response data are sent to the application program, so that the application program realizes the visit for being directed to the database It asks.
7. it is described in response to the access request according to the method described in claim 6, wherein, generate access request data packet It includes:
In response to the access request, the structured query sentence and the access parameter are obtained;And
For the structured query sentence and the access parameter, encryption and/or compression processing are executed, to generate the access Request data.
8. according to the method described in claim 6, wherein, the access request data to the JDBC server that sends includes:
Obtain the second network quality parameters of network between the JDBC client and the JDBC server;
Detect whether second network quality parameters meet the second preset condition;And
In the case where second network quality parameters meet second preset condition, the access is sent by long connection Request data is to JDBC server.
9. according to the method described in claim 8, wherein, the method also includes:
In the case where second network quality parameters are unsatisfactory for second preset condition, the visit is sent by short connection Ask request data to JDBC server.
10. a kind of access mechanism of database, is applied to JDBC server, the JDBC server is deployed in the database Consolidated network region, described device include:
First receiving module is configured as receiving the access request data from application program, wherein the access request data It is that JDBC client end response is sent in the application program for the access request of the database, the access request data It is that the JDBC client is encrypted and/or pressed to the structured query sentence and access parameter that carry in the access request What contracting was handled;
Module is obtained, the access request data is configured to respond to, is obtained and the access request from the database The corresponding access response data of data;And
First sending module is configured as sending the access response data to the JDBC client, so that described apply journey Sequence realizes the access for being directed to the database based on the access response data from the JDBC client.
11. a kind of access mechanism of database, is applied to JDBC client, described device includes:
Second receiving module is configured as receiving the access request for the database that application program is sent, wherein described Structured query sentence and access parameter are carried in access request;
Generation module is configured to respond to the access request, generates access request data;
Second sending module is configured as sending the access request data to JDBC server, so that the JDBC server Access response number corresponding with the access request data can be obtained from the database in response to the access request data According to, and the access response data are sent to the JDBC client;
Third receiving module is configured as receiving the access response data;And
Third sending module is configured as sending the access response data to the application program, so that the application program Realize the access for being directed to the database.
12. a kind of electronic equipment, comprising:
One or more processors;And
Memory, for storing one or more programs,
Wherein, when one or more of programs are executed by one or more of processors, so that one or more of Processor realizes method described in any one of claims 1 to 9.
13. a kind of computer readable storage medium, is stored with computer executable instructions, described instruction is used for reality when executed Method described in existing any one of claims 1 to 9.
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 true CN110413676A (en) 2019-11-05
CN110413676B 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)

Cited By (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
CN111339552A (en) * 2020-02-12 2020-06-26 厦门网宿有限公司 Database access method and device
CN111786809A (en) * 2020-05-11 2020-10-16 北京奇艺世纪科技有限公司 Client software network optimization method, system, device and storage medium
CN112000444A (en) * 2020-10-27 2020-11-27 财付通支付科技有限公司 Database transaction processing method and device, storage medium and electronic equipment
CN112162996A (en) * 2020-09-23 2021-01-01 金现代信息产业股份有限公司 Database access method and system for in-station graph editor
CN112364087A (en) * 2020-11-26 2021-02-12 亚信科技(中国)有限公司 Method and system for accessing database by C/C + + application program of ARM platform
CN112910980A (en) * 2021-01-27 2021-06-04 中国银联股份有限公司 Database access system and method
CN113296974A (en) * 2020-08-31 2021-08-24 阿里巴巴集团控股有限公司 Database access method and device, electronic equipment and readable storage medium
CN113688182A (en) * 2021-10-26 2021-11-23 深圳市明源云科技有限公司 Database automatic switching method and device and computer readable storage medium
WO2024087312A1 (en) * 2022-10-28 2024-05-02 蚂蚁区块链科技(上海)有限公司 Database access method, computing device and server

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102546810A (en) * 2012-01-16 2012-07-04 广州市新信荟智信息产业有限公司 Remote access method of database
CN102739560A (en) * 2011-04-13 2012-10-17 腾讯科技(深圳)有限公司 Instant communication method, system thereof and device thereof
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
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

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102739560A (en) * 2011-04-13 2012-10-17 腾讯科技(深圳)有限公司 Instant communication method, system thereof and device thereof
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
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

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
陈艳军等: ""基于Socket长短连接切换的C/S模型设计"", 《电脑知识与技术》 *

Cited By (13)

* 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
CN111339552A (en) * 2020-02-12 2020-06-26 厦门网宿有限公司 Database access method and device
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
CN113296974A (en) * 2020-08-31 2021-08-24 阿里巴巴集团控股有限公司 Database access method and device, electronic equipment and readable 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
CN112000444A (en) * 2020-10-27 2020-11-27 财付通支付科技有限公司 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
CN112910980A (en) * 2021-01-27 2021-06-04 中国银联股份有限公司 Database access system and method
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
WO2024087312A1 (en) * 2022-10-28 2024-05-02 蚂蚁区块链科技(上海)有限公司 Database access method, computing device and server

Also Published As

Publication number Publication date
CN110413676B (en) 2022-03-11

Similar Documents

Publication Publication Date Title
CN110413676A (en) The access method and its device of database, electronic equipment and medium
US11182379B2 (en) DAG based methods and systems of transaction processing in a distributed ledger
CA3087309C (en) Blockchain-based data processing method and device
US20160127465A1 (en) Cross-platform data synchronization
US11444783B2 (en) Methods and apparatuses for processing transactions based on blockchain integrated station
CN108376106A (en) A kind of block chain message feedback method and system
US20210200750A1 (en) Method and device of processing data for blockchain, and blockchain system
EP3436935A1 (en) Pre-formed instructions for a mobile cloud service
US11200211B2 (en) Method and system for managing mutual distributed ledgers in a system of interconnected devices
US11212175B2 (en) Configuration management for cloud storage system and method
US9910881B1 (en) Maintaining versions of control plane data for a network-based service control plane
US11900074B2 (en) Method and apparatus for implementing an end-to-end API design and development module integrating with firmwide tools and processes
CN108573029A (en) A kind of method, apparatus and storage medium obtaining network access relational data
WO2022192331A1 (en) System and method for fully integrated regression and system testing analytics
US20230396590A1 (en) Techniques for bootstrapping across secure air gaps with proxying sidecar
US20230393858A1 (en) Techniques for bootstrapping across secure air gaps with static sidecar
US20200302034A1 (en) Systems and methods for transaction-based licensing
CN107438067A (en) A kind of multi-tenant construction method and system based on mesos container cloud platforms
JP7427169B2 (en) Common database architecture to support large-scale transactions and node archiving on MaaS platforms
US20230393859A1 (en) Techniques for bootstrapping across secure air gaps with edge device cluster
CN112565340B (en) Service scheduling method, device, computer system and medium for distributed application
CN112910835B (en) Block chain-based configuration management method, apparatus, system, device, and medium
KR20230101442A (en) System of Blockchain Framework for 5G Mobile Edge Computing, Device and Management Method thereof
CN110389837A (en) Data access method, device, equipment, storage medium and system
CN111866171B (en) Message processing method, device, electronic equipment and 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