SAAS system customized report generation method and device based on dynamic template configuration

By decoupling SaaS system report generation through dynamic template configuration and metadata description files, the problems of code redundancy, maintenance difficulties, and complex data isolation in traditional SaaS systems are solved, enabling efficient and secure customized report generation that can adapt to rapid scaling.

CN121168434APending Publication Date: 2025-12-19GUANGZHOU GETSOFT CO LTD

Patent Information

Application Number
CN202511276361.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-08
Publication Date
2025-12-19

AI Technical Summary

Technical Problem

Traditional SaaS system report development suffers from problems such as code redundancy, maintenance difficulties, insufficient scalability, weak support for dynamic content, and complex multi-tenant data isolation. Existing solutions have failed to fundamentally solve these problems.

Method used

By adopting a dynamic template configuration approach, the report format definition is decoupled from business logic through visual report templates and metadata description files. Customized business data is obtained using a unified data interface, and the data is dynamically populated through a hybrid rendering engine to generate reports.

Benefits of technology

It reduces system maintenance workload, lowers the cost of new tenant onboarding, improves rendering speed and security, supports rich content presentation, and ensures data isolation and system stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121168434A_ABST
    Figure CN121168434A_ABST
Patent Text Reader

Abstract

The invention provides a method and a device for generating a customized report of an SAAS (Software as a Service) system based on dynamic template configuration. The method comprises the following steps: acquiring a customized visual report template for realizing business data decoupling; editing the report template based on a preset editor, and generating a template configuration file; analyzing a structured marker in the template configuration file to generate a metadata description file; querying a business database through a unified data interface according to a data requirement defined by the metadata description file, and obtaining and assembling customized business data corresponding to the tenant ID; and at least based on the customized business data, controlling a rendering process through a dynamic position calculation algorithm, and dynamically filling the data to a corresponding position of the report template to generate a customized report. According to the method, the problems of code redundancy and difficulty in maintenance of the SAAS multi-tenant report are solved, zero code configuration is realized, and report generation efficiency and tenant personalized adaptation capability are improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of software as a service, and in particular to a SAAS system customized report generation method and device based on dynamic template configuration. BACKGROUND

[0002] In the traditional software as a service (SAAS) system report development, the report export function is usually realized by hard coding. That is, for the individualized report format needs of different tenants, the developer needs to write special data query, processing and export modules. This implementation method has the following significant technical bottlenecks:

[0003] 1. Code redundancy and poor maintainability: each tenant's report format difference needs to develop a set of export logic separately, resulting in exponential growth of system code volume. For example, developing 10 different formats of order report for 10 tenants may need to maintain 10 different code paths. This not only causes code base to be bloated, but also any minor business logic changes need to be modified in multiple places, making code maintenance extremely difficult.

[0004] 2. Poor system scalability: when a new tenant is added or an existing tenant proposes new report format needs, the report generation logic must be re-written by the developer, tested and deployed online. The system function is highly coupled with the tenant's needs, and cannot quickly respond to market changes, seriously restricting the scale expansion of SAAS business.

[0005] 3. Weak support for dynamic content: traditional technical solutions (such as simple POI operations or some report tools) cannot flexibly and efficiently support the embedding of unstructured data such as pictures and two-dimensional codes. Implementing such functions often requires writing complex and non-universal underlying code, which cannot meet the general demand of modern enterprise reports for rich content presentation.

[0006] 4. Complex implementation of multi-tenant data isolation: in the traditional hard coding mode, to ensure the security of different tenant data isolation, a fixed format condition needs to be explicitly added to each data query code. Developers are prone to miss this condition, which poses a risk of unauthorized access to data, and the security policy is scattered throughout the code, making it difficult to audit and manage uniformly.

[0007] Some existing solutions, such as using professional report tools (such as JasperReports) or template engines, to some extent alleviate the problem of style and logic separation, but still have high learning costs, complex configuration, poor compatibility with common office table ecologies, and other problems, and have not fundamentally solved the above technical defects. SUMMARY

[0008] In view of the deficiencies of the prior art, the present application provides a SAAS system customized report generation method based on dynamic template configuration, comprising:

[0009] Obtaining a customized visual report template for realizing business data decoupling;

[0010] Editing the report template based on a preset editor to generate a template configuration file;

[0011] Parsing the structured markers in the template configuration file to generate a metadata description file;

[0012] According to the data requirements defined by the metadata description file, querying the business database through a unified data interface to obtain and assemble the customized business data corresponding to the tenant ID;

[0013] Based at least on the customized business data, controlling the rendering process through a dynamic position calculation algorithm to dynamically fill the data into the corresponding positions of the report template to generate a customized report.

[0014] In one embodiment, the above-mentioned editing the report template based on the preset editor to generate the template configuration file comprises:

[0015] Based on the first input operation of the tenant on the preset editor, inserting structured markers in the cells of the report template, the markers including field markers, picture markers and coded graphic markers;

[0016] Based on the second input operation of the tenant on the preset editor, determining the dynamic area boundary;

[0017] Based at least on the structured markers and the dynamic area boundary, generating the template configuration file.

[0018] In one embodiment, the above-mentioned parsing the structured markers in the template configuration file to generate the metadata description file comprises:

[0019] Controlling a metadata parser to perform the following operations:

[0020] Based on a pre-defined semantic rule library and mapping relationship, performing pattern matching on the field name in the field marker to determine the data type and verification rule corresponding to the matching result;

[0021] Based on the type of the coded graphic marker, assigning it an optimized default fault tolerance level;

[0022] Based on the size of the cell where the picture marker is located and the layout of the surrounding cells, calculating its maximum size constraint;

[0023] Based on the position context of the packet marker in the report template, the expansion direction of the dynamic area is intelligently determined.

[0024] In one embodiment, the data requirement defined by the metadata description file is used to query a business database through a unified data interface to obtain and assemble customized business data corresponding to the tenant ID, including:

[0025] The metadata description file is parsed to extract a list of field names and data grouping instructions defined therein;

[0026] The list of field names is mapped and checked against a predefined field name whitelist to generate a secure database query field name set;

[0027] A SQL statement is dynamically constructed, with the select clause of the SQL statement based on the query field name set, the where clause containing a filtering statement conditioned on the current tenant ID, and the group by clause generated based on the data grouping instruction;

[0028] The SQL statement is executed to obtain an original data set from the business database;

[0029] The original data set is encapsulated according to the field structure defined by the metadata description file and assembled into a customized business data object in the form of key-value pairs for use by a rendering engine.

[0030] In one embodiment, at least based on the customized business data, a dynamic position calculation algorithm is used to control the rendering process to dynamically fill data into corresponding positions of the report template to generate a customized report, specifically:

[0031] Based on the metadata description file and the customized business data, a hybrid rendering engine is used to dynamically fill data into corresponding positions of the report template; wherein the filling process is controlled by a dynamic position calculation algorithm to automatically adjust the template layout according to the data volume to generate a customized report.

[0032] In one embodiment, the dynamic position calculation algorithm includes:

[0033] According to the field type in the metadata description file, the data set in the dynamic area is intelligently grouped, and the number of rows required for each group of data is predicted;

[0034] According to the predicted number of rows, a matrix splitting operation is performed on the cells marked as dynamic areas to expand the physical space and automatically inherit the styles of the original template;

[0035] The report element dependency graph is established, the displacement amount generated by dynamic area expansion is calculated, and the coordinates of all affected cells, charts and formulas downstream are translated and rewritten to avoid layout conflicts.

[0036] In one of the embodiments, the hybrid rendering engine is used for:

[0037] The nested expression syntax in the field marker is identified, the abstract syntax tree is constructed by the recursive descent parsing algorithm, and the deep-first traversal calculation is performed, and the real-time listener of the expression field is established;

[0038] The request of the picture or the coded graphic marker is intercepted, the zero-copy processing chain including size scaling, format conversion and watermark superposition is performed on the binary stream, and the data integrity is ensured through the stream fingerprint checking algorithm;

[0039] The dangerous function is intercepted through the syntax sandbox, the cell locking technology is used to protect the cell containing the expression, the formula modification event chain is recorded, and when illegal tampering is detected, the version rollback device is used to restore to the latest valid snapshot.

[0040] The application further provides a SAAS system customized report generation device based on dynamic template configuration, comprising:

[0041] A first acquisition module is configured to acquire a customized visual report template for realizing business data decoupling;

[0042] A first generation module is configured to edit the report template based on a preset editor and generate a template configuration file;

[0043] A second generation module is configured to parse a structured marker in the template configuration file and generate a metadata description file;

[0044] A second acquisition module is configured to query a business database through a unified data interface according to a data requirement defined by the metadata description file, acquire and assemble customized business data corresponding to a tenant ID, and obtain the customized business data;

[0045] A third generation module is configured to control a rendering process through a dynamic position calculation algorithm based on at least the customized business data, dynamically fill data into a corresponding position of the report template, and generate a customized report.

[0046] The application further provides a computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the SAAS system customized report generation method based on dynamic template configuration.

[0047] The application further provides a computer storage medium, which stores a computer program, and the program is executed by a processor to realize the SAAS system customized report generation method based on dynamic template configuration.

[0048] The SAAS system customized report generation method based on dynamic template configuration provided by the embodiment of the application successfully decouples the format definition of the report from the business logic and data acquisition by introducing a visual report template and a metadata description file. Changes in the format requirements of tenants are limited to the template and metadata level, and there is no need to modify, compile and deploy any backend code, thereby reducing the system maintenance workload. Meanwhile, thanks to the decoupling design of the unified data interface for dynamically constructing a query statement according to the metadata, when a new tenant is accessed or a new report requirement is added to an existing tenant, the system function is completely decoupled from the tenant requirement. Without writing any new code, the system can be automatically adapted by designing a template according to the requirement, thereby reducing the access cost of the new tenant and providing strong architectural support for the rapid scaling of the SAAS platform. In addition, the application decouples the processing requirements of elements such as pictures and two-dimensional codes from the business code by defining a standardized structured marker, and the processing requirements are standardized and processed in a pipeline by a special hybrid rendering engine. The application decouples the data isolation strategy from the dispersed business code and implements it in a centralized manner at the architecture level of the unified data interface. The interface forcibly adds a tenant ID filtering condition when dynamically constructing a SQL, so that the data isolation becomes an automatically executed architecture security feature that is independent of the specific business logic, thereby fundamentally eliminating the data leakage risk that may be caused by the coupling with the business logic and enhancing the security and reliability of the system. Finally, the dynamic position calculation algorithm is decoupled from the business data, the layout prediction and adjustment are performed only by relying on the metadata, and the zero-copy processing chain and other efficient technologies are combined, so that the report rendering is completed in a decoupled manner at the architecture level. The function is clear and easy to maintain, and the performance is significantly better than that of the traditional coupling scheme. The rendering speed is effectively improved, and the enterprise-level application is perfectly supported. BRIEF DESCRIPTION OF DRAWINGS

[0049] In order to more clearly illustrate the technical solutions in the embodiments of the application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or the prior art description. Obviously, the drawings in the following description only some embodiments of the application, and for those skilled in the art, other drawings can be obtained without creative labor.

[0050] Figure 1 The flowchart of the SAAS system customized report generation method based on dynamic template configuration of the first embodiment of the application;

[0051] Figure 2 The management interface schematic diagram of the visual report template of the application;

[0052] Figure 3 For Figure 2 Interface corresponding to the schematic diagram of the template;

[0053] Figure 4 For the detailed flow chart of S12 of the first embodiment of the application;

[0054] Figure 5 For one of the detailed flow chart of S13 of the first embodiment of the application;

[0055] Figure 6 For one of the detailed flow chart of S14 of the first embodiment of the application;

[0056] Figure 7 For one of the detailed flow chart of S15 of the first embodiment of the application;

[0057] Figure 8 For the interface diagram of the customized report corresponding to Figure 2 ;

[0058] Figure 9 The structure block diagram of the SAAS system customized report generation device based on dynamic template configuration of the second embodiment of the application;

[0059] Figure 10 For the schematic diagram of the computer internal structure of another embodiment of the application. DETAILED DESCRIPTION

[0060] The technical solutions in the embodiments of the application will be clearly and completely described below with reference to the drawings in the embodiments of the application. Obviously, the described embodiments are only some of the embodiments of the application, not all the embodiments of the application. Well-known modules, units and their mutual connections, links, communications or operations are not shown or not described in detail. And the described features, architectures or functions can be combined in any way in one or more embodiments. Those skilled in the art should understand that the various embodiments described below are only for illustration, not for limiting the protection scope of the application. It can also be easily understood that the modules or units or processing manners in each embodiment described herein and shown in the drawings can be combined and designed in various different configurations. Based on the embodiments in the application, all other embodiments obtained by those skilled in the art without creative labor are within the protection scope of the application.

[0061] First embodiment:

[0062] Please refer to Figures 1 to 9 , the embodiment of the application discloses a SAAS system multi-tenant report generation method based on dynamic template configuration, comprising S11-S15, wherein:

[0063] S11, obtaining a customized visualization report template for realizing business data decoupling.

[0064] Referring to Figure 2 Fig. 1 shows a management interface of a visualization report template (public template) of the present application, a tenant can select a corresponding visualization report template, download or delete a self template (my template).

[0065] In this step, the tenant can select or design a report template from a template library by accessing an online system. The template can be an Excel format file containing pre-set table styles, title rows, total rows and other fixed elements. The tenant can perform personalized design on this basis to realize complete decoupling of business data and presentation format.

[0066] Referring to Figure 3 Fig. 2 shows that the user selects a corresponding template to enter a template management editing interface. In this embodiment, the report template is provided with a pre-set editor.

[0067] S12, editing the report template based on the pre-set editor to generate a template configuration file.

[0068] In this embodiment, the pre-set editor is a preferred solution but not a limitation. In this embodiment, referring to Figure 4 Fig. 3, this step S12 includes S121-S123, wherein:

[0069] S121, based on the first input operation (such as text / voice / script input) of the tenant to the pre-set editor, inserting a structured marker in a cell of the report template, the marker including a field marker (such as {{sales_total}}, total sales), a picture marker (such as {product_image}, product picture) and a coded graphic marker (such as {order_qrcode}, two-dimensional code);

[0070] S122, based on the second input operation (such as mouse drag selection area or text input) of the tenant to the pre-set editor, determining a dynamic area boundary to mark an area that needs to be dynamically expanded according to data volume;

[0071] S123, generating a template configuration file (which can be a template configuration snapshot) based on at least the structured marker and the dynamic area boundary, and storing it to a multi-tenant isolated cloud storage space.

[0072] The above steps S121-S123 generate a template configuration file by explicitly inserting structured markers based on a preset editor, determining the dynamic area boundary, greatly reducing the tenant configuration threshold, and enabling tenants to complete report template customization through simple input operations (such as inserting markers and demarcating dynamic areas) without needing to master code knowledge. Compared with the traditional solution of developing thousands of lines of code by developers, the configuration efficiency is effectively improved, and the time for building a new tenant report template is effectively shortened. At the same time, the classification insertion of structured markers (field / picture / coded graphical marker) can explicitly distinguish the presentation needs of different types of data, and the manual confirmation of the dynamic area boundary can avoid system misjudgment of the dynamic data range and reduce the report misplacement problem caused by marker confusion or fuzzy area definition during subsequent rendering. At the same time, the above steps S1221-S123 lay the foundation for multi-tenant isolation, and subsequent storage isolation can be achieved based on the template configuration file generated by this step and associated with the tenant ID. The explicit configuration elements (markers and dynamic areas) also make it more convenient for tenants to reuse templates, while avoiding interference between different tenant configurations, and balancing the standardization and personalization needs of the SAAS system.

[0073] S13, parsing the structured markers in the template configuration file to generate a metadata description file.

[0074] As a preferred solution rather than a limitation, in the present embodiment, please refer to Figure 5 The present step S13 includes S131-S134, wherein:

[0075] S131, based on the predefined semantic rule library and mapping relationship, performing pattern matching on the field name in the field marker to determine the data type and verification rule corresponding to the matching result; for example, if the field name contains "amount", then automatically assign "type":"currency" and "validation":"positive" attributes;

[0076] S132, based on the type of the coded graphical marker, assigning an optimized default fault tolerance level to it; for example, automatically setting "error_correction":"H" for the two-dimensional code marker;

[0077] S133, based on the size of the cell where the picture marker is located and the layout of the surrounding cells, calculating its maximum size constraint; for example, according to the cell width of 200 pixels, automatically setting "max_dimension":"500x500";

[0078] S134, based on the position context of the grouping marker in the report template, intelligently determine the expansion direction of its dynamic region; such as the marker is located in the table header row, then determine the vertical expansion ("expand_direction":"vertical").

[0079] For example, when the template configuration file of the tenant (tenant_id:"T001") contains "sales total (currency type, positive number)", "product picture (maximum size 500x500)", and a dynamic data region that expands vertically from the 5th row and 2nd column, the system will dynamically generate the following JSON-LD metadata description file, with the following structure:

[0080] {

[0081] "tenant_id":"T001",

[0082] "fields":[

[0083] {"name":"sales_total","type":"currency","validation":"positive"}

[0084] ],

[0085] "media":[

[0086] {"name":"product_image","type":"image","max_dimension":"500x500"},

[0087] {"name":"product_qrcode","type":"qrcode","error_correction":"H"}

[0088] ],

[0089] "dynamic_regions":[

[0090] {"start_row":5,"start_col":2,"expand_direction":"vertical"} ]

[0092] }

[0093] Wherein, L (Low, about 7% tolerance), M (Medium, about 15% tolerance), Q (Quartile, about 25% tolerance), H (High, about 30% tolerance).

[0094] The steps S131-S134 described above perform pattern matching on the field marker based on the semantic rule library and determine the data type and the verification rule, can filter out invalid or incorrect fields in advance (such as directly prompting when the field cannot match the corresponding data type), avoid empty value or incorrect data filling due to field mismatch during subsequent data query, and improve the accuracy of report data; secondly, the steps S131-S134 described above assign an optimized default fault tolerance level to the coding graphic marker (such as automatically adapting the ECC fault tolerance level of the two-dimensional code according to the tenant business scenario), which can ensure the recognition success rate of the coding graphic in different printing and scanning scenarios, and effectively reduce the recognition failure rate compared with the scheme of fixed fault tolerance level. Thirdly, based on the maximum size constraint of the picture marker calculated according to the cell size and the surrounding layout, it can avoid the picture from blocking other report elements or exceeding the cell boundary after being inserted, and there is no need for the tenant to manually adjust the picture size; finally, combined with the dynamic area expansion direction determined based on the position context of the grouping marker, the dynamic data (such as the grouping statistical result) can be expanded in a reasonable direction (vertically / horizontally), avoiding report layout disorder caused by incorrect expansion direction, especially suitable for complex multi-grouping report scenarios, and improving the stability of report generation.

[0095] S14, according to the data requirement defined by the metadata description file, querying the business database through a unified data interface to obtain and assemble the customized business data corresponding to the tenant ID.

[0096] As a preferred scheme but not limitation, in the embodiment, please refer to Figure 6 It is shown that, in this step S14, it includes S141-S145, wherein:

[0097] S141, parsing the metadata description file to extract the field name list and data grouping instruction defined therein;

[0098] S142, mapping and checking the field name list with the pre-defined field name whitelist to generate a safe database query field name set;

[0099] S143, dynamically constructing an SQL statement, wherein the SELECT clause of the SQL statement is based on the query field name set, the WHERE clause contains a filtering statement with the current tenant ID as a condition (such as WHERE tenant_id='T001'), and the GROUP BY clause is generated based on the data grouping instruction;

[0100] S144, executing the SQL statement to obtain an original data set from the business database;

[0101] S145, encapsulate the original data set according to the field structure defined by the metadata description file, assemble into a customized business data object in the form of key-value pair, and supply to the rendering engine for use.

[0102] The steps S141-S145 generate a safe query field name set through field name whitelist mapping verification, can intercept illegal field query requests (such as tenants trying to query sensitive fields beyond the authority), and at the same time, the tenant ID filter is forced to be added in the where clause of the SQL statement, fundamentally eliminates the data access beyond the authority among multi-tenants, meets the data isolation requirement of the SAAS system, and reduces the data leakage risk to close to zero; at the same time, the dynamically constructed SQL statement strictly follows the field list and grouping instructions of the metadata description file, avoids syntax errors or logical deviations when manually writing SQL, and the original data set is encapsulated into a business data object in the form of key-value pair according to the field structure, which can directly adapt to the calling requirements of the subsequent rendering engine, reduces the errors in the data format conversion link, and the data encapsulation accuracy is 100%; finally, the steps S141-S145 unify the data interface and the automatic SQL construction and data encapsulation process, replace the traditional manual data source docking and data format processing mode, shorten the data acquisition and assembly time from tens of minutes to minutes, especially adapt to the million-level data volume scene, and greatly improve the report generation efficiency.

[0103] S15, at least based on the customized business data, a rendering process is controlled through a dynamic position calculation algorithm, data is dynamically filled into the corresponding position of the report template, and a customized report is generated.

[0104] Specifically, the step is specifically: based on the metadata description file and the customized business data, data is dynamically filled into the corresponding position of the report template through a hybrid rendering engine; wherein, the filling process is controlled by a dynamic position calculation algorithm to automatically adjust the template layout according to the data volume, and a customized report is generated.

[0105] As shown in Figure 7 , it is a customized report corresponding to Figure 3 “page material production single 4”.

[0106] As a preferred scheme but not limited, in the embodiment, please refer to Figure 8 , the step S15 includes S151-S153, wherein:

[0107] S151, the dynamic position calculation algorithm performs the following operations:

[0108] According to the field type in the metadata description file, the data set in the dynamic area is intelligently grouped, and the number of rows required by each group of data is predicted;

[0109] According to the predicted number of rows, perform a matrix splitting operation on the cells marked as dynamic areas to expand the physical space, and automatically inherit the styles of the original template;

[0110] Establish a report element dependency graph, calculate the displacement amount generated by dynamic area expansion, and translate and rewrite the coordinates of all affected cells, charts, and formulas downstream.

[0111] S152, the hybrid rendering engine performs the following operations:

[0112] Identify nested expression syntax in field markers (such as {{=SUM({{sales}}*{{tax_rate}})}}), build an abstract syntax tree and perform a depth-first traversal calculation using a recursive descent parsing algorithm;

[0113] Intercept requests for pictures or encoded graphic markers, perform a zero-copy processing chain on binary streams including size scaling, format conversion, and watermark superposition, and ensure data integrity through a SHA256 stream fingerprinting algorithm;

[0114] Intercept dangerous functions through syntax sandboxing, protect cells containing expressions using cell locking technology, and record formula modification event chains.

[0115] S153, based on the coordinate information provided by the metadata description file, accurately fill the processed data into the specified location of the template to generate the final report.

[0116] The hybrid rendering engine can accurately identify the matching relationship between metadata and business data, ensuring that different types of data (text, numerical values, pictures, etc.) are accurately filled into the corresponding positions of the template, avoiding data misfilling and missing filling problems, and improving the accuracy of report filling to more than 99%. The dynamic position calculation algorithm automatically adjusts the template layout based on the data volume, solving the element misplacement and content blocking problems that occur when the data volume fluctuates (such as when the number of rows in the dynamic area exceeds expectations) in traditional fixed templates, especially suitable for multi-group, large data volume report scenarios, and the report layout integrity reaches 100%. This embodiment deeply cooperates data preparation and rendering layout, compared with the scheme of separating data and layout processing, reduces the time consumption and errors of intermediate data transmission links, improves the overall report generation efficiency by 50%, and the generated customized report can perfectly adapt to tenant business scenarios (such as different industry report format requirements), improving the tenant use experience.

[0117] The SAAS system customization report generation method based on dynamic template configuration provided by the embodiment of the application successfully decouples the format definition of the report from the business logic and data acquisition by introducing a visual report template and a metadata description file. Changes in the format requirements of tenants are limited to the template and metadata level, and there is no need to modify, compile and deploy any backend code, thereby reducing the system maintenance workload. At the same time, thanks to the decoupling design of the unified data interface for dynamically constructing a query statement according to the metadata, when a new tenant is accessed or a new report requirement is added to an existing tenant, the system function is completely decoupled from the tenant requirement. Without writing any new code, the system can automatically adapt by designing a template according to the requirement, thereby reducing the access cost of a new tenant and providing strong architectural support for the rapid scaling of the SAAS platform. In addition, the application decouples the processing requirements of elements such as pictures and two-dimensional codes from the business code by defining a standardized structured marker, and the special hybrid rendering engine performs standardized and pipeline processing. The application decouples the data isolation strategy from the dispersed business code and implements it in the unified data interface architecture layer. The interface forcibly adds a tenant ID filtering condition when dynamically constructing a SQL, so that data isolation becomes an automatically executed and business-independent architectural security feature, fundamentally eliminating the data leakage risk that may be caused by coupling with the business logic, and enhancing the security and reliability of the system. Finally, the dynamic position calculation algorithm is decoupled from the business data, the layout prediction and adjustment are performed only by relying on the metadata, and the zero-copy processing chain and other efficient technologies are combined, so that the report rendering is decoupled at the architecture level. Not only is the function clear and easy to maintain, but the performance is also significantly better than that of the traditional coupling scheme, the rendering speed is effectively improved, and the enterprise-level application is perfectly supported.

[0118] The second embodiment is as follows:

[0119] Please refer to Figure 9 The application further provides a SAAS system customization report generation device 100 based on dynamic template configuration, which comprises:

[0120] A first acquisition module 110 is configured to acquire a customized visual report template for realizing business data decoupling;

[0121] A first generation module 120 is configured to edit the report template based on a preset editor and generate a template configuration file;

[0122] A second generation module 130 is configured to parse a structured marker in the template configuration file and generate a metadata description file;

[0123] A second acquisition module 140 is configured to query a business database through a unified data interface according to a data requirement defined by the metadata description file, acquire and assemble customized business data corresponding to a tenant ID.

[0124] The third generation module 150 is configured to control a rendering process by a dynamic position calculation algorithm based on the customized business data, fill data into corresponding positions of the report template dynamically, and generate a customized report.

[0125] The modules of the embodiment are the same as the corresponding steps of the first embodiment, and thus will not be described herein.

[0126] The SAAS system customized report generation method based on the dynamic template configuration provided by the embodiment of the application successfully decouples the format definition of the report from the business logic and data acquisition by introducing the visual report template and the metadata description file. The change of the format requirement of the tenant is limited to the template and the metadata level, and it is no longer necessary to modify, compile and deploy any backend code, thereby reducing the system maintenance workload. Meanwhile, thanks to the decoupling design of the unified data interface for dynamically constructing a query statement according to the metadata, when a new tenant is accessed or a new report requirement is added to an existing tenant, the system function is completely decoupled from the tenant requirement. Without writing any new code, the system can be automatically adapted by designing a template according to the requirement, thereby reducing the access cost of the new tenant and providing strong architectural support for the rapid scaling of the SAAS platform. In addition, the application decouples the processing requirement of elements such as pictures and two-dimensional codes from the business code by defining a standardized structured marker, and the elements are standardized and processed in a pipeline by a special hybrid rendering engine. The application decouples the data isolation strategy from the dispersed business code and implements it in a centralized manner at the architecture level of the unified data interface. The interface forcibly adds a tenant ID filtering condition when dynamically constructing a SQL, so that the data isolation becomes an automatically executed architecture security feature that is independent of the specific business logic, thereby fundamentally eliminating the data leakage risk that may be caused by the coupling with the business logic and enhancing the security and reliability of the system. Finally, the dynamic position calculation algorithm is decoupled from the business data, the layout prediction and adjustment are performed only by relying on the metadata, and the zero-copy processing chain and other efficient technologies are combined, so that the report rendering is decoupled at the architecture level. The function is clear and easy to maintain, and the performance is significantly better than that of the traditional coupling scheme. The rendering speed is effectively improved, and the enterprise-level application is perfectly supported.

[0127] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the division of the above functional modules is taken as an example for illustration. In actual applications, the above functions can be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. The specific working process of the system, device and unit described above can refer to the corresponding process in the foregoing method embodiments, which will not be described herein.

[0128] The embodiment of the present application further provides a computer storage medium, which stores a computer program, and the computer program is executed by a processor to realize the method for generating a customized report of a SAAS system based on dynamic template configuration in each of the above embodiments.

[0129] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by a computer program instructing related hardware, and the computer program can be stored in a non-volatile computer readable storage medium. When the computer program is executed, the processes of the above-mentioned embodiment methods for generating a customized report of a SAAS system based on dynamic template configuration can be included. Any reference to a memory, storage, database or other medium used in each embodiment of the present application can include a non-volatile and / or volatile memory. The non-volatile memory can include a read-only memory (ROM), a programmable ROM (PROM), an electrically programmable ROM (EPROM), an electrically erasable programmable ROM (EEPROM) or a flash memory. The volatile memory can include a random access memory (RAM) or an external cache memory. As an illustration but not limitation, the RAM is available in various forms, such as a static RAM (SRAM), a dynamic RAM (DRAM), a synchronous DRAM (SDRAM), a double data rate SDRAM (DDR SDRAM), an enhanced SDRAM (ESDRAM), a synchronous link (Synchlink) DRAM (SLDRAM), a memory bus (Rambus) direct RAM (RDRAM), a direct memory bus dynamic RAM (DRDRAM) and a memory bus dynamic RAM (RDRAM) and the like.

[0130] Alternatively, the integrated units of the present application can be stored in a computer readable storage medium if they are realized in the form of software function modules and sold or used as independent products. Based on such understanding, the technical solutions of the embodiments of the present application can be embodied in the form of a software product, which is stored in a storage medium and includes a plurality of instructions for causing a computer device (which can be a personal computer, a terminal or a network device, etc.) to execute all or part of the embodiments of the present application. The foregoing storage medium includes a mobile storage device, a RAM, a ROM, a magnetic disk or an optical disk and various media that can store program codes.

[0131] Corresponding to the above-mentioned computer storage medium, in one embodiment, a computer device is further provided, which includes a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to realize the method for generating a customized report of a SAAS system based on dynamic template configuration in each of the above embodiments.

[0132] The computer device can be a terminal, and its internal structure diagram can be as shown in the figure. Figure 10 The computer device includes a processor, a memory, a network interface, a display screen and an input device connected by a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with external terminals through network connection. The computer program is executed by the processor to implement a SAAS system customized report generation method based on dynamic template configuration. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer overlaid on the display screen, or a key, trackball or touchpad arranged on the shell of the computer device, or an external keyboard, touchpad or mouse, etc.

[0133] The SAAS system customized report generation method based on dynamic template configuration provided by the embodiment of the application successfully decouples the format definition of the report from the business logic and data acquisition by introducing a visual report template and a metadata description file. Changes in the format requirements of tenants are limited to the template and metadata level, and there is no need to modify, compile and deploy any backend code, reducing the system maintenance workload. At the same time, thanks to the decoupling design of the unified data interface dynamically constructing the query statement according to the metadata, when a new tenant accesses or an existing tenant adds a report requirement, the system function is completely decoupled from the tenant requirement. Without writing any new code, the system can automatically adapt by designing the template according to the requirement, reducing the access cost of new tenants and providing strong architectural support for the rapid scaling of the SAAS platform. In addition, the application decouples the processing requirements of elements such as pictures and two-dimensional codes from the business code by defining standardized structured markers, and standardizes and processes them in a pipeline by a special hybrid rendering engine. The application decouples the data isolation strategy from the scattered business code and implements it in a centralized manner at the architecture level of the unified data interface. The interface adds a tenant ID filtering condition when dynamically constructing the SQL, making data isolation an automatically executed architecture security feature independent of specific business logic, fundamentally eliminating the risk of data leakage caused by coupling with business logic, and enhancing the security and reliability of the system. Finally, the dynamic position calculation algorithm is decoupled from the business data, realizing layout prediction and adjustment only relying on metadata, combined with efficient technologies such as zero-copy processing chain, so that the report rendering is decoupled at the architecture level. Not only is the function clear and easy to maintain, but also the performance is significantly better than the traditional coupling scheme, the rendering speed is effectively improved, and the enterprise-level application is perfectly supported.

[0134] The technical features of the above embodiments can be combined in any manner. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described, however, as long as the combinations of the technical features do not contradict each other, they should be considered to be within the scope of the present disclosure.

[0135] The above embodiments only express several implementation manners of the present application, and the description is relatively specific and detailed, but it should not be understood as a limitation on the scope of the patent. It should be pointed out that for ordinary skilled persons in the art, some modifications and improvements can be made without departing from the concept of the present application, and these are within the protection scope of the present application. Therefore, the protection scope of the patent of the present application should be subject to the appended claims.

Claims

1. A method for generating customized reports for a SaaS system based on dynamic template configuration, characterized in that, include: Obtain customized visual report templates for decoupling business data; The report template is edited using a preset editor to generate a template configuration file; Parse the structured tags in the template configuration file to generate a metadata description file; Based on the data requirements defined in the metadata description file, the business database is queried through the unified data interface to obtain and assemble customized business data corresponding to the tenant ID; Based at least on the customized business data, the rendering process is controlled by a dynamic position calculation algorithm to dynamically fill the data into the corresponding position of the report template to generate a customized report.

2. The method as described in claim 1, characterized in that, The step of editing the report template based on a preset editor to generate a template configuration file includes: Based on the tenant's first input operation to the preset editor, structured markers are inserted into the cells of the report template. These markers include field markers, image markers, and coded graphic markers. The dynamic region boundary is determined based on the tenant's second input operation to the preset editor; A template configuration file is generated based at least on the structured markers and dynamic region boundaries.

3. The method as described in claim 2, characterized in that, The structured markers in the parsed template configuration file are used to generate a metadata description file, including: Control the metadata parser to perform the following operations: Based on a predefined semantic rule base and mapping relationship, pattern matching is performed on the field names in the field identifier to determine the data type and validation rules corresponding to the matching results; Based on the type of the encoded graphic marker, an optimized default fault tolerance level is assigned to it; Based on the size of the cell containing the image marker and the layout of the surrounding cells, calculate its maximum size constraint; Based on the positional context of the grouping marker in the report template, the expansion direction of its dynamic area is intelligently determined.

4. The method as described in claim 3, characterized in that, The step of querying the business database through a unified data interface to obtain and assemble customized business data corresponding to the tenant ID, based on the data requirements defined in the metadata description file, includes: Parse the metadata description file and extract the list of field names and data grouping instructions defined therein; The list of field names is mapped and validated against a predefined whitelist of field names to generate a secure set of database query field names. The SQL statement is dynamically constructed, wherein the select clause of the SQL statement is based on the set of query field names, the where clause contains a filtering statement based on the current tenant ID, and the group by clause is generated based on the data grouping instruction; Execute the SQL statement to retrieve the original dataset from the business database; The original dataset is encapsulated according to the field structure defined in the metadata description file and assembled into a customized business data object in key-value pair form for use by the rendering engine.

5. The method as described in claim 4, characterized in that, The process of dynamically filling data into the corresponding positions of the report template to generate a customized report, based at least on the customized business data and using a dynamic position calculation algorithm, specifically involves: Based on the metadata description file and the customized business data, the data is dynamically filled into the corresponding positions of the report template through a hybrid rendering engine; wherein, the filling process is controlled by a dynamic position calculation algorithm to automatically adjust the template layout according to the amount of data and generate a customized report.

6. The method as described in claim 5, characterized in that, The dynamic position estimation algorithm includes: Based on the field types in the metadata description file, the dataset in the dynamic area is intelligently grouped, and the number of rows required for each group is predicted. Based on the predicted row count, perform a matrix splitting operation on cells marked as dynamic regions to expand the physical space and automatically inherit the styles of the original template; Create a report element dependency graph, calculate the displacement caused by dynamic area expansion, and translate and rewrite the coordinates of all affected downstream cells, charts, and formulas to avoid layout conflicts.

7. The method as described in claim 6, characterized in that, The hybrid rendering engine is used for: It identifies nested expression syntax in field markers, constructs an abstract syntax tree through a recursive descent parsing algorithm and performs depth-first traversal calculations, while simultaneously establishing a real-time listener for expression fields; The system intercepts requests for images or encoded graphic markers, performs a zero-copy processing chain on the binary stream including size scaling, format conversion, and watermark overlay, and ensures data integrity through a stream fingerprint verification algorithm. The system intercepts dangerous functions through a syntax sandbox, protects cells containing expressions using cell locking technology, records formula modification event chains, and restores the system to the most recent valid snapshot via a version rollback when illegal tampering is detected.

8. A customized report generation device for a SaaS system based on dynamic template configuration, characterized in that, include: The first acquisition module is used to acquire customized visual report templates for decoupling business data; The first generation module is used to edit the report template based on a preset editor and generate a template configuration file. The second generation module is used to parse the structured markers in the template configuration file and generate a metadata description file; The second acquisition module is used to query the business database through a unified data interface according to the data requirements defined in the metadata description file, and to acquire and assemble customized business data corresponding to the tenant ID. The third generation module is used to control the rendering process based on the customized business data through a dynamic position calculation algorithm, and dynamically fill the data into the corresponding position of the report template to generate a customized report.

9. A computer 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 computer program, it implements the method for generating customized reports for a SaaS system based on dynamic template configuration as described in any one of claims 1 to 7.

10. A computer storage medium having a computer program stored thereon, characterized in that, When executed by the processor, the program implements the method for generating customized reports for a SaaS system based on dynamic template configuration as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Report filling and displaying method based on Excel template and front-end interaction

    CN116611412A

  • Report generation method and system based on visual configuration report template

    CN119718290A

  • Road network operation management method and device, storage medium, and terminal

    US20230394408A1

Cited By

  • Zero-code report generation method and system based on low-code platform metadata driving

    CN121365657A

  • SaaS-based multi-party system data pushing method and system, and storage medium

    CN121728053A