A configuration report generation method and device, computer equipment and storage medium
By obtaining the report configuration fields to generate the target configuration file and associating it with the preset framework and database, the problem of low report generation efficiency is solved, and efficient report generation without manual intervention is achieved.
Patent Information
- Application Number
- CN202211114059.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-14
- Publication Date
- 2026-01-23
- Estimated Expiration
- 2042-09-14
AI Technical Summary
In existing technologies, enterprise report generation is inefficient, requiring repetitive work by developers, resulting in a human-intensive and inefficient generation process.
By obtaining the fields to be configured in the report to be generated, the target configuration file is generated, the pre-compiled script file in the preset framework is associated, the target business data is obtained, and the configurable report is generated, reducing repetitive work for developers.
It improves report generation efficiency, reduces repetitive work for developers, and enables the generation of configurable reports without manual intervention.
Smart Images

Figure CN115408453B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of data processing, and in particular to a configuration report generation method and device, computer equipment and a storage medium. BACKGROUND
[0002] In the process of informatization, enterprises are increasingly using more and more business data, and the amount of business data is also increasing. Generating business reports from enterprise data and conducting business analysis and management can effectively apply enterprise data.
[0003] In the prior art, different business systems generate reports by querying different data according to the interfaces of the corresponding systems, and then generate Excel files according to the rendering module, and send the Excel files to the corresponding front end for display. The development of each report requires at least one developer to participate throughout the process, and the specific developer needs to be specially developed, which takes a long development cycle. For reports of the same type, the developer needs to repeat the same development work, which consumes a lot of development time, and the generation process of the report is too dependent on the developer, resulting in low efficiency of report generation. Therefore, how to improve the efficiency of report generation has become a problem to be solved. SUMMARY
[0004] Therefore, it is necessary to provide a configuration report generation method, device, computer equipment and storage medium to solve the problem of low efficiency of report generation.
[0005] In a first aspect, a configuration report generation method is provided, which includes:
[0006] Obtaining the to-be-configured fields of each display item in the to-be-generated report;
[0007] According to the received collection items in the to-be-configured fields, the configuration parameters of the to-be-generated report are obtained;
[0008] Based on the configuration parameters, a target configuration file corresponding to the to-be-generated report is generated;
[0009] Based on the target configuration file, the precompiled script file in the preset framework corresponding to the target configuration file is associated to obtain an associated file of the preset framework and a preset database;
[0010] According to the associated file, the corresponding target business data is obtained from the preset database;
[0011] Based on the target business data, a configuration report is generated.
[0012] In a second aspect, a configuration report generation device is provided, which includes:
[0013] The acquisition module is used to acquire the fields to be configured for each display item in the report to be generated;
[0014] The configuration parameter determination module is used to obtain the configuration parameters of the report to be generated based on the collection items in the received fields to be configured.
[0015] The target configuration file generation module is used to generate the target configuration file corresponding to the report to be generated based on the configuration parameters.
[0016] The associated file determination module is used to associate the pre-compiled script file in the preset framework corresponding to the target configuration file with the target configuration file, so as to obtain the associated file between the preset framework and the preset database.
[0017] The target business data acquisition module is used to acquire corresponding target business data from the preset database based on the associated file;
[0018] The configurable report generation module is used to generate configurable reports based on the target business data.
[0019] Thirdly, embodiments of the present invention provide a computer device, the computer device including a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the configurable report generation method as described in the first aspect.
[0020] Fourthly, embodiments of the present invention provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the configurable report generation method as described in the first aspect.
[0021] The advantages of this invention compared to the prior art are:
[0022] The system retrieves the configurable fields for each display item in the report to be generated. Based on the collected items in the received configurable fields, it obtains the configuration parameters for the report to be generated. Based on the configuration parameters, it generates the target configuration file corresponding to the report to be generated. Based on the target configuration file, it associates the pre-compiled script file in the preset framework corresponding to the target configuration file to obtain the association file between the preset framework and the preset database. Based on the association file, it retrieves the corresponding target business data from the preset database. Based on the target business data, it generates a configurable report. During the configurable report generation process, developers do not need to perform repetitive work; they only need to generate the corresponding report based on the configuration information, which improves the efficiency of report generation. Attached Figure Description
[0023] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0024] Figure 1 This is a schematic diagram of an application environment for a configurable report generation method provided in an embodiment of the present invention;
[0025] Figure 2 This is a flowchart illustrating a configurable report generation method according to an embodiment of the present invention;
[0026] Figure 3 This is a flowchart illustrating a configurable report generation method according to an embodiment of the present invention;
[0027] Figure 4 This is a flowchart illustrating a configurable report generation method according to an embodiment of the present invention;
[0028] Figure 5 This is a schematic diagram of the structure of a configurable report generation method provided in an embodiment of the present invention;
[0029] Figure 6 This is a schematic diagram of the structure of a configurable report generation device provided in an embodiment of the present invention;
[0030] Figure 7 This is a schematic diagram of the structure of a computer device provided in an embodiment of the present invention. Detailed Implementation
[0031] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0032] It should be understood that, when used in this specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or collections thereof.
[0033] It should also be understood that the term “and / or” as used in this specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0034] As used in this specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if [described condition or event] is detected" may be interpreted, depending on the context, as meaning "once determined," "in response to determination," "once [described condition or event] is detected," or "in response to detection of [described condition or event]."
[0035] Furthermore, in the description of this invention and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0036] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of the invention include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.
[0037] It should be understood that the sequence number of each step in the following embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0038] To illustrate the technical solution of the present invention, specific embodiments are described below.
[0039] An embodiment of the present invention provides a configurable report generation method, which can be applied to, for example... Figure 1In this application environment, the client communicates with the server. Clients include, but are not limited to, PDAs, desktop computers, laptops, ultra-mobile personal computers (UMPCs), netbooks, and personal digital assistants (PDAs). The server can be implemented using a standalone server or a server cluster consisting of multiple servers.
[0040] See Figure 2 This is a flowchart illustrating a configurable report generation method according to an embodiment of the present invention. The configurable report generation method described above can be applied to... Figure 1 The server in the example connects to the corresponding client. For example... Figure 2 As shown, the configurable report generation method may include the following steps.
[0041] S201: Retrieve the fields to be configured for each display item in the report to be generated.
[0042] In step S201, the fields to be configured for each display item in the report to be generated are obtained. The report to be generated is the report that the corresponding business system needs to generate. Each display item is the header information, scene information, etc. that need to be configured in the report to be generated. The fields to be configured are the attributes that need to be configured in the display item.
[0043] In this embodiment, a report configuration interface is set up in the configuration system. This interface includes a selection control for business users to choose data tables, allowing them to select the necessary database tables. The database can be MySQL or another database based on a structured query language. The fields in the database table structure can be fields that developers determine the business users might need based on business chain analysis; different business scenarios require different fields. The field and its configuration item are deleted from the component to be configured. Based on the business user's trigger action of adding the control, a new row and its configuration item are added to the component. The field to be configured may include, for example, scenario information, display name, table header information, and field type.
[0044] It should be noted that the scenario information is the source information of the report under different circumstances. The "display name" is used to display as the header in the report, and the "field type" is used to configure the type of the field. Business personnel can directly configure the required information in the report configuration interface, thereby increasing the flexibility of business personnel in configuring reports and reducing the difficulty for developers in developing table structures.
[0045] Specifically, in order to facilitate the identification of the fields to be configured for the display items, the data format of the fields to be configured for the display items can be defined. For example, the display item configuration information can be defined according to the display item type and type value format. Then (1, 11) indicates that the font type of the display item is bold, etc. For display items with numerical values, the fields to be configured for the display items can be defined according to the display item type, type value, and numerical value format.
[0046] It's important to note that when the report data to be generated is from a single data table, the data from that table can be directly displayed. However, when the report data consists of multiple data points with mathematical relationships between them, these relationships can be used to display the report's layout, and the resulting data from these relationships can be incorporated into the result display items. This way, when modifying the result display item information later, only a portion of the data from the multiple data tables or only the mathematical relationships need to be changed. When retrieving the result display items, the initial display data from multiple display items can be obtained, along with the calculation formulas for the display data between the display items. Based on the initial display data and the calculation formulas, the result display item data is determined, and the initial display data is then displayed in the result display items derived from the display item calculation formulas. For example, if the initial display data is 2 and 3, and the result display data is 6, the mathematical calculation formula between the initial display data and the result display data is 2*3=6. Furthermore, the display item identifiers of the initial display data are 1 and 2, and the display item identifier of the result display data is 3. Then, the display item calculation formula between the display items with identifiers 1, 2, and 3 is [3]=[1]*[2]. That is, the display data with the display item identifier 3 is the product of the display data with the display item identifiers 1 and 2.
[0047] Optionally, retrieve the fields to be configured for each display item in the report to be generated, including:
[0048] Based on the received request information, obtain the configuration file for the report to be generated;
[0049] Based on the configuration file, obtain the fields to be configured for each display item in the report to be generated.
[0050] In this embodiment, the received report generation request information refers to a request to generate a front-end report. The configuration file of the report to be generated is obtained. The configuration file includes various parameters in the configuration interface, such as parameters in various display fields in the configuration interface. Specifically, it includes report name display items, report description display items, report header display items, etc. Each display item includes fields to be configured. For example, the fields to be configured in the header display item include header identifier, header name, width, etc., and the fields to be configured in the report details display item include report name, report path, report description, etc.
[0051] It should be noted that the configuration file for the report to be generated also includes data column value types and display formatting, whether column values display totals (including group summaries), the structured query language script of the data source, data result sorting, and field definitions and assignments for filtering business objects (including custom business parameter field constants), etc.
[0052] It should be noted that by using structured query statements, the data source of the report to be generated can be quickly obtained, and the corresponding terminal can be returned according to the data retrieval request of the report to be generated. This enables the rapid creation of simple reports with full functionality, without the need to install a Business Operating System (BOS) or perform a large number of repetitive operations on the attribute configuration of each report to be generated. By using the field information in the configuration file as the query logic of the structured query statement, the data from all data tables can be displayed in one interface, thereby effectively improving the efficiency of report generation.
[0053] S202: Obtain the configuration parameters for the report to be generated based on the collection items in the received fields to be configured.
[0054] In step S202, the configuration parameters of the report to be generated are obtained based on the collected items in the fields to be configured received, where the collected items are the fields input in the fields to be configured.
[0055] In this embodiment, the user configures the collection items for the corresponding fields to be configured in the configuration interface. The user can configure the fields to be configured in the generated configuration interface to obtain the corresponding configuration parameters. For example, for the header configuration, if the report to be generated includes multiple header information, such as Header 1 (Unit Name), Header 2 (Unit Number), Header 3 (Business Channel), Header 4 (Time Dimension), etc., the user can configure the identifier and minimum width of Header 1, the identifier and minimum width of Header 2, the table identifier and minimum width of Header 3, and the identifier and minimum width of Header 4, etc. Based on the configured parameters, the target configuration file for the report to be generated with the configured values is obtained. The target configuration file includes the parameter information configured in the configuration interface.
[0056] S203: Based on the configuration parameters, generate the target configuration file corresponding to the report to be generated.
[0057] In step S203, based on the configuration parameters, a target configuration file corresponding to the report to be generated is generated. The target configuration file is the configuration file obtained after the report to be generated is configured. In this embodiment, depending on the platform of the report to be generated, the corresponding language is different, and the language description in the configuration file is also different. For example, on the Android platform, the customized command can be the Gradle command (a project automation build tool). The Gradle command is a script written by the application developer using the Groovy language (a programming language) that can run in the Gradle build tool. It is understood that other methods can also be used to trigger the customized terminal to customize the data collection toolkit, and there are no restrictions on this.
[0058] S204: Based on the target configuration file, associate the pre-compiled script file in the preset framework corresponding to the target configuration file to obtain the association file between the preset framework and the preset database.
[0059] In step S204, based on the target configuration file, the pre-compiled script file in the preset framework corresponding to the target configuration file is associated to obtain the association file between the preset framework and the preset database. The association file is an XML file and the preset database is a relational database.
[0060] In this embodiment, the default framework is the MyBatis framework. The target configuration file is transferred to the MyBatis framework, and a pre-compiled script file is associated with it. This pre-compiled script file is a MyBatis script. The MyBatis framework connects to a default database based on the pre-compiled script and generates an associated file with the default database. The MyBatis framework avoids programmers directly manipulating JDBC-related code, allowing programmers to obtain result sets without manually setting database connection parameters or manipulating the database. This achieves separation of Java program code and structured query statements. When using the MyBatis framework, programmers can associate Java POJO (PlanOldJavaObjects) objects with the database using simple annotations or XML files.
[0061] It should be noted that the MyBatis framework connects to the default database through the Controller layer (controller layer), Service layer (service interface), Serviceimpl layer (service implementation class), mapper layer (mapper interface), entity layer (entity class of POJO), and mapping layer (generating association files).
[0062] Specifically, the configurable reports are developed on the Java platform using the Spreebot open-source application framework, along with the Mybatis persistence layer framework. To improve efficiency, it can also be integrated with a Spring Cloud microservice architecture and adopt a front-end / back-end separation model; for example, the back-end uses IntelliJ IDEA and the front-end uses VS Code. The Mybatis mapping function can connect to a preset database and automatically generate code, producing not only simple CRUD statements but also complex batch CRUD statements.
[0063] It's worth noting that using a front-end / back-end separation model with asynchronous data requests results in faster loading speeds and prevents screen freezes after changes to page data. Furthermore, the front-end and back-end projects are independent, each maintaining its own separate project. This not only improves development efficiency but also reduces maintenance and secondary development costs.
[0064] Sprebut is a rapid configuration scaffolding for the Spring framework, enabling the rapid development of individual microservices. Spring Cloud is a cloud application development tool based on Sprebut. Sprebut focuses on rapid and easy integration of individual components, while Spring Cloud is a service governance framework that focuses on the overall picture. Sprebut employs the principle of "default over configuration." A significant portion of Spring Cloud is built upon Sprebut.
[0065] S205: Based on the associated file, retrieve the corresponding target business data from the preset database.
[0066] In step S205, based on the associated file, the preset framework and the preset database are connected, and the corresponding target business data is obtained from the preset database.
[0067] In this embodiment, the preset framework is the Mybatis framework, a persistence framework. The Mybatis framework can design various module functions associated with a preset database. When retrieving target business data from the preset database through the Mybatis framework, the corresponding interface is used to generate an interface Mapper file for the Java program. The Mapper file is used to manage structured query statements. The Mapper file manages the query, insert, modify, and delete operations of the corresponding database. The Mybatis framework establishes a connection with the database based on the database information and constructs a MappedStatement interface for that database. Simultaneously, single-step parsing is performed. This single-step parsing process involves syntax and variable checks on the associated file, followed by correction based on the validation results. From the corrected associated file, statements related to the structured query statements are parsed to generate the M... The process of parsing a Mapper file involves extracting independent structured query statements. This process includes identifying the beginning and end of the query statement and determining its type using the initial string. The type of structured query statement is then marked with matching prefix and suffix characters. Structured query statement types include insert, update, delete, and select statements, among others. Based on the parsed query statement type, the syntax and variable checks in the associated files corresponding to the Mapper file are performed to check for errors. These checks are then corrected, and an executable script is output. Multiple step-by-step statements within this executable script are extracted, resulting in individual executable structured query statements. Finally, these step-by-step statements are used to retrieve the corresponding target business data from a pre-defined database.
[0068] Optionally, based on the associated file, the corresponding target business data is obtained from the preset database, including:
[0069] The associated file is transferred to the preset frame, and the query statement obtained by the preset frame parsing the associated file is obtained.
[0070] Based on the query statement, retrieve the target business data corresponding to the report to be generated from the preset database.
[0071] In this embodiment, within the Mybatis framework, the association file is an XML file in XML format. This XML file stores MappedStatement objects formed from structured query statement configuration information. The MappedStatement object can include information such as input parameter association configuration, the executed structured query statement, and result association configuration. The corresponding structured query statement can be obtained by parsing the MappedStatement object according to its association rules.
[0072] It's important to note that the associated file is an XML file. Different types of query statements require different XML tags for configuration and identification. These XML tags provide many attributes, essentially pre-setting different types of XML tags and corresponding to MappedStatement objects. MappedStatement objects can be structured query statements, and the XML tags define the execution behavior of each structured query statement. Therefore, Mybatis's parsing rules include the correspondence between XML tags and structured query statement types, parsing the XML tags in the associated file, and determining the existence of corresponding structured query statements by identifying the XML tags.
[0073] It should be noted that developers have different coding habits, and the format used when writing pre-compiled scripts may vary. For example, some developers like to write two tag pairs on the same line, but writing them on the same line is not conducive to file parsing. The generated association file can be adjusted according to the coding format in the pre-compiled script to make the generated association file a standard association file. The standard association file is obtained according to the unified coding format in the pre-compiled script, such as: no more than two tag pairs should appear on the same line.
[0074] Optionally, the associated file is transferred to a preset frame, and the query statement obtained by the preset frame parsing the associated file is obtained, including:
[0075] Based on the associated file, extract the select statement from the associated file to obtain the select statement file;
[0076] The contents of the select statement file are rewritten to obtain a new select statement file;
[0077] Based on the new select statement file, the preset framework is run to obtain the query statements in the new select statement file.
[0078] In this embodiment, the select statement file uses Structured Query Language (SCL), a special-purpose programming language used for database querying and programming. It's used to access, query, update, and manage statements in relational database systems that select data from the database. Select statements include dynamic and static structured query statements. Dynamic structured query statements contain dynamic conditions and can generate multiple structured query statements, while static structured query statements do not contain dynamic conditions and can only generate one structured query statement. The select statement file contains all the select statements extracted from the standard associated file. The select statements in the standard associated file can be extracted using regular expressions. Regular expressions are logical formulas for string manipulation, using predefined specific characters and combinations of these characters to form a "rule string" used to retrieve and replace text that matches a certain pattern (rule). The select statements in the standard associated file can be extracted selectively based on the extraction focus.
[0079] After extracting the SELECT statement file, its contents can be rewritten. This primarily involves removing parameters unrelated to the structured query statements from the SELECT statement file. The remaining SELECT statement file only contains key information from each SELECT statement. This key information is then used to reconstruct and simplify the file, resulting in a new associated file. For example, if the structured query statements in the associated file contain data unrelated to the report to be generated (user class, product type, etc.), this data is not needed to construct the Mybatis project. Only the key information used to construct the Mybatis project needs to be retained. This key information can include the report name, report identifier, etc. Key information can be obtained by iterating through the key information in each SELECT tag pair in the SELECT statement file using keywords. Based on this key information, the file is rewritten to obtain the query statements in the new SELECT statement file. These new query statements are then used to query the preset database to obtain the corresponding business data. Based on this business data, a configurable report is generated.
[0080] S206: Generate configurable reports based on target business data.
[0081] In step S206, a configurable report is generated based on the target business data, and the configurable report is displayed in the preview interface.
[0082] In this embodiment, the target business data is populated into the report to obtain a configurable report, in which data query, deletion and other operations can be performed.
[0083] The system retrieves the configurable fields for each display item in the report to be generated. Based on the collected items in the received configurable fields, it obtains the configuration parameters for the report to be generated. Based on the configuration parameters, it generates the target configuration file corresponding to the report to be generated. Based on the target configuration file, it associates the pre-compiled script file in the preset framework corresponding to the target configuration file to obtain the association file between the preset framework and the preset database. Based on the association file, it retrieves the corresponding target business data from the preset database. Based on the target business data, it generates a configurable report. During the configurable report generation process, developers do not need to perform repetitive work; they only need to generate the corresponding report based on the configuration information, which improves the efficiency of report generation.
[0084] See Figure 3 This is a flowchart illustrating a configurable report generation method according to an embodiment of the present invention, as shown below. Figure 3 The configurable report generation method may include the following steps:
[0085] S301: Retrieve the fields to be configured for each display item in the report to be generated;
[0086] S302: Obtain the configuration parameters of the report to be generated based on the collection items in the received fields to be configured;
[0087] S303: Generate the target configuration file corresponding to the report to be generated based on the configuration parameters.
[0088] The contents of steps S301 to S303 are the same as those of steps S201 to S203, and can be referred to the description of steps S201 to S203, which will not be repeated here.
[0089] S304: Based on the preset framework, create a pre-compiled script file corresponding to the preset framework connection interface and the preset database, and establish a connection with the preset database through the pre-compiled script file;
[0090] S305: Establish a connection to the preset database via a pre-compiled script file.
[0091] In this embodiment, the preset framework is the MyBatis framework. Precompiled script files corresponding to the preset framework connection interface and the preset database are created. The MyBatis framework is a persistent framework, and the precompiled script W is an XML file. Based on the MappedStatement interface in the MyBatis framework, the XML file containing one or more structured query statements is paired to generate the Java program interface precompiled script file. The precompiled script file is used to manage the structured query statements. The precompiled script file manages the query, insert, modify, and delete operations of the corresponding database. Related files are generated based on the precompiled script.
[0092] S306: Based on the target configuration file, associate the pre-compiled script file in the preset framework corresponding to the target configuration file to obtain the association file between the preset framework and the preset database;
[0093] S307: Based on the associated file, retrieve the corresponding target business data from the preset database;
[0094] S308: Generate configurable reports based on target business data.
[0095] The contents of steps S306 to S308 are the same as those of steps S204 to S206. Please refer to the description of steps S204 to S206 above. They will not be repeated here.
[0096] See Figure 4 This is a flowchart illustrating a configurable report generation method according to an embodiment of the present invention, as shown below. Figure 4 The configurable report generation method may include the following steps:
[0097] S401: Retrieve the fields to be configured for each display item in the report to be generated;
[0098] S402: Obtain the configuration parameters of the report to be generated based on the collection items in the received fields to be configured;
[0099] S403: Generate the target configuration file corresponding to the report to be generated based on the configuration parameters;
[0100] S404: Based on the target configuration file, associate the pre-compiled script file in the preset framework corresponding to the target configuration file to obtain the association file between the preset framework and the preset database;
[0101] The contents of steps S401 to S404 are the same as those of steps S201 to S204, and can be referred to the description of steps S201 to S204, which will not be repeated here.
[0102] S405: Synchronize business data to the preset database using the preset synchronization tool;
[0103] S406: Obtain historical data corresponding to business data;
[0104] S407: Filter out the correct business data from the preset database based on historical data, and delete the incorrect business data from the preset database.
[0105] In this embodiment, the preset synchronization tool is the Kettle synchronization tool, which reads the business data that needs to be synchronized from the data terminal and synchronizes it to the preset database according to the method of full synchronization or incremental synchronization. The preset database can be a relational database or a non-relational database. Relational databases store data in the form of a two-dimensional table, including row data and column data. Each row or column represents data corresponding to a table header. Non-relational databases use data storage methods such as Redis and HBase. Redis stores data in key-value pairs, while HBase uses columnar storage, storing data of the same column together and accessing data through column indexes. Before synchronizing to the preset database, the data format in the preset database is determined, and the business data obtained from the data terminal is converted to the corresponding data format of the preset database. For example, when synchronizing from a relational database to a Redis database, the business data in the relational database is first extracted from the database, converted to key-value pair data format, and then written to the preset database.
[0106] It should be noted that if there are additions or deletions in the business data obtained from the data terminal, the added or modified data needs to be synchronized to the preset database. This can be done by reading the business data that needs to be synchronized from the data terminal through the data interface, and then synchronizing the incremental or deleted data to the preset database using the incremental synchronization method.
[0107] Based on the business data, historical data corresponding to the business data is obtained and analyzed. This historical data can be analyzed and processed according to the attributes of the synchronized business data. For example, if the synchronized business data attribute is a classification level, the historical data is classified. In this embodiment, for example, when evaluating employee performance, the historical evaluation data of the corresponding employee is analyzed to determine whether the real-time evaluation data synchronized to the preset database is correct. If the corresponding employee's historical performance is excellent, but the real-time performance synchronized to the preset database is failing, a warning is issued for that business data using a preset reminder method. If synchronization or calculation anomalies occur, TJS is automatically or manually triggered to logically recalculate the data, ensuring the correct synchronized business data is obtained from the preset database.
[0108] S408: Retrieve the corresponding target business data from the preset database according to the mapping file;
[0109] S409: Generate configurable reports based on target business data.
[0110] The contents of steps S408 to S409 are the same as those of steps S405 to S406, and can be referred to the description of steps S405 to S406 above, which will not be repeated here.
[0111] See Figure 5 This is a flowchart illustrating a configurable report generation method according to an embodiment of the present invention, as shown below. Figure 5 The configurable report generation method may include the following steps:
[0112] S501: Retrieve the fields to be configured for each display item in the report to be generated;
[0113] S502: Obtain the configuration parameters of the report to be generated based on the collection items in the received fields to be configured;
[0114] S503: Generates the target configuration file corresponding to the report to be generated based on the configuration parameters;
[0115] S504: Based on the target configuration file, associate the pre-compiled script file in the preset framework corresponding to the target configuration file to obtain the association file between the preset framework and the preset database;
[0116] S505: Based on the associated file, retrieve the corresponding target business data from the preset database;
[0117] S506: Generate configurable reports based on target business data.
[0118] Generate configurable reports based on business data.
[0119] The contents of steps S501 to S506 are the same as those of steps S201 to S206, and can be referred to the description of steps S201 to S206, which will not be repeated here.
[0120] S507: Based on the query command received in the configurable report, obtain the query business data corresponding to the query command, and export the query business data to a preset table.
[0121] In this embodiment, after the generated configurable report is displayed in the preview interface, a query field is entered in the query item of the generated configurable report. Based on the entered query field, the corresponding query instruction is obtained. Based on the query instruction, the business data corresponding to the query instruction is generated in the preview interface of the configurable report.
[0122] It should be noted that the generated configurable report includes an interface operation area, which includes export and delete operations for data in the configurable report. After the corresponding query data is obtained, the data can be directly processed in the preview interface to export the query business data to a preset table.
[0123] Please see Figure 6 , Figure 6 This is a schematic diagram of a configurable report generation device provided in an embodiment of the present invention. In this embodiment, the terminal includes units used for execution... Figures 2 to 5 The steps in the corresponding embodiments. Please refer to the details. Figures 2 to 5 as well as Figures 2 to 5 The relevant descriptions in the corresponding embodiments are shown below. For ease of explanation, only the parts relevant to this embodiment are shown. See also... Figure 5 The configurable report generation device 60 includes: an acquisition module 61, a configuration parameter determination module 62, a target configuration file generation module 63, an associated file determination module 64, a target business data acquisition module 65, and a configurable report generation module 66.
[0124] Module 61 is used to retrieve the fields to be configured for each display item in the report to be generated;
[0125] The configuration parameter determination module 62 is used to obtain the configuration parameters of the report to be generated based on the collection items in the received fields to be configured.
[0126] The target configuration file generation module 63 is used to generate the target configuration file corresponding to the report to be generated based on the configuration parameters.
[0127] The associated file determination module 64 is used to associate the pre-compiled script file in the preset framework corresponding to the target configuration file based on the target configuration file, so as to obtain the associated file between the preset framework and the preset database.
[0128] The target business data acquisition module 65 is used to acquire the corresponding target business data from the preset database based on the associated file;
[0129] The configurable report generation module 66 is used to generate configurable reports based on target business data.
[0130] Optionally, the aforementioned acquisition module 61 includes:
[0131] The configuration file retrieval unit is used to retrieve the configuration file of the report to be generated based on the received request information;
[0132] The "Fields to be configured" unit is used to obtain the fields to be configured for each display item in the report to be generated, based on the configuration file.
[0133] Optionally, the aforementioned target business data acquisition module 65 includes:
[0134] The parsing unit is used to transfer the mapping file to the preset frame and obtain the query statement obtained by the preset frame parsing the associated file;
[0135] The business data acquisition unit is used to retrieve the target business data corresponding to the report to be generated from the preset database according to the query statement.
[0136] Optionally, the above-mentioned parsing unit includes:
[0137] The select statement file retrieval sub-unit is used to extract the select statements in the mapping file based on the mapping file, and obtain the select statement file.
[0138] The rewrite sub-unit is used to rewrite the contents of the select statement file to obtain a new select statement file;
[0139] The query statement retrieval sub-unit is used to run a preset framework based on a new select statement file to obtain the query statements in the new select statement file.
[0140] Optionally, the aforementioned generating apparatus 60 further includes:
[0141] The pre-compiled script creation module is used to create pre-compiled script files corresponding to the preset framework connection interface and the preset database based on the preset framework.
[0142] The connection establishment unit is used to establish a connection with a pre-compiled script file.
[0143] Optionally, the aforementioned generating apparatus 60 further includes:
[0144] The synchronization module is used to synchronize business data to a preset database using a preset synchronization tool;
[0145] The historical data analysis module is used to obtain historical data corresponding to business data;
[0146] The filtering module is used to filter out the correct business data from the preset database based on historical data, and to delete the incorrect business data from the preset database.
[0147] Optionally, the aforementioned generating apparatus 60 further includes:
[0148] The export module is used to obtain the search business data corresponding to the search command entered in the configurable report, and export the search business data to a preset table.
[0149] Figure 7 This is a schematic diagram of the structure of a computer device provided in an embodiment of the present invention. Figure 7 As shown, the computer device of this embodiment includes: at least one processor ( Figure 7 Only one is shown in the diagram), a memory, and a computer program stored in the memory and executable on at least one processor, wherein the processor executes the computer program to implement the steps in any of the above-described configurable report generation method embodiments.
[0150] This computer device may include, but is not limited to, a processor and memory. Those skilled in the art will understand that... Figure 7 The examples of computer devices are merely examples and do not constitute a limitation on computer devices. Computer devices may include more or fewer components than shown in the illustration, or combinations of certain components, or different components, such as network interfaces, displays, and input devices.
[0151] The processor referred to can be a CPU, but it can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor.
[0152] Memory includes readable storage media, internal memory, etc., wherein internal memory can be the RAM of a computer device, providing an environment for the operation of the operating system and computer-readable instructions stored in the readable storage media. The readable storage media can be the hard drive of a computer device, or in other embodiments, it can be an external storage device of the computer device, such as a plug-in hard drive, Smart Media Card (SMC), Secure Digital (SD) card, or Flash Card. Furthermore, memory can include both internal storage units and external storage devices of a computer device. Memory is used to store the operating system, applications, bootloader, data, and other programs, such as program code for computer programs. Memory can also be used to temporarily store data that has been output or will be output.
[0153] Those skilled in the art will understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the functions described above can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this invention. The specific working process of the units and modules in the above device can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here. If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention can implement all or part of the processes in the methods of the above embodiments by instructing related hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the above method embodiments. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. A computer-readable medium can include at least: any entity or device capable of carrying computer program code, a recording medium, a computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media. Examples include USB flash drives, portable hard drives, magnetic disks, or optical disks. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electrical carrier signals or telecommunication signals.
[0154] The present invention can implement all or part of the processes in the methods of the above embodiments, or it can be accomplished by a computer program product. When the computer program product is run on a computer device, the computer device executes the steps in the above method embodiments.
[0155] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0156] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0157] In the embodiments provided by this invention, it should be understood that the disclosed apparatus / computer devices and methods can be implemented in other ways. For example, the apparatus / computer device embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0158] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0159] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.
Claims
1. A method for generating configurable reports, characterized in that, The generation method includes: Retrieve the fields to be configured for each display item in the report to be generated; Based on the collected items in the fields to be configured received, the configuration parameters of the report to be generated are obtained; Based on the configuration parameters, generate the target configuration file corresponding to the report to be generated; Based on the target configuration file, the pre-compiled script file in the preset framework corresponding to the target configuration file is associated to obtain the association file between the preset framework and the preset database; Based on the associated file, retrieve the corresponding target business data from the preset database; Based on the target business data, generate configurable reports; The step of retrieving the corresponding target business data from the preset database based on the associated file includes: The associated file is transmitted to the preset frame, and the query statement obtained by the preset frame parsing the associated file is obtained; Based on the query statement, the corresponding target business data is obtained from the preset database; The step of transmitting the associated file to the preset framework and obtaining the query statement obtained by the preset framework parsing the associated file includes: Based on the mapping file, extract the select statements from the associated file to obtain the select statement file; The contents of the select statement file are rewritten to obtain a new select statement file; Based on the new select statement file, the preset framework is run to obtain the query statement in the new select statement file.
2. The configurable report generation method as described in claim 1, characterized in that, The step of obtaining the fields to be configured for each display item in the report to be generated includes: Based on the received request information, obtain the configuration file for the report to be generated; Based on the configuration file, obtain the fields to be configured for each display item in the report to be generated.
3. The configurable report generation method as described in claim 1, characterized in that, Before the step of associating the pre-compiled script file in the preset framework corresponding to the target configuration file with the preset database, thereby mapping the preset framework to the preset database, and obtaining the corresponding file between the preset framework and the preset database, the method further includes: Based on the preset framework, create a pre-compiled script file corresponding to the preset framework connection interface and the preset database; A connection to the preset database is established through the pre-compiled script file.
4. The configurable report generation method as described in claim 1, characterized in that, Before generating the configurable report based on the target business data, the process also includes: The business data is synchronized to the preset database using a preset synchronization tool. Obtain the historical data corresponding to the business data; Based on the historical data, the correct business data in the preset database is filtered out, and the incorrect business data in the preset database is deleted.
5. The configurable report generation method as described in claim 1, characterized in that, After generating the configurable report based on the target business data, the process also includes: Based on the query command received in the configurable report, obtain the query business data corresponding to the query command, and export the query business data to a preset table.
6. A configurable report generation device, characterized in that, The device includes: The acquisition module is used to acquire the fields to be configured for each display item in the report to be generated; The configuration parameter determination module is used to obtain the configuration parameters of the report to be generated based on the collection items in the received fields to be configured. The target configuration file generation module is used to generate the target configuration file corresponding to the report to be generated based on the configuration parameters. The associated file determination module is used to associate a pre-compiled script file in a preset framework corresponding to the target configuration file with the target configuration file, thereby obtaining a mapping file between the preset framework and the preset database; the mapping file is an XML file. The target business data acquisition module is used to acquire the corresponding target business data from the preset database based on the associated file; The configurable report generation module is used to generate configurable reports based on the target business data. The step of retrieving the corresponding target business data from the preset database based on the associated file includes: The associated file is transmitted to the preset frame, and the query statement obtained by the preset frame parsing the associated file is obtained; Based on the query statement, the corresponding target business data is obtained from the preset database; The step of transmitting the associated file to the preset framework and obtaining the query statement obtained by the preset framework parsing the associated file includes: Based on the mapping file, extract the select statements from the associated file to obtain the select statement file; The contents of the select statement file are rewritten to obtain a new select statement file; Based on the new select statement file, the preset framework is run to obtain the query statement in the new select statement file.
7. A computer device, characterized in that, The computer device includes a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein the processor executes the computer program to implement the configurable report generation method as described in any one of claims 1 to 5.
8. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the configurable report generation method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Report generation method and device, medium and electronic equipment
CN111158795A
Report configuration method, device and equipment and computer storage medium
CN113342821A