CN115618838A - Report generation method and equipment - Google Patents

Report generation method and equipment Download PDF

Info

Publication number
CN115618838A
CN115618838A CN202211186776.8A CN202211186776A CN115618838A CN 115618838 A CN115618838 A CN 115618838A CN 202211186776 A CN202211186776 A CN 202211186776A CN 115618838 A CN115618838 A CN 115618838A
Authority
CN
China
Prior art keywords
template
file
requirement
style
report
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
CN202211186776.8A
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.)
China Construction Bank Corp
Original Assignee
China Construction Bank Corp
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 China Construction Bank Corp filed Critical China Construction Bank Corp
Priority to CN202211186776.8A priority Critical patent/CN115618838A/en
Publication of CN115618838A publication Critical patent/CN115618838A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • 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

Abstract

The invention provides a report generation method and equipment, which relate to the technical field of data processing and comprise the following steps: acquiring a user requirement file, and determining an object style and an object attribute of a target report according to the user requirement file; generating a demand template file corresponding to the target report by using an object style template generated according to the object style and an object attribute template generated according to the object attribute; and generating the target report according to the service data corresponding to the requirement template file and the target report. According to the invention, the requirement template file can be generated according to the user requirement file, and then the report meeting the user requirement is generated according to the requirement template file, so that the report generation efficiency and quality are effectively improved.

Description

Report generation method and equipment
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a report generation method and device.
Background
At present, in the operation process of business systems of various industries, a large amount of user behavior data, business process data, summarized data based on the data and the like are generated, and due to the requirement of business management, the data often needs to be nested into a template set in advance to present a report with a fixed format.
Since the templates are usually fixed, when the report needs change, the templates need to be manually changed or new templates need to be created to generate reports meeting the actual needs of users.
However, with the development of the times, data in a future business system will grow explosively, report requirements will be complex and changeable, and contents are diversified, for example, a plurality of picture display items may exist in a requirement template, so that not only is the workload extremely large, but also a certain error risk exists when the template is manually established or changed, and the generation efficiency and quality of reports are low.
Disclosure of Invention
The invention provides a report generation method and equipment, which can effectively improve the generation efficiency and quality of a report.
In a first aspect, the present invention provides a report generating method, including:
acquiring a user requirement file, and determining an object style and an object attribute of a target report according to the user requirement file, wherein the user requirement file is used for describing the form and content of the target report required by a user;
generating a demand template file corresponding to the target report by using an object style template generated according to the object style and an object attribute template generated according to the object attribute;
when a plurality of picture display items exist in the requirement template file, business data corresponding to the target report are obtained, picture list objects in the business data are circularly traversed, image codes corresponding to the picture list objects are obtained, the image codes corresponding to the picture list objects and text data in the business data are filled in the requirement template file, and the target report is generated.
In one possible embodiment, the determining the object style and the object attribute of the target report according to the user requirement file includes:
analyzing key words in the user requirement file, and determining the object style and the object attribute of the target report according to the key words in the user requirement file;
wherein the object styles include, but are not limited to, font type, font size, font color, paragraph format, and table style; the object attributes are used to present text data and/or pictures including, but not limited to, name, age, location, time, and traffic.
In a possible implementation manner, before generating the requirement template file corresponding to the target report by using the object style template generated according to the object style and the object attribute template generated according to the object attribute, the method further includes:
determining metadata corresponding to the object style and determining metadata corresponding to the object attribute;
generating the object style template according to metadata corresponding to the object style and in a key value pair mode; the key name in the object style template is an object style name marked by a freemaker label;
generating the object attribute template according to the metadata corresponding to the object attribute and the form of a key value pair; and the key name in the object attribute template is the object attribute name marked by a freemaker label.
In a possible implementation manner, when a picture display item exists in the requirement template file, business data corresponding to the target report is acquired by using a freemaker technology, and an image code corresponding to the picture display item is acquired in the business data and is filled in an image data tag in the requirement template file.
In a possible embodiment, the method further comprises:
and when no picture display item exists in the requirement template file, acquiring business data corresponding to the target report by using a freemaker technology, and filling the business data in the requirement template file to generate the target report.
In a possible embodiment, the method further comprises:
when the user requirement file is detected to be changed, modifying the object style template and/or the object attribute template according to the changed content of the user requirement file;
and updating the requirement template file according to the modified object style template and/or the object attribute template.
In a second aspect, the present invention provides a report generating apparatus, comprising:
the system comprises a determining module, a display module and a display module, wherein the determining module is used for acquiring a user requirement file and determining an object style and an object attribute of a target report according to the user requirement file, and the user requirement file is used for describing the form and the content of the target report required by a user;
the template generating module is used for generating a demand template file corresponding to the target report by utilizing an object style template generated according to the object style and an object attribute template generated according to the object attribute;
and the report generation module is used for acquiring the service data corresponding to the target report when a plurality of picture display items exist in the requirement template file, circularly traversing picture list objects in the service data, acquiring image codes corresponding to the picture list objects, and filling the image codes corresponding to the picture list objects and text data in the service data into the requirement template file to generate the target report.
In one possible embodiment, the determining module is configured to:
analyzing key words in the user requirement file, and determining the object style and the object attribute of the target report according to the key words in the user requirement file;
wherein the object styles include, but are not limited to, font type, font size, font color, paragraph format, and table style; the object attributes are used to present text data and/or pictures including, but not limited to, name, age, location, time, and traffic.
In one possible embodiment, the template generation module is configured to:
determining metadata corresponding to the object style and determining metadata corresponding to the object attribute;
generating the object style template according to the metadata corresponding to the object style and in a key value pair mode; the key name in the object style template is an object style name marked by a freemaker label;
generating the object attribute template according to the metadata corresponding to the object attribute and in a key value pair mode; and the key name in the object attribute template is the object attribute name marked by a freemaker label.
In one possible implementation, the report generation module is further configured to:
when a picture display item exists in the requirement template file, business data corresponding to the target report is obtained by using a freemaker technology, image codes corresponding to the picture display item are obtained from the business data, and the image codes are filled in image data labels in the requirement template file.
In one possible implementation, the report generation module is further configured to:
and when no picture display item exists in the requirement template file, acquiring business data corresponding to the target report by using a freemaker technology, and filling the business data in the requirement template file to generate the target report.
In one possible implementation, the system further includes a template updating module configured to:
when the user requirement file is detected to be changed, modifying the object style template and/or the object attribute template according to the changed content of the user requirement file;
and updating the requirement template file according to the modified object style template and/or the object attribute template.
In a third aspect, the present invention provides an electronic device comprising: at least one processor and memory;
the memory stores computer-executable instructions;
the at least one processor executing the computer-executable instructions stored by the memory causes the at least one processor to perform the report generation method as provided by the first aspect.
In a fourth aspect, the present invention provides a computer-readable storage medium having stored therein computer-executable instructions that, when executed by a processor, implement the report generation method as provided by the first aspect.
In a fifth aspect, the invention provides a computer program product comprising a computer program which, when executed by a processor, implements the report generation method as provided in the first aspect.
The report generation method and the report generation equipment provided by the invention can dynamically generate the requirement template file required by the user according to the requirement file of the user. Different requirement files can generate different requirement template files, so that when the requirement of a user changes, the requirement template file required by the user can be automatically generated only by providing a new user requirement file; in addition, when a plurality of picture display items exist in the requirement template file, the service data corresponding to the target report is obtained, the picture list objects in the service data are traversed circularly, the image codes corresponding to the picture list objects are obtained, and the image codes corresponding to the picture list objects and the text data in the service data are filled in the requirement template file, so that the target report can be obtained, and the report generation efficiency and quality are improved.
Drawings
Fig. 1 is a first flowchart illustrating a report generating method according to an embodiment of the present invention;
fig. 2 is a schematic flowchart of a report generating method according to an embodiment of the present invention;
fig. 3 is a third schematic flowchart of a report generation method provided in an embodiment of the present invention;
FIG. 4 is a schematic diagram of program modules of a report generation apparatus provided in an embodiment of the present invention;
fig. 5 is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention. In addition, while the present disclosure has been described in terms of one or more exemplary embodiments, it is to be understood that each aspect of the disclosure can independently be provided as a complete embodiment.
It should be noted that the brief descriptions of the terms in the present invention are only for the convenience of understanding the embodiments described below, and are not intended to limit the embodiments of the present invention. These terms should be understood in their ordinary and customary meaning unless otherwise indicated.
The terms "first," "second," and the like in the description and claims of this specification and in the above-described drawings are used for distinguishing between similar or analogous objects or entities and not necessarily for limiting a particular order or sequence unless otherwise indicated. It is to be understood that the terms so used are interchangeable under appropriate circumstances such that the embodiments of the invention described herein are, for example, capable of operation in sequences other than those illustrated or otherwise described herein.
Furthermore, the terms "comprises" and "comprising," as well as any variations thereof, are intended to cover a non-exclusive inclusion, such that a product or device that comprises a list of elements is not necessarily limited to those elements explicitly listed, but may include other elements not expressly listed or inherent to such product or device.
The term "module," as used herein, refers to any known or later developed hardware, software, firmware, artificial intelligence, fuzzy logic, or combination of hardware or/and software code that is capable of performing the functionality associated with that element.
With the global trend of economy and the increasing market competition, the informatization requirements of more and more enterprises are rapidly increased, and a large amount of user behavior data, business process data and the like, as well as the calculation process and result summarization based on the data are generated in application systems of various industries. Due to business requirements or management requirements, it is often necessary to nest these data into pre-set templates to present a fixed format report.
Since the templates are usually fixed, when the report requirement changes, the templates need to be manually changed or new templates need to be created to generate reports meeting the actual requirements of users. However, with the continuous expansion of services, services and data in future application systems are likely to grow explosively, report requirements are complex and variable, and data contents are also diversified, for example, a plurality of picture display items may exist in a requirement template, so that the workload is extremely high and a certain error risk also exists when the template is manually established or changed, resulting in low report generation efficiency and quality.
In view of the above technical problems, the present invention provides a report generating method, which can dynamically generate a requirement template file required by a user only by providing a user requirement file for a scene in which the user requirement frequently changes; in addition, when a plurality of picture display items exist in the requirement template file, the service data corresponding to the target report is obtained, the picture list objects in the service data are traversed circularly, the image codes corresponding to the picture list objects are obtained, and the image codes corresponding to the picture list objects and the text data in the service data are filled in the requirement template file, so that the target report can be obtained, and the report generation efficiency and quality are effectively improved. The following examples are given for illustrative purposes.
Referring to fig. 1, fig. 1 is a first flowchart illustrating a report generation method provided in an embodiment of the present invention, and in a possible implementation manner, the report generation method includes:
s101, acquiring a user requirement file, and determining an object style and an object attribute of a target report according to the user requirement file.
In this embodiment, the user requirement file is used to describe the form and content of the target report required by the user, and the object style and the object attribute of the target report required by the user can be determined by performing modeling analysis on the requirement object according to the user requirement file.
In one possible embodiment, the object style and the object attribute of the target report may be determined by analyzing the keywords in the user requirement file.
The object style is a style specification related to the target report, and examples of the style specification include but are not limited to a font type, a font size, a font color, a paragraph format, a table style, and the like.
The object attribute is an attribute value description of the target report, and includes, but is not limited to, name, age, location, time, and traffic. Optionally, the object attribute may also be a picture for showing name, age, location, time, and traffic volume.
And S102, generating a demand template file corresponding to the target report by using an object style template generated according to the object style and an object attribute template generated according to the object attribute.
In a possible implementation, after determining the object style and the object attribute of the target report, an object style template may be generated according to the object style, and an object attribute template may be generated according to the object attribute.
For example, the object style template may include each attribute name and a style corresponding to each attribute name, and the object style template may include the following attribute names: report title name, report date, chapter one title name, etc.; the style corresponding to the report title name may be: font No. 10, red background, centered; the style corresponding to the report date can be a font 8 and a middle; the style corresponding to the title name of the first chapter may be: font No. 8, left justification, etc.
In a possible embodiment, the requirement template file may be generated by synthesizing the object style template and the object property template.
S103, when a plurality of picture display items exist in the requirement template file, acquiring service data corresponding to the target report, circularly traversing picture list objects in the service data, acquiring image codes corresponding to the picture list objects, filling the image codes corresponding to the picture list objects and text data in the service data into the requirement template file, and generating the target report.
In a possible implementation manner, after the requirement template file is generated, business data corresponding to the target report may be parsed and obtained by a freemaker engine, and the business data is automatically filled into the requirement template file, so that the target report with a specific style and content data is generated.
In some embodiments of the invention, when business data corresponding to a target report is obtained by using a freemaker technology and is filled in a requirement template file, whether the requirement template file contains a picture display item is determined; and when the number of the picture display items contained in the requirement template file is two or more, circularly traversing the picture list objects in the service data, acquiring base64 codes corresponding to the picture display items, and filling the base64 codes corresponding to the picture display items in the image data label in the requirement template file.
When one picture display item is contained in the requirement template file, obtaining a base64 code corresponding to the picture display item from the service data, and filling the base64 code corresponding to the picture display item in an image data tag in the requirement template file.
When no picture display item exists in the requirement template file, the service data can be directly filled in the requirement template file to generate the target report.
In one embodiment, the content in the target report may include text, picture content, and the like. However, the number of contents of the picture file may be plural.
In a feasible implementation manner, when the number of the picture files is multiple, a list tag manner can be uniformly adopted for performing uniform replacement processing, and the picture list object at the server side is circularly traversed to obtain the corresponding base64 encoded content and fill the corresponding base64 encoded content into the < imagedata > tag in the corresponding template. For processing of text or single picture files, the corresponding tag object can be directly replaced.
The Base64 is one of methods for representing binary data based on 64 printable characters, is one of common encoding modes for transmitting 8Bit byte codes, can be used for transmitting longer identification information in an HTTP environment in a process from binary to character, has non-readability by adopting the Base64 encoding, and can be read only after being decoded.
In the report generation method provided in this embodiment, a user may flexibly configure a user requirement file according to an actual requirement, a requirement template file required by the user may be dynamically generated according to the user requirement file, the requirement template file may be adjusted in real time for a scene in which a user requirement frequently changes, so as to achieve efficient output of a report, and in addition, when a plurality of picture display items exist in the requirement template file, service data corresponding to a target report is acquired, picture list objects in the service data are cyclically traversed, image codes corresponding to the picture list objects are acquired, and the image codes corresponding to the picture list objects and text data in the service data are filled in the requirement template file, so that report generation efficiency and quality are effectively improved.
Based on the content described in the foregoing embodiment, referring to fig. 2, fig. 2 is a second flowchart illustrating a report generation method provided in an embodiment of the present invention, and in a possible implementation, the report generation method includes:
the method comprises the steps of obtaining a user requirement file, wherein the user requirement file describes the form and content of a target report required by a user in detail, carrying out modeling analysis on a required object according to the user requirement file, and determining the object style and the object attribute of the target report required by the user.
The object style is a style specification related to the target report, and examples of the style specification include but are not limited to a font type, a font size, a font color, a paragraph format, a table style, and the like. The object attribute is an attribute value description of the target report, and includes, but is not limited to, name, age, location, time, and traffic.
After the object style and the object attribute of the target report are determined, metadata corresponding to the object style is determined, and metadata corresponding to the object attribute is determined.
Generating the object style template according to the metadata corresponding to the object style and in a key value pair mode; the key name (key) in the object style template is an object style name marked by a freemaker label, and the key value (value) is acquired from the service data through a back-end service request.
Generating the object attribute template according to the metadata corresponding to the object attribute and in a key value pair mode; the key name (key) in the object attribute template is an object attribute name marked by a freemaker label, and the key value (value) is acquired from the service data through a back-end service request.
And generating a demand template file corresponding to the target report according to the object style template and the object attribute template. And analyzing and acquiring the business data corresponding to the target report by a freemaker engine, and automatically filling the business data into the requirement template file, thereby generating the target report with the style and the content data.
Among them, freemaker is a template engine, i.e., a general-purpose tool that is based on templates and data to be changed and used to generate output text (HTML web pages, e-mails, configuration files, source code, etc.). The Java class library component can be embedded into a developed product, a Template is written in a Freemarker Language (FTL) format, the Template can focus on how data is displayed, and the Template can focus on what data is displayed.
The report generation method provided by the embodiment can dynamically generate the requirement template file required by the user, so that the frequently-changed scene required by the user can be met, the efficient output of the report is realized, and the report generation efficiency and quality are effectively improved.
Based on the content described in the foregoing embodiment, referring to fig. 3, fig. 3 is a third schematic flowchart of a report generation method provided in an embodiment of the present invention, and in a possible implementation, the report generation method includes:
s301, determining the object style and the object attribute of the target report according to the user requirement file.
S302, generating an object style template according to the object style, and generating an object attribute template according to the object attribute.
And S303, generating a requirement template file corresponding to the target report according to the object style template and the object attribute template.
And S304, generating the target report according to the service data corresponding to the requirement template file and the target report.
S305, when the user requirement file is detected to be changed, the object style template and/or the object attribute template are modified according to the changed content of the user requirement file.
And S306, updating the requirement template file according to the modified object style template and/or the object attribute template. Return to execution S304.
In the embodiment of the invention, if the content required by the user is changed, the user only needs to adjust the user required file, and then the required template file can be changed.
When the user requirement file is detected to only change the style of the object, only the object style template can be changed, and the object attribute template can be directly reused, so that the working efficiency of the whole report template manufacturing can be improved to a great extent.
In some embodiments of the present invention, after the requirement template file is generated, similar data templates of the same or similar products can be selected, and only the corresponding relationship between the data and the templates needs to be changed, so that the same service data can correspond to a plurality of templates as required to output different reports, thereby implementing efficient multiplexing of the templates. Based on the content described in the foregoing embodiment, an embodiment of the present invention further provides a report generating apparatus, and referring to fig. 4, fig. 4 is a schematic diagram of program modules of the report generating apparatus provided in the embodiment of the present invention, where the report generating apparatus includes:
the determining module 401 is configured to obtain a user requirement file, and determine an object style and an object attribute of a target report according to the user requirement file, where the user requirement file is used to describe a form and a content of the target report required by a user.
A template generating module 402, configured to generate a requirement template file corresponding to the target report by using an object style template generated according to the object style and an object attribute template generated according to the object attribute.
A report generating module 403, configured to, when multiple picture display items exist in the requirement template file, obtain service data corresponding to the target report, circularly traverse picture list objects in the service data, obtain image codes corresponding to the picture list objects, and fill the image codes corresponding to the picture list objects and text data in the service data in the requirement template file to generate the target report.
In some embodiments, the determination module 401 is configured to:
analyzing key words in the user requirement file, and determining the object style and the object attribute of the target report according to the key words in the user requirement file;
wherein the object styles include, but are not limited to, font type, font size, font color, paragraph format, and table style; the object attributes are used to present text data and/or pictures including, but not limited to, name, age, location, time, and traffic.
In some embodiments, the template generation module 402 is to:
determining metadata corresponding to the object style and determining metadata corresponding to the object attribute;
generating the object style template according to metadata corresponding to the object style and in a key value pair mode; the key name in the object style template is an object style name marked by a freemaker label;
generating the object attribute template according to the metadata corresponding to the object attribute and in a key value pair mode; and the key name in the object attribute template is the object attribute name marked by a freemaker label.
In some embodiments, the report generation module 403 is further configured to:
when a picture display item exists in the requirement template file, business data corresponding to the target report is obtained by using a freemaker technology, image codes corresponding to the picture display item are obtained from the business data, and the image codes are filled in image data labels in the requirement template file.
In some embodiments, the report generation module 403 is further configured to:
and when no picture display item exists in the requirement template file, acquiring service data corresponding to the target report by using a freemaker technology, filling the service data into the requirement template file, and generating the target report.
In some embodiments, the report generating apparatus further includes a template updating module, configured to:
when the user requirement file is detected to be changed, modifying the object style template and/or the object attribute template according to the changed content of the user requirement file;
and updating the requirement template file according to the modified object style template and/or the object attribute template.
The report generation device provided by the embodiment of the invention can dynamically generate the requirement template file required by the user according to the requirement file of the user. Different requirement files can generate different requirement template files, so that when the requirement of a user changes, the requirement template file required by the user can be automatically generated only by providing a new user requirement file; in addition, when a plurality of picture display items exist in the requirement template file, the service data corresponding to the target report is obtained, the picture list objects in the service data are traversed circularly, the image codes corresponding to the picture list objects are obtained, and the image codes corresponding to the picture list objects and the text data in the service data are filled in the requirement template file, so that the target report can be obtained, and the report generation efficiency and quality are improved.
It should be noted that, for the specific execution contents of the determining module 401, the template generating module 402, and the report generating module 403 in the embodiment of the present invention, reference may be made to related contents in the embodiments illustrated in fig. 1 to fig. 3, which are not described herein again.
Further, based on the content described in the foregoing embodiments, an embodiment of the present invention further provides an electronic device, where the electronic device includes at least one processor and a memory; wherein the memory stores computer execution instructions; the at least one processor executes computer-executable instructions stored in the memory to implement the steps of the report generation method described in the above embodiments, which is not described herein again.
For better understanding of the embodiment of the present invention, referring to fig. 5, fig. 5 is a schematic diagram of a hardware structure of an electronic device according to the embodiment of the present invention.
As shown in fig. 5, the electronic apparatus 50 of the present embodiment includes: a processor 501 and a memory 502; wherein:
a memory 502 for storing computer-executable instructions;
the processor 501 is configured to execute the computer execution instructions stored in the memory to implement the steps of the report generation method described in the foregoing embodiments, which is not described herein again, and reference may be specifically made to the relevant description in the foregoing method embodiments.
Alternatively, the memory 502 may be separate or integrated with the processor 501.
When the memory 502 is provided separately, the device further comprises a bus 503 for connecting said memory 502 and the processor 501.
Further, based on the content described in the foregoing embodiments, an embodiment of the present invention further provides a computer-readable storage medium, where a computer-executable instruction is stored in the computer-readable storage medium, and when a processor executes the computer-executable instruction, the steps of the report generating method described in the foregoing embodiments may be implemented, and details of this embodiment are not repeated herein.
Further, based on the content described in the foregoing embodiments, an embodiment of the present invention further provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps of the report generating method described in the foregoing embodiments may be implemented, and details are not described herein again.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described device embodiments are merely illustrative, and for example, the division of the modules is only one logical division, and other divisions may be realized in practice, for example, a plurality of modules may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed coupling or direct coupling or communication connection between each other may be through some interfaces, indirect coupling or communication connection between devices or modules, and may be in an electrical, mechanical or other form.
The modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, functional modules in the embodiments of the present invention may be integrated into one processing unit, or each module may exist alone physically, or two or more modules are integrated into one unit. The module integrated unit can be realized in a hardware form, and can also be realized in a form of hardware and a software functional unit.
The integrated module implemented in the form of a software functional module may be stored in a computer-readable storage medium. The software functional module is stored in a storage medium and includes several instructions to enable a computer device (which may be a personal computer, a server, or a network device) or a processor (processor) to execute some steps of the methods according to the embodiments of the present invention.
It should be understood that the Processor may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of a method disclosed in connection with the present invention may be embodied directly in a hardware processor, or in a combination of the hardware and software modules within the processor.
The memory may comprise a high-speed RAM memory, and may further comprise a non-volatile storage NVM, such as at least one disk memory, and may also be a usb disk, a removable hard disk, a read-only memory, a magnetic or optical disk, etc.
The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, an Extended ISA (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, the buses in the figures of the present invention are not limited to only one bus or one type of bus.
The storage medium may be implemented by any type or combination of volatile or non-volatile memory devices, such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks. A storage media may be any available media that can be accessed by a general purpose or special purpose computer.
An exemplary storage medium is coupled to the processor such the processor can read information from, and write information to, the storage medium. Of course, the storage medium may also be integral to the processor. The processor and the storage medium may reside in an Application Specific Integrated Circuits (ASIC). Of course, the processor and the storage medium may reside as discrete components in an electronic device or host device.
Those of ordinary skill in the art will understand that: all or a portion of the steps of implementing the above-described method embodiments may be performed by hardware associated with program instructions. The program may be stored in a computer-readable storage medium. When executed, the program performs steps comprising the method embodiments described above; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.

Claims (10)

1. A report generation method, the method comprising:
acquiring a user requirement file, and determining an object style and an object attribute of a target report according to the user requirement file, wherein the user requirement file is used for describing the form and content of the target report required by a user;
generating a demand template file corresponding to the target report by using an object style template generated according to the object style and an object attribute template generated according to the object attribute;
when a plurality of picture display items exist in the requirement template file, business data corresponding to the target report are obtained, picture list objects in the business data are traversed circularly, image codes corresponding to the picture list objects are obtained, the image codes corresponding to the picture list objects and text data in the business data are filled in the requirement template file, and the target report is generated.
2. The method of claim 1, wherein determining object styles and object attributes of a target report based on the user requirements file comprises:
analyzing key words in the user requirement file, and determining the object style and the object attribute of the target report according to the key words in the user requirement file;
wherein the object styles include, but are not limited to, font type, font size, font color, paragraph format, and table style; the object attributes are used to present text data and/or pictures including, but not limited to, name, age, location, time, and traffic.
3. The method according to claim 1, wherein before generating the requirement template file corresponding to the target report using the object style template generated according to the object style and the object attribute template generated according to the object attribute, the method further comprises:
determining metadata corresponding to the object style and determining metadata corresponding to the object attribute;
generating the object style template according to metadata corresponding to the object style and in a key value pair mode; the key name in the object style template is an object style name marked by a freemaker label;
generating the object attribute template according to the metadata corresponding to the object attribute and in a key value pair mode; and the key name in the object attribute template is the object attribute name marked by a freemaker label.
4. The method of claim 1, further comprising:
when a picture display item exists in the requirement template file, business data corresponding to the target report is obtained by using a freemaker technology, image codes corresponding to the picture display item are obtained from the business data, and the image codes are filled in an image data label in the requirement template file.
5. The method of claim 1, further comprising:
and when no picture display item exists in the requirement template file, acquiring service data corresponding to the target report by using a freemaker technology, filling the service data into the requirement template file, and generating the target report.
6. The method of any of claims 1 to 5, further comprising:
when the user requirement file is detected to be changed, modifying the object style template and/or the object attribute template according to the changed content of the user requirement file;
and updating the requirement template file according to the modified object style template and/or the object attribute template.
7. An apparatus for generating a report, the apparatus comprising:
the system comprises a determining module, a display module and a display module, wherein the determining module is used for acquiring a user requirement file and determining an object style and an object attribute of a target report according to the user requirement file, and the user requirement file is used for describing the form and the content of the target report required by a user;
the template generating module is used for generating a demand template file corresponding to the target report by utilizing an object style template generated according to the object style and an object attribute template generated according to the object attribute;
and the report generation module is used for acquiring the service data corresponding to the target report when a plurality of picture display items exist in the requirement template file, circularly traversing picture list objects in the service data, acquiring image codes corresponding to the picture list objects, and filling the image codes corresponding to the picture list objects and text data in the service data into the requirement template file to generate the target report.
8. An electronic device, comprising: at least one processor and memory;
the memory stores computer-executable instructions;
execution of the computer-executable instructions stored by the memory by the at least one processor causes the at least one processor to perform the report generation method of any of claims 1-6.
9. A computer-readable storage medium having stored thereon computer-executable instructions which, when executed by a processor, implement the report generation method of any of claims 1 to 6.
10. A computer program product comprising a computer program, wherein the computer program, when executed by a processor, implements the report generation method of any of claims 1 to 6.
CN202211186776.8A 2022-09-27 2022-09-27 Report generation method and equipment Pending CN115618838A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211186776.8A CN115618838A (en) 2022-09-27 2022-09-27 Report generation method and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211186776.8A CN115618838A (en) 2022-09-27 2022-09-27 Report generation method and equipment

Publications (1)

Publication Number Publication Date
CN115618838A true CN115618838A (en) 2023-01-17

Family

ID=84860923

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211186776.8A Pending CN115618838A (en) 2022-09-27 2022-09-27 Report generation method and equipment

Country Status (1)

Country Link
CN (1) CN115618838A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116402038A (en) * 2023-06-09 2023-07-07 中国中金财富证券有限公司 Report generation method, report generation device, electronic equipment and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116402038A (en) * 2023-06-09 2023-07-07 中国中金财富证券有限公司 Report generation method, report generation device, electronic equipment and storage medium
CN116402038B (en) * 2023-06-09 2023-08-18 中国中金财富证券有限公司 Report generation method, report generation device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN109918607B (en) Page construction method and device, medium and computing equipment
CN108495192B (en) Page editing processing method and device
CN105512890A (en) Method and system for generating accounting voucher
CN102165462A (en) Encoding, updating, and decoding barcodes in a document
CN111694565A (en) Data visualization application development method and system
CN112035111A (en) Page editing method, system, computer device and computer readable storage medium
US9043343B2 (en) Identifier assigning method, identifier parsing method, and multimedia reading
CN111797351A (en) Page data management method and device, electronic equipment and medium
CN112433705A (en) Script generation method and device, electronic equipment and storage medium
CN115618838A (en) Report generation method and equipment
CN111752565A (en) Interface generation method and device, computer equipment and readable storage medium
CN114416056A (en) Page generation method, system, computer equipment and readable storage medium
CN110851136A (en) Data acquisition method and device, electronic equipment and storage medium
CN110837727A (en) Document template generation method and device, terminal equipment and medium
CN112948418A (en) Dynamic query method, device, equipment and storage medium
CN111325012A (en) word report generation method and system
CN115270198A (en) Signature method, device and storage medium of PDF document
CN116048486A (en) Processing method of configuration item data, electronic equipment and computer readable storage medium
CN115935909A (en) File generation method and device and electronic equipment
CN115048920A (en) Front-end data exporting method, device, equipment and storage medium
CN111581402A (en) Method and system for generating content test material, electronic equipment and storage medium
JP2011118497A (en) Device and program for managing guideline
CN114169306A (en) Method, device and equipment for generating electronic receipt and readable storage medium
US11182635B2 (en) Terminal apparatus, character recognition system, and character recognition method
CN114115864A (en) Interface generation method and device and electronic equipment

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