CN114626352A - Report automatic generation method and device, computer equipment and storage medium - Google Patents

Report automatic generation method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN114626352A
CN114626352A CN202210237139.2A CN202210237139A CN114626352A CN 114626352 A CN114626352 A CN 114626352A CN 202210237139 A CN202210237139 A CN 202210237139A CN 114626352 A CN114626352 A CN 114626352A
Authority
CN
China
Prior art keywords
target
label
report
data
template
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.)
Granted
Application number
CN202210237139.2A
Other languages
Chinese (zh)
Other versions
CN114626352B (en
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.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen Co 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 Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN202210237139.2A priority Critical patent/CN114626352B/en
Publication of CN114626352A publication Critical patent/CN114626352A/en
Application granted granted Critical
Publication of CN114626352B publication Critical patent/CN114626352B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/177Editing, e.g. inserting or deleting of tables; using ruled lines
    • 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 embodiment of the application belongs to the field of big data and relates to an automatic report generation method, which comprises the steps of obtaining a target file and a target template corresponding to an automatic report generation instruction when the automatic report generation instruction is received; acquiring a configuration label in the target template, analyzing the configuration label to obtain a label type and a preset processing logic corresponding to the label type, and constructing data information of the target file based on the preset processing logic; and writing the data information into the target template to obtain a target report corresponding to the target file, and sending a downloading instruction of the target report to a client so that the client downloads the target report. The application also provides a report automatic generation device, computer equipment and a storage medium. In addition, the application also relates to a block chain technology, and the target report can be stored in the block chain. The report form management method and the report form management system realize unified management of the report forms and improve the efficiency of automatic generation of the report forms.

Description

Report automatic generation method and device, computer equipment and storage medium
Technical Field
The present application relates to the field of artificial intelligence technologies, and in particular, to a method and an apparatus for automatically generating a report, a computer device, and a storage medium.
Background
With the coming of the internet era, various businesses emerge endlessly, and various excel reports need to be generated by depending on a system in many times. The excel report can be used for carrying out statistics, distinguishing, analysis, estimation and other operations on data, and the report has a replaceable function for some industries.
In a conventional report generation method, each report data is analyzed, then each report is developed in a targeted manner, and finally a report is generated. Therefore, the development efficiency is greatly reduced, and the human resources are put into simple and repeated labor, which not only wastes the human resources, but also further improves the maintenance cost. And once the report is modified, the report can only be re-developed and maintained, and the next system update is waited, so that the report generation efficiency is low.
Disclosure of Invention
The embodiment of the application aims to provide a method and a device for automatically generating a report, a computer device and a storage medium, so as to solve the technical problem of low report generation efficiency.
In order to solve the above technical problem, an embodiment of the present application provides an automatic report generation method, which adopts the following technical scheme:
when a report automatic generation instruction is received, acquiring a target file and a target template corresponding to the report automatic generation instruction;
acquiring a configuration label in the target template, analyzing the configuration label to obtain a label type and a preset processing logic corresponding to the label type, and constructing data information of the target file based on the preset processing logic;
and writing the data information into the target template to obtain a target report corresponding to the target file, and sending a downloading instruction of the target report to a client so that the client downloads the target report.
Further, the step of constructing the data information of the target file based on the preset processing logic includes:
when the label type is a composite line label, acquiring line data corresponding to the composite line label, and detecting whether the line data are the same;
when the row data are determined to be the same data, merging the row data according to the composite row label to obtain the data information;
and when the line data are not the same data, determining abnormal data in the line data, and merging non-abnormal data except the abnormal data in the line data to obtain the data information.
Further, the step of constructing the data information of the target file based on the preset processing logic further includes:
when the configured label is a single-row label, acquiring a sub-label category of the single-row label, wherein the sub-label category comprises a time label and an index label;
when the sub-tag type is the time tag, processing first data configured as the time tag in the target file according to a time format labeled by the time tag to obtain the data information;
and when the sub-label type is the index label, processing second data configured as the index label in the target file according to the index labeled by the index label to obtain the data information.
Further, before the step of obtaining the configuration tag in the target template, the method further includes:
acquiring the file type of the target file, acquiring a stored label dictionary according to the file type, and determining whether all label categories corresponding to the data in the target file exist in the label dictionary;
and when all the label categories exist in the label dictionary, generating configuration labels of the target file based on the label categories, and storing the configuration labels into the target template in columns.
Further, after the step of determining whether all tag categories corresponding to the data in the target file exist in the tag dictionary, the method further includes:
when the label category corresponding to the data does not exist in the label dictionary, establishing a new preset label in the label dictionary based on the data type of the data;
and generating a target label of the target file based on the preset label, and storing the target label into the target template in a row.
Further, after the step of writing the data information into the target template to obtain a target report corresponding to the target file, and sending a downloading instruction of the target report to a client, so that the client downloads the target report, the method further includes:
when a modification instruction of the target report is received, searching a target modification format and error data corresponding to the modification instruction;
modifying the abnormal label corresponding to the error data according to the target modification format to obtain a normal label;
and re-importing the normal label in the target template to obtain a modification template, and generating a modification report corresponding to the modification instruction based on the modification template.
Further, the step of sending the downloading instruction of the target report to the client, so that the client downloads the target report includes:
and binding the target report with a corresponding preset downloading interface, and sending a downloading instruction of the target report to the client when the binding of the target report and the preset downloading interface is completed so that the client downloads the target report.
In order to solve the above technical problem, an embodiment of the present application further provides an automatic report generation apparatus, which adopts the following technical solution:
the system comprises an acquisition module, a report generation module and a report generation module, wherein the acquisition module is used for acquiring a target file and a target template corresponding to a report automatic generation instruction when receiving the report automatic generation instruction;
the analysis module is used for acquiring a configuration label in the target template, analyzing the configuration label to obtain a label type and a preset processing logic corresponding to the label type, and constructing data information of the target file based on the preset processing logic;
and the writing module is used for writing the data information into the target template to obtain a target report corresponding to the target file, and sending a downloading instruction of the target report to a client so as to enable the client to download the target report.
In order to solve the above technical problem, an embodiment of the present application further provides a computer device, which adopts the following technical solutions:
when a report automatic generation instruction is received, acquiring a target file and a target template corresponding to the report automatic generation instruction;
acquiring a configuration label in the target template, analyzing the configuration label to obtain a label type and a preset processing logic corresponding to the label type, and constructing data information of the target file based on the preset processing logic;
and writing the data information into the target template to obtain a target report corresponding to the target file, and sending a downloading instruction of the target report to a client so that the client downloads the target report.
In order to solve the above technical problem, an embodiment of the present application further provides a computer-readable storage medium, which adopts the following technical solutions:
when a report automatic generation instruction is received, acquiring a target file and a target template corresponding to the report automatic generation instruction;
acquiring a configuration label in the target template, analyzing the configuration label to obtain a label type and a preset processing logic corresponding to the label type, and constructing data information of the target file based on the preset processing logic;
and writing the data information into the target template to obtain a target report corresponding to the target file, and sending a downloading instruction of the target report to a client so that the client downloads the target report.
According to the report automatic generation method, when a report automatic generation instruction is received, a target file and a target template corresponding to the report automatic generation instruction are obtained; then, acquiring a configuration label in the target template, analyzing the configuration label to obtain a label type and a preset processing logic corresponding to the label type, constructing data information of the target file based on the preset processing logic, and efficiently generating the data information of the target file through the configuration label; and then, writing the data information into the target template to obtain a target report corresponding to the target file, and sending a downloading instruction of the target report to the client so as to enable the client to download the target report, thereby realizing the uniform management and automatic generation of the report according to the label, saving the report generation time, improving the report generation efficiency, and further reducing the maintenance cost of the report.
Drawings
In order to more clearly illustrate the solution of the present application, the drawings needed for describing the embodiments of the present application will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present application, and that other drawings can be obtained by those skilled in the art without inventive effort.
FIG. 1 is an exemplary system architecture diagram in which the present application may be applied;
FIG. 2 is a flow diagram of one embodiment of a method for automated report generation according to the present application;
FIG. 3 is a schematic diagram of an embodiment of an automated report generation apparatus according to the present application;
FIG. 4 is a block diagram of one embodiment of a computer device according to the present application.
Reference numerals: the report automatic generation device 300, the acquisition module 301, the analysis module 302 and the write-in module 303.
Detailed Description
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs; the terminology used in the description of the application herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application; the terms "including" and "having," and any variations thereof, in the description and claims of this application and the description of the above figures are intended to cover non-exclusive inclusions. The terms "first," "second," and the like in the description and claims of this application or in the foregoing drawings are used for distinguishing between different objects and not for describing a particular sequential order.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein can be combined with other embodiments.
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings.
As shown in fig. 1, the system architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The user may use the terminal devices 101, 102, 103 to interact with the server 105 via the network 104 to receive or send messages or the like. The terminal devices 101, 102, 103 may have various communication client applications installed thereon, such as a web browser application, a shopping application, a search application, an instant messaging tool, a mailbox client, social platform software, and the like.
The terminal devices 101, 102, 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, e-book readers, MP3 players (Moving Picture experts Group Audio Layer III, mpeg compression standard Audio Layer 3), MP4 players (Moving Picture experts Group Audio Layer IV, mpeg compression standard Audio Layer 4), laptop portable computers, desktop computers, and the like.
The server 105 may be a server providing various services, such as a background server providing support for pages displayed on the terminal devices 101, 102, 103.
It should be noted that, the report automatic generation method provided in the embodiment of the present application is generally executed by a server, and accordingly, the report automatic generation apparatus is generally disposed in the server.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
With continued reference to FIG. 2, a flow diagram of one embodiment of a method for automated generation of reports in accordance with the present application is shown. The report automatic generation method comprises the following steps:
step S201, when receiving a report automatic generation instruction, obtaining a target file and a target template corresponding to the report automatic generation instruction.
In this embodiment, when a report automatic generation instruction is received, a target file and a target template corresponding to the report automatic generation instruction are obtained, where the target file is a file that needs to be subjected to report generation, and the target template is a preset report template. And analyzing the received report generation instruction to obtain a report identifier corresponding to the report generation instruction, and determining a corresponding target file and a target template according to the report identifier.
Step S202, obtaining a configuration label in the target template, analyzing the configuration label to obtain a label type and a preset processing logic corresponding to the label type, and constructing data information of the target file based on the preset processing logic.
In this embodiment, the target template includes a header, a tag column, and all data in the target file, where each tag column corresponds to one configuration tag. The configuration tags are tags configured in advance according to the target data in the target file, and when the tag configuration of all the target data in the target file is completed, the configuration tags are stored in the target template in columns. The tag configuration of the target data can be configured through the data format of the target data, and if the target data in the time format is configured with the time tag, the target data is configured with the time tag. The configuration tag may specifically include a single-line tag and a composite-line tag, where the single-line tag is a single data type and tag information corresponding to data that does not need to be subjected to data merging, the composite-line tag is a tag corresponding to data that needs to be subjected to data merging, and an execution action, that is, a preset processing logic, on the data in the target file is determined according to the tag type. A target template may include multiple configuration tags, with a target template corresponding to a target report. Specifically, when a target template is obtained, a configuration tag configured in the target template is obtained, and the configuration tag is analyzed to obtain a tag type of the configuration tag and a preset processing logic corresponding to the tag type. The configuration label is analyzed, a preset regular expression can be obtained, the regular expression is matched with the configuration label, and the label type and the preset processing logic are obtained. And then, constructing data information of the data of the target file based on the preset processing logic, namely constructing the data of the target file into the data information which accords with the target template through the preset processing logic.
Step S203, writing the data information into the target template to obtain a target report corresponding to the target file, and sending a downloading instruction of the target report to a client so that the client downloads the target report.
In this embodiment, since the data information is obtained by processing the data in the target file according to the preset processing logic of the configuration tag, when the data information is obtained, the data information is written in the target template in columns according to the corresponding configuration tag. The configuration tag is also configured with a target column of the data information, where the target column is a column to which the target tag belongs in the target template (report), for example, the target column is an a column in the configuration tag, and when the data information is obtained, the data information is written in the a column of the target template. When the target template writing is completed, a target report is obtained; and sending the downloading instruction of the target report to a client so that the client downloads the target report. When the target report is downloaded successfully, feeding the target report back to a target display interface of the server; and when the target report fails to be downloaded, acquiring the reason of the downloading failure, and feeding back the reason of the downloading failure to a target display interface of the server.
It is emphasized that, in order to further ensure the privacy and security of the target report, the target report may also be stored in a node of a block chain.
The block chain referred by the application is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
According to the method and the device, the report can be managed and automatically generated according to the label, the report generation time is saved, the report generation efficiency is improved, and the maintenance cost of the report is further reduced.
In some optional implementation manners of this embodiment, the step of constructing the data information of the target file based on the preset processing logic includes:
when the label type is a composite line label, acquiring line data corresponding to the composite line label, and detecting whether the line data are the same;
when the row data are determined to be the same data, merging the row data according to the composite row label to obtain the data information;
and when the line data are not the same data, determining abnormal data in the line data, and merging non-abnormal data except the abnormal data in the line data to obtain the data information.
In this embodiment, different tag types correspond to different preset processing logics. And when the type of the label is a composite line label, acquiring line data corresponding to the composite line label, wherein the line data is data randomly placed in a target template in a target file in lines, determining whether all data in the line data are the same data, and if the line data are the same data, merging the line data corresponding to the composite line label to obtain data information corresponding to the target file. If the line data is not the same data, determining abnormal data in the line data, wherein the abnormal data is inconsistent with other data in the line data; and screening the abnormal data, and combining the residual non-abnormal data in the line of data to obtain data information corresponding to the target file.
According to the data merging method and device, the row data are merged through the composite row labels, unified management of the same content data is achieved, and the data merging efficiency is improved.
In some optional implementation manners of this embodiment, the step of constructing the data information of the target file based on the preset processing logic further includes:
when the configured label is a single-row label, acquiring a sub-label category of the single-row label, wherein the sub-label category comprises a time label and an index label;
when the sub-tag type is the time tag, processing first data configured as the time tag in the target file according to a time format labeled by the time tag to obtain the data information;
and when the sub-label type is the index label, processing second data configured as the index label in the target file according to the index labeled by the index label to obtain the data information.
In this embodiment, when the configured tag is a single-line tag, a sub-tag category of the single-line tag is obtained, where the sub-tag category includes a time tag, an index tag, and a specific tag. The time label specifies the output format of the time data in the target file, such as YYYY-MM (2008-12) or YYYMM (200812); the index label is an index ID of the ratio or the ratio in the target file; the designated tag is a processing tag of designated data in the target file, and logic processing only for the target file can be performed on the designated data according to the designated tag. And acquiring the sub-label category of the single row of labels, and performing different logic processing on the data of the target file according to the sub-label category to obtain the data information of the target file. And when the sub-label type is the time label, processing the first data configured as the time label in the target file according to the time format marked by the time label to obtain data information. Specifically, when the sub-tag category is a time tag, first data configured as the time tag in the target file and a time format labeled by the time tag are acquired; and modifying the first data into data conforming to the time format to obtain data information. When the sub-label type is an index label, processing second data configured as the index label in the target file according to the index labeled by the index label to obtain data information; wherein, for data belonging to the same index, the same index label is corresponded. Taking the absence rate as an index, the absence rate is calculated by the ratio of the number of absent people to the total number of people, and the number of absent people and the total number of people correspond to the same index label. When the sub-label type is an index label, second data configured as the index label in the target file is obtained, a calculation formula associated with the index is obtained according to the index labeled by the index label, index calculation is performed on the second data according to the calculation formula, and a final index result is obtained, wherein the index result is data information of the target file.
According to the embodiment, the data information of the target file is constructed through the single row of tags, different logic processing of the data according to the single row of tags is realized, and further, automatic generation of the report is realized.
In some optional implementations of this embodiment, before the step of obtaining the configuration tag in the target template, the method further includes:
acquiring the file type of the target file, acquiring a stored label dictionary according to the file type, and determining whether all label categories corresponding to the data in the target file exist in the label dictionary;
and when all the label categories exist in the label dictionary, generating configuration labels of the target file based on the label categories, and storing the configuration labels into the target template in columns.
In this embodiment, the file type is a type to which the target file belongs, and the file type of the target file may be determined according to a suffix name or a file name of the target file. And acquiring the stored label dictionary according to the file type, wherein different file types correspond to different label dictionaries. And determining whether all the label categories corresponding to the data in the target file exist in the label dictionary, wherein different data types or data contents may correspond to different label categories, and when the label categories corresponding to all the data in the target file exist in the label dictionary, generating configuration labels of the target file based on the label categories, and storing the configuration labels in a target template in a column.
According to the embodiment, the configuration labels are uniformly managed through the label dictionary, so that when report contents need to be newly added or modified, automatic modification of the report can be completed through modification of the labels, and the automatic generation efficiency of the report is improved.
In some optional implementation manners of this embodiment, after the step of determining whether all the tag categories corresponding to the data in the target file exist in the tag dictionary, the method further includes:
when the label category corresponding to the data does not exist in the label dictionary, establishing a new preset label in the label dictionary based on the data type of the data;
and generating a target label of the target file based on the preset label, and storing the target label into the target template in a row.
In this embodiment, the tag dictionary does not necessarily have tag categories corresponding to all data in the target file, and when the tag dictionary does not have tag categories corresponding to data in the target file, the data type of the data is acquired, and a corresponding preset tag is newly built in the tag dictionary according to the data type. The data type and the preset label are in an association relationship, and the preset label corresponding to the data type can be obtained through the preset association mapping label. And when the preset label is obtained, generating a target label of the target file according to the preset label, and storing the target label in a target template corresponding to the target file according to columns.
In the embodiment, the target tags are newly added in the tag dictionary, so that different processing can be performed on the contents of the report data through the newly added tags, and the processing efficiency of the report data is further improved.
In some optional implementation manners of this embodiment, after the step of writing the data information into the target template to obtain a target report corresponding to the target file, and sending a downloading instruction of the target report to a client, so that the client downloads the target report, the method further includes:
when a modification instruction of the target report is received, searching a target modification format and error data corresponding to the modification instruction;
modifying the abnormal label corresponding to the error data according to the target modification format to obtain a normal label;
and re-importing the normal label in the target template to obtain a modified template, and generating a modified report corresponding to the modification instruction based on the modified template.
In this embodiment, when a modification instruction of a target report is received, a target modification format and error data corresponding to the modification instruction are searched, and an exception tag corresponding to the error data is modified according to the target modification format. For example, the date 2008-12 in the target report is modified into 200812, and the target modification format of the 200812 is YYYY-MM; and when a modification instruction of the target report is received, modifying the exception tag corresponding to 2008-12 according to the target modification format YYYY-MM, namely modifying the exception tag into the target modification format YYYYYY-MM. And the modified abnormal label is a normal label, the normal label is imported into the target template again and stored to obtain a modified template, and the modified template is downloaded to obtain a modified report corresponding to the current modification instruction.
According to the embodiment, the normal label is obtained by modifying the abnormal label, and then the modification template is generated according to the normal label, so that the report can be automatically modified through the label, and the report modification efficiency is improved.
In some optional implementation manners of this embodiment, the step of sending the downloading instruction of the target report to the client, so that the client downloads the target report includes:
and binding the target report with a corresponding preset downloading interface, and sending a downloading instruction of the target report to the client when the binding of the target report and the preset downloading interface is completed so that the client downloads the target report.
In this embodiment, when data information is written into a target template to obtain a target report, the target report is bound with a corresponding preset downloading interface, and when the target report is bound with the preset downloading interface, a downloading instruction of the target report is sent to a client; and when the client receives the downloading instruction of the target report, the client downloads the target report based on the downloading instruction. In addition, when a target template corresponding to the report automatic generation instruction is obtained, the target template can be bound with a preset downloading interface of a corresponding client in advance; when the data information is written into the target template to obtain the target report, the target report and a preset downloading interface do not need to be bound, a downloading instruction of the target report is directly sent to the client, and the client downloads the target report based on the downloading instruction.
According to the embodiment, the target report is bound with the corresponding preset downloading interface, so that the target report is automatically downloaded, and the generation efficiency of the target report is further improved.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware associated with computer readable instructions, which can be stored in a computer readable storage medium, and when executed, the processes of the embodiments of the methods described above can be included. The storage medium may be a non-volatile storage medium such as a magnetic disk, an optical disk, a Read-Only Memory (ROM), or a Random Access Memory (RAM).
It should be understood that, although the steps in the flowcharts of the figures are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and may be performed in other orders unless explicitly stated herein. Moreover, at least a portion of the steps in the flow chart of the figure may include multiple sub-steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, which are not necessarily performed in sequence, but may be performed alternately or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
With further reference to fig. 3, as an implementation of the method shown in fig. 2, the present application provides an embodiment of an automatic report generation apparatus, where the embodiment of the apparatus corresponds to the embodiment of the method shown in fig. 2, and the apparatus may be specifically applied to various electronic devices.
As shown in fig. 3, the report automatic generation apparatus 300 according to this embodiment includes: an obtaining module 301, an analyzing module 302 and a writing module 303. Wherein:
the obtaining module 301 is configured to obtain a target file and a target template corresponding to an automatic report generation instruction when the automatic report generation instruction is received;
in this embodiment, when a report automatic generation instruction is received, a target file and a target template corresponding to the report automatic generation instruction are obtained, where the target file is a file that needs report generation, and the target template is a preset report template. And analyzing the received report generation instruction to obtain a report identifier corresponding to the report generation instruction, and determining a corresponding target file and a target template according to the report identifier.
An analyzing module 302, configured to obtain a configuration tag in the target template, analyze the configuration tag to obtain a tag type and a preset processing logic corresponding to the tag type, and construct data information of the target file based on the preset processing logic;
in some optional implementations of this embodiment, the parsing module 302 includes:
the first acquisition unit is used for acquiring line data corresponding to the composite line label and detecting whether the line data are the same data or not when the label type is the composite line label;
the merging unit is used for merging the line data according to the composite line label when the line data are determined to be the same data, so as to obtain the data information;
and the confirming unit is used for confirming abnormal data in the line data and merging non-abnormal data except the abnormal data in the line data to obtain the data information when the line data are not the same data.
In some optional implementations of this embodiment, the parsing module 302 further includes:
a second obtaining unit, configured to obtain a sub-label category of the single-line label when the configured label is the single-line label, where the sub-label category includes a time label and an index label;
a first constructing unit, configured to, when the sub-tag type is the time tag, process first data configured as the time tag in the target file according to a time format labeled by the time tag, to obtain the data information;
and a second constructing unit, configured to, when the sub-tag type is the index tag, process second data configured as the index tag in the target file according to an index labeled by the index tag, to obtain the data information.
In this embodiment, the target template includes a header, a tag column, and all data in the target file, where each tag column corresponds to one configuration tag. The configuration tags are tags configured in advance according to the target data in the target file, and when the tag configuration of all the target data in the target file is completed, the configuration tags are stored in the target template in columns. The tag configuration of the target data can be configured through the data format of the target data, and if the target data in the time format is configured with the time tag, the target data is configured with the time tag. The configuration tag may specifically include a single-line tag and a composite-line tag, where the single-line tag is a single data type and tag information corresponding to data that does not need to be subjected to data merging, the composite-line tag is a tag corresponding to data that needs to be subjected to data merging, and an execution action, that is, a preset processing logic, on the data in the target file is determined according to the tag type. A target template may include multiple configuration tags, one corresponding to each target report. Specifically, when a target template is obtained, a configuration tag configured in the target template is obtained, and the configuration tag is analyzed to obtain a tag type of the configuration tag and a preset processing logic corresponding to the tag type. The configuration label is analyzed, a preset regular expression can be obtained, the regular expression is matched with the configuration label, and the label type and the preset processing logic are obtained. And then, constructing data information of the data of the target file based on the preset processing logic, namely constructing the data of the target file into the data information which accords with the target template through the preset processing logic.
A writing module 303, configured to write the data information into the target template, obtain a target report corresponding to the target file, and send a downloading instruction of the target report to a client, so that the client downloads the target report.
In some optional implementations of this embodiment, the writing module 303 includes:
and the binding unit is used for binding the target report and a corresponding preset downloading interface, and sending a downloading instruction of the target report to the client when the binding of the target report and the preset downloading interface is finished so that the client downloads the target report.
In this embodiment, since the data information is obtained by processing the data in the target file according to the preset processing logic of the configuration tag, when the data information is obtained, the data information is written in the target template in columns according to the corresponding configuration tag. The configuration tag is also configured with a target column of data information, where the target column is a column to which the target tag belongs in a target template (report), for example, the target column is an a column in the configuration tag, and when the data information is obtained, the data information is written in the a column of the target template. When the target template writing is completed, a target report is obtained; and sending the downloading instruction of the target report to a client so that the client downloads the target report. When the target report is downloaded successfully, feeding the target report back to a target display interface of the server; and when the target report fails to be downloaded, acquiring the reason of the downloading failure, and feeding back the reason of the downloading failure to a target display interface of the server.
It is emphasized that, in order to further ensure the privacy and security of the target report, the target report may also be stored in a node of a block chain.
The block chain referred by the application is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. A block chain (Blockchain), which is essentially a decentralized database, is a string of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, which is used for verifying the validity (anti-counterfeiting) of the information and generating a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
In some optional implementation manners of this embodiment, the report automatic generation apparatus 300 further includes:
the confirming module is used for acquiring the file type of the target file, acquiring a stored label dictionary according to the file type and determining whether all label categories corresponding to the data in the target file exist in the label dictionary or not;
and the generating module is used for generating configuration labels of the target file based on the label categories when all the label categories exist in the label dictionary, and storing the configuration labels into the target template in columns.
In some optional implementations of this embodiment, the determining module further includes:
the new creation module is used for creating a preset tag in the tag dictionary based on the data type of the data when the tag category corresponding to the data does not exist in the tag dictionary;
and the storage unit is used for generating a target label of the target file based on the preset label and storing the target label into the target template in a row.
In this embodiment, the file type is a type to which the target file belongs, and the file type of the target file may be determined according to a suffix name or a file name of the target file. And acquiring the stored label dictionary according to the file type, wherein different file types correspond to different label dictionaries. And determining whether all the label categories corresponding to the data in the target file exist in the label dictionary, wherein different data types or data contents may correspond to different label categories, and when the label categories corresponding to all the data in the target file exist in the label dictionary, generating configuration labels of the target file based on the label categories, and storing the configuration labels in a target template in a column.
In some optional implementation manners of this embodiment, the report automatic generation apparatus 300 further includes:
the searching module is used for searching a target modification format and error data corresponding to the modification instruction when the modification instruction of the target report is received;
the modification module is used for modifying the abnormal label corresponding to the error data according to the target modification format to obtain a normal label;
and the importing module is used for re-importing the normal label into the target template to obtain a modification template, and generating a modification report corresponding to the modification instruction based on the modification template.
In this embodiment, when a modification instruction of a target report is received, a target modification format and error data corresponding to the modification instruction are searched, and an exception tag corresponding to the error data is modified according to the target modification format. For example, the date 2008-12 in the target report is modified into 200812, and the target modification format of 200812 is YYYY-MM; and when a modification instruction of the target report is received, modifying the exception tag corresponding to 2008-12 according to the target modification format YYYY-MM, namely modifying the exception tag into the target modification format YYYYY-MM. And the modified abnormal label is a normal label, the normal label is imported into the target template again and stored to obtain a modified template, and the modified template is downloaded to obtain a modified report corresponding to the current modification instruction.
The report automatic generation device provided by the embodiment realizes the unified management and automatic generation of the report according to the label, saves the report generation time, improves the report generation efficiency, and further reduces the maintenance cost of the report.
In order to solve the technical problem, an embodiment of the present application further provides a computer device. Referring to fig. 4, fig. 4 is a block diagram of a basic structure of a computer device according to the present embodiment.
The computer device 6 comprises a memory 61, a processor 62, a network interface 63 communicatively connected to each other via a system bus. It is noted that only a computer device 6 having components 61-63 is shown, but it is understood that not all of the shown components are required to be implemented, and that more or fewer components may be implemented instead. As will be understood by those skilled in the art, the computer device is a device capable of automatically performing numerical calculation and/or information processing according to a preset or stored instruction, and the hardware includes, but is not limited to, a microprocessor, an Application Specific Integrated Circuit (ASIC), a Programmable Gate Array (FPGA), a Digital Signal Processor (DSP), an embedded device, and the like.
The computer device can be a desktop computer, a notebook, a palm computer, a cloud server and other computing devices. The computer equipment can carry out man-machine interaction with a user through a keyboard, a mouse, a remote controller, a touch panel or voice control equipment and the like.
The memory 61 includes at least one type of readable storage medium including a flash memory, a hard disk, a multimedia card, a card type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a Read Only Memory (ROM), an Electrically Erasable Programmable Read Only Memory (EEPROM), a Programmable Read Only Memory (PROM), a magnetic memory, a magnetic disk, an optical disk, etc. In some embodiments, the memory 61 may be an internal storage unit of the computer device 6, such as a hard disk or a memory of the computer device 6. In other embodiments, the memory 61 may also be an external storage device of the computer device 6, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the computer device 6. Of course, the memory 61 may also comprise both an internal storage unit of the computer device 6 and an external storage device thereof. In this embodiment, the memory 61 is generally used for storing an operating system installed on the computer device 6 and various application software, such as computer readable instructions of a report automatic generation method. Further, the memory 61 may also be used to temporarily store various types of data that have been output or are to be output.
The processor 62 may be a Central Processing Unit (CPU), controller, microcontroller, microprocessor, or other data Processing chip in some embodiments. The processor 62 is typically used to control the overall operation of the computer device 6. In this embodiment, the processor 62 is configured to execute the computer readable instructions or process data stored in the memory 61, for example, execute the computer readable instructions of the report automatic generation method.
The network interface 63 may comprise a wireless network interface or a wired network interface, and the network interface 63 is typically used for establishing a communication connection between the computer device 6 and other electronic devices.
The computer equipment provided by the embodiment realizes the unified management and automatic generation of the report according to the label, saves the report generation time, improves the report generation efficiency and further reduces the maintenance cost of the report.
The present application further provides another embodiment, which is to provide a computer-readable storage medium, wherein the computer-readable storage medium stores computer-readable instructions, which can be executed by at least one processor, so as to cause the at least one processor to execute the steps of the report automatic generation method.
The computer-readable storage medium provided by the embodiment realizes unified management and automatic generation of the report according to the label, saves the report generation time, improves the report generation efficiency, and further reduces the maintenance cost of the report.
Through the description of the foregoing embodiments, it is clear to those skilled in the art that the method of the foregoing embodiments may be implemented by software plus a necessary general hardware platform, and certainly may also be implemented by hardware, but in many cases, the former is a better implementation. Based on such understanding, the technical solutions of the present application may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present application.
It should be understood that the above-described embodiments are merely exemplary of some, and not all, embodiments of the present application, and that the drawings illustrate preferred embodiments of the present application without limiting the scope of the claims appended hereto. This application is capable of embodiments in many different forms and is provided for the purpose of enabling a thorough understanding of the disclosure of the application. Although the present application has been described in detail with reference to the foregoing embodiments, it will be apparent to one skilled in the art that the present application may be practiced without modification or with equivalents of some of the features described in the foregoing embodiments. All equivalent structures made by using the contents of the specification and the drawings of the present application are directly or indirectly applied to other related technical fields and are within the protection scope of the present application.

Claims (10)

1. An automatic report generation method is characterized by comprising the following steps:
when a report automatic generation instruction is received, acquiring a target file and a target template corresponding to the report automatic generation instruction;
acquiring a configuration label in the target template, analyzing the configuration label to obtain a label type and a preset processing logic corresponding to the label type, and constructing data information of the target file based on the preset processing logic;
and writing the data information into the target template to obtain a target report corresponding to the target file, and sending a downloading instruction of the target report to a client so that the client downloads the target report.
2. The automated report generation method according to claim 1, wherein the step of constructing the data information of the target file based on the preset processing logic comprises:
when the label type is a composite line label, acquiring line data corresponding to the composite line label, and detecting whether the line data are the same;
when the row data are determined to be the same data, merging the row data according to the composite row label to obtain the data information;
and when the line data are not the same data, determining abnormal data in the line data, and merging non-abnormal data except the abnormal data in the line data to obtain the data information.
3. The automated report generation method according to claim 1, wherein the step of constructing the data information of the target file based on the preset processing logic further comprises:
when the configured label is a single-row label, acquiring a sub-label category of the single-row label, wherein the sub-label category comprises a time label and an index label;
when the sub-tag type is the time tag, processing first data configured as the time tag in the target file according to a time format marked by the time tag to obtain the data information;
and when the sub-label type is the index label, processing second data configured as the index label in the target file according to the index labeled by the index label to obtain the data information.
4. The automated report generation method according to claim 1, further comprising, before the step of obtaining the configuration tag in the target template:
acquiring the file type of the target file, acquiring a stored label dictionary according to the file type, and determining whether all label categories corresponding to the data in the target file exist in the label dictionary;
and when all the label categories exist in the label dictionary, generating configuration labels of the target file based on the label categories, and storing the configuration labels into the target template in columns.
5. The automated report generation method according to claim 4, further comprising, after the step of determining whether all the label categories corresponding to the data in the target file exist in the label dictionary, the steps of:
when the label category corresponding to the data does not exist in the label dictionary, establishing a new preset label in the label dictionary based on the data type of the data;
and generating a target label of the target file based on the preset label, and storing the target label into the target template in a row.
6. The method for automatically generating reports according to claim 1, wherein after the step of writing the data information into the target template to obtain the target report corresponding to the target file and sending a downloading instruction of the target report to the client, so that the client downloads the target report, the method further comprises:
when a modification instruction of the target report is received, searching a target modification format and error data corresponding to the modification instruction;
modifying the abnormal label corresponding to the error data according to the target modification format to obtain a normal label;
and re-importing the normal label in the target template to obtain a modification template, and generating a modification report corresponding to the modification instruction based on the modification template.
7. The automated report generation method according to claim 1, wherein the step of sending the downloading instruction of the target report to the client, so that the client downloads the target report comprises:
and binding the target report with a corresponding preset downloading interface, and sending a downloading instruction of the target report to the client when the binding of the target report and the preset downloading interface is completed so that the client downloads the target report.
8. An automatic report generation device, comprising:
the acquisition module is used for acquiring a target file and a target template corresponding to the report automatic generation instruction when the report automatic generation instruction is received;
the analysis module is used for acquiring a configuration label in the target template, analyzing the configuration label to obtain a label type and a preset processing logic corresponding to the label type, and constructing data information of the target file based on the preset processing logic;
and the writing module is used for writing the data information into the target template to obtain a target report corresponding to the target file, and sending a downloading instruction of the target report to a client so as to enable the client to download the target report.
9. A computer device comprising a memory having computer readable instructions stored therein and a processor which when executed implements the steps of the automated report generation method according to any of claims 1 to 7.
10. A computer readable storage medium, characterized in that it has stored thereon computer readable instructions which, when executed by a processor, implement the steps of the report automated generation method according to any of claims 1 to 7.
CN202210237139.2A 2022-03-11 2022-03-11 Report automatic generation method, device, computer equipment and storage medium Active CN114626352B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210237139.2A CN114626352B (en) 2022-03-11 2022-03-11 Report automatic generation method, device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210237139.2A CN114626352B (en) 2022-03-11 2022-03-11 Report automatic generation method, device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN114626352A true CN114626352A (en) 2022-06-14
CN114626352B CN114626352B (en) 2024-02-06

Family

ID=81902709

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210237139.2A Active CN114626352B (en) 2022-03-11 2022-03-11 Report automatic generation method, device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114626352B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114818645A (en) * 2022-06-29 2022-07-29 深圳红途科技有限公司 Automatic report generation method, device, equipment and medium based on data body

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109948134A (en) * 2019-03-21 2019-06-28 润电能源科学技术有限公司 A kind of report automatic generation method, system and electronic equipment and storage medium
CN111325012A (en) * 2020-01-22 2020-06-23 奇安信科技集团股份有限公司 word report generation method and system
CN111552704A (en) * 2020-03-16 2020-08-18 中国平安人寿保险股份有限公司 Data report generation method and device, computer equipment and storage medium
CN111814441A (en) * 2020-06-30 2020-10-23 平安科技(深圳)有限公司 Report generation method and device, electronic equipment and storage medium
CN112632006A (en) * 2020-12-18 2021-04-09 平安普惠企业管理有限公司 Electronic report file export method, device, equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109948134A (en) * 2019-03-21 2019-06-28 润电能源科学技术有限公司 A kind of report automatic generation method, system and electronic equipment and storage medium
CN111325012A (en) * 2020-01-22 2020-06-23 奇安信科技集团股份有限公司 word report generation method and system
CN111552704A (en) * 2020-03-16 2020-08-18 中国平安人寿保险股份有限公司 Data report generation method and device, computer equipment and storage medium
CN111814441A (en) * 2020-06-30 2020-10-23 平安科技(深圳)有限公司 Report generation method and device, electronic equipment and storage medium
CN112632006A (en) * 2020-12-18 2021-04-09 平安普惠企业管理有限公司 Electronic report file export method, device, equipment and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114818645A (en) * 2022-06-29 2022-07-29 深圳红途科技有限公司 Automatic report generation method, device, equipment and medium based on data body
CN114818645B (en) * 2022-06-29 2022-10-28 深圳红途科技有限公司 Automatic report generation method, device, equipment and medium based on data body

Also Published As

Publication number Publication date
CN114626352B (en) 2024-02-06

Similar Documents

Publication Publication Date Title
CN112507027B (en) Kafka-based incremental data synchronization method, device, equipment and medium
CN113254445B (en) Real-time data storage method, device, computer equipment and storage medium
CN112631924A (en) Automatic testing method and device, computer equipment and storage medium
CN112671734A (en) Message processing method facing multiple data sources and related equipment thereof
CN112631884A (en) Pressure measurement method and device based on data synchronization, computer equipment and storage medium
CN114626352B (en) Report automatic generation method, device, computer equipment and storage medium
CN112685115A (en) International cue language generating method, system, computer equipment and storage medium
CN116956326A (en) Authority data processing method and device, computer equipment and storage medium
CN111552663A (en) File consistency verification method and device, computer equipment and storage medium
CN115687826A (en) Page refreshing method and device, computer equipment and storage medium
CN115712422A (en) Form page generation method and device, computer equipment and storage medium
CN114912003A (en) Document searching method and device, computer equipment and storage medium
CN115061916A (en) Method for automatically generating interface test case and related equipment thereof
CN114968822A (en) Interface testing method and device, computer equipment and storage medium
CN110765610B (en) PDM integration method, PDM integration device, computer equipment and storage medium
CN114615325A (en) Message pushing method and device, computer equipment and storage medium
CN114143308A (en) File uploading information processing method and device, computer equipment and storage medium
CN114090066A (en) User interface card view generation method and device, computer equipment and medium
CN113806372B (en) New data information construction method, device, computer equipment and storage medium
CN115526731A (en) Task batch processing method and device, computer equipment and storage medium
CN114238466A (en) Message pushing method and device, computer equipment and storage medium
CN115827047A (en) Request processing method and device, computer equipment and storage medium
CN114218191A (en) System function migration method and device, computer equipment and storage medium
CN117235260A (en) Text labeling method, device, equipment and storage medium based on artificial intelligence
CN113504957A (en) Table data processing method and device, computer equipment and storage medium

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
GR01 Patent grant
GR01 Patent grant