Data report generation method and device, storage medium and electronic device
By obtaining report parameters and generating configuration information on the backend, the method of quickly generating data reports is realized, which solves the problem of the traditional report development consumes a lot of resources, and improves the development efficiency and report accuracy and stability.
Patent Information
- Application Number
- CN202411594087.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-08
- Publication Date
- 2025-02-21
AI Technical Summary
Traditional reporting development methods consume a lot of resources, have a long development cycle, high cost, and are difficult to quickly respond to changes in product operation requirements.
By obtaining the report parameters of the data report to be generated, determining the corresponding configuration parameters, and instructing the backend to generate the target address and configuration information, thereby quickly generating the data report on the frontend.
It reduces the resources and time required to develop data reports, improves development efficiency and report accuracy and stability, and can quickly respond to product operation needs.
Smart Images

Figure CN119493595A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of smart home technology, and more specifically, to a method and device for generating a data report, a storage medium, and an electronic device. Background Art
[0002] With the rapid development of front-end technology and the diversification of enterprise product operation report requirements, traditional report development methods face many challenges. First, a lot of coding and development work is required, resulting in long development cycles, high development costs, complex maintenance, and difficulty in quickly responding to changes in product operation requirements. Second, traditional report development requires developers to have a high level of technical skills and has a strong dependence on developers. In addition, errors are easily introduced during report updates and maintenance, affecting the stability and accuracy of reports.
[0003] In view of the problem that the development of data reports consumes a lot of resources in related technologies, no effective solution has been proposed yet.
[0004] Therefore, it is necessary to improve the related technology to overcome the above-mentioned defects in the related technology. Summary of the invention
[0005] The embodiments of the present application provide a method and device for generating a data report, a storage medium, and an electronic device, so as to at least solve the problem of high resource consumption in developing data reports in the related art.
[0006] According to one aspect of an embodiment of the present application, a method for generating a data report is provided, comprising: obtaining report parameters of a data report to be generated, wherein the report parameters include at least: a report identifier of the data report; determining configuration parameters corresponding to the report parameters through the report parameters, and instructing a backend to generate a target address of the data report based on the configuration parameters, and configuration information of the data report, wherein the target address is used to render the data report; and generating the data report through the target address and the configuration information obtained from the backend.
[0007] In an exemplary embodiment, obtaining report parameters of a data report to be generated includes: determining a current page menu of a front end; and determining the report parameters through the current page menu, wherein there is a corresponding relationship between the current page menu and the report identifier.
[0008] In an exemplary embodiment, determining the configuration parameters corresponding to the report parameters through the report parameters includes: determining all pre-configured configuration parameters included in the backend; and taking the target configuration parameters having the report identifier among all the configuration parameters as the configuration parameters.
[0009] In an exemplary embodiment, instructing the backend to generate the target address of the data report based on the configuration parameters, and generating the configuration information of the data report, includes: instructing the backend to generate the target address of the data report based on the configuration parameters, wherein the target address is at least used to point to the configuration parameters; and when the report parameters also include query parameters, instructing the backend to determine the configuration information through the query parameter items corresponding to the query parameters.
[0010] In an exemplary embodiment, the data report is generated by obtaining the target address and the configuration information from the backend, including: parsing the configuration information to obtain the query parameter items included in the configuration information; identifying the available query items of the data report in the query parameter items; rendering the query components required for the data report through the available query items; and rendering the data report based on the query components through the target address.
[0011] In an exemplary embodiment, the query component required for rendering the data report through the available query items includes: confirming whether the current page menu of the front end is a container menu; when the current page menu is not the container menu, rendering the search items required for the data report, wherein the query component includes the search items.
[0012] In an exemplary embodiment, the query component required for rendering the data report through the available query items includes: confirming whether the current page menu of the front end is a container menu; when the current page menu is the container menu, creating the layout of the data report; parsing the functional items in the layout, wherein the query component includes the functional items.
[0013] According to another aspect of an embodiment of the present application, a device for generating a data report is also provided, including: an acquisition module, used to acquire report parameters of a data report to be generated, wherein the report parameters include at least: a report identifier of the data report; a determination module, used to determine configuration parameters corresponding to the report parameters through the report parameters, and instruct a backend to generate a target address of the data report based on the configuration parameters, and generate configuration information of the data report, wherein the target address is used to render the data report; and a generation module, used to generate the data report using the target address and the configuration information obtained from the backend.
[0014] According to another aspect of the embodiments of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the above-mentioned data report generation method when running.
[0015] According to another aspect of an embodiment of the present application, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the data report generation method through the computer program.
[0016] According to another aspect of the embodiments of the present application, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the method for generating the data report is implemented.
[0017] Through the present application, the report parameters of the data report to be generated are obtained, wherein the report parameters at least include: the report identifier of the data report; the configuration parameters corresponding to the report parameters are determined through the report parameters, and the backend is instructed to generate the target address of the data report based on the configuration parameters, and the configuration information of the data report, wherein the target address is used to render the data report; the data report is generated by the target address and the configuration information obtained from the backend. That is to say, by pre-deploying the configuration parameters at the backend, when it is necessary to generate a data report, the corresponding configuration parameters can be determined according to the report parameters of the data report, and then the target address and the configuration information of the data report for rendering the data report can be obtained, and then the data report can be generated quickly and accurately without consuming a lot of resources to develop the data report. Therefore, the above technical solution is adopted to solve the problem of many resources consumed in developing data reports in the related technology. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0019] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0020] Figure 1 It is a hardware environment diagram of an optional data report generation method according to an embodiment of the present application;
[0021] Figure 2 is a flow chart of an optional method for generating a data report according to an embodiment of the present application;
[0022] Figure 3 It is an interactive sequence diagram of a web front-end, a back-end server and a configuration back-end according to an optional data report generation method of an embodiment of the present application;
[0023] Figure 4 is another flow chart of an optional method for generating a data report according to an embodiment of the present application;
[0024] Figure 5 It is a structural block diagram of an optional data report generation device according to an embodiment of the present application. DETAILED DESCRIPTION
[0025] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0026] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0027] According to one aspect of an embodiment of the present application, a method for generating a data report is provided. The method for generating a data report is widely used in smart home (Smart Home), smart home, smart home device ecology, smart residential (IntelligenceHouse) ecology and other whole-house intelligent digital control application scenarios. Optionally, in this embodiment, the above-mentioned method for generating a data report can be applied to Figure 1 In the hardware environment shown in FIG. 1 , a plurality of terminal devices 102 and a server 104 are formed. Figure 1 As shown, the server 104 is connected to multiple terminal devices 102 via a network, and can be used to provide services (such as application services, etc.) for the terminals or clients installed on the terminals. A database can be set on the server or independently of the server to provide data storage services for the server 104. Cloud computing and / or edge computing services can be configured on the server or independently of the server to provide data computing services for the server 104.
[0028] The network may include but is not limited to at least one of the following: wired network, wireless network. The wired network may include but is not limited to at least one of the following: wide area network, metropolitan area network, local area network, and the wireless network may include but is not limited to at least one of the following: WIFI (Wireless Fidelity), Bluetooth. The terminal device 102 may be but is not limited to a PC, a mobile phone, a tablet computer, a smart air conditioner, a smart range hood, a smart refrigerator, a smart oven, a smart stove, a smart washing machine, a smart water heater, a smart washing device, a smart dishwasher, a smart projection device, a smart TV, a smart clothes drying rack, a smart curtain, a smart audio and video, a smart socket, a smart speaker, a smart fresh air device, a smart kitchen and bathroom device, a smart bathroom device, a smart sweeping robot, a smart window cleaning robot, a smart mopping robot, a smart air purification device, a smart steamer, a smart microwave oven, a smart kitchen treasure, a smart purifier, a smart water dispenser, a smart door lock, etc.
[0029] In this embodiment, a method for generating a data report is provided, including but not limited to being applied to a front end, Figure 2 : is a flow chart of a method for generating a data report according to an embodiment of the present application, the flow chart includes the following steps:
[0030] Step S202: Acquire report parameters of the data report to be generated, wherein the report parameters at least include: a report identifier of the data report;
[0031] Step S204: determining configuration parameters corresponding to the report parameters through the report parameters, and instructing the backend to generate a target address of the data report and configuration information of the data report based on the configuration parameters, wherein the target address is used to render the data report;
[0032] Optionally, the target address is a link to the Metabase where the configuration parameters are located.
[0033] Step S206: Generate the data report using the target address and the configuration information obtained from the backend.
[0034] Through the above steps, the report parameters of the data report to be generated are obtained, wherein the report parameters at least include: the report identifier of the data report; the configuration parameters corresponding to the report parameters are determined through the report parameters, and the backend is instructed to generate the target address of the data report based on the configuration parameters, and the configuration information of the data report, wherein the target address is used to render the data report; the data report is generated by the target address and the configuration information obtained from the backend. That is to say, by pre-deploying the configuration parameters on the backend, when it is necessary to generate a data report, the corresponding configuration parameters can be determined according to the report parameters of the data report, and then the target address and the configuration information of the data report for rendering the data report can be obtained, and then the data report can be generated quickly and accurately without consuming a lot of resources to develop the data report. Therefore, the above technical solution is adopted to solve the problem of large resources consumed in developing data reports in related technologies.
[0035] In an exemplary embodiment, obtaining report parameters of a data report to be generated includes: determining a current page menu of a front end; and determining the report parameters through the current page menu, wherein there is a corresponding relationship between the current page menu and the report identifier.
[0036] In this way, when users operate on the front end, the system can automatically identify user needs and quickly locate the reports that need to be generated, improving the user experience. It is suitable for complex business environments with multi-level and multi-type report requirements.
[0037] Specifically, the user's operation will trigger the response of the Web front end, and the current page menu (such as product operation, sales analysis, user behavior analysis, etc.) where the current user is located will be recognized by the system. The design of the page menu usually corresponds to the business function or data report type, so the type of report that the user wants to view can be determined through the current page menu, that is, the report parameters can be determined through the current page menu.
[0038] In the system design, each menu item is associated with one or more report IDs, which correspond to the configuration parameters of the report stored in the Metabase database. Through the current page menu, the system can query the corresponding report ID.
[0039] In an exemplary embodiment, determining the configuration parameters corresponding to the report parameters through the report parameters includes: determining all pre-configured configuration parameters included in the backend; and taking the target configuration parameters having the report identifier among all the configuration parameters as the configuration parameters.
[0040] After the current page menu is identified and the report ID is determined, the next step is to use this report ID to obtain the report from the back-end server (i.e. Figure 3 The configuration parameters of the report are retrieved from the database of the background server (ie, the configuration background). Optionally, the configuration parameters may include the data source, query statement, chart type, display format, etc. of the report, and may also include information such as whether multiple report combinations are involved.
[0041] In an exemplary embodiment, instructing the backend to generate the target address of the data report based on the configuration parameters, and generating the configuration information of the data report, includes: instructing the backend to generate the target address of the data report based on the configuration parameters, wherein the target address is at least used to point to the configuration parameters; and when the report parameters also include query parameters, instructing the backend to determine the configuration information through the query parameter items corresponding to the query parameters.
[0042] Furthermore, the data report is generated by obtaining the target address and the configuration information from the backend, including: parsing the configuration information to obtain the query parameter items included in the configuration information; identifying the available query items of the data report in the query parameter items; rendering the query components required for the data report through the available query items; and rendering the data report based on the query components through the target address.
[0043] Optionally, the backend generates a target address (i.e., I frame URL) for the data report based on the configuration parameters. This target address is dynamically generated and points to a specific report configuration in the Metabase system. The target address contains the query conditions and display parameters required for the report. Through this address, Metabase can know which data source to obtain data from and how to display the data.
[0044] In some cases, report parameters contain not only report configuration information, but also specific query parameters. Query parameters are conditions used to filter data from data sources, such as time range, product type, region, etc. If the report parameters contain query parameters, the backend server needs to process further to identify and parse these query parameter items to determine the detailed configuration information of the report. This configuration information may involve detailed rules for data query, data filtering conditions, personalized display settings for charts, etc. The generated configuration information will be sent back to the front end as a response together with the target address of the report. After receiving it, the front end will parse this information, dynamically render the report query options, and load and display the report generated by Metabase through the I frame.
[0045] Specifically, the query component required for rendering the data report through the available query items includes: confirming whether the current page menu of the front end is a container menu; when the current page menu is not the container menu, rendering the search items required for the data report, wherein the query component includes the search items.
[0046] Confirm whether the current page menu on the front end is a container menu: First, the front end needs to identify the menu type of the page the user is currently on and determine whether it is a container menu. Container menus usually refer to pages that do not directly display data reports but provide other layouts or menu options. If the current menu is not a container menu, then it is directly associated with the data report.
[0047] In the case where the current page menu is not the container menu, the search items required for rendering the data report: Once it is confirmed that the current menu is directly related to the data report, the front end will dynamically render the query components required for the data report, i.e., the search items, based on the report configuration information obtained from the back end. These search items include but are not limited to time selectors, drop-down lists, text input boxes, etc., which allow users to customize report query conditions according to specific needs. For example, users can select a specific date range, product line, or region to filter and display data.
[0048] Specifically, the query component required for rendering the data report through the available query items includes: confirming whether the current page menu of the front end is a container menu; when the current page menu is the container menu, creating the layout of the data report; parsing the function items in the layout, wherein the query component includes the function items.
[0049] Optionally, when the current page menu is the container menu, create the layout of the data report: when the current menu is a container menu, the task of the front end is to create the overall layout of the report based on the layout information returned by the back end. The layout may include multiple areas, each of which can carry different functional items or reports. After creating the layout, the front end needs to further parse the configuration of each functional item in the layout. These functional items may also be the entrance to the data report, or menu items that provide additional layout elements, such as navigation bars, titles, buttons, etc. After parsing the configuration information of the functional items, the front end can correctly display the interface elements of these functional items and provide the correct interaction logic for each functional item, such as clicking a button to trigger a report query.
[0050] That is, in the embodiment of the present application, when the menu is directly associated with the report, the front end can quickly display the query component, allowing the user to customize the report query; when the menu is used as a container, the front end builds a layout framework to provide users with a clear report directory and organizational structure, making it easier for users to browse and access various reports. This flexible front-end processing method is a key part of realizing automatic report generation and display, which not only improves the usability of the report, but also reduces the workload of development and maintenance.
[0051] Obviously, the embodiments described above are only some embodiments of the present application, not all embodiments. In order to better understand the method for generating the above data report, the above process is described below in conjunction with the embodiments, but it is not intended to limit the technical solutions of the embodiments of the present application, specifically:
[0052] In the presentation of big data reports, the timeliness, accuracy and stability of data are important criteria. In related technologies, data reports are developed by, for example: manually coding reports with the help of third-party plug-ins such as Echarts, generating reports through Bi tools such as Tableau and PowerBi, and cloud-based report generation services such as Google Data Studio and Amazon QuickSight. The above methods have the problems of high development and maintenance costs, long development cycles, inability to meet the timeliness requirements of reports, high technical barriers, high licensing fees, and possible impact when processing large-scale data.
[0053] The embodiment of the present application greatly reduces the development workload by introducing the automated report generation method of Metabase. Users can automatically generate the required reports through simple configuration and operation, which greatly shortens the development cycle and reduces the development cost, and can also quickly respond to different needs of product operations. Specifically, through the customized development of Metabase, a layer of configuration is performed on the upper layer of the data report, which serves as a bridge for driving data and interface display. For the front-end interface, it only needs to process the relationship between the configuration file and the interface layout, and for the bottom layer of Metabase, it only needs to query the data according to the parameters for display, so as to improve the development efficiency while ensuring the stability of data display.
[0054] Specifically, Figure 3 It is an interactive sequence diagram of a web front-end, a back-end server and a configuration back-end according to an optional data report generation method of an embodiment of the present application; Figure 3 As shown:
[0055] The web front end is responsible for obtaining the Iframe url (i.e., target address) and menu report configuration information (i.e., configuration information), and uses the configuration information to drive the page to display the chart's search items and Metabase report content. The backend server dynamically reads the configuration (i.e., configuration parameters) from the database based on the report ID (i.e., report identifier) transmitted by the web end, generates the Iframe url, and returns the Iframe url and configuration information to the web front end after combining them. The specific steps include:
[0056] Step 1: The user views the report.
[0057] Step 2: The web front end obtains the report ID through the current page menu to make an interface request to the backend server.
[0058] Step 3: After receiving the report ID from the front end, the backend server queries the database for the configuration parameters that have been configured and stored in the database.
[0059] Step 4: Generate a Metabase link (i.e., target address) and a combination of configuration information. The configuration information includes: query parameter items required for the report, and whether it is a combination of multiple reports. Finally, return all the combination information (i.e., the combination of target address and configuration information) to the front end.
[0060] Step 5: After receiving the configuration information and Iframe URL, the web front end performs data parsing. Dynamically identify the query items required for the report and selectively render the required query components, such as industry and trade drop-down items, time selection, etc.; render the Metabase chart (i.e., data report) according to the Iframe URL in the returned data.
[0061] Step 6: Return to the report content.
[0062] In some optional cases, the Iframe URL may be a URL pointing to a specific report generated by Metabase. This URL will contain the report's parameters and configuration information so that when the web front-end loads the Iframe, Metabase can correctly generate and display the corresponding data report. When the Iframe in the web front-end page loads this URL, Metabase will generate a report based on these parameters and display it in the Iframe.
[0063] Furthermore, the operation of the embodiment of the present application is divided into two parts: one part is the foreground configuration acquisition and configuration parsing part, and the other part is the background configuration part.
[0064] The background configuration part mainly solves the page layout, the association between menu items and Metabase, and the dynamic configuration of search items. The main function of the front-end part is to obtain the background configuration dynamic rendering interface, get the background configuration for data analysis, and determine whether it is a container or a function menu. The container menu only provides layout, and the function menu provides dynamic search items and Iframe rendering. Figure 4 As shown, it includes: configuring Metabase menu, logging in Metabase ID, configuring report query items, and creating Metabase menu. Confirm whether it is a container menu. If so, create a container menu; if not, select the associated Metabase report and create a Metabase function menu. Both the container menu and the Metabase function menu are stored in the database.
[0065] Optionally, in the configuration report query items, available query items include but are not limited to: industry and trade list, time selection, industry name, and designer role.
[0066] Furthermore, Figure 4 It also includes: opening the Metabase menu, obtaining the report configuration (i.e., configuration parameters) according to the report ID, and then obtaining the query item and Iframe URL through the database. Then, it is determined whether it is a container menu. If it is a container menu, a layout is created, the function items in the layout are parsed, the search items are parsed and rendered, and finally the Iframe is rendered; if it is not a container menu, only the search items need to be parsed and rendered, and finally the Iframe is rendered.
[0067] Thus, the embodiment of the present application realizes an automated report generation process, including the entire process from data configuration to visualization generation; and realizes the flexibility and customization capability of custom configuration based on dynamic search items.
[0068] As the high-frequency demand for enterprise data reports puts the development and maintenance of data reports under test, the automatic generation method of this application can realize the automatic generation of reports, which means that reports can be quickly generated through simple settings, saving development costs while greatly improving development efficiency and shortening the development cycle, allowing the development of data reports to focus on the data itself without paying too much attention to interface implementation.
[0069] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods of each embodiment of the present application.
[0070] In this embodiment, a data report generation device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0071] Figure 5 : is a structural block diagram of an optional data report generation device according to an embodiment of the present application, the device comprising:
[0072] The acquisition module 52 is used to acquire report parameters of the data report to be generated, wherein the report parameters at least include: a report identifier of the data report;
[0073] A determination module 54, configured to determine configuration parameters corresponding to the report parameters through the report parameters, and instruct the backend to generate a target address of the data report and configuration information of the data report based on the configuration parameters, wherein the target address is used to render the data report;
[0074] The generating module 56 is used to generate the data report using the target address and the configuration information obtained from the backend.
[0075] Through the above-mentioned device, the report parameters of the data report to be generated are obtained, wherein the report parameters at least include: the report identifier of the data report; the configuration parameters corresponding to the report parameters are determined through the report parameters, and the backend is instructed to generate the target address of the data report based on the configuration parameters, and the configuration information of the data report, wherein the target address is used to render the data report; the data report is generated by the target address and the configuration information obtained from the backend. That is to say, by pre-deploying the configuration parameters at the backend, when it is necessary to generate a data report, the corresponding configuration parameters can be determined according to the report parameters of the data report, and then the target address and the configuration information of the data report for rendering the data report can be obtained, and then the data report can be generated quickly and accurately without consuming a lot of resources to develop the data report. Therefore, the above-mentioned technical solution solves the problem of a lot of resources consumed in developing data reports in the related technology.
[0076] In an exemplary embodiment, the acquisition module 52 is further used to: determine the current page menu of the front end; determine the report parameter through the current page menu, wherein there is a corresponding relationship between the current page menu and the report identifier.
[0077] In an exemplary embodiment, the determination module 54 is further used to: determine all pre-configured configuration parameters included in the backend; and use the target configuration parameter having the report identifier among all the configuration parameters as the configuration parameter.
[0078] In an exemplary embodiment, the determination module 54 is also used to: instruct the backend to generate a target address of the data report based on the configuration parameters, wherein the target address is at least used to point to the configuration parameters; and when the report parameters also include query parameters, instruct the backend to determine the configuration information through the query parameter items corresponding to the query parameters.
[0079] In an exemplary embodiment, the generation module 56 is also used to: parse the configuration information to obtain query parameter items included in the configuration information; identify available query items of the data report in the query parameter items; render the query components required for the data report through the available query items; and render the data report based on the query components through the target address.
[0080] In an exemplary embodiment, the generation module 56 is also used to: confirm whether the current page menu of the front end is a container menu; if the current page menu is not the container menu, render the search items required for the data report, wherein the query component includes the search items.
[0081] In an exemplary embodiment, the generation module 56 is also used to: confirm whether the current page menu of the front end is a container menu; if the current page menu is the container menu, create the layout of the data report; and parse the functional items in the layout, wherein the query component includes the functional items.
[0082] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.
[0083] Optionally, in this embodiment, the storage medium may be configured to store a computer program for performing the following steps:
[0084] S1, obtaining report parameters of a data report to be generated, wherein the report parameters at least include: a report identifier of the data report;
[0085] S2, determining configuration parameters corresponding to the report parameters through the report parameters, and instructing the backend to generate a target address of the data report and configuration information of the data report based on the configuration parameters, wherein the target address is used to render the data report;
[0086] S3, generating the data report using the target address and the configuration information obtained from the backend.
[0087] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.
[0088] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.
[0089] An embodiment of the present application further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0090] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:
[0091] S1, obtaining report parameters of a data report to be generated, wherein the report parameters at least include: a report identifier of the data report;
[0092] S2, determining configuration parameters corresponding to the report parameters through the report parameters, and instructing the backend to generate a target address of the data report and configuration information of the data report based on the configuration parameters, wherein the target address is used to render the data report;
[0093] S3, generating the data report using the target address and the configuration information obtained from the backend.
[0094] In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0095] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps in any one of the above method embodiments are implemented.
[0096] An embodiment of the present application further provides another computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.
[0097] An embodiment of the present application also provides a computer program, which includes computer instructions, which are stored in a computer-readable storage medium; a processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the steps in any one of the above method embodiments.
[0098] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.
[0099] Obviously, those skilled in the art should understand that the above modules or steps of the present application can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.
[0100] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A method for generating a data report, characterized in that: include: Acquire report parameters of the data report to be generated, wherein the report parameters at least include: a report identifier of the data report; Determine the configuration parameters corresponding to the report parameters through the report parameters, and instruct the backend to generate the target address of the data report and the configuration information of the data report based on the configuration parameters, wherein the target address is used to render the data report; The data report is generated by using the target address and the configuration information obtained from the back end.
2. The method for generating a data report according to claim 1, characterized in that: Get the report parameters of the data report to be generated, including: Determine the current page menu on the front end; The report parameter is determined through the current page menu, wherein there is a corresponding relationship between the current page menu and the report identifier.
3. The method for generating a data report according to claim 1, characterized in that: Determining configuration parameters corresponding to the report parameters through the report parameters includes: Determining all pre-configured configuration parameters included in the backend; The target configuration parameter having the report identifier among all the configuration parameters is used as the configuration parameter.
4. The method for generating a data report according to claim 1, characterized in that: Instructing the backend to generate the target address of the data report based on the configuration parameters, and the configuration information for generating the data report, including: instructing the backend to generate a target address of the data report based on the configuration parameters, wherein the target address is at least used to point to the configuration parameters; and In the case where the report parameters further include query parameters, the backend is instructed to determine the configuration information through the query parameter items corresponding to the query parameters.
5. The method for generating a data report according to claim 4, characterized in that: Generating the data report by using the target address and the configuration information obtained from the backend includes: Parsing the configuration information to obtain query parameter items included in the configuration information; Identifying available query items of the data report in the query parameter items; The query component required for rendering the data report through the available query items; The data report is rendered based on the query component through the target address.
6. The method for generating a data report according to claim 5, characterized in that: The query components required for rendering the data report through the available query items include: Confirm whether the current page menu on the front end is a container menu; In a case where the current page menu is not the container menu, the search items required for rendering the data report are rendered, wherein the query component includes the search items.
7. The method for generating a data report according to claim 5, characterized in that: The query components required for rendering the data report through the available query items include: Confirm whether the current page menu on the front end is a container menu; In the case where the current page menu is the container menu, creating a layout of the data report; The functional items in the layout are parsed, wherein the query component includes the functional items.
8. A data report generation device, characterized in that: include: An acquisition module, used for acquiring report parameters of a data report to be generated, wherein the report parameters at least include: a report identifier of the data report; A determination module, used to determine the configuration parameters corresponding to the report parameters through the report parameters, and instruct the backend to generate a target address of the data report based on the configuration parameters, and generate configuration information of the data report, wherein the target address is used to render the data report; A generating module is used to generate the data report using the target address and the configuration information obtained from a backend.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein the program executes the method according to any one of claims 1 to 7 when executed.
10. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 7 through the computer program.