A dynamic report generation method and device based on PaaS platform
By establishing a configuration page for each tenant in the backend management system of the PaaS platform and dynamically generating report pages, it solves the customization and update problems of report generation in a multi-tenant environment, improves management and development efficiency, reduces costs, and achieves Multi-channel reporting services.
Patent Information
- Application Number
- CN202410027947.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-08
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2044-01-08
AI Technical Summary
The report generation method of the existing PaaS platform is difficult to dynamically update and customize in a multi-tenant environment, resulting in high management costs and low development efficiency. It also relies on developers to adjust page codes, resulting in slow project advancement and high complexity.
By establishing a configuration page for each tenant in the backend management system of the PaaS platform, using preset configuration protocols to obtain custom protocol data, dynamically generate report pages, including UI control rendering and data display, and support multi-end channel rendering and data push , reduce server resources and labor costs.
It realizes the dynamics of tenant report style and content, improves management and development efficiency, reduces maintenance costs, provides convenient, multi-terminal, feature-rich and real-time dynamically updated report services, and reduces dependence on developers.
Smart Images

Figure CN118210491B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of Web front-end report display, and in particular to a dynamic report generation method and device based on a PaaS platform. Background Art
[0002] PaaS (Platform-as-a-Service) is a business model that provides the operation and development environment of application services as a service. With the rapid growth of business, the number of tenants connected to the PaaS platform is increasing. The data information related to each tenant is inconsistent. The data and standards that need to be collected and analyzed are mostly different. The only way to meet the needs is to open project code branches according to tenants, modify form collection fields, add database table fields, etc. Now there is an urgent need for a set of methods that can meet the needs of multi-tenant data collection and statistical analysis, including field settings in data report pages, types of rendering UI controls, acquisition of field option data, push of collected data, etc. By configuring and generating a data rendering protocol in an agreed format, providing mobile rendering collection pages and Web rendering report pages, it can meet the needs of operators to uniformly manage multi-tenant data collection and statistical analysis. Developers do not need to repeatedly adjust the collection and report page rendering fields, reducing the maintenance cost of the PaaS platform for project branches, thereby realizing omni-channel data connection and efficient information feedback.
[0003] Based on the PaaS platform, there are two main ways to achieve existing report generation. One is to directly customize the report style according to different user needs. Subsequent function maintenance and report updates can only be done by development and operation personnel modifying the system code. The other is also based on a multi-tenant cloud platform, which can customize report functions, similar to the production of questionnaires, but lacks more customized operations, such as customizing the report data push and data acquisition API interface, so that the import and export option data can only be done through traditional file upload and download forms, or the relevant option data is hard-coded in the database. As a result, when dynamically updating reports, multiple branches manage multiple projects, the management cost is high, and the server resource consumption is large; the project customization share is large and the complexity is high, the data source and management are relatively complex, and the data flow is disordered; it is highly dependent on developers to adjust the page code according to project needs, the project progress is slow, the development efficiency is low, and the project delivery cost rate is high. Summary of the invention
[0004] The present invention provides a dynamic report generation method and device based on PaaS platform, which can realize real-time dynamic update of reports, highly customize report pages, and improve unified management and development efficiency.
[0005] In order to solve the above technical problems, an embodiment of the present invention provides a dynamic report generation method based on a PaaS platform, comprising:
[0006] In response to the current tenant's entry operation on the report page of the PaaS platform, the user-defined protocol data configured by the current tenant in the corresponding configuration page is obtained by calling the tenant information interface, and the current page configuration protocol and report data are obtained; wherein the configuration page is established for each tenant in the background management system of the PaaS platform based on a preset configuration protocol, and is used to configure the page custom protocol of each tenant based on the preset configuration protocol;
[0007] Get the data of each field in the field configuration of the current page configuration protocol, perform protocol docking configuration processing on each field data one by one, obtain the option data of each field, and integrate the report search object and report field object data based on the option data of each field;
[0008] Based on the report search object and report field object data, control the rendering of various UI controls and the display of report data in the report page, and dynamically generate the report page.
[0009] In the implementation of the embodiment of the present invention, a corresponding configuration page is established for each tenant in the background management system of the PaaS platform based on a preset configuration protocol. The configuration page is used to configure the page custom protocol of each tenant based on the preset configuration protocol, and respond to the current tenant entering the report page of the PaaS platform. By calling the tenant information interface, the custom protocol data configured by the current tenant in the corresponding configuration page is obtained, the current page configuration protocol and report data are obtained, and the field data in the field configuration of the current page configuration protocol is obtained. The protocol docking configuration processing is performed on each field data one by one to obtain the option data of each field, and based on the option data of each field, the report search object and the report field object data are integrated; based on the report search object and the report field object data, the rendering of various UI controls in the report page and the display of report data are controlled to dynamically generate a report page. Based on the PaaS platform, it manages the configuration pages of different tenants. In multi-tenant scenarios, it has flexible, easy-to-maintain and highly customizable report page protocols, which improves the management integration of the project, facilitates unified management, improves management and development efficiency, reduces server resources and labor costs, and stipulates the settings of configuration protocols such as field types, type rules, table display styles, data source interfaces, and data push formats. It also performs simple operations and configurations through visual configuration pages, integrates page customization protocols for Web and mobile page rendering, data acquisition, and data push, and provides PaaS platform operators with a set of convenient, multi-terminal, feature-rich, and real-time dynamically updated report services. For tenants, the style and content design of reports are more dynamic.
[0010] As a preferred solution, the data of each field is processed one by one for protocol docking configuration to obtain the option data of each field, specifically:
[0011] Take each field as the current field one by one, and determine whether it supports field search based on the filter conditions corresponding to the current field. If the current field supports field search, add the current field to the report search object, and set the search field value based on the search matching method of the current field.
[0012] Get the search control type of the current field. When the search control type is a selection control type, based on the option data source of the selection control type, determine whether the option data of the current field is obtained through the interface. If not, set the option data of the current field to the custom data in the configuration; if so, perform interface configuration authentication on the current field based on the interface configuration information of the selection control type to obtain the option data of the current field.
[0013] As a preferred solution, based on the interface configuration information of the selection control type, the interface configuration authentication process is performed on the current field to obtain the option data of the current field, specifically:
[0014] According to the interface configuration information of the selection control type, the option interface configuration corresponding to the current field is extracted to obtain the interface configuration, and the interface docking configuration corresponding to the current field is searched in the interface configuration according to the data docking configuration identifier;
[0015] According to the authentication method configured in the option interface, determine whether the current interface needs authentication. If authentication is required, perform data interface authentication processing on the current field according to the interface docking configuration and local cache, obtain authentication parameters, and store the authentication parameters and time node in the local cache;
[0016] Extract the option interface address and interface parameters based on the interface configuration and interface docking configuration, and construct the option data interface initial request based on the option interface address and interface parameters;
[0017] If the authentication parameter conditions are met, send an initial request for the option data interface, extract the request data according to the interface configuration, process the request data, and set the option data of the current field; the authentication parameter condition is that the authentication parameter is not empty, and the interface connection needs to carry the authentication parameter;
[0018] If the authentication parameter conditions are not met, the authentication parameters are set according to the interface docking configuration, an initial request for the option data interface is sent, and the request data is extracted and processed according to the interface configuration, and the option data of the current field is set.
[0019] As a preferred solution, according to the interface docking configuration and local cache, the data interface authentication processing is performed on the current field to obtain the authentication parameters, which are specifically:
[0020] Extract all attribute values of the interface parameters of the authentication configuration in the authentication method, obtain the storage location of the authentication parameters in the local cache, and determine whether the authentication parameters exist in the local cache according to the storage location. If so, determine whether the authentication parameters are expired;
[0021] When the authentication parameters expire or do not exist in the local cache, the login address and login parameters are extracted according to the interface docking configuration, and based on the login address and login parameters, the login interface is requested to obtain login data to obtain the authentication parameters.
[0022] As a preferred solution, based on the report search object and report field object data, the rendering of various UI controls in the report page and the display of report data are controlled to dynamically generate the report page, specifically:
[0023] Set the search bar on the rendered report page based on the filter conditions of the report fields of the report search object;
[0024] Set the table for rendering the report page according to the table display mode and data display type of the report field object data;
[0025] Set search conditions in the page search bar, request report data and refresh the table on the report page to display report data and dynamically generate the report page.
[0026] As a preferred solution, the pre-set configuration protocol is specifically:
[0027] Various configuration field protocols pre-set in the report page of the PaaS platform;
[0028] Among them, various configurations include UI control rendering style configuration, option data acquisition interface configuration and interface authentication configuration.
[0029] As a preferred solution, the configuration page includes a data connection configuration module and a basic field module;
[0030] Among them, the data docking configuration module is used to display the configuration of the interface docking in the form of a pop-up window, and use the plug-in to generate a configuration input box so that the tenant can enter the interface URL information and authentication method information through the configuration input box;
[0031] The basic field module includes the field list submodule and the field configuration submodule;
[0032] The field list submodule is used to display basic field information, so that tenants can click on a field to switch to the field configuration submodule to display the corresponding configuration information of the field;
[0033] The field configuration submodule is used to display field configuration information in a form, so that tenants can customize the field name, field ID, mobile acquisition page, and web report page.
[0034] In order to solve the same technical problem, an embodiment of the present invention also provides a dynamic report generation device based on a PaaS platform, comprising: a protocol data acquisition unit, a protocol docking configuration processing unit and a dynamic report generation unit;
[0035] The protocol data acquisition unit is used to respond to the current tenant's report page entry operation on the PaaS platform, obtain the custom protocol data configured by the current tenant in the corresponding configuration page by calling the tenant information interface, and obtain the current page configuration protocol and report data; wherein the configuration page is to establish a corresponding configuration page for each tenant in the background management system of the PaaS platform based on a pre-set configuration protocol, and is used to configure the page custom protocol of each tenant based on the pre-set configuration protocol;
[0036] The protocol docking configuration processing unit is used to obtain the data of each field in the field configuration of the current page configuration protocol, perform protocol docking configuration processing on each field data one by one, obtain the option data of each field, and integrate the report search object and the report field object data based on the option data of each field;
[0037] The dynamic report generation unit is used to control the rendering of various UI controls and the display of report data in the report page based on the report search object and the report field object data, and dynamically generate the report page.
[0038] In order to solve the same technical problem, an embodiment of the present invention also provides a computer device, including a processor and a memory, the memory is used to store a computer program, and when the computer program is executed by the processor, a dynamic report generation method based on a PaaS platform is implemented.
[0039] In order to solve the same technical problem, an embodiment of the present invention further provides a computer-readable storage medium storing a computer program, which implements a dynamic report generation method based on a PaaS platform when the computer program is executed by a processor.
[0040] Compared with the prior art, the present invention has the following beneficial effects:
[0041] 1. For tenants / users, the style and content design of the report are more dynamic. Based on the pre-set configuration protocol, multiple objects are established to link and finally form a complete report configuration protocol data structure. The interface connection protocol is realized through interface configuration authentication processing. The pre-set configuration protocol is used for various configuration field protocols in the Web-side report page, including UI control rendering style, option data acquisition interface configuration and interface authentication configuration, etc., agreeing on field types, type rules, table display styles and data source interfaces, data push formats and other settings. By obtaining the data of each field in the field configuration of the current page configuration protocol, integrating report search objects and report field object data, controlling the rendering of various UI controls and the display of report data in the report page, realizing dynamic update of report configuration and real-time acquisition of option data, including real-time update of data for each field, field type and option, and allowing the use of multiple authentication methods in the protocol configuration, the interface call is more secure.
[0042] 2. The dynamic report generation method of the present invention is more maintainable for the background management system of the PaaS platform. A corresponding configuration page is established for each tenant. The configuration page is used to configure the page customization protocol of each tenant based on the pre-set configuration protocol. Through a unified background management page, the configuration protocol of each tenant's report page on the Web side is managed, and the report design of multiple tenants is uniformly configured and managed. There is no need to repeatedly modify the system code in maintenance, which reduces a lot of maintenance and development costs, improves the management integration of the project, reduces server resources and labor costs, facilitates unified management, and improves management and development efficiency.
[0043] 3. Tenants / users perform simple operations and configurations through visual configuration pages, which integrate the configuration protocols for Web and mobile page rendering, data acquisition, and data push. From obtaining configuration protocols and report data to obtaining option data, various UI controls are rendered and report data is displayed. This provides PaaS platform operators with a set of convenient, multi-terminal, feature-rich, and real-time dynamically updated reporting services. All report-related configurations and data acquisition methods are delivered in a serialized form. Each tenant has an independent management configuration page. Tenants can complete the high customization of the entire report page through visual operations without touching any code. The PaaS platform generates flexible, easy-to-maintain, and highly customizable report pages in multi-tenant scenarios.
[0044] Other features and advantages of the present invention will be described in detail in the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1: A flow chart of an embodiment of a dynamic report generation method based on a PaaS platform provided by the present invention;
[0046] Figure 2 : A configuration page diagram of an embodiment of a dynamic report generation method based on a PaaS platform provided by the present invention;
[0047] Figure 3 : A flow chart of the implementation of a report page of an embodiment of a dynamic report generation method based on a PaaS platform provided by the present invention;
[0048] Figure 4 : A report page diagram generated by an embodiment of a dynamic report generation method based on a PaaS platform provided by the present invention;
[0049] Figure 5 : A structural diagram of an embodiment of a dynamic report generation device based on a PaaS platform provided by the present invention. DETAILED DESCRIPTION
[0050] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0051] Embodiment 1
[0052] Please refer to Figure 1 , is a flow chart of a dynamic report generation method based on a PaaS platform provided by an embodiment of the present invention. The dynamic report generation method includes steps 101 to 103, each of which is as follows:
[0053] Step 101: In response to the current tenant entering the report page on the PaaS platform, by calling the tenant information interface, the custom protocol data configured by the current tenant in the corresponding configuration page is obtained, and the current page configuration protocol and report data are obtained; wherein, the configuration page is established for each tenant in the background management system of the PaaS platform based on a pre-set configuration protocol, and is used to configure the page custom protocol of each tenant based on the pre-set configuration protocol.
[0054] In this embodiment, a configuration protocol is pre-set, and a background management page is designed to manage the configuration protocol of each tenant's report page on the Web side to achieve unified management. Based on the pre-set configuration protocol, a configuration page is established for each tenant in the tenant management of the PaaS platform background management system to configure the page customization protocol of each tenant, that is, to configure the rendering of various UI controls and option data acquisition in the mobile terminal collection page and the Web terminal report page. For the data platform in a multi-tenant scenario, both the report page and the option data are allowed to be highly customized. The report page is rendered through the agreed configuration protocol, and the protocol can be used to meet the needs of different users, and customize their report style, option data acquisition and report data display.
[0055] In this embodiment, after the tenant completes the protocol configuration in the configuration page, when entering the PaaS platform Web report page, the current tenant's report page entry operation on the PaaS platform is triggered. The report page program constructs an interface request carrying user / tenant information, and calls the tenant information interface to obtain the latest configuration protocol of the page (the current page configuration protocol) and report data.
[0056] It should be noted that the present invention uses the report page program as the execution body to implement a dynamic report generation method, which is a method for the entire process from obtaining the configuration protocol, obtaining the report data, obtaining the option data, to rendering various UI controls and displaying the report data on the Web-side report page.
[0057] Optional, pre-set configuration protocols, specifically:
[0058] Various configuration field protocols pre-set in the report page of the PaaS platform;
[0059] Among them, various configurations include UI control rendering style configuration, option data acquisition interface configuration and interface authentication configuration.
[0060] In this embodiment, the preset configuration protocol is a set of field protocols designed for various configurations in the Web-side report page, including UI control rendering style, option data acquisition interface configuration, and interface authentication configuration. The preset configuration protocol is shown in Tables 1 to 5 below:
[0061] Table 1 Overall protocol
[0062]
[0063]
[0064] Table 2field object
[0065]
[0066] Table 3 report object
[0067]
[0068]
[0069]
[0070] Table 4 interface object
[0071]
[0072] Table 5 authInfo object
[0073]
[0074]
[0075] By implementing the embodiment of the present invention, the report configuration is transformed into the data structure design and field design of the interface docking protocol. The configuration protocol supports the acquisition of report option data in a customized and interface manner, which not only meets the needs of users to customize data, but also meets the needs of users to retrieve data from different third-party data sources. The interface method also adds authentication processing to avoid the problem of failure of third-party data retrieval, making the call of the interface for obtaining relevant business sensitive data more secure.
[0076] Optionally, the configuration page includes a data connection configuration module and a basic field module;
[0077] In this embodiment, the configuration page, such as Figure 2 As shown, the configuration page is divided into two modules: data connection configuration module and basic field module.
[0078] Among them, the data docking configuration module is used to display the configuration of the interface docking in the form of a pop-up window, and use the plug-in to generate a configuration input box so that the tenant can enter the interface URL information and authentication method information through the configuration input box;
[0079] In this embodiment, the interface docking configuration is displayed in a pop-up window, and the codemirror plug-in is used to generate a configuration input box, which provides the user with information such as the interface URL and authentication method.
[0080] Optionally, the basic field module includes a field list submodule and a field configuration submodule;
[0081] In this embodiment, the report field configuration belongs to the basic field module, which is composed of a field list submodule and a field configuration submodule.
[0082] The field list submodule is used to display basic field information, so that tenants can click on a field to switch to the field configuration submodule to display the corresponding configuration information of the field;
[0083] In this embodiment, the field list submodule is used to display basic field information such as field name, module, whether the three major pages of the mobile terminal are collected, and the order within the module. By clicking on the field, you can switch to display the configuration information corresponding to the field in the field configuration submodule.
[0084] The field configuration submodule is used to display field configuration information in a form, so that tenants can customize the field name, field ID, mobile acquisition page, and web report page.
[0085] In this embodiment, the field configuration submodule is displayed in the form of a form, providing users with the configuration of field names, field identifiers, mobile acquisition pages, and Web report pages. Among them, the field identifier is the unique identifier of the report field, and the user does not support modification after completing the addition; in the configuration of the Web report page, it is provided to configure whether the field is displayed in the list and whether it supports filtering. When setting the field to be displayed in the list, it supports setting the list rendering effect, such as: display type (text, picture), list width, list cell content alignment, etc.; when setting the field to support filtering, it supports setting the filter type (selection, number, date, text), filter matching method, number type verification rules, single-choice type data source and option configuration, etc. After the user clicks Save on the configuration page, the user can obtain the configuration protocol information of the tenant on the mobile acquisition page and Web report page of the corresponding tenant.
[0086] It should be noted that, unlike other report pages that generally manage multiple branches and multiple projects or protocols are built into the project code, resulting in high management costs and large resource consumption on the server, the present invention introduces a management background page to transmit all report-related configurations and data acquisition methods in a serialized form. Each tenant has an independent management page, i.e., a configuration page. Tenants can complete the high degree of customization of the entire report page only through visual operations without touching any code. Subsequent functional maintenance and report updates of the report page can also be handled by operators operating the management page without relying on development and operation personnel.
[0087] In the implementation of the embodiment of the present invention, a corresponding configuration page is established for each tenant in the background management system of the PaaS platform based on a preset configuration protocol. The configuration page is used to configure the page custom protocol of each tenant based on the preset configuration protocol, and respond to the current tenant entering the report page of the PaaS platform. By calling the tenant information interface, the custom protocol data configured by the current tenant in the corresponding configuration page is obtained, the current page configuration protocol and report data are obtained, and the field data in the field configuration of the current page configuration protocol is obtained. The protocol docking configuration processing is performed on each field data one by one to obtain the option data of each field, and based on the option data of each field, the report search object and the report field object data are integrated; based on the report search object and the report field object data, the rendering of various UI controls in the report page and the display of report data are controlled to dynamically generate a report page. Based on the PaaS platform, it manages the configuration pages of different tenants. In multi-tenant scenarios, it has flexible, easy-to-maintain and highly customizable report page protocols, which improves the management integration of the project, facilitates unified management, improves management and development efficiency, reduces server resources and labor costs, and stipulates the settings of configuration protocols such as field types, type rules, table display styles, data source interfaces, and data push formats. It also performs simple operations and configurations through visual configuration pages, integrates page customization protocols for Web and mobile page rendering, data acquisition, and data push, and provides PaaS platform operators with a set of convenient, multi-terminal, feature-rich, and real-time dynamically updated report services. For tenants, the style and content design of reports are more dynamic.
[0088] Step 102: Acquire the data of each field in the field configuration of the current page configuration protocol, perform protocol docking configuration processing on each field data one by one, obtain the option data of each field, and integrate the report search object and report field object data based on the option data of each field.
[0089] In this embodiment, the report page program processes each field data in the field configuration fields in the latest page configuration protocol (current page configuration protocol) obtained in step 101 one by one, implements the interface docking protocol, completes all search configurations for the field, repeats steps 1021-1022 to process all fields, and integrates the report search object and report field object data.
[0090] The implementation of the present invention establishes multiple objects (field, report, column, select, etc. in the configuration protocol) to link and finally form a complete report configuration protocol data structure, namely, the "interface connection protocol", to achieve dynamic update of report configuration and real-time acquisition of form option data, including real-time update of each field, field type, and option data. The implementation process of the report page, such as Figure 3 As shown, it includes the main process of report page rendering (steps 1021 to 1022 and step 103), the option data interface acquisition process (steps S1 to S5), and the data interface authentication process (steps S21-S22). All report-related configurations and data acquisition methods are transmitted in a serialized form. Each tenant has an independent management page. The tenant only needs to perform visual operations without touching any code to complete the high customization of the entire report page.
[0091] Optionally, the data of each field is processed one by one for protocol docking configuration to obtain option data of each field, specifically including step 1021 to step 1022, each step is specifically as follows:
[0092] Step 1021: taking each field as the current field one by one; judging whether the field search is supported according to the filter condition corresponding to the current field; if the current field supports the field search, adding the current field to the report search object, and setting the search field value based on the search matching method of the current field;
[0093] In this embodiment, report.isFilter is used to determine whether field search is supported. If the value is true, the field is added to the search object. The search field value is set according to report.select.searchType. If it is "between", it is an empty array, and other values are empty strings.
[0094] Step 1022: Get the search control type of the current field. When the search control type is a selection control type, determine whether the option data of the current field is obtained through the interface based on the option data source of the selection control type. If not, set the option data of the current field to the custom data in the configuration. If so, perform interface configuration authentication on the current field based on the interface configuration information of the selection control type to obtain the option data of the current field.
[0095] In this embodiment, the search control type is obtained according to report.select.type. If the value is "select", that is, the selection control type, it is necessary to enter the option data source based on the selection control type, determine whether the option data of the current field is obtained through the interface, and complete the selection type option data acquisition. If it is not a selection control type, it means that the field does not support search, and the option data based on each field is directly performed to integrate the report search object and report field object data.
[0096] As an example of this embodiment, when determining whether the option data of the current field is obtained through the interface, report.select.fieldInfo.dataSource is used to determine whether the option data is obtained through the interface. If it is "custom", indicating that the option data of the field is not obtained through the interface, the value of report.select.fieldInfo.customData is set to the option data, and then the option data of each field is integrated to integrate the report search object and the report field object data. If it is "interface", indicating that the option data of the field is obtained through the interface, the interface configuration authentication process is performed to complete the acquisition of the option data of the selection control type.
[0097] Optionally, based on the interface configuration information of the selection control type, interface configuration authentication processing is performed on the current field to obtain option data of the current field, specifically including steps S1 to S5, each step is specifically as follows:
[0098] S1: extract the option interface configuration corresponding to the current field according to the interface configuration information of the selection control type, obtain the interface configuration, and search for the interface docking configuration corresponding to the current field in the interface configuration according to the data docking configuration identifier;
[0099] In this embodiment, the field option interface configuration is obtained according to report.select.fieldInfo.interface (hereinafter referred to as interfaceOpt), and the interface connection configuration is found in interfaces according to interfaceOpt.id (hereinafter replaced by interfaceCfg).
[0100] S2: According to the authentication method configured in the option interface, determine whether the current interface needs authentication. If authentication is required, perform data interface authentication processing on the current field according to the interface docking configuration and local cache, obtain authentication parameters, and store the authentication parameters and time node in the local cache;
[0101] In this embodiment, whether login authentication needs to be completed first is determined based on interfaceCfg.authType. If it is "none" or "fixed", it means that authentication is not required, then the process goes to step S3, extracts the option interface address and interface parameters, and makes an option data interface call. If it is "login", it means that authentication is required, then the data interface authentication process is entered to complete the login authentication.
[0102] Optionally, the authentication methods include no authentication required, carrying authentication parameters without logging in, and logging in to obtain and carry authentication parameters. "interface.authType configures the authentication method. The values can be: none / fixed / login, corresponding to: no authentication required / carrying authentication parameters without logging in / logging in to obtain and carry authentication parameters. The authInfo object is the configuration item for obtaining and carrying authentication parameters.
[0103] In the implementation of the embodiment of the present invention, relevant parameter configurations are added to the interface object and the authInfo object, the value of interface.authType is determined, and the value configurations of loginOpt, method, and params in authInfo are combined to construct an authentication request according to the configuration to obtain authentication parameters, so as to meet the requirements of authentication methods such as no authentication required, carrying authentication parameters without logging in, logging in to obtain and carrying authentication parameters, so that multiple authentication methods are allowed in the call of the interface, and the credentials stored in localStorage are used as the basis for judging the interface authentication, so that the call of the interface for obtaining relevant business sensitive data is more secure.
[0104] Optionally, according to the interface connection configuration and the local cache, data interface authentication processing is performed on the current field to obtain authentication parameters, which specifically includes steps S21 and S22, as follows:
[0105] S21: extract all attribute values of the interface parameters of the authentication configuration in the authentication method, obtain the storage location of the authentication parameters in the local cache, and determine whether the authentication parameters exist in the local cache according to the storage location. If so, determine whether the authentication parameters are expired;
[0106] In this embodiment, the authentication parameters are obtained according to the interfaceCfg.authInfo.params object, and the values of all attributes in the object are extracted to obtain the storage locations of the authentication parameters in the local cache localStorage, and it is determined whether these locations exist. Otherwise, a request is made to the login interface to obtain the authentication parameters, that is, step S22, and if yes, the expiration of the authentication parameters is further determined.
[0107] As an example of this embodiment, when judging whether the authentication parameters are expired, the authentication parameter related information is extracted from localStorage in turn, and all the authentication information is judged whether it is expired according to the time node in the information and interface.authInfo.loginOpt.expire. If no, it means that the authentication parameters are not expired, then interfaceCfg.authInfo.params is used as the prototype, and the values in all the authentication parameter information are combined into an authentication information object (hereinafter replaced by authParam), and step S3 is entered to extract the option interface address and interface parameters, and call the option data interface; if yes, it means that the authentication parameters are expired, then step S22 is entered to request the login interface to obtain the authentication parameters.
[0108] S22: When the authentication parameters expire, or the authentication parameters do not exist in the local cache, the login address and login parameters are extracted according to the interface docking configuration, and based on the login address and login parameters, the login interface is requested to obtain login data to obtain the authentication parameters.
[0109] In this embodiment, a login interface request is constructed and sent according to the path, method, params, etc. under the interfaceCfg.url and interfaceCfg.authInfo.loginOpt objects, and the authentication parameter value is obtained from the interface data according to the interfaceCfg.authInfo.loginOpt.response object and authParams is constructed. The authentication parameter value and the current time node are stored in localStorage in turn according to the object attributes.
[0110] S3: extract the option interface address and interface parameters based on the interface configuration and interface interconnection configuration, and construct an option data interface initial request based on the option interface address and interface parameters;
[0111] In this embodiment, the option data interface initial request (hereinafter referred to as dataRequest) is constructed according to interfaceCfg.url and the path, method, params, etc. under the interfaceOpt object.
[0112] S4: If the authentication parameter condition is met, send an initial request for the option data interface, extract the request data according to the interface configuration, process the request data, and set the option data of the current field; wherein, the authentication parameter condition is that the authentication parameter is not empty, and the interface docking needs to carry the authentication parameter;
[0113] In this embodiment, when the authentication parameter conditions are met (the authentication parameters are not empty, and the interface docking requires the authentication parameters), a dataRequest request is sent, and the request data is parsed and processed according to interfaceOpt.response to complete the setting of the control type option data.
[0114] S5: If the authentication parameter conditions are not met, the authentication parameters are set according to the interface docking configuration, an initial request for the option data interface is sent, and the request data is extracted according to the interface configuration, the request data is processed, and the option data of the current field is set.
[0115] In this embodiment, when interfaceCfg.authType is "fixed", the value of authParams is interfaceCfg.authInfo.params. When interfaceCfg.authType is "fixed" or "login", the authentication parameter conditions are not met, and the authentication parameters need to be set according to the interface docking configuration. InterfaceCfg.authInfo.method stores authParams in the corresponding position of dataRequest, corresponding to body in "post", corresponding to url in "get", and corresponding to header in "header".
[0116] Step 103: Based on the report search object and the report field object data, the rendering of various UI controls in the report page and the display of the report data are controlled to dynamically generate the report page.
[0117] In this embodiment, the report page program controls the rendering of various UI controls on the report page and the display of report data according to the data in the fields.
[0118] Optionally, step 103 specifically includes step 1031 to step 1033, each step is specifically as follows:
[0119] Step 1031: Setting a search bar for a rendered report page based on the filter conditions of the report field of the report search object;
[0120] In this embodiment, if report.isFilter is true, a search item for the field is added to the page search bar, and the search item control (date, input box, selection), placeholder, verification method, etc. are set according to the properties in the report.select object.
[0121] Step 1032: setting a table for rendering the report page according to the table display mode and data display type of the report field object data;
[0122] In this embodiment, if report.isShow is true, the report data corresponding to the field is displayed in the table, and the data display type (text, picture), width, minimum width, fixed mode and value alignment type of the table column are set according to the properties in the report.column object.
[0123] Step 1033: Set search conditions in the page search bar, request report data and refresh the table on the report page, display the report data, and dynamically generate the report page.
[0124] In this embodiment, the page search bar sets the search conditions and clicks Search to request report data and refresh the table. The generated report page is as follows: Figure 4 shown.
[0125] Compared with the prior art, the present invention has the following beneficial effects:
[0126] 1. For tenants / users, the style and content design of the report are more dynamic. Based on the pre-set configuration protocol, multiple objects are established to link and finally form a complete report configuration protocol data structure. The interface connection protocol is realized through interface configuration authentication processing. The pre-set configuration protocol is used for various configuration field protocols in the Web-side report page, including UI control rendering style, option data acquisition interface configuration and interface authentication configuration, etc., agreeing on field types, type rules, table display styles and data source interfaces, data push formats and other settings. By obtaining the data of each field in the field configuration of the current page configuration protocol, integrating report search objects and report field object data, controlling the rendering of various UI controls and the display of report data in the report page, realizing dynamic update of report configuration and real-time acquisition of option data, including real-time update of data for each field, field type and option, and allowing the use of multiple authentication methods in the protocol configuration, the interface call is more secure.
[0127] 2. The dynamic report generation method of the present invention is more maintainable for the background management system of the PaaS platform. A corresponding configuration page is established for each tenant. The configuration page is used to configure the page customization protocol of each tenant based on the pre-set configuration protocol. Through a unified background management page, the configuration protocol of each tenant's report page on the Web side is managed, and the report design of multiple tenants is uniformly configured and managed. There is no need to repeatedly modify the system code in maintenance, which reduces a lot of maintenance and development costs, improves the management integration of the project, reduces server resources and labor costs, facilitates unified management, and improves management and development efficiency.
[0128] 3. Tenants / users perform simple operations and configurations through visual configuration pages, which integrate the configuration protocols for Web and mobile page rendering, data acquisition, and data push. From obtaining configuration protocols and report data to obtaining option data, various UI controls are rendered and report data is displayed. This provides PaaS platform operators with a set of convenient, multi-terminal, feature-rich, and real-time dynamically updated reporting services. All report-related configurations and data acquisition methods are delivered in a serialized form. Each tenant has an independent management configuration page. Tenants can complete the high customization of the entire report page through visual operations without touching any code. The PaaS platform generates flexible, easy-to-maintain, and highly customizable report pages in multi-tenant scenarios.
[0129] Embodiment 2
[0130] Accordingly, see Figure 5 , Figure 5 1 is a schematic diagram of a second embodiment of a dynamic report generation device based on a PaaS platform provided by the present invention. Figure 5 As shown, the dynamic report generation device based on the PaaS platform includes a protocol data acquisition unit 501, a protocol docking configuration processing unit 502 and a dynamic report generation unit 503;
[0131] The protocol data acquisition unit 501 is used to respond to the current tenant's report page entry operation on the PaaS platform, obtain the custom protocol data configured by the current tenant in the corresponding configuration page by calling the tenant information interface, and obtain the current page configuration protocol and report data; wherein the configuration page is to establish a corresponding configuration page for each tenant in the background management system of the PaaS platform based on a preset configuration protocol, and is used to configure the page custom protocol of each tenant based on the preset configuration protocol;
[0132] The protocol docking configuration processing unit 502 is used to obtain the data of each field in the field configuration of the current page configuration protocol, perform protocol docking configuration processing on each field data one by one, obtain the option data of each field, and integrate the report search object and the report field object data based on the option data of each field;
[0133] The dynamic report generation unit 503 is used to control the rendering of various UI controls and the display of report data in the report page based on the report search object and the report field object data, and dynamically generate the report page.
[0134] In the implementation of the embodiment of the present invention, a corresponding configuration page is established for each tenant in the background management system of the PaaS platform based on a preset configuration protocol. The configuration page is used to configure the page custom protocol of each tenant based on the preset configuration protocol, and respond to the current tenant entering the report page of the PaaS platform. By calling the tenant information interface, the custom protocol data configured by the current tenant in the corresponding configuration page is obtained, the current page configuration protocol and report data are obtained, and the field data in the field configuration of the current page configuration protocol is obtained. The protocol docking configuration processing is performed on each field data one by one to obtain the option data of each field, and based on the option data of each field, the report search object and the report field object data are integrated; based on the report search object and the report field object data, the rendering of various UI controls in the report page and the display of report data are controlled to dynamically generate a report page. Based on the PaaS platform, it manages the configuration pages of different tenants. In multi-tenant scenarios, it has flexible, easy-to-maintain and highly customizable report page protocols, which improves the management integration of the project, facilitates unified management, improves management and development efficiency, reduces server resources and labor costs, and stipulates the settings of configuration protocols such as field types, type rules, table display styles, data source interfaces, and data push formats. It also performs simple operations and configurations through visual configuration pages, integrates page customization protocols for Web and mobile page rendering, data acquisition, and data push, and provides PaaS platform operators with a set of convenient, multi-terminal, feature-rich, and real-time dynamically updated report services. For tenants, the style and content design of reports are more dynamic.
[0135] The above-mentioned dynamic report generation device based on PaaS platform can implement the above-mentioned method embodiment of a dynamic report generation method based on PaaS platform. The optional items in the above-mentioned method embodiment are also applicable to this embodiment and will not be described in detail here. The rest of the contents of the embodiment of this application can refer to the contents of the above-mentioned method embodiment, and will not be repeated in this embodiment.
[0136] In addition, an embodiment of the present application further provides a computer device, which includes a processor and a memory, wherein the memory is used to store a computer program, and when the computer program is executed by the processor, the steps in any of the above method embodiments are implemented.
[0137] An embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.
[0138] The above specific embodiments further illustrate the purpose, technical solutions and beneficial effects of the present invention. It should be understood that the above are only specific embodiments of the present invention and are not intended to limit the scope of protection of the present invention. It is particularly pointed out that for those skilled in the art, any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the scope of protection of the present invention.
Claims
1. A dynamic report generation method based on PaaS platform, It is characterized in that include: In response to the current tenant entering the report page of the PaaS platform, by calling the tenant information interface, the custom protocol data configured by the current tenant in the corresponding configuration page is obtained, and the current page configuration protocol and report data are obtained; wherein, the configuration page is based on a preset configuration protocol, and a corresponding configuration page is established for each tenant in the background management system of the PaaS platform, and is used to configure the page custom protocol of each tenant based on the preset configuration protocol; wherein, the preset configuration protocol is specifically: various configuration field protocols pre-set in the report page of the PaaS platform; wherein, the various configurations include UI control rendering style configuration, option data acquisition interface configuration, etc. The configuration page includes a data docking configuration module and a basic field module; wherein the data docking configuration module is used to display the configuration of the interface docking in a pop-up window, and a configuration input box is generated by a plug-in so that the tenant can input the interface URL information and the authentication method information through the configuration input box; the basic field module includes a field list submodule and a field configuration submodule; the field list submodule is used to display the basic information of the field so that the tenant can click on the field to switch the display of the configuration information corresponding to the field in the field configuration submodule; the field configuration submodule is used to display the field configuration information in a form so that the tenant can customize the field name, field identifier, mobile terminal acquisition page and Web terminal report page; Acquire the data of each field in the field configuration of the current page configuration protocol, perform protocol docking configuration processing on each field data one by one, obtain option data of each field, and integrate report search objects and report field object data based on the option data of each field; The step of performing protocol docking configuration processing on each field data one by one to obtain option data of each field includes: taking each field as the current field one by one; judging whether field search is supported according to the screening condition corresponding to the current field, and if the current field supports the field search, adding the current field to the report search object, and setting the search field value based on the search matching method of the current field; obtaining the search control type of the current field, and when the search control type is a selection control type, judging whether the option data of the current field is obtained through an interface based on the option data source of the selection control type, and if not, setting the option data of the current field as the custom data in the configuration; and if so, performing interface configuration authentication processing on the current field based on the interface configuration information of the selection control type to obtain the option data of the current field; The interface configuration authentication processing for the current field based on the interface configuration information of the selection control type includes: extracting the option interface configuration corresponding to the current field according to the interface configuration information of the selection control type to obtain the interface configuration, and searching the interface docking configuration corresponding to the current field in the interface configuration according to the data docking configuration identifier; judging whether the current interface needs authentication according to the authentication method of the option interface configuration, and when authentication is required, performing data interface authentication processing on the current field according to the interface docking configuration and the local cache to obtain authentication parameters, and storing the authentication parameters and time nodes in the local cache; based on the interface configuration and the interface The method comprises: receiving a configuration, extracting an option interface address and interface parameters, and constructing an option data interface initial request based on the option interface address and the interface parameters; if the authentication parameter condition is met, sending the option data interface initial request, extracting request data according to the interface configuration, processing the request data, and setting the option data of the current field; wherein the authentication parameter condition is that the authentication parameter is not empty, and the interface docking needs to carry the authentication parameter; if the authentication parameter condition is not met, setting the authentication parameter according to the interface docking configuration, sending the option data interface initial request, extracting request data according to the interface configuration, processing the request data, and setting the option data of the current field; Based on the report search object and the report field object data, the rendering of various UI controls in the report page and the display of the report data are controlled to dynamically generate a report page.
2. The dynamic report generation method based on the PaaS platform as claimed in claim 1, It is characterized in that According to the interface connection configuration and the local cache, data interface authentication processing is performed on the current field to obtain authentication parameters, specifically: Extracting all attribute values of the interface parameters of the authentication configuration in the authentication method, obtaining the storage location of the authentication parameters in the local cache, and judging whether the authentication parameters exist in the local cache according to the storage location, and if so, judging whether the authentication parameters are expired; When the authentication parameter expires, or the authentication parameter does not exist in the local cache, the login address and login parameter are extracted according to the interface docking configuration, and based on the login address and login parameter, the login interface is requested to obtain login data to obtain the authentication parameter.
3. The dynamic report generation method based on the PaaS platform as claimed in claim 1, It is characterized in that The control of rendering of various UI controls in the report page and display of the report data based on the report search object and the report field object data, and dynamic generation of the report page, is specifically as follows: Based on the screening conditions of the report field of the report search object, setting a search bar for rendering the report page; According to the table display mode and data display type of the report field object data, setting the table for rendering the report page; The search conditions are set in the page search bar, the report data is requested and the table of the report page is refreshed to display the report data and dynamically generate the report page.
4. A dynamic report generation device based on PaaS platform, It is characterized in that include: Protocol data acquisition unit, protocol docking configuration processing unit and dynamic report generation unit; The protocol data acquisition unit is used to respond to the current tenant's report page entry operation on the PaaS platform, and obtain the custom protocol data configured by the current tenant in the corresponding configuration page by calling the tenant information interface, and obtain the current page configuration protocol and report data; wherein, the configuration page is based on a preset configuration protocol, and a corresponding configuration page is established for each tenant in the background management system of the PaaS platform, and is used to configure the page custom protocol of each tenant based on the preset configuration protocol; wherein, the preset configuration protocol is specifically: various configuration field protocols pre-set in the report page of the PaaS platform; wherein, the various configurations include UI control rendering style configuration, selection Item data acquisition interface configuration and interface authentication configuration; the configuration page includes a data docking configuration module and a basic field module; wherein the data docking configuration module is used to display the configuration of the interface docking in the form of a pop-up window, and uses a plug-in to generate a configuration input box so that the tenant can input the interface URL information and authentication method information through the configuration input box; the basic field module includes a field list submodule and a field configuration submodule; the field list submodule is used to display the basic information of the field, so that the tenant can click on the field to switch to display the configuration information corresponding to the field in the field configuration submodule; the field configuration submodule is used to display the field configuration information in the form of a form, so that the tenant can customize the field name, field identifier, mobile acquisition page and Web report page; The protocol docking configuration processing unit is used to obtain the data of each field in the field configuration of the current page configuration protocol, perform protocol docking configuration processing on the data of each field one by one, obtain the option data of each field, and integrate the report search object and report field object data based on the option data of each field; the protocol docking configuration processing on the data of each field one by one to obtain the option data of each field includes: taking each field as the current field one by one; judging whether the field search is supported according to the screening condition corresponding to the current field, if the current field supports the field search, adding the current field to the report search object, and setting the search field value based on the search matching mode of the current field; obtaining the search control type of the current field, when the search control type is a selection control type, judging whether the option data of the current field is obtained through the interface based on the option data source of the selection control type, if not, setting the option data of the current field as the custom data in the configuration; if so, performing interface configuration authentication processing on the current field based on the interface configuration information of the selection control type, and obtaining the option data of the current field; The interface configuration authentication processing for the current field based on the interface configuration information of the selection control type includes: extracting the option interface configuration corresponding to the current field according to the interface configuration information of the selection control type to obtain the interface configuration, and searching the interface docking configuration corresponding to the current field in the interface configuration according to the data docking configuration identifier; judging whether the current interface needs authentication according to the authentication method of the option interface configuration, and when authentication is required, performing data interface authentication processing on the current field according to the interface docking configuration and the local cache to obtain authentication parameters, and storing the authentication parameters and time nodes in the local cache; based on the interface configuration and the interface The method comprises: receiving a configuration, extracting an option interface address and interface parameters, and constructing an option data interface initial request based on the option interface address and the interface parameters; if the authentication parameter condition is met, sending the option data interface initial request, extracting request data according to the interface configuration, processing the request data, and setting the option data of the current field; wherein the authentication parameter condition is that the authentication parameter is not empty, and the interface docking needs to carry the authentication parameter; if the authentication parameter condition is not met, setting the authentication parameter according to the interface docking configuration, sending the option data interface initial request, extracting request data according to the interface configuration, processing the request data, and setting the option data of the current field; The dynamic report generation unit is used to control the rendering of various UI controls in the report page and the display of the report data based on the report search object and the report field object data, and dynamically generate a report page.
5. A computer device, It is characterized in that It comprises a processor and a memory, wherein the memory is used to store a computer program, and when the computer program is executed by the processor, the dynamic report generation method based on the PaaS platform as described in any one of claims 1 to 3 is implemented.
6. A computer-readable storage medium, It is characterized in that It stores a computer program, which, when executed by a processor, implements the dynamic report generation method based on the PaaS platform as described in any one of claims 1 to 3.
Citation Information
Patent Citations
Report configuration method, device and equipment and computer storage medium
CN113342821A
Report data visualization system and visualization method
CN113609235A
System and methods to perform row level field masking leveraging attribute based access control in a multi tenant environment
US20220215107A1
