CN105956143A - Database access method and database proxy node - Google Patents

Database access method and database proxy node Download PDF

Info

Publication number
CN105956143A
CN105956143A CN201610313378.6A CN201610313378A CN105956143A CN 105956143 A CN105956143 A CN 105956143A CN 201610313378 A CN201610313378 A CN 201610313378A CN 105956143 A CN105956143 A CN 105956143A
Authority
CN
China
Prior art keywords
database
access request
user terminal
business datum
high load
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
CN201610313378.6A
Other languages
Chinese (zh)
Other versions
CN105956143B (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.)
Shenzhen Longrise Technology Co Ltd
Original Assignee
Shenzhen Longrise Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Longrise Technology Co Ltd filed Critical Shenzhen Longrise Technology Co Ltd
Priority to CN201610313378.6A priority Critical patent/CN105956143B/en
Publication of CN105956143A publication Critical patent/CN105956143A/en
Application granted granted Critical
Publication of CN105956143B publication Critical patent/CN105956143B/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/24Querying

Landscapes

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

Abstract

The invention discloses a database access method, which is applied to a database proxy node. A proxy service is provided for a plurality of database servers at a back end through the database proxy node. The method comprises the following steps: specific to any database server at the back end, if the database proxy node receives a database access request directing to the database server within a high-load time interval of the database server, determining a type of an SQL (Structured Query Language) sentence carried by the database access request firstly, and directly acquiring and transmitting business data directed by the SQL sentence to a source user terminal of the database access request if the carried SQL sentence is a DQL (Data Query Language) sentence; and if the carried SQL sentence is a DML (Data Manipulation Language) sentence, sending the database access request to the database server to execute the database access request when the high-load time interval of the database server is exceeded. The invention also discloses a database proxy node. Through adoption of the database access method and the database proxy node, the working stability of the database servers can be improved.

Description

Data bank access method and database broker node
Technology neighborhood
The present invention relates to Internet technical field, particularly relate to a kind of data bank access method and data base's generation Reason node.
Background technology
Along with the high speed development of Internet technology, various with personalized operation, abundant content, active The specialization comprehensive customer center website of interaction forms arise at the historic moment, the various electricity emerged in large numbers the most in the recent period Sub-business web site, microblogging website etc..Aforementioned customer center website is all the database server by rear end Offer content is supported, when a large amount of access request are concurrent in a short time, database server limits due to performance Tend not to perform all of access request in time, cause operating lag, even delay machine and stop service, There is the problem that job stability is relatively low.
Summary of the invention
A kind of data bank access method of offer and database broker node, purport are provided In the stability improving database server work.
For achieving the above object, the present invention provides a kind of data bank access method, this data bank access method Comprise the following steps:
Step A, when receiving the database access request that user terminal sends, database broker node Judge currently whether to be positioned at the high load capacity time period of database server corresponding to described database access request Within, if otherwise proceeding to perform step B, being, proceeding to perform step C;
Step B, described database access request is forwarded to described data base by described database broker node Server performs;
Step C, described database broker node parses the SQL language that described database access request carries Sentence, wherein, if described SQL statement is DQL statement, then proceeds to perform step D, if described SQL Statement is DML statement, then, time outside the high load capacity time period arriving described database server, proceed to Perform step B;
Step D, described database broker node obtains the business that the current described SQL statement stored is pointed to Data, and the business datum obtained is sent to described user terminal.
Alternatively, before the described step that the business datum obtained is sent extremely described user terminal, also wrap Include:
When obtaining the business datum failure stored, described database broker node is based on other data base's generations Reason node obtains and stores the business datum that described SQL statement is pointed to, and proceeds to perform described by acquisition Business datum sends the step to described user terminal.
Alternatively, described database broker node judges currently whether be positioned at described database access request pair Before step within the high load capacity time period of the database server answered, also include:
When receiving the database access request that user terminal sends, described database broker node is to institute State user terminal and carry out verification operation;
When being verified, perform described database broker node judges currently whether be positioned at described data base Step within the high load capacity time period of the database server that access request is corresponding.
Alternatively, the described step that the business datum of acquisition sends extremely described user terminal includes:
Described database broker node uses the described business datum that the key encryption preset obtains, and will add Business datum after close sends to described user terminal, for described user terminal based on corresponding key solution Close go out business datum.
Alternatively, described data bank access method, also include:
The high load capacity time period information of each database server that described database broker node updates stores.
Additionally, for achieving the above object, the present invention also provides for a kind of database broker node, this data base Agent node includes:
Judge module, for when receiving the database access request that user terminal sends, it is judged that current Within whether being positioned at the high load capacity time period of database server corresponding to described database access request;
Sending module, for outside the high load capacity time period being currently located at described database server time, Described database access request is forwarded to described database server perform;
Parsing module, within the high load capacity time period being currently located at described database server time, Parse the SQL statement that described database access request carries;
Described sending module is additionally operable to, and when described SQL statement is DQL statement, obtains current storage The business datum pointed to of described SQL statement, and the business datum obtained is sent to described user eventually End;And
It is DML statement in described SQL statement, and arrives the high load capacity time of described database server Time outside Duan, described database access request is forwarded to described database server and performs.
Alternatively, described sending module is additionally operable to when obtaining the business datum failure stored, based on other Database broker node obtains and stores the business datum that described SQL statement is pointed to.
Alternatively, described database broker node also includes:
Authentication module, for when receiving the database access request that user terminal sends, to described use Family terminal carries out verification operation;
Described judge module is additionally operable to when being verified, it is judged that currently whether be positioned at described database access Within the high load capacity time period of the database server that request is corresponding.
Alternatively, the described business datum that the key encryption that described sending module is also used for presetting obtains, And the business datum after encryption is sent to described user terminal, for described user terminal based on accordingly Secret key decryption goes out business datum.
Alternatively, described database broker node, also include:
More new module, for updating the high load capacity time period information of each database server of storage.
The data bank access method that the present invention proposes, is applied to database broker node, by data base's generation Multiple database servers that reason node is rear end provide agency service.Any database for rear end takes Business device, if database broker node receives sensing within the high load capacity time period of this database server During the database access request of this database server, it is first determined this database access request carries The type of SQL statement, if the SQL statement carried is DQL statement, the most directly obtains and sends described The business datum that SQL statement is pointed to is to the source user terminal of database access request;If the SQL carried Statement is DML statement, then time outside wait arrives the high load capacity time period of described database server, Database access request is sent to database server execution.Compared to prior art, the present invention can When database server high load capacity works, share partial pressure for database server, reach to promote number Purpose according to storehouse server job stability.
Accompanying drawing explanation
Fig. 1 is the schematic flow sheet of data bank access method first embodiment of the present invention;
Fig. 2 is the data base's topological structure exemplary plot in data bank access method first embodiment of the present invention;
Fig. 3 is the high-level schematic functional block diagram of database broker node first embodiment of the present invention.
The realization of the object of the invention, functional characteristics and advantage will in conjunction with the embodiments, do referring to the drawings further Explanation.
Detailed description of the invention
Should be appreciated that specific embodiment described herein, only in order to explain the present invention, is not used to limit Determine the present invention.
The present invention provides a kind of data bank access method, with reference to Fig. 1, at data bank access method of the present invention First embodiment in, this data bank access method includes:
Step S10, when receiving the database access request that user terminal sends, database broker saves Point judges currently whether to be positioned at the high load capacity time of database server corresponding to described database access request Within Duan, if otherwise proceeding to perform step S20, being, proceeding to perform step S30;
Reference Fig. 2, the data base's topological structure exemplary plot applied for data bank access method of the present invention, as Shown in Fig. 2, multiple database servers that database broker node is rear end provide agency service, for Any database server of rear end, if database broker node is when the high load capacity of this database server Between when receiving the database access request pointing to this database server within section, it is first determined these data SQL (Structured Query Language, the SQL) statement that storehouse access request is carried Type, then perform different operation according to the type parsing SQL statement, to alleviate data base's clothes The operating pressure of business device, promotes the job stability of database server.
Concrete, in embodiments of the present invention, user terminal provides visualization based on database server Operation interface, such as the web interface provided by browser;User terminal is receiving user based on browsing The URL of the address field input of device, or the click behaviour that hyperlink address based on browser display triggers Make, or during other type of operation, generate and carry corresponding URL (or IP address) and SQL The database access request of statement sends to database broker node, to ask aforementioned URL or hyperlink The business datum that address is corresponding;Described database broker node is receiving the data base that user terminal sends During access request, first determine whether currently whether be positioned at the database service that described database access request is corresponding Within the high load capacity time period of device.
It should be noted that database broker node also stores the height of each database server of its agency Duration of load application segment information, is likely to be at the time period of high load capacity for describing each database server.Wherein, High load capacity time period information can be manually entered by the management personnel with authority, it is possible to by each database service Device draws according to its real time operation load recorded statistics, and sends to database broker node.Data base Agent node, when receiving the database access request that user terminal sends, directly judges current system Whether the time is the high load capacity time period being positioned at database server corresponding to this database access request, It is to determine that this database server is in high load capacity duty.
It should be noted that in other embodiments, before above-mentioned steps S10, also include:
Data base's routing device receives the raw data base access request that described user terminal sends, described former Beginning database access request carries the original URL of described user terminal requests, described original URL pair The domain name answered is the original domain name of described user terminal requests;Described data base's routing device is to described user Terminal returns and redirects response message, wraps in the domain name corresponding for URL that described redirection response message carries Include the node identification of the database broker node that described data base's routing device is described user terminal selecting, Database access request is sent to described database broker node, by described data for described user terminal Storehouse agent node provides agency service.
Such as, the URL that user terminal carries in the database access request that database broker node sends For http://www.XXX.com/news/a.html, wherein, content corresponding for www.XXX.com is by rear The database server of platform provides, and provides agency service, data base road by database broker node It is one data base's agent node of user terminal selecting by equipment according to predetermined policy, the data base's generation chosen The node identification of reason node is C1, then constructing new URL is http://C1/www.XXX.com/news/a.html.User terminal sends data base to described new URL Access request, to ask the business datum of the corresponding aforementioned page.
Step S20, described database access request is forwarded to described data by described database broker node Storehouse server performs;
It is easily understood that outside the high load capacity time period being positioned at database server, i.e. data base's clothes During business device non-high load capacity work, the data, services that database server can provide normally, data base's generation Reason node obviously there is no need to provide agency service.Therefore, in embodiments of the present invention, database broker Node is currently located at the high load capacity time of database server corresponding to described database access request determining Time outside Duan, directly the database access request of reception is forwarded to described database server and performs.
Concrete, database server, when performing the database access request received, parses this data The SQL statement that storehouse access request is carried, wherein, SQL statement includes DQL (Data Query Language, data query language) statement and DML (Data Manipulation Language, data Operating language) statement.When the SQL statement parsed is DQL statement, illustrate that user is intended to data Data in storehouse are inquired about;When the SQL statement parsed is DML statement, illustrate that user is intended to right Data in data base operate, including inserting data, change data or deleting data etc..
Such as, when the SQL statement parsed is DQL statement, database server obtains storage The business datum that described SQL statement is pointed to, and the business datum of acquisition is back to its data base received The source user terminal of access request;The most such as, when the SQL statement parsed is DML statement, number Operate accordingly based on the SQL statement parsed according to storehouse server, and return the result of operation to institute State user terminal, at least include operating the most successfully information.
Step S30, described database broker node parses the SQL that described database access request carries Statement, wherein, if described SQL statement is DQL statement, then proceeds to perform step S40, if described SQL statement is DML statement, then time outside the high load capacity time period arriving described database server, Proceed to perform step S20;
Step S40, described database broker node obtains the industry that the current described SQL statement stored is pointed to Business data, and the business datum obtained is sent to described user terminal.
It will be appreciated by persons skilled in the art that database server high load capacity work in the case of, The delay of its response database access request will substantially increase, and, along with the database access received please Ask sustainable growth, the process resource consumption of database server will be made totally, in fact it could happen that machine of delaying stops The situation of service.Therefore, in embodiments of the present invention, it is being currently located at described database access request pair Time within the high load capacity time period of the database server answered, database broker node-agent database service Device provides service.
Concrete, database broker node is currently located at the number that described database access request is corresponding determining According to time within the high load capacity time period of storehouse server, the database access request first parsing reception is taken The SQL statement of band, and judge whether the SQL statement parsed is DQL statement;Wherein,
When the SQL statement parsed is DQL statement, database broker node obtains current storage The business datum that described SQL statement is pointed to, directly sends the business datum obtained to described user eventually End, presents to user for it;
When the SQL statement parsed is DQL statement, database broker node waits and arrives described number According to time outside the high load capacity time period of storehouse server, the database access request received is sent to described number Perform according to storehouse server.
It should be noted that in other embodiments, described database broker node also deletes storage, And in preset time period, it is not accessed for business datum.Wherein, described preset time period can be needed by reality Being configured, such as, described preset time period is set to 24 hours by the present embodiment, art technology Personnel are not it is understood that be accessed for business datum for a long time by periodically deleting, it is possible to promote number According to the utilization rate of storehouse agent node memory space, preferably to provide agency service.
The data bank access method that the present embodiment proposes, by many numbers that database broker node is rear end Agency service is provided according to storehouse server, for any database server of rear end, if database broker joint Point receives the data pointing to this database server within the high load capacity time period of this database server During the access request of storehouse, it is first determined the type of the SQL statement that this database access request carries, if carrying SQL statement be DQL statement, the most directly obtain and send described SQL statement point to business datum Source user terminal to database access request;If the SQL statement carried is DML statement, then wait Time outside the high load capacity time period arriving described database server, database access request is sent to number Perform according to storehouse server.Compared to prior art, the present invention can work at database server high load capacity Time, share partial pressure for database server, reach to promote the mesh of database server job stability 's.
Further, based on first embodiment, it is proposed that the second enforcement of data bank access method of the present invention Example, in the present embodiment, before the described step that the business datum obtained is sent extremely described user terminal, Also include:
When obtaining the business datum failure stored, described database broker node is based on other data base's generations Reason node obtains and stores the business datum that described SQL statement is pointed to, and proceeds to perform described by acquisition Business datum sends the step to described user terminal.
It should be noted that the difference of the present embodiment and first embodiment is, embodiment adds number According to storehouse agent node obtain storage business datum failure time process operation, below only for this distinguish into Row illustrates, other can refer to first embodiment, and here is omitted.
Based on described above, it will be appreciated by persons skilled in the art that database server is at high load capacity In the case of work, the delay of its response database access request will substantially increase, and, along with reception Database access request sustainable growth, the process resource consumption of database server will be made totally, can Can occur that machine of delaying stops the situation of service.Therefore, in embodiments of the present invention, described database broker joint Point is when obtaining the business datum failure of storage, and described database broker node is based on other database brokers Node obtains and stores the business datum that described database access request points to, below with aforementioned data base's generation Reason node is first agent's node, and other database broker nodes aforementioned are that second agent's node is carried out specifically Illustrate:
First agent's node is when obtaining the business datum failure of storage, and the database access received please Asking and be forwarded to second agent's node, wherein, first agent's node is added with use in database access request In describing the identification information that user terminal is verified, to avoid second agent's node to carry out secondary checking, Cause the unnecessary process wasting of resources;Second agent's node is receiving the number that first agent's node forwards During according to storehouse access request, recognize the aforementioned identification information that this database access request carries, directly obtain The business datum that the described database access request of storage points to is back to first agent's node;First agent The business datum of reception, when receiving the business datum that second agent's node returns, is stored as institute by node State the business datum that database access request points to, meanwhile, use this business number of public key encryption after updating Described user terminal it is back to after according to.
The present embodiment is not storing its database access request indication received by database broker node To business datum time, based on other database broker nodes provide agency service, it is ensured that user terminal energy Enough normally obtain data, services.
Further, based on first embodiment, the 3rd embodiment of data bank access method of the present invention is proposed, In the present embodiment, before step S10, also include:
When receiving the database access request that user terminal sends, described database broker node is to institute State user terminal and carry out verification operation;
When being verified, proceed to perform step S10.
It should be noted that the difference of the present embodiment and first embodiment is, the present embodiment is real first On the basis of executing example, add the verification operation to user terminal, illustrate only for this difference below, Other can refer to first embodiment, and here is omitted.
In embodiments of the present invention, described database broker node is receiving the data that user terminal sends During the access request of storehouse, the identity of user terminal is verified by the database access request being primarily based on reception, Such as, the database access request that user terminal sends also carries user based on user terminal pre-entered User name and the password of correspondence, database broker node receiving user terminal send data base visit When asking request, the identity of user terminal is carried out by the user name and the password that carry according to database access request Whether checking, be the user authorized to determine the user of correspondence.After being verified, then judge to work as Before whether be positioned at database server corresponding to described database access request the high load capacity time period within, To start the handling process of agency service, specifically can refer to first embodiment, here is omitted.
The present embodiment is by verifying user terminal, it is possible to promote the safety storing data.
Further, based on aforementioned any embodiment, it is proposed that the 4th of data bank access method of the present invention Embodiment, in the present embodiment, the described step that the business datum obtained is sent extremely described user terminal Including:
Described database broker node uses the described business datum that the key encryption preset obtains, and will add Business datum after close sends to described user terminal, for described user terminal based on corresponding key solution Close go out business datum.
It should be noted that the difference of the present embodiment and first embodiment is, embodiment adds and send out Sending the specific descriptions of business datum, illustrate only for this difference below, other can respectively refer to aforementioned Each embodiment, here is omitted.
It will be appreciated by persons skilled in the art that data in the transmitting procedure of network, easily by illegally Molecule is stolen, and causes user data to be revealed.Therefore, in the present embodiment, database broker node is being sent out When sending the business datum of acquisition, the key preset first obtained, and use the industry of this key encryption acquisition Business data, wherein it is possible to use the rivest, shamir, adelmans such as RSA Algorithm or Elgamal algorithm such as to carry out Encryption, it would however also be possible to employ as DES algorithm, 3DES algorithm, TDEA algorithm, Blowfish algorithm, The symmetric encipherment algorithms such as RC5 algorithm or IDEA algorithm are encrypted.
Such as, RSA Algorithm is used to add when database broker node based on the PKI that user terminal is issued in advance During the business datum of close acquisition, then user terminal needs the private key corresponding based on aforementioned PKI and uses RSA Algorithm decrypts business datum;The most such as, make an appointment with user terminal when database broker node uses Key use DES algorithm for encryption obtain business datum time, then user terminal need based on identical institute State key and use DES algorithm to decrypt business datum.
The present embodiment business datum by encrypted transmission, it is possible to the safety of data transmission.
Further, based on aforementioned any embodiment, it is proposed that the 5th of data bank access method of the present invention Embodiment, in the present embodiment, described data bank access method, also include:
The high load capacity time period information of each database server that described database broker node updates stores.
It should be noted that the difference of the present embodiment and aforementioned any embodiment is, the present embodiment increases Renewal operation to the high load capacity time period information of database server, the most only retouches this difference Stating, other can respectively refer to foregoing embodiments, and here is omitted.
In embodiments of the present invention, it is provided that three kinds of modes updating high load capacity time period information:
One, database broker node receive the management personnel with default access renewal instruct time, The instruction that updates according to receiving updates the high load capacity time period information of corresponding database server;
Its two, database broker node receiving database server send high load capacity time period information Time, by store to should the high load capacity time period information updating of database server be the high load capacity received Time period information;
Its three, the timing of database broker node sends and updates request to each database server, and is receiving During to each database server high load capacity time period information based on the more newly requested return received, by correspondence The high load capacity time period information of each data server is updated to the letter of corresponding high load capacity time period received respectively Breath.
The present embodiment by the high load capacity time period information of each database server stored is updated, Make database broker node can preferably provide agency service, promote database server work further The stability made.
The present invention also provides for a kind of database broker node, with reference to Fig. 3, saves at database broker of the present invention In the first embodiment of point, this database broker node includes:
Judge module 10, for when receiving the database access request that user terminal sends, it is judged that when Before whether be positioned at database server corresponding to described database access request the high load capacity time period within;
As in figure 2 it is shown, multiple database servers that database broker node is rear end provide agency service, For any database server of rear end, if database broker node is born at the height of this database server When receiving the database access request pointing to this database server within the lotus time period, it is first determined should The SQL (Structured Query Language, SQL) that database access request carries The type of statement, then performs different operations, to alleviate data according to the type parsing SQL statement The operating pressure of storehouse server, promotes the job stability of database server.
Concrete, in embodiments of the present invention, user terminal provides visualization based on database server Operation interface, such as the web interface provided by browser;User terminal is receiving user based on browsing The URL of the address field input of device, or the click behaviour that hyperlink address based on browser display triggers Make, or during other type of operation, generate and carry corresponding URL (or IP address) and SQL The database access request of statement sends to database broker node, to ask aforementioned URL or hyperlink The business datum that address is corresponding;Described database broker node is receiving the data base that user terminal sends During access request, first determine whether currently whether be positioned at the database service that described database access request is corresponding Within the high load capacity time period of device.
It should be noted that database broker node also stores the height of each database server of its agency Duration of load application segment information, is likely to be at the time period of high load capacity for describing each database server.Wherein, High load capacity time period information can be manually entered by the management personnel with authority, it is possible to by each database service Device draws according to its real time operation load recorded statistics, and sends to database broker node.Receiving To user terminal send database access request time, it is judged that module 10 directly judges current system time Whether it is the high load capacity time period being positioned at database server corresponding to this database access request, is then Determine that this database server is in high load capacity duty.
It should be noted that in other embodiments, database broker node before agency service is provided, Also include:
Data base's routing device receives the raw data base access request that described user terminal sends, described former Beginning database access request carries the original URL of described user terminal requests, described original URL pair The domain name answered is the original domain name of described user terminal requests;Described data base's routing device is to described user Terminal returns and redirects response message, wraps in the domain name corresponding for URL that described redirection response message carries Include the node identification of the database broker node that described data base's routing device is described user terminal selecting, Database access request is sent to described database broker node, by described data for described user terminal Storehouse agent node provides agency service.
Such as, the URL that user terminal carries in the database access request that database broker node sends For http://www.XXX.com/news/a.html, wherein, content corresponding for www.XXX.com is by rear The database server of platform provides, and provides agency service, data base road by database broker node It is one data base's agent node of user terminal selecting by equipment according to predetermined policy, the data base's generation chosen The node identification of reason node is C1, then constructing new URL is http://C1/www.XXX.com/news/a.html.User terminal sends data base to described new URL Access request, to ask the business datum of the corresponding aforementioned page.
Sending module 20, for outside the high load capacity time period being currently located at described database server Time, described database access request is forwarded to described database server and performs;
It is easily understood that outside the high load capacity time period being positioned at database server, i.e. data base's clothes During business device non-high load capacity work, the data, services that database server can provide normally, data base's generation Reason node obviously there is no need to provide agency service.Therefore, in embodiments of the present invention, sending module 20 The height being currently located at database server corresponding to described database access request is determined at judge module 10 Time outside duration of load application section, directly the database access request of reception is forwarded to described database server Perform.
Concrete, database server, when performing the database access request received, parses this data The SQL statement that storehouse access request is carried, wherein, SQL statement includes DQL (Data Query Language, data query language) statement and DML (Data Manipulation Language, data Operating language) statement.When the SQL statement parsed is DQL statement, illustrate that user is intended to data Data in storehouse are inquired about;When the SQL statement parsed is DML statement, illustrate that user is intended to right Data in data base operate, including inserting data, change data or deleting data etc..
Such as, when the SQL statement parsed is DQL statement, database server obtains storage The business datum that described SQL statement is pointed to, and the business datum of acquisition is back to its data base received The source user terminal of access request;The most such as, when the SQL statement parsed is DML statement, number Operate accordingly based on the SQL statement parsed according to storehouse server, and return the result of operation to institute State user terminal, at least include operating the most successfully information.
Parsing module 30, within the high load capacity time period being currently located at described database server Time, parse the SQL statement that described database access request carries;
Described sending module 20 is additionally operable to, and when described SQL statement is DQL statement, obtains current storage The business datum that the described SQL statement deposited is pointed to, and the business datum obtained is sent to described user eventually End;And
It is DML statement in described SQL statement, and arrives the high load capacity time of described database server Time outside Duan, described database access request is forwarded to described database server and performs.
It will be appreciated by persons skilled in the art that database server high load capacity work in the case of, The delay of its response database access request will substantially increase, and, along with the database access received please Ask sustainable growth, the process resource consumption of database server will be made totally, in fact it could happen that machine of delaying stops The situation of service.Therefore, in embodiments of the present invention, it is being currently located at described database access request pair Time within the high load capacity time period of the database server answered, database broker node-agent database service Device provides service.
Concrete, determine at judge module 10 and be currently located at the data base that described database access request is corresponding Time within the high load capacity time period of server, first parsing module 30 parses the database access of reception please Seek entrained SQL statement, and judge whether the SQL statement parsed is DQL statement;Wherein,
When the SQL statement parsed is DQL statement, described sending module 20 obtains current storage The business datum that described SQL statement is pointed to, directly sends the business datum obtained to described user eventually End, presents to user for it;
When the SQL statement parsed is DQL statement, described sending module 20 waits and arrives described number According to time outside the high load capacity time period of storehouse server, the database access request received is sent to described number Perform according to storehouse server.
It should be noted that in other embodiments, described database broker node also includes removing module, For deleting storage, and in preset time period, it is not accessed for business datum.Wherein, described default Time period can be configured according to actual needs, and such as, described preset time period is set to 24 by the present embodiment Hour, it will be appreciated by persons skilled in the art that and be not accessed for business for a long time by periodically deletion Data, it is possible to promote the utilization rate of database broker node storage space, preferably to provide agency service.
The database broker node that the present embodiment proposes, the multiple database servers for rear end provide agency Service, for any database server of rear end, if database broker node is at this database server The high load capacity time period within receive point to this database server database access request time, first Determine the type of the SQL statement that this database access request carries, if the SQL statement carried is DQL Statement, the most directly obtains and sends the business datum of described SQL statement sensing to database access request Source user terminal;If the SQL statement carried is DML statement, then waits and arrive described database service Time outside the high load capacity time period of device, database access request is sent to database server execution.Phase Compared with prior art, the present invention can be when database server high load capacity works, for database server Share partial pressure, reach to promote the purpose of database server job stability.
Further, based on first embodiment, it is proposed that the second enforcement of database broker node of the present invention Example, in the present embodiment, described sending module 20 is additionally operable to when obtaining the business datum failure stored, Obtain and store, based on other database broker nodes, the business datum that described SQL statement is pointed to.
It should be noted that the difference of the present embodiment and first embodiment is, embodiment adds number According to storehouse agent node obtain storage business datum failure time process operation, below only for this distinguish into Row explanation, other repeat no more.
Based on described above, it will be appreciated by persons skilled in the art that database server is at high load capacity In the case of work, the delay of its response database access request will substantially increase, and, along with reception Database access request sustainable growth, the process resource consumption of database server will be made totally, can Can occur that machine of delaying stops the situation of service.Therefore, in embodiments of the present invention, described sending module 20 When obtaining the business datum failure of storage, obtain and store described number based on other database broker nodes The business datum pointed to according to storehouse access request, with the database broker node at sending module 20 place be below First agent's node, other database broker nodes are that second agent's node is specifically described:
First agent's node (sending module 20), when obtaining the business datum failure of storage, is received Database access request be forwarded to second agent's node, wherein, first agent's node is in database access Request is added with for describing the identification information that user terminal is verified, to avoid second agent's node Carry out secondary checking, cause the unnecessary process wasting of resources;Second agent's node is receiving the first generation During the database access request that reason node forwards, recognize the aforementioned mark that this database access request carries Information, the business datum of the described database access request sensing directly obtaining storage is back to first agent Node;First agent's node receive second agent's node return business datum time, will receive industry Business data are stored as the business datum that described database access request points to, and this business datum are back to Described user terminal.
The present embodiment is not storing its database access request indication received by database broker node To business datum time, based on other database broker nodes provide agency service, it is ensured that user terminal energy Enough normally obtain data, services.
Further, based on first embodiment, the 3rd embodiment of database broker node of the present invention is proposed, In the present embodiment, described database broker node also includes:
Authentication module, for when receiving the database access request that user terminal sends, to described use Family terminal carries out verification operation;
Described judge module 10 is additionally operable to when being verified, it is judged that currently whether is positioned at described data base and visits Within the high load capacity time period of the database server that the request of asking is corresponding.
It should be noted that the difference of the present embodiment and first embodiment is, the present embodiment is real first On the basis of executing example, add the verification operation to user terminal, illustrate only for this difference below, Other repeat no more.
In embodiments of the present invention, when receiving the database access request that user terminal sends, first The identity of user terminal is verified based on the database access request received by authentication module, such as, The database access request that user terminal sends also carries user user based on user terminal pre-entered Name and the password of correspondence, database broker node is receiving the database access request that user terminal sends Time, the identity of user terminal verified by the user name and the password that carry according to database access request, Whether it is the user authorized to determine the user of correspondence.After being verified, authentication module will receive Database access request transmission to judge module 10 be updated process, to start the process of agency service Flow process, specifically can refer to first embodiment, and here is omitted.
The present embodiment is by verifying user terminal, it is possible to promote the safety storing data.
Further, based on aforementioned any embodiment, it is proposed that the 4th of database broker node of the present invention Embodiment, in the present embodiment, the key encryption that described sending module 20 is also used for presetting obtains Described business datum, and the business datum after encryption is sent to described user terminal, for described user Terminal goes out business datum based on corresponding secret key decryption.
It should be noted that the difference of the present embodiment and first embodiment is, embodiment adds and send out Sending the specific descriptions of business datum, illustrate only for this difference below, other can respectively refer to aforementioned Each embodiment, here is omitted.
It will be appreciated by persons skilled in the art that data in the transmitting procedure of network, easily by illegally Molecule is stolen, and causes user data to be revealed.Therefore, in the present embodiment, the business number obtained is being sent According to time, sending module 20 first obtain preset key, and use this key encryption obtain business number According to, wherein it is possible to use the rivest, shamir, adelmans such as RSA Algorithm or Elgamal algorithm to be such as encrypted, Such as DES algorithm, 3DES algorithm, TDEA algorithm, Blowfish algorithm, RC5 can also be used to calculate The symmetric encipherment algorithms such as method or IDEA algorithm are encrypted.
Such as, RSA Algorithm encryption is used when sending module 20 based on the PKI that user terminal is issued in advance During the business datum obtained, then user terminal needs the private key corresponding based on aforementioned PKI and uses RSA to calculate Method decrypts business datum;The most such as, use, when sending module 20, the key made an appointment with user terminal When using the business datum that DES algorithm for encryption obtains, then user terminal needs based on identical described key And use DES algorithm to decrypt business datum.
The present embodiment business datum by encrypted transmission, it is possible to the safety of data transmission.
Further, based on aforementioned any embodiment, it is proposed that the 5th of database broker node of the present invention Embodiment, in the present embodiment, described database broker node, also include:
More new module, for updating the high load capacity time period information of each database server of storage.
It should be noted that the difference of the present embodiment and aforementioned any embodiment is, the present embodiment increases Renewal operation to the high load capacity time period information of database server, the most only retouches this difference Stating, other can respectively refer to foregoing embodiments, and here is omitted.
In embodiments of the present invention, it is provided that three kinds of modes updating high load capacity time period information:
One, more new module receive the management personnel with default access renewal instruct time, according to The instruction that updates received updates the high load capacity time period information of corresponding database server;
Its two, more new module receive database server send high load capacity time period information time, will Store to should the high load capacity time period information updating of database server be the high load capacity time period received Information;
Its three, the timing of more new module sends and updates request to each database server, and is receiving each number During according to storehouse server high load capacity time period information based on the more newly requested return received, by corresponding each data The high load capacity time period information of server is updated to the corresponding high load capacity time period information received respectively.
The present embodiment by the high load capacity time period information of each database server stored is updated, Make database broker node can preferably provide agency service, promote database server work further The stability made.
These are only the preferred embodiments of the present invention, not thereby limit the scope of the claims of the present invention, every Utilize equivalent structure or equivalence flow process conversion that description of the invention and accompanying drawing content made, or directly or Connect and be used in other relevant technology neighborhoods, be the most in like manner included in the scope of patent protection of the present invention.

Claims (10)

1. a data bank access method, it is characterised in that described data bank access method includes following step Rapid:
Step A, when receiving the database access request that user terminal sends, database broker node Judge currently whether to be positioned at the high load capacity time period of database server corresponding to described database access request Within, if otherwise proceeding to perform step B, being, proceeding to perform step C;
Step B, described database access request is forwarded to described data base by described database broker node Server performs;
Step C, described database broker node parses the SQL language that described database access request carries Sentence, wherein, if described SQL statement is DQL statement, then proceeds to perform step D, if described SQL Statement is DML statement, then, time outside the high load capacity time period arriving described database server, proceed to Perform step B;
Step D, described database broker node obtains the business that the current described SQL statement stored is pointed to Data, and the business datum obtained is sent to described user terminal.
Data bank access method the most according to claim 1, it is characterised in that described by obtain Business datum sent before the step of described user terminal, also included:
When obtaining the business datum failure stored, described database broker node is based on other data base's generations Reason node obtains and stores the business datum that described SQL statement is pointed to, and proceeds to perform described by acquisition Business datum sends the step to described user terminal.
Data bank access method the most according to claim 1, it is characterised in that described data base's generation Reason node judges currently whether to be positioned at the high load capacity of database server corresponding to described database access request Before step within time period, also include:
When receiving the database access request that user terminal sends, described database broker node is to institute State user terminal and carry out verification operation;
When being verified, perform described database broker node judges currently whether be positioned at described data base Step within the high load capacity time period of the database server that access request is corresponding.
4. according to the data bank access method described in any one of claim 1-3, it is characterised in that described The step that the business datum of acquisition sends extremely described user terminal is included:
Described database broker node uses the described business datum that the key encryption preset obtains, and will add Business datum after close sends to described user terminal, for described user terminal based on corresponding key solution Close go out business datum.
5. according to the data bank access method described in any one of claim 1-3, it is characterised in that described Data bank access method, also includes:
The high load capacity time period information of each database server that described database broker node updates stores.
6. a database broker node, it is characterised in that described database broker node includes:
Judge module, for when receiving the database access request that user terminal sends, it is judged that current Within whether being positioned at the high load capacity time period of database server corresponding to described database access request;
Sending module, for outside the high load capacity time period being currently located at described database server time, Described database access request is forwarded to described database server perform;
Parsing module, within the high load capacity time period being currently located at described database server time, Parse the SQL statement that described database access request carries;
Described sending module is additionally operable to, and when described SQL statement is DQL statement, obtains current storage The business datum pointed to of described SQL statement, and the business datum obtained is sent to described user eventually End;And
It is DML statement in described SQL statement, and arrives the high load capacity time of described database server Time outside Duan, described database access request is forwarded to described database server and performs.
Database broker node the most according to claim 6, it is characterised in that described sending module It is additionally operable to, when obtaining the business datum failure stored, obtain based on other database broker nodes and store The business datum that described SQL statement is pointed to.
Database broker node the most according to claim 6, it is characterised in that described data base's generation Reason node also includes:
Authentication module, for when receiving the database access request that user terminal sends, to described use Family terminal carries out verification operation;
Described judge module is additionally operable to when being verified, it is judged that currently whether be positioned at described database access Within the high load capacity time period of the database server that request is corresponding.
9. according to the database broker node described in any one of claim 6-8, it is characterised in that described The described business datum that the key encryption that sending module is also used for presetting obtains, and by the industry after encryption Business data send to described user terminal, go out business for described user terminal based on corresponding secret key decryption Data.
10. according to the database broker node described in any one of claim 6-8, it is characterised in that institute State database broker node, also include:
More new module, for updating the high load capacity time period information of each database server of storage.
CN201610313378.6A 2016-05-11 2016-05-11 Data bank access method and database broker node Active CN105956143B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610313378.6A CN105956143B (en) 2016-05-11 2016-05-11 Data bank access method and database broker node

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610313378.6A CN105956143B (en) 2016-05-11 2016-05-11 Data bank access method and database broker node

Publications (2)

Publication Number Publication Date
CN105956143A true CN105956143A (en) 2016-09-21
CN105956143B CN105956143B (en) 2019-07-26

Family

ID=56912618

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610313378.6A Active CN105956143B (en) 2016-05-11 2016-05-11 Data bank access method and database broker node

Country Status (1)

Country Link
CN (1) CN105956143B (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107222493A (en) * 2017-06-26 2017-09-29 浪潮软件股份有限公司 A kind of ORACLE JDBC data transmission channels ciphered compressed system and method
CN110457944A (en) * 2019-08-02 2019-11-15 爱友智信息科技(苏州)有限公司 A kind of data sharing method and system
CN110661786A (en) * 2019-09-04 2020-01-07 杭州利项科技有限公司 User data system based on chain relation
CN111949451A (en) * 2020-08-17 2020-11-17 广东睿江云计算股份有限公司 Database operation backup method and system
CN112162996A (en) * 2020-09-23 2021-01-01 金现代信息产业股份有限公司 Database access method and system for in-station graph editor
CN112181948A (en) * 2020-09-30 2021-01-05 中国工商银行股份有限公司 Database operation statement processing method and device, electronic equipment and medium
CN112632625A (en) * 2020-12-31 2021-04-09 深圳昂楷科技有限公司 Database security gateway system, data processing method and electronic equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101916298A (en) * 2010-08-31 2010-12-15 深圳市赫迪威信息技术有限公司 Database operation method, apparatus and system
CN103095691A (en) * 2012-12-31 2013-05-08 清华大学 Method of controlling access to Internet of things nodes
CN103139278A (en) * 2011-12-05 2013-06-05 北京网康科技有限公司 Network resource pre-fetching and cache accelerating method and device thereof
CN103365979A (en) * 2013-07-03 2013-10-23 交通银行股份有限公司 Long-distance double-center online processing method and system based on open database
CN105183751A (en) * 2015-07-13 2015-12-23 深信服网络科技(深圳)有限公司 Database access method and database access device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101916298A (en) * 2010-08-31 2010-12-15 深圳市赫迪威信息技术有限公司 Database operation method, apparatus and system
CN103139278A (en) * 2011-12-05 2013-06-05 北京网康科技有限公司 Network resource pre-fetching and cache accelerating method and device thereof
CN103095691A (en) * 2012-12-31 2013-05-08 清华大学 Method of controlling access to Internet of things nodes
CN103365979A (en) * 2013-07-03 2013-10-23 交通银行股份有限公司 Long-distance double-center online processing method and system based on open database
CN105183751A (en) * 2015-07-13 2015-12-23 深信服网络科技(深圳)有限公司 Database access method and database access device

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107222493A (en) * 2017-06-26 2017-09-29 浪潮软件股份有限公司 A kind of ORACLE JDBC data transmission channels ciphered compressed system and method
CN110457944A (en) * 2019-08-02 2019-11-15 爱友智信息科技(苏州)有限公司 A kind of data sharing method and system
CN110457944B (en) * 2019-08-02 2023-08-25 爱友智信息科技(苏州)有限公司 Data sharing method and system
CN110661786A (en) * 2019-09-04 2020-01-07 杭州利项科技有限公司 User data system based on chain relation
CN110661786B (en) * 2019-09-04 2021-10-08 杭州利项科技有限公司 User data system based on chain relation
CN111949451A (en) * 2020-08-17 2020-11-17 广东睿江云计算股份有限公司 Database operation backup method and system
CN112162996A (en) * 2020-09-23 2021-01-01 金现代信息产业股份有限公司 Database access method and system for in-station graph editor
CN112181948A (en) * 2020-09-30 2021-01-05 中国工商银行股份有限公司 Database operation statement processing method and device, electronic equipment and medium
CN112181948B (en) * 2020-09-30 2024-02-02 中国工商银行股份有限公司 Processing method and device of database operation statement, electronic equipment and medium
CN112632625A (en) * 2020-12-31 2021-04-09 深圳昂楷科技有限公司 Database security gateway system, data processing method and electronic equipment

Also Published As

Publication number Publication date
CN105956143B (en) 2019-07-26

Similar Documents

Publication Publication Date Title
CN105956143A (en) Database access method and database proxy node
CN108270882B (en) Domain name resolution method and device, storage medium and electronic device
CN101267299B (en) A method and system for securely display data on the webpage
US20130246504A1 (en) Method for subscribing to notification, apparatus and system
CN102752300B (en) Dynamic antitheft link system and dynamic antitheft link method
CN102682009A (en) Method and system for logging in webpage
CN106060004A (en) Database access method and database agent node
CN102447677A (en) Resource access control method, system and equipment
CN111262839A (en) Vulnerability scanning method, management equipment, node and storage medium
CN112399130B (en) Processing method and device of cloud video conference information, storage medium and communication equipment
JP2017513151A (en) Private cloud connection device cluster architecture
CN104954386A (en) Network anti-hijacking methods and device
CN110933092A (en) JWT (just-in-one wt) based single sign-on realization method and device
CN105553920A (en) Data interaction method, apparatus, and system
CN112468540B (en) Cloud platform-based data distribution method, equipment and medium
CN103428179A (en) Method, system and device for logging into multi-domain-name website
CN102624914A (en) Method for detecting local DNS (Domain Name Server) used by client side in Web form
CN109819068A (en) User terminal and its block chain domain name analytic method
CN106021375B (en) Data bank access method and database broker node
CN104618388A (en) Quick registration and login method and corresponding reset server and information server
JP4667326B2 (en) Authentication apparatus, authentication method, and authentication program implementing the method
JP5678893B2 (en) Attribute information linkage providing system, access information management device, access information proxy management device, method, and program
CN112491955B (en) Method and system for realizing iframe system data exchange based on proxy server
JP5383923B1 (en) Information processing apparatus, information processing system, information processing method, and program
CN102082666B (en) Single login system and method and service management system as well as single login intermediate system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Address after: 518057 Shenzhen Software Park, Nanshan District high tech Industrial Park, Guangdong, China,, 6 401-402

Applicant after: Yongxing Shenzhen Polytron Technologies Inc

Address before: 518057 Shenzhen Software Park, Nanshan District high tech Industrial Park, Guangdong, China,, 6 401-402

Applicant before: Shenzhen Longrise Technology Co., Ltd.

COR Change of bibliographic data
GR01 Patent grant
GR01 Patent grant