CN111538731B - Automatic report generation system for industrial data - Google Patents

Automatic report generation system for industrial data Download PDF

Info

Publication number
CN111538731B
CN111538731B CN202010405791.1A CN202010405791A CN111538731B CN 111538731 B CN111538731 B CN 111538731B CN 202010405791 A CN202010405791 A CN 202010405791A CN 111538731 B CN111538731 B CN 111538731B
Authority
CN
China
Prior art keywords
data
report
industrial
cells
industrial data
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
CN202010405791.1A
Other languages
Chinese (zh)
Other versions
CN111538731A (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.)
Shandong Huitai Intelligent Technology Co ltd
Original Assignee
Shandong Huitai Intelligent 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 Shandong Huitai Intelligent Technology Co ltd filed Critical Shandong Huitai Intelligent Technology Co ltd
Priority to CN202010405791.1A priority Critical patent/CN111538731B/en
Publication of CN111538731A publication Critical patent/CN111538731A/en
Application granted granted Critical
Publication of CN111538731B publication Critical patent/CN111538731B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/22Indexing; Data structures therefor; Storage structures
    • G06F16/2282Tablespace storage structures; Management thereof
    • 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/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • G06F40/183Tabulation, i.e. one-dimensional positioning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • G06F40/186Templates
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/02Total factory control, e.g. smart factories, flexible manufacturing systems [FMS] or integrated manufacturing systems [IMS]

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Computational Linguistics (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • General Health & Medical Sciences (AREA)
  • Software Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention discloses an automatic report generation system for industrial data, which comprises an industrial data server, a distributed processing server, a report server, an industrial data database and a report database; the industrial data server is used for acquiring industrial data, driving the distributed processing server to process and package the distributed industrial data according to a pre-configured data processing rule, and inputting the processed and packaged industrial data into the industrial data database; the report server is used for selecting one of the automatically generated industrial report template files according to a preset timing task, calling corresponding industrial data, and filling or replacing part or all of active cells in the industrial report template file after processing to generate a report file. The invention can overcome the complicated work of manual calculation and input by automatically acquiring industrial data and automatically generating the report, so that the report generation mode and the whole data and report processing process are more flexible, the invention has strong adaptability, and the data processing pressure is relieved by adopting the distributed processing server.

Description

Automatic report generation system for industrial data
Technical Field
The invention relates to the technical field of industrial data report processing, in particular to an automatic industrial data report generation system.
Background
In the industrial production process, a large amount of production is often accompanied by consumption of data, and the display of the data is often displayed in the form of a report. In the traditional mode, workers at all positions transcribe the energy or material data used, produced and consumed by all the equipment, and the corresponding departments collect the energy or material data manually, calculate and input the energy or material data, so that the operation is complicated and the huge workload is accompanied.
The invention patent with the patent number of CN109947810A discloses a real-time acquisition system for industrial equipment data, which comprises the following components: the distributed acquisition nodes are arranged corresponding to each workshop in the factory, a node server is arranged in the distributed acquisition nodes, and the node server comprises a data acquisition unit; the data acquisition unit is used for acquiring real-time data of industrial equipment in the workshop, storing the real-time data into the node server, and preprocessing the real-time data by the node server to generate a data preprocessing result; the data center comprises a data acquisition server and a web server; the data acquisition server is used for storing and further processing the data preprocessing results transmitted by the node servers and generating a data report; the web server is used for presenting the data report in web form for viewing by a user, and is also used for providing a configuration interface for the user to configure parameters of the data acquisition unit. However, in the invention, the data report is generated in a single mode, and as the processing amount of industrial data is increased, the variety is increased, and the time spent by staff on the processing of the data report format is increased. Aiming at the problems, the invention patent with the patent number of CN109446507A discloses a report construction method and a report construction device, wherein the method comprises the following steps: acquiring each target analysis rule contained in a report template to be constructed; searching a target data value corresponding to each target analysis rule; writing each target data value into a cell corresponding to the report template to be constructed to obtain a target report template to be constructed; and converting the target report template to be constructed into a target report. According to the construction method, the target data values corresponding to the target analysis rules in the report template to be constructed are obtained, the target report template to be constructed is obtained by writing the target data values into the cells corresponding to the report template to be constructed, the target report template to be constructed is converted into the target report, the report can be automatically generated as long as the report template to be constructed exists, and the report is constructed without development or implementation by program developers or personnel with programming experience. However, the following two problems still exist at present:
First, the target parsing rule in the report is usually a specific value that is already calculated in the corresponding database, and it is difficult to process the data again in the report generation process.
Secondly, based on the first problem, the data processing and report generation contents are not effectively separated, along with the increasing processing capacity of industrial data, the report data is easy to be abnormal when complex business logic is applied to process, and meanwhile, the data processing strategy and the template generation rule are difficult to be respectively revised, so that the updating difficulty is high.
Disclosure of Invention
The invention aims to provide an automatic report generation system for industrial data, which aims to overcome the complicated work of manual calculation and input by automatically acquiring the industrial data and automatically generating a report; the industrial data is dynamic and diversified in format, the report data and the report format are effectively separated completely, and independent revisions of the industrial data and the report are conveniently carried out by a user respectively, so that the report generation mode and the whole data and report processing process are more flexible, and the method has strong adaptability; meanwhile, the industrial data calculation rule is set in a special distributed processing server for processing, so that the processing speed is improved, the data processing pressure of the report database is relieved, and the problem that the report database is easy to be abnormal when complex business logic is applied to process the report data is avoided.
In order to achieve the above objective, in combination with fig. 1, the present invention proposes an automatic industrial data report generation system, which includes an industrial data server, a distribution processing server, a report server, an industrial data database and a report database;
the industrial data server is used for acquiring industrial data of a corresponding data structure from each industrial device in a timing/real-time manner, distributing the acquired industrial data to a plurality of distributed processing servers, driving each distributed processing server to process the distributed industrial data according to a pre-configured data processing rule, packaging the processed industrial data by taking the pre-configured data structure as a template, and inputting the packaged industrial data into the industrial data database;
the report server is used for selecting one of the automatically generated industrial report template files according to a preset timing task, calling corresponding industrial data from an industrial data database, filling or replacing part or all of active cells in the industrial report template file after processing to generate a final report file, and storing the generated report file into the corresponding report database;
The industrial report template file is based on an Excel table, and an external custom plug-in is added into part or all Excel cells, wherein the part of the cells are provided with corresponding calculation strategies.
As a preferred example thereof, the industrial data server includes an industrial data interface, an industrial data processing module, an industrial data modeling module, and an industrial data computing engine;
the industrial data interfaces are respectively in butt joint with the data interfaces of all the industrial equipment and are used for acquiring relevant industrial data from all the industrial equipment;
the industrial data modeling module is used for defining and configuring a data structure of each type of industrial data;
the industrial data calculation engine is used for configuring the processing strategy of the industrial equipment, and the configuration content comprises data processing rules of related industrial data, calling frequency of each industrial equipment data interface and generation time of the related industrial data;
the industrial data processing module is respectively connected with the industrial data interface, the industrial data modeling module and the industrial data computing engine and is used for acquiring corresponding industrial data from each industrial data interface within a set time range according to a processing strategy configured by the industrial data computing engine, distributing the acquired industrial data to the distributed processing server for processing, packaging the processed industrial data by taking a data structure configured by the industrial data modeling module as a template, and inputting the packaged industrial data into the industrial data database.
As a preferable example, the report server comprises an industrial report template generation module, a report file generation module and a timing task setting module;
the industrial report module generating module is used for adding an external custom plug-in into part or all Excel cells based on an Excel table, setting cell calculation strategies of part of the Excel cells, generating a required industrial report template file, setting corresponding report template uploading attributes for the generated industrial report template file, uploading the industrial report template file to the report file generating module, and adding data of the report template uploading attributes in a report server;
the report file generation module is used for selecting one of the industrial report template files from the report module database according to a preset timing task, and acquiring corresponding data from the industrial data database to fill part or all of the movable cells in the industrial report template file so as to generate a final report file;
the timing task setting module is used for setting a corresponding timing task for each industrial report template, the timing task is used for triggering a report engine interface, inquiring a report database according to report parameters contained in the timing task, judging whether a corresponding report file is generated, calling the report file generating module through the report generating interface when a related report is not generated, taking the industrial report template corresponding to the timing task as a generating report structure basis, reading an external custom plug-in contained in each cell of the industrial report template, calling corresponding industrial data from the industrial database, filling the corresponding industrial data into the corresponding cells one by one, and carrying out related calculation processing on part of the cells according to a preset cell calculation strategy.
As a preferred example, the report file generating module classifies the external custom plug-ins in each cell, respectively constructs a common instruction set and a circulation instruction set, and respectively executes the instructions of each set according to the constructed instruction set;
types of the external custom plug-ins include: direct acquisition, conditional judgment acquisition, cyclic acquisition and custom function acquisition;
the direct acquisition refers to direct variable value replacement;
the condition judgment type acquisition refers to the replacement of a variable value when a set condition is met;
the cyclic acquisition refers to variable value replacement based on cyclic variation;
the custom function obtaining refers to variable value replacement by calling a corresponding custom function.
As a preferable example, the custom function obtaining means that the function expression of the corresponding cell in the industrial report template file is extracted through the regular expression, the extracted function expression is stored, and then the following operations are performed one by one or in parallel:
and calling and executing a corresponding external custom plug-in Java according to the function input value stored in the preset Jexl Context object.
As a preferred example, the process of calling and executing the corresponding external custom plug-in Java according to the function input value stored in the preset Jexl Context object includes the following steps:
s11, acquiring parameters transmitted in a custom function, wherein the parameters comprise names of materials, workshops and equipment, and executing service codes of the parameters to acquire a function return value, and the function return value is obtained by calling a report database or an industrial data server;
s12, taking the obtained function return value as the current variable value, and replacing a corresponding function expression in the industrial report template file, wherein in the replacement process, the content in the industrial report template file is instantiated into a memory through an Apache POI interface, and a corresponding instruction is executed based on the above related instruction set;
when the function return value is obtained by calling a report database, the acquired parameters of the external custom plug-in are transmitted into the report database, return data are acquired, secondary processing and packaging including calculation, conversion and splicing are carried out on the return data, and the packaged data are returned as the function return value;
When the function return value is obtained by calling the industrial data server, the acquired parameters of the external custom plug-in are packaged into first Json format data, the packaged first Json format data are transmitted to the corresponding industrial data server, the second Json format data returned by the first Json format data are received, the received second Json format data are subjected to secondary processing, the returned data are converted through an Apache Json interface, the required result value is obtained, secondary processing and packaging including calculation, conversion and splicing are performed on the result value, and the packaged data are returned as the function return value.
As a preferred example, if a merging instruction is recorded in the content of a cell, the column number of the cell is recorded in a column number set to be vertically merged, where the merging instruction refers to any column of data that can identify a column in which the merging instruction is located as a column to be vertically merged, and then, for the column number set to be vertically merged, the vertical merging of the cells is performed through an Apache POI interface, where the vertical merging refers to merging of cells with the same content in any one column.
As a preferred example, the performing, by using an Apache POI interface, vertical merging of the cells for the to-be-vertically merged column number set refers to traversing each column of the cells column by column according to the column number in the to-be-vertically merged column number set, and performing corresponding vertical merging operation on the cells according to the actual merging attribute;
wherein the process of traversing the rows of cells row by row for each current column comprises:
(1) If the number of the cells in the N-th row is not less than the column number of the current column, the content of the cells in the N-th row in the current column is the same as the content of the current initial value, and the current initial row number is not a preset value, determining that the initial row number is unchanged, and adding one to the cut-off row number;
(2) If the number of the cells in the N-th row is not less than the column number of the current column, the content of the cells in the N-th row in the current column is the same as the content of the current initial value, and the current initial row number is a preset value, setting the initial row number and the cut-off row number as N;
(3) If the number of the cells in the N-th row is not less than the column number of the current column, the content of the cells in the N-th row in the current column is different from the content of the current initial value, and the current initial row number is less than the cut-off row number, merging the corresponding cells in the current column through an Apache POI interface according to the current initial row number and the cut-off row number, setting the initial row number and the cut-off row number as N, and setting the initial value as the content of the cells in the N-th row in the current column;
(4) If the number of the cells in the N-th row is not less than the column number of the current column, the content of the cells in the N-th row in the current column is different from the content of the current initial value, and the current initial row number is the preset value, setting the initial row number and the cut-off row number as N, and setting the initial value as the content of the cells in the N-th row in the current column;
(5) If the number of the N-th row of cells is smaller than the column number of the current column and the current starting row number is smaller than the cut-off row number, merging the corresponding cells in the current column through an Apache POI interface according to the current starting row number and the cut-off row number, and setting the starting row number and the cut-off row number as the preset value after merging;
(6) If the number of the cells in the N-th row is smaller than the column number of the current column and the current starting row number is not smaller than the cut-off row number, the next row of cells is continuously traversed.
As a preferred example, the process of traversing the rows of cells row by row for each current column further includes:
(7) If the current starting line number is smaller than the ending line number, merging a plurality of corresponding cells in the current column through the Apache POI interface according to the current starting line number and the ending line number;
(8) And for the current row, if the content of the M row of cells is null, assigning the content of the M row of cells to be null so that a plurality of continuous cells with null assignment can be combined through the Apache POI interface, and the preset value is-1.
As a preferred example, the report server includes a report display and editing module, configured to display the generated report file through a browser, and provide a corresponding editing function entry, where the editing function includes saving, single calculation, total calculation, and reacquiring;
the storage function is used for storing the generated report file into a report database;
the single computing function is used for restoring the content of one of the modified cells selected by the user into original data;
the all calculation function is used for restoring the contents of all the modified cells into original data;
the re-acquisition function is used for clearing all data in the saved report files in the report database and re-adding when the report content is abnormal or restored to original data after one or more modifications and storage.
Compared with the prior art, the technical scheme of the invention has the remarkable beneficial effects that:
(1) The complex work of manual calculation and input is overcome by automatically acquiring industrial data and automatically generating a report.
(2) The working data are dynamic and the formats are diversified, so that the report data and the report formats are completely separated.
(3) Meanwhile, the industrial data calculation rule is set in a special distributed processing server for processing, so that the processing speed is improved, the data processing pressure of the report database is relieved, and the problem that the report database is easy to be abnormal when complex business logic is applied to process the report data is avoided.
(4) By adding the external custom plug-in and the related cell calculation strategy in the report template file, compared with the traditional input mode, the method and the system can carry out secondary processing on the processed and packaged industrial data in the report generation process, realize effective separation of the industrial data processing process and the report data processing process, facilitate independent revision of the industrial data and the report by users respectively, enable the report generation mode and the whole data and report processing process to be more flexible, and have strong adaptability.
(5) In the report generation process, the call data can be processed for the second time, the report is optimized, and meanwhile, the processing efficiency is improved through the mode of combining instructions to generate an instruction set and the like.
It should be understood that all combinations of the foregoing concepts, as well as additional concepts described in more detail below, may be considered a part of the inventive subject matter of the present disclosure as long as such concepts are not mutually inconsistent. In addition, all combinations of claimed subject matter are considered part of the disclosed inventive subject matter.
The foregoing and other aspects, embodiments, and features of the present teachings will be more fully understood from the following description, taken together with the accompanying drawings. Other additional aspects of the invention, such as features and/or advantages of the exemplary embodiments, will be apparent from the description which follows, or may be learned by practice of the embodiments according to the teachings of the invention.
Drawings
The drawings are not intended to be drawn to scale. In the drawings, each identical or nearly identical component that is illustrated in various figures may be represented by a like numeral. For purposes of clarity, not every component may be labeled in every drawing. Embodiments of various aspects of the invention will now be described, by way of example, with reference to the accompanying drawings, in which:
FIG. 1 is a schematic diagram of an automatic industrial data reporting system of the present invention.
Fig. 2 is a schematic diagram of the structure of an industrial data server of the present invention.
FIG. 3 is a flow diagram of a single report engine of the present invention.
Detailed Description
For a better understanding of the technical content of the present invention, specific examples are set forth below, along with the accompanying drawings.
In combination with fig. 1, the invention provides an automatic report generation system for industrial data, which comprises an industrial data server, a distributed processing server, a report server, an industrial data database and a report database.
The industrial data server is used for acquiring industrial data of a corresponding data structure from each industrial device in a timing/real-time manner, distributing the acquired industrial data to a plurality of distributed processing servers, driving each distributed processing server to process the distributed industrial data according to a pre-configured data processing rule, packaging the processed industrial data by taking the pre-configured data structure as a template, and inputting the packaged industrial data into the industrial data database.
The report server is used for selecting one of the automatically generated industrial report template files according to a preset timing task, calling corresponding industrial data from an industrial data database, filling or replacing part or all of active cells in the industrial report template file after processing to generate a final report file, and storing the generated report file into the corresponding report database.
The industrial report template file is based on an Excel table, and an external custom plug-in is added into part or all Excel cells, wherein the part of the cells are provided with corresponding calculation strategies.
1. Generating industrial data
The industrial data server includes an industrial data interface, an industrial data processing module, an industrial data modeling module, and an industrial data computing engine.
The industrial data interfaces are respectively in butt joint with the data interfaces of the industrial devices and are used for acquiring relevant industrial data from the industrial devices.
The industrial data modeling module is used for defining and configuring a data structure of each type of industrial data.
The industrial data calculation engine is used for configuring the processing strategy of the industrial equipment, and the configuration content comprises data processing rules of related industrial data, calling frequency of each industrial equipment data interface and generation time of the related industrial data.
The industrial data processing module is respectively connected with the industrial data interface, the industrial data modeling module and the industrial data computing engine and is used for acquiring corresponding industrial data from each industrial data interface within a set time range according to a processing strategy configured by the industrial data computing engine, distributing the acquired industrial data to the distributed processing server for processing, packaging the processed industrial data by taking a data structure configured by the industrial data modeling module as a template, and inputting the packaged industrial data into the industrial data database.
The data produced, consumed and used in industry originate from various industrial devices, the interfaces used by each industrial device are different, and the structures of corresponding industrial data are also different, so that an industrial data model is firstly created through an industrial data modeling module and used for configuring the data structures. The industrial data computing engine is used for configuring the equipment, such as configuring data processing rules of corresponding industrial data, calling frequency of a corresponding industrial equipment data interface, generation time or generation period of related industrial data and the like. Based on the method, an industrial data calculation engine is used as a basis, industrial data modeling is used as a template, industrial data are acquired from each equipment interface and processed, and the processed data are packaged and then are input into an industrial data database. FIG. 2 is a schematic diagram of an industrial data server in which industrial data is modeled as entity classes for defining the industrial data; the industrial data calculation engine is used for configuring an industrial data calculation algorithm and the like; the industrial data interface is a service module, is in butt joint with the data interfaces of various industrial equipment, and carries out relevant processing on data according to the configuration content of an industrial data calculation engine, and comprises the steps of calling the industrial data interface to acquire the data, packaging the data by taking industrial data modeling as a template, storing the data in an industrial data database, and simultaneously reading the data in the industrial data database by the industrial data interface and distributing the data to a distributed processing server for processing.
2. Generating industrial report
The report server comprises an industrial report template generation module, a report file generation module and a timing task setting module.
The industrial report module generating module is used for adding an external custom plug-in into part or all Excel cells based on an Excel table, setting cell calculation strategies of part of the Excel cells, generating a required industrial report template file, setting corresponding report template uploading attributes for the generated industrial report template file, uploading the industrial report template file to the report file generating module, and adding data of the report template uploading attributes in a report server.
The report file generation module is used for selecting one of the industrial report template files from the report module database according to a preset timing task, and acquiring corresponding data from the industrial data database to fill part or all of the movable cells in the industrial report template file so as to generate a final report file.
The timing task setting module is used for setting a corresponding timing task for each industrial report template, the timing task is used for triggering a report engine interface, inquiring a report database according to report parameters contained in the timing task, judging whether a corresponding report file is generated, calling the report file generating module through the report generating interface when a related report is not generated, taking the industrial report template corresponding to the timing task as a generating report structure basis, reading an external custom plug-in contained in each cell of the industrial report template, calling corresponding industrial data from the industrial database, filling the corresponding industrial data into the corresponding cells one by one, and carrying out related calculation processing on part of the cells according to a preset cell calculation strategy.
The distributed processing servers are connected with the industrial data processing module, the industrial data processing module distributes the acquired industrial data to a plurality of distributed processing servers, and each distributed processing server is driven to process the distributed industrial data according to a processing strategy configured by the industrial data computing engine. In some examples, the industrial data is summarized into an industrial data database through an industrial data server, then the industrial data is distributed to a distribution processing server through the industrial data server, the distribution processing server can process the distributed industrial data, and calculate and obtain a calculation result according to a preset calculation engine, and a report server is used for counting the calculation result to obtain a report. According to the invention, the data processing calculation rules are separated from the data, and the calculation rules are arranged in the special distributed processing server for processing, so that the processing speed is improved, the data processing pressure of the report server is relieved, and the problem that the report server is easy to cause abnormality when complex business logic is applied to process the report data is avoided.
With reference to fig. 3, on the basis of the foregoing structure, the report generation process includes the following steps:
step one, setting a report template
A template document is understood to be a document whose structure is associated with the final desired form, which may have a plurality of cells, for example, formed as a table, at least some of which have corresponding instructions recorded therein; the content of a part of the cells can be unchanged, and the first cell in a row or a column can record the meaning of the row, so that the replacement or merging of data is not needed, and further, an instruction can not be recorded.
In the specific implementation process, the instructions in each cell can be classified, so that a common instruction set and a circulating instruction set are respectively constructed, and the instructions in each set can be conveniently executed based on the instruction sets respectively through the construction of the instruction sets.
The variable value can be obtained by at least one of the following modes:
1) Direct acquisition: the process of replacing instructions recorded in a cell based on this type of variable value can be understood as direct variable value replacement;
2) Condition judgment type acquisition: based on the process of the instruction recorded in the variable value replacement unit cell of the type, when the required condition is met, the replacement of the variable value is performed, and the replacement of the variable value of the condition judgment formula can be understood;
3) And (3) circularly obtaining: the process of replacing instructions recorded in a cell based on this type of variable value, determined from cyclic variations, can be understood as cyclic variable value replacement;
4) And (3) obtaining a custom function: the process of replacing the instructions recorded in the cells with the variable values based on the type can be understood as the variable value replacement based on the custom function by calling the corresponding custom function.
In a specific implementation, any one or more of the variable values and fixed values can be used to make an Excel report template file.
Step two, uploading the report template and setting uploading attribute
In specific implementation, firstly, report template uploading attributes are set, and the specific attributes are as follows: parameters such as a path in which the template is stored, a template name, a company to which the template belongs, a workshop to which the template belongs, a post to which the template belongs, and the like; setting storage attributes of the report, wherein the specific attributes are as follows: parameters such as report templates, numerical values, material types, column types, data time and the like.
And (2) uploading the report template generated in the step (1) to a report engine server, adding data of an uploading attribute of the report template to the report server, and storing the report template file in a designated file path.
Step three, configuring report engine
In specific implementation, a timing task is configured for each report template, and specific attributes are as follows: timing task name, timing task execution time, belonging post, and executing report template.
And then executing the timing task, calling a report engine interface through the timing task, and inputting the parameters of the time interval, the workshop, the company and the like into a report database to perform data query. The report database receives parameters transmitted by the interface, performs SQL splicing, executes query sentences to acquire data, encapsulates the data and returns the encapsulated data. The report engine acquires the data returned by the report database query through the interface of the timing task and stores the data. And comparing the transmitted parameters with the data returned from the report database, judging which reports are generated according to the time interval, the workshop and other parameters, if the reports are generated, not performing generating operation, preventing the repeated generation of the reports, and if the reports are not generated, calling a report generating interface.
And finally, according to the report templates associated with the timing tasks as parameters, the parameters are transmitted into a report database, a report storage path is obtained according to the report uploading attributes set in the step 2, a final report template file is obtained through the obtained report template storage path, and finally, an Excel report file is generated through an Apache POI interface. The Apache POI can be understood as: is a free open-source cross-platform Java API written in Java, and the Apache POI provides an API interface for operating Microsoft Office.
The specific steps for generating the Excel report file are as follows:
firstly, obtaining the content of an Excel report template through an Apache POI, and obtaining data in each cell in a report. The direct variable value replacement, the variable value replacement of the conditional judgment formula, and the cyclic variable value replacement in step 1 are known to those skilled in the art, and a desired scheme is obtained, so that the description is not given here. The following description is directed primarily to variable value replacement based on custom functions.
The variable values of the custom functions are replaced, the function expressions in the template file can be extracted through the regular expressions, and the extracted function expressions can be stored, so that calculation can be conveniently performed one by one or in parallel. After this step, it may comprise: according to the function input value stored in the preset Jexl Context object, calling the corresponding self-defining method in Java, and executing the corresponding self-defining method in Java comprises the following specific steps:
firstly, acquiring parameters transmitted in a custom function, such as names of materials, workshops, equipment and the like, and executing service codes to acquire a return value, wherein the return value can be obtained by at least one of the following modes:
1) Calling a report database to obtain:
the parameters of the obtained self-defining method are transmitted into a report database, returned data are obtained through parameters such as names of materials, workshops, equipment and the like, and the returned data can be subjected to secondary processing and packaging in modes such as calculation, conversion, splicing and the like, and final data are returned.
2) Invoking industrial data server to acquire:
and packaging the acquired parameters of the self-defined method into Json format data, transmitting the packaged data to an interface in a corresponding industrial data server, receiving the Json format data returned by the interface, then performing secondary processing on the received Json format data, converting the returned data through an Apache Json interface, acquiring a required result value, performing final processing and packaging in the modes of converting, splicing and the like, and returning the final data.
And obtaining a corresponding function return value as the current variable value through any one or more modes. The function expression in the template document may be replaced with a function return value. In the replacement process, the content in the template document is instantiated into the memory through the Apache POI interface, and then the instruction is executed based on the instruction set involved above.
If the content in the cell records the merging instruction, the column number of the cell is recorded in the column number set to be vertically merged. The merging instruction is understood as any data that can identify a column in which the merging instruction is located as a column to be vertically merged, and may be recorded in any cell in the column, for example, a single row may be used to represent a column in which the column needs to perform vertical merging. In a specific implementation, the merge instruction may be, for example, a $ { m } instruction. Further, it can be determined whether there is a $ { m } instruction in a cell, and if so, the column number of the corresponding cell is recorded into the set of column numbers to be vertically merged. And then, according to the column number set to be vertically combined, vertically combining the cells through the Apache POI. The above vertical merging is understood to mean that any number of cells of the same content can be merged in one column. Through vertical merging, the whole table is more logically clear and attractive, so that the final report can more clearly list data. The specific processing logic of the vertical merging may be varied, so long as the vertical merging is completed, without departing from the description of the present embodiment.
According to the column number set to be vertically combined, the Apache POI is used for vertically combining the cells, and the specific steps are as follows:
traversing each column of unit cells column by column according to the column numbers in the column number set to be vertically combined; traversing each row of cells row by row for each current column; if the partial cells of the current column need to be combined, combining the partial cells of the current column through the Apache POI according to the current starting line number and the ending line number.
When traversing each row of cells row by row for each current column, the method comprises the following steps:
if the number of the cells in the N-th row is not less than the column number of the current column, the content of the cells in the N-th row in the current column is the same as the content of the current initial value, and the current initial row number is not a preset value, determining that the initial row number is unchanged, and adding one to the cut-off row number;
if the number of the cells in the N-th row is not less than the column number of the current column, the content of the cells in the N-th row in the current column is the same as the content of the current initial value, and the current initial row number is a preset value, setting the initial row number and the cut-off row number as N;
if the number of the cells in the N-th row is not less than the column number of the current column, the content of the cells in the N-th row in the current column is different from the content of the current initial value, and the current starting row number is less than the cut-off row number, merging the corresponding cells in the current column through Apache POI according to the current starting row number and the cut-off row number, setting the starting row number and the cut-off row number as N, and setting the initial value as the content of the cells in the N-th row in the current column;
If the number of the cells in the N-th row is not less than the column number of the current column, the content of the cells in the N-th row in the current column is different from the content of the current initial value, and the current initial row number is the preset value, setting the initial row number and the cut-off row number as N, and setting the initial value as the content of the cells in the N-th row in the current column;
if the number of the N-th row of cells is smaller than the column number of the current column and the current starting row number is smaller than the cut-off row number, merging the corresponding cells in the current column through Apache POI according to the current starting row number and the cut-off row number, and setting the starting row number and the cut-off row number as the preset value after merging;
if the number of the cells in the N-th row is smaller than the column number of the current column and the current starting row number is not smaller than the cut-off row number, the next row of cells is continuously traversed.
When traversing each row of cells row by row for each current column, the method further comprises:
and if the current starting line number is smaller than the ending line number aiming at the current column after traversing all lines, merging a plurality of corresponding cells in the current column through the Apache POI according to the current starting line number and the ending line number.
When traversing each row of cells row by row for each current column, the method further comprises:
and for the current row, if the content of the M row of cells is null, assigning the content of the M row of cells to be null so that a plurality of continuous cells with null assignment can be combined through the Apache POI. The preset value is-1.
Step four, displaying report forms and providing editing function
After the implementation, the report generated in the step 3 can be displayed through a browser for the user to review, and the report can be stored, calculated singly, calculated entirely, acquired again and the like while being displayed. The method comprises the following specific steps:
1) And (3) preserving:
the user can modify the numerical content in the displayed report, after modification, the user can click a save button to perform storage operation, and after clicking, the user can send data to a report database to be stored.
2) Single calculation:
when the user modifies the data in batches and wants to restore the content in a certain modified cell, the cell can be selected, a single calculation button is clicked, and the content in the cell is restored into the original data.
3) All the calculation:
after the user modifies the data in batches, if the user wants to restore the modified content completely, clicking all calculation buttons, and restoring the content in the modified cells to the original data completely.
4) And (5) re-acquisition:
the report may be used when at least one of the following conditions exists, specifically:
1. when the generated report content is abnormal.
2. When the report content is restored to the most original data after being modified one or more times and stored.
When one or more of the above conditions exist, the user clicks the reacquire button, the report content will be entirely regenerated, and all data will be added again after being purged from the report database.
Aspects of the invention are described in this disclosure with reference to the drawings, in which are shown a number of illustrative embodiments. The embodiments of the present disclosure need not be defined to include all aspects of the present invention. It should be understood that the various concepts and embodiments described above, as well as those described in more detail below, may be implemented in any of a number of ways, as the disclosed concepts and embodiments are not limited to any implementation. Additionally, some aspects of the disclosure may be used alone or in any suitable combination with other aspects of the disclosure.
While the invention has been described with reference to preferred embodiments, it is not intended to be limiting. Those skilled in the art will appreciate that various modifications and adaptations can be made without departing from the spirit and scope of the present invention. Accordingly, the scope of the invention is defined by the appended claims.

Claims (8)

1. An automatic report generation system for industrial data is characterized by comprising an industrial data server, a distributed processing server, a report server, an industrial data database and a report database;
the industrial data server is used for acquiring industrial data of a corresponding data structure from each industrial device in a timing/real-time manner, distributing the acquired industrial data to a plurality of distributed processing servers, driving each distributed processing server to process the distributed industrial data according to a pre-configured data processing rule, packaging the processed industrial data by taking the pre-configured data structure as a template, and inputting the packaged industrial data into the industrial data database;
the report server is used for selecting one of the automatically generated industrial report template files according to a preset timing task, calling corresponding industrial data from an industrial data database, filling or replacing part or all of active cells in the industrial report template file after processing to generate a final report file, and storing the generated report file into the corresponding report database;
the industrial report template file is based on an Excel table, and an external custom plug-in is added into part or all Excel cells, wherein the part of cells are provided with corresponding calculation strategies;
Types of the external custom plug-ins include: direct acquisition, conditional judgment acquisition, cyclic acquisition and custom function acquisition;
the direct acquisition refers to direct variable value replacement;
the condition judgment type acquisition refers to the replacement of a variable value when a set condition is met;
the cyclic acquisition refers to variable value replacement based on cyclic variation;
the custom function obtaining refers to variable value replacement by calling a corresponding custom function;
the custom function obtaining means that the function expression of the corresponding cell in the industrial report template file is extracted through the regular expression, the extracted function expression is stored, and then the following operations are carried out one by one or in parallel:
calling and executing a corresponding external custom plug-in Java according to a function input value stored in a preset Jexl Context object;
the process of calling and executing the corresponding external custom plug-in Java according to the function input value stored in the preset Jexl Context object comprises the following steps:
s11, acquiring parameters transmitted in a custom function, wherein the parameters comprise names of materials, workshops and equipment, and executing service codes of the parameters to acquire a function return value, and the function return value is obtained by calling a report database or an industrial data server;
S12, taking the obtained function return value as a current variable value, replacing a corresponding function expression in the industrial report template file, wherein in the replacement process, instantiating the content in the industrial report template file into a memory through an Apache POI interface, and executing a corresponding instruction based on the related instruction set;
when the function return value is obtained by calling a report database, the acquired parameters of the external custom plug-in are transmitted into the report database, return data are acquired, secondary processing and packaging including calculation, conversion and splicing are carried out on the return data, and the packaged data are returned as the function return value;
when the function return value is obtained by calling the industrial data server, the acquired parameters of the external custom plug-in are packaged into first Json format data, the packaged first Json format data are transmitted to the corresponding industrial data server, the second Json format data returned by the first Json format data are received, the received second Json format data are subjected to secondary processing, the returned data are converted through an Apache Json interface, the required result value is obtained, secondary processing and packaging including calculation, conversion and splicing are performed on the result value, and the packaged data are returned as the function return value.
2. The automated industrial data generation reporting system of claim 1 wherein the industrial data server comprises an industrial data interface, an industrial data processing module, an industrial data modeling module, and an industrial data computing engine;
the industrial data interfaces are respectively in butt joint with the data interfaces of all the industrial equipment and are used for acquiring relevant industrial data from all the industrial equipment;
the industrial data modeling module is used for defining and configuring a data structure of each type of industrial data;
the industrial data calculation engine is used for configuring the processing strategy of the industrial equipment, and the configuration content comprises data processing rules of related industrial data, calling frequency of each industrial equipment data interface and generation time of the related industrial data;
the industrial data processing module is respectively connected with the industrial data interface, the industrial data modeling module and the industrial data computing engine and is used for acquiring corresponding industrial data from each industrial data interface within a set time range according to a processing strategy configured by the industrial data computing engine, distributing the acquired industrial data to the distributed processing server for processing, packaging the processed industrial data by taking a data structure configured by the industrial data modeling module as a template, and inputting the packaged industrial data into the industrial data database.
3. The automated industrial data generation reporting system of claim 1 wherein the reporting server comprises an industrial reporting template generation module, a reporting file generation module, and a timed task setting module;
the industrial report template generation module is used for adding an external custom plug-in into part or all Excel cells based on an Excel table, setting cell calculation strategies of part of the Excel cells, generating a required industrial report template file, setting corresponding report template uploading attributes for the generated industrial report template file, uploading the industrial report template file to the report file generation module, and adding data of the report template uploading attributes in a report server;
the report file generation module is used for selecting one of the industrial report template files from the report module database according to a preset timing task, and acquiring corresponding data from the industrial data database to fill part or all of the movable cells in the industrial report template file so as to generate a final report file;
the timing task setting module is used for setting a corresponding timing task for each industrial report template, the timing task is used for triggering a report engine interface, inquiring a report database according to report parameters contained in the timing task, judging whether a corresponding report file is generated, calling the report file generating module through the report generating interface when a related report is not generated, taking the industrial report template corresponding to the timing task as a generating report structure basis, reading an external custom plug-in contained in each cell of the industrial report template, calling corresponding industrial data from the industrial database, filling the corresponding industrial data into the corresponding cells one by one, and carrying out related calculation processing on part of the cells according to a preset cell calculation strategy.
4. The automated industrial data generation reporting system of claim 1 wherein the report file generation module classifies external custom plug-ins in each cell, constructs a common instruction set and a loop instruction set, and executes instructions of each set according to the constructed instruction set, respectively.
5. The automatic report generating system of claim 1, wherein if a merge instruction is recorded in the content of a cell, the column number of the cell is recorded in a set of column numbers to be vertically merged, wherein the merge instruction is arbitrary data capable of identifying a column in which the cell is located as a column to be vertically merged, and then the vertical merging of the cells is performed through an Apache POI interface for the set of column numbers to be vertically merged, and the vertical merging refers to merging of cells with the same content in an arbitrary plurality of cells in a column.
6. The automatic industrial data generating report system according to claim 5, wherein the vertical merging of the cells through the Apache POI interface for the set of column numbers to be vertically merged refers to traversing each column of the cells column by column according to the column numbers in the set of column numbers to be vertically merged, and performing corresponding vertical merging operation on the cells according to actual merging attributes;
Wherein the process of traversing the rows of cells row by row for each current column comprises:
(1) If the number of the cells in the N-th row is not less than the column number of the current column, the content of the cells in the N-th row in the current column is the same as the content of the current initial value, and the current initial row number is not a preset value, determining that the initial row number is unchanged, and adding one to the cut-off row number;
(2) If the number of the cells in the N-th row is not less than the column number of the current column, the content of the cells in the N-th row in the current column is the same as the content of the current initial value, and the current initial row number is a preset value, setting the initial row number and the cut-off row number as N;
(3) If the number of the cells in the N-th row is not less than the column number of the current column, the content of the cells in the N-th row in the current column is different from the content of the current initial value, and the current initial row number is less than the cut-off row number, merging the corresponding cells in the current column through an Apache POI interface according to the current initial row number and the cut-off row number, setting the initial row number and the cut-off row number as N, and setting the initial value as the content of the cells in the N-th row in the current column;
(4) If the number of the cells in the N-th row is not less than the column number of the current column, the content of the cells in the N-th row in the current column is different from the content of the current initial value, and the current initial row number is the preset value, setting the initial row number and the cut-off row number as N, and setting the initial value as the content of the cells in the N-th row in the current column;
(5) If the number of the N-th row of cells is smaller than the column number of the current column and the current starting row number is smaller than the cut-off row number, merging the corresponding cells in the current column through an Apache POI interface according to the current starting row number and the cut-off row number, and setting the starting row number and the cut-off row number as the preset value after merging;
(6) If the number of the cells in the N-th row is smaller than the column number of the current column and the current starting row number is not smaller than the cut-off row number, the next row of cells is continuously traversed.
7. The automated industrial data generating reporting system of claim 6 wherein the traversing the rows of cells row by row for each current column further comprises:
(7) If the current starting line number is smaller than the ending line number, merging a plurality of corresponding cells in the current column through the Apache POI interface according to the current starting line number and the ending line number;
(8) And for the current row, if the content of the M row of cells is null, assigning the content of the M row of cells to be null so that a plurality of continuous cells with null assignment can be combined through the Apache POI interface, and the preset value is-1.
8. The automated industrial data generation reporting system of claim 1 wherein the reporting server comprises a reporting display and editing module for displaying generated reporting files through a browser and providing corresponding editing function entries, the editing functions including save, single calculation, full calculation and reacquire;
the storage function is used for storing the generated report file into a report database;
the single computing function is used for restoring the content of one of the modified cells selected by the user into original data;
the all calculation function is used for restoring the contents of all the modified cells into original data;
the re-acquisition function is used for clearing all data in the saved report files in the report database and re-adding when the report content is abnormal or restored to original data after one or more modifications and storage.
CN202010405791.1A 2020-05-14 2020-05-14 Automatic report generation system for industrial data Active CN111538731B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010405791.1A CN111538731B (en) 2020-05-14 2020-05-14 Automatic report generation system for industrial data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010405791.1A CN111538731B (en) 2020-05-14 2020-05-14 Automatic report generation system for industrial data

Publications (2)

Publication Number Publication Date
CN111538731A CN111538731A (en) 2020-08-14
CN111538731B true CN111538731B (en) 2023-08-29

Family

ID=71968026

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010405791.1A Active CN111538731B (en) 2020-05-14 2020-05-14 Automatic report generation system for industrial data

Country Status (1)

Country Link
CN (1) CN111538731B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112528613A (en) * 2020-12-21 2021-03-19 金蝶软件(中国)有限公司 Data table generation method and related equipment thereof
CN112686010B (en) * 2020-12-23 2024-03-01 江苏苏宁云计算有限公司 Resource data report generation method, device, computer equipment and storage medium
CN113706088A (en) * 2021-01-23 2021-11-26 深圳市玄羽科技有限公司 Industrial data automatic generation report system
CN113536753B (en) * 2021-07-05 2024-05-14 无锡信捷电气股份有限公司 Formula management system capable of being freely configured
CN114217722B (en) * 2021-12-22 2024-05-17 沈阳东睿科技有限公司 Automatic engine file data acquisition method based on dynamic binding
CN115118611A (en) * 2022-06-24 2022-09-27 中国工商银行股份有限公司 Software SDN network specification statistical method and system
CN116389579A (en) * 2023-03-22 2023-07-04 安芯网盾(北京)科技有限公司 Report generation method and system based on micro-service

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107423272A (en) * 2017-04-21 2017-12-01 广东浪潮大数据研究有限公司 A kind of report form generation method and its device based on excel
CN109614424A (en) * 2018-11-28 2019-04-12 南京赛克蓝德网络科技有限公司 Page layout generation method, calculates equipment and medium at device
CN110618983A (en) * 2019-08-15 2019-12-27 复旦大学 JSON document structure-based industrial big data multidimensional analysis and visualization method
CN111144083A (en) * 2019-12-20 2020-05-12 腾讯科技(深圳)有限公司 Report generation method, device, equipment and computer readable storage medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050234886A1 (en) * 2004-04-16 2005-10-20 Karim Mohraz Report designer tool and method
CA3024687A1 (en) * 2017-11-20 2019-05-20 Royal Bank Of Canada System and method for e-receipt platform

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107423272A (en) * 2017-04-21 2017-12-01 广东浪潮大数据研究有限公司 A kind of report form generation method and its device based on excel
CN109614424A (en) * 2018-11-28 2019-04-12 南京赛克蓝德网络科技有限公司 Page layout generation method, calculates equipment and medium at device
CN110618983A (en) * 2019-08-15 2019-12-27 复旦大学 JSON document structure-based industrial big data multidimensional analysis and visualization method
CN111144083A (en) * 2019-12-20 2020-05-12 腾讯科技(深圳)有限公司 Report generation method, device, equipment and computer readable storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
许南山 ; 孙风平 ; .基于XML的可复用报表生成***的设计与实现.计算机工程与设计.2006,(第03期),全文. *

Also Published As

Publication number Publication date
CN111538731A (en) 2020-08-14

Similar Documents

Publication Publication Date Title
CN111538731B (en) Automatic report generation system for industrial data
CN105700888B (en) A kind of visualization quick development platform based on jbpm workflow engine
CN101923557B (en) Data analysis system and method
CN108804630B (en) Industry application-oriented big data intelligent analysis service system
US7159209B1 (en) Inter-application validation tool for use in enterprise architecture modeling
CN104778540A (en) BOM (bill of material) management method and management system for building material equipment manufacturing
CN104778124A (en) Automatic testing method for software application
CN108037919A (en) A kind of visualization big data workflow configuration method and system based on WEB
CN111178688A (en) Self-service analysis method and system for power technology supervision data, storage medium and computer equipment
CN112286957A (en) API application method and system of BI system based on structured query language
CN105279269A (en) SQL generating method and system for supporting table free association
CN113947468B (en) Data management method and platform
CN113806429A (en) Canvas type log analysis method based on large data stream processing framework
CN115657890A (en) PRA robot customizable method
CN103186713A (en) Method and web application for OEE-analysis
CN114328452A (en) Data auditing method, device, platform, electronic equipment and storage medium
WO2020259155A1 (en) Method and apparatus for generating alarm data report
CN113032633A (en) Method for customizing table by using reference data item
US8918410B2 (en) System and method for fast identification of variable roles during initial data exploration
CN114780074B (en) Information computing system for realizing big data analysis and construction method
CN113688141B (en) Application function design method and software development platform
CN115757481A (en) Data migration method, device, equipment and storage medium
CN114090583A (en) Cross-business system order data analysis method and device
CN114860851A (en) Data processing method, device, equipment and storage medium
CN112764396B (en) Configuration method and device

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