CN101221561A - Data base script generalization implementing system and method - Google Patents

Data base script generalization implementing system and method Download PDF

Info

Publication number
CN101221561A
CN101221561A CNA2007100009167A CN200710000916A CN101221561A CN 101221561 A CN101221561 A CN 101221561A CN A2007100009167 A CNA2007100009167 A CN A2007100009167A CN 200710000916 A CN200710000916 A CN 200710000916A CN 101221561 A CN101221561 A CN 101221561A
Authority
CN
China
Prior art keywords
script
database
grammer
grammatical
sgml
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
CNA2007100009167A
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 CNA2007100009167A priority Critical patent/CN101221561A/en
Publication of CN101221561A publication Critical patent/CN101221561A/en
Pending legal-status Critical Current

Links

Images

Landscapes

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

Abstract

The utility model provides a database script generalization realization system and a database script generalization realization method. The system comprises: a database script analyzer used to make grammatical analysis to at least one kind of special database script; a markup language forming device used to form a markup language according to the result of the grammatical analysis; and a script analytical device used to respectively analyze the database script compiled by using the markup language into at least one database script special for database systems according to the type and the markup language of at least one database system. The markup language of the invention is simple and clear; the database script compiled by using the markup language is easy to understand, achieves the effect of supporting a plurality of database systems by only compiling a script, has good extensibility (the extension can simply be made by adding markups and markup interpretation algorithms), decreases the development cost, saves the maintenance time, and improves the development efficiency.

Description

Data base script generalization is realized system and method
Technical field
The present invention relates to the Computer Database field, relate in particular to a kind of data base script generalization and realize system and method.
Background technology
The present invention relates to the computer database system field, especially support the computer application system field of several data storehouse system, it provides a kind of to write and safeguard the method that a sets of data storehouse script is but supported several data storehouse system simultaneously.
Develop a sets of data storehouse application software system, at first will select a kind of Database Systems, such as ORACLE, SQLSERVER or the like, then by write data storehouse script definition one cover application data base.Under different situations, environment, one cover application software need be supported several data storehouse system, and the script grammer of every kind of Database Systems is different, and is especially widely different for the grammer of storing process, trigger, determined database script can only depend on concrete Database Systems thus.The computer nowadays field is supported several data storehouse system to mean to finish and is write multiple private database script.
For the mainframe computer applications software systems of supporting several data storehouse system, write and safeguard the costly of a sets of data storehouse script, can expect, write simultaneously and safeguard that many covers database script cost not of the same race is very large.
So hope can provide a kind of to write a database script but can be used for the method for polytype database.
Summary of the invention
At above one or more problems, the invention provides a kind of data base script generalization and realize system and method, can only write and safeguard that a sets of data storehouse script lacks support several data storehouse, reduce cost of development and saved maintenance time, improve development efficiency.
Data base script generalization realization of the present invention system comprises: the database script analytical equipment is used for the private database script of at least a type is carried out grammatical analysis; SGML forms device, is used for according to the grammatical analysis result, forms SGML; And the script resolver, be used for the database script of usage flag language compilation being resolved to respectively the database script of at least a Database Systems special use according to the type and token language of at least a Database Systems.
Above-mentioned database script analytical equipment comprises: parsing unit, be used for grammer according to the database script analytical database script of at least a type, and enumerate all grammers and indicate the attribute that every kind of grammer is relevant according to the database kind; And grammatical markers unit, being used for grammatical markers grammatical function is identical and that the grammer association attributes is identical is the category-A grammer, grammatical markers grammatical function is identical and that the grammer association attributes is different is the category-B grammer, and the grammatical markers that grammatical function is different is a C class grammer.
Above-mentioned SGML forms device and forms grammatical markers and flag attribute to form SGML according to the grammer of classification and grammer association attributes, and wherein, every kind of grammer is corresponding to a group echo and flag attribute.
Above-mentioned script resolver comprises: database script is preserved the unit, is used to store the database script of writing with SGML; Extraction unit is used for extracting the grammatical markers and the flag attribute value of the database script of writing with SGML, and with grammatical markers and flag attribute to being mapped to corresponding grammatical markers structure chained list; And the script resolution unit, be used for grammatical markers, to generate the database script of at least a types of database special use according to the syntax parsing grammatical markers structure chained list of at least a types of database.
Data base script generalization implementation method of the present invention may further comprise the steps: step S202, carry out grammatical analysis by the database script analytical equipment to the private database script of at least a type; Step S204 forms device according to the grammatical analysis result by SGML and forms SGML; And step S206, according to the type and token language of at least a Database Systems, the database script of usage flag language compilation is resolved to the database script of at least a Database Systems special use respectively by the script resolver.
Above-mentioned step S202 comprises: step S202-2, according to the grammer of the database script analytical database script of at least a type, enumerate all grammers and indicate the attribute that every kind of grammer is relevant according to the database kind; And step S202-4, grammatical markers grammatical function is identical and that the grammer association attributes is identical is the category-A grammer, and grammatical markers grammatical function is identical and that the grammer association attributes is different is the category-B grammer, and the grammatical markers that grammatical function is different is a C class grammer.
In step S204, form grammatical markers and flag attribute to form SGML according to the grammer of classification and grammer association attributes, wherein, every kind of grammer is corresponding to a group echo and flag attribute.
Above-mentioned step S206 comprises: step S206-2 will be stored in the script resolver with the database script that SGML is write; Step S206-4 extracts grammatical markers and flag attribute value in the database script of writing with SGML by the script resolver, and with grammatical markers and flag attribute to being mapped to corresponding grammatical markers structure chained list; And step S206-6, the script resolver is according to the grammatical markers in the syntax parsing grammatical markers structure chained list of at least a types of database, to generate the database script of at least a types of database special use.
SGML of the present invention is simple and clear, the database script of usage flag language compilation is easy-to-understand, reached and only write the effect that a cover script is but supported several data storehouse system, and expandability is good, only need newly-increased mark and mark interpretation algorithms to get final product, reduce the exploitation cost, saved maintenance time, improved development efficiency.
Description of drawings
Accompanying drawing described herein is used to provide further understanding of the present invention, constitutes the application's a part, and illustrative examples of the present invention and explanation thereof are used to explain the present invention, do not constitute improper qualification of the present invention.In the accompanying drawings:
Fig. 1 is a block diagram of realizing system according to data base script generalization of the present invention;
Fig. 2 is the process flow diagram according to data base script generalization implementation method of the present invention; And
Fig. 3 is a process flow diagram of handling grammatical markers according to an embodiment of the invention.
Embodiment
Below with reference to accompanying drawing, describe the specific embodiment of the present invention in detail.
Fig. 1 is a block diagram of realizing system according to data base script generalization of the present invention.As shown in Figure 1, data base script generalization realization of the present invention system comprises: database script analytical equipment 102 is used for the private database script of at least a type is carried out grammatical analysis; SGML forms device 104, is used for according to the grammatical analysis result, forms SGML; And script resolver 106, be used for the database script of usage flag language compilation being resolved to respectively the database script of at least a Database Systems special use according to the type and token language of at least a Database Systems.
Above-mentioned database script analytical equipment 102 comprises: parsing unit 102-2, be used for grammer according to the database script analytical database script of at least a type, and enumerate all grammers and indicate the attribute that every kind of grammer is relevant according to the database kind; And grammatical markers unit 102-4, being used for grammatical markers grammatical function is identical and that the grammer association attributes is identical is the category-A grammer, grammatical markers grammatical function is identical and that the grammer association attributes is different is the category-B grammer, and the grammatical markers that grammatical function is different is a C class grammer.
Above-mentioned SGML forms device 104 and forms grammatical markers and flag attribute to form SGML according to the grammer of classification and grammer association attributes, and wherein, every kind of grammer is corresponding to a group echo and flag attribute.
Above-mentioned script resolver 106 comprises: database script is preserved unit 106-2, is used to store the database script of writing with SGML; Extraction unit 106-4 is used for extracting the grammatical markers and the flag attribute value of the database script of writing with SGML, and with grammatical markers and flag attribute to being mapped to corresponding grammatical markers structure chained list; And script resolution unit 106-6, be used for grammatical markers, to generate the database script of at least a types of database special use according to the syntax parsing grammatical markers structure chained list of at least a types of database.
Fig. 2 is the process flow diagram according to data base script generalization implementation method of the present invention.As shown in Figure 2, data base script generalization implementation method of the present invention may further comprise the steps: step S202, carry out grammatical analysis by the database script analytical equipment to the private database script of at least a type; Step S204 forms device according to the grammatical analysis result by SGML and forms SGML; And step S206, according to the type and token language of at least a Database Systems, the database script of usage flag language compilation is resolved to the database script of at least a Database Systems special use respectively by the script resolver.
Above-mentioned step S202 comprises: step S202-2, according to the grammer of the database script analytical database script of at least a type, enumerate all grammers and indicate the attribute that every kind of grammer is relevant according to the database kind; And step S202-4, grammatical markers grammatical function is identical and that the grammer association attributes is identical is the category-A grammer, and grammatical markers grammatical function is identical and that the grammer association attributes is different is the category-B grammer, and the grammatical markers that grammatical function is different is a C class grammer.
In step S204, form grammatical markers and flag attribute to form SGML according to the grammer of classification and grammer association attributes, wherein, every kind of grammer is corresponding to a group echo and flag attribute.
Above-mentioned step S206 comprises: step S206-2 will be stored in the script resolver with the database script that SGML is write; Step S206-4 extracts grammatical markers and flag attribute value in the database script of writing with SGML by the script resolver, and with grammatical markers and flag attribute to being mapped to corresponding grammatical markers structure chained list; And step S206-6, the script resolver is according to the grammatical markers in the syntax parsing grammatical markers structure chained list of at least a types of database, to generate the database script of at least a types of database special use.
Because the changes of function that current various Database Systems realize is little, the database script main contents comprise " creating table ", " establishment view ", " creating main external key ", " establishment index ", " establishment trigger ", " establishment storing process ", " additions and deletions change table record ".Different types of Database Systems script grammer is different, and especially " trigger and storing process " grammer difference is huge.
So core thinking of the present invention is to write a cover Universal Database mark script together with the Database Systems title (as: ORALCLE) that will support, passes to the backstage analysis program, generates special-purpose database script at last by this program.
Realization principle of the present invention realizes that with ODBC and JAVA API principle is the same: the standard interface user oriented, difference is realized by the backstage.
The present invention is feasible based on following condition: extract " Database Systems script grammer general character not of the same race " as prerequisite of formulating the SGML grammer; The grammer that various private database scripts are comprised is identical, and different is the grammer external expressive form; The quantity of grammar entries is denumerable (100 order of magnitude), and it is real that background program is resolved cost that these grammers spend.For Database Systems separately special grammar can formulate special marker, by the special dissection process of background program.
Put it briefly, the data base script generalization method is exactly to extract " standard database SGML grammer " according to " various Database Systems script grammer general character ", formulate special marking for the proprietary special grammar of database, use this cover SGML to write database script then, resolve script and generate the private database script according to the concrete Database Systems that will support by background program at last.The present invention can by but be not limited to software and realize.
This method implementation procedure comprises:
The first step: analyze the variety classes database script, analyze its grammer and form
The first step can comprise the following steps: again
1, forms according to its grammer of variety classes database script case study, divide, enumerate all grammers and indicate the attribute that every kind of grammer is relevant according to the database kind.
2, finding out the grammer that grammatical function is identical and the grammer association attributes is identical, is the category-A grammer with this class grammatical markers.
3, it is identical but grammer that the grammer association attributes is inequality is the category-B grammer with this class grammatical markers to find out grammatical function.
4, finding out the different grammer of grammatical function (the special-purpose grammer of Database Systems), is C class grammer with this class grammatical markers.
Second step: according to classification grammer design SGML
According to classification grammer and grammer association attributes, design grammatical markers and flag attribute, every kind of corresponding group echo of grammer and flag attribute are finished the design of all grammatical markers and flag attribute.
The 3rd step: script is resolved on the backstage
Receive parameter: Database Systems title N (for example: ORACLE), the database script content of text of usage flag language compilation
Output content: the private database script corresponding with N
Handle and to comprise the following steps: again
1, extracts the database script content of text of usage flag language compilation to core buffer.
2, extract all grammatical markers and flag attribute value according to grammatical markers, and it is mapped to corresponding grammatical markers structure chained list.
3, marks for treatment structure chained list is resolved translation to grammatical markers.To write the grammatical markers analytic method of different special uses to the disparate databases system.The incorporation of markings property value adopts methods such as replacement, splicing to finish the generation of private database script in the mark analytic method.
In order better to understand the inventive method core thinking, the grammer that " fetches data the storehouse current time in system " in the database store process is carried out indicia designs below in conjunction with Fig. 3:
Following statement is that Oracle, Sqlserver, three kinds of Database Systems of Mysql are for the different disposal of obtaining the Database Systems current time.
//oracle
Select?sysdate?into?Operate_Time?from?dual;
//sqlserver
Select?@Operate_Time=getdate()
//mysql
set?@Operate?Time=now();
After above statement analyzed, extract a grammatical attribute " VarName ": the time value variable name.
The grammatical markers that following statement is finished for design.
<<SYSTIME?VarName=/>>
Following statement is for using this grammatical markers example.
<<SYSTIME?VarName=Operate_Time />>
Fig. 3 is a process flow diagram of handling grammatical markers according to an embodiment of the invention.As shown in Figure 3, the flow process of processing grammatical markers comprises: at first read mark (S302); Judge whether to get current time mark (S304); Under the situation that does not need to read, finish, under the situation that needs read, read Varname property value (S306); Judgment data storehouse type (S308); If type of database is sqlserver, to handle according to sqlserver database mark, generation is used for sqlserver wide area information server script; If type of database is oracle, then to handle according to oracle database mark, generation is used for oracle wide area information server script; If type of database is mysql, then to handle according to mysql database mark, generation is used for mysql wide area information server script (S310).
Adopt the method for the invention, compared with prior art, SGML is simple and clear, the database script of usage flag language compilation is easy-to-understand, reached only to write the effect that a cover script is but supported several data storehouse system, and expandability is good, only need newly-increased mark and mark interpretation algorithms to get final product, reduce the exploitation cost, saved maintenance time, improved development efficiency.
The above is the preferred embodiments of the present invention only, is not limited to the present invention, and for a person skilled in the art, the present invention can have various changes and variation.Within the spirit and principles in the present invention all, any modification of being done, be equal to replacement, improvement etc., all should be included within protection scope of the present invention.

Claims (8)

1. a data base script generalization is realized system, it is characterized in that comprising:
The database script analytical equipment is used for the private database script of at least a type is carried out grammatical analysis;
SGML forms device, is used for according to described grammatical analysis result, forms SGML; And
The script resolver is used for the database script that database script that type and described SGML according at least a Database Systems will use described SGML to write resolves to described at least a Database Systems special use respectively.
2. data base script generalization according to claim 1 is realized system, it is characterized in that described database script analytical equipment comprises:
Parsing unit is used for analyzing according to the database script of described at least a type the grammer of described database script, enumerates all grammers and indicates the attribute that every kind of grammer is relevant according to the database kind; And
The grammatical markers unit, being used for grammatical markers grammatical function is identical and that the grammer association attributes is identical is the category-A grammer, and grammatical markers grammatical function is identical and that the grammer association attributes is different is the category-B grammer, and the grammatical markers that grammatical function is different is a C class grammer.
3. data base script generalization according to claim 1 is realized system, it is characterized in that, described SGML forms device and forms grammatical markers and flag attribute to form SGML according to the grammer of classification and grammer association attributes, wherein, every kind of grammer is corresponding to a group echo and flag attribute.
4. data base script generalization according to claim 1 is realized system, it is characterized in that described script resolver comprises:
Database script is preserved the unit, is used to store the database script of writing with described SGML;
Extraction unit is used for extracting the grammatical markers and the flag attribute value of the database script of writing with described SGML, and with described grammatical markers and flag attribute to being mapped to corresponding grammatical markers structure chained list; And
The script resolution unit is used for the grammatical markers according to the described grammatical markers structure of the syntax parsing of described at least a types of database chained list, to generate the database script of described at least a types of database special use.
5. a data base script generalization implementation method is characterized in that, said method comprising the steps of:
Step S202 carries out grammatical analysis by the database script analytical equipment to the private database script of at least a type;
Step S204 forms device according to described grammatical analysis result by SGML and forms SGML; And
Step S206, according to the type and the described SGML of at least a Database Systems, the database script that will use described SGML to write by the script resolver resolves to the database script of described at least a Database Systems special use respectively.
6. data base script generalization implementation method according to claim 5 is characterized in that, described step S202 comprises:
Step S202-2 analyzes the grammer of described database script according to the database script of described at least a type, enumerates all grammers and indicates the attribute that every kind of grammer is relevant according to the database kind; And
Step S202-4, grammatical markers grammatical function is identical and that the grammer association attributes is identical is the category-A grammer, and grammatical markers grammatical function is identical and that the grammer association attributes is different is the category-B grammer, and the grammatical markers that grammatical function is different is a C class grammer.
7. data base script generalization implementation method according to claim 5, it is characterized in that, in described step S204, form grammatical markers and flag attribute to form SGML according to the grammer of classification and grammer association attributes, wherein, every kind of grammer is corresponding to a group echo and flag attribute.
8. data base script generalization implementation method according to claim 5 is characterized in that, described step S206 comprises:
Step S206-2 will be stored in described script resolver with the database script that described SGML is write;
Step S206-4 extracts grammatical markers and flag attribute value in the database script of writing with described SGML by described script resolver, and with described grammatical markers and flag attribute to the grammatical markers structure chained list that is mapped to correspondence; And
Step S206-6, described script resolver is according to the grammatical markers in the described grammatical markers structure of the syntax parsing of the described at least a types of database chained list, to generate the database script of described at least a types of database special use.
CNA2007100009167A 2007-01-08 2007-01-08 Data base script generalization implementing system and method Pending CN101221561A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNA2007100009167A CN101221561A (en) 2007-01-08 2007-01-08 Data base script generalization implementing system and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNA2007100009167A CN101221561A (en) 2007-01-08 2007-01-08 Data base script generalization implementing system and method

Publications (1)

Publication Number Publication Date
CN101221561A true CN101221561A (en) 2008-07-16

Family

ID=39631407

Family Applications (1)

Application Number Title Priority Date Filing Date
CNA2007100009167A Pending CN101221561A (en) 2007-01-08 2007-01-08 Data base script generalization implementing system and method

Country Status (1)

Country Link
CN (1) CN101221561A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103902574A (en) * 2012-12-27 2014-07-02 中国移动通信集团内蒙古有限公司 Real-time data loading method and device based on data flow technology
CN106649053A (en) * 2016-12-28 2017-05-10 北京奇艺世纪科技有限公司 Task running status information acquisition method and device
CN114860314A (en) * 2022-07-06 2022-08-05 深圳华锐分布式技术股份有限公司 Deployment upgrading method, device, equipment and medium based on database compatibility

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103902574A (en) * 2012-12-27 2014-07-02 中国移动通信集团内蒙古有限公司 Real-time data loading method and device based on data flow technology
CN106649053A (en) * 2016-12-28 2017-05-10 北京奇艺世纪科技有限公司 Task running status information acquisition method and device
CN114860314A (en) * 2022-07-06 2022-08-05 深圳华锐分布式技术股份有限公司 Deployment upgrading method, device, equipment and medium based on database compatibility
CN114860314B (en) * 2022-07-06 2022-10-04 深圳华锐分布式技术股份有限公司 Deployment upgrading method, device, equipment and medium based on database compatibility

Similar Documents

Publication Publication Date Title
CN109582861A (en) A kind of data-privacy information detecting system
CN107168762B (en) Body-based RUCM (robust object model) consistency checking method
CN101751461A (en) Document conversion method and device
CN106919612A (en) A kind of processing method and processing device of SQL script of reaching the standard grade
CN108509199A (en) Method, device, equipment and storage medium for automatically generating Chinese annotations
CN102591855A (en) Data identification method and data identification system
CN103235757B (en) Several apparatus and method that input domain tested object is tested are made based on robotization
CN108664546B (en) XML data structure conversion method and device
CN104361189A (en) Method for quickly generating virtual terminal Excel table by SCD (Security Coding Device)
CN105930267A (en) Database dictionary based storage process static detection method and system
CN107688640A (en) A kind of substation secondary device drawing consults method and apparatus
CN101221561A (en) Data base script generalization implementing system and method
CN108008947B (en) Intelligent prompting method and device for programming statement, server and storage medium
CN102710833B (en) Mobile phone test case and automatic generation method thereof
CN110569243B (en) Data query method, data query plug-in and data query server
CN117632999A (en) SQL-based code conversion method, device, equipment and medium
CN109472145A (en) A kind of code reuse recognition methods and system based on graph theory
CN102521250A (en) Method for implementing universal syntactic analysis of intelligent measuring instrument
CN104704487A (en) Translation processing device and program
CN111177506A (en) Classification storage method and system based on big data
CN116303359A (en) Method for realizing multi-type document export of database structure
CN108614821B (en) Geological data interconnection and mutual-checking system
CN102141912B (en) Method and device for processing multi-class engine Widget
CN103678607A (en) Building method of emotion marking system
Mu et al. Automatic test method research on the word part of document format translator

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C12 Rejection of a patent application after its publication
RJ01 Rejection of invention patent application after publication

Open date: 20080716