CN107908739A - Dynamic syntax analytic method and its resolution system - Google Patents
Dynamic syntax analytic method and its resolution system Download PDFInfo
- Publication number
- CN107908739A CN107908739A CN201711131857.7A CN201711131857A CN107908739A CN 107908739 A CN107908739 A CN 107908739A CN 201711131857 A CN201711131857 A CN 201711131857A CN 107908739 A CN107908739 A CN 107908739A
- Authority
- CN
- China
- Prior art keywords
- database
- syntax
- keyword
- matching
- critical word
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/30—Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
- G06F16/36—Creation of semantic tools, e.g. ontology or thesauri
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/30—Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
- G06F16/33—Querying
- G06F16/3331—Query processing
- G06F16/334—Query execution
- G06F16/3344—Query execution using natural language analysis
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computational Linguistics (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Artificial Intelligence (AREA)
- Machine Translation (AREA)
Abstract
The invention discloses a kind of dynamic syntax analytic method, including obtain the syntax library data for the database for needing to carry out syntax parsing;Obtain the feature critical word of syntax library and weight is set;Obtain read statement information and obtain keyword;Keyword is matched to obtain with feature critical word and matches scoring;Computing statement information and the matching degree of each database;Choose the syntax library corresponding to database and syntax parsing is carried out to sentence information input by user.Present invention also offers the resolution system for realizing the dynamic syntax analytic method.The present invention extracts the feature critical word in the syntax library of types of databases, and obtain the keyword in the sentence information of input, both are subjected to matching so as to which comprehensive matching obtains the syntax library corresponding to final sentence information, therefore the method for the present invention enables to user to call the syntax library of polymorphic type in different databases, realize dynamic analysis and the identification of grammer, and the method for the present invention is simple and reliable.
Description
Technical field
Present invention relates particularly to a kind of dynamic syntax analytic method and its resolution system.
Background technology
With the development and the improvement of people's living standards of national economy technology, and the arriving of Internet era, data
Have become one of most important resource in the whole world.With the continuous improvement of the importance of data, data management equally also obtains
People have been arrived more and more to pay attention to., database technology ought as efficient access and the instrument of management mass data resource, status
It is right also more and more important.
At present, the species of common database is very much, including the open source software for being adapted to medium-sized and small enterprises to use
SQLServer;Performance is high and widely used ORACLE;More preferable SYBASE is showed under unix platforms;It is mainly used in data
DB2 of warehouse and online transaction etc..Moreover, with the widely available of data application and development, new database also layer
Go out not poor.
The database of each type, suffers from itself exclusive a set of data managing method;And with data managing method phase
It is corresponding, then be database self-growth come out a set of data base administration and using instrument, such as database query tools, pin
Rapid batch handling implement to data in database etc..But the structure and data managing method due to each database are not
Together, hence in so that each wide area information server management and use instrument are all different and often different general.
Each wide area information server management and the characteristic of oneself is suffered from using instrument.When the user of database makes
During with database A, if user want use database B in a certain data base administration and using instrument, but often due to
Incompatibility between database, causes this purpose not realize.
The content of the invention
It is an object of the present invention to provide a kind of can realize to call syntax library mutually between disparate databases
Dynamic syntax analytic method.
The second object of the present invention is to provide a kind of resolution system for realizing the dynamic syntax analytic method.
This dynamic syntax analytic method provided by the invention, includes the following steps:
S1. obtain institute it is in need progress syntax parsing database syntax library data;
S2. the data of the step S1 syntax libraries obtained are analyzed, so as to obtain the grammer corresponding to each database
The feature critical word in storehouse, while corresponding weighted value is set to each feature critical word;
S3. sentence information input by user is obtained;
S4. morphology and syntactic analysis are carried out to the sentence information that step S3 is obtained, so as to obtain the key in sentence information
Word;
S5. the keyword in sentence information that step S4 is obtained is matched with the feature critical word that step S2 is obtained,
Score so as to obtain the matching of the keyword in sentence information and the feature critical word corresponding to each database;
S6. scored according to the obtained matchings of step S2 weighted value and the step S5 obtained, be calculated sentence information with it is every
The matching degree of a database;
S7. the matching degree obtained according to step S6, chooses the syntax library corresponding to the best database of matching degree to user
The sentence information of input carries out syntax parsing.
Database described in step S1 includes SQLServer, ORACLE, SYBASE and DB2.
The feature critical word of acquisition syntax library described in step S2, specifically by type of database keyword syntactic model
Obtained.
Morphology and syntactic analysis are carried out to sentence information described in step S4, specially using bison to sentence information into
Row morphology and syntactic analysis.
Being matched the keyword closed in sentence information with feature critical word described in step S5 simultaneously obtains matching scoring, tool
Body is that matching scoring is matched and calculated using following rule:
R1. each keyword will be matched with feature critical word;
R2. for each keyword, it is natural number to be respectively provided with matching total score an X, X;
R3. for N number of database for needing to carry out syntax parsing, if keyword i and m feature critical word successful match,
Then the score of each feature critical word is that X/m, i and m are natural number, and m≤N.
Computing statement information and the matching degree of each database described in step S6, specially using the calculating of following formula
With degree:
Pj=a1*S1+a2*S2+…ak*Sk+…+az*Sz
P in formulajFor sentence information and the matching degree of j-th of database, j is natural number;akFor k-th of j-th of database
The weight of feature critical word;SkFor the matching score of k-th of feature critical word of j-th of database;Z is j-th of database
The number of feature critical word, k are natural number and k≤z.
Syntax library corresponding to the best database of selection matching degree described in step S7 is to sentence information input by user
Syntax parsing is carried out, syntax library is specially chosen using following rule:
If matching degree is that 0 or matching degree are equal, according to the order for the syntax library priority being previously set, choose preferential
The high syntax library of level;
If matching degree is unequal, the syntax library corresponding to the highest database of matching degree is chosen.
Present invention also offers a kind of resolution system for realizing the dynamic syntax analytic method, including database to obtain mould
Block, feature critical word obtains and weight setting module, input module, keyword acquisition module, keyword-matching module, matching degree
Computing module and output module;Database acquisition module is used to obtain the database for needing to carry out syntax parsing, and by acquisition
Database information passes to the acquisition of feature critical word and weight setting module;Feature critical word obtains and weight setting module is used for
The feature critical word information of the corresponding syntax library of each database is obtained, and is the weight amplitude of each feature critical word, at the same time
Feature critical word information and weight are uploaded into keyword-matching module;User passes through pass from input module read statement information
Key word acquisition module uploads keyword-matching module after obtaining the keyword in sentence information;Keyword-matching module is used for language
Keyword in sentence information carries out matching scoring with the feature critical word corresponding to each database, and result is uploaded matching degree
Computing module;Matching primitives module is used for matching scoring computing statement information and the matching degree of each database according to upload,
And matching result is exported by output module.
This dynamic syntax analytic method and its resolution system provided by the invention, in the syntax library of types of databases
Feature critical word is extracted, and obtains the keyword in the sentence information of input, both are carried out matching so as to comprehensive
With obtaining the syntax library corresponding to final sentence information, therefore the method for the present invention enables to user in different databases
The syntax library of polymorphic type is called, realizes dynamic analysis and the identification of grammer, and the method for the present invention is simple and reliable.
Brief description of the drawings
Fig. 1 is the method flow diagram of the method for the present invention.
Fig. 2 is the system module figure of present system.
Embodiment
It is the method flow diagram of the method for the present invention as shown in Figure 1:This dynamic syntax analytic method provided by the invention, bag
Include following steps:
S1. obtain institute it is in need progress syntax parsing database syntax library data;In the specific implementation, database bag
Include SQLServer, ORACLE, SYBASE and DB2 etc.;
S2. the data of the step S1 syntax libraries obtained are analyzed, is obtained by type of database keyword syntactic model
The feature critical word of the syntax library corresponding to each database is obtained, while corresponding weighted value is set to each feature critical word;
S3. sentence information input by user is obtained;
S4. the sentence information obtained using bison to step S3 carries out morphology and syntactic analysis, so as to obtain sentence information
In keyword;
S5. the keyword in sentence information that step S4 is obtained is matched with the feature critical word that step S2 is obtained,
Score so as to obtain the matching of the keyword in sentence information and the feature critical word corresponding to each database;Specially use
Following rule is matched and calculates matching scoring:
R1. each keyword will be matched with feature critical word;
R2. for each keyword, it is natural number to be respectively provided with matching total score an X, X;
R3. for N number of database for needing to carry out syntax parsing, if keyword i and m feature critical word successful match,
Then the score of each feature critical word is that X/m, i and m are natural number, and m≤N;
S6. scored according to the obtained matchings of step S2 weighted value and the step S5 obtained, be calculated sentence information with it is every
The matching degree of a database;Matching degree is specially calculated using following formula:
Pj=a1*S1+a2*S2+…ak*Sk+…+az*Sz
P in formulajFor sentence information and the matching degree of j-th of database, j is natural number;akFor k-th of j-th of database
The weight of feature critical word;SkFor the matching score of k-th of feature critical word of j-th of database;Z is j-th of database
The number of feature critical word, k are natural number and k≤z;
S7. the matching degree obtained according to step S6, chooses the syntax library corresponding to the best database of matching degree to user
The sentence information of input carries out syntax parsing;Syntax library is specially chosen using following rule:
If matching degree is that 0 or matching degree are equal, according to the order for the syntax library priority being previously set, choose preferential
The high syntax library of level;
If matching degree is unequal, the syntax library corresponding to the highest database of matching degree is chosen.
It is illustrated in figure 2 the system module figure of present system:The present invention also provides realize dynamic syntax parsing
The resolution system of method, including database acquisition module, feature critical word obtains and weight setting module, input module, key
Word acquisition module, keyword-matching module, matching degree computing module and output module;Database acquisition module, which is used to obtain, to be needed
The database of syntax parsing is carried out, and the database information of acquisition is passed into the acquisition of feature critical word and weight setting module;
The acquisition of feature critical word and weight setting module are used for the feature critical word information for obtaining the corresponding syntax library of each database, and
For the weight amplitude of each feature critical word, while feature critical word information and weight are uploaded into keyword-matching module;User
From input module read statement information, and keyword is uploaded after obtaining the keyword in sentence information by keyword acquisition module
Matching module;Keyword-matching module is used for the feature critical word corresponding to by the keyword in sentence information and each database
Matching scoring is carried out, and result is uploaded into matching degree computing module;Matching primitives module is based on according to the matching of upload scoring
Sentence information and the matching degree of each database are calculated, and matching result is exported by output module.
Claims (8)
1. a kind of dynamic syntax analytic method, includes the following steps:
S1. obtain institute it is in need progress syntax parsing database syntax library data;
S2. the data of the step S1 syntax libraries obtained are analyzed, so as to obtain the syntax library corresponding to each database
Feature critical word, while corresponding weighted value is set to each feature critical word;
S3. sentence information input by user is obtained;
S4. morphology and syntactic analysis are carried out to the sentence information that step S3 is obtained, so as to obtain the keyword in sentence information;
S5. the keyword in sentence information that step S4 is obtained is matched with the feature critical word that step S2 is obtained, so that
The matching for obtaining keyword and the feature critical word corresponding to each database in sentence information is scored;
S6. scored according to the weighted value that step S2 is obtained and the obtained matchings of step S5, sentence information and every number is calculated
According to the matching degree in storehouse;
S7. the matching degree obtained according to step S6, chooses the syntax library corresponding to the best database of matching degree and user is inputted
Sentence information carry out syntax parsing.
2. dynamic syntax analytic method according to claim 1, it is characterised in that the database described in step S1 includes
SQLServer, ORACLE, SYBASE and DB2.
3. dynamic syntax analytic method according to claim 1, it is characterised in that the acquisition syntax library described in step S2
Feature critical word, is obtained specifically by type of database keyword syntactic model.
4. dynamic syntax analytic method according to claim 1, it is characterised in that described in step S4 to sentence information into
Row morphology and syntactic analysis, specially carry out morphology and syntactic analysis using bison to sentence information.
5. the dynamic syntax analytic method according to one of Claims 1 to 4, it is characterised in that will close sentence described in step S5
Keyword in information is matched with feature critical word and obtains matching scoring, is specially matched simultaneously using following rule
Calculate matching scoring:
R1. each keyword will be matched with feature critical word;
R2. for each keyword, it is natural number to be respectively provided with matching total score an X, X;
R3. for N number of database for needing to carry out syntax parsing, if keyword i and m feature critical word successful match, often
The score of one feature critical word is that X/m, i and m are natural number, and m≤N.
6. the dynamic syntax analytic method according to one of Claims 1 to 4, it is characterised in that the calculating language described in step S6
Sentence information and the matching degree of each database, specially calculate matching degree using following formula:
Pj=a1*S1+a2*S2+…ak*Sk+…+az*Sz
P in formulajFor sentence information and the matching degree of j-th of database, j is natural number;akFor k-th of feature of j-th of database
The weight of keyword;SkFor the matching score of k-th of feature critical word of j-th of database;Z is the feature of j-th of database
The number of keyword, k are natural number and k≤z.
7. the dynamic syntax analytic method according to one of Claims 1 to 4, it is characterised in that the selection described in step S7
Syntax parsing is carried out to sentence information input by user with the syntax library spent corresponding to best database, specially using as follows
Rule chooses syntax library:
If matching degree is that 0 or matching degree are equal, according to the order for the syntax library priority being previously set, it is high to choose priority
Syntax library;
If matching degree is unequal, the syntax library corresponding to the highest database of matching degree is chosen.
A kind of 8. resolution system for the dynamic syntax analytic method realized described in one of claim 1~7, it is characterised in that including
Database acquisition module, feature critical word obtains and weight setting module, input module, keyword acquisition module, keyword
With module, matching degree computing module and output module;Database acquisition module is used to obtain the data for needing to carry out syntax parsing
Storehouse, and the database information of acquisition is passed into the acquisition of feature critical word and weight setting module;Feature critical word obtains and power
Weight setup module is used for the feature critical word information for obtaining the corresponding syntax library of each database, and is each feature critical word
Weight amplitude, while feature critical word information and weight are uploaded into keyword-matching module;User is from input module read statement
Information, and upload keyword-matching module after obtaining the keyword in sentence information by keyword acquisition module;Keyword
It is used to the feature critical word corresponding to the keyword in sentence information and each database carrying out matching scoring with module, and will
As a result matching degree computing module is uploaded;Matching primitives module is used for according to the matching of upload scoring computing statement information and each number
Exported according to the matching degree in storehouse, and by matching result by output module.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711131857.7A CN107908739A (en) | 2017-11-15 | 2017-11-15 | Dynamic syntax analytic method and its resolution system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711131857.7A CN107908739A (en) | 2017-11-15 | 2017-11-15 | Dynamic syntax analytic method and its resolution system |
Publications (1)
Publication Number | Publication Date |
---|---|
CN107908739A true CN107908739A (en) | 2018-04-13 |
Family
ID=61844315
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201711131857.7A Pending CN107908739A (en) | 2017-11-15 | 2017-11-15 | Dynamic syntax analytic method and its resolution system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107908739A (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109040061A (en) * | 2018-08-01 | 2018-12-18 | 吉林大学珠海学院 | A kind of data Auto-matching analytic method, system, device and storage medium |
CN109614427A (en) * | 2018-10-23 | 2019-04-12 | 平安科技(深圳)有限公司 | The access method and device of Various database, storage medium and electronic equipment |
CN111125218A (en) * | 2019-12-13 | 2020-05-08 | 成都安恒信息技术有限公司 | Database compatibility method based on protocol analysis and compatibility proxy device thereof |
CN113742371A (en) * | 2021-11-08 | 2021-12-03 | 北京安华金和科技有限公司 | SQL statement block analysis processing method and device |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20030041052A1 (en) * | 2001-08-22 | 2003-02-27 | International Business Machines Corporation | Tool for converting SQL queries into portable ODBC |
CN101901222A (en) * | 2009-05-27 | 2010-12-01 | 北京启明星辰信息技术股份有限公司 | Method and system for analyzing and matching SQLs (Structured Query Languages) |
CN103778185A (en) * | 2013-12-27 | 2014-05-07 | 北京天融信软件有限公司 | SQL statement parsing method and system used for database auditing system |
CN104035941A (en) * | 2013-03-08 | 2014-09-10 | 腾讯科技(深圳)有限公司 | Information screening method and device |
CN106919711A (en) * | 2017-03-13 | 2017-07-04 | 北京百度网讯科技有限公司 | The method and apparatus of the markup information based on artificial intelligence |
-
2017
- 2017-11-15 CN CN201711131857.7A patent/CN107908739A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20030041052A1 (en) * | 2001-08-22 | 2003-02-27 | International Business Machines Corporation | Tool for converting SQL queries into portable ODBC |
CN101901222A (en) * | 2009-05-27 | 2010-12-01 | 北京启明星辰信息技术股份有限公司 | Method and system for analyzing and matching SQLs (Structured Query Languages) |
CN104035941A (en) * | 2013-03-08 | 2014-09-10 | 腾讯科技(深圳)有限公司 | Information screening method and device |
CN103778185A (en) * | 2013-12-27 | 2014-05-07 | 北京天融信软件有限公司 | SQL statement parsing method and system used for database auditing system |
CN106919711A (en) * | 2017-03-13 | 2017-07-04 | 北京百度网讯科技有限公司 | The method and apparatus of the markup information based on artificial intelligence |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109040061A (en) * | 2018-08-01 | 2018-12-18 | 吉林大学珠海学院 | A kind of data Auto-matching analytic method, system, device and storage medium |
CN109614427A (en) * | 2018-10-23 | 2019-04-12 | 平安科技(深圳)有限公司 | The access method and device of Various database, storage medium and electronic equipment |
CN111125218A (en) * | 2019-12-13 | 2020-05-08 | 成都安恒信息技术有限公司 | Database compatibility method based on protocol analysis and compatibility proxy device thereof |
CN113742371A (en) * | 2021-11-08 | 2021-12-03 | 北京安华金和科技有限公司 | SQL statement block analysis processing method and device |
CN113742371B (en) * | 2021-11-08 | 2022-02-15 | 北京安华金和科技有限公司 | SQL statement block analysis processing method and device |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105701253B (en) | The knowledge base automatic question-answering method of Chinese natural language question semanteme | |
CN107180045B (en) | Method for extracting geographic entity relation contained in internet text | |
CN107908739A (en) | Dynamic syntax analytic method and its resolution system | |
US20020055932A1 (en) | System and method for comparing heterogeneous data sources | |
CN109446341A (en) | The construction method and device of knowledge mapping | |
CN105843897A (en) | Vertical domain-oriented intelligent question and answer system | |
US20040158567A1 (en) | Constraint driven schema association | |
US20050102303A1 (en) | Computer-implemented method, system and program product for mapping a user data schema to a mining model schema | |
US20110191335A1 (en) | Method and system for conducting legal research using clustering analytics | |
CN107562919B (en) | Multi-index integrated software component retrieval method and system based on information retrieval | |
CN107665217A (en) | A kind of vocabulary processing method and system for searching service | |
US20200134537A1 (en) | System and method for generating employment candidates | |
CN104484380A (en) | Personalized search method and personalized search device | |
US20230169074A1 (en) | Device and method for converting natural language query into sql query | |
CN109657072A (en) | A kind of intelligent search WEB system and method applied to government's aid decision | |
CN115757819A (en) | Method and device for acquiring information of quoting legal articles in referee document | |
CN110309513A (en) | A kind of method and apparatus of context dependent analysis | |
CN104778205B (en) | A kind of mobile application sequence and clustering method based on Heterogeneous Information network | |
CN117112595A (en) | Information query method and device, electronic equipment and storage medium | |
CN107818078B (en) | Semantic association and matching method for Chinese natural language dialogue | |
CN105512270A (en) | Method and device for determining related objects | |
Goyal et al. | A Review on Different Content Based Image Retrieval Techniques Using High Level Semantic Feature | |
Naeem et al. | Generating OLAP queries from natural language specification | |
Yu et al. | The application of data mining technology in employment analysis of university graduates | |
Tang et al. | Ontology-based semantic retrieval for education management systems |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20180413 |
|
RJ01 | Rejection of invention patent application after publication |