CN1351299A - Method and device for accessing database - Google Patents

Method and device for accessing database Download PDF

Info

Publication number
CN1351299A
CN1351299A CN 00125888 CN00125888A CN1351299A CN 1351299 A CN1351299 A CN 1351299A CN 00125888 CN00125888 CN 00125888 CN 00125888 A CN00125888 A CN 00125888A CN 1351299 A CN1351299 A CN 1351299A
Authority
CN
China
Prior art keywords
application system
middleware
module
result
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN 00125888
Other languages
Chinese (zh)
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.)
ZTE Corp
Original Assignee
ZTE Corp
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 ZTE Corp filed Critical ZTE Corp
Priority to CN 00125888 priority Critical patent/CN1351299A/en
Publication of CN1351299A publication Critical patent/CN1351299A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

A method and device for accessing database is disclosed. Said device is composed of application system, database manage system (DBMS) and middleware between them. Said application system can access said middleware in data service mode. Said middleware performs database access and data conversion to universal format, and can transmit the result back to said application system. Its advantage is that modifying the middleware can perform the implantation of DMBS with high speed and low cost.

Description

A kind of Database Accessing Methods and device
The present invention relates to a kind of general Database Accessing Methods of software systems in realizing, specifically, is the method that a kind of application software system does not rely on particular data base management system DBMS need use database the time.
Generally need to use database to deposit or service data in Large Scale Application Software System, various Database Systems provide different access mode and other characteristics (such as capacity estimation, the online backup of database).In the prior art, Database Accessing Methods is directly to adopt the various api interfaces relevant with DBMS, or uses some general database interfaces.When changing the DBMS system, both of these case all needs to make amendment to using software systems.The shortcoming one of using api interface is when changing DBMS, the transplanting cost is higher, the 2nd, the database associative operation has different staff developments respectively, all developers must understand each realization details of database processing fully, comprise list structure, the relation between table and the table etc. cause product quality wayward, so easy duplication of labour, and cost is higher; Though use GDI can make the transplanting cost that reduction is arranged slightly, other aspects there is no improvement, and have a strong impact on the service efficiency of database.
The purpose of this invention is to provide and a kind ofly ask lower and lower-cost data bank access method of software systems whole development and device thereof of expense when transplanting in different DBMS system.
For achieving the above object, the device of a kind of accessing database that the present invention at first proposes, its core be in the prior art application system and DBMS between increase a middleware and isolate, application system adopts the mode of data, services to visit described middleware, carry out the conversion work of data, services by described middleware, and the actual access of database of finishing is put the data that obtain in order, and the result who forms common version returns to application system.
A kind of data bank access method that the present invention proposes may further comprise the steps:
1) judges whether the desired data access of application system is the transactional operation, if enter step 2)
If not, then directly enter step 3);
2) application system is sent transaction commands of beginning to middleware, and middleware returns one to application system
Transaction Identifier;
3) application system is sent a services request to middleware;
4) middleware is translated services request, and data base management system DBMS is operated, and obtains
Get the result;
5) if the result has only a record, middleware is organized into canonical form with the result and returns to application system,
Enter step 8);
6) result has many records, and middleware writes result buffer with the result, and the buffer zone sign is returned
Give application system, carry out corresponding operating by application system;
7) application system is sent the order that discharges result buffer to middleware;
8) then complete successfully if not the affairs type operation;
9) affairs type operation, if the services request failure, application system is cancelled whole affairs to middleware, moves back
Go out processing procedure;
10) if continue services request, then repeating step 3, until finishing whole affairs;
11) all services all complete successfully, and application system confirms that to middleware whole affairs finish.
Aforesaid a kind of data bank access method is characterized in that, described step 6)
In carry out corresponding operating by application system and comprise:
1) sends to middleware with system and get result command;
2) middleware returns an outcome record to application system;
3) repeating step 2), stop to fetch data until having got data or application system.
Further describe the present invention below in conjunction with drawings and Examples.
Fig. 1 is the process flow diagram of the method for the invention
Fig. 2 is the structural representation of device of the present invention
In order to understand the present invention better, be necessary to explain earlier related notion, the notion of service is understood that application system wishes database is carried out certain operation, to obtain a statement of potential result, represents { title with a tlv triple; Input; Output }.Application system is sent services request to middleware, and middleware satisfies the visiting demand of application system to database.
Wherein, which type of service operations title decision middleware carries out.
The input expression is input to the parameter of middleware, and its quantity, type and form depend on service name.
The output data that output expression application system obtains from middleware, its quantity, type and form depend on service name.
Service is irrelevant with concrete database structure and method of operating, only represents what information is application system wish to store, obtain or delete.Concrete database manipulation is by middleware processes.Service model is only relevant with the specific requirement that application system is stored and obtained data.
Below be an example:
Application system need write database with the data that collect, and data have two, and { A, B} want the time of record acquisition to data simultaneously.Take out corresponding data by the time when needed.In order to realize above-mentioned functions, need two services.
A service is to write data, and its name is called Write, and input parameter is A, B, and time, not output, its expression-form is { Write; A, B, time; }
Another service is a reading of data, and its name is called Read, and input parameter is time, output A, and B, its expression-form are { Read; Time; A, B}.
How particularly these two services all do not indicate operating database, its implementation is finished by middleware, on stream, only needs to set up these data of table storage in database, to finish the method for above-mentioned two pairing operating databases of service then, and add in the middleware and go.Application system only proposes above-mentioned service request to middleware, the result that can obtain wishing just, and needn't know its concrete storage mode and operating process.
In the practical application of database, also relevant for the notion of transaction operation, it is meant that the sequence of operations of in the business process data in the database repeatedly being revised must all finish in order, if an operation failure is arranged then belong to these affairs process all operation be invalid, to not influence of legacy data.Therefore the ability of affairs control need be provided when using this method accessing database, can make a plurality of services constitute affairs, be convenient to realize some application.Do not having explicitly when indicating affairs, middleware should the service that each is independent be interpreted as the operation of affairs.
The return message of database manipulation generally is divided into two kinds, and a kind of form is one or more data, constitutes a record, and another kind is to return a group record.When returning a record, middleware is arranged it and is directly returned to application by standard format.When returning many records, middleware is recorded in all data in the result buffer, and gives and use a buffer zone sign, uses and obtains data one by one by this sign.
According to the method described in the present invention, when application system need be stored some information in database or obtain some information from database, the described method of concrete realization flow of just pressing Fig. 1 demonstration is finished the operation that needs to middleware device application service.
Application is sent transaction commands of beginning (when a plurality of services constitute affairs) to middleware, middleware returns a Transaction Identifier (when a plurality of services constitute affairs) to application, application is sent a services request to middleware, middleware is translated services request, and DBMS operated, when the result that obtains has only a record, then middleware is organized into canonical form with the result and returns to application, when the result has many records, middleware writes result buffer with the result, and the buffer zone sign is returned to application system; Continue services request if exist, then have application system to continue to send services request to middleware, until not continuing services request, then application system is cancelled whole affairs to middleware, withdraws from processing procedure (when a plurality of services constitute affairs).
For example when the result has many records, application system need obtain some information in database, be to work like this: application system is sent to middleware and is got result command, middleware returns an outcome record to application, stops to fetch data until having got data or application, and application system is sent the order in buffer release district to middleware, constantly repeat, until finishing whole affairs, all services all complete successfully, and use to middleware and confirm that whole affairs finish.
Among the present invention, application system uses the interface form of service to include but not limited to the interface of general or special purpose API form, through the interface of the class form of secondary encapsulation.
The present invention is applicable to existing all operations system and DBMS system, just under the various different operating systems with the DBMS system under the implementation of middleware slightly different.Now be SUNSolarise with the suitable environment *7 operating systems and Oracle *8.0 the middleware of DBMS is an example, the structural principle of the present invention that key diagram 2 provides.
Apparatus of the present invention are the middleware systems that are isolated between application system and the database, and middleware system provides data, services to application system, so that replace the traditional method of the direct accessing database of application system.When changing the DBMS system, needs need not make amendment the portability of enhanced system like this to the application system.
As shown in Figure 2, described middleware is between application module and database, application module uses the interface and the middleware module communication of API form, and the composition module of middleware is divided into service module, scheduler module, processing module, outcome record enquiry module and five modules of overtime detection module.The reason that is divided into five modules is in order to realize the operational efficiency and the stability of concurrent operations, raising system.In fact all functions complete combination with these modules also is fine together.
Described service module is used to receive various command, and it is distributed to scheduler module and enquiry module.
Described scheduler module is used to manage the duty of each processing module and according to its idle condition concrete operational order is delivered processing module and carry out.
Described processing module is used for the analysis operation order and is translated into actual database manipulation, carries out these operations and the result is write result buffer or directly returns to application system.Processing module can have a plurality of, to satisfy the demand of concurrent accessing database.
Described enquiry module returns to application system by the query requests that comes from application system that service module provides with the record in the result buffer of appointment.
Described overtime detection module is used to check the state of each operation, result's buffering and processing module, by the out-of-date operation requests of deletion, stop overtime processing, discharge result's buffering of overtime existence to guarantee the robustness of system.
Information mutual between application system and the middleware system comprises:
The beginning transaction commands, application system notice middleware begins affairs.Middleware returns to application system with the transaction number of these affairs.
Services request, application system notice middleware carries out the operation of appointment by designated parameters, indicate the transaction number under this service simultaneously, the information whether middleware return result and service operations be successful identifies if buffer zone is then returned in a service of returning many records simultaneously.
Obtain the order of data in the buffer zone, application system notice middleware returns data in the buffer zone, and middleware returns to application system with data ordering after good, and pointer is moved down.Application system can be reused this order and obtain total data one by one.
Confirm transaction commands, application system confirms that all operations of these affairs all completes successfully, and revises data of database.
The cancellation transaction commands, application system is cancelled these affairs operations, and the reduction of data in the database is the state when beginning to operate.
Should be pointed out that the present invention could realize under designated environment, above-mentioned example should not be construed as certain restriction of the present invention.
This shows that behind use the present invention, do not need to relate to the realization details of database manipulation in the realization of application system, the operation of all database sections is finished by middleware fully, thereby realizes the isolation between application system and the DBMS.When carrying out the transplanting of DBMS, needs only need revise the middleware part, the test specification after reducing greatly to transplant (being limited in the middleware scope), thus reduce the transplanting expense, accelerate transplanting speed.
In the development phase of application system, use said method the realization details of database manipulation part can be encapsulated in the middleware system, application system only need propose data dictionary and operation requirement, by middleware is optimized and develops, can generate code with higher stability and greater efficiency.Application system on stream, only need the definition and the definition of data dictionary and service are revised, thereby avoided because a certain application system is not considered the use of other application systems to database when directly revising database structure, thereby the chaotic situation that causes many other application systems normally not move has improved development efficient.

Claims (6)

  1. The device of 1 one kinds of accessing databases, comprise application system and data base management system (DBMS) DBMS, it is characterized in that, also comprise a middleware between application system and data base management system (DBMS) DBMS, described application system adopts the mode of data, services to visit described middleware, carries out the conversion work of data, services and the actual access of database of finishing by described middleware, the data that obtain are put in order, and the result who forms common version returns to application system.
  2. The device of 2 a kind of accessing databases as claimed in claim 1 is characterized in that, described middleware comprises service module, scheduler module, processing module, outcome record enquiry module and overtime detection module;
    Described service module is used to receive various command, and it is distributed to scheduler module and enquiry module;
    Described scheduler module is used to manage the duty of each processing module and according to its idle condition concrete operational order is delivered processing module and carry out;
    Described processing module is used for the analysis operation order and is translated into actual database manipulation, carries out these operations and the result is write result buffer or directly returns to application system.Processing module is a plurality of to have, to satisfy the demand of concurrent accessing database;
    Described enquiry module returns to application system by the query requests that comes from application system that service module provides with the record in the result buffer of appointment;
    Described overtime detection module is used to check the state of each operation, result's buffering and processing module, by the out-of-date operation requests of deletion, stop overtime processing, discharge result's buffering of overtime existence to guarantee the robustness of system.
  3. The device of 3 a kind of accessing databases as claimed in claim 1 or 2 is characterized in that, application system uses the interface form of service to comprise the interface of general or special purpose API form, or through the interface of the class form of secondary encapsulation.
  4. The device of 4 a kind of accessing databases as claimed in claim 1 is characterized in that, all functions of described service module, scheduler module, processing module, outcome record enquiry module and overtime detection module can be combined becomes a module.
  5. 5 one kinds of data bank access methods may further comprise the steps:
    1) judges whether the desired data access of application system is the transactional operation, if enter step 2)
    If not, then directly enter step 3);
    2) application system is sent transaction commands of beginning to middleware, and middleware returns one to application system
    Transaction Identifier;
    3) application system is sent a services request to middleware;
    4) middleware is translated services request, and data base management system DBMS is operated, and obtains
    Get the result;
    5) if the result has only a record, middleware is organized into canonical form with the result and returns to application system,
    Enter step 8);
    6) result has many records, and middleware writes result buffer with the result, and the buffer zone sign is returned
    Give application system, carry out corresponding operating by application system;
    7) application system is sent the order that discharges result buffer to middleware;
    8) then complete successfully if not the affairs type operation;
    9) affairs type operation, if the services request failure, application system is cancelled whole affairs to middleware, moves back
    Go out processing procedure;
    10) if continue services request, then repeating step 3, until finishing whole affairs;
    11) all services all complete successfully, and application system confirms that to middleware whole affairs finish.
  6. 6 a kind of data bank access methods as claimed in claim 5 is characterized in that, carry out corresponding operating by application system in the described step 6) and comprise:
    1) sends to middleware with system and get result command;
    2) middleware returns an outcome record to application system;
    3) repeating step 2), stop to fetch data until having got data or application system.
CN 00125888 2000-10-28 2000-10-28 Method and device for accessing database Pending CN1351299A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 00125888 CN1351299A (en) 2000-10-28 2000-10-28 Method and device for accessing database

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 00125888 CN1351299A (en) 2000-10-28 2000-10-28 Method and device for accessing database

Publications (1)

Publication Number Publication Date
CN1351299A true CN1351299A (en) 2002-05-29

Family

ID=4591670

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 00125888 Pending CN1351299A (en) 2000-10-28 2000-10-28 Method and device for accessing database

Country Status (1)

Country Link
CN (1) CN1351299A (en)

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100337235C (en) * 2003-06-23 2007-09-12 华为技术有限公司 Method and apparatus for accessing database
CN100375464C (en) * 2004-09-29 2008-03-12 上海宝信软件股份有限公司 Method for data communication of every terminal when network interconnecting
CN101478437A (en) * 2009-01-13 2009-07-08 深圳市同洲电子股份有限公司 Network resource management method, system and network management server
CN101558405B (en) * 2006-10-17 2011-04-13 三星Sds株式会社 Migration apparatus which convert database of mainframe system into database of open system and method for thereof
CN102760155A (en) * 2012-05-30 2012-10-31 中兴通讯股份有限公司 Database-based transaction control method and device
CN101840348B (en) * 2009-12-24 2013-02-20 陕西移数通电讯有限公司 Database middleware system
CN103425793A (en) * 2013-08-28 2013-12-04 五八同城信息技术有限公司 Method for accessing database by means of database storage layer used in instant communication system
CN103744896A (en) * 2013-12-24 2014-04-23 乐视网信息技术(北京)股份有限公司 Method and device for data processing
CN104040569A (en) * 2011-08-23 2014-09-10 法律研究室控股有限公司 Collaboration computer system
CN104375995A (en) * 2013-08-13 2015-02-25 苏州广海信息科技有限公司 Database management system
CN105205060A (en) * 2014-06-12 2015-12-30 中兴通讯股份有限公司 Method and device for generating word document database dictionary
CN105786998A (en) * 2016-02-19 2016-07-20 创元网络技术股份有限公司 Database middleware system and method for processing data through database middleware system

Cited By (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100337235C (en) * 2003-06-23 2007-09-12 华为技术有限公司 Method and apparatus for accessing database
CN100375464C (en) * 2004-09-29 2008-03-12 上海宝信软件股份有限公司 Method for data communication of every terminal when network interconnecting
CN101558405B (en) * 2006-10-17 2011-04-13 三星Sds株式会社 Migration apparatus which convert database of mainframe system into database of open system and method for thereof
CN101478437A (en) * 2009-01-13 2009-07-08 深圳市同洲电子股份有限公司 Network resource management method, system and network management server
CN101840348B (en) * 2009-12-24 2013-02-20 陕西移数通电讯有限公司 Database middleware system
CN104040569A (en) * 2011-08-23 2014-09-10 法律研究室控股有限公司 Collaboration computer system
US11042514B2 (en) 2011-08-23 2021-06-22 Graeme Perkins Collaboration computer system
CN104040569B (en) * 2011-08-23 2018-08-28 伦德尔控股有限公司 Collaboration computing machine system
CN102760155A (en) * 2012-05-30 2012-10-31 中兴通讯股份有限公司 Database-based transaction control method and device
CN102760155B (en) * 2012-05-30 2018-02-13 中兴通讯股份有限公司 A kind of transaction control method and device based on database
CN104375995A (en) * 2013-08-13 2015-02-25 苏州广海信息科技有限公司 Database management system
CN103425793B (en) * 2013-08-28 2017-03-01 五八同城信息技术有限公司 Method for utilizing database purchase layer to access data base in instant communicating system
CN103425793A (en) * 2013-08-28 2013-12-04 五八同城信息技术有限公司 Method for accessing database by means of database storage layer used in instant communication system
CN103744896A (en) * 2013-12-24 2014-04-23 乐视网信息技术(北京)股份有限公司 Method and device for data processing
CN105205060A (en) * 2014-06-12 2015-12-30 中兴通讯股份有限公司 Method and device for generating word document database dictionary
CN105786998A (en) * 2016-02-19 2016-07-20 创元网络技术股份有限公司 Database middleware system and method for processing data through database middleware system
CN105786998B (en) * 2016-02-19 2019-02-26 创元网络技术股份有限公司 Database middleware system and the method for handling data using it

Similar Documents

Publication Publication Date Title
CN105793843B (en) The bind lines and column for memory database for OLTP and analysis workload stores
CN1146820C (en) Dynamic modification of database management system
CN100353325C (en) Method for realing sharing internal stored data base and internal stored data base system
EP2443564B1 (en) Data compression for reducing storage requirements in a database system
CN100345143C (en) Method and apparatus for data processing
CN103460208A (en) Methods and systems for loading data into a temporal data warehouse
CN105164674A (en) Queries involving multiple databases and execution engines
CN1351299A (en) Method and device for accessing database
CN1526107A (en) Integrating tablespaces with different block sizes
CN101046821A (en) Generic database manipulator
CN104412241A (en) Memory compaction mechanism for main memory databases
WO2000007120A1 (en) Object to relational database mapping infrastructure in a customer care and billing system
CN1545252A (en) A method for implementing foreground data configuration in network management system
CN1881208A (en) Construction method for dynamic structured query language statement
CN1928873A (en) System and method for database access for implementing load sharing
CN1731364A (en) Method for compression and search of database backup data
US6941309B2 (en) Object integrated management system
CN1933462A (en) A mobile middleware and a method for processing business logic using it
CN1510575A (en) High-efficient administration method for database connection
US20220197885A1 (en) Hybrid shadow paging for storing a database
CN111651758B (en) Method for auditing result set of relational database of operation and maintenance auditing system
CN1791873A (en) Undrop objects and dependent objects in a database system
CN1652111A (en) Method for implementing realtime database routine operation
CN1877573A (en) Multilayer database system structure
CN109800233A (en) A kind of big data fusion searching method

Legal Events

Date Code Title Description
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C06 Publication
PB01 Publication
C02 Deemed withdrawal of patent application after publication (patent law 2001)
WD01 Invention patent application deemed withdrawn after publication