A report generation method, device, equipment and storage medium
Through an automated report generation method, the problems of high cost and complex development of traditional report generation methods are solved, and a more efficient and lower-cost report development process is achieved.
Patent Information
- Application Number
- CN202011295462.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-11-18
- Publication Date
- 2025-03-25
- Estimated Expiration
- 2040-11-18
AI Technical Summary
Traditional report generation methods are costly, have a long development cycle, and have high requirements for developers. They need to master both front-end and back-end development languages at the same time.
It provides a report generation method, which automatically extracts and generates reports by obtaining the report information entered by users, selecting data sources and generating conditions, reducing development thresholds and costs.
It reduces the time and labor cost of report development, improves the efficiency and aesthetics of report development, and simplifies the development process.
Smart Images

Figure CN112487773B_ABST
Abstract
Description
Technical Field
[0001] One or more embodiments of the present specification relate to the field of visual data technology, and in particular, to a report generation method, apparatus, device, and storage medium. Background Art
[0002] Data visualization is to present data in the form of charts, so that users can more quickly understand the information conveyed by the data, so that management can make more effective decisions, thereby improving corporate efficiency. Today, as mobile phones have gradually become a necessity of life, users have gradually become accustomed to using mobile devices such as smartphones to handle various needs in life and work. In the past, developing reports through traditional methods required a lot of manual labor, and solidifying business needs to develop visual reports into the system required a long processing process, which can no longer meet users' needs for visual reports.
[0003] Traditional report development requires manual writing in HTML pages The report table is designed using tags such as , and the report data interface is developed using languages such as Java. Jdbc or MyBatis is used to query the report data, and the query data is returned to the page to display the report. The entire development cycle of the report is long, and it is not easy to modify after development. Each modification requires a new version.
[0004] The traditional model of report development places high demands on report developers, who are required to master both the front-end language and a back-end development language (such as Java). The traditional model of report development requires a high time cost, as each time a new report is developed, the front-end page and data interface need to be redeveloped. Summary of the invention
[0005] In view of this, an object of one or more embodiments of the present specification is to provide a report generation method, apparatus, device and storage medium to solve the problem of high cost of existing report generation methods.
[0006] Based on the above purpose, one or more embodiments of this specification provide a report generation method, including:
[0007] Acquiring report information input by a user on a device terminal, selection of a report data source, and selection of at least one pre-configured report generation condition;
[0008] Extract report data from the selected report data source according to the selected report generation conditions;
[0009] A report is generated according to the report information and the report data.
[0010] Optionally, the report information includes at least one of the following: basic report information, a banner image, a report description, and a report watermark.
[0011] Optionally, the report data source includes: at least one database among Sql Server, Oracle, Mysql and Hive.
[0012] Optionally, the at least one pre-configured report generation condition includes: a time condition and / or a report dimension condition.
[0013] Optionally, extracting report data from a selected report data source according to the selected report generation condition includes:
[0014] According to the selected report generation condition and in accordance with the data query template corresponding to the selected report data source, a data query statement corresponding to the selected report generation condition is generated, and the data query statement is executed in the selected report data source to obtain the report data.
[0015] Optionally, the basic information of the report includes at least one of the following: report name, report agency, demanding department and person making the demand.
[0016] Optionally, the report watermark includes: login account information and login time information.
[0017] Based on the same inventive concept, one or more embodiments of this specification provide a report generation device, including:
[0018] A report configuration acquisition module, used to acquire report information input by a user on a device terminal, a selection of a report data source, and a selection of at least one pre-configured report generation condition;
[0019] A report data acquisition module, used to extract report data from a selected report data source according to the selected report generation conditions;
[0020] The report generation module is used to generate a report based on the report information and the report data.
[0021] Based on the same inventive concept, one or more embodiments of this specification provide an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method described above when executing the program.
[0022] Based on the same inventive concept, one or more embodiments of this specification provide a non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the computer to execute the above method.
[0023] From the above description, it can be seen that the report generation method, apparatus, device and storage medium provided in one or more embodiments of the present specification obtain the report information input by the user on the device terminal, the selection of the report data source and the selection of at least one pre-configured report generation condition; extract the report data from the selected report data source according to the selected report generation condition; generate the report according to the report information and the report data. The present invention reduces the threshold for report development, reduces the cost of report development, and improves the aesthetics of the report. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] In order to more clearly illustrate one or more embodiments of the present specification or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only one or more embodiments of the present specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0025] Figure 1 A flowchart of a report generation method provided by one or more embodiments of this specification;
[0026] Figure 2 A schematic diagram of a structure of a report generation device provided in one or more embodiments of this specification;
[0027] Figure 3 A more specific schematic diagram of the hardware structure of an electronic device is provided for one or more embodiments of this specification. DETAILED DESCRIPTION
[0028] In order to make the objectives, technical solutions and advantages of the present disclosure more clearly understood, the present disclosure is further described in detail below in combination with specific embodiments and with reference to the accompanying drawings.
[0029] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in one or more embodiments of this specification should be understood by people with ordinary skills in the field to which this disclosure belongs. The words "first", "second" and similar words used in one or more embodiments of this specification do not indicate any order, quantity or importance, but are only used to distinguish different components. Words such as "include" or "comprise" mean that the elements or objects appearing before the word include the elements or objects listed after the word and their equivalents, without excluding other elements or objects. Words such as "connect" or "connected" are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "Up", "down", "left", "right", etc. are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly.
[0030] Data visualization is to present data in the form of charts, so that users can more quickly understand the information conveyed by the data, so that management can make more effective decisions, thereby improving corporate efficiency. Today, as mobile phones have gradually become a necessity of life, users have gradually become accustomed to using mobile devices such as smartphones to handle various needs in life and work. In the past, developing reports through traditional methods required a lot of manual labor, and solidifying business needs to develop visual reports into the system required a long processing process, which can no longer meet users' needs for visual reports.
[0031] Traditional report development requires manual writing in HTML pages The report table is designed using tags such as , and the report data interface is developed using languages such as Java. Jdbc or MyBatis is used to query the report data, and the query data is returned to the page to display the report. The entire development cycle of the report is long, and it is not easy to modify after development. Each modification requires a new version.
[0032] The traditional model of report development places high demands on report developers, who are required to master both the front-end language and a back-end development language (such as Java). The traditional model of report development requires a high time cost, as each time a new report is developed, the front-end page and data interface need to be redeveloped.
[0033] The report generation method provided in one or more embodiments of this specification pre-configures report configuration information into a database. During the report generation process, only the configuration step needs to be operated, and the other steps are automatically executed, thereby reducing development efficiency and costs.
[0034] Figure 1 A flow chart of a report generation method provided in one or more embodiments of this specification, the report generation method comprising:
[0035] S110: Acquire report information input by a user on a device terminal, selection of a report data source, and selection of at least one pre-configured report generation condition.
[0036] Optionally, the report information includes at least one of the following: basic report information, banner image, report description and report watermark. The basic report information includes at least one of the following: report name, report affiliated organization, demand department and demand proposer. The report watermark includes login account information and login time information.
[0037] Optionally, the report data source includes: at least one database among Sql Server, Oracle, Mysql and Hive.
[0038] Optionally, the at least one pre-configured report generation condition includes: a time condition and / or a report dimension condition.
[0039] As an example, the present invention provides a report configuration interface as a report configuration interface to obtain report information input by a user on a device terminal, selection of a report data source, and selection of at least one pre-configured report generation condition.
[0040] The basic information of the report includes the report name, the report organization, the demand department and the demand proposer. The present invention provides a window interface for the user to input or a drop-down list for the user to select the preset report name, report organization, demand department and demand proposer. The basic information of the report can facilitate the search and classification of the report, and the organization of the user who logged in the report can be queried, and then the configuration can be automatically filled.
[0041] The banner image part provides a banner image upload interface. Users can upload image files in common data formats such as jpg and png through the provided banner image upload interface. In some cases, the size of the image file is limited, such as 100kb. The reports developed by existing tools are not beautiful enough. In report development, in addition to pursuing higher development efficiency, we also pursue the beauty of visualization. By adding banner images, the beauty of the report is increased.
[0042] The report description includes the description of the report content, such as the annual cumulative data as of the current year, and the description of the unit of the report data. The report description is a supplementary description of the report content, which allows users to understand the report data in more detail.
[0043] The report watermark section includes a checkbox to show or hide the watermark. Users can check the checkbox to show or hide the watermark. The watermark content is pre-set, for example, including: login user information and login time. By obtaining the login user information, the information plus the time is displayed as a watermark on the report page. This function can increase the security of the data.
[0044] The user pre-draws several required header styles, parses the headers through the POI function algorithm, and stores them in the database for subsequent selection. The header style can be drawn through Excel. The report header part includes several dimension information, which can be one or more of the X-axis row name or the Y-axis column name.
[0045] It also includes maintaining indicator properties, including sorting, warning, dimension information conversion, drilling down and jumping of any field.
[0046] It also includes filtering conditions, specifically including the function of adding new conditions. The newly added conditions include the display name and the value corresponding to the display name. Users can add and delete conditions through this function. Optional filtering conditions include: effective scope, payment scope, monthly value, annual accumulation, quarterly accumulation, monthly accumulation, daily accumulation, overall, individual insurance, bank insurance, group insurance, telemarketing, total premium, first year standard insurance, first year term payment, 10-year term payment and protection type. The dimension information is configured by filtering conditions, and the configured field names and field values are consistent with the field names and field values in the database.
[0047] The report data source section provides a data source drop-down list for users to select a report data source, which includes several pre-configured data sources. Users can pre-configure their own database to maintain data source information for subsequent report data query work. The data source is obtained from the data source entry address and loaded into the memory corresponding to each instance. Specifically, it is a process of dynamic data source injection, which loads multiple instances of existing data sources into the memory at the same time when the system starts. During the operation, the newly added data source uses a distributed notification mechanism to ensure that all instances are loaded into the memory.
[0048] The time condition includes a date range. The present invention provides a calendar-style configuration query time interface. The user can configure the query time on the provided calendar-style interface through the configuration query time function.
[0049] S120: Extracting report data from the selected report data source according to the selected report generation condition.
[0050] Optionally, based on the selected report generation condition and in accordance with the data query template corresponding to the selected report data source, a data query statement corresponding to the selected report generation condition is generated, and the data query statement is executed in the selected report data source to obtain the report data.
[0051] As an optional embodiment, different report data sources correspond to different database syntaxes. The present invention provides data query statement templates corresponding to each data source, such as SQL templates. The values of the configured dimension conditions and time condition information are replaced in the SQL template to generate executable SQL. Because the SQL template is configured when configuring SQL, different values of the filter conditions can be replaced in the template, so that multiple SQLs can be combined into one dynamic SQL.
[0052] As an optional embodiment, a multi-data source connection pool is used to execute the spliced dynamic SQL in the data source selected by the user to obtain the query results as report data.
[0053] S130: Generate a report according to the report information and the report data.
[0054] The report data is filled into a report created according to the report information.
[0055] The report generation method further includes:
[0056] Report publishing: When all the information is filled in, the script is verified and the report is published if it meets the verification rules.
[0057] Report display: After the report is published, you can display the report in the report menu, or preview the report on the report management page.
[0058] The present invention only requires input of information in the configuration step, and other stages are automatically executed, thereby improving the efficiency of report development and reducing labor costs. When new requirements arise, only the information in the configuration needs to be changed, which has high flexibility. When a new report needs to be added, there is no need to re-encode, only to configure it through the interface, which greatly simplifies the development workload.
[0059] It should be noted that the method of one or more embodiments of this specification can be performed by a single device, such as a computer or server. The method of this embodiment can also be applied in a distributed scenario and completed by multiple devices cooperating with each other. In the case of such a distributed scenario, one of the multiple devices can only perform one or more steps in the method of one or more embodiments of this specification, and the multiple devices will interact with each other to complete the described method.
[0060] It should be noted that the above is a description of a specific embodiment of the present specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0061] Based on the same inventive concept, corresponding to any of the above-mentioned embodiments and methods, one or more embodiments of this specification further provide a report generation device. Figure 2 , a report generating device, comprising:
[0062] The report configuration acquisition module 210 is used to acquire the report information input by the user on the device terminal, the selection of the report data source and the selection of at least one pre-configured report generation condition;
[0063] The report data acquisition module 220 is used to extract report data from the selected report data source according to the selected report generation condition;
[0064] The report generation module 230 is used to generate a report according to the report information and the report data.
[0065] For the convenience of description, the above devices are described in terms of functions divided into various modules. Of course, when implementing one or more embodiments of this specification, the functions of each module can be implemented in the same or multiple software and / or hardware.
[0066] The device of the above embodiment is used to implement the corresponding report generation method in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be described in detail here.
[0067] Based on the same inventive concept, corresponding to any of the above-mentioned embodiments and methods, one or more embodiments of this specification also provide an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the report generation method described in any of the above embodiments is implemented.
[0068] Figure 3 A more specific schematic diagram of the hardware structure of an electronic device provided in this embodiment is shown, and the device may include: a processor 1010, a memory 1020, an input / output interface 1030, a communication interface 1040, and a bus 1050. The processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040 are connected to each other through the bus 1050 in the device.
[0069] The processor 1010 can be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this specification.
[0070] The memory 1020 may be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 1020 may store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented by software or firmware, the relevant program codes are stored in the memory 1020 and are called and executed by the processor 1010.
[0071] The input / output interface 1030 is used to connect the input / output module to realize information input and output. The input / output module can be configured in the device as a component (not shown in the figure), or it can be externally connected to the device to provide corresponding functions. The input device may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output device may include a display, a speaker, a vibrator, an indicator light, etc.
[0072] The communication interface 1040 is used to connect a communication module (not shown) to realize communication interaction between the device and other devices. The communication module can realize communication through a wired mode (such as USB, network cable, etc.) or a wireless mode (such as mobile network, WIFI, Bluetooth, etc.).
[0073] The bus 1050 includes a path that transmits information between the various components of the device (eg, the processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040).
[0074] It should be noted that, although the above device only shows the processor 1010, the memory 1020, the input / output interface 1030, the communication interface 1040 and the bus 1050, in the specific implementation process, the device may also include other components necessary for normal operation. In addition, it can be understood by those skilled in the art that the above device may also only include the components necessary for implementing the embodiments of the present specification, and does not necessarily include all the components shown in the figure.
[0075] The electronic device of the above embodiment is used to implement the corresponding report generation method in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be described in detail here.
[0076] Based on the same inventive concept, corresponding to any of the above-mentioned embodiments and methods, one or more embodiments of this specification also provide a non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the computer to execute the report generation method described in any of the above embodiments.
[0077] The computer-readable medium of this embodiment includes permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device.
[0078] The computer instructions stored in the storage medium of the above embodiment are used to enable the computer to execute the report generation method described in any of the above embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.
[0079] Those skilled in the art should understand that the discussion of any of the above embodiments is merely illustrative and is not intended to imply that the scope of the present disclosure (including the claims) is limited to these examples. In line with the present disclosure, the technical features in the above embodiments or different embodiments may be combined, the steps may be implemented in any order, and there are many other variations of different aspects of one or more embodiments of the present specification as described above, which are not provided in detail for the sake of simplicity.
[0080] In addition, to simplify the description and discussion, and in order not to obscure one or more embodiments of the present specification, known power / ground connections to integrated circuit (IC) chips and other components may or may not be shown in the provided figures. In addition, the device may be shown in the form of a block diagram so as to avoid obscuring one or more embodiments of the present specification, and this also takes into account the fact that the details of the implementation of these block diagram devices are highly dependent on the platform on which one or more embodiments of the present specification will be implemented (i.e., these details should be fully within the scope of understanding of those skilled in the art). Where specific details (e.g., circuits) are set forth to describe exemplary embodiments of the present disclosure, it is apparent to those skilled in the art that one or more embodiments of the present specification may be implemented without these specific details or with variations in these specific details. Therefore, these descriptions should be considered illustrative rather than restrictive.
[0081] Although the present disclosure has been described in conjunction with specific embodiments of the present disclosure, many replacements, modifications and variations of these embodiments will be apparent to those skilled in the art from the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) may use the embodiments discussed.
[0082] One or more embodiments of this specification are intended to cover all such substitutions, modifications and variations that fall within the broad scope of the appended claims. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of one or more embodiments of this specification should be included in the scope of protection of this disclosure.
Claims
1. A report generation method, characterized in that: include: Acquiring report information input by a user on a device terminal, selection of a report data source, and selection of at least one pre-configured report generation condition; According to the selected report generation condition, according to the data query template corresponding to the selected report data source, a data query statement corresponding to the selected report generation condition is generated, different report data sources correspond to different database syntaxes, and different values are replaced for the filter conditions to combine multiple data query statements into a dynamic data query statement, and the dynamic data query statement is executed in the selected report data source to obtain the report data; A report is generated according to the report information and the report data.
2. The method according to claim 1, characterized in that The report information includes at least one of the following: basic report information, banner image, report description and report watermark.
3. The method according to claim 1, characterized in that The report data source includes: at least one database among Sql Server, Oracle, Mysql and Hive.
4. The method according to claim 1, characterized in that The at least one pre-configured report generation condition includes: a time condition and / or a report dimension condition.
5. The method according to claim 2, characterized in that: The basic information of the report includes at least one of the following: report name, report to which the report belongs, demanding department and demand proposer.
6. The method according to claim 2, characterized in that The report watermark includes: login account information and login time information.
7. A report generation device, characterized in that: include: A report configuration acquisition module, used to acquire report information input by a user on a device terminal, a selection of a report data source, and a selection of at least one pre-configured report generation condition; A report data acquisition module is used to generate a data query statement corresponding to the selected report generation condition according to the selected report generation condition and the data query template corresponding to the selected report data source, and different report data sources correspond to different database syntaxes. Different values are replaced for the filter conditions to synthesize multiple data query statements into a dynamic data query statement, and the dynamic data query statement is executed in the selected report data source to obtain the report data; The report generation module is used to generate a report based on the report information and the report data.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the method according to any one of claims 1 to 6 is implemented.
9. A non-transitory computer-readable storage medium, characterized in that: The non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to cause the computer to execute any one of claims 1 to 6.
Citation Information
Patent Citations
Report generation method, device and equipment
CN110728126A