Report generation method and device based on low code and medium
Through the low-code report generation method, users can quickly generate reports that meet their needs, solving the problems of high development thresholds for traditional report generation tools and high data integration difficulties, and achieving efficient, flexible and secure report generation.
Patent Information
- Application Number
- CN202510110630.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-23
- Publication Date
- 2025-05-27
AI Technical Summary
The development threshold for traditional report generation tools is high, and it is difficult for non-professional technical developers to use. The content of the report is closely related to the business, the production process is complex and inefficient, and data integration is difficult and lacks flexibility.
Using a low-code report generation method, the data type is determined by the user input data and the adapter is selected, the data is selected through drag and drop operations and parameter mapping is performed, the template rules are determined and the data is rendered to generate a report file.
It improves the flexibility and personalized customization capabilities of report generation, lowers the development threshold, supports a variety of data types and data sources, ensures the accuracy of data query and selection, simplifies the report generation process, improves processing efficiency, and enhances the practicality and security of reports.
Smart Images

Figure CN120045169A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular, to a report generation method, device, and medium based on low-code. Background Art
[0002] Reports are key tools for enterprises to report to their superiors, assisting enterprise leaders and decision-makers to make various decisions quickly and accurately. However, traditional report generation tools have the problem of high development thresholds, making it difficult for non-professional technical developers to handle. Moreover, since the report content is closely related to specific business, the production process is quite complex, with cumbersome processes, resulting in low efficiency. In addition, report data often comes from multiple channels, with great integration difficulty and lack of necessary flexibility. Summary of the Invention
[0003] To solve the above problems, this application proposes a report generation method based on low-code, including: determining the data type according to user input data, determining the interface implementation class corresponding to the data type, and determining the corresponding adapter according to the interface implementation class, so as to query and select the input data through the adapter; determining the selected data through the user's drag-and-drop operation, and performing parameter mapping according to the selected data to determine the template rules, where the template rules include mapping relationships and report layouts; rendering the selected data according to the template rules to generate a report file.
[0004] In one example, before determining the interface implementation class corresponding to the data type, the method further includes: determining the data source and the multiple data types included in the data source; abstracting the data source through a pre-set adapter to determine the multiple interface implementation classes corresponding to the multiple types.
[0005] In one example, before determining the selected data through the user's drag-and-drop operation, the method further includes: determining a pre-set drag-and-drop tool, determining the output fields and configuration information through the drag-and-drop tool; converting according to the output fields and the configuration information to determine the rules of the rule engine; registering the rules through the rule engine and performing logical execution through the rule engine to load the rules.
[0006] In one example, after determining the selected data through the user's drag-and-drop operation, the method further includes: determining the user's configuration information, storing the configuration information in a pre-set database; performing dynamic registration according to the configuration information to determine the corresponding rules.
[0007] In one example, parameter mapping is performed on the selected data, specifically including: determining the report layout and the data dragged by the user, and determining the title row and the data row according to the report layout and the data; determining the pre-set report attributes, and writing the report attributes, the title row, and the data row into the report file.
[0008] In one example, the method further includes: determining a pre-set form designer, and determining a table layout template through the form designer, so that the user determines the dragged form according to the table layout template.
[0009] In one example, the method further includes: encrypting the report file to determine a password, and sending the password to the user.
[0010] In one example, the method further includes: determining the customization task of the user, and determining the task period according to the customization task; determining the periodic report corresponding to the task period, and regularly sending the periodic report to the user.
[0011] On the other hand, the present application also proposes a low-code based report generation device, including: at least one processor; and a memory communicatively connected to the at least one processor; wherein, the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor, so that the low-code based report generation device can execute: determining the data type according to the user input data, determining the interface implementation class corresponding to the data type, and determining the corresponding adapter according to the interface implementation class, so as to query and select the input data through the adapter; determining the selected data through the user's drag operation, performing parameter mapping according to the selected data to determine a template rule, the template rule including a mapping relationship and a report layout; rendering the selected data according to the template rule to generate a report file.
[0012] On the other hand, the present application also proposes a non-volatile computer storage medium storing computer executable instructions, the computer executable instructions being set to: determining the data type according to the user input data, determining the interface implementation class corresponding to the data type, and determining the corresponding adapter according to the interface implementation class, so as to query and select the input data through the adapter; determining the selected data through the user's drag operation, performing parameter mapping according to the selected data to determine a template rule, the template rule including a mapping relationship and a report layout; rendering the selected data according to the template rule to generate a report file.
[0013] This application allows users to select data through drag-and-drop operations and customize the report layout, greatly enhancing the flexibility and personalized customization ability of report generation. Users can quickly create reports that meet their needs without writing complex code. By abstracting the data source and pre-setting the adapter, this method can support multiple data types and data sources, ensuring the accuracy of data query and selection. This provides users with a wide range of data source options and enhances the practicality of the report. This application uses a rule engine for rule registration and logic execution, achieving dynamic loading and intelligent processing of report rules. This helps simplify the report generation process, improve processing efficiency, and ensure the accuracy and consistency of the report. Through parameter mapping and report rendering, this method can automatically generate report files and support multiple report attributes and formats. This provides users with an efficient and convenient way to generate reports, reducing manual operations and time costs. This application encrypts the report file and sends the password to the user, ensuring the security and privacy protection of the report. This provides users with a more reliable and secure way to store and transmit reports. According to the user's customization tasks and task cycles, this method can regularly generate periodic reports and send them to the user. This helps users obtain data and analysis results in a timely manner and provides stronger support for decision-making. This application has the advantages of high flexibility, strong data source adaptability, intelligent processing, high efficiency and convenience, high security, and support for customized tasks and periodic reports, providing users with a high-quality report generation experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] The drawings described herein are used to provide a further understanding of the present application and form a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation of the present application. In the drawings:
[0015] Figure 1 is a schematic flowchart of a low-code-based report generation method in an embodiment of the present application;
[0016] Figure 2 is a schematic diagram of a low-code-based report generation device in an embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0017] To make the objectives, technical solutions, and advantages of the present application clearer, the technical solutions of the present application will be clearly and completely described below in conjunction with the specific embodiments of the present application and the corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.
[0018] The technical solutions provided by each embodiment of the present application will be described in detail below in conjunction with the drawings.
[0019] As Figure 1 shown, to solve the above problems, a low-code based report generation method provided by an embodiment of the present application includes:
[0020] S101. Determine the data type according to the user input data, determine the interface implementation class corresponding to the data type, and determine the corresponding adapter according to the interface implementation class, so as to query and select the input data through the adapter.
[0021] The basic information that needs to be saved for the target data source includes information such as database type, IP address, port, username, password, connection suffix, etc. The specific parameters are shown in Table 1.
[0022] Table 1
[0023]
[0024]
[0025] The form designer provides the user with an Excel table layout template, which is similar to a platform for designing forms. It has a basic canvas and Excel-style layout options. The user can easily design the layout and style of the table by customizing data or dragging form elements and introducing data from external data sources. The low-code backend will parse the canvas content in the designer and convert the layout, style, and data into a JSON data model, and then securely store it on the server side.
[0026] The report design interface integrates a third-party service kkfile to implement the real-time file rendering and preview function. After the user modifies the configuration, the result can be immediately seen, thus saving the time of repeated adjustment and waiting.
[0027] The core logic process of report generation mainly includes five aspects: dynamic template generation, data integration and processing, intelligent assistance, generation, and rendering.
[0028] In one embodiment, the operation of the data source is abstracted through the adapter pattern. Specific data source operation interface classes are implemented for each type of data source, and these implementation classes are registered in the Spring ContextBean. When the user inputs the data source type, the corresponding adapter Bean is dynamically loaded from the Spring Context, so as to achieve efficient data query and conversion. Subsequently, the data processing pipeline is used to perform preliminary processing on the data of the external data source, including processes such as data cleaning, aggregation, sorting, and grouping, so that it can be flexibly triggered as needed when generating reports.
[0029] S102. Determine the selected data through the user's drag operation, and perform parameter mapping based on the selected data to determine the template rules, where the template rules include mapping relationships and report layouts.
[0030] S103. Render the selected data according to the template rules to generate a report file. Based on the dynamic template generation mechanism of the EasyRule rule engine, this mechanism takes the data selected by the user through the drag operation as parameters and maps them into the template generation rules. The mapping relationships are stored in JSON format, effectively achieving the decoupling of report rendering and backend data processing.
[0031] In one embodiment, the report drag-and-drop construction tool usually outputs field and logic configurations. These configuration information can be converted into rules of Easy Rules and presented in JSON form. For example, a rule configuration may include the following content: when the price is greater than 1000, output the price information to the console. Of course, the specific actions can be customized according to business requirements, such as calling the xxl-job client to generate reports regularly.
[0032] In one embodiment, when defining the rule engine and the rule model, use the API of Easy Rules for rule registration and execution logic, so that the configuration files generated by drag-and-drop can be dynamically loaded and converted into rules.
[0033] In one embodiment, the rules need to be tightly bound to the drag-and-drop interface. After the drag-and-drop operation is completed, the configuration information will be directly saved to the database. After the backend receives the configuration submitted by the user, these rules will be dynamically registered.
[0034] In one embodiment, the layout and data mapping of the report are both recorded in the rules in JSON form. This embodiment uses the Apache POI open-source project to generate the title row and data rows of the report according to the report layout and data dragged by the user, and at the same time adjusts attributes such as row height and column width, and finally writes the report to a file. In addition, through the Java client provided by the highly available large-scale distributed storage service Minio, the generated report file is pushed to the Minio server for storage.
[0035] In one embodiment, the report usually restricts the access rights of the report and is only viewable by some users with high permissions. This embodiment uses the encryption tool zip4j to encrypt the report to ensure data security. After the encryption is completed, the system will randomly generate a password and send it to the user through the in-site message system. In addition, to meet the requirements of periodic reports such as weekly reports, monthly reports, and annual reports, this embodiment supports using the Java client of the distributed task processing service XXL-Job in the rule actions to customize tasks to achieve the regular generation of reports.
[0036] In one embodiment, Redis deployed distributively is used to cache report configurations, including configuration information and result data, thereby reducing the access frequency to the database and disk. The Thread Pool TaskExecutor component in the Spring framework is used to configure a thread pool, and the generation speed of complex reports is increased through multi-threading or distributed computing.
[0037] As Figure 2 shown, an embodiment of the present application further provides a low-code based report generation device, including:
[0038] At least one processor; and,
[0039] A memory communicatively connected to the at least one processor; wherein,
[0040] The memory stores instructions executable by the at least one processor, and when the instructions are executed by the at least one processor, a low-code based report generation device can execute:
[0041] Determine the data type according to the user input data, determine the interface implementation class corresponding to the data type, and determine the corresponding adapter according to the interface implementation class, so as to query and select the input data through the adapter;
[0042] Determine the selected data through the user's drag operation, perform parameter mapping according to the selected data, so as to determine the template rules, and the template rules include mapping relationships and report layouts;
[0043] Render the selected data according to the template rules to generate a report file.
[0044] An embodiment of the present application further provides a non-volatile computer storage medium, storing computer-executable instructions, and the computer-executable instructions are set as:
[0045] Determine the data type according to the user input data, determine the interface implementation class corresponding to the data type, and determine the corresponding adapter according to the interface implementation class, so as to query and select the input data through the adapter;
[0046] Determine the selected data through the user's drag operation, perform parameter mapping according to the selected data, so as to determine the template rules, and the template rules include mapping relationships and report layouts;
[0047] Render the selected data according to the template rules to generate a report file.
[0048] In the 1990s, improvements to a technology could be clearly distinguished as either hardware improvements (e.g., improvements to circuit structures such as diodes, transistors, switches, etc.) or software improvements (improvements to method flows). However, with the development of technology, many method flow improvements today can be regarded as direct improvements to hardware circuit structures. Designers almost always obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that an improvement to a method flow cannot be implemented using a hardware entity module. For example, a Programmable Logic Device (PLD) (such as a Field Programmable Gate Array (FPGA)) is such an integrated circuit whose logical function is determined by the user programming the device. Designers can program themselves to "integrate" a digital system onto a single PLD, without having to ask a chip manufacturer to design and fabricate a dedicated integrated circuit chip. Moreover, nowadays, instead of manually fabricating integrated circuit chips, this programming is mostly implemented using "logic compiler" software, which is similar to the software compilers used in program development and writing. The original code before compilation also has to be written in a specific programming language, which is called a Hardware Description Language (HDL), and there is not just one type of HDL, but many types, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones currently are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also be aware that by simply performing a little logical programming on the method flow using the above-mentioned several hardware description languages and programming it into an integrated circuit, it is easy to obtain the hardware circuit that implements the logical method flow.
[0049] The controller can be implemented in any suitable manner. For example, the controller can take the form of, for example, a microprocessor or a processor and a computer-readable medium storing computer-readable program code (such as software or firmware) executable by the (micro)processor, logic gates, switches, an application specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller. Examples of the controller include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320. The memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art also know that in addition to implementing the controller in the form of pure computer-readable program code, it is entirely possible to logically program the method steps to enable the controller to be implemented in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, and embedded microcontrollers to achieve the same function. Therefore, such a controller can be considered a hardware component, and the devices included therein for implementing various functions can also be regarded as the structures within the hardware component. Or even, the devices for implementing various functions can be regarded as either software modules for implementing the method or the structures within the hardware component.
[0050] The systems, devices, modules, or units illustrated in the above embodiments can be specifically implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer can be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0051] For the convenience of description, when describing the above devices, they are described separately as various units according to their functions. Of course, when implementing this specification, the functions of each unit can be implemented in one or more software and / or hardware.
[0052] Each embodiment in this application is described in a progressive manner. The same or similar parts among the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device and medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.
[0053] The devices, media, and methods provided by the embodiments of this application correspond one-to-one. Therefore, the devices and media also have beneficial technical effects similar to those of their corresponding methods. Since the beneficial technical effects of the methods have been described in detail above, the beneficial technical effects of the devices and media will not be elaborated here.
[0054] Those skilled in the art should understand that the embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, this application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk memories, CD-ROMs, optical memories, etc.) containing computer-usable program code.
[0055] This application is described with reference to the flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to the embodiments of this application. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, such that the instructions executed by the processor of the computer or other programmable data processing devices generate means for implementing the functions specified in Figure 1 one process or multiple processes and / or blocks Figure 1 one block or multiple blocks.
[0056] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, such that the instructions stored in the computer-readable memory generate a manufactured article including instruction means that implement the functions specified in Figure 1 one process or multiple processes and / or blocks Figure 1 one block or multiple blocks.
[0057] These computer program instructions can also be loaded onto a computer or other programmable data processing device, such that a series of operation steps are executed on the computer or other programmable device to generate a computer-implemented process. Thus, the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in Figure 1 one process or multiple processes and / or blocks Figure 1 one block or multiple blocks.
[0058] In a typical configuration, a computing device includes one or more processors (CPUs), an input / output interface, a network interface, and memory.
[0059] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0060] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules 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, 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. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0061] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0062] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.
Claims
1. A report generation method based on low code, characterized in that: include: Determine a data type according to user input data, determine an interface implementation class corresponding to the data type, and determine a corresponding adapter according to the interface implementation class, so as to query and select the input data through the adapter; Determine the selected data through the user's dragging operation, perform parameter mapping according to the selected data to determine the template rule, the template rule includes a mapping relationship and a report layout; The selected data is rendered according to the template rule to generate a report file.
2. The method according to claim 1, characterized in that Before determining the interface implementation class corresponding to the data type, the method further includes: Determine a data source, and determine multiple data types contained in the data source; The data source is abstractly processed through a preset adapter to determine a plurality of interface implementation classes corresponding to the plurality of types.
3. The method according to claim 1, characterized in that Before determining the selected data through the user's dragging operation, the method further includes: Determine a preset drag tool, and determine output fields and configuration information through the drag tool; Performing conversion according to the output field and the configuration information to determine the rule of the rule engine; The rules are registered through the rule engine, and logic execution is performed through the rule engine to load the rules.
4. The method according to claim 1, characterized in that: After determining the selected data through the user's dragging operation, the method further includes: Determining the configuration information of the user, and storing the configuration information in a pre-set database; Dynamic registration is performed according to the configuration information to determine the corresponding rules.
5. The method according to claim 1, characterized in that Parameter mapping is performed according to the selected data, specifically including: Determine the report layout and the data dragged by the user, and determine a title row and a data row according to the report layout and the data; Determine the preset report attributes, and write the report attributes, the title row and the data row into the report file.
6. The method according to claim 1, characterized in that The method further comprises: A pre-set form designer is determined, and a table layout template is determined by the form designer, so that the user determines the dragged form according to the table layout template.
7. The method according to claim 1, characterized in that The method further comprises: The report file is encrypted to determine a password, and the password is sent to the user.
8. The method according to claim 1, characterized in that The method further comprises: Determine a customized task for the user, and determine a task cycle according to the customized task; Determine a periodic report corresponding to the task period, and send the periodic report to the user regularly.
9. A report generation device based on low code, characterized in that: include: at least one processor; as well as, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the low-code-based report generation device to perform: Determine a data type according to user input data, determine an interface implementation class corresponding to the data type, and determine a corresponding adapter according to the interface implementation class, so as to query and select the input data through the adapter; Determine the selected data through the user's dragging operation, perform parameter mapping according to the selected data to determine the template rule, the template rule includes a mapping relationship and a report layout; The selected data is rendered according to the template rule to generate a report file.
10. A non-volatile computer storage medium storing computer executable instructions, characterized in that: The computer executable instructions are configured to: Determine a data type according to user input data, determine an interface implementation class corresponding to the data type, and determine a corresponding adapter according to the interface implementation class, so as to query and select the input data through the adapter; Determine the selected data through the user's dragging operation, perform parameter mapping according to the selected data to determine the template rule, the template rule includes a mapping relationship and a report layout; The selected data is rendered according to the template rule to generate a report file.
Citation Information
Cited By
Method for automatically generating execution brief report
CN120893416A