CN104252509A - Expression execution method and expression execution device - Google Patents

Expression execution method and expression execution device Download PDF

Info

Publication number
CN104252509A
CN104252509A CN201310538489.3A CN201310538489A CN104252509A CN 104252509 A CN104252509 A CN 104252509A CN 201310538489 A CN201310538489 A CN 201310538489A CN 104252509 A CN104252509 A CN 104252509A
Authority
CN
China
Prior art keywords
expression formula
arithmetic logic
database
association rule
enforcement engine
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
CN201310538489.3A
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.)
Shenzhen Huaao Data Technology Co Ltd
Original Assignee
Shenzhen Huaao Data Technology 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 Shenzhen Huaao Data Technology Co Ltd filed Critical Shenzhen Huaao Data Technology Co Ltd
Priority to CN201310538489.3A priority Critical patent/CN104252509A/en
Publication of CN104252509A publication Critical patent/CN104252509A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/21Design, administration or maintenance of databases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/12Use of codes for handling textual entities
    • G06F40/151Transformation

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Machine Translation (AREA)

Abstract

The invention provides an expression execution method which comprises the following steps: acquiring an expression; resolving the expression to acquire an arithmetic logic; calling an execution engine added with database rules according to the arithmetic logic. The invention also provides a corresponding device. According to the method provided by the embodiment of the invention, the execution engine added with the database rules is called, so that calculation of a null value in a database by the expression is realized.

Description

A kind of expression formula manner of execution and device
Technical field
The application relates to database management technology field, particularly relates to a kind of expression formula manner of execution and device.
Background technology
In the expression formula implementation of database, general evaluation of expression is to the worthwhile one-tenth null pointer of null, thus throw exception, but in database, null as a legal computing, and observes a set of operation rule in database, but to time in database, data convert in some database product, just must observe the set of rule of database, but the expression formula executive mode according to database operation rule in current technology, can not be realized.
Summary of the invention
Technical problems to be solved in this application are to provide a kind of expression formula manner of execution and the device that can carry out computing to null value in database.
In order to solve the problem, this application discloses a kind of expression formula manner of execution, comprising:
Obtain expression formula;
Resolve described expression formula and obtain arithmetic logic;
The enforcement engine that with the addition of database association rule is called according to described arithmetic logic.
Further, described acquisition expression formula comprises:
Obtain the expression formula of user's input.
Further, described analytical expression acquisition arithmetic logic comprises:
Adopt bottom-up analytic method to resolve described expression formula and obtain arithmetic logic.
Further, describedly call according to arithmetic logic the enforcement engine that with the addition of database association rule and comprise:
Call the enforcement engine that with the addition of database association rule according to arithmetic logic, described database association rule at least comprises the null operation rule of database.
Present invention also provides a kind of expression formula actuating unit, comprising:
Acquisition module, for obtaining expression formula;
Parsing module, obtains arithmetic logic for resolving described expression formula;
Calling module, for calling the enforcement engine that with the addition of database association rule according to described arithmetic logic.
Further, described acquisition module also for:
Obtain the expression formula of user's input.
Further, described parsing module also for:
Adopt bottom-up resolver to resolve described expression formula and obtain arithmetic logic.
Further, described calling module also for:
Call the enforcement engine that with the addition of database association rule according to arithmetic logic, described database association rule at least comprises the null operation rule of database.
Compared with prior art, the application comprises following advantage: by calling the enforcement engine that with the addition of database association rule, achieves the computing of expression formula about null value in database.
accompanying drawing explanation
Fig. 1 is the process flow diagram of a kind of expression formula manner of execution one of the present invention embodiment;
Fig. 2 is the structural representation of a kind of expression formula actuating unit one of the present invention embodiment.
Embodiment
For enabling above-mentioned purpose, the feature and advantage of the application more become apparent, below in conjunction with the drawings and specific embodiments, the application is described in further detail.
With reference to Fig. 1, show the process flow diagram of a kind of expression formula manner of execution one of the application embodiment;
In database, null is as a legal computing, and a set of operation rule of observing in database, but to time in database, data convert in some database product, just must observe the set of rule of database, thus need this cover null to be carried out to a set of evaluation of expression of special processing; The a set of Evaluation rule achieving applicable database of embodiment of the present invention innovation, makes the data processing of this database product more natural, and make process structure be loyal to the actual meaning of one's words of database, product obtains greatly perfect.A kind of expression formula manner of execution that the embodiment of the present invention provides, comprising:
Step S101, acquisition expression formula;
Further, described acquisition expression formula comprises:
Obtain the expression formula of user's input.
Described expression formula can be the character string command meeting database association rule that user inputs.
Step S102, resolve described expression formula obtain arithmetic logic;
Further, described analytical expression acquisition arithmetic logic comprises:
Adopt bottom-up analytic method to resolve described expression formula and obtain arithmetic logic.
Step S102 also can pass through hand-written analyzer, adopts the analytical expression of operation precedence generally, and local adopts LL (1) to analyze, a final formation abstract syntax tree (AST), and carries out syntactic verification.
Step S103, call the enforcement engine that with the addition of database association rule according to described arithmetic logic.
Further, describedly call according to arithmetic logic the enforcement engine that with the addition of database association rule and comprise:
Call the enforcement engine that with the addition of database association rule according to arithmetic logic, described database association rule at least comprises the null operation rule of database.
Traversal AST, adopts visitor's Design Mode, realizes entity and is separated with operation;
First carry out type checking, complete type legitimacy, the work such as implicit conversion;
Secondly AST is become execution instruction sequence, facilitate enforcement engine reading command, perform computing.
Instruction sequence is the abstractdesription meeting database operation rule having inner definition, and operation rule is described as the form meeting database demand by it, makes enforcement engine can perform the correct result in place.
The embodiment of the present invention, by by calling the enforcement engine that with the addition of database association rule, achieves the computing of expression formula about null value in database.
With reference to the structural representation that Fig. 2 is a kind of expression formula actuating unit one of the present invention embodiment.
A kind of expression formula actuating unit that the embodiment of the present invention provides, comprising:
Acquisition module 21, for obtaining expression formula;
Parsing module 22, obtains arithmetic logic for resolving described expression formula;
Calling module 23, for calling the enforcement engine that with the addition of database association rule according to described arithmetic logic.
Further, described acquisition module 21 also for:
Obtain the expression formula of user's input.
Further, described parsing module 22 also for:
Adopt bottom-up resolver to resolve described expression formula and obtain arithmetic logic.
Further, described calling module 23 also for:
Call the enforcement engine that with the addition of database association rule according to arithmetic logic, described database association rule at least comprises the null operation rule of database.
Parsing module 22 also can pass through hand-written analyzer, adopts the analytical expression of operation precedence generally, and local adopts LL (1) to analyze, a final formation abstract syntax tree (AST), and carries out syntactic verification.
The enforcement engine that calling module 23 calls can travel through AST, adopts visitor's Design Mode, realizes entity and is separated with operation; First carry out type checking, complete type legitimacy, the work such as implicit conversion; Secondly AST is become execution instruction sequence, facilitate enforcement engine reading command, perform computing.
For device embodiment, due to itself and embodiment of the method basic simlarity, so description is fairly simple, relevant part illustrates see the part of embodiment of the method.
Each embodiment in this instructions all adopts the mode of going forward one by one to describe, and what each embodiment stressed is the difference with other embodiments, between each embodiment identical similar part mutually see.
A kind of expression formula manner of execution above the application provided and device, be described in detail, apply specific case herein to set forth the principle of the application and embodiment, the explanation of above embodiment is just for helping method and the core concept thereof of understanding the application; Meanwhile, for one of ordinary skill in the art, according to the thought of the application, all will change in specific embodiments and applications, in sum, this description should not be construed as the restriction to the application.

Claims (8)

1. an expression formula manner of execution, is characterized in that, comprising:
Obtain expression formula;
Resolve described expression formula and obtain arithmetic logic;
The enforcement engine that with the addition of database association rule is called according to described arithmetic logic.
2. method according to claim 1, is characterized in that, described acquisition expression formula comprises:
Obtain the expression formula of user's input.
3. method according to claim 1 and 2, is characterized in that, described analytical expression obtains arithmetic logic and comprises:
Adopt bottom-up analytic method to resolve described expression formula and obtain arithmetic logic.
4. method according to claim 2, is characterized in that, describedly calls according to arithmetic logic the enforcement engine that with the addition of database association rule and comprises:
Call the enforcement engine that with the addition of database association rule according to arithmetic logic, described database association rule at least comprises the null operation rule of database.
5. an expression formula actuating unit, is characterized in that, comprising:
Acquisition module, for obtaining expression formula;
Parsing module, obtains arithmetic logic for resolving described expression formula;
Calling module, for calling the enforcement engine that with the addition of database association rule according to described arithmetic logic.
6. device according to claim 5, is characterized in that, described acquisition module also for:
Obtain the expression formula of user's input.
7. the device according to claim 5 or 6, is characterized in that, described parsing module also for:
Adopt bottom-up resolver to resolve described expression formula and obtain arithmetic logic.
8. device according to claim 6, is characterized in that, described calling module also for:
Call the enforcement engine that with the addition of database association rule according to arithmetic logic, described database association rule at least comprises the null operation rule of database.
CN201310538489.3A 2013-11-05 2013-11-05 Expression execution method and expression execution device Pending CN104252509A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310538489.3A CN104252509A (en) 2013-11-05 2013-11-05 Expression execution method and expression execution device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310538489.3A CN104252509A (en) 2013-11-05 2013-11-05 Expression execution method and expression execution device

Publications (1)

Publication Number Publication Date
CN104252509A true CN104252509A (en) 2014-12-31

Family

ID=52187402

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310538489.3A Pending CN104252509A (en) 2013-11-05 2013-11-05 Expression execution method and expression execution device

Country Status (1)

Country Link
CN (1) CN104252509A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107832391A (en) * 2017-10-31 2018-03-23 长城计算机软件与系统有限公司 A kind of data query method and system

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101093493A (en) * 2006-06-23 2007-12-26 国际商业机器公司 Speech conversion method for database inquiry, converter, and database inquiry system
US20080133537A1 (en) * 2006-12-01 2008-06-05 Portico Systems Gateways having localized in memory databases and business logic execution
CN102799644A (en) * 2012-06-28 2012-11-28 用友软件股份有限公司 Dynamic database query system and method based on metadata
CN103177038A (en) * 2011-12-26 2013-06-26 昆山麦克斯泰科技有限公司 Query expression in vertical search engine

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101093493A (en) * 2006-06-23 2007-12-26 国际商业机器公司 Speech conversion method for database inquiry, converter, and database inquiry system
US20080133537A1 (en) * 2006-12-01 2008-06-05 Portico Systems Gateways having localized in memory databases and business logic execution
CN103177038A (en) * 2011-12-26 2013-06-26 昆山麦克斯泰科技有限公司 Query expression in vertical search engine
CN102799644A (en) * 2012-06-28 2012-11-28 用友软件股份有限公司 Dynamic database query system and method based on metadata

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
张 昱: "一种构建Java语言扩展的编译器框架", 《计 算 机 工 程》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107832391A (en) * 2017-10-31 2018-03-23 长城计算机软件与系统有限公司 A kind of data query method and system
CN107832391B (en) * 2017-10-31 2020-08-18 长城计算机软件与系统有限公司 Data query method and system

Similar Documents

Publication Publication Date Title
US10102039B2 (en) Converting a hybrid flow
US8806452B2 (en) Transformation of computer programs and eliminating errors
US8849673B2 (en) Rule generation
CN106951305B (en) Method for generating midCore script from QVT-R language based on model conversion
US20140250429A1 (en) Code analysis for simulation efficiency improvement
US10534592B2 (en) Template expressions for constraint-based systems
US9304893B1 (en) Integrated software development and test case management system
CN102779044B (en) The dissection process system of expression formula and analyzing and processing method
CN104461531A (en) Implementing method for self-defined functions of reporting system
US10474435B2 (en) Configuration model parsing for constraint-based systems
CN113504900A (en) Programming language conversion method and device
US20150205584A1 (en) Lightweight optionally typed data representation of computation
WO2015031610A1 (en) Method and apparatus for generating health quality metrics
CN105893052A (en) War packet analyzer
CN105556504A (en) Generating a logical representation from a physical flow
CN108459846B (en) Software cloud customization method and platform
CN103544154A (en) Data format conversion method
CN103186384A (en) Business-component-oriented software designing and analyzing system and using method thereof
CN114064601B (en) Storage process conversion method, device, equipment and storage medium
Garis et al. Translating Alloy specifications to UML class diagrams annotated with OCL
CN111026916B (en) Text description conversion method and device, electronic equipment and storage medium
CN104252509A (en) Expression execution method and expression execution device
CN109918084B (en) Data mapping method of service management system
CN104899045B (en) A kind of general Software Coding auxiliary system and method
CN110674355B (en) DSL application system for describing data labeling task and method thereof

Legal Events

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

Application publication date: 20141231

RJ01 Rejection of invention patent application after publication