CN114064716B - Metadata-based automatic WEB report generation method and device - Google Patents
Metadata-based automatic WEB report generation method and device Download PDFInfo
- Publication number
- CN114064716B CN114064716B CN202111275114.3A CN202111275114A CN114064716B CN 114064716 B CN114064716 B CN 114064716B CN 202111275114 A CN202111275114 A CN 202111275114A CN 114064716 B CN114064716 B CN 114064716B
- Authority
- CN
- China
- Prior art keywords
- data
- item
- type
- web
- report
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/248—Presentation of query results
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/245—Query processing
- G06F16/2455—Query execution
- G06F16/24553—Query execution of query operations
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/10—Text processing
- G06F40/166—Editing, e.g. inserting or deleting
- G06F40/177—Editing, e.g. inserting or deleting of tables; using ruled lines
- G06F40/18—Editing, e.g. inserting or deleting of tables; using ruled lines of spreadsheets
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computational Linguistics (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (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)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention provides a method and a device for automatically generating a WEB report based on metadata, wherein the method comprises the following steps: receiving data source setting information and connecting the data source setting information with a target database to obtain a service data table; receiving the selected candidate service data table, and acquiring data item metadata information of the service data table; acquiring a corresponding abstract data type from a preset data type mapping library according to the data type in the metadata information of the data item, respectively acquiring a web element control and an operator from a data type and web element control mapping library and a data type and operator mapping library according to the acquired abstract data type, and automatically generating a corresponding data output item, a query condition, a threshold value, an operator and a statistical item; and inquiring corresponding data according to the setting result, and acquiring data content to generate a report. The method automatically generates the data output items, the query conditions, the operators, the statistical contents and the statistical modes by a system, and overcomes the defect that the adjustment of the business data table needs to be realized by re-program development if meeting.
Description
Technical Field
The invention relates to the field of network databases, in particular to an automatic WEB report generation method and device based on metadata.
Background
With the rapid development of information technologies such as the internet and a network database, various service systems based on the internet are widely constructed and applied. In these systems, the data reporting function is one of the usual functions. The core is to interactively customize and generate a business data report meeting the user demands according to the user demands. Such interactive custom generation includes user-defined data sources, data conditions, output content, and statistical means.
In the actual development process of the report function of the business system, system developers arrange business data content according to business requirements, and develop the data report function based on a program language after series of works such as database conceptual design, logic design and physical data storage design. Once the business systems are developed, the data table structure and the report function are basically solidified, and the user cannot adjust or change at will.
In practical application, the data content and report functions are continuously changed along with business development, so that in order to meet new application requirements, the original data report functions of some application systems must be updated or redeveloped in time, which is necessary to cause a large number of repeated construction of application systems, and a large amount of financial resources and material resources are wasted. On the other hand, with the expansion and depth of business applications, it may be necessary to build a new informationized application system, and how to develop and meet the report functions required by the subsequent business changes rapidly is also a technical problem to be solved urgently.
Disclosure of Invention
Aiming at the problems existing in the prior art, the invention provides a method and a device for automatically generating a WEB report based on metadata.
The invention provides a WEB report automatic generation method based on metadata, which comprises the following steps: receiving data source setting information, connecting a target database according to the data source setting information, and acquiring all service data tables from the target database; receiving candidate service data tables selected from all service data tables, and acquiring data item metadata information of the candidate service data tables, wherein the data item metadata information comprises data item names and data types; according to the data types in the metadata information of the data items, obtaining corresponding abstract data types from a preset data type mapping library, and respectively obtaining corresponding web element controls and operators from a data type and web element control mapping library and a data type and operator mapping library according to the obtained abstract data types to generate corresponding data output items, data query conditions, data item thresholds, data item operators and data statistics items; receiving the generated data output items, data query conditions, data item operators and settings of data statistics items; inquiring corresponding data from the candidate business data table according to the setting result, and acquiring data content; and generating a report according to the acquired data content, wherein the report content comprises data output items and statistical data corresponding to the data.
According to an embodiment of the invention, the automatic generation method of the WEB report based on the metadata further comprises the following steps after the corresponding data output item, the data query condition, the data item threshold value, the data item operator and the data statistics item are generated: receiving a setting of a saved report; correspondingly, after generating the report according to the acquired data content, storing the report name, the operation time and the data retrieval query statement.
According to an embodiment of the invention, the automatic generation method of the WEB report based on the metadata comprises the following steps: text data type, numeric data type, and temporal data type.
According to the metadata-based automatic WEB report generation method, the data type mapping library is used for storing the mapping relation between the data types of the database and the abstract data types; the data type and web interface element control mapping library is used for storing the mapping relation between the abstract data type and the web interface element control; the data type and operator mapping library is used for storing mapping relation between abstract data type and common data operator.
According to an embodiment of the invention, according to the data type in the metadata information of the data item, a corresponding abstract data type is obtained from a preset data type mapping library, and according to the obtained abstract data type, a corresponding WEB element control and an operator are respectively obtained from a data type and WEB element control mapping library and a data type and operator mapping library, and a corresponding data output item, a data query condition, a data item threshold value, a data item operator and a data statistics item are generated, including:
displaying all data items of the candidate data table and receiving a selected result of the candidate data items;
displaying all selected data items and initializing query conditions;
if the abstract data type corresponding to the data type mapping library is searched for the text type according to the data type of the selected data item, a web text box is constructed after the corresponding data item, and the corresponding web option list comprises the query condition of the data item;
if the abstract data type corresponding to the data type mapping library is found to be numerical value type according to the data type of the selected data item, two web text boxes are constructed after the corresponding data item, the minimum value and the maximum value of the data item data are initialized respectively, and an operator web option list is added between the two text boxes;
if the abstract data type corresponding to the data type mapping library is found to be time type according to the data type of the selected data item, two web text boxes are constructed after the corresponding data item, and the web text boxes are respectively initialized to web time controls of starting time and ending time.
According to an embodiment of the invention, the method for automatically generating the WEB report based on the metadata further comprises the following steps after initializing the query condition: a check box button for adding whether to output all data items and a check button for adding whether to count all numerical data items.
According to the metadata-based automatic WEB report generation method, the data source setting information comprises a database type, a database address, a database name, a user name and a password.
The invention also provides an automatic WEB report generation device based on the metadata, which comprises the following steps: the data source information setting module is used for receiving data source setting information, connecting a target database according to the data source setting information and acquiring all service data tables from the target database; the service data table selection module is used for receiving candidate service data tables selected from all the service data tables and obtaining data item metadata information of the candidate service data tables, wherein the data item metadata information comprises data item names and data types; the report setting interface generation module is used for acquiring a corresponding abstract data type from a preset data type mapping library according to the data type in the data item metadata information, respectively acquiring a corresponding web element control and an operator from a data type and web element control mapping library and a data type and operator mapping library according to the acquired abstract data type, and generating a corresponding data output item, a data query condition, a data item threshold value, a data item operator and a data statistics item; the report operation setting module is used for receiving the generated data output items, data query conditions, data item operators and settings of data statistics items; the report data retrieval module is used for inquiring corresponding data from the candidate business data table according to the setting result and acquiring data content; and the report generation and display module is used for generating a report according to the acquired data content, wherein the report content comprises data output items and statistical data corresponding to the data.
The invention also provides an electronic device, which comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the processor realizes the steps of the automatic WEB report generation method based on the metadata when executing the program.
The present invention also provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of any of the metadata-based automatic WEB report generation methods described above.
The automatic generation method and the device for the WEB report based on the metadata, which are provided by the invention, have the advantages that the query conditions, the output data items, the statistical contents and the contents of the statistical modes required by the report generation are all automatically generated by the system, the implementation of additional development programs is not needed, the report can be automatically generated only by setting the query conditions, the output data items, the statistical contents and the statistical modes according to the service requirements according to the automatically generated contents, and the defect that the program development needs to be updated or carried out again after the current system development is completed, such as the adjustment of the service data table, is overcome. Based on the method and the device of the invention, the user only needs to design the corresponding service data table according to the data service and the storage requirement.
Drawings
In order to more clearly illustrate the invention or the technical solutions of the prior art, the following description will briefly explain the drawings used in the embodiments or the description of the prior art, and it is obvious that the drawings in the following description are some embodiments of the invention, and other drawings can be obtained according to the drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic flow chart of an automatic generation method of a WEB report based on metadata;
FIG. 2 is a second flow chart of the metadata-based automatic WEB report generation method according to the present invention;
FIG. 3 is a flow chart of a method for setting data source information provided by the invention;
FIG. 4 is a flowchart of the report setting interface content automatic generation method provided by the invention;
FIG. 5 is a diagram of a report query condition page provided by the present invention;
FIG. 6 is a diagram of a report output page and a data manipulation page provided by the invention;
FIG. 7 is a diagram of a report of settings and customized output content provided by the present invention;
FIG. 8 is a schematic diagram of the automatic generating device of the WEB report based on the metadata;
fig. 9 is a schematic structural diagram of an electronic device provided by the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present invention more apparent, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is apparent that the described embodiments are some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Setting report data items, query conditions, statistical conditions, report output formats and styles are the most basic and fundamental operations for making reports. To realize automatic report generation, the core method not only can set various parameters and processes by itself, but also can automatically generate the content to be set instead of additionally developing programs to realize, so as to provide the content for users to set by themselves. These settings include: data items, query conditions (data items, operators, value range), statistical manner (grouping statistics with some data item).
The following describes a metadata-based automatic WEB report generation method and device with reference to fig. 1 to 9. FIG. 1 is a schematic flow chart of the metadata-based automatic generation method for WEB report, as shown in FIG. 1, and the metadata-based automatic generation method for WEB report includes:
101. and receiving data source setting information, connecting the data source setting information with a target database, and acquiring all service data tables from the target database.
This step sets the data source information of the data required for making the report, and in one embodiment, the set information includes: the database type, database address, database name, user name and password are specifically shown in fig. 3.
Firstly, presetting a type, a version and a driver model library of database software in a system, automatically listing a software version and a data driver version corresponding to a database after a user selects a corresponding database software type so as to facilitate the user to select, and inputting a database name, a database address (such as a network IP address), a database user name and a database password after the database software version and the driver are selected, thereby completing the setting of a data source.
And acquiring service data tables in the set data source information, connecting the system with a database according to the data source setting information, and acquiring all the service data tables in the data source for making a report for selection and use after successful connection.
102. Receiving candidate service data tables selected from all service data tables, and acquiring data item metadata information of the candidate service data tables, wherein the data item metadata information comprises data item names and data types;
acquiring data item metadata information of the selected candidate service data table according to the candidate service data table selected by the user, wherein the data item metadata information comprises: data item name and data type.
103. And according to the data types in the metadata information of the data items, acquiring corresponding abstract data types from a preset data type mapping library, respectively acquiring corresponding web element controls and operators from a data type and web element control mapping library and a data type and operator mapping library according to the acquired abstract data types, and generating corresponding data output items, data query conditions, data item thresholds, data item operators and data statistics items.
And the report operation interface content automatically generates the query conditions, output data items, statistical content and statistical page content required by report making. The main method flow chart is shown in fig. 4.
First, a data type mapping library, a data type and web interface element control mapping library, and a data type and operator mapping library are pre-built in the present invention. The web interface element control corresponding to the abstract data type is stored in the mapping library of the data type and the web interface element control; in the data type and operator mapping library, operators corresponding to the abstract data types are stored.
And secondly, according to the metadata information of the data items of the selected candidate business data table, automatically generating data output items, data query conditions, data item thresholds, data item operators and data statistics items required for making the report by the corresponding relation between the data type information in the metadata information and a preset data type mapping library, a data type and web element control mapping library and a data type and operator mapping library. Optionally, radio, full-selection and counter-selection buttons are added in front of the data output items and the data statistics items.
104. And receiving the generated data output items, data query conditions, data item operators and settings of data statistics items.
And (3) setting report data output items, query conditions, a data statistics mode, a report title and whether to store a report or not according to the automatically generated data output items, the data query conditions and the web interface content of the data statistics mode in the step (103).
105. And inquiring corresponding data from the candidate service data table according to the setting result, and acquiring data content.
And constructing a data retrieval query SQL statement according to the statistical mode and the statistical content determined in the step 104, and acquiring data according to the set parameters from a candidate service data table corresponding to the data source.
106. And generating a report according to the acquired data content, wherein the report content comprises data output items and statistical data corresponding to the data.
And generating and displaying a report according to the acquired data content, wherein the report content comprises data output items and statistical data corresponding to the data, and can also comprise report title names, time and other contents.
The automatic generation method of the WEB report based on the metadata, disclosed by the invention, has the advantages that the query conditions, the output data items, the statistical contents and the statistical contents required by the report generation are automatically generated by the system, the implementation of additional development programs is not needed, the report can be automatically generated only by setting the query conditions, the output data items, the statistical contents and the statistical manners according to the service requirements according to the automatically generated contents, and the defect that the data adjustment is required to be updated or the program development is required to be carried out again after the system development is completed at present is overcome. Based on the invention, the user only needs to design the corresponding service data table according to the data service and the storage requirement.
In one embodiment, after the generating the corresponding data output item, the data query condition, the data item threshold, the data item operator, and the data statistics item, the method further comprises: receiving a setting of a saved report; correspondingly, after generating the report according to the acquired data content, storing the report name, the operation time and the data retrieval query statement.
Fig. 2 is a second flowchart of the automatic generating method of the WEB report based on metadata, as shown in fig. 2, if a save report is set in step 104, relevant information of the constructed report is automatically saved. The stored information includes: report name, operation time, data retrieval query SQL statement.
In one embodiment, the abstract data types include: text data type, numeric data type, and temporal data type. The embodiment of the invention establishes the corresponding relation between the three data types and different database software data types by abstracting the data types of the business report data into the three data types, so that the technical scheme of the invention can be suitable for the different database software types, and the application range of automatic generation of the data report is improved.
In one embodiment, the data type mapping library is used for storing the mapping relation between the data types of the database and the abstract data types; the data type and web interface element control mapping library is used for storing the mapping relation between the abstract data type and the web interface element control; the data type and operator mapping library is used for storing mapping relation between abstract data type and common data operator.
The above embodiments have been described, and the main data types of the data may be abstract text data types, numerical data types, and time data types, in consideration of the report data object and the operation mode. The data type mapping library is mainly responsible for storing the mapping relation between the abstract data types and the data types of the common database; the mapping library of the data types and the web interface element controls mainly stores the mapping relation between the abstract data types and the common web interface element controls in the invention; the data type and operator mapping library is mainly responsible for storing the mapping relation between the data type and the common data operator abstracted by the technical scheme of the invention.
In one embodiment, the obtaining a corresponding abstract data type from a preset data type mapping library according to the data type in the metadata information of the data item, obtaining a corresponding web element control and an operator from a data type and web element control mapping library and a data type and operator mapping library according to the obtained abstract data type, and generating a corresponding data output item, a data query condition, a data item threshold value, a data item operator and a data statistics item respectively, including: displaying all data items of the candidate data table and receiving a selected result of the candidate data items; displaying all selected data items and initializing query conditions; if the abstract data type corresponding to the data type mapping library is searched for the text type according to the data type of the selected data item, a web text box is constructed after the corresponding data item, and the corresponding web option list comprises the query condition of the data item; if the abstract data type corresponding to the data type mapping library is found to be numerical value type according to the data type of the selected data item, two web text boxes are constructed after the corresponding data item, the minimum value and the maximum value of the data item data are initialized respectively, and an operator web option list is added between the two text boxes; if the abstract data type corresponding to the data type mapping library is found to be time type according to the data type of the selected data item, two web text boxes are constructed after the corresponding data item, and the web text boxes are respectively initialized to web time controls of starting time and ending time.
Specifically, the method for automatically constructing the data output item, the data query condition, the data item threshold value, the data item operator and the data statistics item is as follows:
report query condition construction: all data items of the table are listed and displayed, a user selects part of the data items as query conditions, the selected data item names are output in the page, and corresponding condition contents are initialized after the data item names. If the abstract data type corresponding to the data type mapping library is searched for text data according to the data type of the selected data item, automatically constructing a web text input box behind the data item, initializing the data content of the data item by using an asynchronous data transmission technology, constructing an operator web list option behind the data item, and inquiring the option content of the condition comprises: beginning with, including, etc. If the abstract data type corresponding to the data type mapping library is found to be a numerical value type according to the data type of the selected data item, two web text boxes are automatically constructed behind the data item, the maximum value and the minimum value of the data item are obtained by using an asynchronous data transmission technology, the minimum value of the data item data is initialized by a first text box, the maximum value of the data item data is initialized by a second text box, a web option list of data item operators is added between the two text boxes, and the option contents of the operators comprise: greater than (>), greater than or equal to (> =), equal to (=), less than (<), less than or equal to (< =). If the abstract data type corresponding to the data type mapping library is the time type according to the data type of the selected data item, two web text boxes are automatically built behind the data item, wherein the first text box and the second text box are initialized to be web time controls, the first text box is the starting time of the query, and the second text box is the ending time of the query.
In the embodiment of the invention, the corresponding relation between the abstract three data types and the web page control element is established so as to acquire the data types of the data items of the data table, and the web page control content can be automatically constructed through the abstract data types, thereby being beneficial to realizing the automatic generation of report query conditions and statistical condition pages. The corresponding relation between the three abstract data types and the data operators is established, so that corresponding operator options can be automatically added when a query condition page is constructed.
In one embodiment, after initializing the query condition, the method further comprises: a check box button for adding whether to output all data items and a check button for adding whether to count all numerical data items.
The data item corresponds to the data output item of the output report, and check boxes for outputting and counting are added in the embodiment of the invention, and corresponding operation is executed. For example, a check box button for whether to output is added on all data items, and a check button for whether to count is added in front of all numerical data items.
According to the embodiment of the invention, the check box buttons for outputting or not are added to all the data items, and the check buttons for counting or not are added to all the numerical data items, so that the output loading of the data items and the statistics result can be customized, and the personalized customization of the report is realized.
In one embodiment, the data source setting information includes a database type, a database address, a database name, a user name, and a password. Step 101 of the above embodiment is already described and will not be repeated here.
The following description will be made by taking agricultural machinery service organization data as an example:
the contents of the data table: the data items of the organization name, the county name, the villages and towns of the responsible person, the construction time, the total power of agricultural machinery (thousands of watts), the number of small tractors (tables), the number of large tractor matched machines (parts), the number of small tractor matched machines (parts), the number of drainage and irrigation diesel engines (tables), the power of drainage and irrigation diesel engines (thousands of watts), the statistical year and the like.
The report generation method comprises the following steps:
the query condition page of the report is automatically produced, and as shown in fig. 5, the custom region county is a sense region. The automatic generation report output (content customization) page and the data operation (automatic statistics customization) page are shown in fig. 6, and the automatic generation report of the setting conditions and the self-customized output content is shown in fig. 7.
The metadata-based automatic generation device for the WEB report provided by the invention is described below, and the metadata-based automatic generation device described below and the metadata-based automatic generation method described above can be correspondingly referred to each other.
Fig. 8 is a schematic structural diagram of an automatic generating device for WEB report based on metadata, where, as shown in fig. 8, the automatic generating device for WEB report based on metadata includes: the system comprises a data source information setting module 801, a business data table selecting module 802, a report setting interface generating module 803, a report operation setting module 804, a report data retrieving module 805 and a report generating and displaying module 806. The data source information setting module 801 is configured to receive data source setting information, connect to a target database according to the data source setting information, and obtain all service data tables from the target database; the service data table selection module 802 is configured to receive candidate service data tables selected from all service data tables, and obtain metadata information of data items of the candidate service data tables, where the metadata information of data items includes names of data items and data types; the report setting interface generating module 803 is configured to obtain a corresponding abstract data type from a preset data type mapping library according to a data type in the metadata information of the data item, obtain a corresponding web element control and an operator from a data type and web element control mapping library and a data type and operator mapping library according to the obtained abstract data type, and generate a corresponding data output item, a data query condition, a data item threshold, a data item operator and a data statistics item; the report operation setting module 804 is configured to receive the generated settings of the data output item, the data query condition, the data item operator, and the data statistics item; the report data retrieval module 805 is configured to query corresponding data from the candidate service data table according to the setting result, and obtain data content; the report generation and display module 806 is configured to generate a report according to the acquired data content, where the report content includes a data output item and statistical data corresponding to the data.
In an embodiment of the apparatus, the report generating template storage setting module is further included, and is used for receiving setting of a stored report; after generating a report according to the acquired data content, storing the report name, the operation time and the data retrieval query statement.
The embodiment of the device provided by the embodiment of the present invention is for implementing the above embodiments of the method, and specific flow and details refer to the above embodiments of the method, which are not repeated herein.
The automatic generating device for the WEB report based on the metadata provided by the embodiment of the invention is used for automatically generating query conditions, output data items, statistical contents and contents of statistical modes required by the report generation by a system, does not need to be realized by a user through additional development programs, can automatically generate the report after setting the query conditions, the output data items, the statistical contents and the statistical modes according to business requirements only by the automatically generated contents, and overcomes the defect that the data adjustment needs to be updated or the program development needs to be carried out again after the system development is completed at present. Based on the invention, the user only needs to design the corresponding service data table according to the data service and the storage requirement.
Fig. 9 is a schematic structural diagram of an electronic device provided by the present invention, and as shown in fig. 9, the electronic device may include: processor 901, communication interface (Communications Interface) 902, memory 903 and communication bus 904, wherein processor 901, communication interface 902 and memory 903 communicate with each other via communication bus 904. The processor 901 may call logic instructions in the memory 903 to perform a metadata-based automatic WEB report generation method, the method comprising: receiving data source setting information, connecting a target database according to the data source setting information, and acquiring all service data tables from the target database; receiving candidate service data tables selected from all service data tables, and acquiring data item metadata information of the candidate service data tables, wherein the data item metadata information comprises data item names and data types; according to the data types in the metadata information of the data items, obtaining corresponding abstract data types from a preset data type mapping library, respectively obtaining corresponding web element controls and operators from a data type and web element control mapping library and a data type and operator mapping library according to the obtained abstract data types, and generating corresponding data output items, data query conditions, data item thresholds, data item operators and data statistics items; receiving the generated data output items, data query conditions, data item operators and settings of data statistics items; inquiring corresponding data from the candidate business data table according to the setting result, and acquiring data content; and generating a report according to the acquired data content, wherein the report content comprises data output items and statistical data corresponding to the data.
Further, the logic instructions in the memory 903 described above may be implemented in the form of software functional units and may be stored in a computer readable storage medium when sold or used as a stand alone product. Based on this understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
In another aspect, the present invention also provides a computer program product comprising a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions which, when executed by a computer, enable the computer to perform the method for automatically generating a metadata-based WEB report provided by the above methods, the method comprising: receiving data source setting information, connecting a target database according to the data source setting information, and acquiring all service data tables from the target database; receiving candidate service data tables selected from all service data tables, and acquiring data item metadata information of the candidate service data tables, wherein the data item metadata information comprises data item names and data types; according to the data types in the metadata information of the data items, obtaining corresponding abstract data types from a preset data type mapping library, respectively obtaining corresponding web element controls and operators from a data type and web element control mapping library and a data type and operator mapping library according to the obtained abstract data types, and generating corresponding data output items, data query conditions, data item thresholds, data item operators and data statistics items; receiving the generated data output items, data query conditions, data item operators and settings of data statistics items; inquiring corresponding data from the candidate business data table according to the setting result, and acquiring data content; and generating a report according to the acquired data content, wherein the report content comprises data output items and statistical data corresponding to the data.
In still another aspect, the present invention also provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, is implemented to perform the metadata-based automatic WEB report generation method provided in the above embodiments, the method including: receiving data source setting information, connecting a target database according to the data source setting information, and acquiring all service data tables from the target database; receiving candidate service data tables selected from all service data tables, and acquiring data item metadata information of the candidate service data tables, wherein the data item metadata information comprises data item names and data types; according to the data types in the metadata information of the data items, obtaining corresponding abstract data types from a preset data type mapping library, respectively obtaining corresponding web element controls and operators from a data type and web element control mapping library and a data type and operator mapping library according to the obtained abstract data types, and generating corresponding data output items, data query conditions, data item thresholds, data item operators and data statistics items; receiving the generated data output items, data query conditions, data item operators and settings of data statistics items; inquiring corresponding data from the candidate business data table according to the setting result, and acquiring data content; and generating a report according to the acquired data content, wherein the report content comprises data output items and statistical data corresponding to the data.
The apparatus embodiments described above are merely illustrative, wherein the elements illustrated as separate elements may or may not be physically separate, and the elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
From the above description of the embodiments, it will be apparent to those skilled in the art that the embodiments may be implemented by means of software plus necessary general hardware platforms, or of course may be implemented by means of hardware. Based on this understanding, the foregoing technical solution may be embodied essentially or in a part contributing to the prior art in the form of a software product, which may be stored in a computer readable storage medium, such as ROM/RAM, a magnetic disk, an optical disk, etc., including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method described in the respective embodiments or some parts of the embodiments.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present invention, and are not limiting; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims (9)
1. The automatic WEB report generation method based on the metadata is characterized by comprising the following steps of:
receiving data source setting information, connecting a target database according to the data source setting information, and acquiring all service data tables from the target database;
receiving candidate service data tables selected from all service data tables, and acquiring data item metadata information of the candidate service data tables, wherein the data item metadata information comprises data item names and data types;
according to the data types in the metadata information of the data items, obtaining corresponding abstract data types from a preset data type mapping library, respectively obtaining corresponding web element controls and operators from a data type and web element control mapping library and a data type and operator mapping library according to the obtained abstract data types, and generating corresponding data output items, data query conditions, data item thresholds, data item operators and data statistics items;
receiving the generated data output items, data query conditions, data item operators and settings of data statistics items;
inquiring corresponding data from the candidate business data table according to the setting result, and acquiring data content;
generating a report according to the acquired data content, wherein the report content comprises data output items and statistical data corresponding to the data;
the data type mapping library is used for storing the mapping relation between the data types of the database and the abstract data types; the data type and web interface element control mapping library is used for storing the mapping relation between the abstract data type and the web interface element control; the data type and operator mapping library is used for storing mapping relation between abstract data type and common data operator.
2. The method for automatically generating a WEB report based on metadata according to claim 1, wherein after generating the corresponding data output item, the data query condition, the data item threshold, the data item operator, and the data statistics item, further comprises:
receiving a setting of a saved report;
correspondingly, after generating the report according to the acquired data content, storing the report name, the operation time and the data retrieval query statement.
3. The automatic metadata-based WEB report generation method of claim 1, wherein the abstract data types comprise: text data type, numeric data type, and temporal data type.
4. The automatic metadata-based WEB report generating method according to claim 3, wherein the obtaining the corresponding abstract data type from a preset data type mapping library according to the data type in the metadata information of the data item, obtaining the corresponding WEB element control and the corresponding operator from the data type and WEB element control mapping library and the data type and operator mapping library according to the obtained abstract data type, and generating the corresponding data output item, the data query condition, the data item threshold, the data item operator and the data statistics item respectively comprises:
displaying all data items of the candidate business data table and receiving a selected result of the candidate data items;
displaying all selected data items and initializing query conditions;
if the abstract data type corresponding to the data type mapping library is searched for the text type according to the data type of the selected data item, a web text box is constructed after the corresponding data item, and the corresponding web option list comprises the query condition of the data item;
if the abstract data type corresponding to the data type mapping library is found to be numerical value type according to the data type of the selected data item, two web text boxes are constructed after the corresponding data item, the minimum value and the maximum value of the data item data are initialized respectively, and an operator web option list is added between the two text boxes;
if the abstract data type corresponding to the data type mapping library is searched for as time type according to the data type of the selected data item, two web text boxes are constructed after the corresponding data item, and the web text boxes are respectively initialized to web time controls of starting time and ending time.
5. The method for automatically generating a WEB report based on metadata according to claim 4, further comprising, after initializing the query condition:
a check box button for adding whether to output all data items and a check button for adding whether to count all numerical data items.
6. The automatic metadata-based WEB report generating method of claim 1, wherein the data source setting information comprises a database type, a database address, a database name, a user name, and a password.
7. The automatic WEB report generation device based on the metadata is characterized by comprising the following components:
the data source information setting module is used for receiving data source setting information, connecting a target database according to the data source setting information and acquiring all service data tables from the target database;
the service data table selection module is used for receiving candidate service data tables selected from all the service data tables and obtaining data item metadata information of the candidate service data tables, wherein the data item metadata information comprises data item names and data types;
the report setting interface generation module is used for acquiring a corresponding abstract data type from a preset data type mapping library according to the data type in the data item metadata information, respectively acquiring a corresponding web element control and an operator from a data type and web element control mapping library and a data type and operator mapping library according to the acquired abstract data type, and generating a corresponding data output item, a data query condition, a data item threshold value, a data item operator and a data statistics item;
the report operation setting module is used for receiving the generated data output items, data query conditions, data item operators and settings of data statistics items;
the report data retrieval module is used for inquiring corresponding data from the candidate business data table according to the setting result and acquiring data content;
the report generation display module is used for generating a report according to the acquired data content, wherein the report content comprises data output items and statistical data corresponding to the data;
the data type mapping library is used for storing the mapping relation between the data types of the database and the abstract data types; the data type and web interface element control mapping library is used for storing the mapping relation between the abstract data type and the web interface element control; the data type and operator mapping library is used for storing mapping relation between abstract data type and common data operator.
8. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor, when executing the program, implements the steps of the metadata-based automatic WEB report generation method of any one of claims 1 to 6.
9. A non-transitory computer-readable storage medium having stored thereon a computer program, wherein the computer program when executed by a processor implements the steps of the metadata-based WEB report automatic generation method of any of claims 1 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111275114.3A CN114064716B (en) | 2021-10-29 | 2021-10-29 | Metadata-based automatic WEB report generation method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111275114.3A CN114064716B (en) | 2021-10-29 | 2021-10-29 | Metadata-based automatic WEB report generation method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114064716A CN114064716A (en) | 2022-02-18 |
CN114064716B true CN114064716B (en) | 2023-10-20 |
Family
ID=80236324
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111275114.3A Active CN114064716B (en) | 2021-10-29 | 2021-10-29 | Metadata-based automatic WEB report generation method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114064716B (en) |
Citations (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1588369A (en) * | 2004-09-06 | 2005-03-02 | 杭州恒生电子股份有限公司 | Relation type data base system and its search and report method |
CN1704900A (en) * | 2004-06-03 | 2005-12-07 | 微软公司 | Method and apparatus for generating user interfaces based upon automation with full flexibility |
CN101477526A (en) * | 2008-12-31 | 2009-07-08 | 中兴通讯股份有限公司 | Method and system for implementing statistical forms customization |
CN103778107A (en) * | 2012-10-25 | 2014-05-07 | 上海宝信软件股份有限公司 | Method and platform for quickly and dynamically generating form based on EXCEL |
CN105320690A (en) * | 2014-07-30 | 2016-02-10 | 北京中海纪元数字技术发展股份有限公司 | Metadata based rapid statistic form generation method and system |
CN108089899A (en) * | 2016-11-22 | 2018-05-29 | 深圳市创梦天地科技有限公司 | Inquire about the implementation method and device of report |
CN108446309A (en) * | 2018-02-05 | 2018-08-24 | 深圳市资本在线金融信息服务有限公司 | The application process and device of WEB intelligent report forms |
CN109508338A (en) * | 2018-11-23 | 2019-03-22 | 成都四方伟业软件股份有限公司 | Data sheet correlating method and device |
CN110728123A (en) * | 2019-10-14 | 2020-01-24 | 金蝶软件(中国)有限公司 | Report generation method, system and related equipment |
CN111158650A (en) * | 2019-12-25 | 2020-05-15 | 中国建设银行股份有限公司 | Report template, report template and report generation method and device |
CN111708917A (en) * | 2020-06-10 | 2020-09-25 | 武汉钢铁有限公司 | Steel report data acquisition system |
CN112463797A (en) * | 2020-12-08 | 2021-03-09 | 航天信息股份有限公司 | Report generation method, system, storage medium and electronic equipment |
CN112685493A (en) * | 2020-12-30 | 2021-04-20 | 平安普惠企业管理有限公司 | Report processing method and device, electronic equipment and storage medium |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP4070318B1 (en) * | 2019-12-04 | 2024-10-09 | Tempus AI, Inc. | Systems and methods for automating rna expression calls in a cancer prediction pipeline |
-
2021
- 2021-10-29 CN CN202111275114.3A patent/CN114064716B/en active Active
Patent Citations (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1704900A (en) * | 2004-06-03 | 2005-12-07 | 微软公司 | Method and apparatus for generating user interfaces based upon automation with full flexibility |
CN1588369A (en) * | 2004-09-06 | 2005-03-02 | 杭州恒生电子股份有限公司 | Relation type data base system and its search and report method |
CN101477526A (en) * | 2008-12-31 | 2009-07-08 | 中兴通讯股份有限公司 | Method and system for implementing statistical forms customization |
CN103778107A (en) * | 2012-10-25 | 2014-05-07 | 上海宝信软件股份有限公司 | Method and platform for quickly and dynamically generating form based on EXCEL |
CN105320690A (en) * | 2014-07-30 | 2016-02-10 | 北京中海纪元数字技术发展股份有限公司 | Metadata based rapid statistic form generation method and system |
CN108089899A (en) * | 2016-11-22 | 2018-05-29 | 深圳市创梦天地科技有限公司 | Inquire about the implementation method and device of report |
CN108446309A (en) * | 2018-02-05 | 2018-08-24 | 深圳市资本在线金融信息服务有限公司 | The application process and device of WEB intelligent report forms |
CN109508338A (en) * | 2018-11-23 | 2019-03-22 | 成都四方伟业软件股份有限公司 | Data sheet correlating method and device |
CN110728123A (en) * | 2019-10-14 | 2020-01-24 | 金蝶软件(中国)有限公司 | Report generation method, system and related equipment |
CN111158650A (en) * | 2019-12-25 | 2020-05-15 | 中国建设银行股份有限公司 | Report template, report template and report generation method and device |
CN111708917A (en) * | 2020-06-10 | 2020-09-25 | 武汉钢铁有限公司 | Steel report data acquisition system |
CN112463797A (en) * | 2020-12-08 | 2021-03-09 | 航天信息股份有限公司 | Report generation method, system, storage medium and electronic equipment |
CN112685493A (en) * | 2020-12-30 | 2021-04-20 | 平安普惠企业管理有限公司 | Report processing method and device, electronic equipment and storage medium |
Non-Patent Citations (6)
Title |
---|
a metadata approach for building web application user interface;《Procedia Technology》(第11期);903-911 * |
基于Word模板的报表控件的设计;余建军 等;《计算机与现代化》(第109期);117-121 * |
基于元数据管理的OLAP系统设计与实现;楼笑;《中国优秀硕士学位论文全文数据库 信息科技辑》(第1期);I138-233 * |
基于数据中心的数据仓库结构设计;韩鲲;薛辉;魏国庆;薛松;;信息安全与通信保密(12);83-87 * |
基于语义分析的统计报表多维数据建模方法;沈晖;陆育锋;郭以东;杨勇;;计算机科学(第09期);249-252 * |
面向网络海量空间信息的GIS平台体系结构;陆锋, 周大良, 郭朝珍, 池天河, 谢昆青, 刘仁义;地球信息科学(03);32-40 * |
Also Published As
Publication number | Publication date |
---|---|
CN114064716A (en) | 2022-02-18 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110276059B (en) | Dynamic report processing method and device | |
CN112015412A (en) | Device and method for generating business model based on form engine | |
CN115712413B (en) | Low code development method, device, equipment and storage medium | |
CN107992506B (en) | Information processing method and device | |
CN111858608A (en) | Data management method, device, server and storage medium | |
CN116737127A (en) | Low code development method, device, equipment and storage medium | |
CN114356333A (en) | Service function configuration method, equipment, storage medium and service system thereof | |
CN115994718A (en) | General training evaluation system | |
EP3523732B1 (en) | Systems and methods for efficiently distributing alert messages | |
CN114064716B (en) | Metadata-based automatic WEB report generation method and device | |
CN114371845A (en) | Form generation method and device | |
CN115878589A (en) | Version management method and device of structured data and related equipment | |
CN113312052A (en) | Component calling method and device, electronic equipment and storage medium | |
CN112527918A (en) | Data processing method and device | |
CN112182115A (en) | Relationship display method and device, storage medium and electronic device | |
US10311049B2 (en) | Pattern-based query result enhancement | |
CN116738954A (en) | Report export method, report template configuration device and computer equipment | |
US10331715B2 (en) | Metadata enrichment with a keyword definition editor | |
CN109857735A (en) | A kind of data configuration method and system carrying out regular description by excel | |
US9916154B2 (en) | File-based transport of table content | |
CN115292370A (en) | Business document data processing method, device and medium | |
CN115114325A (en) | Data query method and device, electronic equipment and storage medium | |
CN112861060A (en) | Page creating method and device, computer equipment and storage medium | |
CN113805850A (en) | Artificial intelligence management system based on multiple deep learning and machine learning frameworks | |
US10558637B2 (en) | Modularized data distribution plan generation |
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 |