WO2023273073A1 - 报表配置方法、装置、设备及计算机存储介质 - Google Patents

报表配置方法、装置、设备及计算机存储介质 Download PDF

Info

Publication number
WO2023273073A1
WO2023273073A1 PCT/CN2021/127616 CN2021127616W WO2023273073A1 WO 2023273073 A1 WO2023273073 A1 WO 2023273073A1 CN 2021127616 W CN2021127616 W CN 2021127616W WO 2023273073 A1 WO2023273073 A1 WO 2023273073A1
Authority
WO
WIPO (PCT)
Prior art keywords
field
report
data
report configuration
display
Prior art date
Application number
PCT/CN2021/127616
Other languages
English (en)
French (fr)
Inventor
王希
Original Assignee
深圳前海微众银行股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳前海微众银行股份有限公司 filed Critical 深圳前海微众银行股份有限公司
Publication of WO2023273073A1 publication Critical patent/WO2023273073A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2282Tablespace storage structures; Management thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/242Query formulation
    • G06F16/2433Query languages
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2458Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries
    • G06F16/2462Approximate or statistical queries
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/248Presentation of query results

Definitions

  • the present application relates to the technical field of financial technology (Fintech), and in particular to a report configuration method, device, equipment and computer storage medium.
  • business personnel need to monitor and analyze business operation data more efficiently and conveniently, so as to better understand and gain insight into existing and incremental customers in business development. Analyzing business operation data requires accessing data and making reports according to requirements.
  • the current method is that business personnel submit data access requirements to developers, and developers provide them to business personnel after obtaining the data. Business personnel then manually summarize the obtained data. report. Due to frequent changes in business requirements, many temporary access requirements, and deviations in understanding of business requirements by developers, business personnel are often unable to quickly obtain data.
  • the main purpose of this application is to provide a report configuration method, device, equipment and computer storage medium, aiming at solving the current technical problem that business personnel cannot quickly obtain required data.
  • the present application provides a report configuration method, the report configuration method includes:
  • report configuration information based on report configuration interface configuration, wherein the report configuration information includes access requirement information and display requirement information configured for each configurable field in the report configuration interface, and the configurable field is the native field or a custom field that performs formula operations on the native field;
  • the report data is displayed according to the display rules defined by the display requirement information.
  • the present application also provides a report configuration device, the report configuration device includes:
  • An import module configured to import each business data record obtained according to the statistical calculation of each native field in the preset table structure into the preset table structure to obtain a target data table
  • An acquisition module configured to acquire report configuration information based on report configuration interface configuration, wherein the report configuration information includes access requirement information and display requirement information configured for each configurable field in the report configuration interface, and the configurable
  • the field is the native field or a custom field that performs formula operations on the native field;
  • a query module configured to convert the data access requirement information into a target structured query statement, and use the target structured query statement to query the target data table to obtain report data;
  • a display module configured to display the report data according to the display rules defined by the display requirement information.
  • the present application also provides a report configuration device, the report configuration device includes: a memory, a processor, and a report configuration program stored in the memory and operable on the processor.
  • the report configuration program is executed by the processor, the above steps of the report configuration method are realized.
  • the present application also provides a computer storage medium, on which a report configuration program is stored, and when the report configuration program is executed by a processor, the steps of the report configuration method described above are implemented.
  • the present application also provides a computer program product, the computer program product includes a computer program, and when the computer program is executed by a processor, the steps of the report configuration method as described above are realized.
  • This application obtains the target data table by importing various business data records calculated according to the statistical calculation of each native field in the preset table structure into the preset table structure; obtains the report configuration information based on the configuration of the report configuration interface, wherein the report configuration information includes The access requirement information and display requirement information configured by each configurable field in the report configuration interface.
  • the configurable fields are native fields or custom fields that perform formula operations on native fields; convert the access requirement information into target structured query statements , and use the target structured query statement to query the target data table to obtain the report data; display the report data according to the display rules defined by the display requirement information.
  • the target data table is obtained by pre-defining the table structure and pre-statistically calculating the data import table structure, so that business personnel can obtain data from the data table according to the required dimensions and indicators, that is, realize self-service data retrieval for business personnel; by setting the visualization
  • the report configuration interface is for business personnel to configure reports visually, and then convert the information configured by business personnel into structured query statements to query data tables and automatically draw reports, realizing the visual report configuration of business personnel. That is to say, this application provides a self-service visual report configuration solution, which can realize the self-service retrieval of business personnel, no longer need to ask developers for requirements, and there is no release process for developers, which greatly improves the access of business personnel.
  • Data efficiency, and the visual configuration interface enables business personnel to complete report configuration by themselves without mastering complex structured query statements, and quickly generate report display pages without manually drawing reports.
  • FIG. 1 is a schematic diagram of the device structure of the report configuration device hardware operating environment involved in the solution of the embodiment of the present application;
  • FIG. 2 is a schematic flow chart of the first embodiment of the report configuration method of the present application
  • Fig. 3 is an exemplary report configuration interface involved in the embodiment of the present application.
  • FIG. 4 is an exemplary report display effect diagram related to the embodiment of the present application.
  • Fig. 5 is a schematic diagram of functional modules of an embodiment of the report configuration device of the present application.
  • FIG. 1 is a schematic diagram of the device structure of the hardware operating environment of the report configuration device involved in the solution of the embodiment of the present application.
  • the report configuration device in the embodiment of this application can be a smart phone, a PC (Personal Computer, personal computer), tablet computer, portable computer, etc.
  • the report configuration device may include: a processor 1001 , such as a CPU, a communication bus 1002 , a user interface 1003 , a network interface 1004 , and a memory 1005 .
  • the communication bus 1002 is used to realize connection and communication between these components.
  • the user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface.
  • the network interface 1004 may include a standard wired interface and a wireless interface (such as a Wi-Fi interface).
  • the memory 1005 may be a high-speed RAM memory, or a stable memory (non-volatile memory), such as a disk memory.
  • the memory 1005 may also be a storage device independent of the aforementioned processor 1001 .
  • report configuration device structure shown in Figure 1 does not constitute a limitation on the report configuration device, and may include more or less components than those shown in the illustration, or combine certain components, or different components layout.
  • the memory 1005 as a computer storage medium may include an operating system, a network communication module, a user interface module, and a report configuration program.
  • the network interface 1004 is mainly used to connect to the background server and perform data communication with the background server; the user interface 1003 is mainly used to connect to the client and perform data communication with the client; and the processor 1001 can be used for
  • the report configuration program stored in the memory 1005 is called, and the operations described in the following embodiments of the report configuration method of this application are performed.
  • FIG. 2 is a schematic flowchart of the first embodiment of the tag generation method of the present application.
  • the embodiment of the present application provides an embodiment of the report configuration method. It should be noted that although the logic sequence is shown in the flow chart, in some cases, the sequence shown or described can be executed in a different order than here. A step of.
  • the execution subject of the report configuration method may be a device such as a smart phone, a personal computer, or a server.
  • the configuration system execution subject will be used to describe various embodiments below.
  • the report configuration method includes:
  • Step S10 import each business data record obtained according to the statistical calculation of each native field in the preset table structure into the preset table structure to obtain a target data table;
  • a self-service visual report configuration solution is proposed.
  • the developer first establishes the database table structure according to the business logic.
  • the table structure includes most of the fields required by the business personnel to meet most of the fixed needs, and uses the data warehouse to calculate the original business data according to the fields in the table structure.
  • the report configuration interface allows business personnel to visually select dimensions and indicators, and then converts the information configured by business personnel into structured query statements to query data tables and automatically draw reports, realizing the visual report configuration of business personnel.
  • the self-service visual report configuration solution can realize self-service data retrieval by business personnel, no longer need to ask developers for requirements, and there is no release process for developers, which greatly improves the data retrieval efficiency of business personnel, and the visual configuration interface makes business Personnel can complete report configuration by themselves without mastering complex structured query statements, and quickly generate report display pages without manually drawing reports.
  • developers can first define the development specification of the table structure, and then establish the table structure (ie, the preset table structure) in the configuration system according to the development specification.
  • the database may be a MySQL database or other databases based on structured query language.
  • Each field in the table structure can be the field that the business personnel may need through the analysis of the business chain by the developer. The required fields are different according to the specific business scenarios, and there is no limitation here.
  • an example of a development specification is as follows:
  • Time field varchar(32) --Type is string format 2020-01-01 or 20200101
  • the configuration system performs statistical calculations on the original data according to the fields in the preset table structure (hereinafter referred to as native fields) to obtain various business data, and imports the business data into the preset table structure to obtain a data table. For example, if the native field includes "number of people placing orders per day", then the number of people who place orders for the product per day is calculated based on the statistics of the original ordering user data. Specifically, the configuration system can be based on the statistical calculation of the Hive data warehouse. After the Hadoop cluster calculation is completed, the calculated business data can be imported into the MySQL database through Sqoop.
  • the configuration system can be set to periodically pull raw data for statistical calculation and update the data table according to a certain period. For example, pull and calculate data according to daily, weekly, monthly, or annual cycles. Specifically, the cycle can be set according to business needs to support different report types such as daily, weekly, monthly, and annual reports.
  • the data in each cycle can be summarized into a business data import data table, for example, every other week, the data in a week is summarized into a business data import data table, and only the Weekly data; the summary method can be to take the data of any day in the period for statistical calculation as the data in the period, or to calculate the average of the data in the period and then take the average as the data in the period, or other summary methods , which can be set according to business requirements.
  • the range of a week can be set according to business requirements, for example, setting Sunday to Saturday as a week, or setting Monday to Sunday as a week, and so on.
  • Step S20 acquiring report configuration information based on the configuration of the report configuration interface, wherein the report configuration information includes access requirement information and display requirement information configured for each configurable field in the report configuration interface, and the configurable fields are The native field or a custom field that performs formula operations on the native field;
  • the configuration system can obtain report configuration information based on the configuration operations triggered by business personnel based on the configuration components.
  • the report configuration information can include report configuration The access requirement information and display requirement information configured by each configurable field in the interface.
  • the configurable fields are native fields in the preset table structure or custom fields that perform formula operations on native fields; formula operations can be four arithmetic operations on native fields, such as addition, subtraction, multiplication, and division.
  • a custom field can be defined to represent The result calculated according to the formula (A-B)/A for native fields A and B.
  • a field configuration component can be set in the report configuration interface for business personnel to configure fields.
  • the configuration system triggers the configuration based on this component by business personnel. Operation to obtain the access requirement information and display requirement information configured for each configurable field.
  • the access requirement information may include information such as fields to be accessed and access conditions
  • the display requirement information may include information such as fields to be displayed and display methods.
  • the field configuration component can be displayed in the report configuration interface, and each native field in the preset table structure corresponding to the target data table is displayed in the field configuration component, and Each configuration item corresponding to each native field.
  • Field configuration components can also display field deletion and addition controls for business personnel to delete displayed fields or add custom fields in the field configuration component; the configuration system is triggered by business personnel on the deletion control of a displayed field Operation, delete the field and the configuration items of the field in the field configuration component, and add a row of fields and the configuration items of the field in the field configuration component according to the trigger operation of the business personnel on adding controls.
  • the fields displayed in the field configuration component can be configured with fields.
  • the configuration items that can be configured with fields can include, for example, table display, field name, display name, parent header, field type, decimal place, field source, expand/collapse, and collapse method , sorting method and graphic display, etc., in specific implementations, there may be fewer or more according to business requirements. For example, when there is no requirement for decimal places in data display, the configuration item of decimal places may not be set, and for example, when required To help business personnel better understand the meaning and logic of fields, you can add a field description as a configuration item.
  • the role of each configuration item is illustrated below, but in a specific implementation, the definition or role of each configuration item can also be changed on the basis of the following examples:
  • “Table display” is used to configure whether the field needs to be displayed in the report.
  • Field name is used as the field name in the structured query statement.
  • the field name of the native field adopts the field name in the preset table structure and cannot be configured.
  • the field name of the custom field can be configured as required.
  • Display name is used to display as the header in the report.
  • the display name of the native field can default to the display name defined in the preset table structure and can be modified.
  • the display name of the custom field is configurable.
  • "Parent Header” is the upper level of the display name. In the report, the fields of the same indicator type as the parent header are displayed as adjacent columns. Only the parent header of the field whose field type is the indicator type can be configured.
  • Field Type is used to configure the type of the field.
  • the configurable field types include dimension type and index type; if the native fields of the preset table structure include date, the date can also be used as a separate field type; date type fields
  • the configuration items of field source, decimal place, expand/collapse, collapsing method, and sorting method are not configurable.
  • the configuration items of field source, decimal place, and collapsing method are not configurable for dimension type fields, and the configuration items for indicator type fields are not configurable. /Collapse this configuration item.
  • “Decimal places” only works for fields whose field type is an indicator.
  • the options that can be configured include percentage, decimal place, unit thousand, unit ten thousand, unit billion, etc.
  • the option percentage indicates that the data of this field is displayed in percentage, such as 80.12 %, and the number of decimal places can be set at the same time; the option decimal places means that the data in this field is displayed using the default data, and the number of decimal places can be set at the same time; the option unit thousand means that the data in this field is divided by 1000 using the default data Set the number of decimal places; the option unit million means that the data in this field is divided by 10000 by default data, and the number of decimal places can be set; digits.
  • "Field source” indicates the source of the configurable field.
  • the field source of the native field is not configurable by default.
  • the field source of the custom field can be configured as a formula for calculating the native field.
  • the field source of the custom field is defined as (A-B)/ A, means that the data of the custom field is calculated according to the calculation formula using the data of the native fields A and B; that is, the business personnel can directly obtain the data of the native field from the target data table, or obtain the data based on the native field
  • the calculated data increases the flexibility of business personnel to configure reports and reduces the difficulty for developers to develop table structures.
  • “Expand/Collapse” is used to configure whether the fields of the dimension type are displayed expanded or collapsed in the report.
  • Coldlapse method is used to configure the collapsing method of each category data when the fields of the dimension type are collapsing, for example, two options of average and sum can be included.
  • “Sorting method” is used to configure whether the dimension type field needs to be sorted, and the priority of sorting.
  • the priority can be represented by a number. The larger the number, the higher the priority.
  • “Graphic display” is used to configure whether the field needs to be displayed in the graph.
  • the configuration system can obtain the access requirement information and display requirement information for each configurable field. For example: configure “Table Display” as the configurable field that needs to be displayed and “Field Type” as the indicator type as the indicator field in the data access requirement information, and use the field name of the configurable field to represent the indicator field. Configure “Table Display” as the required display, “Field Type” as the dimension type, and “Expand/Collapse” as the expanded configurable field as the first dimension field in the access requirement information, and use the configurable field's Field name to represent the first dimension field.
  • the display requirement information also includes the indicator field and the first dimension field in the access requirement information.
  • the access requirement information also includes the calculation formula of the index field configured as the calculation formula in "Field Source”, and the configuration information of the two configuration items "collapse method” and “sort method” of each first dimension field.
  • the display requirement information also includes the configuration information of the indicator field, the first dimension field and the second dimension field in the configuration items of "display name", "parent header”, “decimal places” and "graphic display”. If the field type includes the date type, you can also configure the "field type” to be a date type field as the date field in the retrieval requirement information and display requirement information.
  • Step S30 converts the data access requirement information into a target structured query statement, and uses the target structured query statement to query in the target data table to obtain report data;
  • the configuration system can convert the access requirement information into a structured query statement (hereinafter referred to as a target structured query statement).
  • a structured query statement hereinafter referred to as a target structured query statement.
  • various types of information can be converted into structured query statements according to pre-set rules, and various types of information can be converted into various fields and statements in structured query statements according to the rules during conversion and spliced to obtain the target Structured query statement.
  • the date field in the access requirement information can be used as the selection field (that is, the field after select) and the grouping field (that is, the group by), use the index field as the selection field in the structured query statement, etc.
  • Specific rules can be set according to business requirements, and are not limited or listed in this embodiment.
  • the configuration system can use the target structured query statement to query the target data table to obtain report data.
  • the configuration system may use the converted target structured query statement to query the target data table to obtain report data. It can be understood that when the data in the target data table is regularly updated, the report data queried by using the target structured query statement at different times is the same.
  • the configuration system can detect whether the currently logged-in user has access rights to the target data table, and if so, obtain the configuration information of the predefined target data table, access the database according to the configuration information, and query The statement searches the target data table to obtain report data.
  • the configuration information includes information such as the IP address, port, database name, user name and password of the database.
  • Step S40 displaying the report data according to the display rules defined by the display requirement information.
  • the configuration system can display the report data according to the display rules defined by the display requirement information.
  • the display requirement information may include a display style type.
  • the display style type includes a table style and/or a graphic style
  • the graphic style includes a line graph and a bar graph.
  • the configuration system can display the display name and parent header corresponding to the first dimension field, index field, and date field in the display demand information as the header name, and the report The report data corresponding to the first dimension field and the indicator field in the data are displayed as column data under the corresponding header name; when the table style includes a graphic style, the configuration system can display the report corresponding to the field that needs to be displayed graphically in the display requirement information Data are presented in corresponding graphical styles. According to the configuration information of the "decimal place" configuration item corresponding to the field to be displayed in the display requirement information, the report data corresponding to the field can be converted to a decimal place.
  • the report configuration interface includes a report directory configuration component, so that business personnel can configure the report directory through the directory configuration component.
  • the number of horizontal levels of the directory is not limited, and the number of vertical levels is limited to 2.
  • the configuration system can obtain the report directory based on the configuration operation triggered by the directory configuration component, and save the report data according to the report directory, so that business personnel can easily find the report data according to the report directory.
  • the report configuration interface may include a report description configuration component for business personnel to configure report descriptions through the report description configuration component.
  • the report description may be used to describe the purpose, source, etc. of the report.
  • the configuration system can obtain the report description based on the configuration operation triggered by the report description configuration component, and save and display it together with the report data, so that business personnel can understand the purpose and source of the report when viewing the report.
  • the target data table is obtained by importing the business data records obtained according to the statistical calculation of each native field in the preset table structure into the preset table structure; the report configuration information based on the configuration of the report configuration interface is obtained, wherein the report Configuration information includes access requirement information and display requirement information configured for each configurable field in the report configuration interface.
  • the configurable fields are native fields or custom fields that perform formula operations on native fields; convert the access requirement information into targets Structured query statement, and use the target structured query statement to query the target data table to obtain the report data; display the report data according to the display rules defined by the display requirement information.
  • the target data table is obtained by pre-defining the table structure and pre-statistically calculating the data import table structure, so that business personnel can obtain data from the data table according to the required dimensions and indicators, that is, realize self-service data retrieval for business personnel; by setting the visualization
  • the report configuration interface is for business personnel to configure reports visually, and then convert the information configured by business personnel into structured query statements to query data tables and automatically draw reports, realizing the visual report configuration of business personnel. That is to say, this embodiment provides a self-service visual report configuration solution, which can realize the self-service retrieval of data by business personnel, no longer need to ask developers for requirements, and there is no release process for developers, which greatly improves the business personnel.
  • Data retrieval efficiency, and the visual configuration interface enables business personnel to complete report configuration by themselves without mastering complex structured query statements, and quickly generate report display pages without manually drawing reports.
  • step S30 the step of converting the access demand information into the target structured query statement in step S30 includes:
  • Step S301 obtaining the first dimension field and index field in the access demand information, wherein the first dimension field is a field configured as a dimension type that needs to be expanded in each of the configurable fields, and the index The field is a field configured as an indicator type in each of the configurable fields;
  • the access requirement information includes the field configured as the dimension type that needs to be expanded among the configurable fields, that is, the first dimension field, and the field configured as the index type among the configurable fields, that is, the index field.
  • the configuration system can obtain the first dimension field and the index field from the access requirement information.
  • Step S302 add an aggregation function to the index field according to the summarization method corresponding to the first dimension field in the data access requirement information, and use the first dimension field and the index field added with the aggregation function as selection fields , and using the first dimension field as a grouping field;
  • the configuration system can use the first dimension field as a grouping field, that is, the field after group by.
  • the configuration system may use the grouping order of each first dimension field in the access requirement information as the arrangement order of each grouping field after the group by.
  • the configuration system uses the first dimension field and the indicator field with the aggregation function added as the selection field, that is, the field after select.
  • the configuration system may also use the display order of each first dimension field and index field in the access requirement information as the arrangement order of each selection field after select.
  • Step S303 generating a target structured query statement for the target data table according to the selection field and the grouping field.
  • the configuration system generates a target structured query statement for the target data table according to the selection field and the grouping field.
  • the selection field and the grouping field can be filled into the template of the structured query statement, that is, the selection field of select from the name of the target data table group by grouping field is filled.
  • the step of converting the fetching requirement information into the target structured query statement in the step S301 further includes:
  • Step S304 using the target field as a filter field, and generating a conditional statement in the target structured query statement according to the filter condition and the filter field.
  • the configuration system can use the target field as the filter field, and generate the conditional statement in the target structured query statement (the statement after where ), that is, to fill the generated conditional statement into the target structured query statement.
  • the target field can be any field in the configurable fields.
  • the step of converting the fetching requirement information into the target structured query statement in the step S301 further includes:
  • Step S305 obtaining the dimension fields to be sorted in the sorting requirement information and the sorting priority of each of the dimension fields to be sorted, wherein the dimension fields to be sorted are configured to be sorted in each of the first dimension fields field;
  • the configuration system may acquire the dimension fields to be sorted and the sorting priority of each sorting dimension field in the sorting requirement information.
  • the dimension fields to be sorted are the fields configured to be sorted among the first dimension fields.
  • the configuration system may use the configuration information of each first dimension field in the configuration item "sorting method" as sorting requirement information.
  • Step S306 using each dimension to be sorted as a sorting field and organizing the order of each sorting field according to the sorting priority, so as to generate a sorting statement in the target structured query statement.
  • the configuration system takes each dimension field to be sorted as the sorting field (that is, the field after order by), and organizes the order of each sorting field according to the sorting priority, so as to generate the sorting statement in the target structured query statement.
  • the sorting fields with high priority can be ranked in front, and the sorting fields with low priority can be sorted in the back, and the sorting statement can be sorted by order by and the sorting fields arranged in the order of priority at the back.
  • the step S40 includes:
  • Step S401 obtain header names and display order respectively corresponding to the first dimension field, the index field and the second dimension field in the display requirement information, wherein the second dimension field is the configurable The field configured as the dimension type that needs to be collapsed;
  • the display requirement information may include the first dimension field and index field, and also includes the field configured as the dimension type that needs to be collapsed in each configurable field, that is, the second dimension field, and also includes the first dimension field, index field, and second dimension field.
  • the header name and display order corresponding to the two-dimensional fields can be used as the header name;
  • the configuration items of the configurable fields can also include "display order", which allows business personnel to configure the order of each field in the table (for example, the order from left to right) , the configuration system can determine the display order of each field according to the configuration information of the first dimension field, index field and second dimension field in the configuration item "Display Order".
  • Step S402 arrange the header names according to the display order and display them as headers, and use the report data corresponding to the first dimension field and the indicator field in the report data as the corresponding header names
  • the column data of , and the expansion control corresponding to each row is displayed under the header name corresponding to the second dimension field.
  • the configuration system displays the header names in the display order as the headers in the table, and displays the report data corresponding to the first dimension field and indicator field in the report data as the column data under the corresponding header names. Since the second dimension field is not queried as a selection field in the structured query statement, there is no data grouped by the second dimension field in the report data. At this time, the configuration system can be configured under the header name corresponding to the second dimension field Display the expansion control corresponding to each row. The expansion control is used for business personnel to view the data when the second dimension field is expanded in the corresponding row.
  • the data of the row where the expansion control is located is used as the query object, and the second dimension field is used as the grouping field to query to obtain the row data when expanded under the second dimension field.
  • category data For example, the first dimension field includes the date, the second dimension field includes the city, and the indicator includes the click-through rate.
  • the display table shows the click-through rate of each day, and does not specifically display the clicks of each city every day. Rate; when the expand control of a certain day under the header name "City" is triggered to display the command, it will expand to display the click-through rate of each city on that day.
  • the expand control can be converted into a collapse control after being triggered, and when the configuration system detects a collapse command triggered based on the collapse control, the data of each category expanded by the second dimension field is configured according to the second dimension field
  • the collapsing method is summarized. If the collapsing method is summing, the data of each category will be summed. If the collapsing method is averaging, the data of each category will be averaged. For example, when the click-through rates of various cities on a certain day that are expanded and displayed are collected according to the summing method, the sum of the click-through rates of each city on that day will be displayed; Collapse When collapsed, the average click-through rate for each city on that day will be displayed.
  • the step S30 includes:
  • Step S307 acquiring a custom structured query statement input based on the report configuration interface
  • input controls for business personnel to input custom structured query statements can be set, and the configuration system can obtain the custom structured query statements input by business personnel from the input controls.
  • business personnel can customize a statement for obtaining all table fields, such as select * from rep_wcz_d, where rep_wcz_d is an example of the name of the target data table.
  • You can also define a statement to obtain some table fields, such as select wd_date, kaihu_channel, kaihu_user, xiadan_user from rep_wcz_d, where wd_date, kaihu_channel, kaihu_user, xiadan_user are examples of table fields.
  • Step S308 converting the access requirement information into a filling part in the self-defined structured query statement, so as to use the filling part to fill the self-defined structured query statement to obtain a target structured query statement;
  • the filling part may include a selection field, a conditional statement, a grouping field, a sorting field, etc.
  • the specific implementation manner of converting the access requirement information into the filling part may refer to the above-mentioned second embodiment, which will not be described in detail here.
  • Step S309 when the target structured query statement carries a predefined keyword, determine the replacement word corresponding to the keyword according to the preset keyword replacement rule, and use the replacement word to replace the keyword to obtain Standard structured query statement;
  • Step S310 using the standard structured query statement to query the target data table to obtain report data.
  • Some keywords can be defined in advance for business personnel to use, and the replacement rules corresponding to each keyword can be set in advance.
  • Business personnel can use keywords in custom structured query statements, such as replacing some time and user names that cannot be determined when configuring reports and other information. If the business personnel use keywords in the custom structured query statement, then the target structured query statement will carry the keyword.
  • the configuration system can detect whether a keyword is carried in the target structured query statement through string matching; if so, it will determine the replacement word corresponding to the keyword according to the preset keyword replacement rules, and use the replacement word to replace the target structured query statement.
  • keywords in the query statement a standard structured query statement that can be used to query the target database can be obtained. After obtaining the standard structured query statement, the standard structured query statement can be used to query the target data table to obtain the report data.
  • step S309 includes:
  • Step S3091 when the target structured query statement carries a predefined time keyword, calculate the relative time relative to the current time according to the current time and the preset relative time definition corresponding to the time keyword, Using the relative time as the replacement word corresponding to the time keyword;
  • the time keyword can be defined in advance, and the relative time definition corresponding to the time keyword can be set.
  • the relative time definition refers to the time relative to the current time, such as yesterday, the day before yesterday, and the last day of the previous month. For example, setting the time The relative time of the keyword run_date is defined as yesterday, the relative time of run_month_begin is defined as the first day of the previous month, and the relative time of the setting time keyword run_month_end is defined as the last day of the previous month.
  • the configuration system can obtain the current time, and calculate the relative time relative to the current time according to the current time and the preset relative time definition corresponding to the time keyword , using the relative time as the replacement word corresponding to the time keyword. For example, if the current time is January 2, 2021, and the time keyword is run_date, then according to the relative time definition "yesterday" corresponding to the current time and the time keyword, it can be calculated that yesterday on January 2, 2021 is 2021 1 On January 1, use January 1, 2021 as the replacement word for run_date, and replace run_date in the target structured query statement. It should be noted that when using relative time as a replacement word to replace the time keyword, you can first convert the data format of the relative time into the time format in the data table, for example, convert January 1, 2021 to 2021-01-01 .
  • Step S3092 when the target structured query statement carries a predefined username keyword, use the username of the current user as the replacement word for the username keyword.
  • Username keywords can be defined in advance, such as setting the username keyword user_name.
  • Business personnel can use the user name keyword to replace the user name in the custom structured query statement.
  • an exemplary report configuration interface is shown in FIG. 3 .
  • business personnel can configure report types, report characteristics (that is, the summary method of dimensions mentioned in the above-mentioned embodiments), report styles (that is, the display style types mentioned in the above-mentioned embodiments), table
  • report characteristics that is, the summary method of dimensions mentioned in the above-mentioned embodiments
  • report styles that is, the display style types mentioned in the above-mentioned embodiments
  • table For the number of data items (that is, the number of data items to be displayed in the table), you can enter a custom SQL statement (that is, a custom structured query statement), and you can also configure each configuration item of each configurable field and configure the report description.
  • custom SQL statement that is, a custom structured query statement
  • the date in the figure above indicates that the report type is a daily report, and the following time period indicates the date of the business personnel configuration Dimension filter conditions, "City” and “Channel” represent the dimension type fields configured by business personnel, and the "Expand/Collapse” configuration item is configured to collapse.
  • business personnel can perform secondary configuration on the “expand/collapse” configuration item of the dimension.
  • Linear graph indicates that the configured graphic style is a linear graph, and "Visitors-number of people” indicates the configured fields that need to be displayed in the graph. The following shows a linear graph and a table.
  • “Date” in the table is the display name of the date in the first dimension field
  • “City” and “Channel” are the display names of the city and channel in the second dimension field.
  • “Visit”, “Order” and “Payment” are the three parent headers
  • “Numbers”, “Click Rate” and “Conversion Rate” are the number of people and click rate respectively and the display name for the conversion rate metric field.
  • the "View SQL” control at the bottom allows business personnel to view converted standard structured query statements, and the configuration system can display standard structured query statements based on the viewing instructions triggered by this control.
  • the present application also provides a report configuration device.
  • the report configuration device includes:
  • the import module 10 is used to import each business data record obtained according to the statistical calculation of each native field in the preset table structure into the preset table structure to obtain a target data table;
  • the acquiring module 20 is configured to acquire report configuration information configured based on the report configuration interface, wherein the report configuration information includes access requirement information and display requirement information configured for each configurable field in the report configuration interface, and the configurable
  • the matching field is the native field or a custom field that performs formula operations on the native field;
  • a query module 30 configured to convert the data access requirement information into a target structured query statement, and use the target structured query statement to query in the target data table to obtain report data;
  • the display module 40 is configured to display the report data according to the display rules defined by the display requirement information.
  • query module 30 is also used for:
  • the first dimension field is a field configured as a dimension type that needs to be expanded in each of the configurable fields
  • the index field is each A field configured as an indicator type among the configurable fields
  • the first dimension field is used as a grouping field
  • a target structured query statement for the target data table is generated according to the selection field and the grouping field.
  • the query module 30 is also used for:
  • the query module 30 is further configured to:
  • the display module 40 is also used for:
  • the second dimension field is the Field configured as the dimension type that needs to be collapsed
  • header names Arrange the header names according to the display order and display them as headers, and use the report data corresponding to the first dimension field and the indicator field in the report data as the column data under the corresponding header names display, and display the expansion controls corresponding to each row under the header name corresponding to the second dimension field.
  • query module 30 is also used for:
  • the replacement word corresponding to the keyword is determined according to the preset keyword replacement rule, and the keyword is replaced by the replacement word to obtain a standard structured Check for phrases;
  • the report data is obtained by querying the target data table by using the standard structured query statement.
  • query module 30 is also used for:
  • the target structured query statement When the target structured query statement carries a predefined time keyword, calculate the relative time relative to the current time according to the current time and the preset relative time definition corresponding to the time keyword, and use the The relative time is used as the replacement word corresponding to the time keyword;
  • the target structured query statement When the target structured query statement carries a predefined username keyword, the username of the current user is used as a replacement word for the username keyword.
  • each module of the task scheduling node in the above report configuration system corresponds to each step in the above embodiment of the report configuration method, and its functions and implementation processes will not be repeated here.
  • the present application also provides a computer storage medium, on which a report configuration program is stored.
  • a report configuration program is stored.
  • the steps of the report configuration method described in any one of the above embodiments are implemented.
  • the present application also provides a computer program product, where the computer program product includes a computer program, and when the computer program is executed by a processor, the steps of the report configuration method described in any one of the above embodiments are implemented.
  • the term “comprises”, “comprises” or any other variation thereof is intended to cover a non-exclusive inclusion such that a process, method, article or system comprising a set of elements includes not only those elements, It also includes other elements not expressly listed, or elements inherent in the process, method, article, or system. Without further limitations, an element defined by the phrase “comprising a " does not preclude the presence of additional identical elements in the process, method, article or system comprising that element.
  • the methods of the above embodiments can be implemented by means of software plus a necessary general-purpose hardware platform, and of course also by hardware, but in many cases the former is better implementation.
  • the technical solution of the present application can be embodied in the form of a software product in essence or the part that contributes to the prior art, and the computer software product is stored in a storage medium as described above (such as ROM/RAM , magnetic disk, optical disk), including several instructions to enable a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in various embodiments of the present application.

Abstract

本申请涉及金融科技技术领域,公开了一种报表配置方法、装置、设备以及计算机存储介质。所述方法包括:将按照预设表结构中各原生字段统计计算得到的各条业务数据记录导入预设表结构得到目标数据表;获取基于报表配置界面配置的报表配置信息,其中,报表配置信息包括针对报表配置界面中各可配字段配置的取数需求信息和展示需求信息;将取数需求信息转换为目标结构化查询语句,并采用目标结构化查询语句在目标数据表中查询得到报表数据;按照展示需求信息定义的展示规则对报表数据进行展示。

Description

报表配置方法、装置、设备及计算机存储介质
本申请要求于2021年6月29日申请的、申请号为202110729395.9的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及金融科技(Fintech)技术领域,尤其涉及一种报表配置方法、装置、设备以及计算机存储介质。
背景技术
随着计算机技术的发展,越来越多的技术应用在金融领域,传统金融业正在逐步向金融科技转变,但由于金融行业的安全性、实时性以及稳定性等要求,也对技术提出了更高的要求。
企业经营与运作中过程中,业务人员需要更加高效便利地监控和分析业务运营数据,以便更好地了解和深度洞察业务发展中的存量及增量客户。而分析业务运营数据需要根据需求取数和制作报表,目前的方式是由业务人员将取数需求提交给开发人员,由开发人员取数后提供给业务人员,业务人员再根据获取的数据手工汇总报表。由于业务需求变化频繁、临时取数需求多、开发人员对业务需求理解存在偏差等原因,往往导致业务人员无法快速获取数据。
技术问题
本申请的主要目的在于提供一种报表配置方法、装置、设备以及计算机存储介质,旨在解决目前业务人员无法快速获取所需数据的技术问题。
技术解决方案
为实现上述目的,本申请提供一种报表配置方法,所述报表配置方法包括:
将按照预设表结构中各原生字段统计计算得到的各条业务数据记录导入所述预设表结构得到目标数据表;
获取基于报表配置界面配置的报表配置信息,其中,所述报表配置信息包括针对所述报表配置界面中各可配字段配置的取数需求信息和展示需求信息,所述可配字段是所述原生字段或对所述原生字段进行公式运算的自定义字段;
将所述取数需求信息转换为目标结构化查询语句,并采用所述目标结构化查询语句在所述目标数据表中查询得到报表数据;
按照所述展示需求信息定义的展示规则对所述报表数据进行展示。
此外,为实现上述目的,本申请还提供一种报表配置装置,所述报表配置装置包括:
导入模块,用于将按照预设表结构中各原生字段统计计算得到的各条业务数据记录导入所述预设表结构得到目标数据表;
获取模块,用于获取基于报表配置界面配置的报表配置信息,其中,所述报表配置信息包括针对所述报表配置界面中各可配字段配置的取数需求信息和展示需求信息,所述可配字段是所述原生字段或对所述原生字段进行公式运算的自定义字段;
查询模块,用于将所述取数需求信息转换为目标结构化查询语句,并采用所述目标结构化查询语句在所述目标数据表中查询得到报表数据;
展示模块,用于按照所述展示需求信息定义的展示规则对所述报表数据进行展示。
此外,为实现上述目的,本申请还提供一种报表配置设备,所述报表配置设备包括:存储器、处理器及存储在所述存储器上并可在所述处理器上运行的报表配置程序,所述报表配置程序被所述处理器执行时实现如上所述的报表配置方法的步骤。
此外,为实现上述目的,本申请还提供一种计算机存储介质,所述计算机存储介质上存储有报表配置程序,所述报表配置程序被处理器执行时实现如上所述的报表配置方法的步骤。
此外,为实现上述目的,本申请还提供计算机程序产品,所述计算机程序产品包括计算机程序,所述计算机程序被处理器执行时实现如上所述的报表配置方法的步骤。
有益效果
本申请通过将按照预设表结构中各原生字段统计计算得到的各条业务数据记录导入预设表结构得到目标数据表;获取基于报表配置界面配置的报表配置信息,其中,报表配置信息包括针对报表配置界面中各可配字段配置的取数需求信息和展示需求信息,所可配字段是原生字段或对原生字段进行公式运算的自定义字段;将取数需求信息转换为目标结构化查询语句,并采用目标结构化查询语句在目标数据表中查询得到报表数据;按照展示需求信息定义的展示规则对报表数据进行展示。通过预先定义表结构并预先统计计算数据导入表结构得到目标数据表,使得业务人员可自己根据所需维度和指标从数据表中取数,也即实现业务人员自助式取数;通过设置可视化的报表配置界面,供业务人员可视化地配置报表,再根据业务人员配置的信息转换为结构化查询语句查询数据表并自动绘制报表,实现了业务人员可视化报表配置。也即,本申请提供了一种自助式的可视化报表配置方案,能够实现业务人员自助取数,不再需要向开发人员提需求,没有了开发人员发版流程,极大地提高了业务人员的取数效率,并且可视化的配置界面使得业务人员无需掌握复杂的结构化查询语句即可自助完成报表配置,并快速生成报表展示页面,无需手动绘制报表。
附图说明
图1为本申请实施例方案涉及的报表配置设备硬件运行环境的设备结构示意图;
图2为本申请报表配置方法第一实施例的流程示意图;
图3为本申请实施例涉及的一种示例性的报表配置界面;
图4为本申请实施例涉及的一种示例性的报表展示效果图;
图5为本申请报表配置装置一实施例的功能模块示意图。
本申请目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。
本发明的实施方式
应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。
参照图1,图1为本申请实施例方案涉及的报表配置设备硬件运行环境的设备结构示意图。
本申请实施例报表配置设备可以是智能手机、PC(Personal Computer,个人计算机)、平板电脑、便携计算机等等。
如图1所示,该报表配置设备可以包括:处理器1001,例如CPU,通信总线1002,用户接口1003,网络接口1004,存储器1005。其中,通信总线1002用于实现这些组件之间的连接通信。用户接口1003可以包括显示屏(Display)、输入单元比如键盘(Keyboard),可选用户接口1003还可以包括标准的有线接口、无线接口。网络接口1004可选的可以包括标准的有线接口、无线接口(如Wi-Fi接口)。存储器1005可以是高速RAM存储器,也可以是稳定的存储器(non-volatile memory),例如磁盘存储器。存储器1005可选的还可以是独立于前述处理器1001的存储装置。
本领域技术人员可以理解,图1中示出的报表配置设备结构并不构成对报表配置设备的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。
如图1所示,作为一种计算机存储介质的存储器1005中可以包括操作系统、网络通信模块、用户接口模块以及报表配置程序。
在图1所示的终端中,网络接口1004主要用于连接后台服务器,与后台服务器进行数据通信;用户接口1003主要用于连接客户端,与客户端进行数据通信;而处理器1001可以用于调用存储器1005中存储的报表配置程序,并执行以下本申请报表配置方法各实施例所述的操作。
基于上述硬件结构,提出本申请报表配置方法的各实施例。
参照图2,图2为本申请标签生成方法第一实施例的流程示意图。
本申请实施例提供了报表配置方法的实施例,需要说明的是,虽然在流程图中示出了逻辑顺序,但是在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤。在本实施例中,报表配置方法执行主体可以是智能手机、个人计算机、服务器等设备,为便于描述,以下以配置系统执行主体进行各实施例的阐述。在本实施例中,报表配置方法包括:
步骤S10,将按照预设表结构中各原生字段统计计算得到的各条业务数据记录导入所述预设表结构得到目标数据表;
在本实施例中,为解决业务人员需要向开发人员提取数需求,开发人员取数给业务人员绘制报表,数据获取效率低的问题,提出一种自助式的可视化报表配置方案。一方面,由开发人员先按照业务逻辑建立数据库表结构,表结构中包括业务人员需要的大部分字段,以满足大部分固定需求,并利用数据仓库将原始业务数据按照表结构中的字段统计计算后导入该表结构得到数据库数据表,业务人员需要取数时即可自己根据所需维度和指标进行从数据表中取数,也即实现业务人员自助式取数;另一方面,通过设置可视化的报表配置界面,供业务人员可视化地选取维度和指标,再根据业务人员配置的信息转换为结构化查询语句查询数据表并自动绘制报表,实现了业务人员可视化报表配置。自助式的可视化报表配置方案能够实现业务人员自助取数,不再需要向开发人员提需求,没有了开发人员发版流程,极大地提高了业务人员的取数效率,并且可视化的配置界面使得业务人员无需掌握复杂的结构化查询语句即可自助完成报表配置,并快速生成报表展示页面,无需手动绘制报表。
具体地,开发人员在建立数据库表结构(或称数据模型)之前,可先定义表结构的开发规范,再按照开发规范在配置系统中建立表结构(也即预设表结构)。数据库可以是采用MySQL数据库或者是其他基于结构化查询语言的数据库。表结构中的各个字段可以是开发人员通过对业务链条进行分析得到的业务人员可能所需的字段,根据具体的业务场景不同所需的字段不同,在此不做限制。
在一实施方式中,一种开发规范的示例如下:
表名命名规范
report_业务缩写_[源表自定义部分],例:report_zhj_cust_loan_data
表字段注释规范
`product_code` int(4) comment '产品编码'
表中添加自增主键
`id` bigint(11) NOT NULL AUTO_INCREMENT COMMENT 'primary key'
表末尾添加创建时间字段
`create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP comment '创建时间'
表存储引擎
ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_bin
字段类型创建规范
时间字段varchar(32)   --类型为字符串格式2020-01-01或20200101
字符串varchar(32)   --长度根据具体情况定义
整数类型bigint(11)    --长度根据具体情况定义
小数类型  decimal(18,4) –长度根据具体情况定义
一种表结构的示例如下:
drop table  if exists funnel_daily_section;
create table funnel_daily_section(
id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
stat_datevarchar(10) not null comment'日期',
product_namevarchar(20) not null comment'产品',
first_apply_ctint(10) comment'发起人数',
first_approve_ctint(10) comment '通过人数',
first_approve_rate decimal(5,4) comment '通过率',
second_apply_ctint(10) comment'复审人数',
second_apply_rate decimal(5,4) comment'复审提交率',
second_approve_ctint(10) comment '复审通过人数',
second_approve_rate decimal(5,4) comment '复审通过率',
      PRIMARY KEY (id),
      INDEX stat_date_index (stat_date)
 )comment = '漏斗统计'
  DEFAULT CHARACTER SET = utf8
COLLATE='utf8_bin';
配置系统将原始数据按照预设表结构中的字段(以下称为原生字段)进行统计计算得到各条业务数据,将业务数据导入该预设表结构得到数据表。例如,原生字段包括“每日下单人数”,则根据原始的下单用户数据统计计算得到产品每天的下单人数。具体地,配置系统可基于Hive数据仓库统计计算,在Hadoop集群计算完成后,通过Sqoop方式将计算好的各条业务数据导入MySQL数据库。
在一实施方式中,配置系统可以设置为按照一定周期定期拉取原始数据统计计算并更新数据表。例如,按照每日、每周、每月或每年等周期拉取并计算数据,具体可以根据业务需求设置周期,以支持日报、周报、月报和年报等不同报表类型。按照周期统计和更新数据表具体可以是每个周期内的数据汇总为一条业务数据导入数据表,例如,每隔一周将一周内的数据汇总为一条业务数据导入数据表,数据表中就只呈现每周的数据;汇总方式可以是取周期内任意一天的数据进行统计计算作为该周期内的数据,或者对周期内的数据进行统计计算后再求平均作为该周期内的数据,或者其他汇总方式,具体可以根据业务需求进行设置。需要说明的是,一周的范围可以根据业务需求进行设置,例如设置周日至周六为一周,或周一至周日为一周等。
需要说明的是,根据不同的业务需求开发人员可以开发不同的表结构,提供不同的数据表供业务人员选择。
步骤S20,获取基于报表配置界面配置的报表配置信息,其中,所述报表配置信息包括针对所述报表配置界面中各可配字段配置的取数需求信息和展示需求信息,所述可配字段是所述原生字段或对所述原生字段进行公式运算的自定义字段;
在配置系统中设置报表配置界面,在报表配置界面中可设置供业务人员选择数据表的选择控件,也即业务人员需要哪个数据表里的数据就选择哪个数据表,配置系统可以将基于该选择控件选取的数据表作为目标数据表。
报表配置界面中可以设置供业务人员进行报表展示样式,报表维度和指标的配置组件,配置系统可以基于业务人员基于配置组件触发的配置操作,获取到报表配置信息,报表配置信息可以包括针对报表配置界面中各可配字段配置的取数需求信息和展示需求信息。其中,可配字段是预设表结构中的原生字段或对原生字段进行公式运算的自定义字段;公式运算可以是对原生字段进行加减乘除四则运算等,例如可以定义一个自定义字段来表示对原生字段A和B按照公式(A-B)/A计算得到的结果。进一步地,报表配置界面中可以设置供业务人员进行字段配置的字段配置组件,根据该组件业务人员可以配置报表中是否展示各个可配字段以及如何展示,配置系统根据业务人员基于该组件触发的配置操作,获取到针对各个可配字段配置的取数需求信息和展示需求信息。其中,取数需求信息可以包括需要取数的字段以及取数的条件等信息,展示需求信息可以包括需要展示的字段以及展示的方式等信息。
具体地,在一实施方式中,当配置系统确定目标数据表后,可在报表配置界面中展示字段配置组件,字段配置组件中展示目标数据表对应的预设表结构中的各个原生字段,以及各个原生字段对应的各个配置项。字段配置组件中还可展示字段的删除和添加控件,供业务人员在字段配置组件中删除已展示的字段,或者添加自定义字段;配置系统根据业务人员对某个已展示字段的删除控件的触发操作,在字段配置组件中删除该字段和该字段的配置项,根据业务人员对添加控件的触发操作在字段配置组件中新增一行字段和该字段的配置项。
在字段配置组件中展示的字段即可配字段,可配字段的配置项可包括例如表格显示、字段名、展示名称、父表头、字段类型、小数位、字段来源、展开/收拢、收拢方式、排序方式和图形显示等,在具体实施方式中根据业务需求可以更少或更多,例如,当对数据展示的小数位没有要求时,可以不设置小数位这一配置项,又如当需要帮助业务人员更好地理解字段含义及逻辑时,可以增设字段说明这一配置项。以下对各个配置项的作用进行举例说明,但在具体实施方式中,各个配置项的定义或作用也可以在以下例子的基础上进行更改:
“表格显示”用于配置该字段是否需要展示在报表中。“字段名”用于在结构化查询语句中作为字段名使用,原生字段的字段名采用预设表结构中的字段名,不可配置,自定义字段的字段名可根据需要配置。“展示名称”用于在报表中作为表头展示,原生字段的展示名称可以默认采用预设表结构中的定义的展示名称,并可修改,自定义字段的展示名称可配置。“父表头”是展示名称的上位层级,在报表中将父表头相同的指标类型的字段作为相邻列展示,只有字段类型为指标类型的字段的父表头才可配置。“字段类型”用于配置该字段的类型,可配置的字段类型包括维度类型和指标类型;若预设表结构的原生字段包括日期,则日期也可以作为一个单独的字段类型;日期类型的字段不可配置字段来源、小数位、展开/收拢、收拢方式和排序方式这几项配置项,维度类型的字段不可配置字段来源、小数位和收拢方式这几项配置项,指标类型的字段不可配置展开/收拢这一配置项。“小数位”只对字段类型为指标的字段起作用,可以配置的选项包括百分比、小数位、单位千、单位万、单位亿等;其中,选项百分比表示该字段的数据使用百分比展示,如80.12%,同时可设置百分数小数位的位数;选项小数位表示该字段的数据使用默认数据展示,同时可设置数据的小数位数;选项单位千表示该字段的数据使用默认数据除1000,同时可设置小数位的位数;选项单位万表示该字段的数据使用默认数据除10000,同时可设置小数位的位数;选项单位亿表示该字段的数据使用默认数据除10000000,同时可设置小数位的位数。“字段来源”表示可配字段的来源,原生字段的字段来源默认不可配置,自定义字段的字段来源可以配置为对原生字段进行计算的公式,例如自定义字段的字段来源定义为(A-B)/A,表示用原生字段A和B的数据按照该计算公式计算得到该自定义字段的数据;也即,业务人员可以直接从目标数据表中获取原生字段的数据,也可以获取基于原生字段的数据进行计算得到的数据,从而增加了业务人员配置报表的灵活性,也降低了开发人员开发表结构的难度。“展开/收拢”用于配置维度类型的字段在报表中展开展示还是收拢展示。“收拢方式”用于配置维度类型的字段收拢时各个类别数据的收拢方式,例如,可包括平均和求和两个选项。“排序方式”用于配置维度类型字段是否需要排序,以及排序的优先级,优先级可以采用数字表示,数字越大优先级越大。“图形显示”用于配置该字段是否需要在图形中展示。
基于对各个可配字段的各个配置项的配置操作,配置系统可以获取针对各个可配字段的取数需求信息和展示需求信息。例如:将“表格显示”配置为需要展示、“字段类型”配置为指标类型的可配字段作为取数需求信息中的指标字段,并以该可配字段的字段名来表示该指标字段。将“表格显示”配置为需要展示、“字段类型”配置为维度类型、“展开/收拢”配置为展开的可配字段作为取数需求信息中的第一维度字段,并以该可配字段的字段名来表示该第一维度字段。将“表格显示”配置为需要展示、“字段类型”配置为维度类型、“展开/收拢”配置为收拢的可配字段作为展示需求信息中的第二维度字段,并以该可配字段的字段名来表示该第二维度字段,同时展示需求信息中也包括取数需求信息中的该指标字段和该第一维度字段。取数需求信息还包括“字段来源”配置为计算公式的指标字段的该计算公式,还包括各个第一维度字段在“收拢方式”和“排序方式”这两个配置项的配置信息。展示需求信息还包括该指标字段、该第一维度字段和该第二维度字段在“展示名称”、“父表头”、“小数位”、“图形显示”这几个配置项的配置信息。若字段类型包括日期类型,则还可以将“字段类型”配置为日期类型的字段作为取数需求信息和展示需求信息中的日期字段。
步骤S30将所述取数需求信息转换为目标结构化查询语句,并采用所述目标结构化查询语句在所述目标数据表中查询得到报表数据;
在获取到取数需求信息后,配置系统可以将取数需求信息转换为结构化查询语句(以下称为目标结构化查询语句)。具体地,可以根据预先设定的各类信息转换为结构化查询语句的规则,在转换时按照该规则将各类信息转换为结构化查询语句中的各类字段和语句并进行拼接,得到目标结构化查询语句。例如,可以将取数需求信息中的日期字段作为结构化查询语句中的选择字段(也即select后面的字段)和分组字段(也即group by后面的字段),将指标字段作为结构化查询语句中的选择字段等。具体规则可以根据业务需求进行设置,在本实施例中不做限制,也不做一一列举。
在转换得到目标结构化查询语句后,配置系统可以采用目标结构化查询语句在目标数据表中查询得到报表数据。在一实施方式中,配置系统可以在检测到基于报表配置界面中触发的查询指令后,再采用转换得到的目标结构化查询语句在目标数据表中进行查询得到报表数据。可以理解的是,当目标数据表中的数据是定期更新时,不同的时间采用目标结构化查询语句查询到的报表数据是相同的。
进一步地,在一实施方式中,配置系统可以检测当前登录用户是否有目标数据表的访问权限,若有则获取预先定义的目标数据表的配置信息,根据配置信息访问数据库,通过目标结构化查询语句查找目标数据表得到报表数据。其中,配置信息包括数据库的IP地址、端口、数据库名、用户名和密码等信息。
步骤S40,按照所述展示需求信息定义的展示规则对所述报表数据进行展示。
在查询得到报表数据后,配置系统可以按照展示需求信息定义的展示规则对报表数据进行展示。可以理解的是,根据展示需求信息不同,定义的展示规则是不同的,对报表数据的展示效果是不同的。例如,在一实施方式中,展示需求信息中可以包括展示样式类型,根据业务人员在报表配置界面中的配置操作,展示样式类型包括表格样式和/或图形样式,图形样式包括线形图、柱状图、饼状图等;当表格样式包括表格样式时,配置系统可以将展示需求信息中的第一维度字段、指标字段和日期字段对应的展示名称和父表头作为表头名称进行展示,将报表数据中第一维度字段和指标字段对应的报表数据分别作为对应表头名称下的列数据进行展示;当表格样式包括图形样式时,配置系统可以根据展示需求信息中需要图形显示的字段对应的报表数据以对应的图形样式进行展示。可以根据展示需求信息中需要展示的字段对应的“小数位”配置项配置信息,对该字段对应的报表数据进行小数位转化。
进一步地,在一实施方式中,报表配置界面中包括报表目录配置组件,以供业务人员通过该目录配置组件配置报表的目录。可选地,目录横向层级数不限制,纵向层级数限制为2。配置系统可以基于该目录配置组件触发的配置操作获取报表目录,并按照该报表目录对报表数据进行保存,以便于业务人员根据报表目录方便地查找到该报表数据。
报表配置界面中可以包括报表说明配置组件,以供业务人员通过该报表说明配置组件配置报表说明,报表说明可以用于说明报表的用途、来源等等。配置系统可以基于该报表说明配置组件触发的配置操作获取报表说明,并与报表数据一起保存和展示,以便于业务人员查看报表时能够了解报表的用途、来源等信息。
在本实施例中,通过将按照预设表结构中各原生字段统计计算得到的各条业务数据记录导入预设表结构得到目标数据表;获取基于报表配置界面配置的报表配置信息,其中,报表配置信息包括针对报表配置界面中各可配字段配置的取数需求信息和展示需求信息,所可配字段是原生字段或对原生字段进行公式运算的自定义字段;将取数需求信息转换为目标结构化查询语句,并采用目标结构化查询语句在目标数据表中查询得到报表数据;按照展示需求信息定义的展示规则对报表数据进行展示。通过预先定义表结构并预先统计计算数据导入表结构得到目标数据表,使得业务人员可自己根据所需维度和指标从数据表中取数,也即实现业务人员自助式取数;通过设置可视化的报表配置界面,供业务人员可视化地配置报表,再根据业务人员配置的信息转换为结构化查询语句查询数据表并自动绘制报表,实现了业务人员可视化报表配置。也即,本实施例提供了一种自助式的可视化报表配置方案,能够实现业务人员自助取数,不再需要向开发人员提需求,没有了开发人员发版流程,极大地提高了业务人员的取数效率,并且可视化的配置界面使得业务人员无需掌握复杂的结构化查询语句即可自助完成报表配置,并快速生成报表展示页面,无需手动绘制报表。
进一步地,基于上述第一实施例,提出本申请报表配置方法第二实施例,在本实施例中,所述步骤S30中将所述取数需求信息转换为目标结构化查询语句的步骤包括:
步骤S301,获取所述取数需求信息中的第一维度字段和指标字段,其中,所述第一维度字段为各所述可配字段中被配置为需要展开的维度类型的字段,所述指标字段为各所述可配字段中被配置为指标类型的字段;
取数需求信息中包括各可配字段中被配置为需要展开的维度类型的字段,也即第一维度字段,还包括各可配字段中被配置为指标类型的字段,也即指标字段。配置系统可以从取数需求信息中获取第一维度字段和指标字段。
步骤S302,按照所述取数需求信息中所述第一维度字段对应的汇总方式对所述指标字段添加聚合函数,将所述第一维度字段和添加了聚合函数的所述指标字段作为选择字段,以及将所述第一维度字段作为分组字段;
配置系统可以将第一维度字段作为分组字段,也即group by后面的字段。具体地,配置系统可以按照取数需求信息中各个第一维度字段的分组顺序作为各个分组字段在group by后面的排列顺序。配置系统按照取数需求信息中第一维度字段的汇总方式对指标字段添加聚合函数。例如,若汇总方式是求和则对指标字段添加sum函数,得到sum(指标字段);若汇总方式是求平均则对指标字段对应的选择字段添加avg函数,得到avg(指标字段)。配置系统将第一维度字段和添加了聚合函数的指标字段作为选择字段,也即select后面的字段。可选地,配置系统还可以按照取数需求信息中各个第一维度字段和指标字段的展示顺序作为各个选择字段在select后面的排列顺序。
步骤S303,根据所述选择字段和所述分组字段生成针对所述目标数据表的目标结构化查询语句。
配置系统根据选择字段和分组字段生成针对目标数据表的目标结构化查询语句。具体地,可以将选择字段和分组字段填充到结构化查询语句的模板中,也即,填充得到select 选择字段 from 目标数据表表名 group by 分组字段。
进一步地,在一实施方式中,所述步骤S301中将所述取数需求信息转换为目标结构化查询语句的步骤还包括:
步骤S304,将所述目标字段作为筛选字段,并根据所述过滤条件和所述筛选字段生成所述目标结构化查询语句中的条件语句。
当取数需求信息中还包括对目标字段的过滤条件时,配置系统可以将目标字段作为筛选字段,并根据该过滤条件和该筛选字段生成目标结构化查询语句中的条件语句(where后面的语句),也即将生成的条件语句填充到目标结构化查询语句中。其中,目标字段可以是可配字段中的任意字段。具体根据过滤条件和筛选字段生成条件语句的具体方法可以参照结构化查询语句的条件语句语法,在本实施例中不做赘述。
进一步地,在一实施方式中,所述步骤S301中将所述取数需求信息转换为目标结构化查询语句的步骤还包括:
步骤S305,获取所述排序需求信息中的待排序维度字段和各所述待排序维度字段的排序优先级,其中,所述待排序维度字段为各所述第一维度字段中被配置为需要排序的字段;
当取数需求信息还包括针对各第一维度字段配置的排序需求信息时,配置系统可以获取排序需求信息中的待排序维度字段和各排序维度字段的排序优先级。其中,待排序维度字段为各个第一维度字段中被配置为需要排序的字段。在一实施方式中,配置系统可以将各第一维度字段在“排序方式”这一配置项的配置信息作为排序需求信息。
步骤S306,将各所述待排序维度作为排序字段并按照所述排序优先级组织各所述排序字段的顺序,以生成所述目标结构化查询语句中的排序语句。
配置系统将各待排序维度字段作为排序字段(也即order by后面的字段),并按照排序优先级组织各排序字段的顺序,以生成目标结构化查询语句中的排序语句。具体地,可以根据排序优先级将优先级高的排序字段排在前面,将优先级低的排序字段排在后面,由order by以及后面按照优先级顺序排列的排序字段即排序语句,将排序语句填充到目标结构化查询语句中。
进一步地,在一实施方式中,当展示需求信息中的报表样式类型包括表格样式时,所述步骤S40包括:
步骤S401,获取所述展示需求信息中所述第一维度字段、所述指标字段和第二维度字段分别对应的表头名称和展示顺序,其中,所述第二维度字段为各所述可配字段中被配置为需要收拢的维度类型的字段;
展示需求信息中可包括第一维度字段和指标字段,还包括各可配字段中被配置为需要收拢的维度类型的字段,也即第二维度字段,还包括第一维度字段、指标字段和第二维度字段分别对应的表头名称和展示顺序。其中,可以将展示名称和父表头作为表头名称;可配字段的配置项还可以包括“展示顺序”,供业务人员配置各个字段在表格中的顺序(例如从左到右排列的顺序),配置系统可以根据第一维度字段、指标字段和第二维度字段在“展示顺序”这一配置项的配置信息确定各个字段的展示顺序。
步骤S402,将所述表头名称按照所述展示顺序排列后作为表头进行展示,将所述报表数据中所述第一维度字段和所述指标字段对应的报表数据分别作为对应表头名称下的列数据进行展示,并在所述第二维度字段对应的表头名称下展示各行对应的展开控件。
配置系统将表头名称按照展示顺序排列后作为表格中的表头进行展示,将报表数据中第一维度字段和指标字段对应的报表数据分别作为对应表头名称下的列数据进行展示。由于第二维度字段并没有作为结构化查询语句中的选择字段进行查询,所以报表数据中没有按照第二维度字段分组的数据,此时,配置系统可以在第二维度字段对应的表头名称下展示各行对应的展开控件,展开控件用于供业务人员查看该第二维度字段在对应行展开时的数据。当配置系统检测到基于展开控件触发的展开指令时,以该展开控件所在行的数据作为查询对象,以该第二维度字段作为分组字段查询得到该行数据在该第二维度字段下展开时各个类别的数据。例如,第一维度字段包括日期,第二维度字段包括城市,指标包括点击率,在城市维度收拢的情况下,展示表格中展示的是每一天的点击率,没有具体展示每天各个城市分别的点击率;当“城市”这一表头名称下某一天的展开控件被触发展示指令时,将展开展示该天各个城市的点击率。进一步地,展开控件在被触发后可以转换为收拢控件,当配置系统检测到基于收拢控件触发的收拢指令时,将该第二维度字段展开的各个类别的数据按照该第二维度字段被配置的收拢方式进行汇总,若收拢方式为求和则将各个类别的数据进行求和,若收拢方式为求平均则将各个类别的数据进行求平均。例如,当将展开展示的某天各个城市的点击率按照求和的收拢方式收拢后,将展示该天各个城市的点击率和;当将展开展示的某天各个城市的点击率按照求平均的收拢方式收拢后,将展示该天各个城市的平均点击率。
进一步地,基于上述第一和/或第二实施例,提出本申请报表配置方法第三实施例,在本实施例中,所述步骤S30包括:
步骤S307,获取基于所述报表配置界面输入的自定义结构化查询语句;
报表配置界面中可以设置供业务人员输入自定义结构化查询语句的输入控件,配置系统可以从输入控件中获取业务人员输入的自定义结构化查询语句。例如,业务人员可以自定义获取全部表字段的语句,例如select * from rep_wcz_d,其中,rep_wcz_d是目标数据表表名的示例。还可以定义获取部分表字段的语句,例如select wd_date,kaihu_channel,kaihu_user,xiadan_user from rep_wcz_d,其中,wd_date,kaihu_channel,kaihu_user,xiadan_user是表字段的示例。
步骤S308,将所述取数需求信息转换为所述自定义结构化查询语句中的填充部分,以采用所述填充部分对所述自定义结构化查询语句进行填充得到目标结构化查询语句;
将取数需求信息转换为自定义结构化查询语句中的填充部分,以采用填充部分对自定义结构化查询语句中进行填充得到目标结构化查询语句。具体地,填充部分可以包括选择字段、条件语句、分组字段、排序字段等,将取数需求信息转换为填充部分的具体实施方式可以参照上述第二实施例,在此不做详细赘述。
步骤S309,当所述目标结构化查询语句中携带有预先定义的关键字时,按照预设的关键字替换规则确定所述关键字对应的替换字,采用所述替换字替换所述关键字得到标准结构化查询语句;
步骤S310,采用所述标准结构化查询语句在所述目标数据表中查询得到报表数据。
预先可以定义一些关键字供业务人员使用,并预先设置各个关键字对应的替换规则,业务人员可以在自定义结构化查询语句中使用关键字,例如代替一些配置报表时无法确定的时间和用户名等信息。若业务人员在自定义结构化查询语句中使用了关键字,那么目标结构化查询语句会携带有关键字。配置系统可以通过字符串匹配的方式检测目标结构化查询语句中是否携带有关键字;若有,则按照预先设置的关键字替换规则确定该关键字对应的替换字,采用替换字替换目标结构化查询语句中的关键字后,即可得到能够用于查询目标数据库的标准结构化查询语句。在得到标准结构化查询语句后,可采用标准结构化查询语句在目标数据表中查询得到报表数据。
进一步地,在一实施方式中,所述步骤S309包括:
步骤S3091,当所述目标结构化查询语句中携带有预先定义的时间关键字时,根据当前时间和所述时间关键字对应预设的相对时间定义计算得到相对于所述当前时间的相对时间,采用所述相对时间作为所述时间关键字对应的替换字;
预先可以定义时间关键字,并设置该时间关键字对应的相对时间定义,其中,相对时间定义是指昨天、前天、上个月最后一天这种相对于当前时间而言的时间,例如,设置时间关键字run_date的相对时间定义为昨天,run_month_begin的相对时间定义为上个月的第一天,设置时间关键字run_month_end的相对时间定义为上个月的最后一天。业务人员可以在自定义结构化查询语句中使用时间关键字代替时间,例如,select * from rep_wcz_d where kpi_date='${run_date}'表示想要获取昨天的数据。当目标结构化查询语句中携带有预先定义的时间关键字时,配置系统可以获取当前时间,并根据当前时间和该时间关键字对应预设的相对时间定义计算得到相对于该当前时间的相对时间,采用该相对时间作为时间关键字对应的替换字。例如,当前时间为2021年1月2日,时间关键字为run_date,则根据当前时间和该时间关键字对应的相对时间定义“昨天”可计算得到2021年1月2日的昨天为2021年1月1日,将2021年1月1日作为run_date的替换字,并替换掉目标结构化查询语句中的run_date。需要说明的是,在将相对时间作为替换字替换时间关键字时,可先将相对时间的数据格式转换为数据表中的时间格式,例如将2021年1月1日转换为2021-01-01。
步骤S3092,当所述目标结构化查询语句中携带有预先定义的用户名关键字时,采用当前用户的用户名作为所述用户名关键字的替换字。
预先可以定义用户名关键字,例如设置用户名关键字user_name。业务人员可以在自定义结构化查询语句中使用用户名关键字来代替用户名。例如,当业务人员想要限制用户查看报表中数据的权限时,预先可以在配置系统中设置一张定义用户名的维度表,并通过在预设表结构中增设一个id字段来连接该维度表,表示各个用户对各行数据的查看权限;业务人员可以编写自定义结构化查询语句限制只有当数据表中的数据有被当前用户的查看权限时,才将该数据查询出作为报表数据展示,例如,自定义限制权限的查询语句为:select A.wd_date,A.kaihu_channel,A.kaihu_user,A.xiadan_user from rep_wcz_d as A join channel_user as B where A.id=B.id and user_id=${user_name} ,其中rep_wcz_d表示目标数据表,channel_user表示用户名维度表。当目标结构化查询语句中携带有用户名关键字时,采用当前用户的用户名作为用户名关键字的替换字,并采用替换字替换目标结构化查询语句中的该用户名关键字,得到标准结构化查询语句。
进一步地,在一实施方式中,如图3所示为一种示例性的报表配置界面。在该报表配置界面中,业务人员可以配置报表类型、报表特性(也即上述实施例中提到的维度的汇总方式)、报表样式(也即上述实施例中提到的展示样式类型)、表格数据条数(也即表格中需要展示的数据条数),可以输入自定义的SQL语句(也即自定义结构化查询语句),还可以配置各个可配字段的各个配置项,配置报表说明。
进一步地,在一实施方式中,如图4所示为一种示例性的报表展示效果图,图中上面的按日即表示该报表类型为日报,后面的时间段表示业务人员配置的对日期维度的过滤条件,“城市”和“渠道”表示业务人员配置的维度类型的字段,且“展开/收拢”配置项被配置为收拢。在该界面中,业务人员可以对维度的“展开/收拢”配置项进行二次配置。“线性图”表示配置的图形样式为线性图,“访问-人数”表示配置的需要在图形中展示的字段。下面展示的是线性图和表格,表格中的“日期”是第一维度字段日期的展示名称,“城市”和“渠道”是第二维度字段城市和渠道的展示名称,对应的表头名称下在各行展示了“全部”字样的展开控件,“访问”、“下单”和“支付”是三个父表头,“人数”、“点击率”和“转化率”分别是人数、点击率和转化率指标字段的展示名称。最下方的“查看SQL”控件可供业务人员查看转换得到的标准结构化查询语句,配置系统可以根据基于该控件的触发的查看指令展示标准结构化查询语句。
进一步地,本申请还提供一种报表配置装置,参照图5,所述报表配置装置包括:
导入模块10,用于将按照预设表结构中各原生字段统计计算得到的各条业务数据记录导入所述预设表结构得到目标数据表;
获取模块20,用于获取基于报表配置界面配置的报表配置信息,其中,所述报表配置信息包括针对所述报表配置界面中各可配字段配置的取数需求信息和展示需求信息,所述可配字段是所述原生字段或对所述原生字段进行公式运算的自定义字段;
查询模块30,用于将所述取数需求信息转换为目标结构化查询语句,并采用所述目标结构化查询语句在所述目标数据表中查询得到报表数据;
展示模块40,用于按照所述展示需求信息定义的展示规则对所述报表数据进行展示。
进一步地,所述查询模块30还用于:
获取所述取数需求信息中的第一维度字段和指标字段,其中,所述第一维度字段为各所述可配字段中被配置为需要展开的维度类型的字段,所述指标字段为各所述可配字段中被配置为指标类型的字段;
按照所述取数需求信息中所述第一维度字段对应的汇总方式对所述指标字段添加聚合函数,将所述第一维度字段和添加了聚合函数的所述指标字段作为选择字段,以及将所述第一维度字段作为分组字段;
根据所述选择字段和所述分组字段生成针对所述目标数据表的目标结构化查询语句。
进一步地,当所述取数需求信息还包括对目标字段的过滤条件时,所述查询模块30还用于:
将所述目标字段作为筛选字段,并根据所述过滤条件和所述筛选字段生成所述目标结构化查询语句中的条件语句。
进一步地,当所述取数需求信息还包括针对各所述第一维度字段配置的排序需求信息时,所述查询模块30还用于:
获取所述排序需求信息中的待排序维度字段和各所述待排序维度字段的排序优先级,其中,所述待排序维度字段为各所述第一维度字段中被配置为需要排序的字段;
将各所述待排序维度作为排序字段并按照所述排序优先级组织各所述排序字段的顺序,以生成所述目标结构化查询语句中的排序语句。
进一步地,当所述展示需求信息中的展示样式类型包括表格样式时,所述展示模块40还用于:
获取所述展示需求信息中所述第一维度字段、所述指标字段和第二维度字段分别对应的表头名称和展示顺序,其中,所述第二维度字段为各所述可配字段中被配置为需要收拢的维度类型的字段;
将所述表头名称按照所述展示顺序排列后作为表头进行展示,将所述报表数据中所述第一维度字段和所述指标字段对应的报表数据分别作为对应表头名称下的列数据进行展示,并在所述第二维度字段对应的表头名称下展示各行对应的展开控件。
进一步地,所述查询模块30还用于:
获取基于所述报表配置界面输入的自定义结构化查询语句;
将所述取数需求信息转换为所述自定义结构化查询语句中的填充部分,以采用所述填充部分对所述自定义结构化查询语句进行填充得到目标结构化查询语句;
当所述目标结构化查询语句中携带有预先定义的关键字时,按照预设的关键字替换规则确定所述关键字对应的替换字,采用所述替换字替换所述关键字得到标准结构化查询语句;
采用所述标准结构化查询语句在所述目标数据表中查询得到报表数据。
进一步地,所述查询模块30还用于:
当所述目标结构化查询语句中携带有预先定义的时间关键字时,根据当前时间和所述时间关键字对应预设的相对时间定义计算得到相对于所述当前时间的相对时间,采用所述相对时间作为所述时间关键字对应的替换字;
当所述目标结构化查询语句中携带有预先定义的用户名关键字时,采用当前用户的用户名作为所述用户名关键字的替换字。
其中,上述报表配置系统中任务调度节点的各个模块的功能实现,与上述报表配置方法实施例中各步骤相对应,其功能和实现过程在此处不再一一赘述。
本申请还提供一种计算机存储介质,该计算机存储介质上存储有报表配置程序,所述报表配置程序被处理器执行时实现如以上任一项实施例所述的报表配置方法的步骤。
本申请计算机存储介质的具体实施例与上述报表配置方法各实施例基本相同,在此不作赘述。
本申请还提供一种计算机程序产品,所述计算机程序产品包括计算机程序,所述计算机程序被处理器执行时实现如以上任一项实施例所述的报表配置方法的步骤。
本申请计算机存储介质的具体实施例与上述报表配置方法各实施例基本相同,在此不作赘述。
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者系统不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者系统所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者系统中还存在另外的相同要素。
上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在如上所述的一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本申请各个实施例所述的方法。
以上仅为本申请的优选实施例,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本申请的专利保护范围内。

Claims (10)

  1. 一种报表配置方法,其中,所述报表配置方法包括:
    将按照预设表结构中各原生字段统计计算得到的各条业务数据记录导入所述预设表结构得到目标数据表;
    获取基于报表配置界面配置的报表配置信息,其中,所述报表配置信息包括针对所述报表配置界面中各可配字段配置的取数需求信息和展示需求信息,所述可配字段是所述原生字段或对所述原生字段进行公式运算的自定义字段;
    将所述取数需求信息转换为目标结构化查询语句,并采用所述目标结构化查询语句在所述目标数据表中查询得到报表数据;
    按照所述展示需求信息定义的展示规则对所述报表数据进行展示。
  2. 如权利要求1所述的报表配置方法,其中,所述将所述取数需求信息转换为目标结构化查询语句的步骤包括:
    获取所述取数需求信息中的第一维度字段和指标字段,其中,所述第一维度字段为各所述可配字段中被配置为需要展开的维度类型的字段,所述指标字段为各所述可配字段中被配置为指标类型的字段;
    按照所述取数需求信息中所述第一维度字段对应的汇总方式对所述指标字段添加聚合函数,将所述第一维度字段和添加了聚合函数的所述指标字段作为选择字段,以及将所述第一维度字段作为分组字段;
    根据所述选择字段和所述分组字段生成针对所述目标数据表的目标结构化查询语句。
  3. 如权利要求1所述的报表配置方法,其中,当所述取数需求信息还包括对目标字段的过滤条件时,所述将所述取数需求信息转换为目标结构化查询语句的步骤还包括:
    将所述目标字段作为筛选字段,并根据所述过滤条件和所述筛选字段生成所述目标结构化查询语句中的条件语句。
  4. 如权利要求1所述的报表配置方法,其中,当所述取数需求信息还包括针对各所述第一维度字段配置的排序需求信息时,所述将所述取数需求信息转换为目标结构化查询语句的步骤还包括:
    获取所述排序需求信息中的待排序维度字段和各所述待排序维度字段的排序优先级,其中,所述待排序维度字段为各所述第一维度字段中被配置为需要排序的字段;
    将各所述待排序维度作为排序字段并按照所述排序优先级组织各所述排序字段的顺序,以生成所述目标结构化查询语句中的排序语句。
  5. 如权利要求2至4中任一项所述的报表配置方法,其中,当所述展示需求信息中的展示样式类型包括表格样式时,所述按照所述展示需求信息定义的展示规则对所述报表数据进行展示的步骤包括:
    获取所述展示需求信息中所述第一维度字段、所述指标字段和第二维度字段分别对应的表头名称和展示顺序,其中,所述第二维度字段为各所述可配字段中被配置为需要收拢的维度类型的字段;
    将所述表头名称按照所述展示顺序排列后作为表头进行展示,将所述报表数据中所述第一维度字段和所述指标字段对应的报表数据分别作为对应表头名称下的列数据进行展示,并在所述第二维度字段对应的表头名称下展示各行对应的展开控件。
  6. 如权利要求1至4中任一项所述的报表配置方法,其中,所述将所述取数需求信息转换为目标结构化查询语句,并采用所述目标结构化查询语句在所述目标数据表中查询得到报表数据的步骤包括:
    获取基于所述报表配置界面输入的自定义结构化查询语句;
    将所述取数需求信息转换为所述自定义结构化查询语句中的填充部分,以采用所述填充部分对所述自定义结构化查询语句进行填充得到目标结构化查询语句;
    当所述目标结构化查询语句中携带有预先定义的关键字时,按照预设的关键字替换规则确定所述关键字对应的替换字,采用所述替换字替换所述关键字得到标准结构化查询语句;
    采用所述标准结构化查询语句在所述目标数据表中查询得到报表数据。
  7. 如权利要求6所述的报表配置方法,其中,所述当所述目标结构化查询语句中携带有预先定义的关键字时,按照预设的关键字替换规则确定所述关键字对应的替换字的步骤包括:
    当所述目标结构化查询语句中携带有预先定义的时间关键字时,根据当前时间和所述时间关键字对应预设的相对时间定义计算得到相对于所述当前时间的相对时间,采用所述相对时间作为所述时间关键字对应的替换字;
    当所述目标结构化查询语句中携带有预先定义的用户名关键字时,采用当前用户的用户名作为所述用户名关键字的替换字。
  8. 一种报表配置装置,其中,所述报表配置装置包括:
    导入模块,用于将按照预设表结构中各原生字段统计计算得到的各条业务数据记录导入所述预设表结构得到目标数据表;
    获取模块,用于获取基于报表配置界面配置的报表配置信息,其中,所述报表配置信息包括针对所述报表配置界面中各可配字段配置的取数需求信息和展示需求信息,所述可配字段是所述原生字段或对所述原生字段进行公式运算的自定义字段;
    查询模块,用于将所述取数需求信息转换为目标结构化查询语句,并采用所述目标结构化查询语句在所述目标数据表中查询得到报表数据;
    展示模块,用于按照所述展示需求信息定义的展示规则对所述报表数据进行展示。
  9. 一种报表配置设备,其中,所述报表配置设备包括:存储器、处理器及存储在所述存储器上并可在所述处理器上运行的报表配置程序,所述报表配置程序被所述处理器执行时实现如权利要求1至7中任一项所述的报表配置方法的步骤。
  10. 一种计算机存储介质,其中,所述计算机存储介质上存储有报表配置程序,所述报表配置程序被处理器执行时实现如权利要求1至7中任一项所述的报表配置方法的步骤。
PCT/CN2021/127616 2021-06-29 2021-10-29 报表配置方法、装置、设备及计算机存储介质 WO2023273073A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110729395.9 2021-06-29
CN202110729395.9A CN113342821B (zh) 2021-06-29 2021-06-29 报表配置方法、装置、设备及计算机存储介质

Publications (1)

Publication Number Publication Date
WO2023273073A1 true WO2023273073A1 (zh) 2023-01-05

Family

ID=77481410

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/127616 WO2023273073A1 (zh) 2021-06-29 2021-10-29 报表配置方法、装置、设备及计算机存储介质

Country Status (2)

Country Link
CN (1) CN113342821B (zh)
WO (1) WO2023273073A1 (zh)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116048985A (zh) * 2023-01-10 2023-05-02 睿智合创(北京)科技有限公司 一种决策数据即测即看结果报表方法
CN116611412A (zh) * 2023-07-20 2023-08-18 云筑信息科技(成都)有限公司 一种基于Excel模版与前端交互的报表填报和展示方法
CN116781550A (zh) * 2023-08-23 2023-09-19 北京赢科天地电子有限公司 数据采集的实现方法、系统及设备
CN116781789A (zh) * 2023-05-09 2023-09-19 天云融创数据科技(北京)有限公司 一种api服务生成方法及装置
CN117215455A (zh) * 2023-09-25 2023-12-12 中科院成都信息技术股份有限公司 报表计算公式生成方法、装置、计算机设备及存储介质

Families Citing this family (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113342821B (zh) * 2021-06-29 2023-04-07 深圳前海微众银行股份有限公司 报表配置方法、装置、设备及计算机存储介质
CN113486050A (zh) * 2021-09-08 2021-10-08 北京轻松筹信息技术有限公司 报表生成的方法、装置、电子设备和可读存储介质
CN113822028A (zh) * 2021-09-28 2021-12-21 重庆允成互联网科技有限公司 一种实现多个离散指标聚合的报表及报表配置方法
CN113918996B (zh) * 2021-11-24 2024-03-26 企查查科技股份有限公司 分布式数据处理方法、装置、计算机设备和存储介质
CN114416832B (zh) * 2022-01-26 2022-11-15 重庆允丰科技有限公司 一种公式字段、报表的配置方法及计算机存储介质
CN114743384B (zh) * 2022-03-25 2024-03-08 京东方科技集团股份有限公司 报警方法及装置
CN114548062B (zh) * 2022-04-27 2022-08-02 成都瑞华康源科技有限公司 一种报表编排方法
CN114970473A (zh) * 2022-06-08 2022-08-30 河北平普数政科技有限公司 一种基于财务用户报表制作的自行配置报表取数方法
CN115544130A (zh) * 2022-11-30 2022-12-30 广州天维信息技术股份有限公司 业绩报表生成方法、装置、存储介质及计算机设备
CN116561132B (zh) * 2023-07-06 2023-12-22 深圳市明源云科技有限公司 业务数据查询方法、电子设备及可读存储介质
CN116578754B (zh) * 2023-07-13 2023-11-03 杭州之数科技有限公司 一种企业数据精确查询方法及系统

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150324423A1 (en) * 2012-11-26 2015-11-12 Zte Corporation Report creation method, device and system
CN108984506A (zh) * 2018-08-01 2018-12-11 北京中电普华信息技术有限公司 一种可配置的智能报表的生成方法及装置
CN110597842A (zh) * 2019-07-22 2019-12-20 石化盈科信息技术有限责任公司 业务数据查询方法及系统
CN110717319A (zh) * 2019-09-24 2020-01-21 车智互联(北京)科技有限公司 一种自助报表生成方法、装置、计算设备和系统
CN111158795A (zh) * 2019-12-24 2020-05-15 深圳壹账通智能科技有限公司 报表生成方法、装置、介质及电子设备
CN113342821A (zh) * 2021-06-29 2021-09-03 深圳前海微众银行股份有限公司 报表配置方法、装置、设备及计算机存储介质

Family Cites Families (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103744891B (zh) * 2013-12-23 2017-10-10 大唐软件技术股份有限公司 一种数据查询方法和系统
CN104063361B (zh) * 2014-07-04 2017-09-29 用友网络科技股份有限公司 报表设计方法和报表设计系统
CN105843945A (zh) * 2016-04-08 2016-08-10 联动优势科技有限公司 一种报表生成方法及系统
CN106874247B (zh) * 2017-01-03 2021-02-12 北京神州绿盟信息安全科技股份有限公司 一种报表生成方法及装置
CN108572963A (zh) * 2017-03-09 2018-09-25 北京京东尚科信息技术有限公司 信息获取方法和装置
US10853399B2 (en) * 2017-04-05 2020-12-01 Splunk Inc. User interface search tool for locating and summarizing data
US11061918B2 (en) * 2017-04-05 2021-07-13 Splunk Inc. Locating and categorizing data using inverted indexes
CN109492056A (zh) * 2018-10-24 2019-03-19 江苏满运软件科技有限公司 一种商业智能数据查询的方法和系统
CN111126026B (zh) * 2019-12-17 2021-10-08 叮当快药科技集团有限公司 将sql语句解析生成可视化报表的方法和工具
CN111177231B (zh) * 2019-12-20 2023-09-22 中国建设银行股份有限公司 报表生成方法和报表生成装置
CN111078679B (zh) * 2019-12-23 2023-06-16 用友网络科技股份有限公司 数据报表的生成方法、生成装置和计算机可读存储介质
CN111563368B (zh) * 2020-04-03 2023-10-31 江苏苏宁物流有限公司 报表生成方法、装置、计算机设备和存储介质
CN112256684B (zh) * 2020-10-23 2022-08-16 厦门悦讯信息科技股份有限公司 一种报表生成方法、终端设备及存储介质
CN112506946B (zh) * 2020-12-03 2024-04-05 平安科技(深圳)有限公司 业务数据查询方法、装置、设备及存储介质
CN112861501A (zh) * 2021-01-21 2021-05-28 中国建设银行股份有限公司 报表的生成方法、装置、电子设备及计算机可读存储介质
CN112434059B (zh) * 2021-01-26 2021-06-22 腾讯科技(深圳)有限公司 数据处理方法、装置、计算机设备和存储介质

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150324423A1 (en) * 2012-11-26 2015-11-12 Zte Corporation Report creation method, device and system
CN108984506A (zh) * 2018-08-01 2018-12-11 北京中电普华信息技术有限公司 一种可配置的智能报表的生成方法及装置
CN110597842A (zh) * 2019-07-22 2019-12-20 石化盈科信息技术有限责任公司 业务数据查询方法及系统
CN110717319A (zh) * 2019-09-24 2020-01-21 车智互联(北京)科技有限公司 一种自助报表生成方法、装置、计算设备和系统
CN111158795A (zh) * 2019-12-24 2020-05-15 深圳壹账通智能科技有限公司 报表生成方法、装置、介质及电子设备
CN113342821A (zh) * 2021-06-29 2021-09-03 深圳前海微众银行股份有限公司 报表配置方法、装置、设备及计算机存储介质

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116048985A (zh) * 2023-01-10 2023-05-02 睿智合创(北京)科技有限公司 一种决策数据即测即看结果报表方法
CN116048985B (zh) * 2023-01-10 2023-10-20 睿智合创(北京)科技有限公司 一种决策数据即测即看结果报表方法
CN116781789A (zh) * 2023-05-09 2023-09-19 天云融创数据科技(北京)有限公司 一种api服务生成方法及装置
CN116781789B (zh) * 2023-05-09 2024-02-23 天云融创数据科技(北京)有限公司 一种api服务生成方法及装置
CN116611412A (zh) * 2023-07-20 2023-08-18 云筑信息科技(成都)有限公司 一种基于Excel模版与前端交互的报表填报和展示方法
CN116781550A (zh) * 2023-08-23 2023-09-19 北京赢科天地电子有限公司 数据采集的实现方法、系统及设备
CN117215455A (zh) * 2023-09-25 2023-12-12 中科院成都信息技术股份有限公司 报表计算公式生成方法、装置、计算机设备及存储介质

Also Published As

Publication number Publication date
CN113342821B (zh) 2023-04-07
CN113342821A (zh) 2021-09-03

Similar Documents

Publication Publication Date Title
WO2023273073A1 (zh) 报表配置方法、装置、设备及计算机存储介质
US20230350883A1 (en) Dynamic Dashboard with Guided Discovery
AU2020260374B2 (en) Building reports
US8332772B2 (en) Providing structured visualizations of expressions in an expressions editor
US20110137917A1 (en) Retrieving a data item annotation in a view
US7418459B2 (en) Object oriented based, business class methodology for performing data metric analysis
US20070260582A1 (en) Method and System for Visual Query Construction and Representation
US8122337B2 (en) Apparatus and method for navigating a multi-dimensional database
US9075859B2 (en) Parameterized database drill-through
US10296505B2 (en) Framework for joining datasets
CN102541867A (zh) 数据字典生成方法及系统
US10650044B2 (en) Method and apparatus for converting from a source database system to a destination database system
US20110314373A1 (en) System, method and computer program product for performing actions associated with data to be displayed, utilizing a widget
TWI480754B (zh) 使用條件群組之樞紐分析方法
US20220335044A1 (en) Database query execution on multiple databases
US11636421B1 (en) Model driven reporting
US7590613B2 (en) Layout aware calculations
CN113138998A (zh) 数据指标的大屏显示方法、装置及存储介质
US10380134B2 (en) Integrated predictive analysis
US10417185B2 (en) Gesture based semantic enrichment
US10318627B2 (en) Visualizing dependencies of multi-dimensional data
US11966423B2 (en) Data preparation user interface with conditional remapping of data values
US20230325057A1 (en) Smart filtering in an overview page
US10769164B2 (en) Simplified access for core business with enterprise search
US20150006579A1 (en) Custom grouping of multidimensional data

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21948000

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE