CN106648662B - Report generation device and method based on project cost calculation description language BCL - Google Patents

Report generation device and method based on project cost calculation description language BCL Download PDF

Info

Publication number
CN106648662B
CN106648662B CN201611207627.XA CN201611207627A CN106648662B CN 106648662 B CN106648662 B CN 106648662B CN 201611207627 A CN201611207627 A CN 201611207627A CN 106648662 B CN106648662 B CN 106648662B
Authority
CN
China
Prior art keywords
report
bcl
expression
data
calculation
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.)
Active
Application number
CN201611207627.XA
Other languages
Chinese (zh)
Other versions
CN106648662A (en
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.)
JIANGXI BOWEI NEW TECHNOLOGY CO LTD
Original Assignee
JIANGXI BOWEI NEW 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 JIANGXI BOWEI NEW TECHNOLOGY CO LTD filed Critical JIANGXI BOWEI NEW TECHNOLOGY CO LTD
Priority to CN201611207627.XA priority Critical patent/CN106648662B/en
Publication of CN106648662A publication Critical patent/CN106648662A/en
Application granted granted Critical
Publication of CN106648662B publication Critical patent/CN106648662B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/34Graphical or visual programming
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/10Office automation; Time management
    • G06Q10/103Workflow collaboration or project management

Abstract

A report generation device and method based on project cost calculation description language BCL includes compiling report BCL script and format file; creating a report object and loading a report configuration file; loading a report BCL script; performing lexical analysis on the BCL script to generate an EL expression; using a syntax analyzer to generate corresponding BCL syntax tree nodes by all EL expressions, and further forming a whole BCL syntax tree; creating a corresponding BCL object, and associating a BCL syntax tree obtained after syntax analysis; analyzing the generated BCL object to obtain a BCL syntax tree object to be calculated; explaining and executing the current BCL syntax tree, processing nodes in the syntax tree according to a subsequent traversal mode, and providing the created report object as a context for the BCL to execute until all BCL syntax trees are executed; and (5) persisting the report data into a file to complete the task. The method realizes one-time compiling and multiple interpretation and execution, thereby effectively improving the report generation efficiency.

Description

Report generation device and method based on project cost calculation description language BCL
Technical Field
The invention belongs to the field of project cost report generation, and particularly relates to a report configuration generation executing device and a report configuration generation executing method based on project cost calculation description language BCL (binary coded language), which particularly realize project cost report data generation and can dynamically configure data and format generated by a report.
Background
With the continuous development of information technology and the improvement of enterprise management, the engineering cost calculation becomes more and more refined, various reports are more and more, the report generation logic is complex, and the report formats are diversified. In the traditional report generation, a part of data and format generation codes are usually written for each report, but the similar output rules of the reports actually exist, so that the same logic repeated coding condition is easily caused. When the report generation logic and the report format have the customized requirement, special processing logic is usually expanded in the code at present, and once the customized requirement is excessive, the complexity of the code is increased in a geometric number manner, so that the later maintenance is not facilitated.
In the conventional report generation, report generation rules, logics and styles are generally implemented by coding and are integrated in a report generation device. Once a report generation device issues reports, users cannot change report generation rules, and the traditional report generation device in a software product is poor in flexibility due to the mode. Once the service changes, even if the order of the data items output by the report is changed, the code must be modified according to the changed requirement, and the software is subjected to a series of research and development processes such as compiling, integrating, packaging, testing, releasing and the like, so that the software response speed is low and the maintenance and update cost is high.
Disclosure of Invention
In order to solve the problems in the prior art, the invention provides a report generation device and a report generation method based on a project cost calculation description language BCL, which are used for customizing report data and formats.
The report generation device and the execution method are based on the project cost calculation language BCL, are consistent with the project cost calculation language BCL, can be independent of different products, projects and data sources, and have independence on development language and platform independence.
1. The project cost calculation description language BCL comprises the following implementation steps:
(1) designing an algebraic expression and an extended operation expression structure, namely an EL expression, for describing a specific calculation algorithm rule; the EL expression is a complete description of the calculation algorithm rule, takes $ { sum } as a starting mark and an ending mark, and comprises other advanced operation functions including conditional selection operation of various conditional selection expressions and function operation of completing specific calculation rules while the operation characteristics of the traditional algebraic expression are kept. Different from the traditional algebraic operation, the EL expression contains diversified operands, and supports types such as numerical values, character strings, variables and the like, wherein the variable type operand is a typical embodiment of the EL expression supporting dynamic data hooking, and the value of the variable type operand can be the reference of an external object or a specific data value set in an execution stage.
The conditional expression takes # { and } as a start and end mark, the conditional expression internally comprises a plurality of conditional branches and one more default conditional branch, each branch corresponds to an EL expression, and the value of the whole conditional selection expression is the calculation result of the EL expression corresponding to the currently activated conditional branch, such as:
#{
- > Condition 1 EL expression 1;
- > Condition 2 EL expression 2;
- > < EL expression 3;
}
the function operation defines a specific calculation rule to meet the specific calculation requirement of the engineering cost, the grammatical structure of the function operation is compatible with C language, the expansion data type of BCL is supported, besides, the calling of the function also supports the input of EL expression as a parameter, the dynamic binding of the specified engineering data range and the EL expression can be realized, the code redundancy of the expression is further reduced, and the grammatical format is as follows:
sum (data source tag, data source alias,;
(2) analyzing the calculation requirement of the engineering cost, and determining other calculation logic units except the EL expression;
through summarizing and summarizing construction cost engineering data, calculation algorithms and processes, the complex calculation algorithms of construction cost of any engineering can be decomposed into the minimum atomic calculation logic units, namely: EL expressions, macro tables, variables, parameters, data sources, and packets. The macro table can completely express a calculation rule with recursion, multiple fields, multiple records and a summary relation. The data source is used for describing data of a project and a data range thereof, is a bonding agent of BCL language and project data, and realizes the transmission of real data. The variables are specific expense calculation structures including data sources, data filtering algorithms and expense calculation algorithm rules, and compared with parameters only including specific numerical values, the calculation of the variables has a certain sequence, is more complex and has powerful functions. The package is a container of other atomic computation logic units, can define the action range of the computation logic units and shields naming conflicts.
(3) Analyzing the output requirement of the project cost report, calculating the description language expansion based on the project cost, and determining the project cost report generation description language, wherein the project cost report generation description language specifically comprises an expansion EL expression, an EL expression report output function and a report output logic unit except the EL expression;
by summarizing and summarizing the cost report output data, the calculation algorithm and the process, the EL expression is expanded, the EL expression report function operation is defined and the report output logic unit is output on the basis of the project cost calculation description language BCL.
The EL expression expands and adds the EL expression with process property on the basis of the engineering cost calculation description language, and is used for circularly executing the EL expression and the function and executing the report output related function. Taking a for loop as an example, the nested EL expression call is supported, and the for loop syntax format is as follows:
for (data source tag, data source alias,;
the report output function is the extension of an EL expression in a BCL (project cost calculation description language), defines the operation functions of adding report lines, filling cells, acquiring cell data, deleting lines, acquiring line numbers, adding column definitions, starting merging marks, ending merging marks and the like, can realize the filling of report data, and has the grammatical format:
addrow (;
addfield (column name,;
deleterow();
getrowcount();
addfielddef (column name, column type);
beginnionincell (start column name, end column name, merge type);
endunioncell (start column name, end column name, merge type);
and the report output logic unit calculates the description language according to the construction cost. Through summarizing and summarizing construction cost project report output data, calculation algorithms and processes, the project cost complex project report output algorithm of any project can be decomposed into the smallest atomic report output logic unit, namely: EL expression, variable, parameter, report data source, report object.
And the EL expression, the variable and the parameter are consistent with the description of the engineering cost calculation language. The data source is used for describing data of a project and a data range thereof, is a bonding agent of BCL language and project data, and realizes the transmission of real data. The report object comprises a report format object, a report data object and a report generation parameter object, and is an adhesive of BCL language and project report output data, wherein the report format object realizes the transmission of report format data, the transmission of report real data of the report data object and the transmission of report generation parameters of the report generation parameter object. And the report data and the format are generated and filled in the report object through the BCL (project cost calculation description language), and the report data and the format are generated.
2. A report form generation device based on project cost calculation description language BCL is realized based on the expanded project cost calculation description language BCL and project cost report form generation description language, and comprises: the report BCL script compiling device, the report BCL script analyzing device, the report format generating device, the report BCL script executing device and the report data storing device.
The report BCL script compiling device is a set of visual report generation script compiling device, and a user can visually edit report data and format generation rules through the device and generate a report BCL script which accords with the syntax of the engineering cost calculation description language.
The report BCL script compiling device is used for analyzing BCL elements and report elements in each report BCL script to compile and process to form a plurality of EL expression sets, each EL expression set is a syntax tree constructed by the BCL elements, the BCL elements are minimum units to be executed, and the inside of the report BCL script compiling device contains EL expression sets which describe calculation algorithm rules and report function operations.
The report BCL script parsing device comprises a report BCL script file generator and a report BCL script parser and is used for realizing the interconversion between the report BCL element object and the compiled report BCL script file in the report BCL script compiling device. The report BCL element object can be effectively recorded or restored, repeated compiling of the report BCL script is avoided, and the report generation efficiency is accelerated.
The report format generating device is used for realizing the mutual conversion between the report format object and the report format file in the report object and the editing of the report format information. The report format object comprises report page information, report header name, report header format and the like, and the device is used for recording, acquiring and editing corresponding report format information.
The report BCL script execution device is used for explaining and executing the report BCL script compiling device to generate a report BCL object, executing and compiling an EL expression set and calling a report function to realize the storage of report data and a format into the report BCL object. The report BCL object is an EL expression set, and the internal process relates to a report BCL object interpretation execution module, a syntax analysis module, a node calculation module, an engineering data reactor module, a report format parameter reactor module, a data source module, an operation context module and a report function operation module. The report BCL object interpretation execution module is used for controlling the BCL object interpretation execution process, interpreting the BCL object into BCL element nodes to be calculated through the syntax analysis module, and calculating each node in a BCL syntax tree contained in the BCL object by using the node calculation module. The data source module is used for processing data provided by the engineering data reactor module and the report format parameter reactor module, including data source screening, traversing, grouping and the like, and forming a data source which can be used by the node calculation module by operating the context module. The report function operation module comprises report functions of adding columns and rows to the report, filling row unit cell data, modifying row unit cell data, deleting columns and rows, adding merging marks, performing report page-changing operation and the like, and is used for realizing the storage of node calculation result data and formats in a report object according to different function operation logics.
The report data storage device is used for storing the report object into the report file.
3. A report generation method based on project cost calculation description language BCL comprises the following steps:
the first step is as follows: compiling a report BCL script and a format file;
and customizing an output rule according to the output requirement of each report by using the report scripting device, and finally generating a report BCL script for each report. The report scripting device provides a visual editing interface, and report generation rules can be flexibly configured through the visual editing interface. The report BCL script is an EL expression set, accords with the grammar rule of the engineering cost calculation description language, and has the grammar format as follows:
Figure BDA0001190324920000041
the second step is that: creating a report object and loading a report configuration file;
the report object comprises a report format object, a report data object and a report generation parameter object, and is an adhesive of BCL language and project report output data, wherein the report format object realizes the transmission of report format data, the report data object realizes the transmission of real report data, and the report generation parameter object realizes the transmission of report generation parameters.
The report configuration file comprises report page information, report header configuration information, report generation parameter information and the like.
The third step: loading a report BCL script;
the report BCL script is a script which is described by using a project cost calculation description language BCL and has a certain grammar rule, and a data generation rule of the report is defined inside the report.
The fourth step: performing lexical analysis on the BCL script to generate an EL expression;
the EL expression is a complete description of the report generation algorithm rule, and takes $ { sum } as a start mark and an end mark; the EL expression comprises diversified operands, and supports types such as numerical values, character strings, variables and the like, wherein the variable type operand is a typical embodiment that the EL expression supports dynamic data hooking, and the value of the variable type operand can be the reference of an external object or a specific data value set in an execution stage.
While the traditional algebraic expression operation characteristics are kept, the EL expression comprises other high-level operation functions including conditional selection operation of various expression selections and function operation of completing specific calculation rules.
The conditional expression takes # { and } as a start and end mark, the conditional expression internally comprises a plurality of conditional branches and one more default conditional branch, each branch corresponds to an EL expression, and the value of the whole conditional selection expression is the calculation result of the EL expression corresponding to the currently activated conditional branch, such as:
#{
- > Condition 1 EL expression 1;
- > Condition 2 EL expression 2;
- > < EL expression 3;
}
the function operation defines a specific calculation rule to meet the specific calculation requirement of the engineering cost, the grammatical structure of the function operation is compatible with C language, the expansion data type of BCL is supported, besides, the calling of the function also supports the input of EL expression as a parameter, the dynamic binding of the specified engineering data range and the EL expression can be realized, the code redundancy of the expression is further reduced, and the grammatical format is as follows:
sum (data source tag, data source alias,;
the fifth step: and generating corresponding BCL syntax tree nodes by using a syntax analyzer for all EL expressions, and further forming the whole BCL syntax tree. If grammar error exists in the process, executing the eleventh step;
the BCL syntax tree nodes comprise node value attributes, node type attributes, object address values quoted by the current nodes and association attributes of the left and right nodes. And when the word type is a variable operand, the parser transmits the word to the current report context module for variable matching. If the matching is unsuccessful, generating an unknown variable node; and if the matching is successful, creating a reference variable node, wherein the reference variable node represents the real data of the report data source, and acquiring the actual data of the report data source by referring to the variable node for calculation.
And analyzing a matching result according to the node type matching, and if the BCL element is a BCL element, firstly compiling the BCL element to generate a corresponding BCL object which is used as an external reference object of the current reference variable node. And if the node is the BCL object, directly pointing the current reference variable node to the BCL object.
And a sixth step: creating a corresponding BCL object, and associating a BCL syntax tree obtained after syntax analysis;
the seventh step: analyzing the generated BCL object to obtain a BCL syntax tree object to be calculated;
eighth step: interpreting and executing the current BCL syntax tree, processing nodes in the syntax tree according to a subsequent traversal mode, and providing the report object created in the second step as a context for the BCL to be executed until all BCL syntax trees are executed;
the processing involved in this process includes:
(1) and if the current node is a report function node, operating the report object according to the operation type and the provided parameter information. The syntax rule of the report function node is as follows:
addrow (;
and adding report row data, wherein the EL expression in the parameter can be nested and called with addfield fields, so that the filling of the cell data corresponding to the current row is realized.
addfield (column name,;
adding row and column field data of the report, wherein the parameter 1 is the name of the row and column field of the current report, and the parameter 2 is the field value of the row and column of the current report, and supporting an EL expression to realize complex data calculation.
deletebelow (); deleting report row data;
getowcount (); acquiring the number of report lines;
beginnionincell (start column name, end column name, merge type);
defining a starting merging cell of the report;
endunioncell (start column name, end column name merge type);
and defining the end merging cells of the report.
(2) If the current node is a traditional algebra operator node, respectively calculating and obtaining a node value as a left operand and a right operand, carrying out algebra operation, and taking an operation result value as the value of the current node;
(3) if the BCL variable elements are the BCL syntax trees corresponding to the filtering expressions, executing the eighth step on the BCL syntax trees corresponding to the filtering expressions, filtering the original BCL data source, and executing the eighth step on the BCL syntax tree objects corresponding to the value expressions to obtain the result values of the current variable objects;
(4) if the current node is a reference variable node, taking the value of the external reference object corresponding to the node as the result value of the current node;
(5) if the current node is a universal function node, matching and executing a corresponding function by using a function register;
(6) if the current node is an unknown variable node, matching and setting the attribute value of the data source in the current operating context;
the ninth step: judging whether error information exists or not, if so, turning to execute the tenth step; otherwise, executing the eleventh step;
the tenth step: the report data is persisted into a file, the execution task is completed, and the process is finished;
the eleventh step: and generating a corresponding error information report, and ending the process.
The invention has the beneficial effects that:
1. the report generation device and the report generation method can realize the report generation calculation logic and the generation rule to form the report BCL script file, achieve the aim of separating the report data calculation and generation rule from the report generation device, and realize the configurability of the report generation process. The report generation rule can be flexibly configured through the report BCL scripting device to obtain the expected report without re-publishing the report generation device, so that the flexibility of the report can be effectively improved, and the customized requirement of the report is met.
2. The report generation device and method provided by the invention are used for designing a set of report description language suitable for generating reports based on the engineering cost calculation description language extension aiming at the characteristics of the engineering cost reports to form a set of report generation device. By designing the EL expression with a high-level operation function, the diversified calculation unit with a certain structure and rules and the report generation operation logic unit, the requirements of the calculation and the generation diversity of the project cost report data can be met, and the expansibility is good.
3. The report BCL script execution device adopts an interpretation execution mode, the report BCL script is pre-compiled by the report BCL script editing device to form a report BCL object, the conversion between the report BCL object and a BCL script file is realized through the BCL script parsing device, the report BCL object is directly interpreted and executed when the report is generated by the report BCL script execution device, repeated compilation is not needed, one-time compilation and multiple interpretation execution are realized, and the report generation efficiency is effectively improved.
Drawings
FIG. 1 is a compilation execution engine diagram of report BCL data generation in an embodiment of the present invention;
FIG. 2 is a schematic diagram of a report generation process according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of a data source according to an embodiment of the present invention;
fig. 4 is a schematic diagram of report data padding according to an embodiment of the present invention.
Detailed Description
The following will incorporate embodiments of the present invention. The technical solutions in the embodiments of the present invention are clearly and completely described, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The embodiment of the invention takes the generation of a report of the cost of electric power engineering as an example, and provides a report generation device and a method implementation mechanism, as shown in fig. 1, the specific implementation process of the implementation mechanism comprises the following three steps, as can be known by referring to fig. 2:
step A1: compiling report data generation rules and styles, generating report BCL script files and format files
And compiling a report to generate the BCL script and the format by using the report BCL script editing device, wherein once the compiling of the report to generate the BCL script and the format is finished, the report can be repeatedly used.
Step A2: initializing a report object, a report output function, a general function and a report data source;
the report object is a logical unit containing report data, format and parameters, and comprises report page information, header format and report data. And loading the report format file by adopting a report format generating device to generate a report object.
The report output function can realize data filling to the report object.
The general function is used for calculating and processing BCL generated report data.
The report data source module is used for describing data of a project and a data range thereof, is an adhesive of a BCL language and the project data, and realizes the conversion of the analyzed project data into a data source required by report generation. Various types of reports can be generated by effectively organizing data sources and generating rules through report BCL scripts. The data source in the embodiment is shown in fig. 3, so that a complete data source required for constructing the project report can be realized, all reports required for generating the project cost can be ensured, and the method has good flexibility and expansibility.
Step A3: compiling a report BCL script;
the report BCL script defines the data content and the display form of report generation, obtains an executable BCL syntax tree by analyzing and compiling the BCL script, generates a BCL object with a hierarchical structure and stores the BCL object in a BCL document.
Step A4: interpreting and executing the BCL script, calculating report data in the execution process, calling a report function to fill the generated data into a report object
And loading the BCL script document generated in the step A3, forming a BCL object to be calculated and explaining and executing. During the execution process, the basic data is acquired from the report data source in the step A2, and the report object created in the step A2 is filled through a report output function.
The logic flow of BCL script interpretation execution is shown in FIG. 4:
a. b1 and B2 realize that the report output function is called to add report lines and fields in the execution process of the BCL;
b. step B3 obtains the needed data from the report data source by interpreting and executing the EL expression, and realizes the calculation of the cell data according to the syntax rule of the EL expression.
c. Step B4 is to fill the calculation result data into the report object cell
And circularly executing the steps to finally realize the output of the report data and obtain the report object filled with the data.
Step A5, persisting the report object in a file to obtain result data and complete report generation;
and D, persisting the report object filled with data obtained in the step A5 into a file, and outputting the report object as a final result, wherein the report file can be used as an interface of a system and can also be provided for a report control to display.

Claims (2)

1. A report generation device based on project cost calculation description language BCL is characterized in that the device is realized based on the project cost calculation description language BCL and the project cost report generation description language, and comprises: the report BCL script compiling device, the report BCL script analyzing device, the report format generating device, the report BCL script executing device and the report data storing device are arranged in the report format generating device;
the project cost calculation description language BCL comprises the following steps:
(1) the BCL describes an algebraic expression and an extended operation expression structure of a specific calculation algorithm rule, namely an EL expression; the EL expression is a complete description of a calculation algorithm rule, and takes $ { sum } as a starting mark and an ending mark, and the EL expression supports conditional selection operation for containing various conditional selection expressions and function operation for completing specific calculation rules while inheriting the operation characteristics of a traditional algebraic expression, contains diversified operands, supports numerical values, character strings and variable types, wherein the variable type operand is a typical embodiment that the EL expression supports dynamic data hooking, and the value of the variable type operand is the reference of an external object;
the conditional selection expression takes # { and } as a start mark and an end mark, the conditional selection expression internally comprises a plurality of conditional branches and at most one default conditional branch, each branch corresponds to one EL expression, and the value of the whole conditional selection expression is the calculation result of the EL expression corresponding to the current activated conditional branch:
#{
- > Condition 1 EL expression 1;
- > Condition 2 EL expression 2;
- > < EL expression 3;
}
the function operation defines a specific calculation rule to meet the specific calculation requirement of the engineering cost, the syntactic structure of the function is compatible with C language, the extended data type of BCL is supported, besides, the calling of the function also supports the input of EL expression as a parameter, the dynamic binding of the specified engineering data range and the EL expression can be realized, the code redundancy of the expression is further reduced, and the syntactic format is as follows:
sum (data source tag, data source alias,;
(2) analyzing the calculation requirement of the engineering cost, and determining other calculation logic units except the EL expression;
through summarizing and summarizing construction cost engineering data, calculation algorithms and processes, the complex calculation algorithms of construction cost of any engineering can be decomposed into the minimum atomic calculation logic units, namely: EL expressions, macro tables, variables, parameters, data sources, and packets; the macro table can completely express a calculation rule with recursion, multiple fields, multiple records and a summary relation; the data source is used for describing data of a project and a data range thereof, is an adhesive of BCL language and project data, and realizes the transmission of real data; the variable is a specific expense calculation structure comprising a data source, a data filtering algorithm and an expense calculation algorithm rule, and compared with a parameter only comprising a specific numerical value, the variable calculation has a certain sequence, is more complex and has strong functions; the package is a container of other atomic computation logic units, can define the action range of the computation logic units and shields naming conflicts;
(3) analyzing the output requirement of the project cost report, calculating the description language expansion based on the project cost, and determining the project cost report generation description language, wherein the project cost report generation description language specifically comprises an expansion EL expression, an EL expression report output function and a report output logic unit except the EL expression;
expanding an EL expression, defining EL expression report function operation and report output logic units on the basis of project cost calculation description language BCL by summarizing construction cost report output data, calculation algorithm and process;
the EL expression expands and adds the EL expression with process property on the basis of the engineering cost calculation description language, and is used for circularly executing the EL expression and the function and executing the report output related function; the nested EL expression call is supported, and the for loop syntax format is as follows:
for (data source tag, data source alias,;
the report output function is the extension of an EL expression in a BCL (project cost calculation description language), defines adding report lines, filling cells, acquiring cell data, deleting lines, acquiring line numbers, adding column definitions, starting merging marks and ending merging marks, can realize the filling of report data, and has the grammatical format:
addrow (;
addfield (column name,;
deleterow();
getrowcount();
addfielddef (column name, column type);
beginnionincell (start column name, end column name, merge type);
endunioncell (start column name, end column name, merge type);
the report output logic unit calculates the description language according to the construction cost; through summarizing and summarizing construction cost project report output data, calculation algorithms and processes, the project cost complex project report output algorithm of any project can be decomposed into the smallest atomic report output logic unit, namely: EL expression, variable, parameter, report data source, report object;
the EL expression, the variable and the parameter are consistent with the description of the project cost calculation language, the report data source is used for describing data of a project and a data range thereof, and the report data source is an adhesive of a BCL language and the project data and realizes the transmission of real data; the report object comprises a report format object, a report data object and a report generation parameter object, and is an adhesive of BCL language and project report output data, wherein the report format object realizes the transmission of report format data, the report data object realizes the transmission of real report data, and the report generation parameter object realizes the transmission of report generation parameters; the report data and the format are generated and filled in the report object through the BCL (project cost calculation description language), and the report data and the format are generated;
the report BCL script compiling device is a set of visual report generation script compiling device, and a user can visually edit report data and format generation rules through the device and generate a report BCL script which accords with the syntax of the engineering cost calculation description language;
the report BCL script compiling device is used for analyzing BCL elements and report elements in each report BCL script to compile and process to form a plurality of EL expression sets, each EL expression set is a syntax tree constructed by the BCL elements, the BCL elements are minimum units to be executed, and the interior of each EL expression set contains EL expression sets describing calculation algorithm rules and report function operation;
the report BCL script parsing device comprises a report BCL script file generator and a report BCL script parser and is used for realizing the interconversion between a report BCL element object and a compiled report BCL script file in the report BCL script compiling device; the report BCL element object can be effectively recorded or restored, repeated compiling of report BCL scripts is avoided, and the report generation efficiency is improved;
the report format generating device is used for realizing the mutual conversion between the report format object and the report format file in the report object and the editing of the report format information; the report format object comprises report page information, a report header name and a report header format, and the report format generating device is used for recording, acquiring and editing corresponding report format information;
the report BCL script execution device is used for explaining and executing the report BCL script compiling device to generate a report BCL object, executing and compiling an EL expression set and calling a report function to realize the storage of report data and a format into the report BCL object; the report BCL object is an EL expression set, and the internal process relates to a report BCL object interpretation execution module, a syntax analysis module, a node calculation module, an engineering data reactor module, a report format parameter reactor module, a data source module, an operation context module and a report function operation module; the report BCL object interpretation execution module is used for controlling the BCL object interpretation execution process, interpreting the BCL object into BCL element nodes to be calculated through the syntax analysis module, and calculating each node in a BCL syntax tree contained in the BCL object by using the node calculation module; the data source module is used for processing data provided by the engineering data reactor module and the report format parameter reactor module, comprises data source screening, traversing and grouping, and forms a data source which can be used by the node calculation module by operating the context module; the report function operation module comprises a report adding column, a report adding row, a report page changing operation and a report page changing operation, wherein the report adding column, the report adding row, the report page changing operation and the report page changing operation are used for realizing the storage of node calculation result data and a format in a report object according to different function operation logics;
the report data storage device is used for storing the report object into the report file.
2. A report generation method based on project cost calculation description language BCL is characterized by comprising the following steps:
the first step is as follows: compiling a report BCL script and a format file;
customizing an output rule according to the output requirement of each report by using a report scripting device, and finally generating a report BCL script for each report; the report scripting device provides a visual editing interface, and report generation rules can be flexibly configured through the visual editing interface; the report BCL script is an EL expression set, accords with the grammar rule of the engineering cost calculation description language, and has the grammar format as follows:
Figure FDA0002228935640000041
the EL expression is a complete description of a calculation algorithm rule, and takes $ { sum } as a starting mark and an ending mark, and the EL expression supports conditional selection operation for containing various conditional selection expressions and function operation for completing specific calculation rules while inheriting the operation characteristics of a traditional algebraic expression, contains diversified operands, supports numerical values, character strings and variable types, wherein the variable type operand is a typical embodiment that the EL expression supports dynamic data hooking, and the value of the variable type operand is the reference of an external object;
the conditional selection expression takes # { and } as a start mark and an end mark, the conditional selection expression internally comprises a plurality of conditional branches and at most one default conditional branch, each branch corresponds to one EL expression, and the value of the whole conditional selection expression is the calculation result of the EL expression corresponding to the current activated conditional branch:
#{
- > Condition 1 EL expression 1;
- > Condition 2 EL expression 2;
- > < EL expression 3;
}
the second step is that: creating a report object and loading a report configuration file;
the report object comprises a report format object, a report data object and a report generation parameter object, and is an adhesive of BCL language and engineering report output data, wherein the report format object realizes the transmission of report format data, the report data object realizes the transmission of real report data, and the report generation parameter object realizes the transmission of report generation parameters;
the report configuration file comprises report page information, report header configuration information and report generation parameter information;
the third step: loading a report BCL script;
the report BCL script is a script which is described by using a project cost calculation description language BCL and has a certain grammar rule, and a data generation rule of the report is defined inside the report;
the fourth step: performing lexical analysis on the BCL script to generate an EL expression;
the EL expression is a complete description of the report generation algorithm rule, and takes $ { sum } as a start mark and an end mark; the EL expression comprises operands with diversified types, and supports numerical values, character strings and variables, wherein the variable type operands are typical embodiments of the EL expression supporting dynamic data hooking, and the values of the variable type operands are references of external objects;
while the traditional algebraic expression operation characteristics are kept, the EL expression comprises the condition selection operation of various condition selection expressions and the function operation of a specific calculation rule;
the function operation defines a specific calculation rule to meet the specific calculation requirement of the engineering cost, the syntactic structure of the function is compatible with C language, the extended data type of BCL is supported, besides, the calling of the function also supports the input of EL expression as a parameter, the dynamic binding of the specified engineering data range and the EL expression can be realized, the code redundancy of the expression is further reduced, and the syntactic format is as follows:
sum (data source tag, data source alias,;
the fifth step: using a syntax analyzer to generate corresponding BCL syntax tree nodes by all EL expressions, and further forming a whole BCL syntax tree; if the grammar error exists in the step, turning to execute the eleventh step;
the BCL syntax tree node comprises a node value attribute, a node type attribute, an object address value quoted by the current node and the associated attributes of a left node and a right node; when the word type is a variable operand, the grammar analyzer transmits the word to a current report context module for variable matching, and if the matching is unsuccessful, an unknown variable node is generated; if the matching is successful, creating a reference variable node, wherein the reference variable node represents the real data of the report data source, and acquiring the actual data of the report data source by referring to the variable node for calculation;
according to the node type matching, analyzing a matching result, if the BCL element is a BCL element, firstly compiling the BCL element to generate a corresponding BCL object which is used as an external reference object of a current reference variable node, and if the BCL element is the BCL object, directly pointing the current reference variable node to the BCL object;
and a sixth step: creating a corresponding BCL object, and associating a BCL syntax tree obtained after syntax analysis;
the seventh step: analyzing the generated BCL object to obtain a BCL syntax tree object to be calculated;
eighth step: interpreting and executing the current BCL syntax tree, processing nodes in the syntax tree according to a subsequent traversal mode, and providing the report object created in the second step as a context for the BCL to be executed until all BCL syntax trees are executed;
the processing involved in this step includes:
(1) if the current node is a report function node, operating the report object according to the operation type and the provided parameter information;
the syntax rule of the report function node is as follows:
addrow (;
adding report row data, wherein the EL expression in the parameter can be nested to call addfield fields, so that the filling of cell data corresponding to the current row is realized;
addfield (column name,;
adding row and column field data of the report, wherein the parameter 1 is the name of the row and column field of the current report, and the parameter 2 is the field value of the row and column field of the current report, and supporting an EL expression to realize complex data calculation;
deletebelow (); deleting report row data;
getowcount (); acquiring the number of report lines;
beginnionincell (start column name, end column name, merge type);
defining a starting merging cell of the report;
endunioncell (start column name, end column name merge type);
defining a report form ending merging cell;
(2) if the current node is a traditional algebra operator node, respectively calculating and obtaining a node value as a left operand and a right operand, carrying out algebra operation, and taking an operation result value as the value of the current node;
(3) if the BCL variable elements are the BCL syntax trees corresponding to the filtering expressions, executing the eighth step on the BCL syntax trees corresponding to the filtering expressions, filtering the original BCL data source, and executing the eighth step on the BCL syntax tree objects corresponding to the value expressions to obtain the result values of the current variable objects;
(4) if the current node is a reference variable node, taking the value of the external reference object corresponding to the node as the result value of the current node;
(5) if the current node is a universal function node, matching and executing a corresponding function by using a function register;
(6) if the current node is an unknown variable node, matching and setting the attribute value of the data source in the current operating context;
the ninth step: judging whether error information exists or not, if so, turning to execute the tenth step; otherwise, executing the eleventh step;
the tenth step: the report data is persisted into a file, the execution task is completed, and the process is finished;
the eleventh step: and generating a corresponding error information report, and ending the process.
CN201611207627.XA 2016-12-23 2016-12-23 Report generation device and method based on project cost calculation description language BCL Active CN106648662B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611207627.XA CN106648662B (en) 2016-12-23 2016-12-23 Report generation device and method based on project cost calculation description language BCL

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611207627.XA CN106648662B (en) 2016-12-23 2016-12-23 Report generation device and method based on project cost calculation description language BCL

Publications (2)

Publication Number Publication Date
CN106648662A CN106648662A (en) 2017-05-10
CN106648662B true CN106648662B (en) 2020-02-21

Family

ID=58827642

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611207627.XA Active CN106648662B (en) 2016-12-23 2016-12-23 Report generation device and method based on project cost calculation description language BCL

Country Status (1)

Country Link
CN (1) CN106648662B (en)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107665404B (en) * 2017-09-25 2020-08-18 北京航空航天大学 Domain specific language description system and method for taxi supervision
CN108536660B (en) * 2018-04-03 2023-08-04 福建榕基软件工程有限公司 Custom report generation method and terminal
CN109240679A (en) * 2018-07-24 2019-01-18 阿里巴巴集团控股有限公司 The graphic method and device of script file
CN109934928B (en) * 2019-03-18 2023-04-14 江西博微新技术有限公司 Three-dimensional model simplification method based on skeletonization
CN110288222A (en) * 2019-06-20 2019-09-27 江西博微新技术有限公司 Power transformation engineering cost data generation system and method based on three-dimensional modeling
CN110532534A (en) * 2019-08-28 2019-12-03 广联达科技股份有限公司 The method and apparatus for generating engineering value document
CN110879936A (en) * 2019-10-08 2020-03-13 中国第一汽车股份有限公司 Method for batch generation and output of process control plan based on Teamcenter
CN111049936B (en) * 2019-12-31 2022-06-21 天地(常州)自动化股份有限公司 Coal mine underground multi-system fusion linkage control relationship configuration method and linkage intelligent gateway
CN114564624A (en) * 2022-02-11 2022-05-31 中国银联股份有限公司 Feature matching rule construction method, feature matching device, feature matching equipment and feature matching medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103019728A (en) * 2012-12-20 2013-04-03 厦门亿力吉奥信息科技有限公司 Effective complex report parsing engine and parsing method thereof
CN103645929A (en) * 2013-12-17 2014-03-19 江西博微新技术有限公司 BCL (base class library) project cost calculation description language and compiling and executing method thereof

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI430129B (en) * 2010-05-07 2014-03-11 Taiwan Biotech Co Ltd Integrated pharmaceutical research and development relevant numerical analysis and report generation service server, integrated pharmaceutical manufacturing and research and development numerical analysis method, and computer readable recording medium

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103019728A (en) * 2012-12-20 2013-04-03 厦门亿力吉奥信息科技有限公司 Effective complex report parsing engine and parsing method thereof
CN103645929A (en) * 2013-12-17 2014-03-19 江西博微新技术有限公司 BCL (base class library) project cost calculation description language and compiling and executing method thereof

Also Published As

Publication number Publication date
CN106648662A (en) 2017-05-10

Similar Documents

Publication Publication Date Title
CN106648662B (en) Report generation device and method based on project cost calculation description language BCL
CN110196719B (en) Business rule generation method and system based on natural language processing
CN107273117B (en) Programming-friendly agile code automatic generation system
US8286132B2 (en) Comparing and merging structured documents syntactically and semantically
CN110149800B (en) Apparatus for processing abstract syntax tree associated with source code of source program
CN110018829B (en) Method and device for improving execution efficiency of PL/SQL language interpreter
CN106293664A (en) Code generating method and device
EP3037958B1 (en) Declarative user interface representation conversion via hierarchical templates
US20080244541A1 (en) Code translator and method of automatically translating modeling language code to hardware language code
CN106951305B (en) Method for generating midCore script from QVT-R language based on model conversion
AU2004286677B2 (en) Method and system for reversible design tree transformations
CN111880777A (en) Program information issuing method and device and electronic equipment
US20210365258A1 (en) Method and system for updating legacy software
JP2009181446A (en) Program generating device and block diagram generating apparatus
CN109857458B (en) ANTLR-based AltaRica3.0 flattening transformation method
CN105556504A (en) Generating a logical representation from a physical flow
Reis et al. An on-the-fly grammar modification mechanism for composing and defining extensible languages
WO2012129864A1 (en) Method and system for expressing value-added service flow in the form of scripts
CN116126304A (en) XML-based extended Lustre code generation method
CN113655996B (en) Enterprise-level system generation method based on demand model
Lazar et al. Using a fUML Action Language to construct UML models
JP2007122187A (en) Program code generation device
CN114138425B (en) Method and device for generating form based on formula
CN113835688B (en) Object packaging method of scientific computing language interpreter
CN111679867B (en) Method for generating configuration data of embedded system

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
GR01 Patent grant
GR01 Patent grant