[go: up one dir, main page]

CN114528251A - Report generation method and device - Google Patents

Report generation method and device Download PDF

Info

Publication number
CN114528251A
CN114528251A CN202210164007.1A CN202210164007A CN114528251A CN 114528251 A CN114528251 A CN 114528251A CN 202210164007 A CN202210164007 A CN 202210164007A CN 114528251 A CN114528251 A CN 114528251A
Authority
CN
China
Prior art keywords
report
file
upload
target
name
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
CN202210164007.1A
Other languages
Chinese (zh)
Inventor
郑斐
孙馨愉
董宏越
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Bank of China Ltd
Original Assignee
Bank of China Ltd
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 Bank of China Ltd filed Critical Bank of China Ltd
Priority to CN202210164007.1A priority Critical patent/CN114528251A/en
Publication of CN114528251A publication Critical patent/CN114528251A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/13File access structures, e.g. distributed indices
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/11File system administration, e.g. details of archiving or snapshots
    • G06F16/122File system administration, e.g. details of archiving or snapshots using management policies
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/14Details of searching files based on file metadata
    • G06F16/148File search processing
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • G06F16/164File meta data generation
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Library & Information Science (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本发明提供了一种报表生成方法和装置,属于大数据,该方法包括:在数据库中建立报表索引表;根据报表索引表,获取目标上传系统的文件属性信息;根据报表索引表和目标上传系统的文件属性信息,调用报表生成程序,生成报表数据实体;将报表数据实体转换为报表文件发送至目标上传系统。本发明利用在数据库建立的报表索引表将不同报表的生成条件记录,通过调用报表生成程生成报表实体内容,实现同一种上传系统可复用同一套代码,按照不同上传系统的需求生成对应的报表文件。

Figure 202210164007

The invention provides a report generation method and device, belonging to big data. The method includes: establishing a report index table in a database; obtaining file attribute information of a target uploading system according to the report index table; according to the report index table and the target uploading system The attribute information of the file is called, the report generation program is called, and the report data entity is generated; the report data entity is converted into a report file and sent to the target uploading system. The invention uses the report index table established in the database to record the generation conditions of different reports, and generates the report entity content by calling the report generation process, so that the same uploading system can reuse the same set of codes, and generate corresponding reports according to the requirements of different uploading systems. document.

Figure 202210164007

Description

一种报表生成方法和装置A method and device for generating a report

技术领域technical field

本发明涉及计算机数据处理技术领域,尤其涉及一种报表生成方法和装置。The invention relates to the technical field of computer data processing, in particular to a method and device for generating a report.

背景技术Background technique

本部分旨在为权利要求书中陈述的本发明的实施方式提供背景或上下文。此处的描述不因为包括在本部分中就承认是现有技术。This section is intended to provide a background or context for the embodiments of the invention that are recited in the claims. The descriptions herein are not admitted to be prior art by inclusion in this section.

随着电子化办公的趋势不断发展,越来越多的企业或单位开始采用报表对自身的经营管理状况进行统计。报表的种类多种多样。有的企业采用日报表,即以一天的时间范围作为统计周期;也有的企业采用周报表,即以一周的时间范围作为统计周期。现有技术中,报表的统计周期一旦确定,则报表的格式也就相应确定了。以日报表为例,日报表中只具有针对24小时的时间范围内的数据的统计结果。如果需要从日报表中对一个月内的数据进行统计,那么现有技术中,只能够获取这个月内的所有(30个左右)日报表,再根据所有的日报表中的数据,统计得到该月内的统计结果。由于需要处理大量的日报表,所以现有技术中,当需要统计的周期与报表的统计周期不相同时,得到统计数据的过程十分复杂,并且会占用大量统计设备的硬件资源。With the continuous development of the trend of electronic office, more and more enterprises or units begin to use reports to make statistics on their own operation and management status. There are various types of reports. Some enterprises use daily reports, that is, the time range of one day is used as the statistical cycle; some companies use weekly reports, that is, the time range of one week is used as the statistical cycle. In the prior art, once the statistical period of the report is determined, the format of the report is determined accordingly. Taking the daily report as an example, the daily report only has statistical results for data within a 24-hour time range. If it is necessary to count the data within a month from the daily report, then in the prior art, only all (about 30) daily reports in this month can be obtained, and then the statistics can be obtained according to the data in all the daily reports. Statistics for the month. Since a large number of daily reports need to be processed, in the prior art, when the period required for statistics is not the same as the statistical period of the reports, the process of obtaining statistical data is very complicated, and a large number of hardware resources of statistical equipment are occupied.

因此,如何提供一种新的方案,其能够解决上述技术问题是本领域亟待解决的技术难题。Therefore, how to provide a new solution that can solve the above-mentioned technical problems is a technical problem to be solved urgently in the art.

发明内容SUMMARY OF THE INVENTION

本发明实施例提供一种报表生成方法,利用在数据库建立的报表索引表将不同报表的生成条件记录,通过调用报表生成程生成报表实体内容,实现同一种上传系统可复用同一套代码,按照不同上传系统的需求生成对应的报表文件,该方法包括:The embodiment of the present invention provides a report generation method. The report index table established in the database is used to record the generation conditions of different reports, and the report entity content is generated by invoking the report generation process, so that the same upload system can reuse the same set of codes. The corresponding report files are generated according to the requirements of different uploading systems, and the method includes:

在数据库中建立报表索引表;Create a report index table in the database;

根据报表索引表,获取目标上传系统的文件属性信息;Obtain the file attribute information of the target upload system according to the report index table;

根据报表索引表和目标上传系统的文件属性信息,调用报表生成程序,生成报表数据实体;According to the report index table and the file attribute information of the target uploading system, call the report generation program to generate the report data entity;

将报表数据实体转换为报表文件发送至目标上传系统。Convert report data entities into report files and send them to the target uploading system.

本发明实施例还提供一种报表生成装置,包括:The embodiment of the present invention also provides a report generation device, including:

报表索引表建立模块,用于在数据库中建立报表索引表;The report index table building module is used to build the report index table in the database;

目标上传系统的文件属性信息获取模块,用于根据报表索引表,获取目标上传系统的文件属性信息;The file attribute information acquisition module of the target uploading system is used to obtain the file attribute information of the target uploading system according to the report index table;

报表数据实体生成模块,用于根据报表索引表和目标上传系统的文件属性信息,调用报表生成程序,生成报表数据实体;The report data entity generation module is used to call the report generation program according to the report index table and the file attribute information of the target uploading system to generate the report data entity;

报表文件发送模块,用于将报表数据实体转换为报表文件发送至目标上传系统。The report file sending module is used to convert report data entities into report files and send them to the target uploading system.

本发明实施例还提供一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现上述一种报表生成方法。An embodiment of the present invention further provides a computer device, including a memory, a processor, and a computer program stored in the memory and running on the processor, where the processor implements the above-mentioned method for generating a report when executing the computer program.

本发明实施例还提供一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时实现上述一种报表生成方法。An embodiment of the present invention further provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, implements the foregoing method for generating a report.

本发明实施例还提供一种计算机程序产品,所述计算机程序产品包括计算机程序,所述计算机程序被处理器执行时实现上述一种报表生成方法。An embodiment of the present invention further provides a computer program product, where the computer program product includes a computer program, and when the computer program is executed by a processor, the above-mentioned method for generating a report is implemented.

本发明实施例提供的一种报表生成方法和装置,包括:在数据库中建立报表索引表;根据报表索引表,获取目标上传系统的文件属性信息;根据报表索引表和目标上传系统的文件属性信息,调用报表生成程序,生成报表数据实体;将报表数据实体转换为报表文件发送至目标上传系统。本发明利用在数据库建立的报表索引表将不同报表的生成条件记录,通过调用报表生成程生成报表实体内容,实现同一种上传系统可复用同一套代码,按照不同上传系统的需求生成对应的报表文件。在增加报表文件时只需要配置数据库中的报表索引表,按照不同的需求实现报表实体内容的拼接即可,便于报表文件的管理,有效降低代码冗余度和人力物力成本。A report generation method and device provided by the embodiments of the present invention include: establishing a report index table in a database; obtaining file attribute information of a target uploading system according to the report index table; according to the report index table and the file attribute information of the target uploading system , call the report generation program to generate the report data entity; convert the report data entity into a report file and send it to the target uploading system. The invention uses the report index table established in the database to record the generation conditions of different reports, and generates the report entity content by calling the report generation process, so that the same uploading system can reuse the same set of codes, and generate corresponding reports according to the requirements of different uploading systems. document. When adding report files, you only need to configure the report index table in the database, and realize the splicing of report entity content according to different requirements, which is convenient for report file management, and effectively reduces code redundancy and labor and material costs.

附图说明Description of drawings

为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。在附图中:In order to explain the embodiments of the present invention or the technical solutions in the prior art more clearly, the following briefly introduces the accompanying drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only These are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can also be obtained according to these drawings without creative efforts. In the attached image:

图1为本发明实施例一种报表生成方法示意图。FIG. 1 is a schematic diagram of a method for generating a report according to an embodiment of the present invention.

图2为本发明实施例一种报表生成方法的建立报表索引表过程示意图。FIG. 2 is a schematic diagram of a process of establishing a report index table in a report generation method according to an embodiment of the present invention.

图3为本发明实施例一种报表生成方法的生成报表数据实体过程示意图。FIG. 3 is a schematic diagram of a process of generating a report data entity in a report generation method according to an embodiment of the present invention.

图4为本发明实施例一种报表生成方法的报表文件发送过程示意图。FIG. 4 is a schematic diagram of a report file sending process of a report generation method according to an embodiment of the present invention.

图5为运行本发明实施的一种报表生成方法的计算机设备示意图。FIG. 5 is a schematic diagram of a computer device running a report generation method implemented by the present invention.

图6为本发明实施例一种报表生成装置示意图。FIG. 6 is a schematic diagram of an apparatus for generating a report according to an embodiment of the present invention.

具体实施方式Detailed ways

为使本发明实施例的目的、技术方案和优点更加清楚明白,下面结合附图对本发明实施例做进一步详细说明。在此,本发明的示意性实施例及其说明用于解释本发明,但并不作为对本发明的限定。In order to make the purposes, technical solutions and advantages of the embodiments of the present invention more clearly understood, the embodiments of the present invention will be further described in detail below with reference to the accompanying drawings. Here, the exemplary embodiments of the present invention and their descriptions are used to explain the present invention, but not to limit the present invention.

本发明属于大数据技术。图1为本发明实施例一种报表生成方法示意图,如图1所示,本发明实施例提供一种报表生成方法,利用在数据库建立的报表索引表将不同报表的生成条件记录,通过调用报表生成程生成报表实体内容,实现同一种上传系统可复用同一套代码,按照不同上传系统的需求生成对应的报表文件,该方法包括:The present invention belongs to big data technology. FIG. 1 is a schematic diagram of a report generation method according to an embodiment of the present invention. As shown in FIG. 1 , an embodiment of the present invention provides a report generation method. The report index table established in the database is used to record the generation conditions of different reports. The generation process generates report entity content, realizes that the same upload system can reuse the same set of codes, and generates corresponding report files according to the requirements of different upload systems. The method includes:

步骤101:在数据库中建立报表索引表;Step 101: establish a report index table in the database;

步骤102:根据报表索引表,获取目标上传系统的文件属性信息;Step 102: Obtain the file attribute information of the target uploading system according to the report index table;

步骤103:根据报表索引表和目标上传系统的文件属性信息,调用报表生成程序,生成报表数据实体;Step 103: according to the report index table and the file attribute information of the target uploading system, call the report generation program to generate the report data entity;

步骤104:将报表数据实体转换为报表文件发送至目标上传系统。Step 104: Convert the report data entity into a report file and send it to the target uploading system.

本发明实施例提供的一种报表生成方法,包括:在数据库中建立报表索引表;根据报表索引表,获取目标上传系统的文件属性信息;根据报表索引表和目标上传系统的文件属性信息,调用报表生成程序,生成报表数据实体;将报表数据实体转换为报表文件发送至目标上传系统。本发明利用在数据库建立的报表索引表将不同报表的生成条件记录,通过调用报表生成程生成报表实体内容,实现同一种上传系统可复用同一套代码,按照不同上传系统的需求生成对应的报表文件。在增加报表文件时只需要配置数据库中的报表索引表,按照不同的需求实现报表实体内容的拼接即可,便于报表文件的管理,有效降低代码冗余度和人力物力成本。A report generation method provided by an embodiment of the present invention includes: establishing a report index table in a database; obtaining file attribute information of a target uploading system according to the report index table; calling the report index table and the file attribute information of the target uploading system according to the report index table The report generation program generates report data entities; converts report data entities into report files and sends them to the target uploading system. The invention uses the report index table established in the database to record the generation conditions of different reports, and generates the report entity content by calling the report generation process, so that the same uploading system can reuse the same set of codes, and generate corresponding reports according to the requirements of different uploading systems. document. When adding report files, you only need to configure the report index table in the database, and realize the splicing of report entity content according to different requirements, which is convenient for report file management, and effectively reduces code redundancy and labor and material costs.

由于产品的业务数据需要以报表的形式给其他系统或各省分管系统,通过不同的分类方式来生成不同的报表文件以满足不同的需求。根据不同的需求,报表需要以不同的频率传给不同的系统。如何高效的实现报表的生成是本发明实施例所解决的问题。Since the business data of the product needs to be given to other systems or the systems in charge of the provinces in the form of reports, different report files are generated through different classification methods to meet different needs. According to different requirements, reports need to be transmitted to different systems at different frequencies. How to efficiently realize report generation is the problem solved by the embodiments of the present invention.

具体实施本发明实施例提供的一种报表生成方法时,在一个实施例中,还包括:When specifically implementing the report generation method provided by the embodiment of the present invention, in one embodiment, the method further includes:

在数据库中建立报表索引表;Create a report index table in the database;

根据报表索引表,获取目标上传系统的文件属性信息;Obtain the file attribute information of the target upload system according to the report index table;

根据报表索引表和目标上传系统的文件属性信息,调用报表生成程序,生成报表数据实体;According to the report index table and the file attribute information of the target uploading system, call the report generation program to generate the report data entity;

将报表数据实体转换为报表文件发送至目标上传系统。Convert report data entities into report files and send them to the target uploading system.

实施例中,建立一个报表索引表,然后根据上传报表的系统名称获取数据库中报表索引表中的记录去分类用不同的方式实现该系统的报表生成,通过数据库中记录的信息反射调用方法,获取最终统计的报表数据实体内容,转换为报表文件上传至目标上传系统。In the embodiment, a report index table is established, and then the records in the report index table in the database are obtained according to the system name of the uploaded report to classify and implement the report generation of the system in different ways, and the method is reflected and invoked through the information recorded in the database to obtain The final statistical report data entity content is converted into report files and uploaded to the target uploading system.

图2为本发明实施例一种报表生成方法的建立报表索引表过程示意图,如图2所示,具体实施本发明实施例提供的一种报表生成方法时,在一个实施例中,在数据库中建立报表索引表,包括:FIG. 2 is a schematic diagram of a process of building a report index table of a report generation method according to an embodiment of the present invention. As shown in FIG. 2 , when a report generation method provided by an embodiment of the present invention is specifically implemented, in one embodiment, in a database Create a report index table, including:

步骤201:获取与数据库连接的全部上传系统,获取每一上传系统对应报表的生成条件;Step 201: Obtain all uploading systems connected to the database, and obtain the report generation conditions corresponding to each uploading system;

步骤202:根据每一上传系统对应报表的生成条件,在数据库中配置对应每一上传系统的字段记录,建立报表索引表。Step 202: According to the generating conditions of the report corresponding to each uploading system, configure field records corresponding to each uploading system in the database, and establish a report index table.

实施例中,由于不同的上传系统对于报表的要求不同,因此需要针对不同的上传系统建立对应的生成条件表,也即是报表索引表;具体过程包括:In the embodiment, since different uploading systems have different requirements for reports, it is necessary to establish a corresponding generation condition table for different uploading systems, that is, a report index table; the specific process includes:

首先,获取与数据库连接的全部上传系统,获取每一上传系统对应报表的生成条件;然后,根据每一上传系统对应报表的生成条件,在数据库中配置对应每一上传系统的字段记录,建立报表索引表。通过建立报表索引表,可以实现将全部上传系统对于报表的要求进行全方面记录,以便在制作生成报表是按照每一上传系统的要求,有针对性的进行适配。First, obtain all upload systems connected to the database, and obtain the report generation conditions corresponding to each upload system; then, according to the report generation conditions corresponding to each upload system, configure the field records corresponding to each upload system in the database, and create a report direction chart. By establishing a report index table, it is possible to record the requirements of all uploading systems for reports in all aspects, so that reports can be made and generated according to the requirements of each uploading system, and targeted adaptation.

具体实施本发明实施例提供的一种报表生成方法时,在一个实施例中,所述报表索引表包括多个字段,所述字段,至少包括:上传系统名称,报表的出表频率,报表实现的方法名;When implementing the report generation method provided by the embodiment of the present invention, in one embodiment, the report index table includes a plurality of fields, and the fields at least include: uploading system name, report output frequency, report implementation method name;

根据报表索引表,获取目标上传系统的文件属性信息,包括:Obtain the file attribute information of the target upload system according to the report index table, including:

根据目标上传系统名称,在报表索引表中筛选出目标上传系统的报表的出表频率和目标上传系统的报表实现的方法名作为目标上传系统的文件属性信息。According to the name of the target uploading system, the report output frequency of the target uploading system and the method name implemented by the report of the target uploading system are filtered out in the report index table as the file attribute information of the target uploading system.

实施例中,前述建立的报表索引表包括多个字段,该字段,至少包括:上传系统名称,报表的出表频率,报表实现的方法名;还可以包括:报表名称、报表开始时间、报表结束时间等其他字段。根据报表索引表,获取目标上传系统的文件属性信息,主要过程可以包括:根据目标上传系统名称,在报表索引表中筛选出目标上传系统的报表的出表频率和目标上传系统的报表实现的方法名作为目标上传系统的文件属性信息。具体的,获取文件属性是通过报表上传频率和下上传系统在报表索引表中筛选记录。In the embodiment, the report index table established above includes a plurality of fields, the fields at least include: upload system name, report output frequency, and report implementation method name; and may also include: report name, report start time, report end other fields such as time. Obtaining the file attribute information of the target uploading system according to the report index table, the main process may include: according to the name of the target uploading system, filtering out the report output frequency of the target uploading system and the report realization method of the target uploading system in the report index table The name is the file attribute information of the target upload system. Specifically, to obtain the file attributes is to filter records in the report index table through the report upload frequency and the down-loading system.

图3为本发明实施例一种报表生成方法的生成报表数据实体过程示意图,如图3所示,具体实施本发明实施例提供的一种报表生成方法时,在一个实施例中,根据报表索引表和目标上传系统的文件属性信息,调用报表生成程序,生成报表数据实体,包括:FIG. 3 is a schematic diagram of a process of generating a report data entity in a report generating method according to an embodiment of the present invention. As shown in FIG. 3 , when a report generating method provided by an embodiment of the present invention is specifically implemented, in one embodiment, according to the report index The table and target upload the file attribute information of the system, call the report generation program, and generate the report data entity, including:

步骤301:创建定时任务,根据当前系统日期生成不同时间长度的基础报表数据,存入信息记录表;Step 301: Create a timed task, generate basic report data of different time lengths according to the current system date, and store it in the information record table;

步骤302:根据目标上传系统名称,获取报表索引表中对应目标上传系统的字段,放入报表对象中;所述放入报表对象中的字段,包括:报表开始时间、报表结束时间、报表名称、报表的出表频率、报表上传系统名称和报表实现的方法名;Step 302: According to the name of the target uploading system, obtain the fields corresponding to the target uploading system in the report index table, and put them into the report object; the fields put into the report object include: report start time, report end time, report name, Report output frequency, report upload system name and report implementation method name;

步骤303:通过报表接口获取所有生成报表的方法名,与目标上传系统的报表实现的方法名进行匹配;Step 303: Obtain all method names for generating reports through the report interface, and match with the method names implemented by the report of the target uploading system;

步骤304:当方法名匹配一致时,通过反射的方式调用该匹配一致的方法名对应的报表生成程序,从信息记录表中获取适配报表对象的基础报表数据,按照目标上传系统对应报表的生成条件拼接,按照目标上传系统的报表的出表频率生成报表数据实体。Step 304: When the method names match the same, call the report generation program corresponding to the matching method name by means of reflection, obtain the basic report data of the adapted report object from the information record table, and upload the generation of the corresponding report to the system according to the target. Conditional splicing, generating report data entities according to the report output frequency of the target upload system.

实施例中,生成报表数据实体的过程,主要包括:In the embodiment, the process of generating the report data entity mainly includes:

首先,创建定时任务,根据当前系统日期生成不同时间长度的基础报表数据,存入信息记录表;基础报表数据,可以是以日为时间长度,也可以是以周为时间长度,还可以是以月为时间长度,更可以是以季度为时间长度,更进一步的可以是以年为时间长度,以此类推,均在本发明实施例的保护范围内。定时任务,是指通过反射的方式定时调用生成报表的程序;报表生成程序,用于将报表中需要的字段以上传系统规定的格式生成对应的报表;First, create a timed task, generate basic report data of different time lengths according to the current system date, and store them in the information record table; the basic report data can take days as the time length, or weeks as the time length, or Months may be the time length, more may be quarters as the time length, and further may be years as the time length, and so on, all within the protection scope of the embodiments of the present invention. Scheduled task refers to the program that generates reports by calling regularly through reflection; the report generation program is used to generate the corresponding report with the required fields in the report in the format specified by the uploading system;

然后,根据目标上传系统名称,获取报表索引表中对应目标上传系统的字段,放入报表对象中;如果是月报表则获取当前月前一个月的开始和结束时间,如果是日报获取前一天开始时间和结束时间;所述放入报表对象中的字段,包括:报表开始时间、报表结束时间、报表名称、报表的出表频率、报表上传系统名称和报表实现的方法名;Then, according to the name of the target upload system, get the fields corresponding to the target upload system in the report index table, and put them into the report object; if it is a monthly report, get the start and end time of the month before the current month, and if it is a daily report, get the start time of the previous day time and end time; the fields to be put into the report object include: report start time, report end time, report name, report output frequency, report upload system name and report implementation method name;

接着,通过报表接口获取所有生成报表的方法名,与目标上传系统的报表实现的方法名进行匹配;匹配过程是判断所有生成报表的方法名是否存在与目标上传系统的报表实现的方法名存在一致;当方法名匹配一致时,通过反射的方式调用该匹配一致的方法名对应的报表生成程序,从信息记录表中获取适配报表对象的基础报表数据,按照目标上传系统对应报表的生成条件拼接,按照目标上传系统的报表的出表频率生成报表数据实体。Then, obtain all the method names for generating reports through the report interface, and match them with the method names implemented by the report of the target uploading system; the matching process is to determine whether all the method names for generating reports are consistent with the method names implemented by the report of the target uploading system. ;When the method names match the same, call the report generation program corresponding to the matching method name by reflection, obtain the basic report data of the adapted report object from the information record table, and splicing according to the generation conditions of the corresponding report of the target upload system , and generate report data entities according to the report output frequency of the target upload system report.

具体的,获取文件属性是通过报表上传频率和下上传系统在报表索引表中筛选记录。如果是月报表则获取当前月前一个月的开始和结束时间,如果是日报获取前一天开始时间和结束时间。生成报表本地存放的路径,获取数据库中报表索引表中的内容在报表对象中放入报表开始、结束时间,报表名称,报表出表频率,报表上传系统,生成报表调用方法名等信息。生成报表文件,报表生成的方法是通过报表接口获取所有生成报表的方法名,然后判断是否与该条报表索引表中的方法名一致,如果一致则反射调用该方法,该方法中会在各个信息记录表中获取符合报表条件的数据将其以报表上传系统规定的格式拼接起来,获取最终统计数据的实体。Specifically, to obtain the file attributes is to filter records in the report index table through the report upload frequency and the down-loading system. If it is a monthly report, get the start and end time of the month before the current month, and if it is a daily report, get the start time and end time of the previous day. Generate the local storage path of the report, obtain the content in the report index table in the database, and put the report start and end time, report name, report output frequency, report upload system, report generation calling method name and other information in the report object. Generate a report file. The method of report generation is to obtain all the method names for generating the report through the report interface, and then judge whether it is consistent with the method name in the report index table. If it is consistent, the method is called by reflection. The entity that obtains the data that meets the report conditions in the record table and splices it together in the format specified by the report uploading system to obtain the final statistical data.

本发明实施例通过建立一个报表索引表,字段有上传系统、上传系统报表名称、报表的出表频率、报表的分类、报表实现的方法名等字段。写一个定时任务,首先判断当前日期判断生成日报表或者月报表,然后根据上传报表的系统名称获取数据库中报表索引表中的记录去分类用不同的方式实现该系统的报表生成,通过数据库中记录的信息反射调用方法,获取最终统计的报表数据实体内容。In the embodiment of the present invention, a report index table is established, and the fields include uploading system, report name of uploading system, report output frequency, report classification, and method name of report realization. Write a scheduled task, first determine the current date to generate a daily report or a monthly report, and then obtain the records in the report index table in the database according to the name of the system that uploaded the report to classify and use different methods to realize the report generation of the system, through the records in the database The information reflection calls the method to obtain the final statistical report data entity content.

本发明实施例将每一种报表的相应信息以一条记录的形式配置在数据库中,首先通过报表生成频率和上传报表系统来获取数据库中满足条件的所有记录,获取要上传到该系统的相应文件的属性将其记录在列表中。然后通过反射来调用生成相应报表的方法,获取最终统计数据的实体,创建生成文件到本地。In the embodiment of the present invention, the corresponding information of each report is configured in the database in the form of a record. First, all records that meet the conditions in the database are obtained through the report generation frequency and upload report system, and the corresponding files to be uploaded to the system are obtained. property to record it in the list. Then use reflection to call the method of generating the corresponding report, obtain the entity of the final statistical data, and create the generated file locally.

图4为本发明实施例一种报表生成方法的报表文件发送过程示意图,如图4所示,具体实施本发明实施例提供的一种报表生成方法时,在一个实施例中,还包括:在报表对象中放入报表文件的本地存放路径和报表文件的文件名;FIG. 4 is a schematic diagram of a report file sending process of a report generation method according to an embodiment of the present invention. As shown in FIG. 4 , when a report generation method provided by an embodiment of the present invention is specifically implemented, in one embodiment, the method further includes: The local storage path of the report file and the file name of the report file in the report object;

将报表数据实体转换为报表文件发送至目标上传系统,包括:Convert report data entities into report files and send them to the target upload system, including:

步骤401:通过报表对象获取报表文件的本地存放路径和报表文件的文件名;Step 401: obtain the local storage path of the report file and the file name of the report file through the report object;

步骤402:根据报表文件的本地存放路径,定义报表文件的上传路径,创建文件流,将报表数据实体写入报表文件;Step 402: According to the local storage path of the report file, define the upload path of the report file, create a file stream, and write the report data entity into the report file;

步骤403:根据报表文件的文件名,将报表文件发送至目标上传系统。Step 403: Send the report file to the target uploading system according to the file name of the report file.

实施例中,在得到报表数据实体后,需要将报表数据实体转换为报表文件发送至目标上传系统,主要过程,包括:In the embodiment, after the report data entity is obtained, the report data entity needs to be converted into a report file and sent to the target uploading system. The main process includes:

首先,通过报表对象获取报表文件的本地存放路径和报表文件的文件名;前述的报表对象中,已经预先放入报表文件的本地存放路径和报表文件的文件名;然后,根据报表文件的本地存放路径,定义报表文件的上传路径,创建文件流,将报表数据实体写入报表文件;最后,根据报表文件的文件名,将报表文件发送至目标上传系统。First, obtain the local storage path of the report file and the file name of the report file through the report object; in the aforementioned report object, the local storage path of the report file and the file name of the report file have been placed in advance; then, according to the local storage path of the report file Path, define the upload path of the report file, create a file stream, and write the report data entity into the report file; finally, send the report file to the target upload system according to the file name of the report file.

具体的,创建生成文件到本地,首先通过报表对象获取生成文件文件名、本地的输出路径,判断地址格式的正确性,文件夹不存在则创建新的文件夹。然后定义文件上传的本地全路径,创建文件流,将报表实体写入文件,根据报表文件的文件名,将报表文件发送至目标上传系统。Specifically, to create a generated file locally, first obtain the generated file file name and local output path through the report object, and judge the correctness of the address format. If the folder does not exist, create a new folder. Then define the local full path for file upload, create a file stream, write the report entity to the file, and send the report file to the target upload system according to the file name of the report file.

具体实施本发明实施例提供的一种报表生成方法时,在一个实施例中,根据报表文件的文件名,将报表文件发送至目标上传系统,包括:When specifically implementing the report generation method provided by the embodiment of the present invention, in one embodiment, sending the report file to the target uploading system according to the file name of the report file includes:

根据报表文件的文件盘,解析报表上传模式;所述报表上传模式,包括:全辖上传模式,分省上传模式;According to the file disk of the report file, analyze the report upload mode; the report upload mode includes: the whole jurisdiction upload mode and the provincial upload mode;

在报表上传模式为全辖上传模式时,将报表文件按照目标系统预设报表接收时间上传至全辖范围内的目标上传系统的FTP目录;When the report upload mode is the full jurisdiction upload mode, upload the report file to the FTP directory of the target upload system within the jurisdiction according to the preset report receiving time of the target system;

在报表上传模式为分省上传模式时,根据报表文件的文件名对应的省标识号,切换至每一省对应的目标上传系统的FTP目录,将报表文件分省上传至每一省对应的目标上传系统的FTP目录。When the report upload mode is the provincial upload mode, switch to the FTP directory of the target upload system corresponding to each province according to the province identification number corresponding to the file name of the report file, and upload the report file to the target corresponding to each province by province. Upload the system's FTP directory.

实施例中,由于目标系统分布在全辖范围内,如需要全辖上传时,则需要利用全辖上传模式,如需要分省上传时,则需要利用分省上传模式,主要上传过程,包括:In the embodiment, since the target system is distributed in the whole jurisdiction, if the whole jurisdiction upload is required, the whole jurisdiction upload mode needs to be used. If the provincial upload mode is required, the provincial upload mode needs to be used. The main upload process includes:

首先,根据报表文件的文件盘,解析报表上传模式;在报表上传模式为全辖上传模式时,将报表文件按照目标系统预设报表接收时间上传至全辖范围内的目标上传系统的FTP目录;在报表上传模式为分省上传模式时,根据报表文件的文件名对应的省标识号,切换至每一省对应的目标上传系统的FTP目录,将报表文件分省上传至每一省对应的目标上传系统的FTP目录。First, analyze the report upload mode according to the file disk of the report file; when the report upload mode is the full jurisdiction upload mode, upload the report file to the FTP directory of the target upload system within the jurisdiction according to the preset report receiving time of the target system; When the report upload mode is the provincial upload mode, switch to the FTP directory of the target upload system corresponding to each province according to the province identification number corresponding to the file name of the report file, and upload the report file to the target corresponding to each province by province. Upload the system's FTP directory.

批量上传文件到相应上传系统的FTP,上传的时候区分是全辖一份还是需要分省上传,如果需要分省上传则涉及到根据生成报表文件名中的省行联行号来切换相应报表传输的目录。批量将报表文件上传到报表系统的FTP,报表模式有全辖一份和分省上传两种,通过解析报表的文件名判断是哪一种模式。随后就上传到不同的文件目录中,上传系统成功之后将临时报表文件重命名。Upload files in batches to the FTP of the corresponding uploading system. When uploading, you need to distinguish one copy for the entire jurisdiction or need to upload by province. If you need to upload by province, it involves switching the corresponding report transmission according to the provincial branch number in the generated report file name. Directory. Upload report files to the FTP of the report system in batches. There are two report modes: one for the whole jurisdiction and one for each province. You can judge which mode is by analyzing the file name of the report. Then upload it to a different file directory. After the uploading system is successful, the temporary report file will be renamed.

由于现需生成报表文件种类多数量大,需要用大量时间来按照不同需求生成报表文件,导致代码冗余度高同时也不便于管理。本发明用数据库索引表将不同报表的生成条件记录,通过定时任务定时生成日月年报表,利用反射调用生成报表实体内容的方法,同一种上传系统可复用同一套代码。因此增加报表文件时只需要配置数据库记录,按照不同的需求实现报表实体内容的拼接即可。这种方式便于报表文件的管理,有效降低代码冗余度和人力物力成本。Due to the large number of types of report files that need to be generated, it takes a lot of time to generate report files according to different requirements, resulting in high code redundancy and inconvenient management. The invention uses the database index table to record the generation conditions of different reports, generates daily, monthly and annual reports through timed tasks, and utilizes reflection calls to generate the method of report entity content, and the same uploading system can reuse the same set of codes. Therefore, when adding report files, you only need to configure database records, and realize the splicing of report entity content according to different requirements. This method facilitates the management of report files and effectively reduces code redundancy and human and material costs.

下面结合具体场景,对本发明实施例提供的一种报表生成方法进行简要描述:A method for generating a report provided by an embodiment of the present invention is briefly described below with reference to specific scenarios:

本发明实施例通过建立一个报表索引表,字段有上传系统、上传系统报表名称、报表的出表频率、报表的分类、报表实现的方法名等字段。写一个定时任务,首先判断当前日期判断生成日报表或者月报表,然后根据上传报表的系统名称获取数据库中报表索引表中的记录去分类用不同的方式实现该系统的报表生成,通过数据库中记录的信息反射调用方法,获取最终统计的报表数据实体内容。In the embodiment of the present invention, a report index table is established, and the fields include uploading system, report name of uploading system, report output frequency, report classification, and method name of report realization. Write a scheduled task, first determine the current date to generate a daily report or a monthly report, and then obtain the records in the report index table in the database according to the name of the system that uploaded the report to classify and use different methods to realize the report generation of the system, through the records in the database The information reflection calls the method to obtain the final statistical report data entity content.

但当报表数量增加、应用场景较多时,将每一种报表的相应信息以一条记录的形式配置在数据库中,首先通过报表生成频率和上传报表系统来获取数据库中满足条件的所有记录,获取要上传到该系统的相应文件的属性将其记录在列表中。然后通过反射来调用生成相应报表的方法,获取最终统计数据的实体,创建生成文件到本地。然后批量上传文件到相应上传系统的FTP,上传的时候区分是全辖一份还是需要分省上传,如果需要分省上传则涉及到根据生成报表文件名中的省行联行号来切换相应报表传输的目录。However, when the number of reports increases and there are many application scenarios, the corresponding information of each report is configured in the database in the form of a record. First, all records that meet the conditions in the database are obtained through the report generation frequency and upload report system. The properties of the corresponding files uploaded to the system record them in the list. Then use reflection to call the method of generating the corresponding report, obtain the entity of the final statistical data, and create the generated file locally. Then upload the files in batches to the FTP of the corresponding uploading system. When uploading, it is necessary to distinguish one copy for the whole jurisdiction or for uploading by province. If it needs to upload by province, it involves switching the corresponding report according to the provincial branch number in the file name of the generated report. directory to transfer.

技术人员在实现本发明实施例时,需要关注的重点在于:数据库中字段设置要完善,生成报表的可配置型高;通过反射调用相应的方法生成对应报表;报表上传系统的连接方式需要确认,传输形式和传输目录通过代码配置实现;在对应的时间以规定的格式给对应的系统传输内容完整正确的报表,不同频率的报表都能按时生成。When implementing the embodiments of the present invention, the technical personnel need to pay attention to: the field settings in the database should be perfect, and the configurable type of the generated report should be high; the corresponding report is generated by calling the corresponding method through reflection; the connection method of the report uploading system needs to be confirmed, The transmission form and transmission directory are realized through code configuration; reports with complete and correct contents are transmitted to the corresponding system in the specified format at the corresponding time, and reports of different frequencies can be generated on time.

本发明实施例还提供的一种报表生成方法的流程,包括:The process of a report generation method further provided by an embodiment of the present invention includes:

首先创建一个定时任务,获取要生成的报表上传系统的所有文件属性。First, create a timed task to obtain all the file attributes of the report upload system to be generated.

获取文件属性是通过报表上传频率和下上传系统在报表索引表中筛选记录。如果是月报表则获取当前月前一个月的开始和结束时间,如果是日报获取前一天开始时间和结束时间。生成报表本地存放的路径,获取数据库中报表索引表中的内容在报表对象中放入报表开始、结束时间,报表名称,报表出表频率,报表上传系统,生成报表调用方法名等信息。定时任务,是指通过反射的方式定时调用生成报表的程序;报表索引表,是指在数据库中配置相应的字段,插入各种报表记录;报表生成程序,是指将报表中需要的字段以上传系统规定的格式生成对应的报表;连接上传系统程序,是指先将文件生成到本地然后将生成的报表文件批量上传到相应系统的FTP。Obtaining file attributes is to filter records in the report index table through the report upload frequency and the next upload system. If it is a monthly report, get the start and end time of the month before the current month, and if it is a daily report, get the start time and end time of the previous day. Generate the local storage path of the report, obtain the content in the report index table in the database, and put the report start and end time, report name, report output frequency, report upload system, report generation calling method name and other information in the report object. Scheduled task refers to calling the program that generates reports regularly by means of reflection; report index table refers to configuring corresponding fields in the database and inserting various report records; report generating program refers to uploading the required fields in the report to The corresponding report is generated in the format specified by the system; connecting to the uploading system program means that the file is first generated locally and then the generated report file is uploaded to the FTP of the corresponding system in batches.

生成报表文件,报表生成的方法是通过报表接口获取所有生成报表的方法名,然后判断是否与该条报表索引表中的方法名一致,如果一致则反射调用该方法,该方法中会在各个信息记录表中获取符合报表条件的数据将其以报表上传系统规定的格式拼接起来,获取最终统计数据的实体。Generate a report file. The method of report generation is to obtain all the method names for generating the report through the report interface, and then judge whether it is consistent with the method name in the report index table. If it is consistent, the method is called by reflection. The entity that obtains the data that meets the report conditions in the record table and splices it together in the format specified by the report uploading system to obtain the final statistical data.

创建生成文件到本地,首先通过报表对象获取生成文件文件名、本地的输出路径,判断地址格式的正确性,文件夹不存在则创建新的文件夹。然后定义文件上传的本地全路径,创建文件流,将报表实体写入文件。To create a generated file locally, first obtain the generated file file name and local output path through the report object, and judge the correctness of the address format. If the folder does not exist, create a new folder. Then define the local full path for file upload, create a file stream, and write the report entity to the file.

然后批量将报表文件上传到报表系统的FTP,报表模式有全辖一份和分省上传两种,通过解析报表的文件名判断是哪一种模式。随后就上传到不同的文件目录中,上传系统成功之后将临时报表文件重命名。Then upload the report files to the FTP of the report system in batches. There are two report modes: one for the whole jurisdiction and one for each province. You can determine which mode is by analyzing the file name of the report. Then upload it to a different file directory. After the uploading system is successful, the temporary report file will be renamed.

本发明实施例的核心在于数据库中配置相应报表记录,反射调用记录在报表索引表中的方法名,生成报表实体内容,批量上传到规定系统目录,通过数据库配置,可复用性高重复代码数量少。关键点在于配置数据库中报表记录方式,筛选报表记录模式,反射调用生成报表实体内容的方法,批量上传文件方式等The core of the embodiment of the present invention is to configure the corresponding report records in the database, to reflect and call the method names recorded in the report index table, to generate the report entity content, and to upload them to the specified system directory in batches. few. The key point is to configure the report record mode in the database, filter the report record mode, reflect the method to generate the report entity content, upload files in batches, etc.

由于现需生成报表文件种类多数量大,需要用大量时间来按照不同需求生成报表文件,导致代码冗余度高同时也不便于管理。本发明用数据库索引表将不同报表的生成条件记录,通过定时任务定时生成日月年报表,利用反射调用生成报表实体内容的方法,同一种上传系统可复用同一套代码。因此增加报表文件时只需要配置数据库记录,按照不同的需求实现报表实体内容的拼接即可。这种方式便于报表文件的管理,有效降低代码冗余度和人力物力成本。Due to the large number of types of report files that need to be generated, it takes a lot of time to generate report files according to different requirements, resulting in high code redundancy and inconvenient management. The invention uses the database index table to record the generation conditions of different reports, generates daily, monthly and annual reports through timed tasks, and utilizes reflection calls to generate the method of report entity content, and the same uploading system can reuse the same set of codes. Therefore, when adding report files, you only need to configure database records, and realize the splicing of report entity content according to different requirements. This method facilitates the management of report files and effectively reduces code redundancy and human and material costs.

图5为运行本发明实施的一种报表生成方法的计算机设备示意图,如图5所示,本发明实施例还提供一种计算机设备500,包括存储器510、处理器520及存储在存储器上并可在处理器上运行的计算机程序530,所述处理器执行所述计算机程序时实现上述一种报表生成方法。FIG. 5 is a schematic diagram of a computer device running a report generation method implemented by the present invention. As shown in FIG. 5 , an embodiment of the present invention further provides a computer device 500, including a memory 510, a processor 520, and a computer stored in the memory and can The computer program 530 running on the processor, when the processor executes the computer program, implements the above-mentioned method for generating a report.

本发明实施例还提供一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时实现上述一种报表生成方法。An embodiment of the present invention further provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, implements the foregoing method for generating a report.

本发明实施例还提供一种计算机程序产品,所述计算机程序产品包括计算机程序,所述计算机程序被处理器执行时实现上述一种报表生成方法。An embodiment of the present invention further provides a computer program product, where the computer program product includes a computer program, and when the computer program is executed by a processor, the above-mentioned method for generating a report is implemented.

本发明实施例中还提供了一种报表生成装置,如下面的实施例所述。由于该装置解决问题的原理与一种报表生成方法相似,因此该装置的实施可以参见一种报表生成方法的实施,重复之处不再赘述。The embodiment of the present invention also provides a report generating apparatus, as described in the following embodiments. Since the principle of the device for solving the problem is similar to a method for generating a report, the implementation of the device can refer to the implementation of a method for generating a report, and the repetition will not be repeated.

图6为本发明实施例一种报表生成装置示意图,如图6所示,本发明实施例还提供一种报表生成装置,具体实施时可以包括:FIG. 6 is a schematic diagram of a report generating apparatus according to an embodiment of the present invention. As shown in FIG. 6 , an embodiment of the present invention also provides a report generating apparatus, which may include:

报表索引表建立模块601,用于在数据库中建立报表索引表;A report index table establishment module 601 is used to establish a report index table in the database;

目标上传系统的文件属性信息获取模块602,用于根据报表索引表,获取目标上传系统的文件属性信息;The file attribute information acquisition module 602 of the target uploading system is configured to acquire the file attribute information of the target uploading system according to the report index table;

报表数据实体生成模块603,用于根据报表索引表和目标上传系统的文件属性信息,调用报表生成程序,生成报表数据实体;The report data entity generation module 603 is used to call the report generation program according to the report index table and the file attribute information of the target uploading system to generate the report data entity;

报表文件发送模块604,用于将报表数据实体转换为报表文件发送至目标上传系统。The report file sending module 604 is configured to convert the report data entity into a report file and send it to the target uploading system.

具体实施本发明实施例提供的一种报表生成装置时,在一个实施例中,报表索引表建立模块,具体用于:When implementing the report generation device provided by the embodiment of the present invention, in one embodiment, the report index table establishment module is specifically used for:

获取与数据库连接的全部上传系统,获取每一上传系统对应报表的生成条件;Obtain all uploading systems connected to the database, and obtain the report generation conditions corresponding to each uploading system;

根据每一上传系统对应报表的生成条件,在数据库中配置对应每一上传系统的字段记录,建立报表索引表。According to the generation conditions of the report corresponding to each uploading system, configure the field records corresponding to each uploading system in the database, and establish the report index table.

具体实施本发明实施例提供的一种报表生成装置时,在一个实施例中,所述报表索引表包括多个字段,所述字段,至少包括:上传系统名称,报表的出表频率,报表实现的方法名;When implementing the report generating apparatus provided by the embodiment of the present invention, in one embodiment, the report index table includes a plurality of fields, and the fields at least include: uploading system name, report output frequency, report implementation method name;

目标上传系统的文件属性信息获取模块,具体用于:The file attribute information acquisition module of the target upload system, which is specifically used for:

根据目标上传系统名称,在报表索引表中筛选出目标上传系统的报表的出表频率和目标上传系统的报表实现的方法名作为目标上传系统的文件属性信息。According to the name of the target uploading system, the report output frequency of the target uploading system and the method name implemented by the report of the target uploading system are filtered out in the report index table as the file attribute information of the target uploading system.

具体实施本发明实施例提供的一种报表生成装置时,在一个实施例中,报表数据实体生成模块,具体用于:When implementing the report generation device provided by the embodiment of the present invention, in one embodiment, the report data entity generation module is specifically used for:

创建定时任务,根据当前系统日期生成不同时间长度的基础报表数据,存入信息记录表;Create timed tasks, generate basic report data of different time lengths according to the current system date, and store them in the information record table;

根据目标上传系统名称,获取报表索引表中对应目标上传系统的字段,放入报表对象中;所述放入报表对象中的字段,包括:报表开始时间、报表结束时间、报表名称、报表的出表频率、报表上传系统名称和报表实现的方法名;According to the name of the target uploading system, obtain the fields corresponding to the target uploading system in the report index table and put them into the report object; the fields put into the report object include: report start time, report end time, report name, report output Report frequency, report upload system name and report implementation method name;

通过报表接口获取所有生成报表的方法名,与目标上传系统的报表实现的方法名进行匹配;Obtain all method names for generating reports through the report interface, and match the method names implemented by the report of the target uploading system;

当方法名匹配一致时,通过反射的方式调用该匹配一致的方法名对应的报表生成程序,从信息记录表中获取适配报表对象的基础报表数据,按照目标上传系统对应报表的生成条件拼接,按照目标上传系统的报表的出表频率生成报表数据实体。When the method names match the same, the report generation program corresponding to the matching method name is invoked through reflection, and the basic report data of the adapted report object is obtained from the information record table, and is spliced according to the generation conditions of the corresponding report of the target upload system. Generate report data entities according to the report output frequency of the target upload system report.

具体实施本发明实施例提供的一种报表生成装置时,在一个实施例中,报表数据实体生成模块,还用于:在报表对象中放入报表文件的本地存放路径和报表文件的文件名;When specifically implementing the report generation device provided by the embodiment of the present invention, in one embodiment, the report data entity generation module is further configured to: put the local storage path of the report file and the file name of the report file in the report object;

报表文件发送模块,具体用于:Report file sending module, specifically used for:

通过报表对象获取报表文件的本地存放路径和报表文件的文件名;Obtain the local storage path of the report file and the file name of the report file through the report object;

根据报表文件的本地存放路径,定义报表文件的上传路径,创建文件流,将报表数据实体写入报表文件;According to the local storage path of the report file, define the upload path of the report file, create a file stream, and write the report data entity into the report file;

根据报表文件的文件名,将报表文件发送至目标上传系统。Send the report file to the target upload system based on the file name of the report file.

具体实施本发明实施例提供的一种报表生成装置时,在一个实施例中,报表文件发送模块,还用于:When implementing the device for generating a report provided by the embodiment of the present invention, in one embodiment, the report file sending module is further configured to:

根据报表文件的文件盘,解析报表上传模式;所述报表上传模式,包括:全辖上传模式,分省上传模式;According to the file disk of the report file, analyze the report upload mode; the report upload mode includes: the whole jurisdiction upload mode and the provincial upload mode;

在报表上传模式为全辖上传模式时,将报表文件按照目标系统预设报表接收时间上传至全辖范围内的目标上传系统的FTP目录;When the report upload mode is the full jurisdiction upload mode, upload the report file to the FTP directory of the target upload system within the jurisdiction according to the preset report receiving time of the target system;

在报表上传模式为分省上传模式时,根据报表文件的文件名对应的省标识号,切换至每一省对应的目标上传系统的FTP目录,将报表文件分省上传至每一省对应的目标上传系统的FTP目录。When the report upload mode is the provincial upload mode, switch to the FTP directory of the target upload system corresponding to each province according to the province identification number corresponding to the file name of the report file, and upload the report file to the target corresponding to each province by province. Upload the system's FTP directory.

综上,本发明实施例提供的一种报表生成方法和装置,包括:在数据库中建立报表索引表;根据报表索引表,获取目标上传系统的文件属性信息;根据报表索引表和目标上传系统的文件属性信息,调用报表生成程序,生成报表数据实体;将报表数据实体转换为报表文件发送至目标上传系统。本发明利用在数据库建立的报表索引表将不同报表的生成条件记录,通过调用报表生成程生成报表实体内容,实现同一种上传系统可复用同一套代码,按照不同上传系统的需求生成对应的报表文件。在增加报表文件时只需要配置数据库中的报表索引表,按照不同的需求实现报表实体内容的拼接即可,便于报表文件的管理,有效降低代码冗余度和人力物力成本。To sum up, a method and device for generating a report provided by the embodiments of the present invention include: establishing a report index table in a database; obtaining file attribute information of a target uploading system according to the report index table; File attribute information, call the report generation program to generate report data entities; convert the report data entities into report files and send them to the target uploading system. The invention uses the report index table established in the database to record the generation conditions of different reports, and generates the report entity content by calling the report generation process, so that the same uploading system can reuse the same set of codes, and generate corresponding reports according to the requirements of different uploading systems. document. When adding report files, you only need to configure the report index table in the database, and realize the splicing of report entity content according to different needs, which is convenient for the management of report files, and effectively reduces code redundancy and labor and material costs.

本领域内的技术人员应明白,本发明的实施例可提供为方法、系统、或计算机程序产品。因此,本发明可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.

本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block in the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to the processor of a general purpose computer, special purpose computer, embedded processor or other programmable data processing device to produce a machine such that the instructions executed by the processor of the computer or other programmable data processing device produce Means for implementing the functions specified in a flow or flow of a flowchart and/or a block or blocks of a block diagram.

这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory result in an article of manufacture comprising instruction means, the instructions The apparatus implements the functions specified in the flow or flow of the flowcharts and/or the block or blocks of the block diagrams.

这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded on a computer or other programmable data processing device to cause a series of operational steps to be performed on the computer or other programmable device to produce a computer-implemented process such that The instructions provide steps for implementing the functions specified in the flow or blocks of the flowcharts and/or the block or blocks of the block diagrams.

以上所述的具体实施例,对本发明的目的、技术方案和有益效果进行了进一步详细说明,所应理解的是,以上所述仅为本发明的具体实施例而已,并不用于限定本发明的保护范围,凡在本发明的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。The specific embodiments described above further describe the purpose, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above-mentioned specific embodiments are only specific embodiments of the present invention, and are not intended to limit the scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.

Claims (15)

1.一种报表生成方法,其特征在于,包括:1. a report generation method, is characterized in that, comprises: 在数据库中建立报表索引表;Create a report index table in the database; 根据报表索引表,获取目标上传系统的文件属性信息;Obtain the file attribute information of the target upload system according to the report index table; 根据报表索引表和目标上传系统的文件属性信息,调用报表生成程序,生成报表数据实体;According to the report index table and the file attribute information of the target uploading system, call the report generation program to generate the report data entity; 将报表数据实体转换为报表文件发送至目标上传系统。Convert report data entities into report files and send them to the target uploading system. 2.如权利要求1所述的方法,其特征在于,在数据库中建立报表索引表,包括:2. method as claimed in claim 1 is characterized in that, in database, set up report index table, comprising: 获取与数据库连接的全部上传系统,获取每一上传系统对应报表的生成条件;Obtain all uploading systems connected to the database, and obtain the report generation conditions corresponding to each uploading system; 根据每一上传系统对应报表的生成条件,在数据库中配置对应每一上传系统的字段记录,建立报表索引表。According to the generation conditions of the report corresponding to each uploading system, configure the field records corresponding to each uploading system in the database, and establish the report index table. 3.如权利要求2所述的方法,其特征在于,所述报表索引表包括多个字段,所述字段,至少包括:上传系统名称,报表的出表频率,报表实现的方法名;3. The method according to claim 2, wherein the report index table comprises a plurality of fields, and the field includes at least: uploading system name, report output frequency of report, and method name of report realization; 根据报表索引表,获取目标上传系统的文件属性信息,包括:Obtain the file attribute information of the target upload system according to the report index table, including: 根据目标上传系统名称,在报表索引表中筛选出目标上传系统的报表的出表频率和目标上传系统的报表实现的方法名作为目标上传系统的文件属性信息。According to the name of the target uploading system, the report output frequency of the target uploading system and the method name implemented by the report of the target uploading system are filtered out in the report index table as the file attribute information of the target uploading system. 4.如权利要求3所述的方法,其特征在于,根据报表索引表和目标上传系统的文件属性信息,调用报表生成程序,生成报表数据实体,包括:4. The method of claim 3, wherein, according to the report index table and the file attribute information of the target uploading system, the report generation program is invoked to generate the report data entity, comprising: 创建定时任务,根据当前系统日期生成不同时间长度的基础报表数据,存入信息记录表;Create timed tasks, generate basic report data of different time lengths according to the current system date, and store them in the information record table; 根据目标上传系统名称,获取报表索引表中对应目标上传系统的字段,放入报表对象中;所述放入报表对象中的字段,包括:报表开始时间、报表结束时间、报表名称、报表的出表频率、报表上传系统名称和报表实现的方法名;According to the name of the target uploading system, the fields corresponding to the target uploading system in the report index table are obtained and put into the report object; the fields put into the report object include: report start time, report end time, report name, report output Report frequency, report upload system name and report implementation method name; 通过报表接口获取所有生成报表的方法名,与目标上传系统的报表实现的方法名进行匹配;Obtain all method names for generating reports through the report interface, and match the method names implemented by the report of the target uploading system; 当方法名匹配一致时,通过反射的方式调用该匹配一致的方法名对应的报表生成程序,从信息记录表中获取适配报表对象的基础报表数据,按照目标上传系统对应报表的生成条件拼接,按照目标上传系统的报表的出表频率生成报表数据实体。When the method name matches the same, the report generation program corresponding to the matching method name is called by reflection, and the basic report data of the adapted report object is obtained from the information record table, and the corresponding report generation conditions are spliced according to the target upload system. Generate report data entities according to the report output frequency of the target upload system report. 5.如权利要求4所述的方法,其特征在于,还包括:在报表对象中放入报表文件的本地存放路径和报表文件的文件名;5. method as claimed in claim 4, is characterized in that, also comprises: in report object, put into the filename of the local storage path of report file and report file; 将报表数据实体转换为报表文件发送至目标上传系统,包括:Convert report data entities into report files and send them to the target upload system, including: 通过报表对象获取报表文件的本地存放路径和报表文件的文件名;Obtain the local storage path of the report file and the file name of the report file through the report object; 根据报表文件的本地存放路径,定义报表文件的上传路径,创建文件流,将报表数据实体写入报表文件;According to the local storage path of the report file, define the upload path of the report file, create a file stream, and write the report data entity into the report file; 根据报表文件的文件名,将报表文件发送至目标上传系统。Send the report file to the target upload system based on the file name of the report file. 6.如权利要求5所述的方法,其特征在于,根据报表文件的文件名,将报表文件发送至目标上传系统,包括:6. The method of claim 5, wherein, according to the file name of the report file, the report file is sent to the target uploading system, comprising: 根据报表文件的文件盘,解析报表上传模式;所述报表上传模式,包括:全辖上传模式,分省上传模式;According to the file disk of the report file, analyze the report upload mode; the report upload mode includes: the whole jurisdiction upload mode and the provincial upload mode; 在报表上传模式为全辖上传模式时,将报表文件按照目标系统预设报表接收时间上传至全辖范围内的目标上传系统的FTP目录;When the report upload mode is the full jurisdiction upload mode, upload the report file to the FTP directory of the target upload system within the jurisdiction according to the preset report receiving time of the target system; 在报表上传模式为分省上传模式时,根据报表文件的文件名对应的省标识号,切换至每一省对应的目标上传系统的FTP目录,将报表文件分省上传至每一省对应的目标上传系统的FTP目录。When the report upload mode is the provincial upload mode, switch to the FTP directory of the target upload system corresponding to each province according to the province identification number corresponding to the file name of the report file, and upload the report file to the target corresponding to each province by province. Upload the system's FTP directory. 7.一种报表生成装置,其特征在于,包括:7. A report generation device, characterized in that, comprising: 报表索引表建立模块,用于在数据库中建立报表索引表;The report index table building module is used to build the report index table in the database; 目标上传系统的文件属性信息获取模块,用于根据报表索引表,获取目标上传系统的文件属性信息;The file attribute information acquisition module of the target uploading system is used to obtain the file attribute information of the target uploading system according to the report index table; 报表数据实体生成模块,用于根据报表索引表和目标上传系统的文件属性信息,调用报表生成程序,生成报表数据实体;The report data entity generation module is used to call the report generation program according to the report index table and the file attribute information of the target uploading system to generate the report data entity; 报表文件发送模块,用于将报表数据实体转换为报表文件发送至目标上传系统。The report file sending module is used to convert report data entities into report files and send them to the target uploading system. 8.如权利要求7所述的装置,其特征在于,报表索引表建立模块,具体用于:8. device as claimed in claim 7 is characterized in that, report index table establishment module is specially used for: 获取与数据库连接的全部上传系统,获取每一上传系统对应报表的生成条件;Obtain all uploading systems connected to the database, and obtain the report generation conditions corresponding to each uploading system; 根据每一上传系统对应报表的生成条件,在数据库中配置对应每一上传系统的字段记录,建立报表索引表。According to the generation conditions of the report corresponding to each uploading system, configure the field records corresponding to each uploading system in the database, and establish the report index table. 9.如权利要求8所述的装置,其特征在于,所述报表索引表包括多个字段,所述字段,至少包括:上传系统名称,报表的出表频率,报表实现的方法名;9. The device according to claim 8, wherein the report index table comprises a plurality of fields, and the fields at least include: uploading system name, report output frequency, and report implementation method name; 目标上传系统的文件属性信息获取模块,具体用于:The file attribute information acquisition module of the target upload system, which is specifically used for: 根据目标上传系统名称,在报表索引表中筛选出目标上传系统的报表的出表频率和目标上传系统的报表实现的方法名作为目标上传系统的文件属性信息。According to the name of the target uploading system, the report output frequency of the target uploading system and the method name implemented by the report of the target uploading system are filtered out in the report index table as the file attribute information of the target uploading system. 10.如权利要求9所述的装置,其特征在于,报表数据实体生成模块,具体用于:10. The device according to claim 9, wherein the report data entity generation module is specifically used for: 创建定时任务,根据当前系统日期生成不同时间长度的基础报表数据,存入信息记录表;Create timed tasks, generate basic report data of different time lengths according to the current system date, and store them in the information record table; 根据目标上传系统名称,获取报表索引表中对应目标上传系统的字段,放入报表对象中;所述放入报表对象中的字段,包括:报表开始时间、报表结束时间、报表名称、报表的出表频率、报表上传系统名称和报表实现的方法名;According to the name of the target uploading system, the fields corresponding to the target uploading system in the report index table are obtained and put into the report object; the fields put into the report object include: report start time, report end time, report name, report output Report frequency, report upload system name and report implementation method name; 通过报表接口获取所有生成报表的方法名,与目标上传系统的报表实现的方法名进行匹配;Obtain all method names for generating reports through the report interface, and match the method names implemented by the report of the target uploading system; 当方法名匹配一致时,通过反射的方式调用该匹配一致的方法名对应的报表生成程序,从信息记录表中获取适配报表对象的基础报表数据,按照目标上传系统对应报表的生成条件拼接,按照目标上传系统的报表的出表频率生成报表数据实体。When the method name matches the same, the report generation program corresponding to the matching method name is called by reflection, and the basic report data of the adapted report object is obtained from the information record table, and the corresponding report generation conditions are spliced according to the target upload system. Generate report data entities according to the report output frequency of the target upload system report. 11.如权利要求10所述的装置,其特征在于,报表数据实体生成模块,还用于:在报表对象中放入报表文件的本地存放路径和报表文件的文件名;11. device as claimed in claim 10, is characterized in that, report data entity generation module is also used for: in report object, the local storage path of report file and the filename of report file are put into; 报表文件发送模块,具体用于:Report file sending module, specifically used for: 通过报表对象获取报表文件的本地存放路径和报表文件的文件名;Obtain the local storage path of the report file and the file name of the report file through the report object; 根据报表文件的本地存放路径,定义报表文件的上传路径,创建文件流,将报表数据实体写入报表文件;According to the local storage path of the report file, define the upload path of the report file, create a file stream, and write the report data entity into the report file; 根据报表文件的文件名,将报表文件发送至目标上传系统。Send the report file to the target upload system based on the file name of the report file. 12.如权利要求11所述的装置,其特征在于,报表文件发送模块,还用于:12. The device of claim 11, wherein the report file sending module is also used for: 根据报表文件的文件盘,解析报表上传模式;所述报表上传模式,包括:全辖上传模式,分省上传模式;According to the file disk of the report file, analyze the report upload mode; the report upload mode includes: the whole jurisdiction upload mode and the provincial upload mode; 在报表上传模式为全辖上传模式时,将报表文件按照目标系统预设报表接收时间上传至全辖范围内的目标上传系统的FTP目录;When the report upload mode is the full jurisdiction upload mode, upload the report file to the FTP directory of the target upload system within the jurisdiction according to the preset report receiving time of the target system; 在报表上传模式为分省上传模式时,根据报表文件的文件名对应的省标识号,切换至每一省对应的目标上传系统的FTP目录,将报表文件分省上传至每一省对应的目标上传系统的FTP目录。When the report upload mode is the provincial upload mode, switch to the FTP directory of the target upload system corresponding to each province according to the province identification number corresponding to the file name of the report file, and upload the report file to the target corresponding to each province by province. Upload the system's FTP directory. 13.一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,其特征在于,所述处理器执行所述计算机程序时实现权利要求1至6任一项所述方法。13. A computer device comprising a memory, a processor and a computer program stored on the memory and running on the processor, wherein the processor implements any one of claims 1 to 6 when the processor executes the computer program method described in item. 14.一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时实现权利要求1至6任一所述方法。14 . A computer-readable storage medium, characterized in that, the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method of any one of claims 1 to 6 is implemented. 15.一种计算机程序产品,其特征在于,所述计算机程序产品包括计算机程序,所述计算机程序被处理器执行时实现权利要求1至6任一所述方法。15. A computer program product, characterized in that the computer program product comprises a computer program, and when the computer program is executed by a processor, implements the method of any one of claims 1 to 6.
CN202210164007.1A 2022-02-22 2022-02-22 Report generation method and device Pending CN114528251A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210164007.1A CN114528251A (en) 2022-02-22 2022-02-22 Report generation method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210164007.1A CN114528251A (en) 2022-02-22 2022-02-22 Report generation method and device

Publications (1)

Publication Number Publication Date
CN114528251A true CN114528251A (en) 2022-05-24

Family

ID=81623895

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210164007.1A Pending CN114528251A (en) 2022-02-22 2022-02-22 Report generation method and device

Country Status (1)

Country Link
CN (1) CN114528251A (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101790257A (en) * 2009-01-22 2010-07-28 大唐移动通信设备有限公司 Method for memorizing data and network management system
US20110197122A1 (en) * 2010-02-05 2011-08-11 Yuen Sheung Chan Generating and Displaying Active Reports
CN105808538A (en) * 2014-12-29 2016-07-27 深圳云之家网络有限公司 Method and device for generating mobile report form
CN107229718A (en) * 2017-05-31 2017-10-03 北京京东尚科信息技术有限公司 The method and apparatus for handling report data
CN110362567A (en) * 2019-05-29 2019-10-22 武汉快快充通信技术有限公司 A kind of the telephone expenses front-end platform and financial statement deriving method of distributed deployment
CN113486096A (en) * 2021-06-21 2021-10-08 上海百秋电子商务有限公司 Multi-library timing execution report data preprocessing and query method and system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101790257A (en) * 2009-01-22 2010-07-28 大唐移动通信设备有限公司 Method for memorizing data and network management system
US20110197122A1 (en) * 2010-02-05 2011-08-11 Yuen Sheung Chan Generating and Displaying Active Reports
CN105808538A (en) * 2014-12-29 2016-07-27 深圳云之家网络有限公司 Method and device for generating mobile report form
CN107229718A (en) * 2017-05-31 2017-10-03 北京京东尚科信息技术有限公司 The method and apparatus for handling report data
CN110362567A (en) * 2019-05-29 2019-10-22 武汉快快充通信技术有限公司 A kind of the telephone expenses front-end platform and financial statement deriving method of distributed deployment
CN113486096A (en) * 2021-06-21 2021-10-08 上海百秋电子商务有限公司 Multi-library timing execution report data preprocessing and query method and system

Similar Documents

Publication Publication Date Title
CN105389402A (en) Big-data-oriented ETL (Extraction-Transformation-Loading) method and device
CN112559475B (en) Data real-time capturing and transmitting method and system
CN102542007A (en) Method and system for synchronization of relational databases
CN113595761A (en) Micro-service component optimization method of power system information and communication integrated scheduling platform
CN105915381A (en) System for realizing monitoring system business logic online modification
CN114493479A (en) Implementation method and system of enterprise-level workflow engine based on microservice SaaS
WO2019056789A1 (en) Method, device, computer device, storage medium for identifying related party transaction
CN111368327A (en) Data sharing method and device, electronic equipment and readable storage medium
CN109325221A (en) Method and device for merging table files
CN111949634A (en) Method for synchronously migrating block chain data
CN112596806A (en) Data lake data loading script generation method and system
CN113111125A (en) Business evidence storage method based on block chain
CN115373640A (en) Low-code componentization software development method and system for financial reimbursement receipt machine
CN114528251A (en) Report generation method and device
CN119537470A (en) Data synchronization method, device, equipment and medium
CN113934706A (en) A data lake update processing method, device, storage medium and electronic device
CN112134927A (en) Power grid data exchange platform and data exchange method based on plug-in mode
CN103559586A (en) Report document management device, system and method
CN117472981A (en) Service chain tracing and searching method
CN111654337B (en) An information processing method, terminal and computer-readable storage medium
CN115757642A (en) Data synchronization method and device based on filing log file
CN114756295A (en) Application program interface management method and device, electronic equipment and storage medium
CN115150279B (en) Service link information acquisition method and device
RU2787261C1 (en) System and method for engineering data management
CN118503207B (en) Scientific research whole process-oriented data management and archiving method and integrated platform

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20220524