CN104298657A - Evaluation index analysis system based on expression - Google Patents

Evaluation index analysis system based on expression Download PDF

Info

Publication number
CN104298657A
CN104298657A CN201410490189.7A CN201410490189A CN104298657A CN 104298657 A CN104298657 A CN 104298657A CN 201410490189 A CN201410490189 A CN 201410490189A CN 104298657 A CN104298657 A CN 104298657A
Authority
CN
China
Prior art keywords
evaluation index
expression formula
evaluation
expression
analysis
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
CN201410490189.7A
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.)
Grid Planning Research Center of Guangdong Power Grid Co Ltd
Original Assignee
Grid Planning Research Center of Guangdong Power Grid 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 Grid Planning Research Center of Guangdong Power Grid Co Ltd filed Critical Grid Planning Research Center of Guangdong Power Grid Co Ltd
Priority to CN201410490189.7A priority Critical patent/CN104298657A/en
Publication of CN104298657A publication Critical patent/CN104298657A/en
Pending legal-status Critical Current

Links

Landscapes

  • Stored Programmes (AREA)

Abstract

The invention aims to provide an evaluation index analysis system based on an expression. The evaluation index analysis system comprises an evaluation index expression syntax definition module, an expression configuration module and an expression analysis module. According to the evaluation index analysis system based on the expression, the evaluation logic of an evaluation index can be set by a user, the user can timely change the evaluation index of a project, meanwhile, the system can also analyze the evaluation index in real time, and project evaluation can be conducted timely by using new evaluation standard logic.

Description

Based on the evaluation index resolution system of expression formula
Technical field
The present invention relates to a set of evaluation index resolution system based on expression formula, especially user can arrange evaluation index expression formula flexibly according to evaluation criterion document, logic in simultaneity factor in-service evaluation expression formula calculates automatically to evaluation index, obtains evaluation result.
Background technology
At present, the overwhelming majority is all underaction to the parsing of evaluation criterion, because evaluation index is not unalterable, usually just need at set intervals to repair volume, the amendment of evaluation index must be provided for this situation system, also require system to identify simultaneously and resolve the large function of evaluation index two that user arranges, only in this way just can reach the object of flexible automatic evaluation.In the similar system of current minority, all do badly in the change of response evaluation index, usually be all that the evaluation logic of evaluation index is written in code, later stage user is difficult to adjust evaluation index, the change of evaluation index cannot be responded, and the another kind of way improved uses storing process to realize the parsing of evaluation index, although this solution is with certain dirigibility, but client still independently can not complete the change of evaluation index, need new evaluation index to developer, then gone to adjust storing process by developer.This two schemes all only realizes the function of system identification evaluation index, and the function that user revises evaluation index is all disappearance.Cause the reason of this problem to be difficult to technically to realize a set ofly both simply to convert the word index of evaluation index to computing machine discernible index, the easy left-hand seat of user, foot has the scheme of online modification evaluation index flexibly again.
Summary of the invention
Evaluation index cannot be edited flexibly to overcome existing solution, the object of the present invention is to provide a kind of easy, that evaluation criterion can be set by user evaluation index resolution system based on expression formula, this system can realize the evaluation logic of evaluation index to give user to arrange, make user can timely to the change of Output Ratio, simultaneity factor again can be real-time analyzing and evaluating index, use new evaluation criterion logic to carry out project evaluation timely.
The present invention is achieved through the following technical solutions foregoing invention object:
Based on an evaluation index resolution system for expression formula, comprising: evaluation index expression syntax definition module, expression formula configuration module and expression parsing module three part;
Described evaluation index expression syntax definition module, use is increased income syntax analyzer ANTLR-Another Tool for Language Recognition (hereinafter referred to as ANTLR instrument), defines the syntax rule of a set of analyzing and evaluating index expression formula.
Described evaluation index expression syntax definition module, comprise a Grammar Rule file for ANTLR instrument, the morphology definition rule in ANTLR instrument grammar definition is used, all key words occurred in define system, operational character and discernible data type in Grammar Rule file.In rule file, define the structure of operational character and the priority of operational character in expression syntax by the syntactic definition rule in ANTLR instrument grammar definition and the nested of syntax rule simultaneously;
Described evaluation index expression syntax definition module uses Grammar Rule file, generates lexical analysis class (ExpressionLexer) and grammatical analysis class (ExpressionParser) by ANTLR instrument.
Described expression formula configuration module, for configuring and store the evaluation expression formula of evaluation index, the process of the evaluation expression formula of described configuration and storage evaluation index is:
Inputting interface is provided to input evaluation index expression formula to user;
After obtaining the evaluation index expression formula of user's input, evaluation index expression formula is saved in database.
Described evaluation expression formula parsing module, from database, take out the evaluation expression formula of evaluation index, the lexical analysis class (ExpressionLexer) that the ANTRL instrument calling described evaluation index expression syntax definition module generates automatically and grammatical analysis class (ExpressionParser) carry out lexical analysis and grammatical analysis to evaluation expression formula; The detailed process of described lexical analysis and grammatical analysis is:
Use lexical analysis class (ExpressionLexer) to carry out lexical analysis in conjunction with the public token streams class (CommonTokenStream) provided of ANTLR to evaluation index expression formula, then expression formula class (Expression) method that result passes to grammatical analysis class (ExpressionParser) is carried out grammatical analysis.
Described evaluation expression formula parsing module, after lexical analysis and grammatical analysis, uses ANTRL instrument to return the abstract syntax tree of evaluation index expression formula.Again according to the method ergodic abstract syntax tree of postorder traversal, and resolve each node of grammer seeds, finally obtain the analysis result of expression formula.
The present invention contrasts prior art, has the following advantages:
1. user can independently, neatly, the evaluation logic of the momentarily evaluation index of configuration-system.Invention defines the expression syntax of a set of simple easily left-hand seat, user can, easily the evaluation index of word, use the expression syntax of system to configure out.
2. system can respond the change of evaluation index timely, the evaluation logic of evaluation index that what the present invention stored in a database is, i.e. user-defined evaluation index expression formula, this storage, make system respond the change of evaluation index timely, make the evaluation logic of evaluation index not by the impact of evaluating data simultaneously.
3. acquisition evaluation result instant fast.The present invention is the evaluation result being obtained evaluation index by dynamic analysis evaluation expression formula.Evaluation expression formula, in the process of project evaluation, carries out dynamic analysis, and real-time evaluating data is substituted into resolving, thus calculates Real-Time Evaluation result fast.
Accompanying drawing explanation
Fig. 1 is that the evaluation index resolution system in investment projects of capital assets postevaluation workbench construction project uses process flow diagram;
Fig. 2 is the surface chart of editor's evaluation criterion of evaluation index resolution system in investment projects of capital assets postevaluation workbench construction project;
Fig. 3 is expression formula abstract syntax tree;
Fig. 4 is the project evaluation result surface chart of the evaluation index resolution system in investment projects of capital assets postevaluation workbench construction project.
Embodiment
Embodiments of the present invention are to provide the resolution system of rule-based definable expression formula, as shown in Figure 1, comprise evaluation index expression syntax definition module, evaluation index expression formula configuration module and evaluation index expression parsing module three part.
Evaluation index expression syntax definition module, uses the morphology definition rule in the grammar definition of ANTLR instrument, all key words occurred in define system, operational character and discernible data type.By the nested priority defining legality expressions formula and operational character in expression syntax of syntactic definition in grammar definition rule and syntax rule.
Partial expression syntax rule by ANTLR instrument definition in system is as follows:
Evaluation index expression syntax definition module, by using the grammar rule after these definition, makes ANTLR instrument automatically generate corresponding lexical analysis class (ExpressionLexer) and grammatical analysis class (ExpressionParser).
Evaluation expression formula configuration module, for inputting and store the evaluation expression formula of evaluation index.Evaluation expression formula configuration module provides the configuration page (as shown in Figure 2) to allow user input evaluation expression formula, after the evaluation index expression formula obtaining user's input, it is saved in database.
User configured evaluation index expression formula is as follows:
Word evaluation criterion: predicted load-actual negative charge values in load prediction accuracy rate=1-| planning |/actual negative charge values
Configuration and the evaluation index expression formula stored: 1-ABS ([predicted load]-[actual negative charge values])/[actual negative charge values]
Evaluation expression formula parsing module, for after receiving the request of analyzing and evaluating index formula, the evaluation expression formula of evaluation index is taken out from database, lexical analysis class (ExpressionLexer) is used to carry out lexical analysis in conjunction with the public token flow process class (CommonTokenStream) of ANTLR to evaluation index expression formula, then result is passed to, expression formula (Expression) method of grammatical analysis class (ExpressionParser) class carries out grammatical analysis, finally obtains the abstract syntax tree of evaluation index expression formula
Be illustrated in figure 3 expression formula abstract syntax tree example, according to the method ergodic abstract syntax tree of postorder traversal after acquisition abstract syntax tree, and resolve each node of grammer seeds.Analyzing step is as follows:
Step 1: obtain current grammar tree root node, then judge the type of present node, if Value Types, perform step 2. other type perform step 3.
Step 2: Value Types belonging to the root node of current grammar tree, numerical value corresponding for the conversion of the value of root node.Then value is returned.
Step 3: according to the logical operation type of the root node of current grammar tree, then to each child node under root node, perform step 1.
Step 4: after the value of all child nodes of acquisition, according to the logical operation type of root node, carries out logical operation to the value of child node, obtains the result of root node, the then result of calculation of root node.
By using the mode of recurrence, finally obtain the analysis result of expression formula, as shown in Figure 4.
Native system is by the definition of combining assessment index expression syntax, the function that the configuration of evaluation expression formula and evaluation expression formula are resolved, define the expression syntax of a set of user's easy understand and study left-hand seat, and provide three interfaces to allow user from the evaluation index expression formula of primary input evaluation index, and the basic data of design, then by the rapid computations ability of computing system, when project implementation is evaluated, instant parsing is carried out to the evaluation index expression formula of evaluation index, obtains the evaluation result performed according to the evaluation logic of user's setting.Simultaneity factor, by supporting to introduce the concept of variable, when carrying out project evaluation, can pass to expression formula up-to-date data, thus reaches and use latest data to carry out the object evaluated.
Embodiments of the present invention are not limited thereto; under stating basic fundamental thought prerequisite on the invention; according to the ordinary technical knowledge of this area and customary means to content of the present invention make the amendment of other various ways, replacement or change, all drop within rights protection scope of the present invention.

Claims (2)

1. based on an evaluation index resolution system for expression formula, it is characterized in that comprising: evaluation index expression syntax definition module, expression formula configuration module and expression parsing module three part;
Described evaluation index expression syntax definition module, comprise a Grammar Rule file for ANTLR instrument, the morphology definition rule in ANTLR instrument grammar definition is used, all key words occurred in define system, operational character and discernible data type in Grammar Rule file; In rule file, define the structure of operational character and the priority of operational character in expression syntax by the syntactic definition rule in ANTLR instrument grammar definition and the nested of syntax rule simultaneously; Described evaluation index expression syntax definition module uses Grammar Rule file, generates lexical analysis class (ExpressionLexer) and grammatical analysis class (ExpressionParser) by ANTLR instrument;
Described expression formula configuration module, for configuring and store the evaluation expression formula of evaluation index, the process of the evaluation expression formula of described configuration and storage evaluation index is:
Inputting interface is provided to input evaluation index expression formula to user;
After obtaining the evaluation index expression formula of user's input, evaluation index expression formula is saved in database;
Described evaluation expression formula parsing module, from database, take out the evaluation expression formula of evaluation index, the lexical analysis class (ExpressionLexer) that the ANTRL instrument calling described evaluation index expression syntax definition module generates automatically and grammatical analysis class (ExpressionParser) carry out lexical analysis and grammatical analysis to evaluation expression formula;
Described evaluation expression formula parsing module, after lexical analysis and grammatical analysis, uses ANTRL instrument to return the abstract syntax tree of evaluation index expression formula; Again according to the method ergodic abstract syntax tree of postorder traversal, and resolve each node of grammer seeds, finally obtain the analysis result of expression formula.
2. system according to claim 1, is characterized in that: the detailed process of described lexical analysis and grammatical analysis is:
Use lexical analysis class to carry out lexical analysis in conjunction with the public token streams class (CommonTokenStream) provided of ANTLR to evaluation index expression formula, then expression formula class (Expression) method that result passes to grammatical analysis class is carried out grammatical analysis.
CN201410490189.7A 2014-09-23 2014-09-23 Evaluation index analysis system based on expression Pending CN104298657A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410490189.7A CN104298657A (en) 2014-09-23 2014-09-23 Evaluation index analysis system based on expression

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410490189.7A CN104298657A (en) 2014-09-23 2014-09-23 Evaluation index analysis system based on expression

Publications (1)

Publication Number Publication Date
CN104298657A true CN104298657A (en) 2015-01-21

Family

ID=52318386

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410490189.7A Pending CN104298657A (en) 2014-09-23 2014-09-23 Evaluation index analysis system based on expression

Country Status (1)

Country Link
CN (1) CN104298657A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109376220A (en) * 2018-12-12 2019-02-22 北京字节跳动网络技术有限公司 Method and apparatus for obtaining information
CN109656453A (en) * 2018-12-20 2019-04-19 树根互联技术有限公司 Rule editing method, apparatus and equipment
CN110826314A (en) * 2019-11-07 2020-02-21 中金智汇科技有限责任公司 Rule analysis method and device, electronic equipment and storage medium
CN112270175A (en) * 2020-10-29 2021-01-26 成都四方伟业软件股份有限公司 ANTLR-based complex report formula analysis method and device

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
BRUCE008: "ANTLR学习", 《HTTP://BRUCE008.ITEYE.COM/BLOG/1546949》 *
NOVELLY: "基于antlr的表达式解析器", 《HTTP://BLOG.CSDN.NET/NOVELLY/ARTICLE/DETAILS/13886775》 *
TUBOCURARINE: "ANTLR——语法", 《HTTP://BLOG.CHINAUNIX.NET/UID-20606073-ID-1916338.HTML》 *
王建光等: "一种可扩展的表达式解析及计算方法", 《WWW.IBM.COM/DEVELOPERWORKS/CN/JAVA/J-LO-EXPRESSPARSE/#ICOMMENTS》 *

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109376220A (en) * 2018-12-12 2019-02-22 北京字节跳动网络技术有限公司 Method and apparatus for obtaining information
CN109376220B (en) * 2018-12-12 2020-12-25 北京字节跳动网络技术有限公司 Method and device for acquiring information
CN109656453A (en) * 2018-12-20 2019-04-19 树根互联技术有限公司 Rule editing method, apparatus and equipment
CN110826314A (en) * 2019-11-07 2020-02-21 中金智汇科技有限责任公司 Rule analysis method and device, electronic equipment and storage medium
CN110826314B (en) * 2019-11-07 2023-08-22 中金智汇科技有限责任公司 Rule analysis method and device, electronic equipment and storage medium
CN112270175A (en) * 2020-10-29 2021-01-26 成都四方伟业软件股份有限公司 ANTLR-based complex report formula analysis method and device

Similar Documents

Publication Publication Date Title
CN109343857B (en) Method, apparatus and storage medium for deploying machine learning model on line
CN106970819B (en) C program code specification checking device based on PRD L rule description language
US20160252890A1 (en) Method for searching cross-regional power supply area based on cim model and system thereof
CN108984155B (en) Data processing flow setting method and device
CN106610999A (en) Query processing method and device
CN105706092B (en) The method and system of four values simulation
CN108255837B (en) SQL parser and method
CN104035754A (en) XML (Extensible Markup Language)-based custom code generation method and generator
CN111124379B (en) Page generation method and device, electronic equipment and storage medium
CN104298657A (en) Evaluation index analysis system based on expression
CN101859303A (en) Metadata management method and management system
JP2019133622A (en) Mapping of api parameter
CN105446743A (en) System and method for automatically generating SQL sentences
CN103902269A (en) System and method for generating MIB files through XML files
CN104391895A (en) SQL (Structured Query Language) sentence processing system based on cloud computing
CN106383701A (en) Common multi-protocol data access interface technology-based data service system
CN101710273B (en) Method and device for analyzing multi-dimensional query sentence in online analysis processing server
CN104866310A (en) Knowledge data processing method and system
CN108766507A (en) A kind of clinical quality index calculating method based on CQL Yu standard information model openEHR
CN107992324A (en) A kind of code search method based on constraint solving
André et al. Translating UML state machines to coloured Petri nets using Acceleo: A report
CN108008947B (en) Intelligent prompting method and device for programming statement, server and storage medium
CN117112608A (en) Antlr 4-based database statement conversion method and device
CN104090895B (en) Obtain the method for radix, device, server and system
CN114896269A (en) Structured query statement detection method and device, electronic equipment and storage medium

Legal Events

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

Application publication date: 20150121