CN109582662A - A kind of dynamic database building method in Management System Data library - Google Patents

A kind of dynamic database building method in Management System Data library Download PDF

Info

Publication number
CN109582662A
CN109582662A CN201811259286.XA CN201811259286A CN109582662A CN 109582662 A CN109582662 A CN 109582662A CN 201811259286 A CN201811259286 A CN 201811259286A CN 109582662 A CN109582662 A CN 109582662A
Authority
CN
China
Prior art keywords
database
data
node
xml
management system
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.)
Withdrawn
Application number
CN201811259286.XA
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.)
Xi'an Juzheng Intellectual Property Management Co Ltd
Original Assignee
Xi'an Juzheng Intellectual Property Management 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 Xi'an Juzheng Intellectual Property Management Co Ltd filed Critical Xi'an Juzheng Intellectual Property Management Co Ltd
Priority to CN201811259286.XA priority Critical patent/CN109582662A/en
Publication of CN109582662A publication Critical patent/CN109582662A/en
Withdrawn legal-status Critical Current

Links

Landscapes

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

Abstract

The present invention provides a kind of dynamic database building methods in Management System Data library.Mainly using the dynamic memory of database as carrier, it is proposed that completely new Database Dynamic builds the solution in library, by the application-oriented field to management system development of big data, the user interface of close friend, powerful Database Modeling ability, the engineering data base is packaged database modeling technique, dynamic database building does not need artificial participation, to also avoid occurring a possibility that mistake in artificial modeling process;Since the system has the characteristics that the database model that can dynamically establish, to realize versatility of the database between different management systems, the opening of system is realized.

Description

A kind of dynamic database building method in Management System Data library
Technical field
The invention belongs to database development technical fields, and in particular to a kind of dynamic database building side in Management System Data library Method.
Background technique
As many enterprises, manufacturer are when being dedicated to research and development, the application of patent also all can be cautiously assessed and proposed, closely Apply within several years the patent number of packages being approved also in the trend to increase substantially, especially some large enterprises add up application every year and obtain Quasi- case also all nearly thousand, the invention data of hundreds of for these, dry meter and subsequent upkeep operation, if still adopting With traditional artificial management, not only spacious day is time-consuming and easy error, therefore is badly in need of a kind of systematic way to manage really at present, keeps away Exempt to increase sharply because of data the artificial careless mistake and mismanagement of generation.
There are two types of the method that people use at present is usual: first, when establishing database model, what is be likely to occur Variation is included in wherein, then establishes a very large database, although this technology can satisfy expansion backward Demand, but it results in the waste of data redundancy and memory space;Second, it is artificial to enter when data model changes Background data base platform modifying database structure, then modifies corresponding database development code, this technology there are the problem of It is to bring very big difficulty to the maintenance of database, and increase the probability for artificially leading to mistake.
Summary of the invention
The object of the present invention is to provide a kind of dynamic database building method in Management System Data library, solve meet database to The demand of expansion afterwards, while the waste of database data redundancy and memory space is avoided, improve the maintenance of database.
A kind of dynamic database building method in Management System Data library of the present invention, it is characterised in that: the method successively includes XML The generation of tree, the generation of data model, database three steps of generation;First pass through define mapping ruler, write XML template, Load XML template generation XML tree;Then required information is parsed using DOM from XML tree, converts thereof into journey The data structure that sequence can identify, is placed in Array for structural body;Connect background database manager system, retrieve and from storage parameter In the Array for structural body of information take out required for information, write modeling needed for SQL statement and parameter information include wherein, SQL statement is submitted and executed, establishes corresponding database from the background, and compress to the data in database.
Mapping ruler is defined in the generation step of XML tree, is predominantly defined a root node, is marked with DATA, number A child node according to library name as DATA, is marked, node content is database-name with DATABASE;Each data A subtree of the table as DATA, is marked with TABLE, and is inserted into a child node for it, is marked with TABLENAME, is saved Point content is the title of table;Using each row record in table as a subtree of corresponding TABLE, is marked with VAR, every is remembered Child node of the required field of record as VAR, and marked with corresponding field name, node content is right for each field The record value answered.
In the generation step of XML tree, the child node that each subsystem node of XML tree includes mainly has the sequence of the subsystem Number, the subsystem floating type, integer, the child node of the character type sum that are included, all variable nodes, Mei Gebian under the system Depending on the amount node content that includes is needed according to system, generally comprise variable name, types of variables, corresponding reflective memory address, Physical significance.
It is to define an Array for structural body according to the structure of XML tree to be used to store parsing in the generation step of data model Obtained data load entire XML tree, and finally circulation takes out the node in XML tree comprising information needed and nodal information is turned The data for being changed to structural body type are placed in Array for structural body.
Required information is parsed from XML tree using DOM, whole XML tree can both be parsed completely, it can also Only to parse the node in XML tree including user's information needed, depending on information needed for modeling.
XML file realizes conversion and the data model of a variety of data formats as intermediary in entire Database Generation, when information changes, the structure for the database model established also changes therewith, and database can be with The change of data model and change, realize the dynamic generation of database.
When data base management system is in the swapping data of internal memory cache region and disk file, data block is pressed Contracting/decompression.
Compression/decompression processes are carried out to journal file or other files.
Compared with the prior art, the invention has the following advantages and beneficial effects:
(1) friendly user interface: user can operate database by user interface, not need profession Database knowledge;
(2) powerful Database Modeling ability: the database is various numbers in conjunction with XML technology towards all management systems A unified Database Modeling interface is provided according to model, realizes the unified Modeling of all databases;
(3) dynamic database building: the engineering data base is packaged database modeling technique, dynamic database building, does not need artificial Participation, thus also avoid in artificial modeling process occur mistake a possibility that;
(4) good systemic openness: since the system has the characteristics that the database model that can dynamically establish, thus real Show versatility of the database between different management systems, realizes the opening of system.
Specific embodiment
The present invention is described in detail With reference to embodiment.
The dynamic database building method in a kind of Management System Data of the invention library, it is characterised in that: the method is successively wrapped Include three generation of XML tree, the generation of data model, the generation of database steps;It first passes through and defines mapping ruler, writes XML Template, load XML template generation XML tree;Then required information is parsed using DOM from XML tree, is converted At the data structure that program can identify, it is placed in Array for structural body;Background database manager system is connected, is retrieved and from storage Information required for taking out in the Array for structural body of parameter information writes the required SQL statement of modeling and includes parameter information Wherein, SQL statement is submitted and executed, establishes corresponding database from the background, and compress to the data in database.
Mapping ruler is defined in the generation step of XML tree, is predominantly defined a root node, is marked with DATA, number A child node according to library name as DATA, is marked, node content is database-name with DATABASE;Each data A subtree of the table as DATA, is marked with TABLE, and is inserted into a child node for it, is marked with TABLENAME, is saved Point content is the title of table;Using each row record in table as a subtree of corresponding TABLE, is marked with VAR, every is remembered Child node of the required field of record as VAR, and marked with corresponding field name, node content is right for each field The record value answered.
In the generation step of XML tree, the child node that each subsystem node of XML tree includes mainly has the sequence of the subsystem Number, the subsystem floating type, integer, the child node of the character type sum that are included, all variable nodes, Mei Gebian under the system Depending on the amount node content that includes is needed according to system, generally comprise variable name, types of variables, corresponding reflective memory address, Physical significance.
It is to define an Array for structural body according to the structure of XML tree to be used to store parsing in the generation step of data model Obtained data load entire XML tree, and finally circulation takes out the node in XML tree comprising information needed and nodal information is turned The data for being changed to structural body type are placed in Array for structural body.
Required information is parsed from XML tree using DOM, whole XML tree can both be parsed completely, it can also Only to parse the node in XML tree including user's information needed, depending on information needed for modeling.
XML file realizes conversion and the data model of a variety of data formats as intermediary in entire Database Generation, when information changes, the structure for the database model established also changes therewith, and database can be with The change of data model and change, realize the dynamic generation of database.
When data base management system is in the swapping data of internal memory cache region and disk file, data block is pressed Contracting/decompression.
Compression/decompression processes are carried out to journal file or other files.
The design principle of XML technology and database dynamic database building technology in database dynamic modeling is said first It is bright.
XML (eXtensible Markup Language, extensible markup language) is a set of rule for defining semantic marker Then, it is a kind of symbol to grow up on the basis of HTML (Hypertext Markup Language, text mark up language) Labelled notation language, as HTML, XML is also from standard generalized markup language SGML (Standard Generalized Markup Language) the simplification format that is derived, the purpose is to allow data description to have the standard of a simple possible, But it breaches the constraint of the fixation mark set of HTML, user, which can according to need, defines various labels to describe in document Data element.
In order to meet the needs of Database Dynamic builds library, designed system allows for saving the emulation letter of user's typing Model is ceased, and it is transferred in the module for establishing database model, to realize according to the data of user's typing in rear number of units According to the function of carrying out dynamic database building in library;Whole system is designed to external schema, internal schema, generates mode Three models, each Kind mode completes different tasks towards different objects;
External schema user oriented, allows user to carry out various operations to database model parameter, which can pass through volume The mode for writing user interface code is realized;Internal schema system-oriented, for saving parameter information and the progress of user's typing Data Format Transform generates the intermediate form file convenient for transmission and data sharing, and intermediate form the file information is converted to Data type needed for background data base;Generation mode executes dynamic and establishes database model towards background database manager system SQL (Structure Query Language, structured query language) sentence, realize the foundation of database model.In order to The needs of when meeting data conversion to data retrieval speed, the structural body for saving data use tree in definition, wherein Root node of the database as tree, each subtree of each table as root node in database, each field in table Each leaf node of the information as tree can be somebody's turn to do when the certain field information to some table is inquired by retrieval Logical address of the field in Array for structural body is completed, and field address can be calculated by following formula:
Fij=T1+T2+...+Ti-1+(j-1)×B+S(1.1)
Wherein FijRepresent logical address corresponding to j-th of field in i-th of table, TiRepresent i-th of table information institute The storage size accounted for, B represent the space size that each field in table i is distributed, and S represents the starting of the Array for structural body Address.
The generation and parsing of intermediate form file use XML technology to be realized, the DOM (Document in XML technology Object Model, DOM Document Object Model) it can allow for developer's random access XML tree node and can be carried out adding for node Add, modify and deletes, the intermediary by using XML file as transmission data, the Database Modeling that user is saved Information generates XML file, and the parameter information from arbitrary source is converted to XML format to realize, then passes through solution again Analysis XML file obtains required Database Modeling information, finally carries out the foundation of database model.
The generation of the XML tree in dynamic database building technology of the present invention is described in detail combined with specific embodiments below.
These database model information are converted by database model information of user's typing from arbitrary source, system It for XML file format and saves, these information are inserted into whole XML tree as subtree or node, and circular insertion is all The XML file is saved after subtree and node;Step has
(1) mapping ruler design is defined from structured data to the mapping ruler of XML format data, mainly comprising following several A aspect: a root node is defined, is marked with DATA;Database name is referred to as a child node of DATA, used DATABASE marks, and node content is database-name;Using each tables of data as a subtree of DATA, made with TABLE Label, and it is inserted into a child node for it, it is marked with TABLENAME, node content is the title of table;Each row in table A subtree as corresponding TABLE is recorded, is marked with VAR;The required field that every is recorded is as the son section of VAR Point, and marked with corresponding field name, node content is record value corresponding to each field.
(2) corresponding XML template is write out according to mapping ruler
(3) XML template is loaded, required node data is taken from record set, using data as corresponding subtree and node Circular insertion is into template tree, until all data loadeds.
The definition of mapping ruler can be changed according to the form of tree, when rule definition changes, it is only necessary to repair Change corresponding XML template, the XML file of different expression-forms can be generated, enhances the flexible of XML file form generated Property.
DOM document and element variable are defined first, are loaded XML template, are then judged whether subsystem serial number is maximum, in this way The generation for then saving XML file tree terminates;It if not being to load subsystem node, sees whether the system has record, does not remember such as Record, which then returns, judges the whether maximum step of subsystem serial number, then takes subsystem variable to deposit as subsystem corresponding node if any record Enter XML tree, judges the whether maximum step of subsystem serial number until record takes object for appreciation to return, until final judgement is, XML tree generates knot Beam.
The child node that wherein each subsystem node of XML tree includes mainly has the serial number of the subsystem, subsystem to be wrapped The floating type that contains, integer, the child node of character type sum, all variable nodes, each variable node include under the system Depending on content is needed according to system, variable name, types of variables, corresponding reflective memory address, physical significance etc. are generally comprised Deng.
Required information is parsed using DOM from XML tree first, converts thereof into the number that program can identify According to structure, to provide required parameter information to establish database model;During parsing, whole can both be set Complete solution analysis, can also only parse in XML tree include user's information needed node, this can according to modeling needed for information and It is fixed;Specific algorithm are as follows:
(1) structure set defines an Array for structural body and is used to store the data that parsing obtains;(2) entire XML number is loaded According to model tree;(3) circulation takes out the node in XML tree comprising information needed and nodal information taking-up is converted to structural body type Data be placed in Array for structural body.
DOM document and element variable are defined first, are loaded XML tree, are then judged whether subsystem serial number is maximum, in this way then Terminate;As not being to calculate subsystem node sum, subsystem node insert structure body array corresponding position is taken, then judge to save Whether points are maximum, return judge the whether maximum step of subsystem serial number in this way, take subsystem node step if not being to return to, It circuits sequentially until terminating.
Simulation object data are established in background data base according to the parsing obtained simulation object model information of XML file Library type, the database model are the base tables of database, it defines the structure of simulation architecture tables of data, all database word bank tables All it will inherit and derive from from the base table;Database Dynamic generating algorithm is as follows:
(1) background database manager system is connected;
(2) using the technology of trie tree information required for being taken out in the Array for structural body of storage parameter information;
(3) it writes the required SQL statement of modeling and includes wherein parameter information;
(4) it submits and executes SQL statement, establish corresponding database from the background.
Start and connect background data base, judge whether there is base table in background data base, if any then deleting, does not read then Model information creates SQL statement, submits and execute SQL statement, establish corresponding database from the background.In entire Database XML file realizes the conversion of a variety of data formats and the generation of data model as intermediary, eliminates to data source Limitation, when being changed with simulation object model information, the information of database model also occurs accordingly to change, the database established The structure of model also changes therewith, and database can change with the change of simulation object data model, reduces people Work establishes a series of problems present in database model, realizes the dynamic generation of database, so that database can be by Multiple emulation platforms are shared.

Claims (8)

1. a kind of dynamic database building method in Management System Data library, it is characterised in that: the method successively includes the life of XML tree At, three generation of data model, the generation of database steps;It first passes through and defines mapping ruler, writes XML template, load XML Template generation XML tree;Then required information is parsed from XML tree using DOM, converting thereof into program can know Other data structure, is placed in Array for structural body;Connect background database manager system, retrieve and from storage parameter information knot Information required for taking out in structure body array writes the required SQL statement of modeling and includes wherein, to submit and hold parameter information Row SQL statement is established corresponding database from the background, and is compressed to the data in database.
2. a kind of dynamic database building method in Management System Data library as described in claim 1, it is characterised in that: the XML tree Generation step in define mapping ruler, predominantly define a root node, marked with DATA, database name be referred to as A child node of DATA, is marked, node content is database-name with DATABASE;Using each tables of data as DATA's One subtree, is marked with TABLE, and is inserted into a child node for it, is marked with TABLENAME, and node content is table Title;It using each row record in table as a subtree of corresponding TABLE, is marked with VAR, required for every record Child node of the field as VAR, and marked with corresponding field name, node content is record value corresponding to each field.
3. a kind of dynamic database building method in Management System Data library as described in claim 1, it is characterised in that: the XML tree Generation step in, the child node that each subsystem node of XML tree includes mainly has the serial number of the subsystem, subsystem to be wrapped The floating type that contains, integer, the child node of character type sum, all variable nodes, each variable node include under the system Depending on content is needed according to system, variable name, types of variables, corresponding reflective memory address, physical significance are generally comprised.
4. a kind of dynamic database building method in Management System Data library as described in claim 1, it is characterised in that: the data mould It is to define an Array for structural body according to the structure of XML tree to be used to store the data that parsing obtains in the generation step of type, load Entire XML tree, finally circulation takes out the node in XML tree comprising information needed and nodal information is converted to structural body type Data are placed in Array for structural body.
5. a kind of dynamic database building method in Management System Data library as described in claim 1, it is characterised in that: the use DOM parses required information from XML tree, whole XML tree can both be parsed completely, and can also only parsed It include the node of user's information needed in XML tree, depending on information needed for modeling.
6. a kind of dynamic database building method in Management System Data library as claimed in any one of claims 1 to 5, wherein, feature exist In:
XML file realizes the conversion of a variety of data formats and the life of data model as intermediary in entire Database At when information changes, the structure for the database model established also changes therewith, and database can be with data The change of model and change, realize the dynamic generation of database.
7. a kind of dynamic database building method in Management System Data library as described in claim 1, it is characterised in that: described to work as data Base management system carries out compression/decompression processes in the swapping data of internal memory cache region and disk file, to data block.
8. a kind of dynamic database building method in Management System Data library as described in claim 1, to journal file or other files Carry out compression/decompression processes.
CN201811259286.XA 2018-10-26 2018-10-26 A kind of dynamic database building method in Management System Data library Withdrawn CN109582662A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811259286.XA CN109582662A (en) 2018-10-26 2018-10-26 A kind of dynamic database building method in Management System Data library

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811259286.XA CN109582662A (en) 2018-10-26 2018-10-26 A kind of dynamic database building method in Management System Data library

Publications (1)

Publication Number Publication Date
CN109582662A true CN109582662A (en) 2019-04-05

Family

ID=65921003

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811259286.XA Withdrawn CN109582662A (en) 2018-10-26 2018-10-26 A kind of dynamic database building method in Management System Data library

Country Status (1)

Country Link
CN (1) CN109582662A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110866029A (en) * 2019-10-11 2020-03-06 支付宝(杭州)信息技术有限公司 sql statement construction method, device, server and readable storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110866029A (en) * 2019-10-11 2020-03-06 支付宝(杭州)信息技术有限公司 sql statement construction method, device, server and readable storage medium
CN110866029B (en) * 2019-10-11 2022-08-09 支付宝(杭州)信息技术有限公司 sql statement construction method, device, server and readable storage medium

Similar Documents

Publication Publication Date Title
Balmin et al. Incremental validation of XML documents
Bernstein et al. Industrial-strength schema matching
Demuth et al. OCL as a specification language for business rules in database applications
US7493335B2 (en) Object process graph relational database interface
US8959122B2 (en) Data processing device
CN110109940A (en) By the figure traversal language conversion of functional expression at the structured query language of extension
US20080172408A1 (en) Converting Recursive Hierarchical Data to Relational Data
US20090327255A1 (en) View matching of materialized xml views
CN103226478A (en) Method for automatically generating and using code
CN102982095B (en) A kind of body automatic creation system based on thesaurus and method thereof
Lanzelotte et al. Optimization of nonrecursive queries in OODBs
CN101901265A (en) Objectification management system of virtual test data
CN115840589A (en) Publishing method supporting heterogeneous distributed database
CN114115839A (en) ORM code processing method and device, electronic equipment and readable storage medium
CN109582662A (en) A kind of dynamic database building method in Management System Data library
US20080010632A1 (en) Processing large sized relationship-specifying markup language documents
CN101504660A (en) Query management method and system of pure extensible markup language database
Lamersdorf Recursive data models for non-conventional database applications
CN103246649A (en) Dynamic database building method
Chillón et al. A Taxonomy of Schema Changes for NoSQL Databases
Klaib et al. A New Approach for Labelling XML Data
Grün Pushing XML Main Memory Databases to their Limits.
Xie et al. Approximate top-k structural similarity search over XML documents
Mordinyi et al. Semantic data integration: Tools and architectures
Srai et al. MDA approach for generating the PSM model for the NoSQL key-value database, application on Redis

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
WW01 Invention patent application withdrawn after publication

Application publication date: 20190405

WW01 Invention patent application withdrawn after publication