CN103823815B - server and database access method - Google Patents

server and database access method Download PDF

Info

Publication number
CN103823815B
CN103823815B CN201210468533.3A CN201210468533A CN103823815B CN 103823815 B CN103823815 B CN 103823815B CN 201210468533 A CN201210468533 A CN 201210468533A CN 103823815 B CN103823815 B CN 103823815B
Authority
CN
China
Prior art keywords
data
tables
operational order
identification information
relational database
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201210468533.3A
Other languages
Chinese (zh)
Other versions
CN103823815A (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.)
China United Network Communications Group Co Ltd
Original Assignee
China United Network Communications Group 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 China United Network Communications Group Co Ltd filed Critical China United Network Communications Group Co Ltd
Priority to CN201210468533.3A priority Critical patent/CN103823815B/en
Publication of CN103823815A publication Critical patent/CN103823815A/en
Application granted granted Critical
Publication of CN103823815B publication Critical patent/CN103823815B/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/25Integrating or interfacing systems involving database management systems
    • G06F16/252Integrating or interfacing systems involving database management systems between a Database Management System and a front-end application
    • 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/23Updating
    • G06F16/2308Concurrency control

Abstract

The invention provides a server and a database access method. The server comprises a receiving module, an access rule routing module, a semantic translation module and a connection protocol fitting module. The receiving module is used for receiving a first access statement; the access rule routing module is used for acquiring a first operating command and data-table identification information both carried in the first access statement, and judging whether or not data in a data table corresponding to the identification information is extracted into a non-relational database when the first operating command is an operation capable of being performed by the non-relational database; the semantic translation module is used for determining the non-relational database as a target non-relational database and translating the first operating command into a second operating command capable of being analyzed by the target non-relational database when the data in the data table corresponding to the identification information is extracted into the non-relational database is judged; the connection protocol fitting module is used for sending the second operating command and the data-table identification information to the target non-relational database. According to the server and the database access method, requirements on high-concurrency database read-write and the like are met by the non-relational database.

Description

Server and data bank access method
Technical field
The present invention relates to database technology, more particularly to a kind of server and data bank access method.
Background technology
With the rise of the Internet web2.0 websites, to ultra-large and high concurrent social network services(Social Networking Services, SNS)The data query requirements of the pure dynamic websites of web2.0 of type also accordingly increase.
Relevant database is built upon the data base on the basis of relational model, using SQL (Structured Query Language, SQL), perform the retrieval and operation to data in relevant database.Relationship type number All it is to store some data structures for formatting according to the table in storehouse, the composition of each tuple field is the same, even if not being each Tuple is required for all of field, but data base can distribute all of field for each tuple, and such structure can be in order to table The operation such as it is attached between table, but but limits the performance of relevant database.Relation used in the prior art Type data base cannot meet the query demand of web2.0 websites, read and write demand, the high efficiency to mass data in high concurrent and deposit The aspect Shortcomings such as storage and requirements for access, enhanced scalability and high-availability requirement.And non-relational database is with key-value pair Data storage, its structure is not fixed, and each tuple can have different field, and each tuple can increase as needed Some key-value pairs, due to being not limited to fixed structure, it is possible to reduce the expense in some times and space, therefore relative to relation Lifted in performance for type data base.Therefore, relevant database can be made up in height using non-relational database Concurrent reading and writing demand, to aspects such as the storage of the high efficiency of mass data and requirements for access, enhanced scalability and high-availability requirements Deficiency.
Operation to data base includes inquiry generic operation and non-inquiry generic operation, because non-relational database is mainly suitable for In inquiry generic operation, therefore non-relational database can not completely replace the function of relevant database, but close due to accessing It is that type data base needs to use SQL, accessing non-relational database needs to use non-relational query language, Accordingly, it would be desirable to consider high concurrent read-write, the high efficiency to mass data how are met when existing relevant database is kept The demand of the aspect such as storage and access, enhanced scalability and high availability.
The content of the invention
The present invention provides a kind of server and data bank access method, for considering keeping existing relevant database When how to meet high concurrent read-write, to the storage of the high efficiency of mass data and access, the aspect such as enhanced scalability and high availability Demand.
One aspect of the present invention provides a kind of server, including:
Receiver module, for receiving application server in application program send first access sentence, it is described first visit Ask the SQL that sentence is standard;
Regular routing module is accessed, accesses what is carried in sentence for obtaining the receiver module is received described first The identification information of the first operational order and the tables of data for accessing object as first operational order, in the described first behaviour When making the operation that instruction can be carried out for non-relational database, judge whether is data in tables of data corresponding to the identification information It has been drawn in non-relational database;
Semantic translation module, for judging tables of data corresponding to the identification information in the rule routing module that accesses In data when being drawn in non-relational database, the non-relational database that the tables of data is drawn into is defined as Target non-relational database, and first operational order is translated to into the target non-relational database analysable Two operational orders, second operational order is unstructured search language;
Connection protocol adaptation module, for second operational order that obtains the semantic translation module and the number Send to the target non-relational database according to the identification information of table, so that the target non-relational database is according to described The second operational order tables of data corresponding to the identification information is inquired about.
Another aspect of the present invention additionally provides a kind of data bank access method, including:
The first access sentence that the application program in application server sends is received, described first accesses sentence for standard SQL;
Obtain described first and access the first operational order and the visit as first operational order carried in sentence The identification information of the tables of data of object is asked, when first operational order is the operation that non-relational database can be carried out, is sentenced Whether the data broken in tables of data corresponding to the identification information have been drawn in non-relational database;
When the data in judging tables of data corresponding to the identification information are drawn in non-relational database, The non-relational database that the tables of data is drawn into is defined as into target non-relational database, and the described first operation is referred to Order translates to analysable second operational order of the target non-relational database, and second operational order is destructuring Query language;
The identification information of second operational order and the tables of data is sent to the target non-relational database, So that the target non-relational database is carried out according to second operational order tables of data corresponding to the identification information Inquiry.
Server provided in an embodiment of the present invention and data bank access method, by the application journey in reception application server Sequence send first access sentence, obtain first access sentence in carry the first operational order and as the first operational order Access object tables of data identification information, the first operational order be non-relational database can carry out operation when, sentence Whether the data in tables of data corresponding to disconnected identification information have been drawn in non-relational database;Judging identification information When data in corresponding tables of data are drawn in non-relational database, the first operational order is translated to into the non-pass of target It is analysable second operational order of type data base;The identification information of tables of data and the second operational order are sent into pass non-to target It is type data base.Relevant database and non-relational database unification are integrated in heterogeneous database service-Engine, will be marked Quasi- SQL translates to the SQL that NoSQL or different relevant databases are respectively adopted so that application program need not consider different type The difference of the access language between data base, using stsndard SQL the access to distinct type data-base is capable of achieving, and is adopted Read and write abruption, the solution backed up in realtime, realize while relational data library facility is kept, using non-relational Data base is met to the read-write of data base's high concurrent, the high efficiency storage to mass data and access, enhanced scalability and Gao Ke With the demand of the aspects such as property.
Description of the drawings
Fig. 1 is the structural representation of the embodiment of server of the present invention;
Fig. 2 is the structural representation of another embodiment of server of the present invention;
Fig. 3 is a kind of application scenarios schematic diagram of server of the present invention;
Fig. 4 is the flow chart of the embodiment of data bank access method of the present invention;
Fig. 5 is the flow chart of another embodiment of data bank access method of the present invention;
Fig. 6 is the flow chart of the another embodiment of data bank access method of the present invention.
Specific embodiment
Relevant database is conducted interviews to be needed to use SQL SQL, different relational data places Using SQL statement can there is certain difference, relevant database can be carried out " increasing ", " deleting ", " changing " and/or " inquiry " Deng operation;Directly can not be conducted interviews using SQL when conducting interviews to non-relational database, and need to be looked into using destructuring Language is ask, " inquiry " operation can be carried out to non-relational database.Construct in the server that various embodiments of the present invention are provided Heterogeneous database uniform service PaaS platform, the PaaS platform supports relevant database and non-relational database simultaneously. The implication of PaaS is serviced for platform(Platform as a Service).By the PaaS platform in server, profit is realized Non-relational database is inquired about operation with SQL.Server described in following embodiment is and constructs this The server of PaaS platform, is particularly suited for the applied field that trade type data manipulation and the inquiry of mass data high concurrent amount coexist Scape.
Fig. 1 is the structural representation of the embodiment of server of the present invention, as shown in figure 1, the server includes receiver module 11st, regular routing module 12, semantic translation module 13 and connection protocol adaptation module 14 are accessed.
Wherein, receiver module 11, for receiving application server in application program send first access sentence, it is described First accesses SQL of the sentence for standard;Regular routing module 12 is accessed, for obtaining the receiver module 11 Receive described first accesses the first operational order and right as the access of first operational order carried in sentence The identification information of the tables of data of elephant, when first operational order is the operation that non-relational database can be carried out, judges institute State whether the data in tables of data corresponding to identification information have been drawn in non-relational database;Semantic translation module 13, For judging that the data in tables of data corresponding to the identification information are drawn in the rule routing module 12 that accesses When in non-relational database, the non-relational database that the tables of data is drawn into is defined as into target non-relational data Storehouse, and first operational order is translated to into analysable second operational order of the target non-relational database, it is described Second operational order is unstructured search language;Connection protocol adaptation module 14, for the semantic translation module 13 to be obtained To second operational order and the identification information of the tables of data send to the target non-relational database, for institute State target non-relational database to be inquired about according to second operational order tables of data corresponding to the identification information.
Further, the semantic translation module 13 is additionally operable to, and judges in the regular routing module 12 of the access described When data in tables of data corresponding to identification information are not drawn in non-relational database, by the pass belonging to the tables of data It is that type data base is defined as relationship by objective (RBO) type data base, and first operational order is translated to into the relationship by objective (RBO) type data Analysable 3rd operational order in storehouse, the 3rd operational order is knot corresponding with the type of the relationship by objective (RBO) type data base Structure query language;Correspondingly, the connection protocol adaptation module 14 is additionally operable to, the institute that the semantic translation module 13 is obtained The identification information for stating the 3rd operational order and the tables of data is sent to the relationship by objective (RBO) type data base, for target pass It is that type database root is operated according to the 3rd operational order tables of data corresponding to the identification information.
When application program in application server is needed by server accessing databases in the embodiment of the present invention, to this Server sends database access statement, i.e., first accesses sentence, includes that application program needs to access in the first access sentence Tables of data mark, and need the concrete operations that carry out to the tables of data, the first format standard SQL shape for accessing sentence Formula, need not consider to use the difference of language between disparate databases when sending the first access sentence so as to application program, utilize General stsndard SQL.
Server by utilizing receiver module 11 thereon receives application program and sends the first access sentence by application server, After the first access sentence is received, the first access sentence is sent to into the regular routing module 12 of access, for the visit Ask that regular routing module 12 is parsed.
Regular routing module 12 is accessed after the first access sentence for receiving the transmission of receiver module 11, to first visit Ask that sentence is parsed, obtain first and access the first operational order carried in sentence and the identification information for accessing object.Wherein, It is the tables of data in relevant database to access object, and the identification information for accessing object is the data that application program needs to access The identification information of table;First operational order is the concrete operations that application program needs to carry out the tables of data, for example " increase ", " deleting ", " changing " and/or " inquiry " etc. operates.Wherein, " inquiry " is the operation for inquiring about class, and " increasing ", " deleting ", " changing " etc. are non-inquiry The operation of class.The operation of inquiry class is relevant database and the executable operation of non-relational database, rather than inquires about class Operation be adapted in relevant database perform.Therefore, access regular routing module 12 to complete to the first solution for accessing sentence After analysis, need to judge that the first operational order, to inquire about generic operation, is also non-inquiry generic operation.If the first operational order is looked into for non- Generic operation is ask, then needs to be operated in relevant database, therefore need not judge that application program needs the data for accessing Whether the data in table have been drawn in non-relational database;If the first operational order is inquiry generic operation, can be Operated in non-relational database, it is therefore desirable to judge application program need the data in the tables of data for accessing whether by In being drawn into non-relational database.
It is the tables of data in relevant database in original state that application program needs the tables of data for accessing, and is available for application One or more relevant databases and one or more non-relational databases of routine access are stored in database server In.That is, the server that the application server that application program is located is located with PaaS platform is connected, what PaaS platform was located The database server that server is located with data base is connected.It is open corresponding respectively on application server and database server Access interface, so that the server in the embodiment of the present invention is connected thereto.
Database server is except including one or more relevant databases and one or more non-relational data Beyond storehouse, also extract including data, change and load(Extraction TransformationLoading, ETL)Engine.Number According to the data that storehouse server by utilizing ETL engine will be suitable for being operated in non-relational database in relevant database, Corresponding non-relational database is drawn near real-time.The data for being suitable for being operated in non-relational database are concurrent Amount is big, needs data of magnanimity reading etc..
Therefore, ETL engines need to be pre-configured with, data extraction definition rule.ETL engine real-time tracking relevant databases The change of middle data, according to predefined decimation rule, the data that rule is specified from relevant database near real-time In being drawn into non-relational database.Relevant database and non-relational data have been respectively stored in equivalent to same data In storehouse, backup each other, make concordance of the data being extracted in relevant database and non-relational database, to guarantee to answer Accurate result can be obtained when being inquired about in non-relational database with program.
The operation that complete paired data is extracted in data base of ETL engines accesses data with application program by PaaS platform Operation, is between the two asynchronous.ETL engines are by real-time tracking and quasi real time complete to extract.In ETL engines by relation When data pick-up in type data base is in non-relational database, the operation can be recorded on database server, i.e., Which non-relational database is which tables of data in which relevant database has been drawn in.Also, database service The record information of the extracted data is sent to device the server at PaaS platform place, and the record information is stored in visit by server In asking regular routing module 12.
Regular routing module 12 is accessed according to the record information, you can judge that the tables of data that application program needs are accessed is It is no to be drawn in non-relational database.
If accessing regular routing module 12 judges that application program needs the tables of data for accessing to be drawn into non-relation In type data base, then according to the record information, can know which non-relational database is the tables of data is drawn in, so as to The server is inquired about the tables of data in the non-relational database.
If accessing regular routing module 12 judges that application program needs the tables of data for accessing not to be drawn into non-relational In data base, then according to one or more relevant databases and the number for each being stored in the database server for pre-saving According to the corresponding relation between table, know that application program needs which relevant database is the tables of data for accessing belong to, that is, have The database instance of body which relationship type, to inquire about the tables of data in the server to the relevant database.
Regular routing module 12 is accessed after judging whether tables of data has been drawn into non-relational database, will be solved The first operational order, the identification information of tables of data and the above-mentioned judged result for separating out is sent to semantic translation module 13.Wherein, Show whether the tables of data is drawn in non-relational database in judged result, if being extracted, the judged result In carry the Database Identification information of the non-relational data being drawn into;If not being extracted, carry in the judged result There are the Database Identification information of the relevant database belonging to the tables of data, i.e., the data base of specific relevant database example Identification information.Semantic translation module 13 is translated according to judged result to the first operational order, specially following two sides Formula:
A kind of mode is, when judged result shows that tables of data is drawn in non-relational database, semanteme translation Module 13 know in the judged result carry Database Identification information it is corresponding be non-relational database, then by the data mark The corresponding non-relational database of knowledge information is defined as target non-relational database, i.e., by accessing the non-relational database The access operation that application program needs to carry out can be completed.The non-relational database is being defined as into target non-relational data After storehouse, the first operational order is translated to analysable second operation of target non-relational database and is referred to by semantic translation module 13 Order, the second operational order is unstructured search language, or is referred to as based on key(Key)The unstructured search language of value(Not Only SQL, NoSQL)Inquiry, that is, meet the operational order of target non-relational database grammer.That is, the first operation Instruction and the corresponding access operation of the second operational order are identicals, and both differences are the second operational orders to same access The adopted database syntax of operation is different.If it is understood that the destructuring that different non-relational data are adopted Query language has differences, then corresponding conversion regime is pre-set in semantic translation module 13.
One of which concrete implementation mode can be that stsndard SQL is previously stored with semantic translation module 13 with non-pass It is the corresponding relation between the unstructured language that type data place is adopted, it is translation templates that the corresponding relation can have.Turn The structure for translating template can be which kind of operational order carried out to which tables of data, and the database syntax of the translation module is adopted It is the grammatical structure of non-SQL.Therefore, it can utilize translation templates by the first operational order and tables of data Identification information, be configured to conform to the access sentence of unstructured search language syntax.So that the server by utilizing is through translation The access sentence that template is obtained conducts interviews to target non-relational database.
Another way is, when judged result shows that tables of data is not drawn in non-relational database, semanteme turns Translate module 13 know in the judged result carry Database Identification information it is corresponding be relevant database, then by the data mark The corresponding relevant database of knowledge information is defined as relationship by objective (RBO) type data base, i.e., can be with complete by accessing the relevant database Into the access operation that application program needs to carry out.After the relevant database to be defined as relationship by objective (RBO) type data base, language First operational order is translated to analysable 3rd operational order of relationship by objective (RBO) type data base by adopted translation module 13.Due to difference Relevant database not necessarily adopt stsndard SQL, may different relational data place using access language in the form of Have differences with stsndard SQL, or the SQL adopted between different relevant databases there is also difference, therefore, the 3rd behaviour It is SQL corresponding with the type of relationship by objective (RBO) type data base to make instruction, that is, the operation for meeting relationship by objective (RBO) type database syntax refers to Order.That is, the first operational order and the corresponding access operation of the 3rd operational order are identicals, both differences are the 3rd The operational order database syntax adopted to same access operation is different.
One of which concrete implementation mode can be previously stored with semantic translation module 13 stsndard SQL from it is different Corresponding relation between the SQL that relational data place is adopted, it is translation templates that the corresponding relation can have.Translation templates Structure can be which kind of operational order carried out to which tables of data, and the database syntax of the translation module is used point Corresponding grammatical structure is not distinguished from different relevant databases.Therefore, it can using translation templates by the first operational order and The identification information of tables of data, is configured to conform to the access sentence of the SQL of relationship by objective (RBO) type data place employing.So as to the server Relationship by objective (RBO) type data base is conducted interviews using the access sentence obtained through translation templates.
Identification information, the target non-relational database of the tables of data that application program is needed to access by semantic translation module 13 Database Identification information and translation after the second operational order send to connection protocol adaptation module 14;Or will be using journey Sequence needs the 3rd after identification information, relationship by objective (RBO) type wide area information server identification information and the translation of the tables of data for accessing Operational order is sent to connection protocol adaptation module 14.If semantic translation module 13 operates the identification information of tables of data and second Instruction, or the identification information and the 3rd operational order of tables of data be configured to access sentence accordingly, then semantic translation module 13 The access sentence is sent to connection protocol adaptation module 14.
Connection protocol adaptation module 14 receives identification information, the Database Identification of the tables of data of the transmission of semantic translation module 13 Information and operational order, wherein operational order are the second operational order or the 3rd operational order.Server is suitable by connection protocol Set up and linking between one or more servers in database server with module 14.The basis of connection protocol adaptation module 14 Database Identification information, by the identification information of tables of data and the second operational order target corresponding to Database Identification information is sent Non-relational database;Or, just the identification information of tables of data and the 3rd operational order are sent to Database Identification information pair The relationship by objective (RBO) type data base for answering.So that target non-relational database completes the behaviour to the tables of data according to the second operational order Make;Or relationship by objective (RBO) type database root completes the operation to the tables of data according to the 3rd operational order.
Server provided in an embodiment of the present invention, the first access sent by the application program in reception application server Sentence, obtains the first data for accessing the first operational order and access object as the first operational order carried in sentence The identification information of table, when the first operational order is the operation that non-relational database can be carried out, judges that identification information is corresponding Whether the data in tables of data have been drawn in non-relational database;In tables of data corresponding to identification information is judged When data are drawn in non-relational database, the first operational order is translated to into target non-relational database can parse The second operational order;Data in tables of data corresponding to identification information is judged are not drawn in non-relational database When, the first operational order is translated to into analysable 3rd operational order of relationship by objective (RBO) type data base;The mark of tables of data is believed Breath and the second operational order are sent to target non-relational database, or by the identification information of tables of data and the 3rd operational order Send to relationship by objective (RBO) type data base, for target non-relational database or the complete paired data table of relationship by objective (RBO) type data base Operation.Relevant database and non-relational database unification are integrated in heterogeneous database service-Engine, stsndard SQL is turned Be translated into the SQL that NoSQL or different relevant databases are respectively adopted so that application program need not consider distinct type data-base it Between access language difference, access to distinct type data-base is capable of achieving using stsndard SQL, and employ read-write point From, the solution backed up in realtime, realize while relational data library facility is kept, it is full using non-relational database Foot to the read-write of data base high concurrent, the high efficiency storage to mass data and access, the side such as enhanced scalability and high availability The demand in face.
Further, it is described to access regular routing module 12 specifically for obtaining institute on the basis of the various embodiments described above State first operational order of carrying in the first access sentence that receiver module 11 is received and as described first The identification information of the tables of data of the access object of operational order, is inquiring the pass belonging to tables of data corresponding to the identification information It is that type data base is the relevant database in addressable one or more relevant databases of the default application program, And when first operational order is the operation that non-relational database can be carried out, judge data corresponding to the identification information Whether the data in table have been drawn in non-relational database.
Access first operation of the regular routing module 12 in the first access sentence that receiver module 11 is received is obtained to refer to After the identification information of order and tables of data, before the operation that judge the first operational order and can carry out for non-relational database, Whether the relevant database for also needing to inquire about belonging to the tables of data is the addressable relevant database of the application program.If Data base in addressable one or more relevant databases of the application program, then illustrate that application program has permission to access and be somebody's turn to do Data base, so access the data that regular routing module 12 judged in tables of data corresponding to identification information whether be drawn into it is non- Relevant database;If not the data base in addressable one or more relevant databases of the application program, then illustrate Application program lack of competence accesses the data base, and accessing regular routing module 12 no longer carries out subsequent operation.
Server provided in an embodiment of the present invention, gets the first operational order and the access as the first operational order After the identification information of the tables of data of object, needs are inquiring the relevant database belonging to tables of data corresponding to identification information On the premise of for the relevant database in addressable one or more relevant databases of default application program, just enter one Step judges that whether the first operational order is the operation that non-relational database can be carried out, and judges data corresponding to identification information Whether the data in table have been drawn in non-relational database, serve what the access request to application program was authenticated Effect, the data base that application program has permission to access only is opened give the application program, is effectively improved database access Safety.
Further, on the basis of the various embodiments described above, the rule routing module 12 that accesses is additionally operable to, and is pre-configured with At least one of application server application program distinguishes addressable one or more relevant databases.
Access regular routing module 12 and judge whether application program is had permission to access before corresponding relevant database, need Addressable one or more relevant databases of the application program are pre-configured with regular routing module 12 is accessed, that is, be had The database instance of body.Due to potentially including one or more application programs in application server, therefore, access rule route mould What is be pre-configured with block 12 is that each application program distinguishes addressable one or more relevant databases in application server.
Server provided in an embodiment of the present invention, is pre-configured with application server in regular routing module is accessed and respectively should Distinguish addressable one or more relevant databases with program, sending from application program for accessing regular routing module Access and got after the identification information and the first operational order of tables of data in sentence, the application journey that is pre-configured with can be passed through The access rights of sequence, to whether allowing the corresponding relational data of application program access to inquire about, are effectively improved data The safety that storehouse accesses.
Fig. 2 is the structural representation of another embodiment of server of the present invention, as shown in Fig. 2 in the base of the various embodiments described above On plinth, the server also includes result adaptation and forwarding module 15.Fig. 3 is that a kind of application scenarios of server of the present invention are illustrated Figure.
As a result adaptation and forwarding module 15 are used to receive the target non-relational database or relationship by objective (RBO) type data base The operating result for being returned, by the operating result the analysable data form of the application program is converted to, and is sent to institute State the application program in application server.
As a result adaptation and forwarding module 15 are arranged in the server, for the non-relation of target in the server of receiving data storehouse Type data base or the operating result of relationship by objective (RBO) type data base.Due to inquiring about the corresponding operating result of generic operation with non-inquiry class behaviour The form for making corresponding operating result is different, therefore, as a result adaptation and forwarding module 15 need the operating result to receiving to enter Row conversion.
If what target non-relational database or relationship by objective (RBO) type data base performed is the operation for inquiring about class, result adaptation And it is that data are converted to predefined form that forwarding module 15 will be inquired, the predefined form is that application program can be known Other form, and then the operating result after format transformation is transmitted to into the application server at application program place, so as to apply journey Sequence can receive recognizable format operation result;If what target non-relational database or relationship by objective (RBO) type data base performed is The operation of non-inquiry class, then operating result is converted to predefined stsndard SQL result generation by result adaptation and forwarding module 15 Code is transmitted to the application server at application program place, so as to application program can receive the operation knot of the stsndard SQL form Really.
Server provided in an embodiment of the present invention, receives target non-relational database or relationship by objective (RBO) type data place is returned The operating result for returning, by operating result the analysable data form of application program is converted to, and is sent in application server Application program, so that application program not only need not consider the grammatical differences of disparate databases when needing and accessing data base, And when operating result is received, the form of received operating result is also the discernible form of application program, effectively Improve the efficiency that application program accesses data base.
One of ordinary skill in the art will appreciate that:Realizing all or part of step of above-mentioned each method embodiment can lead to Cross the related hardware of programmed instruction to complete.Aforesaid program can be stored in a computer read/write memory medium.The journey Sequence upon execution, performs the step of including above-mentioned each method embodiment;And aforesaid storage medium includes:ROM, RAM, magnetic disc or Person's CD etc. is various can be with the medium of store program codes.
Fig. 4 is the flow chart of the embodiment of data bank access method of the present invention, as shown in figure 4, the method includes:
The first access sentence that step 101, the application program received in application server send, described first accesses sentence For the SQL of standard;
Step 102, obtain it is described first access sentence in carry the first operational order and as described first operation The identification information of the tables of data of the access object of instruction, is the behaviour that non-relational database can be carried out in first operational order When making, judge whether the data in tables of data corresponding to the identification information have been drawn in non-relational database;
Step 103, the data in tables of data corresponding to the identification information is judged have been drawn into non-relational number During according in storehouse, the non-relational database that the tables of data is drawn into is defined as into target non-relational database, and will be described First operational order translates to analysable second operational order of the target non-relational database, second operational order For unstructured search language;
Step 104, the identification information of second operational order and the tables of data is sent into relation non-to the target Type data base, so that the target non-relational database is according to second operational order number corresponding to the identification information Inquired about according to table.
Fig. 5 is the flow chart of another embodiment of data bank access method of the present invention, as shown in figure 5, judging in step 102 After whether the data in tables of data corresponding to the identification information are drawn in non-relational database, the method bag Include:
Step 105, the data in tables of data corresponding to the identification information is judged are not drawn into non-relational number During according in storehouse, the relevant database belonging to the tables of data is defined as into relationship by objective (RBO) type data base, and described first is grasped Make instruction translation for analysable 3rd operational order of the relationship by objective (RBO) type data base, the 3rd operational order be with it is described The corresponding SQL of type of relationship by objective (RBO) type data base;
Step 106, the identification information of the 3rd operational order and the tables of data is sent to the relationship by objective (RBO) type Data base, so that the relationship by objective (RBO) type database root is according to the 3rd operational order tables of data corresponding to the identification information Operated.
Data bank access method provided in an embodiment of the present invention, is sent by the application program in reception application server First accesses sentence, obtains first and accesses the first operational order and right as the access of the first operational order carried in sentence The identification information of the tables of data of elephant, when the first operational order is the operation that non-relational database can be carried out, judges mark letter Cease whether the data in corresponding tables of data have been drawn in non-relational database;Judging number corresponding to identification information When being drawn in non-relational database according to the data in table, the first operational order is translated to into target non-relational data Analysable second operational order in storehouse;Data in tables of data corresponding to identification information is judged are not drawn into non-relational When in data base, the first operational order is translated to into analysable 3rd operational order of relationship by objective (RBO) type data base;By tables of data Identification information and the second operational order send to target non-relational database, or by the identification information of tables of data and the 3rd Operational order is sent to relationship by objective (RBO) type data base, so that target non-relational database or relationship by objective (RBO) type data base complete right The operation of tables of data.Relevant database and non-relational database unification are integrated in heterogeneous database service-Engine, will Stsndard SQL translates to the SQL that NoSQL or different relevant databases are respectively adopted so that application program need not consider inhomogeneity The difference of the access language between type data base, using stsndard SQL the access to distinct type data-base is capable of achieving, and is adopted With read and write abruption, the solution backed up in realtime, realize while relational data library facility is kept, using non-relation Type data base is met to the read-write of data base's high concurrent, the high efficiency storage to mass data and access, enhanced scalability and height The demand of the aspects such as availability.
Fig. 6 is the flow chart of the another embodiment of data bank access method of the present invention, as shown in fig. 6, in the various embodiments described above On the basis of, step 102 is specifically included:
Step 201, obtain it is described first access sentence in carry first operational order and as described first The identification information of the tables of data of the access object of operational order;
Step 202, the relevant database belonging to tables of data corresponding to the identification information is being inquired for default institute State the relevant database in addressable one or more relevant databases of application program, and first operational order During the operation that can be carried out for non-relational database, judge whether the data in tables of data corresponding to the identification information are taken out In getting non-relational database.
Data bank access method provided in an embodiment of the present invention, gets the first operational order and refers to as the first operation After the identification information of the tables of data of the access object of order, needs are inquiring the relation belonging to tables of data corresponding to identification information Type data base is the premise of the relevant database in addressable one or more relevant databases of default application program Under, just determine whether that whether the first operational order is the operation that non-relational database can be carried out, and judge identification information Whether the data in corresponding tables of data have been drawn in non-relational database, serve the access request to application program The effect being authenticated, the data base that application program has permission to access only is opened give the application program, is effectively improved number According to the safety that storehouse accesses.
Further, on the basis of the various embodiments described above, inquiring about belonging to tables of data corresponding to the identification information Whether relevant database is the relationship type in addressable one or more relevant databases of the default application program Before data base, the method also includes:
Step 301, be pre-configured with least one of the application server application program difference it is addressable one or Multiple relevant databases.
Data bank access method provided in an embodiment of the present invention, needs to be pre-configured with each application program point in application server Not addressable one or more relevant databases, so that server gets in the access sentence sent from application program After the identification information of tables of data and the first operational order, the access rights of application program that can be by being pre-configured with, to being No permission application program accesses corresponding relational data and is inquired about, and is effectively improved the safety of database access.
Further, on the basis of the various embodiments described above, after step 104 or step 106, the method also includes:
Step 401, the operating result for receiving the target non-relational database or the return of relationship by objective (RBO) type data place, The operating result is converted to into the analysable data form of the application program, and is sent to the institute in the application server State application program.
Data bank access method provided in an embodiment of the present invention, receives target non-relational database or relationship by objective (RBO) type number According to the operating result that place is returned, operating result is converted to into the analysable data form of application program, and is sent to using clothes Application program in business device, so that application program not only need not consider the language of disparate databases when needing and accessing data base Method difference, and when operating result is received, the form of received operating result is also the discernible form of application program, It is effectively improved the efficiency that application program accesses data base.
Specifically, the data bank access method in various embodiments of the present invention may refer to described in above-mentioned each device embodiment Method, here is omitted.
Finally it should be noted that:Various embodiments above only to illustrate technical scheme, rather than a limitation;To the greatest extent Pipe has been described in detail with reference to foregoing embodiments to the present invention, it will be understood by those within the art that:Its according to So the technical scheme described in foregoing embodiments can be modified, either which part or all technical characteristic are entered Row equivalent;And these modifications or replacement, do not make the essence disengaging various embodiments of the present invention technology of appropriate technical solution The scope of scheme.

Claims (4)

1. a kind of server, it is characterised in that include:
Receiver module, for receiving application server in application program send first access sentence, it is described first access language Sentence is the SQL of standard;
Regular routing module is accessed, for obtaining the receiver module is received described first carry in sentence first is accessed The identification information of operational order and the tables of data for accessing object as first operational order, refers in the described first operation When making the operation that can be carried out for non-relational database, judge data in tables of data corresponding to the identification information whether by In being drawn into non-relational database;
Semantic translation module, in judging tables of data corresponding to the identification information in the regular routing module of the access When data are drawn in non-relational database, the non-relational database that the tables of data is drawn into is defined as into target Non-relational database, and first operational order is translated to into analysable second behaviour of the target non-relational database Instruct, second operational order is unstructured search language;
Connection protocol adaptation module, for second operational order that obtains the semantic translation module and the tables of data Identification information send to the target non-relational database, so that the target non-relational database is according to described second The operational order tables of data corresponding to the identification information is inquired about;
The semantic translation module is additionally operable to:
Data in the regular routing module of the access judges tables of data corresponding to the identification information are not drawn into non- When in relevant database, the relevant database belonging to the tables of data is defined as into relationship by objective (RBO) type data base, and by institute State the first operational order and translate to analysable 3rd operational order of the relationship by objective (RBO) type data base, the 3rd operational order It is SQL corresponding with the type of the relationship by objective (RBO) type data base;
Correspondingly, the connection protocol adaptation module is additionally operable to, and the 3rd operation that the semantic translation module is obtained is referred to The identification information of order and the tables of data is sent to the relationship by objective (RBO) type data base, for the relationship by objective (RBO) type database root Operate according to the 3rd operational order tables of data corresponding to the identification information;
It is described access regular routing module specifically for:
Obtain first operational order and conduct carried in the first access sentence that the receiver module is received The identification information of the tables of data of the access object of first operational order, is inquiring tables of data corresponding to the identification information Affiliated relevant database is the relation in addressable one or more relevant databases of the default application program Type data base, and first operational order be non-relational database can carry out operation when, judge the identification information Whether the data in corresponding tables of data have been drawn in non-relational database;
The rule routing module that accesses is additionally operable to:
It is pre-configured with least one of application server application program and distinguishes addressable one or more relationship type numbers According to storehouse.
2. server according to claim 1, it is characterised in that the server also includes:
As a result adaptation and forwarding module, return for receiving the target non-relational database or relationship by objective (RBO) type data place Operating result, the operating result is converted to into the analysable data form of the application program, and be sent to the application The application program in server.
3. a kind of data bank access method, it is characterised in that include:
The first access sentence that the application program in application server sends is received, described first accesses structure of the sentence for standard Change query language;
Obtain described first and access the first operational order and right as the access of first operational order carried in sentence The identification information of the tables of data of elephant, when first operational order is the operation that non-relational database can be carried out, judges institute State whether the data in tables of data corresponding to identification information have been drawn in non-relational database;
When the data in judging tables of data corresponding to the identification information are drawn in non-relational database, by institute State the non-relational database that tables of data is drawn into and be defined as target non-relational database, and first operational order is turned Analysable second operational order of the target non-relational database is translated into, second operational order is unstructured search Language;
The identification information of second operational order and the tables of data is sent to the target non-relational database, for The target non-relational database is inquired about according to second operational order tables of data corresponding to the identification information; After whether the data in the tables of data for judging that the identification information is corresponding are drawn in non-relational database, institute Stating method also includes:
When the data in judging tables of data corresponding to the identification information are not drawn in non-relational database, by institute State the relevant database belonging to tables of data and be defined as relationship by objective (RBO) type data base, and first operational order is translated to into institute Analysable 3rd operational order of relationship by objective (RBO) type data base is stated, the 3rd operational order is and the relationship by objective (RBO) type data The corresponding SQL of type in storehouse;
The identification information of the 3rd operational order and the tables of data is sent to the relationship by objective (RBO) type data base, for institute State relationship by objective (RBO) type database root to operate according to the 3rd operational order tables of data corresponding to the identification information;
It is described to obtain the first operational order and the visit as first operational order carried in the first access sentence The identification information of the tables of data of object is asked, and judges whether the data in tables of data corresponding to the identification information are drawn into It is specially in non-relational database:
Obtain described first and access first operational order and the visit as first operational order carried in sentence Ask the identification information of the tables of data of object;
Can for the default application program the relevant database belonging to tables of data corresponding to the identification information is inquired Relevant database in one or more relevant databases for accessing, and first operational order is non-relational number During the operation that can be carried out according to storehouse, judge whether the data in tables of data corresponding to the identification information have been drawn into non-relational In data base;
Whether it is the default application program the relevant database belonging to tables of data corresponding to the identification information is inquired about Before relevant database in addressable one or more relevant databases, methods described also includes:
It is pre-configured with least one of application server application program and distinguishes addressable one or more relationship type numbers According to storehouse.
4. data bank access method according to claim 3, it is characterised in that methods described also includes:
The operating result that the target non-relational database or relationship by objective (RBO) type data place are returned is received, the operation is tied Fruit is converted to the analysable data form of the application program, and is sent to the application program in the application server.
CN201210468533.3A 2012-11-19 2012-11-19 server and database access method Active CN103823815B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210468533.3A CN103823815B (en) 2012-11-19 2012-11-19 server and database access method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210468533.3A CN103823815B (en) 2012-11-19 2012-11-19 server and database access method

Publications (2)

Publication Number Publication Date
CN103823815A CN103823815A (en) 2014-05-28
CN103823815B true CN103823815B (en) 2017-05-17

Family

ID=50758885

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210468533.3A Active CN103823815B (en) 2012-11-19 2012-11-19 server and database access method

Country Status (1)

Country Link
CN (1) CN103823815B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109947790A (en) * 2019-03-19 2019-06-28 优刻得科技股份有限公司 The method, apparatus and non-volatile memory medium of cloud resource management

Families Citing this family (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104346468A (en) * 2014-11-14 2015-02-11 浪潮(北京)电子信息产业有限公司 Method and device for realizing concurrent I/O (Input/Output) in database system
CN104410644A (en) * 2014-12-15 2015-03-11 北京国双科技有限公司 Data configuration method and device
CN106294499A (en) * 2015-06-09 2017-01-04 阿里巴巴集团控股有限公司 A kind of database data querying method and equipment
CN106503040B (en) * 2016-09-20 2019-08-02 福建天晴数码有限公司 It is applicable in the KV database and its creation method of SQL query method
CN106897467A (en) * 2017-04-24 2017-06-27 成都四方伟业软件股份有限公司 A kind of database adaptation method of big data analysis engine
CN110019350B (en) * 2017-07-28 2021-06-29 北京京东尚科信息技术有限公司 Data query method and device based on configuration information
CN108304522A (en) * 2018-01-25 2018-07-20 深圳市买买提信息科技有限公司 Comparison method, device and the terminal device of difference between a kind of database
CN109063196B (en) * 2018-09-03 2021-08-27 拉扎斯网络科技(上海)有限公司 Data processing method and device, electronic equipment and computer readable storage medium
CN109460416B (en) * 2018-12-12 2020-02-04 成都四方伟业软件股份有限公司 Data processing method and device, electronic equipment and storage medium
CN110032604B (en) * 2019-02-02 2021-12-07 北京奥星贝斯科技有限公司 Data storage device, translation device and database access method
CN109871408B (en) * 2019-03-05 2023-07-14 深圳市迅雷网络技术有限公司 Multi-type database adaptation method, device, electronic equipment and storage medium
CN112749177A (en) * 2019-10-31 2021-05-04 北京国双科技有限公司 Database data processing method and device
CN111488391A (en) * 2020-04-09 2020-08-04 中国银行股份有限公司 Data processing method and device
CN111475534B (en) * 2020-05-12 2023-04-14 北京爱笔科技有限公司 Data query method and related equipment
CN112866348B (en) * 2020-12-31 2022-11-11 金蝶软件(中国)有限公司 Database access method and device, computer equipment and storage medium
CN113420046A (en) * 2021-06-22 2021-09-21 康键信息技术(深圳)有限公司 Data operation method, device, equipment and storage medium of non-relational database

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1686498A2 (en) * 2005-01-31 2006-08-02 Microsoft Corporation Integration of a non-relational query language with a relational data store
CN101158975A (en) * 2007-11-21 2008-04-09 金蝶软件(中国)有限公司 Method and system for accessing distinct type data-base
CN101350028A (en) * 2008-07-10 2009-01-21 西安中电商务信息技术有限公司 XML data XPath search method based on SQL structured search language
CN101706810A (en) * 2009-11-23 2010-05-12 北京中创信测科技股份有限公司 Method and device for querying databases
CN102253984A (en) * 2011-06-28 2011-11-23 用友软件股份有限公司 Query sentence processing device and query sentence processing method
CN102521254A (en) * 2011-11-17 2012-06-27 广东电网公司电力科学研究院 Uniform access method of isomeric database

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1686498A2 (en) * 2005-01-31 2006-08-02 Microsoft Corporation Integration of a non-relational query language with a relational data store
CN101158975A (en) * 2007-11-21 2008-04-09 金蝶软件(中国)有限公司 Method and system for accessing distinct type data-base
CN101350028A (en) * 2008-07-10 2009-01-21 西安中电商务信息技术有限公司 XML data XPath search method based on SQL structured search language
CN101706810A (en) * 2009-11-23 2010-05-12 北京中创信测科技股份有限公司 Method and device for querying databases
CN102253984A (en) * 2011-06-28 2011-11-23 用友软件股份有限公司 Query sentence processing device and query sentence processing method
CN102521254A (en) * 2011-11-17 2012-06-27 广东电网公司电力科学研究院 Uniform access method of isomeric database

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109947790A (en) * 2019-03-19 2019-06-28 优刻得科技股份有限公司 The method, apparatus and non-volatile memory medium of cloud resource management

Also Published As

Publication number Publication date
CN103823815A (en) 2014-05-28

Similar Documents

Publication Publication Date Title
CN103823815B (en) server and database access method
CN106227800B (en) Storage method and management system for highly-associated big data
CN105630881B (en) A kind of date storage method and querying method of RDF
JP5509596B2 (en) Data management device
CN107491561B (en) Ontology-based urban traffic heterogeneous data integration system and method
CN104516979B (en) A kind of data query method and system based on quadratic search
US9020882B2 (en) Database hosting middleware dimensional transforms
CN103064875B (en) A kind of spatial service data distributed enquiring method
CN105183834B (en) A kind of traffic big data semantic applications method of servicing based on ontology library
CN103646051B (en) Big-data parallel processing system and method based on column storage
US20190197185A1 (en) Intelligent natural language query processor
US9753977B2 (en) Method and system for managing database
CN107480252A (en) A kind of data query method, client, service end and system
CN108922633A (en) A kind of disease name standard convention method and canonical system
CN110688397B (en) SQL-based distributed data unified access system and method
JP2006244499A5 (en)
CN103761102B (en) A kind of uniform data service platform and its implementation
CN111221791A (en) Method for importing multi-source heterogeneous data into data lake
US20110172990A1 (en) Knowledge Utilization
CN109947796A (en) A kind of caching method of distributed data base system inquiry intermediate result set
CN106970939A (en) A kind of database audit method and its system
JP2004110219A (en) Data processing system and join processing method
CN102750354A (en) Method for analyzing and processing non-structured data query operating language
Meimaris et al. A query language for multi‐version data web archives
Schreiner et al. Bringing SQL databases to key-based NoSQL databases: a canonical approach

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant