WO2022126983A1 - Electronic report file export method, apparatus and device, and storage medium - Google Patents

Electronic report file export method, apparatus and device, and storage medium Download PDF

Info

Publication number
WO2022126983A1
WO2022126983A1 PCT/CN2021/091578 CN2021091578W WO2022126983A1 WO 2022126983 A1 WO2022126983 A1 WO 2022126983A1 CN 2021091578 W CN2021091578 W CN 2021091578W WO 2022126983 A1 WO2022126983 A1 WO 2022126983A1
Authority
WO
WIPO (PCT)
Prior art keywords
exported
target
index
column
file
Prior art date
Application number
PCT/CN2021/091578
Other languages
French (fr)
Chinese (zh)
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 WO2022126983A1 publication Critical patent/WO2022126983A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/172Caching, prefetching or hoarding of files
    • 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/2455Query execution
    • 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/25Integrating or interfacing systems involving database management systems
    • G06F16/258Data format conversion from or to a database
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • G06F40/186Templates

Definitions

  • the present application relates to the field of traversal query, and in particular, to a method, device, device and storage medium for exporting an electronic report file.
  • the business team After the product is launched, the business team needs a large amount of multi-dimensional data support to track the customer flow conversion rate, process timeliness, risk control rejection reasons, overdue, performance and other indicators in the production environment. These indicators are in high demand (Daily Daily). ), involving a wide range of time (time slice statistics are required), the business team must spend a lot of time sorting and calculating data from the original inventory data, and sorting to form the daily indicator data.
  • each row of data indicators in the report has a specific statistical caliber and value logic, and the column data has statistics in multiple time dimensions such as day, week, month, year, etc.
  • Fetching data for multiple months greatly increases the difficulty of system support.
  • repeated verification is required, the stability risk of data processing is increased, and the data processing efficiency is low.
  • the main purpose of the present application is to solve the problems of data fetching through a large number of scripts and data calculation supported by a large number of codes, resulting in increased data processing stability risks and low data processing efficiency.
  • a first aspect of the present application provides a method for exporting an electronic report file, comprising: when a template configuration request is received, acquiring content to be defined according to the template configuration request, and constructing a target template according to the content to be defined configuration file, and cache the target template configuration file, the target template configuration file includes row index information, column index information, data storage table and table statistics type; obtaining the row indicator information, the column indicator information, the data storage table and the table statistics type, and setting a key-value pair data set according to the row indicator information, the column indicator information and the table statistics type, and store the key-value pair data set in the data storage table; when a file export request is received, generate a row index list to be exported and a column index list to be exported according to the file export request, and store the to-be-exported row index list and the to-be-exported column index list The exported row index list and the to-be-exported column index list are combined into a to-be-exported index parameter matrix; a to
  • a second aspect of the present application provides an electronic report file exporting device, comprising a memory, a processor, and computer-readable instructions stored on the memory and executable on the processor, and the processor executes the computer
  • the following steps are implemented when the readable instruction is received: when a template configuration request is received, the content to be defined is obtained according to the template configuration request, a target template configuration file is constructed according to the to-be-defined content, and the target template configuration file is cached,
  • the target template configuration file includes row indicator information, column indicator information, data storage tables, and table statistics types; the row indicator information, the column indicator information, and all data are obtained from the target template configuration file through a preset timing task.
  • the data storage table and the table statistics type set a key-value pair data set according to the row index information, the column index information and the table statistics type, and store the key-value pair data set in the data
  • a row index list to be exported and a column index list to be exported are generated according to the file export request, and the row index list to be exported and the column index list to be exported are merged into A matrix of indicators and parameters to be exported; obtain a key-value pair data set to be exported, generate a spreadsheet data stream according to the to-be-exported indicator parameter matrix and the to-be-exported key-value pair data set, and send the spreadsheet data stream to the target terminal, so that the target terminal exports the target electronic report file according to the data flow of the electronic form.
  • a third aspect of the present application provides a computer-readable storage medium, where computer instructions are stored in the computer-readable storage medium, and when the computer instructions are executed on a computer, the computer is caused to perform the following steps: when a template configuration is received When requesting, obtain the to-be-defined content according to the template configuration request, construct a target template configuration file according to the to-be-defined content, and cache the target template configuration file, where the target template configuration file includes row index information, column index information information, data storage table and table statistics type; obtain the row indicator information, the column indicator information, the data storage table and the table statistics type from the target template configuration file through a preset timed task, according to the The execution index information, the column index information and the table statistics type are set to a key-value pair data set, and the key-value pair data set is stored in the data storage table; when a file export request is received, according to The file export request generates a to-be-exported row index list and a to-be-exported column index list, and combines the to-be
  • a fourth aspect of the present application provides an electronic report file exporting device, comprising: an obtaining module, configured to obtain to-be-defined content according to the template configuration request when receiving a template configuration request, and construct a target template according to the to-be-defined content configuration file, and cache the target template configuration file, the target template configuration file includes row index information, column index information, data storage table and table statistics type; Obtain the row indicator information, the column indicator information, the data storage table, and the table statistics type from the target template configuration file, and set a key according to the row indicator information, the column indicator information, and the table statistics type value pair data set, and store the key-value pair data set in the data storage table; the merging module, when receiving a file export request, is used to generate a list of row indicators to be exported and a list of to-be-exported row indicators according to the file export request Exporting a column index list, and combining the row index list to be exported and the column index list to be exported into an index parameter matrix to be exported; the export module is used to obtain the
  • the target template configuration file includes row indicator information, column indicator information, data storage tables, and table statistics types; the row indicator information, the column indicator information, and all data are obtained from the target template configuration file through a preset timing task.
  • the data storage table and the table statistics type set a key-value pair data set according to the row index information, the column index information and the table statistics type, and store the key-value pair data set in the data
  • a row index list to be exported and a column index list to be exported are generated according to the file export request, and the row index list to be exported and the column index list to be exported are merged into A matrix of indicators and parameters to be exported; obtain a key-value pair data set to be exported, generate a spreadsheet data stream according to the to-be-exported indicator parameter matrix and the to-be-exported key-value pair data set, and send the spreadsheet data stream to the target terminal, so that the target terminal exports the target electronic report file according to the data flow of the electronic form.
  • a key-value pair data set is generated according to a target template configuration file through a preset timed task
  • an index parameter matrix to be exported is generated according to a file export request
  • an electronic data set is generated according to the index parameter matrix to be exported and the key-value pair data set to be exported.
  • form data stream and send the spreadsheet data stream to the target terminal, so that the target terminal can export the target electronic report file according to the spreadsheet data stream. It is enough to maintain a value logic for the indicators of each row. It is not necessary to support scripts for each time dimension column, which enhances the stability of data processing and improves the efficiency of data processing.
  • FIG. 1 is a schematic diagram of an embodiment of a method for exporting an electronic report file in an embodiment of the application
  • FIG. 2 is a schematic diagram of another embodiment of a method for exporting an electronic report file in an embodiment of the present application
  • FIG. 3 is a schematic diagram of an embodiment of an electronic report file exporting device in an embodiment of the application.
  • FIG. 4 is a schematic diagram of another embodiment of the electronic report file exporting device in the embodiment of the application.
  • FIG. 5 is a schematic diagram of an embodiment of an electronic report file exporting device in an embodiment of the present application.
  • Embodiments of the present application provide an electronic report file export method, device, device, and storage medium, which are used to generate a key-value pair data set according to a target template configuration file through a preset timing task, and generate a to-be-exported index parameter matrix according to a file export request , generate a spreadsheet data stream according to the to-be-exported index parameter matrix and the to-be-exported key-value pair data set, and send the spreadsheet data stream to the target terminal, so that the target terminal exports the target electronic report file according to the spreadsheet data stream.
  • the stability of data processing is enhanced, and the efficiency of data processing is improved.
  • an embodiment of the method for exporting an electronic report file in the embodiment of the present application includes:
  • a template configuration request When a template configuration request is received, obtain the content to be defined according to the template configuration request, build a target template configuration file according to the to-be-defined content, and cache the target template configuration file, where the target template configuration file includes row index information and column index information , datastore tables, and table statistics types.
  • the template configuration request corresponds to the target template configuration file
  • the server configures at least one target template configuration file according to the template configuration request.
  • the server receives the template configuration request
  • the server obtains the corresponding template and the content to be defined according to the template configuration request, and converts the to-be-defined into target definition data conforming to the preset data format according to the template and the content to be defined, wherein,
  • the preset data format can be a JS object notation JSON, or a non-markup language YAML, which is not limited here
  • the server writes the target definition data into the template file according to the preset naming method, and obtains the target template configuration file.
  • the YAML template interacts with the underlying database to process the data to be processed.
  • the execution body of the present application may be an electronic report file exporting device, and may also be a terminal or a server, which is not specifically limited here.
  • the embodiments of the present application take the server as an execution subject as an example for description.
  • the server fetches data through a preset scheduled task. For example, the server fetches data through a preset scheduled task every morning in the early morning, and can also perform data retrieval operations at other times, which is not limited here. Specifically, the server periodically obtains all defined template files, and performs the task of reading data. Further, the server reads the structured query language sql script file according to the row index information corresponding to the target template configuration file. To adjust the caliber of the indicators, it is only necessary to modify a SQL script corresponding to the fetch, and there is no need to adjust each time dimension.
  • the server obtains the statistical time range and grouping method from the column indicator information (for example, the preset year, day, month, and week for grouping statistics); the server sets the statistical time range and grouping method as input parameters corresponding to the sql script file , the server executes the sql script file according to the table statistics type to perform data query and data statistics, obtains the key-value pair data set, and stores the key-value pair data set in the data table (data storage table) defined in the target template configuration file.
  • the server may also perform data retrieval and collection according to specific business application scenarios, which is not specifically limited here.
  • the index parameter matrix to be exported is represented in the form of a two-dimensional array, for example, AutoRptCell[][], this array form can be directly calculated by the cell of (n, m) represented by the formula, where n is the row index identifier , m is the column index identifier. Since all cells are stored in the way of mapping map, for example, Map ⁇ key, AutoRptCell>, where the key key is the query key, the server directly queries the data of this field in the corresponding data storage table according to the key, and then the server obtains the data after , the server sets the data to the corresponding AutoRptCell.
  • mapping map for example, Map ⁇ key, AutoRptCell>
  • the server traverses the Map.values() and sets it to each cell in excel one by one.
  • the spreadsheet data stream is obtained, and the server returns the excel file stream with the set value to the target terminal, so that the target terminal exports the target electronic report file according to the spreadsheet data stream.
  • the server stores the spreadsheet data stream in the blockchain database, which is not specifically limited here.
  • a key-value pair data set is generated according to the target template configuration file through a preset timed task
  • an index parameter matrix to be exported is generated according to a file export request
  • an electronic data set is generated according to the index parameter matrix to be exported and the key-value pair data set to be exported.
  • form data stream and send the spreadsheet data stream to the target terminal, so that the target terminal exports the target electronic report file according to the spreadsheet data stream. It is enough to maintain a value logic for the indicators of each row, and there is no need to support scripts for each time dimension column, which enhances the stability of data processing and improves the efficiency of data processing.
  • FIG. 2 another embodiment of the method for exporting an electronic report file in the embodiment of the present application includes:
  • a template configuration request When a template configuration request is received, obtain the content to be defined according to the template configuration request, build a target template configuration file according to the to-be-defined content, and cache the target template configuration file, where the target template configuration file includes row index information and column index information , datastore tables, and table statistics types.
  • the row indicator information may include the name of the row indicator and the starting value of the row coordinate, and may also include the address of a structured query language sql script, which is not specifically limited here;
  • the column indicator information may include the column time dimension and the starting value of the column coordinate value, and may also include the statistical duration range and duration statistical method (for example, the forward-order statistical method or the reverse-order statistical method), which is not specifically limited here.
  • the statistical duration range includes the statistical start time and the statistical end time;
  • the data storage table is used to indicate the template The target table for data storage for the server to perform data storage operations;
  • the table statistics types include the linkage data statistics method (calculating the results of all time dimension ranges) and the solidified data statistics method (only calculating the data of the current report day).
  • the server parses the template configuration request and obtains the parsing result.
  • the server reads the content to be defined and the template identifier from the parsing result, wherein the to-be-defined
  • the content is a pre-defined indicator according to the actual business scenario, for example, a financial credit indicator, or other indicators, which are not limited here; the server obtains the initial template configuration data from the preset database according to the template identifier, and configures it according to the initial template
  • the data to be defined is subjected to data format conversion and data combination to obtain the encapsulated template data.
  • the initial template configuration data is used to indicate the data configured according to the non-markup language YAML syntax rules; the server converts the encapsulated template data into the target template configuration file , and cache the target template configuration file in the memory database.
  • the target template configuration file includes row indicator information, column indicator information, data storage table and table statistics type.
  • the server names the target template configuration file according to a preset naming rule, wherein the preset naming rule can ensure the uniqueness of the naming of the target template configuration file. It should be noted that the server stores the target template configuration file in the in-memory database, so as to improve the data query efficiency.
  • the preset timing task is a preset data processing task.
  • the server invokes a preset timing task to read the target template configuration file from the in-memory database to obtain row indicator information, column indicator information, data storage table and table statistics type; the server performs indicator analysis on the row indicator information and column indicator information , obtain the structured query language script address, statistical duration range, row index ID and column index ID, and determine the grouping method according to the table statistics type; the server obtains the target structured query language script according to the structured query language script address, and counts the duration
  • the range and grouping method are set to the input parameters corresponding to the target structured query language script; the server executes the structured query language script with the input parameters set to obtain the query data, and sets the query data as the target value;
  • the indicator identification and the statistical duration range are spliced in sequence to obtain the target key, the target key and target value are set as the key-value pair dataset, and the key-value pair dataset is updated to the data storage table.
  • the server performs data statistics on days, weeks, months, and years, respectively, and splices the collected data into a data query key key (target key).
  • )date_slice is obtained by splicing and combining, that is, the key is row_key+_+col_key+_+date_slice.
  • the structured query language script address is used to indicate the calling target structured query language script, so that the structured query language script performs data query according to the structured query statement.
  • the server receives the file export request and performs a data merging operation according to the file export request.
  • the server performs parameter parsing on the file export request, obtains a parameter parsing result, and performs parameter verification on the parameter parsing result to obtain a verification result, where the verification result includes verification passed and verification. If it fails, the verification can be represented by 1 or logically true, and the verification failure can be represented by 0 or logical false.
  • the server determines whether the verification result is a preset value, and when the verification result is not a preset value, the server determines that the verification result is that the verification fails, the server generates warning information, and sends the warning information to the target terminal, and the warning information is used for Indicates that there is an exception in the file export; when the verification result is a preset value, the server determines that the verification result is passed.
  • the server obtains the identifier of the template to be exported from the verification result, and queries the configuration file to be exported from the in-memory database according to the identifier of the template to be exported.
  • the identifier of the template to be exported may be a character string composed of numbers, letters, or underscores, and is unique, for example, the identifier of the template to be exported is temp_001.
  • the server reads the row index information to be exported and the column index information to be exported from the configuration file to be exported, and determines the row index list to be exported and the column index list to be exported according to the row index information to be exported and the column index information to be exported,
  • the row index list to be exported includes the row coordinates and row index identifiers of the index data
  • the column index list to be exported includes the column coordinates and column key information of the dimension data
  • the column key information includes the column index identifier and the statistical time range
  • the row coordinates of the dimensional data and the column coordinates of the dimension data are combined to assemble the to-be-exported row index list and the to-be-exported column index list into a to-be-exported index parameter matrix.
  • the server can also set the width of each column of the exported spreadsheet, that is, the server sets the upper and lower boundaries of the spreadsheet, and determines the height of each row of the exported spreadsheet. Cut out cells.
  • the electronic report file includes the electronic report number, the electronic report name, the formula set in the electronic report, and the report type.
  • the report format includes fonts, lines, and cell widths, and can also include other data, which is not limited here.
  • the server traverses and reads the to-be-exported index parameter matrix, obtains row index identifiers, row coordinates, column coordinates, and column key information, and assembles the to-be-queried keys according to the row and column index identifiers; Query the key-value pair data set to be exported in the data storage table, assign the key-value data set to be exported to the index parameter matrix to be exported according to the row and column coordinates, obtain the assigned index matrix, and generate the index matrix based on the assigned index matrix Spreadsheet data flow, that is, the server sets the index parameter matrix to be exported as the header content, and sets the to-be-exported key-value pair data set as the table body content; the server calls the preset sending interface to send the spreadsheet data flow to the target terminal, so that the target terminal exports the target electronic report file according to the spreadsheet data flow.
  • the server when the server receives the file test request, the server reads the target electronic report file and the target structured query language script according to the file test request; the target electronic report file and the target structured query language script are pushed to the test terminal, so that The test terminal performs white-box testing on the target electronic report file and black-box testing on the target structured query language script, which greatly improves the stability of the system.
  • the server receives the report print request, the server parses the report print request, and obtains the identification of the file to be printed and the user identification information; the server queries the memory database according to the identification of the file to be printed, and obtains the content file of the report to be printed, and the content file of the report to be printed belongs to the target electronic report file. That is, the server pre-stores the pre-exported plurality of target electronic report files in the in-memory database.
  • the user identification information includes information such as a user name, a user mailbox, and a user phone number, which is not specifically limited here.
  • the server converts the user identification information into a watermark image (that is, watermark information); the server embeds the watermark image into the report content file to be printed, and obtains a report file containing the watermark; The watermarked report file is printed.
  • the server records the report print request and the report file containing the watermark into a preset print log. It can be understood that the preset print log is used to record the process of the report printing request, so that the server can trace the entire state of the printed electronic report file and improve the security of the electronic report file.
  • a key-value pair data set is generated according to a target template configuration file through a preset timed task
  • an index parameter matrix to be exported is generated according to a file export request
  • an electronic data set is generated according to the index parameter matrix to be exported and the key-value pair data set to be exported.
  • form data stream and send the spreadsheet data stream to the target terminal, so that the target terminal can export the target electronic report file according to the spreadsheet data stream. It is enough to maintain a value logic for the indicators of each row. It is not necessary to support scripts for each time dimension column, which enhances the stability of data processing and improves the efficiency of data processing.
  • an embodiment of the electronic report file export device in the embodiment of the application includes:
  • the obtaining module 301 when a template configuration request is received, is used to obtain the content to be defined according to the template configuration request, build a target template configuration file according to the to-be-defined content, and cache the target template configuration file, where the target template configuration file includes row index information , column indicator information, data storage table and table statistics type;
  • the setting module 302 is used to obtain row indicator information, column indicator information, data storage table and table statistics type from the target template configuration file through a preset timing task, and set key-value pairs according to the row indicator information, column indicator information and table statistics type data set, and store the key-value pair data set in the data storage table;
  • the merging module 303 when receiving a file export request, is configured to generate a row index list to be exported and a column index list to be exported according to the file export request, and combine the row index list to be exported and the column index list to be exported into index parameters to be exported matrix;
  • the export module 304 is configured to obtain a data set of key-value pairs to be exported, generate a spreadsheet data stream according to the index parameter matrix to be exported and the key-value pair data set to be exported, and send the spreadsheet data stream to the target terminal, so that the target terminal Export the target spreadsheet file according to the spreadsheet data flow.
  • spreadsheet data stream is stored in the blockchain database, which is not specifically limited here.
  • a key-value pair data set is generated according to a target template configuration file through a preset timed task
  • an index parameter matrix to be exported is generated according to a file export request
  • an electronic data set is generated according to the index parameter matrix to be exported and the key-value pair data set to be exported.
  • form data stream and send the spreadsheet data stream to the target terminal, so that the target terminal can export the target electronic report file according to the spreadsheet data stream. It is enough to maintain a value logic for the indicators of each row. It is not necessary to support scripts for each time dimension column, which enhances the stability of data processing and improves the efficiency of data processing.
  • another embodiment of the electronic report file exporting device in the embodiment of the present application includes:
  • the obtaining module 301 when a template configuration request is received, is used to obtain the content to be defined according to the template configuration request, build a target template configuration file according to the to-be-defined content, and cache the target template configuration file, where the target template configuration file includes row index information , column indicator information, data storage table and table statistics type;
  • the setting module 302 is used to obtain row indicator information, column indicator information, data storage table and table statistics type from the target template configuration file through a preset timing task, and set key-value pairs according to the row indicator information, column indicator information and table statistics type data set, and store the key-value pair data set in the data storage table;
  • the merging module 303 when receiving a file export request, is configured to generate a row index list to be exported and a column index list to be exported according to the file export request, and combine the row index list to be exported and the column index list to be exported into index parameters to be exported matrix;
  • the export module 304 is configured to obtain a data set of key-value pairs to be exported, generate a spreadsheet data stream according to the index parameter matrix to be exported and the key-value pair data set to be exported, and send the spreadsheet data stream to the target terminal, so that the target terminal Export the target spreadsheet file according to the spreadsheet data flow.
  • the obtaining module 301 can also be specifically used for:
  • the template configuration request When a template configuration request is received, the template configuration request is parsed to obtain the parsing result, and when the parsing result is not a null value, the content to be defined and the template identifier are read from the parsing result;
  • the initial template configuration data is used to indicate that according to the non-markup language YAML Syntax rule configuration data;
  • the target template configuration file includes row indicator information, column indicator information, data storage table and table statistics type.
  • the setting module 302 is also specifically used for:
  • String splicing is performed on row indicator identifiers, column indicator identifiers, and statistical duration ranges in order to obtain the target key, set the target key and target value as the key-value pair dataset, and update the key-value pair dataset to the data storage table middle.
  • the merging module 303 can also be specifically used for:
  • the indicator list includes row coordinates and row indicator identifiers of indicator data
  • the column indicator list to be exported includes column coordinates and column key information of dimension data
  • the column key information includes column indicator identifiers and statistical time ranges
  • the to-be-exported row indicator list and the to-be-exported column indicator list are assembled into a to-be-exported indicator parameter matrix.
  • the export module 304 can also be specifically used for:
  • the preset sending interface is called to send the spreadsheet data stream to the target terminal, so that the target terminal exports the target electronic report file according to the spreadsheet data stream.
  • the electronic report file exporting device further includes:
  • the reading module 305 when receiving the file test request, is used to read the target electronic report file and the target structured query language script according to the file test request;
  • the test module 306 is configured to push the target electronic report file and the target structured query language script to the test terminal, so that the test terminal performs white box testing on the target electronic report file and black box test on the target structured query language script.
  • the electronic report file exporting device further includes:
  • a determination module 307 configured to receive a report printing request, and determine the report content file to be printed and the user identification information from the report printing request, and the report content file to be printed belongs to the target electronic report file;
  • the printing module 308 is configured to generate watermark information according to the user identification information, embed the watermark information into the report content file to be printed, obtain a report file containing the watermark, and print the report file containing the watermark.
  • a key-value pair data set is generated according to a target template configuration file through a preset timed task
  • an index parameter matrix to be exported is generated according to a file export request
  • an electronic data set is generated according to the index parameter matrix to be exported and the key-value pair data set to be exported.
  • form data stream and send the spreadsheet data stream to the target terminal, so that the target terminal can export the target electronic report file according to the spreadsheet data stream. It is enough to maintain a value logic for the indicators of each row. It is not necessary to support scripts for each time dimension column, which enhances the stability of data processing and improves the efficiency of data processing.
  • FIG. 5 is a schematic structural diagram of an electronic report file export device provided by an embodiment of the present application.
  • the electronic report file export device 500 may vary greatly due to different configurations or performances, and may include one or more processors (central processing units, CPU) 510 (eg, one or more processors) and memory 520, one or more storage media 530 (eg, one or more mass storage devices) that store application programs 533 or data 532.
  • the memory 520 and the storage medium 530 may be short-term storage or persistent storage.
  • the program stored in the storage medium 530 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations in the electronic report file exporting device 500 .
  • the processor 510 may be configured to communicate with the storage medium 530 to execute a series of instruction operations in the storage medium 530 on the electronic report file exporting device 500 .
  • the electronic report file exporting device 500 may also include one or more power supplies 540, one or more wired or wireless network interfaces 550, one or more input and output interfaces 560, and/or, one or more operating systems 531, such as Windows Serve, Mac OS X, Unix, Linux, FreeBSD, and more.
  • operating systems 531 such as Windows Serve, Mac OS X, Unix, Linux, FreeBSD, and more.
  • the present application also provides a computer-readable storage medium.
  • the computer-readable storage medium may be a non-volatile computer-readable storage medium.
  • the computer-readable storage medium may also be a volatile computer-readable storage medium. Instructions are stored in the computer-readable storage medium, and when the instructions are executed on the computer, the computer performs the following steps:
  • the content to be defined is obtained according to the template configuration request, a target template configuration file is constructed according to the to-be-defined content, and the target template configuration file is cached, and the target template configuration file includes a line Indicator information, column indicator information, data storage table and table statistics type;
  • a list of row indicators to be exported and a list of column indicators to be exported are generated according to the file export request, and the list of row indicators to be exported and the list of column indicators to be exported are combined into indicator parameters to be exported matrix;
  • Obtain the key-value pair data set to be exported generate a spreadsheet data stream according to the to-be-exported index parameter matrix and the to-be-exported key-value pair data set, and send the spreadsheet data stream to the target terminal, so that the The target terminal exports the target electronic report file according to the data flow of the electronic form.
  • the present application also provides an electronic report file exporting device, the electronic report file exporting device includes a memory and a processor, and instructions are stored in the memory, and when the instructions are executed by the processor, the processor executes each of the above embodiments. The steps of the electronic report file export method.
  • the computer-readable storage medium may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required by at least one function, and the like; The data created by the use of the node, etc.
  • the blockchain referred to in this application is a new application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, and encryption algorithm.
  • Blockchain essentially a decentralized database, is a series of data blocks associated with cryptographic methods. Each data block contains a batch of network transaction information to verify its Validity of information (anti-counterfeiting) and generation of the next block.
  • the blockchain can include the underlying platform of the blockchain, the platform product service layer, and the application service layer.
  • the integrated unit if implemented in the form of a software functional unit and sold or used as an independent product, may be stored in a computer-readable storage medium.
  • the technical solutions of the present application can be embodied in the form of software products in essence, or the parts that contribute to the prior art, or all or part of the technical solutions, and the computer software products are stored in a storage medium , including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application.
  • the aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), magnetic disk or CD, etc., each of which can store program codes. medium.

Abstract

An electronic report file export method, apparatus and device, and a storage medium, which are used for improving data processing efficiency. The electronic report file export method comprises: constructing a target template configuration file according to a template configuration request; setting a key-value pair data set by means of a preset timing task and the target template configuration file, and storing the key-value pair data set in a data storage table; generating, according to a file export request, a row index list to be exported and a column index list to be exported, and combining the row index list to be exported with the column index list to be exported to obtain an index parameter matrix to be exported; and generating a spreadsheet data flow according to the index parameter matrix to be exported and a key-value pair data set to be exported, and sending the spreadsheet data flow to a target terminal, so that the target terminal exports a target electronic report file according to the spreadsheet data flow. In addition, the method further relates to blockchain technology, and the spreadsheet data flow can be stored in a blockchain node.

Description

电子报表文件导出方法、装置、设备及存储介质Electronic report file export method, device, equipment and storage medium
本申请要求于2020年12月18日提交中国专利局、申请号为202011506861.9、发明名称为“电子报表文件导出方法、装置、设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在申请中。This application claims the priority of the Chinese patent application filed on December 18, 2020 with the application number 202011506861.9 and the invention titled "Electronic report file export method, device, equipment and storage medium", the entire contents of which are by reference incorporated in the application.
技术领域technical field
本申请涉及遍历查询领域,尤其涉及一种电子报表文件导出方法、装置、设备及存储介质。The present application relates to the field of traversal query, and in particular, to a method, device, device and storage medium for exporting an electronic report file.
背景技术Background technique
在产品上线后,业务团队需要大量、多维的数据支持,来跟踪生产环境上的客流转化率、流程时效性、风控拒绝原因、逾期、业绩等指标,这些指标的需求频次高(每日日报),涉及时间范围广(需要对时间进行切片统计),业务团队必须耗费大量时间从原始清单数据整理计算出数据,整理而形成每日各指标数据。After the product is launched, the business team needs a large amount of multi-dimensional data support to track the customer flow conversion rate, process timeliness, risk control rejection reasons, overdue, performance and other indicators in the production environment. These indicators are in high demand (Daily Daily). ), involving a wide range of time (time slice statistics are required), the business team must spend a lot of time sorting and calculating data from the original inventory data, and sorting to form the daily indicator data.
由于报表中的每行数据指标都有特定的统计口径和取值逻辑,并且列数据存在按日、按周、按月、按年等多个时间维度的统计,取数一般还需要往前推多个月取数,大大增加了系统支持的难度,为了实现一张报表,需要实现行*列种统计维度和口径。发明人意识到,为了支持每个数据指标,还需要支持各个时间维度的数据指标计算,其中包括大量脚本进行取数,以及大量代码支持数据计算,这对代码的维护及测试带来了非常大的挑战,对于有问题的数据行,需要反复多次验证,数据处理的稳定性风险增高以及处数据处理效率低。Since each row of data indicators in the report has a specific statistical caliber and value logic, and the column data has statistics in multiple time dimensions such as day, week, month, year, etc., the data generally needs to be pushed forward. Fetching data for multiple months greatly increases the difficulty of system support. In order to realize a report, it is necessary to realize the statistical dimension and caliber of row*column. The inventor realized that in order to support each data indicator, it is also necessary to support the calculation of data indicators in various time dimensions, including a large number of scripts to fetch data, and a large number of codes to support data calculation, which brings great influence to the maintenance and testing of the code. For the problematic data rows, repeated verification is required, the stability risk of data processing is increased, and the data processing efficiency is low.
发明内容SUMMARY OF THE INVENTION
本申请的主要目的在于解决通过大量脚本进行取数,以及大量代码支持数据计算,导致数据处理的稳定性风险增高以及处数据处理效率低的问题。The main purpose of the present application is to solve the problems of data fetching through a large number of scripts and data calculation supported by a large number of codes, resulting in increased data processing stability risks and low data processing efficiency.
为实现上述目的,本申请第一方面提供了一种电子报表文件导出方法,包括:当接收到模板配置请求时,按照所述模板配置请求获取待定义内容,根据所述待定义内容构建目标模板配置文件,并对所述目标模板配置文件进行缓存,所述目标模板配置文件包括行指标信息、列指标信息、数据存储表和表统计类型;通过预设定时任务从所述目标模板配置文件中获取所述行指标信息、所述列指标信息、所述数据存储表和所述表统计类型,根据所述行指标信息和所述列指标信息和所述表统计类型设置键值对数据集,并将所述键值对数据集存储至所述数据存储表中;当接收到文件导出请求时,按照所述文件导出请求生成待导出行指标列表和待导出列指标列表,并将所述待导出行指标列表和所述待导出列指标列表合并为待导出指标参数矩阵;获取待导出键值对数据集,根据所述待导出指标参数矩阵和所述待导出键值对数据集生成电子表格数据流,并将所述电子表格数据流发送至目标终端,以使得所述目标终端按照所述电子表格数据流导出目标电子报表文件。In order to achieve the above purpose, a first aspect of the present application provides a method for exporting an electronic report file, comprising: when a template configuration request is received, acquiring content to be defined according to the template configuration request, and constructing a target template according to the content to be defined configuration file, and cache the target template configuration file, the target template configuration file includes row index information, column index information, data storage table and table statistics type; obtaining the row indicator information, the column indicator information, the data storage table and the table statistics type, and setting a key-value pair data set according to the row indicator information, the column indicator information and the table statistics type, and store the key-value pair data set in the data storage table; when a file export request is received, generate a row index list to be exported and a column index list to be exported according to the file export request, and store the to-be-exported row index list and the to-be-exported column index list The exported row index list and the to-be-exported column index list are combined into a to-be-exported index parameter matrix; a to-be-exported key-value pair data set is obtained, and a spreadsheet is generated according to the to-be-exported index parameter matrix and the to-be-exported key-value pair data set data stream, and send the spreadsheet data stream to the target terminal, so that the target terminal exports the target electronic report file according to the spreadsheet data stream.
本申请第二方面提供了一种电子报表文件导出设备,包括存储器、处理器及存储在所述存储器上并可在所述处理器上运行的计算机可读指令,所述处理器执行所述计算机可读指令时实现如下步骤:当接收到模板配置请求时,按照所述模板配置请求获取待定义内容,根据所述待定义内容构建目标模板配置文件,并对所述目标模板配置文件进行缓存,所述目标模板配置文件包括行指标信息、列指标信息、数据存储表和表统计类型;通过预设定时任务从所述目标模板配置文件中获取所述行指标信息、所述列指标信息、所述数据存储表和所述表统计类型,根据所述行指标信息和所述列指标信息和所述表统计类型设置键值对数据集,并将所述键值对数据集存储至所述数据存储表中;当接收到文件导出请求时,按照所述文件导出请求生成待导出行指标列表和待导出列指标列表,并将所述待导出行指标列表和所述待导出列指标列表合并为待导出指标参数矩阵;获取待导出键值对数据集,根据所述待导出指标参数矩阵和所述待导出键值对数据集生成电子表格数据流,并将所述 电子表格数据流发送至目标终端,以使得所述目标终端按照所述电子表格数据流导出目标电子报表文件。A second aspect of the present application provides an electronic report file exporting device, comprising a memory, a processor, and computer-readable instructions stored on the memory and executable on the processor, and the processor executes the computer The following steps are implemented when the readable instruction is received: when a template configuration request is received, the content to be defined is obtained according to the template configuration request, a target template configuration file is constructed according to the to-be-defined content, and the target template configuration file is cached, The target template configuration file includes row indicator information, column indicator information, data storage tables, and table statistics types; the row indicator information, the column indicator information, and all data are obtained from the target template configuration file through a preset timing task. the data storage table and the table statistics type, set a key-value pair data set according to the row index information, the column index information and the table statistics type, and store the key-value pair data set in the data In the storage table; when a file export request is received, a row index list to be exported and a column index list to be exported are generated according to the file export request, and the row index list to be exported and the column index list to be exported are merged into A matrix of indicators and parameters to be exported; obtain a key-value pair data set to be exported, generate a spreadsheet data stream according to the to-be-exported indicator parameter matrix and the to-be-exported key-value pair data set, and send the spreadsheet data stream to the target terminal, so that the target terminal exports the target electronic report file according to the data flow of the electronic form.
本申请第三方面提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机指令,当所述计算机指令在计算机上运行时,使得计算机执行如下步骤:当接收到模板配置请求时,按照所述模板配置请求获取待定义内容,根据所述待定义内容构建目标模板配置文件,并对所述目标模板配置文件进行缓存,所述目标模板配置文件包括行指标信息、列指标信息、数据存储表和表统计类型;通过预设定时任务从所述目标模板配置文件中获取所述行指标信息、所述列指标信息、所述数据存储表和所述表统计类型,根据所述行指标信息和所述列指标信息和所述表统计类型设置键值对数据集,并将所述键值对数据集存储至所述数据存储表中;当接收到文件导出请求时,按照所述文件导出请求生成待导出行指标列表和待导出列指标列表,并将所述待导出行指标列表和所述待导出列指标列表合并为待导出指标参数矩阵;获取待导出键值对数据集,根据所述待导出指标参数矩阵和所述待导出键值对数据集生成电子表格数据流,并将所述电子表格数据流发送至目标终端,以使得所述目标终端按照所述电子表格数据流导出目标电子报表文件。A third aspect of the present application provides a computer-readable storage medium, where computer instructions are stored in the computer-readable storage medium, and when the computer instructions are executed on a computer, the computer is caused to perform the following steps: when a template configuration is received When requesting, obtain the to-be-defined content according to the template configuration request, construct a target template configuration file according to the to-be-defined content, and cache the target template configuration file, where the target template configuration file includes row index information, column index information information, data storage table and table statistics type; obtain the row indicator information, the column indicator information, the data storage table and the table statistics type from the target template configuration file through a preset timed task, according to the The execution index information, the column index information and the table statistics type are set to a key-value pair data set, and the key-value pair data set is stored in the data storage table; when a file export request is received, according to The file export request generates a to-be-exported row index list and a to-be-exported column index list, and combines the to-be-exported row index list and the to-be-exported column index list into a to-be-exported index parameter matrix; obtains to-be-exported key-value pair data set, generate a spreadsheet data stream according to the to-be-derived index parameter matrix and the to-be-derived key-value pair data set, and send the spreadsheet data stream to the target terminal, so that the target terminal complies with the spreadsheet data Dataflow export destination spreadsheet file.
本申请第四方面提供了一种电子报表文件导出装置,包括:获取模块,当接收到模板配置请求时,用于按照所述模板配置请求获取待定义内容,根据所述待定义内容构建目标模板配置文件,并对所述目标模板配置文件进行缓存,所述目标模板配置文件包括行指标信息、列指标信息、数据存储表和表统计类型;设置模块,用于通过预设定时任务从所述目标模板配置文件中获取所述行指标信息、所述列指标信息、所述数据存储表和所述表统计类型,根据所述行指标信息和所述列指标信息和所述表统计类型设置键值对数据集,并将所述键值对数据集存储至所述数据存储表中;合并模块,当接收到文件导出请求时,用于按照所述文件导出请求生成待导出行指标列表和待导出列指标列表,并将所述待导出行指标列表和所述待导出列指标列表合并为待导出指标参数矩阵;导出模块,用于获取待导出键值对数据集,根据所述待导出指标参数矩阵和所述待导出键值对数据集生成电子表格数据流,并将所述电子表格数据流发送至目标终端,以使得所述目标终端按照所述电子表格数据流导出目标电子报表文件。A fourth aspect of the present application provides an electronic report file exporting device, comprising: an obtaining module, configured to obtain to-be-defined content according to the template configuration request when receiving a template configuration request, and construct a target template according to the to-be-defined content configuration file, and cache the target template configuration file, the target template configuration file includes row index information, column index information, data storage table and table statistics type; Obtain the row indicator information, the column indicator information, the data storage table, and the table statistics type from the target template configuration file, and set a key according to the row indicator information, the column indicator information, and the table statistics type value pair data set, and store the key-value pair data set in the data storage table; the merging module, when receiving a file export request, is used to generate a list of row indicators to be exported and a list of to-be-exported row indicators according to the file export request Exporting a column index list, and combining the row index list to be exported and the column index list to be exported into an index parameter matrix to be exported; the export module is used to obtain the key-value pair data set to be exported, according to the index to be exported The parameter matrix and the to-be-exported key-value pair data set generate a spreadsheet data stream, and send the spreadsheet data stream to the target terminal, so that the target terminal exports the target electronic report file according to the spreadsheet data stream.
本申请提供的技术方案中,当接收到模板配置请求时,按照所述模板配置请求获取待定义内容,根据所述待定义内容构建目标模板配置文件,并对所述目标模板配置文件进行缓存,所述目标模板配置文件包括行指标信息、列指标信息、数据存储表和表统计类型;通过预设定时任务从所述目标模板配置文件中获取所述行指标信息、所述列指标信息、所述数据存储表和所述表统计类型,根据所述行指标信息和所述列指标信息和所述表统计类型设置键值对数据集,并将所述键值对数据集存储至所述数据存储表中;当接收到文件导出请求时,按照所述文件导出请求生成待导出行指标列表和待导出列指标列表,并将所述待导出行指标列表和所述待导出列指标列表合并为待导出指标参数矩阵;获取待导出键值对数据集,根据所述待导出指标参数矩阵和所述待导出键值对数据集生成电子表格数据流,并将所述电子表格数据流发送至目标终端,以使得所述目标终端按照所述电子表格数据流导出目标电子报表文件。本申请实施例中,通过预设定时任务按照目标模板配置文件生成键值对数据集,根据文件导出请求生成待导出指标参数矩阵,根据待导出指标参数矩阵和待导出键值对数据集生成电子表格数据流,并将电子表格数据流发送至目标终端,以使得目标终端按照电子表格数据流导出目标电子报表文件。对每行的指标维护一个取值逻辑即可,不需要针对每个时间维度列分别支持脚本,增强了数据处理的稳定性,以及提高了数据处理效率。In the technical solution provided by the present application, when a template configuration request is received, content to be defined is acquired according to the template configuration request, a target template configuration file is constructed according to the to-be-defined content, and the target template configuration file is cached, The target template configuration file includes row indicator information, column indicator information, data storage tables, and table statistics types; the row indicator information, the column indicator information, and all data are obtained from the target template configuration file through a preset timing task. the data storage table and the table statistics type, set a key-value pair data set according to the row index information, the column index information and the table statistics type, and store the key-value pair data set in the data In the storage table; when a file export request is received, a row index list to be exported and a column index list to be exported are generated according to the file export request, and the row index list to be exported and the column index list to be exported are merged into A matrix of indicators and parameters to be exported; obtain a key-value pair data set to be exported, generate a spreadsheet data stream according to the to-be-exported indicator parameter matrix and the to-be-exported key-value pair data set, and send the spreadsheet data stream to the target terminal, so that the target terminal exports the target electronic report file according to the data flow of the electronic form. In the embodiment of the present application, a key-value pair data set is generated according to a target template configuration file through a preset timed task, an index parameter matrix to be exported is generated according to a file export request, and an electronic data set is generated according to the index parameter matrix to be exported and the key-value pair data set to be exported. form data stream, and send the spreadsheet data stream to the target terminal, so that the target terminal can export the target electronic report file according to the spreadsheet data stream. It is enough to maintain a value logic for the indicators of each row. It is not necessary to support scripts for each time dimension column, which enhances the stability of data processing and improves the efficiency of data processing.
附图说明Description of drawings
图1为本申请实施例中电子报表文件导出方法的一个实施例示意图;1 is a schematic diagram of an embodiment of a method for exporting an electronic report file in an embodiment of the application;
图2为本申请实施例中电子报表文件导出方法的另一个实施例示意图;2 is a schematic diagram of another embodiment of a method for exporting an electronic report file in an embodiment of the present application;
图3为本申请实施例中电子报表文件导出装置的一个实施例示意图;3 is a schematic diagram of an embodiment of an electronic report file exporting device in an embodiment of the application;
图4为本申请实施例中电子报表文件导出装置的另一个实施例示意图;4 is a schematic diagram of another embodiment of the electronic report file exporting device in the embodiment of the application;
图5为本申请实施例中电子报表文件导出设备的一个实施例示意图。FIG. 5 is a schematic diagram of an embodiment of an electronic report file exporting device in an embodiment of the present application.
具体实施方式Detailed ways
本申请实施例提供了一种电子报表文件导出方法、装置、设备及存储介质,用于通过预设定时任务按照目标模板配置文件生成键值对数据集,根据文件导出请求生成待导出指标参数矩阵,根据待导出指标参数矩阵和待导出键值对数据集生成电子表格数据流,并将电子表格数据流发送至目标终端,以使得目标终端按照电子表格数据流导出目标电子报表文件。增强了数据处理的稳定性,以及提高了数据处理效率。Embodiments of the present application provide an electronic report file export method, device, device, and storage medium, which are used to generate a key-value pair data set according to a target template configuration file through a preset timing task, and generate a to-be-exported index parameter matrix according to a file export request , generate a spreadsheet data stream according to the to-be-exported index parameter matrix and the to-be-exported key-value pair data set, and send the spreadsheet data stream to the target terminal, so that the target terminal exports the target electronic report file according to the spreadsheet data stream. The stability of data processing is enhanced, and the efficiency of data processing is improved.
本申请的说明书和权利要求书及上述附图中的术语“第一”、“第二”、“第三”、“第四”等(如果存在)是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的实施例能够以除了在这里图示或描述的内容以外的顺序实施。此外,术语“包括”或“具有”及其任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。The terms "first", "second", "third", "fourth", etc. (if any) in the description and claims of this 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 is to be understood that data so used may be interchanged under appropriate circumstances so that the embodiments described herein can be practiced in sequences other than those illustrated or described herein. Furthermore, the terms "comprising" or "having" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those expressly listed steps or units, but may include other steps or units not expressly listed or inherent to these processes, methods, products or devices.
为便于理解,下面对本申请实施例的具体流程进行描述,请参阅图1,本申请实施例中电子报表文件导出方法的一个实施例包括:For ease of understanding, the following describes the specific process of the embodiment of the present application, referring to FIG. 1 , an embodiment of the method for exporting an electronic report file in the embodiment of the present application includes:
101、当接收到模板配置请求时,按照模板配置请求获取待定义内容,根据待定义内容构建目标模板配置文件,并对目标模板配置文件进行缓存,目标模板配置文件包括行指标信息、列指标信息、数据存储表和表统计类型。101. When a template configuration request is received, obtain the content to be defined according to the template configuration request, build a target template configuration file according to the to-be-defined content, and cache the target template configuration file, where the target template configuration file includes row index information and column index information , datastore tables, and table statistics types.
需要说明的是,模板配置请求与目标模板配置文件相对应,服务器按照模板配置请求配置至少一个目标模板配置文件。具体的,当服务器接收到模板配置请求时,服务器根据模板配置请求获取对应的模板和待定义内容,并根据模板和待定义内容将待定义转化为符合预设数据格式的目标定义数据,其中,预设数据格式可以为JS对象简谱JSON,也可以为非标记语言YAML,具体此处不做限定;服务器按照预设命名方式将目标定义数据写入至模板文件中,得到目标模板配置文件,利用YAML模板与底层数据库进行数据交互操作,以对待处理数据进行处理。It should be noted that the template configuration request corresponds to the target template configuration file, and the server configures at least one target template configuration file according to the template configuration request. Specifically, when the server receives the template configuration request, the server obtains the corresponding template and the content to be defined according to the template configuration request, and converts the to-be-defined into target definition data conforming to the preset data format according to the template and the content to be defined, wherein, The preset data format can be a JS object notation JSON, or a non-markup language YAML, which is not limited here; the server writes the target definition data into the template file according to the preset naming method, and obtains the target template configuration file. The YAML template interacts with the underlying database to process the data to be processed.
可以理解的是,本申请的执行主体可以为电子报表文件导出装置,还可以是终端或者服务器,具体此处不做限定。本申请实施例以服务器为执行主体为例进行说明。It can be understood that the execution body of the present application may be an electronic report file exporting device, and may also be a terminal or a server, which is not specifically limited here. The embodiments of the present application take the server as an execution subject as an example for description.
102、通过预设定时任务从目标模板配置文件中获取行指标信息、列指标信息、数据存储表和表统计类型,根据行指标信息和列指标信息和表统计类型设置键值对数据集,并将键值对数据集存储至数据存储表中。102. Obtain row indicator information, column indicator information, data storage table and table statistics type from the target template configuration file through a preset timed task, set a key-value pair data set according to the row indicator information, column indicator information and table statistics type, and Store the key-value pair dataset in the datastore table.
服务器通过预设定时任务进行数据取数,例如,服务器通过预设定时任务每日凌晨定时任务取数,也可以在其他时间进行数据获取操作,具体此处不做限定。具体的,服务器定时获取所有定义的模板文件,并进行读取数据任务,进一步地,服务器按照目标模板配置文件对应的行指标信息读取结构化查询语言sql脚本文件,当服务器对日报中的数据指标进行口径调整,仅需要修改对应取数的一个sql脚本即可,不需要对每个时间维度进行调整。服务器从列指标信息获取统计时长范围,以及分组方式(例如,预先设置的年、日、月、周进行分组统计的方式);服务器将统计时长范围与分组方式设置为sql脚本文件对应的输入参数,服务器按照表统计类型执行sql脚本文件进行数据查询和数据统计,得到键值对数 据集,并将键值对数据集存储至目标模板配置文件定义的数据表(数据存储表)中。服务器还可以根据具体的业务应用场景进行数据取数收集,具体此处不做限定。The server fetches data through a preset scheduled task. For example, the server fetches data through a preset scheduled task every morning in the early morning, and can also perform data retrieval operations at other times, which is not limited here. Specifically, the server periodically obtains all defined template files, and performs the task of reading data. Further, the server reads the structured query language sql script file according to the row index information corresponding to the target template configuration file. To adjust the caliber of the indicators, it is only necessary to modify a SQL script corresponding to the fetch, and there is no need to adjust each time dimension. The server obtains the statistical time range and grouping method from the column indicator information (for example, the preset year, day, month, and week for grouping statistics); the server sets the statistical time range and grouping method as input parameters corresponding to the sql script file , the server executes the sql script file according to the table statistics type to perform data query and data statistics, obtains the key-value pair data set, and stores the key-value pair data set in the data table (data storage table) defined in the target template configuration file. The server may also perform data retrieval and collection according to specific business application scenarios, which is not specifically limited here.
103、当接收到文件导出请求时,按照文件导出请求生成待导出行指标列表和待导出列指标列表,并将待导出行指标列表和待导出列指标列表合并为待导出指标参数矩阵。103. When a file export request is received, generate a row index list to be exported and a column index list to be exported according to the file export request, and combine the row index list to be exported and the column index list to be exported into an index parameter matrix to be exported.
具体的,当服务器接收到文件导出请求时,服务器按照导出请求确定待导出模板标识,例如,用户在页面点击下载日报数据,终端生成文件导出请求,服务器根据文件导出请求获取预先定义的模板,并通过模板定义的行指标信息(对应的行参数为rows),生成待导出行指标列表,例如,待导出行指标列表为行AutoRptCell列表;服务器根据模板定义的列指标信息cols,生成待导出列指标列表,例如待导出列指标列表为列AutoRptCell列表,其中服务器计算模板中定义的天、周、月、年的取值范围,为每一天、周、月、年生成一个AutoRptCell,行AutoRptCell列表中包括了行的key=row_key以及行在电子表格excel中的索引index位置(行指标标识),列AutoRptCell列表中包括了key=col_key+_+date_slice(时间切片)以及列在excel中的index位置(列指标标识),通过这两个AutoRptCell列表,生成待导出指标参数矩阵(AutoRptMatrix矩阵)。Specifically, when the server receives a file export request, the server determines the identifier of the template to be exported according to the export request. For example, the user clicks on the page to download daily data, the terminal generates a file export request, and the server obtains the predefined template according to the file export request, and Generate a list of row indicators to be exported based on the row indicator information defined by the template (the corresponding row parameter is rows), for example, the row indicator list to be exported is the row AutoRptCell list; the server generates the row indicator to be exported according to the column indicator information cols defined by the template List, for example, the column index list to be exported is the column AutoRptCell list, in which the server calculates the value range of the day, week, month, and year defined in the template, and generates an AutoRptCell for each day, week, month, and year, and the row AutoRptCell list includes The key=row_key of the row and the index position of the row in the spreadsheet excel (row index identifier), the column AutoRptCell list includes key=col_key+_+date_slice (time slice) and the index position in the excel (column indicator identification), through the two AutoRptCell lists, generate the indicator parameter matrix (AutoRptMatrix matrix) to be exported.
104、获取待导出键值对数据集,根据待导出指标参数矩阵和待导出键值对数据集生成电子表格数据流,并将电子表格数据流发送至目标终端,以使得目标终端按照电子表格数据流导出目标电子报表文件。104. Obtain the key-value pair data set to be exported, generate a spreadsheet data stream according to the index parameter matrix to be exported and the key-value pair data set to be exported, and send the spreadsheet data stream to the target terminal, so that the target terminal can follow the spreadsheet data The flow exports the target electronic report file.
其中,待导出指标参数矩阵以二维数组形式进行表示,例如,AutoRptCell[][],此数组形式可以直接通过公式表征的(n,m)的单元格进行计算,其中,n为行指标标识,m为列指标标识。由于所有的单元格以映射map的方式存储,例如,Map<key,AutoRptCell>,其中键key为查询key,服务器按照key直接在对应的数据存储表中查询该字段的数据,然后服务器获取数据后,服务器将数据设置到对应的AutoRptCell中,此时的AutoRptCell的行坐标、列坐标以及单元格值就已经全部处理完成,最后服务器遍历该Map.values(),逐一将其设置到excel中的每一个单元格中,得到电子表格数据流,服务器将设置值后的excel文件流返回至目标终端,以使得目标终端按照电子表格数据流导出目标电子报表文件。Among them, the index parameter matrix to be exported is represented in the form of a two-dimensional array, for example, AutoRptCell[][], this array form can be directly calculated by the cell of (n, m) represented by the formula, where n is the row index identifier , m is the column index identifier. Since all cells are stored in the way of mapping map, for example, Map<key, AutoRptCell>, where the key key is the query key, the server directly queries the data of this field in the corresponding data storage table according to the key, and then the server obtains the data after , the server sets the data to the corresponding AutoRptCell. At this time, the row coordinates, column coordinates and cell values of the AutoRptCell have all been processed. Finally, the server traverses the Map.values() and sets it to each cell in excel one by one. In one cell, the spreadsheet data stream is obtained, and the server returns the excel file stream with the set value to the target terminal, so that the target terminal exports the target electronic report file according to the spreadsheet data stream.
进一步地,服务器将电子表格数据流存储于区块链数据库中,具体此处不做限定。Further, the server stores the spreadsheet data stream in the blockchain database, which is not specifically limited here.
本申请实施例中,通过预设定时任务按照目标模板配置文件生成键值对数据集,根据文件导出请求生成待导出指标参数矩阵,根据待导出指标参数矩阵和待导出键值对数据集生成电子表格数据流,并将电子表格数据流发送至目标终端,以使得目标终端按照电子表格数据流导出目标电子报表文件。对每行的指标维护一个取值逻辑即可,不需要针对每个时间维度列分别支持脚本,增强了数据处理的稳定性,以及提高了数据处理效率。In the embodiment of the present application, a key-value pair data set is generated according to the target template configuration file through a preset timed task, an index parameter matrix to be exported is generated according to a file export request, and an electronic data set is generated according to the index parameter matrix to be exported and the key-value pair data set to be exported. form data stream, and send the spreadsheet data stream to the target terminal, so that the target terminal exports the target electronic report file according to the spreadsheet data stream. It is enough to maintain a value logic for the indicators of each row, and there is no need to support scripts for each time dimension column, which enhances the stability of data processing and improves the efficiency of data processing.
请参阅图2,本申请实施例中电子报表文件导出方法的另一个实施例包括:Referring to FIG. 2, another embodiment of the method for exporting an electronic report file in the embodiment of the present application includes:
201、当接收到模板配置请求时,按照模板配置请求获取待定义内容,根据待定义内容构建目标模板配置文件,并对目标模板配置文件进行缓存,目标模板配置文件包括行指标信息、列指标信息、数据存储表和表统计类型。201. When a template configuration request is received, obtain the content to be defined according to the template configuration request, build a target template configuration file according to the to-be-defined content, and cache the target template configuration file, where the target template configuration file includes row index information and column index information , datastore tables, and table statistics types.
其中,行指标信息可以包括行指标的名称和行坐标的起始值,还可以包括结构化查询语言sql脚本地址,具体此处不做限定;列指标信息可以包括列时刻维度和列坐标起始值,还可以包括统计时长范围和时长统计方式(例如正序统计方式或者逆序统计方式),具体此处不做限定,统计时长范围包括统计开始时刻和统计结束时刻;数据存储表用于指示模板数据保存的目标表,以供服务器进行数据存储操作;表统计类型包括联动数据统计方式(计算所有时刻维度范围的结果)和固化数据统计方式(仅计算当前报表日的数据)。Wherein, the row indicator information may include the name of the row indicator and the starting value of the row coordinate, and may also include the address of a structured query language sql script, which is not specifically limited here; the column indicator information may include the column time dimension and the starting value of the column coordinate value, and may also include the statistical duration range and duration statistical method (for example, the forward-order statistical method or the reverse-order statistical method), which is not specifically limited here. The statistical duration range includes the statistical start time and the statistical end time; the data storage table is used to indicate the template The target table for data storage for the server to perform data storage operations; the table statistics types include the linkage data statistics method (calculating the results of all time dimension ranges) and the solidified data statistics method (only calculating the data of the current report day).
可选的,当服务器接收到模板配置请求时,服务器解析模板配置请求,得到解析结果,当解析结果不为空值时,服务器从解析结果中读取待定义内容和模板标识,其中,待定义 内容为按照实际业务场景预先定义的指标,例如,金融信贷指标,也可以为其他指标,具体此处不做限定;服务器根据模板标识从预设数据库中获取初始模板配置数据,并按照初始模板配置数据对待定义内容进行数据格式转换和数据组合,得到封装后的模板数据,初始模板配置数据用于指示按照非标记语言YAML语法规则配置的数据;服务器将封装后的模板数据转换为目标模板配置文件,并将目标模板配置文件缓存至内存数据库中,目标模板配置文件包括行指标信息、列指标信息、数据存储表和表统计类型。Optionally, when the server receives the template configuration request, the server parses the template configuration request and obtains the parsing result. When the parsing result is not a null value, the server reads the content to be defined and the template identifier from the parsing result, wherein the to-be-defined The content is a pre-defined indicator according to the actual business scenario, for example, a financial credit indicator, or other indicators, which are not limited here; the server obtains the initial template configuration data from the preset database according to the template identifier, and configures it according to the initial template The data to be defined is subjected to data format conversion and data combination to obtain the encapsulated template data. The initial template configuration data is used to indicate the data configured according to the non-markup language YAML syntax rules; the server converts the encapsulated template data into the target template configuration file , and cache the target template configuration file in the memory database. The target template configuration file includes row indicator information, column indicator information, data storage table and table statistics type.
进一步地,服务器根据按照预设命名规则对目标模板配置文件进行命名,其中,预设命名规则可以确保目标模板配置文件命名的唯一性。需要说明的是,服务器将目标模板配置文件存储至内存数据库中,以便于提高数据查询效率。Further, the server names the target template configuration file according to a preset naming rule, wherein the preset naming rule can ensure the uniqueness of the naming of the target template configuration file. It should be noted that the server stores the target template configuration file in the in-memory database, so as to improve the data query efficiency.
202、通过预设定时任务从目标模板配置文件中获取行指标信息、列指标信息、数据存储表和表统计类型,根据行指标信息和列指标信息和表统计类型设置键值对数据集,并将键值对数据集存储至数据存储表中。202. Obtain row indicator information, column indicator information, data storage table and table statistics type from the target template configuration file through a preset timed task, set a key-value pair data set according to the row indicator information, column indicator information and table statistics type, and Store the key-value pair dataset in the datastore table.
其中,预设定时任务为预先设置的数据处理任务。可选的,服务器调用预设定时任务从内存数据库中读取目标模板配置文件,得到行指标信息、列指标信息、数据存储表和表统计类型;服务器对行指标信息和列指标信息进行指标解析,得到结构化查询语言脚本地址、统计时长范围、行指标标识和列指标标识,并按照表统计类型确定分组方式;服务器按照结构化查询语言脚本地址获取目标结构化查询语言脚本,并将统计时长范围和分组方式设置为目标结构化查询语言脚本对应的输入参数;服务器执行已设置输入参数的结构化查询语言脚本,得到查询数据,并将查询数据设置为目标值;服务器对行指标标识、列指标标识和统计时长范围按照先后顺序进行字符串拼接,得到目标键,将目标键和目标值设置为键值对数据集,并将键值对数据集更新至数据存储表中。The preset timing task is a preset data processing task. Optionally, the server invokes a preset timing task to read the target template configuration file from the in-memory database to obtain row indicator information, column indicator information, data storage table and table statistics type; the server performs indicator analysis on the row indicator information and column indicator information , obtain the structured query language script address, statistical duration range, row index ID and column index ID, and determine the grouping method according to the table statistics type; the server obtains the target structured query language script according to the structured query language script address, and counts the duration The range and grouping method are set to the input parameters corresponding to the target structured query language script; the server executes the structured query language script with the input parameters set to obtain the query data, and sets the query data as the target value; The indicator identification and the statistical duration range are spliced in sequence to obtain the target key, the target key and target value are set as the key-value pair dataset, and the key-value pair dataset is updated to the data storage table.
也就是,服务器分别对日、周、月、年进行数据统计,统计出来的数据拼接一个数据查询键key(目标键),例如,key采用行标识row_key、列标识col_key和时间切片(统计时长范围)date_slice进行拼接组合得到,也就是,key为row_key+_+col_key+_+date_slice。需要说明的是,结构化查询语言脚本地址用于指示调用目标结构化查询语言脚本,以使得结构化查询语言脚本按照结构化查询语句进行数据查询。That is, the server performs data statistics on days, weeks, months, and years, respectively, and splices the collected data into a data query key key (target key). )date_slice is obtained by splicing and combining, that is, the key is row_key+_+col_key+_+date_slice. It should be noted that the structured query language script address is used to indicate the calling target structured query language script, so that the structured query language script performs data query according to the structured query statement.
203、当接收到文件导出请求时,按照文件导出请求生成待导出行指标列表和待导出列指标列表,并将待导出行指标列表和待导出列指标列表合并为待导出指标参数矩阵。203. When a file export request is received, generate a row index list to be exported and a column index list to be exported according to the file export request, and combine the row index list to be exported and the column index list to be exported into an index parameter matrix to be exported.
可以理解的是,服务器接收文件导出请求,并按照文件导出请求进行数据合并操作。可选的,首先,当服务器接收到文件导出请求时,服务器对文件导出请求进行参数解析,得到参数解析结果,对参数解析结果进行参数验证,得到验证结果,其中,验证结果包括验证通过和验证未通过,验证通过可以采用1或者逻辑真true表示,验证未通过可以采用0或者逻辑假false表示。进一步地,服务器判断验证结果是否为预设值,当验证结果不为预设值时,服务器确定验证结果为验证未通过,服务器生成警示信息,并将警示信息发送至目标终端,警示信息用于指示文件导出存在异常;当验证结果为预设值时,服务器确定验证结果为验证通过。It can be understood that the server receives the file export request and performs a data merging operation according to the file export request. Optionally, first, when the server receives a file export request, the server performs parameter parsing on the file export request, obtains a parameter parsing result, and performs parameter verification on the parameter parsing result to obtain a verification result, where the verification result includes verification passed and verification. If it fails, the verification can be represented by 1 or logically true, and the verification failure can be represented by 0 or logical false. Further, the server determines whether the verification result is a preset value, and when the verification result is not a preset value, the server determines that the verification result is that the verification fails, the server generates warning information, and sends the warning information to the target terminal, and the warning information is used for Indicates that there is an exception in the file export; when the verification result is a preset value, the server determines that the verification result is passed.
其次,当验证结果为验证通过时,服务器从验证结果中获取待导出模板标识,并按照待导出模板标识从内存数据库中查询待导出的配置文件。其中,待导出模板标识可以为数字、字母或者下划线等字符组合而成的字符串,具有唯一性,例如,待导出模板标识为temp_001。Secondly, when the verification result is that the verification is passed, the server obtains the identifier of the template to be exported from the verification result, and queries the configuration file to be exported from the in-memory database according to the identifier of the template to be exported. The identifier of the template to be exported may be a character string composed of numbers, letters, or underscores, and is unique, for example, the identifier of the template to be exported is temp_001.
然后,服务器从待导出的配置文件中读取待导出行指标信息和待导出列指标信息,并根据待导出行指标信息和待导出列指标信息确定待导出行指标列表和待导出列指标列表,待导出行指标列表包括指标数据的行坐标和行指标标识,待导出列指标列表包括维度数据 的列坐标和列键信息,列键信息包括列指标标识和统计时长范围;最后,服务器按照指标数据的行坐标和维度数据的列坐标合将待导出行指标列表和待导出列指标列表组装为待导出指标参数矩阵。Then, the server reads the row index information to be exported and the column index information to be exported from the configuration file to be exported, and determines the row index list to be exported and the column index list to be exported according to the row index information to be exported and the column index information to be exported, The row index list to be exported includes the row coordinates and row index identifiers of the index data, the column index list to be exported includes the column coordinates and column key information of the dimension data, and the column key information includes the column index identifier and the statistical time range; The row coordinates of the dimensional data and the column coordinates of the dimension data are combined to assemble the to-be-exported row index list and the to-be-exported column index list into a to-be-exported index parameter matrix.
204、获取待导出键值对数据集,根据待导出指标参数矩阵和待导出键值对数据集生成电子表格数据流,并将电子表格数据流发送至目标终端,以使得目标终端按照电子表格数据流导出目标电子报表文件。204. Obtain the key-value pair data set to be exported, generate a spreadsheet data stream according to the index parameter matrix to be exported and the key-value pair data set to be exported, and send the spreadsheet data stream to the target terminal, so that the target terminal can follow the spreadsheet data The flow exports the target electronic report file.
需要说明的是,服务器还可以设置导出电子表格的各个列宽,也就是,服务器设置电子表格的上边界和下边界,并确定导出电子表格的各个行高,服务器依据各个列宽及各个行高切分出单元格。其中,电子报表文件包括电子报表编号、电子报表名称、电子报表内设置的公式以及报表类型,报表格式包括字体、线条与单元格宽度,还可以包括其他数据,具体此处不做限定。It should be noted that the server can also set the width of each column of the exported spreadsheet, that is, the server sets the upper and lower boundaries of the spreadsheet, and determines the height of each row of the exported spreadsheet. Cut out cells. The electronic report file includes the electronic report number, the electronic report name, the formula set in the electronic report, and the report type. The report format includes fonts, lines, and cell widths, and can also include other data, which is not limited here.
可选的,服务器遍历读取待导出指标参数矩阵,得到行指标标识、行坐标、列坐标和列键信息,并根据行指标标识和列指标标识组装成待查询键;服务器按照待查询键从数据存储表中查询待导出键值对数据集,按照行坐标和列坐标将待导出键值数据集赋值至待导出指标参数矩阵中,得到赋值后的指标矩阵,并基于赋值后的指标矩阵生成电子表格数据流,也就是,服务器将待导出指标参数矩阵设置为表头内容,将待导出键值对数据集设置为表体内容;服务器调用预设发送接口,将电子表格数据流发送至目标终端,以使得目标终端按照电子表格数据流导出目标电子报表文件。Optionally, the server traverses and reads the to-be-exported index parameter matrix, obtains row index identifiers, row coordinates, column coordinates, and column key information, and assembles the to-be-queried keys according to the row and column index identifiers; Query the key-value pair data set to be exported in the data storage table, assign the key-value data set to be exported to the index parameter matrix to be exported according to the row and column coordinates, obtain the assigned index matrix, and generate the index matrix based on the assigned index matrix Spreadsheet data flow, that is, the server sets the index parameter matrix to be exported as the header content, and sets the to-be-exported key-value pair data set as the table body content; the server calls the preset sending interface to send the spreadsheet data flow to the target terminal, so that the target terminal exports the target electronic report file according to the spreadsheet data flow.
进一步地,当服务器接收到文件测试请求时,服务器按照文件测试请求读取目标电子报表文件和目标结构化查询语言脚本;将目标电子报表文件和目标结构化查询语言脚本推送至测试终端,以使得测试终端对目标电子报表文件进行白盒测试,并对目标结构化查询语言脚本进行黑盒测试,大大提供了系统的稳定性。Further, when the server receives the file test request, the server reads the target electronic report file and the target structured query language script according to the file test request; the target electronic report file and the target structured query language script are pushed to the test terminal, so that The test terminal performs white-box testing on the target electronic report file and black-box testing on the target structured query language script, which greatly improves the stability of the system.
205、接收报表打印请求,从报表打印请求中确定待打印报表内容文件和用户标识信息,待打印报表内容文件属于目标电子报表文件。205. Receive a report printing request, and determine the report content file to be printed and user identification information from the report printing request, and the report content file to be printed belongs to the target electronic report file.
具体的,服务器接收报表打印请求,服务器解析报表打印请求,得到待打印文件标识和用户标识信息;服务器按照待打印文件标识查询内存数据库,得到待打印报表内容文件,待打印报表内容文件属于目标电子报表文件。也就是,服务器将预先导出的多个目标电子报表文件预先存储于内存数据库中。Specifically, the server receives the report print request, the server parses the report print request, and obtains the identification of the file to be printed and the user identification information; the server queries the memory database according to the identification of the file to be printed, and obtains the content file of the report to be printed, and the content file of the report to be printed belongs to the target electronic report file. That is, the server pre-stores the pre-exported plurality of target electronic report files in the in-memory database.
206、按照用户标识信息生成水印信息,并将水印信息嵌入至待打印报表内容文件中,得到包含水印的报表文件,对包含水印的报表文件进行打印。206. Generate watermark information according to the user identification information, and embed the watermark information into the report content file to be printed to obtain a report file containing the watermark, and print the report file containing the watermark.
其中,用户标识信息包括用户名、用户邮箱和用户电话等信息,具体此处不做限定。服务器将用户标识信息转换为水印图片(也就是水印信息);服务器将水印图片嵌入至待打印报表内容文件中,得到包含水印的报表文件;服务器按照预设打印参数和预设打印接口对对包含水印的报表文件进行打印。The user identification information includes information such as a user name, a user mailbox, and a user phone number, which is not specifically limited here. The server converts the user identification information into a watermark image (that is, watermark information); the server embeds the watermark image into the report content file to be printed, and obtains a report file containing the watermark; The watermarked report file is printed.
进一步地,服务器将报表打印请求和包含水印的报表文件记录至预设打印日志中。可以理解的是,预设打印日志用于记录报表打印请求的过程,以使得服务器实现对打印电子报表文件的全程状态追溯,提高了电子报表文件的安全性。Further, the server records the report print request and the report file containing the watermark into a preset print log. It can be understood that the preset print log is used to record the process of the report printing request, so that the server can trace the entire state of the printed electronic report file and improve the security of the electronic report file.
本申请实施例中,通过预设定时任务按照目标模板配置文件生成键值对数据集,根据文件导出请求生成待导出指标参数矩阵,根据待导出指标参数矩阵和待导出键值对数据集生成电子表格数据流,并将电子表格数据流发送至目标终端,以使得目标终端按照电子表格数据流导出目标电子报表文件。对每行的指标维护一个取值逻辑即可,不需要针对每个时间维度列分别支持脚本,增强了数据处理的稳定性,以及提高了数据处理效率。In the embodiment of the present application, a key-value pair data set is generated according to a target template configuration file through a preset timed task, an index parameter matrix to be exported is generated according to a file export request, and an electronic data set is generated according to the index parameter matrix to be exported and the key-value pair data set to be exported. form data stream, and send the spreadsheet data stream to the target terminal, so that the target terminal can export the target electronic report file according to the spreadsheet data stream. It is enough to maintain a value logic for the indicators of each row. It is not necessary to support scripts for each time dimension column, which enhances the stability of data processing and improves the efficiency of data processing.
上面对本申请实施例中电子报表文件导出方法进行了描述,下面对本申请实施例中电 子报表文件导出装置进行描述,请参阅图3,本申请实施例中电子报表文件导出装置的一个实施例包括:The electronic report file export method in the embodiment of the application has been described above, and the electronic report file export device in the embodiment of the application is described below, referring to Fig. 3, an embodiment of the electronic report file export device in the embodiment of the application includes:
获取模块301,当接收到模板配置请求时,用于按照模板配置请求获取待定义内容,根据待定义内容构建目标模板配置文件,并对目标模板配置文件进行缓存,目标模板配置文件包括行指标信息、列指标信息、数据存储表和表统计类型;The obtaining module 301, when a template configuration request is received, is used to obtain the content to be defined according to the template configuration request, build a target template configuration file according to the to-be-defined content, and cache the target template configuration file, where the target template configuration file includes row index information , column indicator information, data storage table and table statistics type;
设置模块302,用于通过预设定时任务从目标模板配置文件中获取行指标信息、列指标信息、数据存储表和表统计类型,根据行指标信息和列指标信息和表统计类型设置键值对数据集,并将键值对数据集存储至数据存储表中;The setting module 302 is used to obtain row indicator information, column indicator information, data storage table and table statistics type from the target template configuration file through a preset timing task, and set key-value pairs according to the row indicator information, column indicator information and table statistics type data set, and store the key-value pair data set in the data storage table;
合并模块303,当接收到文件导出请求时,用于按照文件导出请求生成待导出行指标列表和待导出列指标列表,并将待导出行指标列表和待导出列指标列表合并为待导出指标参数矩阵;The merging module 303, when receiving a file export request, is configured to generate a row index list to be exported and a column index list to be exported according to the file export request, and combine the row index list to be exported and the column index list to be exported into index parameters to be exported matrix;
导出模块304,用于获取待导出键值对数据集,根据待导出指标参数矩阵和待导出键值对数据集生成电子表格数据流,并将电子表格数据流发送至目标终端,以使得目标终端按照电子表格数据流导出目标电子报表文件。The export module 304 is configured to obtain a data set of key-value pairs to be exported, generate a spreadsheet data stream according to the index parameter matrix to be exported and the key-value pair data set to be exported, and send the spreadsheet data stream to the target terminal, so that the target terminal Export the target spreadsheet file according to the spreadsheet data flow.
进一步地,将电子表格数据流存储于区块链数据库中,具体此处不做限定。Further, the spreadsheet data stream is stored in the blockchain database, which is not specifically limited here.
本申请实施例中,通过预设定时任务按照目标模板配置文件生成键值对数据集,根据文件导出请求生成待导出指标参数矩阵,根据待导出指标参数矩阵和待导出键值对数据集生成电子表格数据流,并将电子表格数据流发送至目标终端,以使得目标终端按照电子表格数据流导出目标电子报表文件。对每行的指标维护一个取值逻辑即可,不需要针对每个时间维度列分别支持脚本,增强了数据处理的稳定性,以及提高了数据处理效率。In the embodiment of the present application, a key-value pair data set is generated according to a target template configuration file through a preset timed task, an index parameter matrix to be exported is generated according to a file export request, and an electronic data set is generated according to the index parameter matrix to be exported and the key-value pair data set to be exported. form data stream, and send the spreadsheet data stream to the target terminal, so that the target terminal can export the target electronic report file according to the spreadsheet data stream. It is enough to maintain a value logic for the indicators of each row. It is not necessary to support scripts for each time dimension column, which enhances the stability of data processing and improves the efficiency of data processing.
请参阅图4,本申请实施例中电子报表文件导出装置的另一个实施例包括:Referring to FIG. 4, another embodiment of the electronic report file exporting device in the embodiment of the present application includes:
获取模块301,当接收到模板配置请求时,用于按照模板配置请求获取待定义内容,根据待定义内容构建目标模板配置文件,并对目标模板配置文件进行缓存,目标模板配置文件包括行指标信息、列指标信息、数据存储表和表统计类型;The obtaining module 301, when a template configuration request is received, is used to obtain the content to be defined according to the template configuration request, build a target template configuration file according to the to-be-defined content, and cache the target template configuration file, where the target template configuration file includes row index information , column indicator information, data storage table and table statistics type;
设置模块302,用于通过预设定时任务从目标模板配置文件中获取行指标信息、列指标信息、数据存储表和表统计类型,根据行指标信息和列指标信息和表统计类型设置键值对数据集,并将键值对数据集存储至数据存储表中;The setting module 302 is used to obtain row indicator information, column indicator information, data storage table and table statistics type from the target template configuration file through a preset timing task, and set key-value pairs according to the row indicator information, column indicator information and table statistics type data set, and store the key-value pair data set in the data storage table;
合并模块303,当接收到文件导出请求时,用于按照文件导出请求生成待导出行指标列表和待导出列指标列表,并将待导出行指标列表和待导出列指标列表合并为待导出指标参数矩阵;The merging module 303, when receiving a file export request, is configured to generate a row index list to be exported and a column index list to be exported according to the file export request, and combine the row index list to be exported and the column index list to be exported into index parameters to be exported matrix;
导出模块304,用于获取待导出键值对数据集,根据待导出指标参数矩阵和待导出键值对数据集生成电子表格数据流,并将电子表格数据流发送至目标终端,以使得目标终端按照电子表格数据流导出目标电子报表文件。The export module 304 is configured to obtain a data set of key-value pairs to be exported, generate a spreadsheet data stream according to the index parameter matrix to be exported and the key-value pair data set to be exported, and send the spreadsheet data stream to the target terminal, so that the target terminal Export the target spreadsheet file according to the spreadsheet data flow.
可选的,获取模块301还可以具体用于:Optionally, the obtaining module 301 can also be specifically used for:
当接收到模板配置请求时,解析模板配置请求,得到解析结果,当解析结果不为空值时,从解析结果中读取待定义内容和模板标识;When a template configuration request is received, the template configuration request is parsed to obtain the parsing result, and when the parsing result is not a null value, the content to be defined and the template identifier are read from the parsing result;
根据模板标识从预设数据库中获取初始模板配置数据,并按照初始模板配置数据对待定义内容进行数据格式转换和数据组合,得到封装后的模板数据,初始模板配置数据用于指示按照非标记语言YAML语法规则配置的数据;Obtain the initial template configuration data from the preset database according to the template identifier, and perform data format conversion and data combination on the content to be defined according to the initial template configuration data to obtain the encapsulated template data. The initial template configuration data is used to indicate that according to the non-markup language YAML Syntax rule configuration data;
将封装后的模板数据转换为目标模板配置文件,并将目标模板配置文件缓存至内存数据库中,目标模板配置文件包括行指标信息、列指标信息、数据存储表和表统计类型。Convert the encapsulated template data into a target template configuration file, and cache the target template configuration file in the memory database. The target template configuration file includes row indicator information, column indicator information, data storage table and table statistics type.
可选的,设置模块302还具体用于:Optionally, the setting module 302 is also specifically used for:
调用预设定时任务从内存数据库中读取目标模板配置文件,得到行指标信息、列指标 信息、数据存储表和表统计类型;Call the preset timing task to read the target template configuration file from the memory database, and obtain row index information, column index information, data storage table and table statistics type;
对行指标信息和列指标信息进行指标解析,得到结构化查询语言脚本地址、统计时长范围、行指标标识和列指标标识,并按照表统计类型确定分组方式;Perform index analysis on the row index information and column index information to obtain the structured query language script address, statistical time range, row index identification and column index identification, and determine the grouping method according to the table statistics type;
按照结构化查询语言脚本地址获取目标结构化查询语言脚本,并将统计时长范围和分组方式设置为目标结构化查询语言脚本对应的输入参数;Obtain the target structured query language script according to the structured query language script address, and set the statistical time range and grouping method as the input parameters corresponding to the target structured query language script;
执行已设置输入参数的结构化查询语言脚本,得到查询数据,并将查询数据设置为目标值;Execute the structured query language script with the input parameters set to obtain the query data, and set the query data as the target value;
对行指标标识、列指标标识和统计时长范围按照先后顺序进行字符串拼接,得到目标键,将目标键和目标值设置为键值对数据集,并将键值对数据集更新至数据存储表中。String splicing is performed on row indicator identifiers, column indicator identifiers, and statistical duration ranges in order to obtain the target key, set the target key and target value as the key-value pair dataset, and update the key-value pair dataset to the data storage table middle.
可选的,合并模块303还可以具体用于:Optionally, the merging module 303 can also be specifically used for:
当接收到文件导出请求时,对文件导出请求进行参数解析,得到参数解析结果,对参数解析结果进行参数验证,得到验证结果;When receiving a file export request, perform parameter parsing on the file export request to obtain the parameter parsing result, and perform parameter verification on the parameter parsing result to obtain the verification result;
当验证结果为验证通过时,从验证结果中获取待导出模板标识,并按照待导出模板标识从内存数据库中查询待导出的配置文件;When the verification result is that the verification is passed, obtain the template identifier to be exported from the verification result, and query the configuration file to be exported from the memory database according to the template identifier to be exported;
从待导出的配置文件中读取待导出行指标信息和待导出列指标信息,并根据待导出行指标信息和待导出列指标信息确定待导出行指标列表和待导出列指标列表,待导出行指标列表包括指标数据的行坐标和行指标标识,待导出列指标列表包括维度数据的列坐标和列键信息,列键信息包括列指标标识和统计时长范围;Read the row index information to be exported and the column index information to be exported from the configuration file to be exported, and determine the row index list to be exported and the column index list to be exported according to the row index information to be exported and the column index information to be exported. The indicator list includes row coordinates and row indicator identifiers of indicator data, the column indicator list to be exported includes column coordinates and column key information of dimension data, and the column key information includes column indicator identifiers and statistical time ranges;
按照指标数据的行坐标和维度数据的列坐标合将待导出行指标列表和待导出列指标列表组装为待导出指标参数矩阵。According to the row coordinates of the indicator data and the column coordinates of the dimension data, the to-be-exported row indicator list and the to-be-exported column indicator list are assembled into a to-be-exported indicator parameter matrix.
可选的,导出模块304还可以具体用于:Optionally, the export module 304 can also be specifically used for:
遍历读取待导出指标参数矩阵,得到行指标标识、行坐标、列坐标和列键信息,并根据行指标标识和列指标标识组装成待查询键;Traverse and read the index parameter matrix to be exported, obtain row index identification, row coordinates, column coordinates and column key information, and assemble the to-be-queried key according to the row index identification and column index identification;
按照待查询键从数据存储表中查询待导出键值对数据集,按照行坐标和列坐标将待导出键值数据集赋值至待导出指标参数矩阵中,得到赋值后的指标矩阵,并基于赋值后的指标矩阵生成电子表格数据流;Query the data set of key-value pairs to be exported from the data storage table according to the key to be queried, and assign the key-value data set to be exported to the index parameter matrix to be exported according to the row and column coordinates to obtain the assigned index matrix, and based on the assignment The resulting indicator matrix generates a spreadsheet data stream;
调用预设发送接口,将电子表格数据流发送至目标终端,以使得目标终端按照电子表格数据流导出目标电子报表文件。The preset sending interface is called to send the spreadsheet data stream to the target terminal, so that the target terminal exports the target electronic report file according to the spreadsheet data stream.
可选的,电子报表文件导出装置还包括:Optionally, the electronic report file exporting device further includes:
读取模块305,当接收到文件测试请求时,用于按照文件测试请求读取目标电子报表文件和目标结构化查询语言脚本;The reading module 305, when receiving the file test request, is used to read the target electronic report file and the target structured query language script according to the file test request;
测试模块306,用于将目标电子报表文件和目标结构化查询语言脚本推送至测试终端,以使得测试终端对目标电子报表文件进行白盒测试,并对目标结构化查询语言脚本进行黑盒测试。The test module 306 is configured to push the target electronic report file and the target structured query language script to the test terminal, so that the test terminal performs white box testing on the target electronic report file and black box test on the target structured query language script.
可选的,电子报表文件导出装置还包括:Optionally, the electronic report file exporting device further includes:
确定模块307,用于接收报表打印请求,从报表打印请求中确定待打印报表内容文件和用户标识信息,待打印报表内容文件属于目标电子报表文件;A determination module 307, configured to receive a report printing request, and determine the report content file to be printed and the user identification information from the report printing request, and the report content file to be printed belongs to the target electronic report file;
打印模块308,用于按照用户标识信息生成水印信息,并将水印信息嵌入至待打印报表内容文件中,得到包含水印的报表文件,对包含水印的报表文件进行打印。The printing module 308 is configured to generate watermark information according to the user identification information, embed the watermark information into the report content file to be printed, obtain a report file containing the watermark, and print the report file containing the watermark.
本申请实施例中,通过预设定时任务按照目标模板配置文件生成键值对数据集,根据文件导出请求生成待导出指标参数矩阵,根据待导出指标参数矩阵和待导出键值对数据集生成电子表格数据流,并将电子表格数据流发送至目标终端,以使得目标终端按照电子表格数据流导出目标电子报表文件。对每行的指标维护一个取值逻辑即可,不需要针对每个 时间维度列分别支持脚本,增强了数据处理的稳定性,以及提高了数据处理效率。In the embodiment of the present application, a key-value pair data set is generated according to a target template configuration file through a preset timed task, an index parameter matrix to be exported is generated according to a file export request, and an electronic data set is generated according to the index parameter matrix to be exported and the key-value pair data set to be exported. form data stream, and send the spreadsheet data stream to the target terminal, so that the target terminal can export the target electronic report file according to the spreadsheet data stream. It is enough to maintain a value logic for the indicators of each row. It is not necessary to support scripts for each time dimension column, which enhances the stability of data processing and improves the efficiency of data processing.
上面图3和图4从模块化的角度对本申请实施例中的电子报表文件导出装置进行详细描述,下面从硬件处理的角度对本申请实施例中电子报表文件导出设备进行详细描述。3 and 4 above describe in detail the electronic report file exporting device in the embodiment of the present application from the perspective of modularization, and the electronic report file exporting device in the embodiment of the present application is described in detail below from the perspective of hardware processing.
图5是本申请实施例提供的一种电子报表文件导出设备的结构示意图,该电子报表文件导出设备500可因配置或性能不同而产生比较大的差异,可以包括一个或一个以上处理器(central processing units,CPU)510(例如,一个或一个以上处理器)和存储器520,一个或一个以上存储应用程序533或数据532的存储介质530(例如一个或一个以上海量存储设备)。其中,存储器520和存储介质530可以是短暂存储或持久存储。存储在存储介质530的程序可以包括一个或一个以上模块(图示没标出),每个模块可以包括对电子报表文件导出设备500中的一系列指令操作。更进一步地,处理器510可以设置为与存储介质530通信,在电子报表文件导出设备500上执行存储介质530中的一系列指令操作。FIG. 5 is a schematic structural diagram of an electronic report file export device provided by an embodiment of the present application. The electronic report file export device 500 may vary greatly due to different configurations or performances, and may include one or more processors (central processing units, CPU) 510 (eg, one or more processors) and memory 520, one or more storage media 530 (eg, one or more mass storage devices) that store application programs 533 or data 532. Among them, the memory 520 and the storage medium 530 may be short-term storage or persistent storage. The program stored in the storage medium 530 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations in the electronic report file exporting device 500 . Furthermore, the processor 510 may be configured to communicate with the storage medium 530 to execute a series of instruction operations in the storage medium 530 on the electronic report file exporting device 500 .
电子报表文件导出设备500还可以包括一个或一个以上电源540,一个或一个以上有线或无线网络接口550,一个或一个以上输入输出接口560,和/或,一个或一个以上操作系统531,例如Windows Serve,Mac OS X,Unix,Linux,FreeBSD等等。本领域技术人员可以理解,图5示出的电子报表文件导出设备结构并不构成对电子报表文件导出设备的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。The electronic report file exporting device 500 may also include one or more power supplies 540, one or more wired or wireless network interfaces 550, one or more input and output interfaces 560, and/or, one or more operating systems 531, such as Windows Serve, Mac OS X, Unix, Linux, FreeBSD, and more. Those skilled in the art can understand that the structure of the electronic report file export device shown in FIG. 5 does not constitute a limitation on the electronic report file export device, and may include more or less components than the one shown, or combine some components, or Different component arrangements.
本申请还提供一种计算机可读存储介质,该计算机可读存储介质可以为非易失性计算机可读存储介质,该计算机可读存储介质也可以为易失性计算机可读存储介质,所述计算机可读存储介质中存储有指令,当所述指令在计算机上运行时,使得计算机执行如下步骤:The present application also provides a computer-readable storage medium. The computer-readable storage medium may be a non-volatile computer-readable storage medium. The computer-readable storage medium may also be a volatile computer-readable storage medium. Instructions are stored in the computer-readable storage medium, and when the instructions are executed on the computer, the computer performs the following steps:
当接收到模板配置请求时,按照所述模板配置请求获取待定义内容,根据所述待定义内容构建目标模板配置文件,并对所述目标模板配置文件进行缓存,所述目标模板配置文件包括行指标信息、列指标信息、数据存储表和表统计类型;When a template configuration request is received, the content to be defined is obtained according to the template configuration request, a target template configuration file is constructed according to the to-be-defined content, and the target template configuration file is cached, and the target template configuration file includes a line Indicator information, column indicator information, data storage table and table statistics type;
通过预设定时任务从所述目标模板配置文件中获取所述行指标信息、所述列指标信息、所述数据存储表和所述表统计类型,根据所述行指标信息和所述列指标信息和所述表统计类型设置键值对数据集,并将所述键值对数据集存储至所述数据存储表中;Obtain the row indicator information, the column indicator information, the data storage table and the table statistics type from the target template configuration file through a preset timed task, and according to the row indicator information and the column indicator information Setting a key-value pair dataset with the table statistics type, and storing the key-value pair dataset in the data storage table;
当接收到文件导出请求时,按照所述文件导出请求生成待导出行指标列表和待导出列指标列表,并将所述待导出行指标列表和所述待导出列指标列表合并为待导出指标参数矩阵;When a file export request is received, a list of row indicators to be exported and a list of column indicators to be exported are generated according to the file export request, and the list of row indicators to be exported and the list of column indicators to be exported are combined into indicator parameters to be exported matrix;
获取待导出键值对数据集,根据所述待导出指标参数矩阵和所述待导出键值对数据集生成电子表格数据流,并将所述电子表格数据流发送至目标终端,以使得所述目标终端按照所述电子表格数据流导出目标电子报表文件。Obtain the key-value pair data set to be exported, generate a spreadsheet data stream according to the to-be-exported index parameter matrix and the to-be-exported key-value pair data set, and send the spreadsheet data stream to the target terminal, so that the The target terminal exports the target electronic report file according to the data flow of the electronic form.
本申请还提供一种电子报表文件导出设备,所述电子报表文件导出设备包括存储器和处理器,存储器中存储有指令,所述指令被处理器执行时,使得处理器执行上述每个实施例中的所述电子报表文件导出方法的步骤。The present application also provides an electronic report file exporting device, the electronic report file exporting device includes a memory and a processor, and instructions are stored in the memory, and when the instructions are executed by the processor, the processor executes each of the above embodiments. The steps of the electronic report file export method.
进一步地,所述计算机可读存储介质可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序等;存储数据区可存储根据区块链节点的使用所创建的数据等。Further, the computer-readable storage medium may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required by at least one function, and the like; The data created by the use of the node, etc.
本申请所指区块链是分布式数据存储、点对点传输、共识机制、加密算法等计算机技术的新型应用模式。区块链(Blockchain),本质上是一个去中心化的数据库,是一串使用密码学方法相关联产生的数据块,每一个数据块中包含了一批次网络交易的信息,用于验证其信息的有效性(防伪)和生成下一个区块。区块链可以包括区块链底层平台、平台产品服务层以及应用服务层等。The blockchain referred to in this application is a new application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, and encryption algorithm. Blockchain, essentially a decentralized database, is a series of data blocks associated with cryptographic methods. Each data block contains a batch of network transaction information to verify its Validity of information (anti-counterfeiting) and generation of the next block. The blockchain can include the underlying platform of the blockchain, the platform product service layer, and the application service layer.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统,装 置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the system, device and unit described above can be referred to the corresponding process in the foregoing method embodiments, which will not be repeated here.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请每个个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(read-only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等每个种可以存储程序代码的介质。The integrated unit, if implemented in the form of a software functional unit and sold or used as an independent product, may be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the present application can be embodied in the form of software products in essence, or the parts that contribute to the prior art, or all or part of the technical solutions, and the computer software products are stored in a storage medium , including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), magnetic disk or CD, etc., each of which can store program codes. medium.
以上所述,以上实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述每个实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请每个实施例技术方案的精神和范围。As mentioned above, the above embodiments are only used to illustrate the technical solutions of the present application, but not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand: The technical solutions described in each embodiment are modified, or some technical features thereof are equivalently replaced; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions in each embodiment of the present application.

Claims (20)

  1. 一种电子报表文件导出方法,其中,包括:A method for exporting an electronic report file, comprising:
    当接收到模板配置请求时,按照所述模板配置请求获取待定义内容,根据所述待定义内容构建目标模板配置文件,并对所述目标模板配置文件进行缓存,所述目标模板配置文件包括行指标信息、列指标信息、数据存储表和表统计类型;When a template configuration request is received, the content to be defined is obtained according to the template configuration request, a target template configuration file is constructed according to the to-be-defined content, and the target template configuration file is cached, and the target template configuration file includes a line Indicator information, column indicator information, data storage table and table statistics type;
    通过预设定时任务从所述目标模板配置文件中获取所述行指标信息、所述列指标信息、所述数据存储表和所述表统计类型,根据所述行指标信息和所述列指标信息和所述表统计类型设置键值对数据集,并将所述键值对数据集存储至所述数据存储表中;Obtain the row indicator information, the column indicator information, the data storage table and the table statistics type from the target template configuration file through a preset timed task, and according to the row indicator information and the column indicator information Setting a key-value pair dataset with the table statistics type, and storing the key-value pair dataset in the data storage table;
    当接收到文件导出请求时,按照所述文件导出请求生成待导出行指标列表和待导出列指标列表,并将所述待导出行指标列表和所述待导出列指标列表合并为待导出指标参数矩阵;When a file export request is received, a list of row indicators to be exported and a list of column indicators to be exported are generated according to the file export request, and the list of row indicators to be exported and the list of column indicators to be exported are combined into indicator parameters to be exported matrix;
    获取待导出键值对数据集,根据所述待导出指标参数矩阵和所述待导出键值对数据集生成电子表格数据流,并将所述电子表格数据流发送至目标终端,以使得所述目标终端按照所述电子表格数据流导出目标电子报表文件。Obtain the key-value pair data set to be exported, generate a spreadsheet data stream according to the to-be-exported index parameter matrix and the to-be-exported key-value pair data set, and send the spreadsheet data stream to the target terminal, so that the The target terminal exports the target electronic report file according to the data flow of the electronic form.
  2. 根据权利要求1所述的电子报表文件导出方法,其中,所述当接收到模板配置请求时,按照所述模板配置请求获取待定义内容,根据所述待定义内容构建目标模板配置文件,并对所述目标模板配置文件进行缓存,所述目标模板配置文件包括行指标信息、列指标信息、数据存储表和表统计类型,包括:The method for exporting an electronic report file according to claim 1, wherein when a template configuration request is received, content to be defined is obtained according to the template configuration request, a target template configuration file is constructed according to the content to be defined, and a The target template configuration file is cached, and the target template configuration file includes row indicator information, column indicator information, data storage table and table statistics type, including:
    当接收到模板配置请求时,解析所述模板配置请求,得到解析结果,当所述解析结果不为空值时,从所述解析结果中读取待定义内容和模板标识;When a template configuration request is received, the template configuration request is parsed to obtain a parsing result, and when the parsing result is not a null value, the content to be defined and the template identifier are read from the parsing result;
    根据所述模板标识从预设数据库中获取初始模板配置数据,并按照所述初始模板配置数据对所述待定义内容进行数据格式转换和数据组合,得到封装后的模板数据,所述初始模板配置数据用于指示按照非标记语言YAML语法规则配置的数据;Obtain initial template configuration data from a preset database according to the template identifier, and perform data format conversion and data combination on the to-be-defined content according to the initial template configuration data to obtain encapsulated template data. The initial template configuration Data is used to indicate data configured according to non-markup language YAML syntax rules;
    将所述封装后的模板数据转换为目标模板配置文件,并将所述目标模板配置文件缓存至内存数据库中,所述目标模板配置文件包括行指标信息、列指标信息、数据存储表和表统计类型。Convert the encapsulated template data into a target template configuration file, and cache the target template configuration file in an in-memory database, where the target template configuration file includes row index information, column index information, data storage table and table statistics type.
  3. 根据权利要求2所述的电子报表文件导出方法,其中,所述通过预设定时任务从所述目标模板配置文件中获取所述行指标信息、所述列指标信息、所述数据存储表和所述表统计类型,根据所述行指标信息和所述列指标信息和所述表统计类型设置键值对数据集,并将所述键值对数据集存储至所述数据存储表中,包括:The method for exporting an electronic report file according to claim 2, wherein the row index information, the column index information, the data storage table and all the data are obtained from the target template configuration file through a preset timed task. Describe the table statistics type, set a key-value pair dataset according to the row indicator information, the column indicator information and the table statistics type, and store the key-value pair dataset in the data storage table, including:
    调用预设定时任务从所述内存数据库中读取所述目标模板配置文件,得到所述行指标信息、所述列指标信息、所述数据存储表和所述表统计类型;Invoking a preset timing task to read the target template configuration file from the in-memory database to obtain the row indicator information, the column indicator information, the data storage table and the table statistics type;
    对所述行指标信息和所述列指标信息进行指标解析,得到结构化查询语言脚本地址、统计时长范围、行指标标识和列指标标识,并按照所述表统计类型确定分组方式;Performing index analysis on the row index information and the column index information, obtaining a structured query language script address, a statistical duration range, a row index identifier and a column index identifier, and determining a grouping method according to the table statistics type;
    按照所述结构化查询语言脚本地址获取目标结构化查询语言脚本,并将所述统计时长范围和所述分组方式设置为所述目标结构化查询语言脚本对应的输入参数;Acquire a target structured query language script according to the structured query language script address, and set the statistical duration range and the grouping method as input parameters corresponding to the target structured query language script;
    执行已设置输入参数的结构化查询语言脚本,得到查询数据,并将所述查询数据设置为目标值;Execute the structured query language script with the input parameters set to obtain query data, and set the query data as the target value;
    对所述行指标标识、所述列指标标识和所述统计时长范围按照先后顺序进行字符串拼接,得到目标键,将所述目标键和所述目标值设置为键值对数据集,并将所述键值对数据集更新至所述数据存储表中。String splicing is performed on the row index identification, the column index identification and the statistical duration range in order to obtain a target key, the target key and the target value are set as a key-value pair data set, and the The key-value pair dataset is updated into the data storage table.
  4. 根据权利要求3所述的电子报表文件导出方法,其中,所述当接收到文件导出请求时,按照所述文件导出请求生成待导出行指标列表和待导出列指标列表,并将所述待导出 行指标列表和所述待导出列指标列表合并为待导出指标参数矩阵,包括:The method for exporting an electronic report file according to claim 3, wherein when a file export request is received, a row index list to be exported and a column index list to be exported are generated according to the file export request, and the index list to be exported is generated. The row index list and the to-be-exported column index list are combined into a to-be-exported index parameter matrix, including:
    当接收到文件导出请求时,对所述文件导出请求进行参数解析,得到参数解析结果,对所述参数解析结果进行参数验证,得到验证结果;When receiving a file export request, perform parameter parsing on the file export request to obtain a parameter parsing result, and perform parameter verification on the parameter parsing result to obtain a verification result;
    当所述验证结果为验证通过时,从所述验证结果中获取待导出模板标识,并按照所述待导出模板标识从所述内存数据库中查询待导出的配置文件;When the verification result is that the verification is passed, obtain the template identifier to be exported from the verification result, and query the configuration file to be exported from the memory database according to the template identifier to be exported;
    从所述待导出的配置文件中读取待导出行指标信息和待导出列指标信息,并根据所述待导出行指标信息和所述待导出列指标信息确定待导出行指标列表和待导出列指标列表,所述待导出行指标列表包括指标数据的行坐标和所述行指标标识,所述待导出列指标列表包括维度数据的列坐标和列键信息,所述列键信息包括所述列指标标识和所述统计时长范围;Read the row index information to be exported and the column index information to be exported from the configuration file to be exported, and determine the row index list to be exported and the column index information to be exported according to the row index information to be exported and the column index information to be exported An index list, the row index list to be exported includes row coordinates of index data and the row index identifier, the column index list to be exported includes column coordinates of dimension data and column key information, and the column key information includes the column Indicator identification and the statistical time range;
    按照所述指标数据的行坐标和所述维度数据的列坐标合将所述待导出行指标列表和所述待导出列指标列表组装为待导出指标参数矩阵。The row index list to be exported and the column index list to be exported are assembled into an index parameter matrix to be exported according to the row coordinates of the index data and the column coordinates of the dimension data.
  5. 根据权利要求4所述的电子报表文件导出方法,其中,所述获取待导出键值对数据集,根据所述待导出指标参数矩阵和所述待导出键值对数据集生成电子表格数据流,并将所述电子表格数据流发送至目标终端,以使得所述目标终端按照所述电子表格数据流导出目标电子报表文件,包括:The method for exporting an electronic report file according to claim 4, wherein the acquiring the key-value pair data set to be exported generates a spreadsheet data stream according to the to-be-exported index parameter matrix and the to-be-exported key-value pair data set, and sending the spreadsheet data stream to the target terminal, so that the target terminal exports the target electronic report file according to the spreadsheet data stream, including:
    遍历读取所述待导出指标参数矩阵,得到所述行指标标识、所述行坐标、所述列坐标和所述列键信息,并根据所述行指标标识和所述列指标标识组装成待查询键;Traversing and reading the to-be-derived index parameter matrix, obtaining the row index identifier, the row coordinate, the column coordinate and the column key information, and assembling the to-be-to-be-index identifier according to the row index identifier and the column index identifier query key;
    按照所述待查询键从所述数据存储表中查询待导出键值对数据集,按照所述行坐标和所述列坐标将所述待导出键值数据集赋值至所述待导出指标参数矩阵中,得到赋值后的指标矩阵,并基于所述赋值后的指标矩阵生成电子表格数据流;The key-value pair data set to be exported is queried from the data storage table according to the key to be queried, and the key-value data set to be exported is assigned to the index parameter matrix to be exported according to the row coordinates and the column coordinates , obtain the index matrix after the assignment, and generate a spreadsheet data stream based on the index matrix after the assignment;
    调用预设发送接口,将所述电子表格数据流发送至目标终端,以使得所述目标终端按照所述电子表格数据流导出目标电子报表文件。A preset sending interface is called to send the spreadsheet data stream to the target terminal, so that the target terminal exports the target electronic report file according to the spreadsheet data stream.
  6. 根据权利要求1-5中任意一项所述的电子报表文件导出方法,其中,在所述获取待导出键值对数据集,根据所述待导出指标参数矩阵和所述待导出键值对数据集生成电子表格数据流,并将所述电子表格数据流发送至目标终端,以使得所述目标终端按照所述电子表格数据流导出目标电子报表文件之后,所述电子报表文件导出方法还包括:The method for exporting an electronic report file according to any one of claims 1-5, wherein, in the obtaining of the key-value pair data set to be exported, according to the to-be-exported index parameter matrix and the to-be-exported key-value pair data After generating a spreadsheet data stream, and sending the spreadsheet data stream to the target terminal, so that the target terminal exports the target electronic report file according to the spreadsheet data stream, the method for exporting the electronic report file further includes:
    当接收到文件测试请求时,按照所述文件测试请求读取所述目标电子报表文件和目标结构化查询语言脚本;When receiving the file test request, read the target electronic report file and the target structured query language script according to the file test request;
    将所述目标电子报表文件和所述目标结构化查询语言脚本推送至测试终端,以使得所述测试终端对所述目标电子报表文件进行白盒测试,并对所述目标结构化查询语言脚本进行黑盒测试。Push the target electronic report file and the target structured query language script to the test terminal, so that the test terminal performs a white-box test on the target electronic report file and performs a white-box test on the target structured query language script. Black box testing.
  7. 根据权利要求1-5中任意一项所述的电子报表文件导出方法,其中,在所述获取待导出键值对数据集,根据所述待导出指标参数矩阵和所述待导出键值对数据集生成电子表格数据流,并将所述电子表格数据流发送至目标终端,以使得所述目标终端按照所述电子表格数据流导出目标电子报表文件之后,所述电子报表文件导出方法还包括:The method for exporting an electronic report file according to any one of claims 1-5, wherein, in the obtaining of the key-value pair data set to be exported, according to the to-be-exported index parameter matrix and the to-be-exported key-value pair data After generating a spreadsheet data stream, and sending the spreadsheet data stream to the target terminal, so that the target terminal exports the target electronic report file according to the spreadsheet data stream, the method for exporting the electronic report file further includes:
    接收报表打印请求,从所述报表打印请求中确定待打印报表内容文件和用户标识信息,所述待打印报表内容文件属于所述目标电子报表文件;receiving a report form printing request, and determining a report form content file to be printed and user identification information from the report form printing request, and the to-be-printed report form content file belongs to the target electronic report form file;
    按照所述用户标识信息生成水印信息,并将所述水印信息嵌入至所述待打印报表内容文件中,得到包含水印的报表文件,对所述包含水印的报表文件进行打印。Generate watermark information according to the user identification information, and embed the watermark information into the report content file to be printed to obtain a report file containing the watermark, and print the report file containing the watermark.
  8. 一种电子报表文件导出设备,包括存储器、处理器及存储在所述存储器上并可在所述处理器上运行的计算机可读指令,所述处理器执行所述计算机可读指令时实现如下步骤:An electronic report file export device, comprising a memory, a processor and a computer-readable instruction stored on the memory and running on the processor, the processor implements the following steps when executing the computer-readable instruction :
    当接收到模板配置请求时,按照所述模板配置请求获取待定义内容,根据所述待定义 内容构建目标模板配置文件,并对所述目标模板配置文件进行缓存,所述目标模板配置文件包括行指标信息、列指标信息、数据存储表和表统计类型;When a template configuration request is received, the content to be defined is obtained according to the template configuration request, a target template configuration file is constructed according to the to-be-defined content, and the target template configuration file is cached, and the target template configuration file includes a line Indicator information, column indicator information, data storage table and table statistics type;
    通过预设定时任务从所述目标模板配置文件中获取所述行指标信息、所述列指标信息、所述数据存储表和所述表统计类型,根据所述行指标信息和所述列指标信息和所述表统计类型设置键值对数据集,并将所述键值对数据集存储至所述数据存储表中;Obtain the row indicator information, the column indicator information, the data storage table and the table statistics type from the target template configuration file through a preset timed task, and according to the row indicator information and the column indicator information Setting a key-value pair dataset with the table statistics type, and storing the key-value pair dataset in the data storage table;
    当接收到文件导出请求时,按照所述文件导出请求生成待导出行指标列表和待导出列指标列表,并将所述待导出行指标列表和所述待导出列指标列表合并为待导出指标参数矩阵;When a file export request is received, a list of row indicators to be exported and a list of column indicators to be exported are generated according to the file export request, and the list of row indicators to be exported and the list of column indicators to be exported are combined into indicator parameters to be exported matrix;
    获取待导出键值对数据集,根据所述待导出指标参数矩阵和所述待导出键值对数据集生成电子表格数据流,并将所述电子表格数据流发送至目标终端,以使得所述目标终端按照所述电子表格数据流导出目标电子报表文件。Obtain the key-value pair data set to be exported, generate a spreadsheet data stream according to the to-be-exported index parameter matrix and the to-be-exported key-value pair data set, and send the spreadsheet data stream to the target terminal, so that the The target terminal exports the target electronic report file according to the data flow of the electronic form.
  9. 根据权利要求8所述的电子报表文件导出设备,所述处理器执行所述计算机程序时还实现以下步骤:The electronic report file export device according to claim 8, wherein the processor also implements the following steps when executing the computer program:
    当接收到模板配置请求时,解析所述模板配置请求,得到解析结果,当所述解析结果不为空值时,从所述解析结果中读取待定义内容和模板标识;When a template configuration request is received, the template configuration request is parsed to obtain a parsing result, and when the parsing result is not a null value, the content to be defined and the template identifier are read from the parsing result;
    根据所述模板标识从预设数据库中获取初始模板配置数据,并按照所述初始模板配置数据对所述待定义内容进行数据格式转换和数据组合,得到封装后的模板数据,所述初始模板配置数据用于指示按照非标记语言YAML语法规则配置的数据;Obtain initial template configuration data from a preset database according to the template identifier, and perform data format conversion and data combination on the to-be-defined content according to the initial template configuration data to obtain encapsulated template data. The initial template configuration Data is used to indicate data configured according to non-markup language YAML syntax rules;
    将所述封装后的模板数据转换为目标模板配置文件,并将所述目标模板配置文件缓存至内存数据库中,所述目标模板配置文件包括行指标信息、列指标信息、数据存储表和表统计类型。Convert the encapsulated template data into a target template configuration file, and cache the target template configuration file in an in-memory database, where the target template configuration file includes row index information, column index information, data storage table and table statistics type.
  10. 根据权利要求9所述的电子报表文件导出设备,所述处理器执行所述计算机程序时还实现以下步骤:The electronic report file export device according to claim 9, wherein the processor also implements the following steps when executing the computer program:
    调用预设定时任务从所述内存数据库中读取所述目标模板配置文件,得到所述行指标信息、所述列指标信息、所述数据存储表和所述表统计类型;Invoking a preset timing task to read the target template configuration file from the in-memory database to obtain the row indicator information, the column indicator information, the data storage table and the table statistics type;
    对所述行指标信息和所述列指标信息进行指标解析,得到结构化查询语言脚本地址、统计时长范围、行指标标识和列指标标识,并按照所述表统计类型确定分组方式;Performing index analysis on the row index information and the column index information, obtaining a structured query language script address, a statistical duration range, a row index identifier and a column index identifier, and determining a grouping method according to the table statistics type;
    按照所述结构化查询语言脚本地址获取目标结构化查询语言脚本,并将所述统计时长范围和所述分组方式设置为所述目标结构化查询语言脚本对应的输入参数;Acquire a target structured query language script according to the structured query language script address, and set the statistical duration range and the grouping method as input parameters corresponding to the target structured query language script;
    执行已设置输入参数的结构化查询语言脚本,得到查询数据,并将所述查询数据设置为目标值;Execute the structured query language script with the input parameters set to obtain query data, and set the query data as the target value;
    对所述行指标标识、所述列指标标识和所述统计时长范围按照先后顺序进行字符串拼接,得到目标键,将所述目标键和所述目标值设置为键值对数据集,并将所述键值对数据集更新至所述数据存储表中。String splicing is performed on the row index identification, the column index identification and the statistical duration range in sequence to obtain a target key, the target key and the target value are set as a key-value pair data set, and the The key-value pair dataset is updated into the data storage table.
  11. 根据权利要求10所述的电子报表文件导出设备,所述处理器执行所述计算机程序时还实现以下步骤:The electronic report file exporting device according to claim 10, wherein the processor further implements the following steps when executing the computer program:
    当接收到文件导出请求时,对所述文件导出请求进行参数解析,得到参数解析结果,对所述参数解析结果进行参数验证,得到验证结果;When receiving a file export request, perform parameter parsing on the file export request to obtain a parameter parsing result, and perform parameter verification on the parameter parsing result to obtain a verification result;
    当所述验证结果为验证通过时,从所述验证结果中获取待导出模板标识,并按照所述待导出模板标识从所述内存数据库中查询待导出的配置文件;When the verification result is that the verification is passed, obtain the template identifier to be exported from the verification result, and query the configuration file to be exported from the memory database according to the template identifier to be exported;
    从所述待导出的配置文件中读取待导出行指标信息和待导出列指标信息,并根据所述待导出行指标信息和所述待导出列指标信息确定待导出行指标列表和待导出列指标列表,所述待导出行指标列表包括指标数据的行坐标和所述行指标标识,所述待导出列指标列表 包括维度数据的列坐标和列键信息,所述列键信息包括所述列指标标识和所述统计时长范围;Read the row index information to be exported and the column index information to be exported from the configuration file to be exported, and determine the row index list to be exported and the column index information to be exported according to the row index information to be exported and the column index information to be exported An index list, the row index list to be exported includes row coordinates of index data and the row index identifier, the column index list to be exported includes column coordinates of dimension data and column key information, and the column key information includes the column Indicator identification and the statistical time range;
    按照所述指标数据的行坐标和所述维度数据的列坐标合将所述待导出行指标列表和所述待导出列指标列表组装为待导出指标参数矩阵。The row index list to be exported and the column index list to be exported are assembled into an index parameter matrix to be exported according to the row coordinates of the index data and the column coordinates of the dimension data.
  12. 根据权利要求11所述的电子报表文件导出设备,所述处理器执行所述计算机程序时还实现以下步骤:The electronic report file export device according to claim 11, wherein the processor further implements the following steps when executing the computer program:
    遍历读取所述待导出指标参数矩阵,得到所述行指标标识、所述行坐标、所述列坐标和所述列键信息,并根据所述行指标标识和所述列指标标识组装成待查询键;Traversing and reading the to-be-derived index parameter matrix, obtaining the row index identifier, the row coordinate, the column coordinate and the column key information, and assembling the to-be-to-be-index identifier according to the row index identifier and the column index identifier query key;
    按照所述待查询键从所述数据存储表中查询待导出键值对数据集,按照所述行坐标和所述列坐标将所述待导出键值数据集赋值至所述待导出指标参数矩阵中,得到赋值后的指标矩阵,并基于所述赋值后的指标矩阵生成电子表格数据流;The key-value pair data set to be exported is queried from the data storage table according to the key to be queried, and the key-value data set to be exported is assigned to the index parameter matrix to be exported according to the row coordinates and the column coordinates , obtain the index matrix after the assignment, and generate a spreadsheet data stream based on the index matrix after the assignment;
    调用预设发送接口,将所述电子表格数据流发送至目标终端,以使得所述目标终端按照所述电子表格数据流导出目标电子报表文件。A preset sending interface is called to send the spreadsheet data stream to the target terminal, so that the target terminal exports the target electronic report file according to the spreadsheet data stream.
  13. 根据权利要求8-12中任意一项所述的电子报表文件导出设备,所述处理器执行所述计算机程序时还实现以下步骤:According to the electronic report file exporting device according to any one of claims 8-12, the processor also implements the following steps when executing the computer program:
    当接收到文件测试请求时,按照所述文件测试请求读取所述目标电子报表文件和目标结构化查询语言脚本;When receiving the file test request, read the target electronic report file and the target structured query language script according to the file test request;
    将所述目标电子报表文件和所述目标结构化查询语言脚本推送至测试终端,以使得所述测试终端对所述目标电子报表文件进行白盒测试,并对所述目标结构化查询语言脚本进行黑盒测试。Push the target electronic report file and the target structured query language script to the test terminal, so that the test terminal performs a white-box test on the target electronic report file and performs a white-box test on the target structured query language script. Black box testing.
  14. 根据权利要求8-12中任意一项所述的电子报表文件导出设备,所述处理器执行所述计算机程序时还实现以下步骤:According to the electronic report file exporting device according to any one of claims 8-12, the processor also implements the following steps when executing the computer program:
    接收报表打印请求,从所述报表打印请求中确定待打印报表内容文件和用户标识信息,所述待打印报表内容文件属于所述目标电子报表文件;receiving a report form printing request, and determining a report form content file to be printed and user identification information from the report form printing request, and the to-be-printed report form content file belongs to the target electronic report form file;
    按照所述用户标识信息生成水印信息,并将所述水印信息嵌入至所述待打印报表内容文件中,得到包含水印的报表文件,对所述包含水印的报表文件进行打印。Generate watermark information according to the user identification information, and embed the watermark information into the report content file to be printed to obtain a report file containing the watermark, and print the report file containing the watermark.
  15. 一种计算机可读存储介质,所述计算机可读存储介质中存储计算机指令,当所述计算机指令在计算机上运行时,使得计算机执行如下步骤:A computer-readable storage medium, storing computer instructions in the computer-readable storage medium, when the computer instructions are executed on a computer, the computer is made to perform the following steps:
    当接收到模板配置请求时,按照所述模板配置请求获取待定义内容,根据所述待定义内容构建目标模板配置文件,并对所述目标模板配置文件进行缓存,所述目标模板配置文件包括行指标信息、列指标信息、数据存储表和表统计类型;When a template configuration request is received, the content to be defined is obtained according to the template configuration request, a target template configuration file is constructed according to the to-be-defined content, and the target template configuration file is cached, and the target template configuration file includes a line Indicator information, column indicator information, data storage table and table statistics type;
    通过预设定时任务从所述目标模板配置文件中获取所述行指标信息、所述列指标信息、所述数据存储表和所述表统计类型,根据所述行指标信息和所述列指标信息和所述表统计类型设置键值对数据集,并将所述键值对数据集存储至所述数据存储表中;Obtain the row indicator information, the column indicator information, the data storage table and the table statistics type from the target template configuration file through a preset timed task, and according to the row indicator information and the column indicator information Setting a key-value pair dataset with the table statistics type, and storing the key-value pair dataset in the data storage table;
    当接收到文件导出请求时,按照所述文件导出请求生成待导出行指标列表和待导出列指标列表,并将所述待导出行指标列表和所述待导出列指标列表合并为待导出指标参数矩阵;When a file export request is received, a list of row indicators to be exported and a list of column indicators to be exported are generated according to the file export request, and the list of row indicators to be exported and the list of column indicators to be exported are combined into indicator parameters to be exported matrix;
    获取待导出键值对数据集,根据所述待导出指标参数矩阵和所述待导出键值对数据集生成电子表格数据流,并将所述电子表格数据流发送至目标终端,以使得所述目标终端按照所述电子表格数据流导出目标电子报表文件。Obtain the key-value pair data set to be exported, generate a spreadsheet data stream according to the to-be-exported index parameter matrix and the to-be-exported key-value pair data set, and send the spreadsheet data stream to the target terminal, so that the The target terminal exports the target electronic report file according to the data flow of the electronic form.
  16. 根据权利要求15所述的计算机可读存储介质,当所述计算机指令在计算机上运行时,使得计算机还执行以下步骤:The computer-readable storage medium of claim 15, when the computer instructions are executed on a computer, causing the computer to further perform the following steps:
    当接收到模板配置请求时,解析所述模板配置请求,得到解析结果,当所述解析结果 不为空值时,从所述解析结果中读取待定义内容和模板标识;When receiving the template configuration request, parse the template configuration request, obtain the analysis result, when the analysis result is not a null value, read the content to be defined and the template identification from the analysis result;
    根据所述模板标识从预设数据库中获取初始模板配置数据,并按照所述初始模板配置数据对所述待定义内容进行数据格式转换和数据组合,得到封装后的模板数据,所述初始模板配置数据用于指示按照非标记语言YAML语法规则配置的数据;Obtain initial template configuration data from a preset database according to the template identifier, and perform data format conversion and data combination on the to-be-defined content according to the initial template configuration data to obtain encapsulated template data. The initial template configuration Data is used to indicate data configured according to non-markup language YAML syntax rules;
    将所述封装后的模板数据转换为目标模板配置文件,并将所述目标模板配置文件缓存至内存数据库中,所述目标模板配置文件包括行指标信息、列指标信息、数据存储表和表统计类型。Convert the encapsulated template data into a target template configuration file, and cache the target template configuration file in an in-memory database, where the target template configuration file includes row index information, column index information, data storage table and table statistics type.
  17. 根据权利要求16所述的计算机可读存储介质,当所述计算机指令在计算机上运行时,使得计算机还执行以下步骤:The computer-readable storage medium of claim 16, which, when executed on a computer, causes the computer to further perform the following steps:
    调用预设定时任务从所述内存数据库中读取所述目标模板配置文件,得到所述行指标信息、所述列指标信息、所述数据存储表和所述表统计类型;Invoking a preset timing task to read the target template configuration file from the in-memory database to obtain the row indicator information, the column indicator information, the data storage table and the table statistics type;
    对所述行指标信息和所述列指标信息进行指标解析,得到结构化查询语言脚本地址、统计时长范围、行指标标识和列指标标识,并按照所述表统计类型确定分组方式;Performing index analysis on the row index information and the column index information, obtaining a structured query language script address, a statistical duration range, a row index identifier and a column index identifier, and determining a grouping method according to the table statistics type;
    按照所述结构化查询语言脚本地址获取目标结构化查询语言脚本,并将所述统计时长范围和所述分组方式设置为所述目标结构化查询语言脚本对应的输入参数;Acquire a target structured query language script according to the structured query language script address, and set the statistical duration range and the grouping method as input parameters corresponding to the target structured query language script;
    执行已设置输入参数的结构化查询语言脚本,得到查询数据,并将所述查询数据设置为目标值;Execute the structured query language script with the input parameters set to obtain query data, and set the query data as the target value;
    对所述行指标标识、所述列指标标识和所述统计时长范围按照先后顺序进行字符串拼接,得到目标键,将所述目标键和所述目标值设置为键值对数据集,并将所述键值对数据集更新至所述数据存储表中。String splicing is performed on the row index identification, the column index identification and the statistical duration range in order to obtain a target key, the target key and the target value are set as a key-value pair data set, and the The key-value pair dataset is updated into the data storage table.
  18. 根据权利要求17所述的计算机可读存储介质,当所述计算机指令在计算机上运行时,使得计算机还执行以下步骤:The computer-readable storage medium of claim 17, which, when executed on a computer, causes the computer to further perform the following steps:
    当接收到文件导出请求时,对所述文件导出请求进行参数解析,得到参数解析结果,对所述参数解析结果进行参数验证,得到验证结果;When receiving a file export request, perform parameter parsing on the file export request to obtain a parameter parsing result, and perform parameter verification on the parameter parsing result to obtain a verification result;
    当所述验证结果为验证通过时,从所述验证结果中获取待导出模板标识,并按照所述待导出模板标识从所述内存数据库中查询待导出的配置文件;When the verification result is that the verification is passed, obtain the template identifier to be exported from the verification result, and query the configuration file to be exported from the memory database according to the template identifier to be exported;
    从所述待导出的配置文件中读取待导出行指标信息和待导出列指标信息,并根据所述待导出行指标信息和所述待导出列指标信息确定待导出行指标列表和待导出列指标列表,所述待导出行指标列表包括指标数据的行坐标和所述行指标标识,所述待导出列指标列表包括维度数据的列坐标和列键信息,所述列键信息包括所述列指标标识和所述统计时长范围;Read the row index information to be exported and the column index information to be exported from the configuration file to be exported, and determine the row index list to be exported and the column index information to be exported according to the row index information to be exported and the column index information to be exported An index list, the row index list to be exported includes row coordinates of index data and the row index identifier, the column index list to be exported includes column coordinates of dimension data and column key information, and the column key information includes the column Indicator identification and the statistical time range;
    按照所述指标数据的行坐标和所述维度数据的列坐标合将所述待导出行指标列表和所述待导出列指标列表组装为待导出指标参数矩阵。The row index list to be exported and the column index list to be exported are assembled into an index parameter matrix to be exported according to the row coordinates of the index data and the column coordinates of the dimension data.
  19. 根据权利要求18所述的计算机可读存储介质,当所述计算机指令在计算机上运行执行以下步骤时,使得计算机还执行以下步骤:The computer-readable storage medium of claim 18, when the computer instructions are executed on the computer to perform the following steps, the computer further causes the computer to perform the following steps:
    遍历读取所述待导出指标参数矩阵,得到所述行指标标识、所述行坐标、所述列坐标和所述列键信息,并根据所述行指标标识和所述列指标标识组装成待查询键;Traversing and reading the to-be-derived index parameter matrix, obtaining the row index identifier, the row coordinate, the column coordinate and the column key information, and assembling the to-be-to-be-index identifier according to the row index identifier and the column index identifier query key;
    按照所述待查询键从所述数据存储表中查询待导出键值对数据集,按照所述行坐标和所述列坐标将所述待导出键值数据集赋值至所述待导出指标参数矩阵中,得到赋值后的指标矩阵,并基于所述赋值后的指标矩阵生成电子表格数据流;The key-value pair data set to be exported is queried from the data storage table according to the key to be queried, and the key-value data set to be exported is assigned to the index parameter matrix to be exported according to the row coordinates and the column coordinates , obtain the index matrix after the assignment, and generate a spreadsheet data stream based on the index matrix after the assignment;
    调用预设发送接口,将所述电子表格数据流发送至目标终端,以使得所述目标终端按照所述电子表格数据流导出目标电子报表文件。A preset sending interface is called to send the spreadsheet data stream to the target terminal, so that the target terminal exports the target electronic report file according to the spreadsheet data stream.
  20. 一种电子报表文件导出装置,其中,所述电子报表文件导出装置包括:An electronic report file export device, wherein the electronic report file export device includes:
    获取模块,当接收到模板配置请求时,用于按照所述模板配置请求获取待定义内容,根据所述待定义内容构建目标模板配置文件,并对所述目标模板配置文件进行缓存,所述目标模板配置文件包括行指标信息、列指标信息、数据存储表和表统计类型;The obtaining module, when receiving a template configuration request, is used to obtain the content to be defined according to the template configuration request, build a target template configuration file according to the to-be-defined content, and cache the target template configuration file, the target template configuration file The template configuration file includes row indicator information, column indicator information, data storage table and table statistics type;
    设置模块,用于通过预设定时任务从所述目标模板配置文件中获取所述行指标信息、所述列指标信息、所述数据存储表和所述表统计类型,根据所述行指标信息和所述列指标信息和所述表统计类型设置键值对数据集,并将所述键值对数据集存储至所述数据存储表中;A setting module, configured to obtain the row indicator information, the column indicator information, the data storage table and the table statistics type from the target template configuration file through a preset timed task, according to the row indicator information and the table statistics type. The column indicator information and the table statistics type are set to a key-value pair data set, and the key-value pair data set is stored in the data storage table;
    合并模块,当接收到文件导出请求时,用于按照所述文件导出请求生成待导出行指标列表和待导出列指标列表,并将所述待导出行指标列表和所述待导出列指标列表合并为待导出指标参数矩阵;The merging module, when receiving a file export request, is configured to generate a row index list to be exported and a column index list to be exported according to the file export request, and merge the row index list to be exported and the column index list to be exported is the index parameter matrix to be exported;
    导出模块,用于获取待导出键值对数据集,根据所述待导出指标参数矩阵和所述待导出键值对数据集生成电子表格数据流,并将所述电子表格数据流发送至目标终端,以使得所述目标终端按照所述电子表格数据流导出目标电子报表文件。An export module, configured to obtain a key-value pair data set to be exported, generate a spreadsheet data stream according to the to-be-exported index parameter matrix and the to-be-exported key-value pair data set, and send the spreadsheet data stream to the target terminal , so that the target terminal exports the target electronic report file according to the data flow of the electronic form.
PCT/CN2021/091578 2020-12-18 2021-04-30 Electronic report file export method, apparatus and device, and storage medium WO2022126983A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011506861.9 2020-12-18
CN202011506861.9A CN112632006A (en) 2020-12-18 2020-12-18 Electronic report file export method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
WO2022126983A1 true WO2022126983A1 (en) 2022-06-23

Family

ID=75317507

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/091578 WO2022126983A1 (en) 2020-12-18 2021-04-30 Electronic report file export method, apparatus and device, and storage medium

Country Status (2)

Country Link
CN (1) CN112632006A (en)
WO (1) WO2022126983A1 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116150249A (en) * 2023-04-13 2023-05-23 新兴际华集团财务有限公司 Table data export method, apparatus, electronic device and computer readable medium
US11783123B1 (en) * 2023-03-15 2023-10-10 Bank Of America Corporation Generating a dynamic template for transforming source data
CN116882345A (en) * 2023-07-06 2023-10-13 合芯科技(苏州)有限公司 Circuit simulation data collection method, system, medium and electronic equipment
CN117829121A (en) * 2024-03-04 2024-04-05 成方金融科技有限公司 Data processing method, device, electronic equipment and medium

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112632006A (en) * 2020-12-18 2021-04-09 平安普惠企业管理有限公司 Electronic report file export method, device, equipment and storage medium
CN113283227A (en) * 2021-05-31 2021-08-20 山东浪潮通软信息科技有限公司 File export method and device and computer readable medium
CN114626352B (en) * 2022-03-11 2024-02-06 平安科技(深圳)有限公司 Report automatic generation method, device, computer equipment and storage medium
CN114595199B (en) * 2022-05-10 2022-09-02 太平金融科技服务(上海)有限公司 File analysis method and device, computer equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105426465A (en) * 2015-11-13 2016-03-23 中国建设银行股份有限公司 Method and device for online exporting statements
US9552283B2 (en) * 2007-11-12 2017-01-24 Ca, Inc. Spreadsheet data transfer objects
CN110941658A (en) * 2019-11-15 2020-03-31 泰康保险集团股份有限公司 Data export method, device, server and storage medium
CN111177231A (en) * 2019-12-20 2020-05-19 中国建设银行股份有限公司 Report generation method and report generation device
CN112632006A (en) * 2020-12-18 2021-04-09 平安普惠企业管理有限公司 Electronic report file export method, device, equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9552283B2 (en) * 2007-11-12 2017-01-24 Ca, Inc. Spreadsheet data transfer objects
CN105426465A (en) * 2015-11-13 2016-03-23 中国建设银行股份有限公司 Method and device for online exporting statements
CN110941658A (en) * 2019-11-15 2020-03-31 泰康保险集团股份有限公司 Data export method, device, server and storage medium
CN111177231A (en) * 2019-12-20 2020-05-19 中国建设银行股份有限公司 Report generation method and report generation device
CN112632006A (en) * 2020-12-18 2021-04-09 平安普惠企业管理有限公司 Electronic report file export method, device, equipment and storage medium

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11783123B1 (en) * 2023-03-15 2023-10-10 Bank Of America Corporation Generating a dynamic template for transforming source data
CN116150249A (en) * 2023-04-13 2023-05-23 新兴际华集团财务有限公司 Table data export method, apparatus, electronic device and computer readable medium
CN116150249B (en) * 2023-04-13 2023-06-16 新兴际华集团财务有限公司 Table data export method, apparatus, electronic device and computer readable medium
CN116882345A (en) * 2023-07-06 2023-10-13 合芯科技(苏州)有限公司 Circuit simulation data collection method, system, medium and electronic equipment
CN117829121A (en) * 2024-03-04 2024-04-05 成方金融科技有限公司 Data processing method, device, electronic equipment and medium

Also Published As

Publication number Publication date
CN112632006A (en) 2021-04-09

Similar Documents

Publication Publication Date Title
WO2022126983A1 (en) Electronic report file export method, apparatus and device, and storage medium
US11176160B2 (en) SQL interceptor for use with third party data analytics packages
US11775501B2 (en) Trace and span sampling and analysis for instrumented software
CN108228166B (en) Template-based back-end code generation method and system
CN109558575B (en) Online form editing method, online form editing device, computer equipment and storage medium
US8615526B2 (en) Markup language based query and file generation
US10970343B2 (en) Adapting database queries for data virtualization over combined database stores
US9053112B2 (en) Automated data validation
CN112434015B (en) Data storage method and device, electronic equipment and medium
US10909109B1 (en) Quality control test transactions for shared databases of a collaboration tool
US20190042631A1 (en) Data Export Job Engine
CN113312376A (en) Method and terminal for real-time processing and analysis of Nginx logs
CN105335482A (en) Batch insert method facing mass distributed database
CN116719822B (en) Method and system for storing massive structured data
CN115658680A (en) Data storage method, data query method and related device
CN114238374A (en) Data query method, device, server and storage medium
CN114610803A (en) Data processing method and device, electronic equipment and storage medium
CN113254399A (en) Log query method and device, electronic equipment and medium
CN116647412B (en) Security defense method and system of Web server
CN116610679B (en) json data analysis method, json data analysis device, computer equipment and computer medium
CN116303322B (en) Declaration type log generalization method and device
CN117112551A (en) Report generation method, report generation device, electronic equipment and storage medium
CN115373963A (en) Log statistical method and device and server
CN115222507A (en) Asynchronous parallel transaction list file generation method and device
CN117010358A (en) Message card generation method, device, computer equipment and storage medium

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: 21904922

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 041023)

122 Ep: pct application non-entry in european phase

Ref document number: 21904922

Country of ref document: EP

Kind code of ref document: A1