CN117057332A - Report generation method, device, equipment and storage medium - Google Patents
Report generation method, device, equipment and storage medium Download PDFInfo
- Publication number
- CN117057332A CN117057332A CN202310919604.5A CN202310919604A CN117057332A CN 117057332 A CN117057332 A CN 117057332A CN 202310919604 A CN202310919604 A CN 202310919604A CN 117057332 A CN117057332 A CN 117057332A
- Authority
- CN
- China
- Prior art keywords
- template
- information
- component
- target
- component data
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 37
- 238000012216 screening Methods 0.000 claims abstract description 61
- 238000007781 pre-processing Methods 0.000 claims description 11
- 238000001914 filtration Methods 0.000 claims description 2
- 238000007405 data analysis Methods 0.000 abstract description 2
- 238000001514 detection method Methods 0.000 description 24
- 238000010586 diagram Methods 0.000 description 6
- 230000001629 suppression Effects 0.000 description 3
- 238000006243 chemical reaction Methods 0.000 description 2
- 230000001105 regulatory effect Effects 0.000 description 2
- 238000004458 analytical method Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000008676 import Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000002085 persistent effect Effects 0.000 description 1
- 230000011218 segmentation Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/10—Text processing
- G06F40/166—Editing, e.g. inserting or deleting
- G06F40/186—Templates
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/22—Indexing; Data structures therefor; Storage structures
- G06F16/2282—Tablespace storage structures; Management thereof
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/242—Query formulation
- G06F16/2433—Query languages
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/10—Text processing
- G06F40/166—Editing, e.g. inserting or deleting
- G06F40/177—Editing, e.g. inserting or deleting of tables; using ruled lines
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computational Linguistics (AREA)
- Audiology, Speech & Language Pathology (AREA)
- General Health & Medical Sciences (AREA)
- Health & Medical Sciences (AREA)
- Artificial Intelligence (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Software Systems (AREA)
- Mathematical Physics (AREA)
- Machine Translation (AREA)
Abstract
The invention relates to the technical field of data analysis and discloses a report generation method, device, equipment and storage medium, which are used for screening target templates from a template library and generating a target report based on corresponding data and the target templates, so that the generation efficiency of the target report is improved. The report generation method comprises the following steps: acquiring template screening request information, and screening out a corresponding template from a preset template library based on the template screening request information to obtain an initial template; generating structured query language sentence information through each component in the initial template; inquiring in a preset component database through the structured inquiry language statement information to obtain component data information; adjusting the initial template through the component data information and the component database to obtain a target template; and generating a target report based on the component data information, the component database and the target template.
Description
Technical Field
The present invention relates to the field of data analysis technologies, and in particular, to a report generating method, apparatus, device, and storage medium.
Background
The data report is a report document which is mainly in the form of a chart or a table and is used for sorting and displaying objective data, statistical data, analysis data, comprehensive information and the like.
At present, a report generating method generally obtains a plurality of target data, selects a plurality of report components in a toolbar, adjusts the report components through the target data, imports the target data into the adjusted corresponding report components to obtain target report component information, and typesets pages through the target report component information to obtain a target report.
In the prior art, each time a new report is generated, report components need to be selected one by one, so that the report generation efficiency is low.
Disclosure of Invention
The invention provides a report generation method, a report generation device, report generation equipment and a storage medium.
The first aspect of the invention provides a report generation method, which comprises the following steps: acquiring template screening request information, screening out a corresponding template from a preset template library based on the template screening request information, and obtaining an initial template; generating structured query language sentence information through each component in the initial template, wherein the structured query language sentence information comprises structured query language sentences corresponding to each component; inquiring in a preset component database through the structured inquiry language statement information to obtain component data information, wherein the component data information comprises component data corresponding to each component; adjusting the initial template through the component data information and the component database to obtain a target template; and generating a target report based on the component data information, the component database and the target template.
In a possible implementation manner, the obtaining the template screening request information, and screening the corresponding template from the preset template library based on the template screening request information to obtain the initial template includes: acquiring template screening request information, and extracting type information and style requirement information in the template screening request information; matching is carried out from a preset template library through the type information, so as to obtain first template information; and screening from the first template information based on the style requirement information to obtain an initial template.
In a possible implementation manner, the filtering from the first template information based on the style requirement information to obtain an initial template includes: extracting weights occupied by all style requirements in the style requirement information to obtain target weight information; acquiring weights of various style requirements corresponding to various templates in the first template information to obtain a template weight information set, wherein the template weight information set comprises template weight information corresponding to various templates; determining the template weight information closest to the target weight information in the template weight information set to obtain target template weight information; and extracting a template corresponding to the weight information of the target template to obtain an initial template.
In a possible implementation manner, the adjusting the initial template through the component data information and the component database to obtain a target template includes: preprocessing the initial template based on the component data information and the component database to obtain an intermediate template; judging whether a form component exists in the intermediate template; and if the form component exists in the intermediate template, adjusting the form component in the intermediate template through component data corresponding to the form component to obtain a target template.
In a possible implementation manner, the adjusting the form component in the intermediate template by the component data corresponding to the form component to obtain the target template includes: determining a hierarchical structure of the component data through the component data corresponding to the table component; determining header information through the hierarchical structure, wherein the header information is a single-stage header or a multi-stage header; identifying a row structure and a column structure of component data corresponding to the form component to obtain structural information; and modifying the form component in the intermediate template through the header information and the structure information to obtain a target template.
In a possible implementation manner, the preprocessing the initial template based on the component data information and the component database to obtain an intermediate template includes: judging whether target component data exists in the component data information, wherein the target component data is component data displaying a null value; if the target component data exists in the component data information, deleting a component corresponding to the target component data in the initial template to obtain a processed initial template; judging whether the processed initial template needs to be added with components or not through the component data information and the component database; if the processed initial template needs to be added with components, acquiring the components needing to be added, and obtaining the information of the components to be added; and importing the components in the component information to be added into the processed initial template to obtain an intermediate template.
In a possible implementation manner, the generating the structured query language sentence information through each component in the initial template includes: extracting content information of each component in the initial template; generating a corresponding text to be processed through the content information of each component to obtain text information to be processed; analyzing the text information to be processed through a preset grammar analyzer to obtain target text information; and converting the target text information to obtain the structured query language sentence information.
The second aspect of the present invention provides a report generating apparatus, including: the screening module is used for acquiring template screening request information, screening out corresponding templates from a preset template library based on the template screening request information, and obtaining an initial template; the first generation module is used for generating structured query language statement information through each component in the initial template, wherein the structured query language statement information comprises structured query language statements corresponding to each component; the query module is used for querying in a preset component database through the structured query language statement information to obtain component data information, wherein the component data information comprises component data corresponding to each component; the adjusting module is used for adjusting the initial template through the component data information and the component database to obtain a target template; a second generating module, configured to generate a target report based on the component data information, the component database, and the target template, where in a feasible implementation, the screening module includes: the processing unit is used for acquiring template screening request information and extracting type information and style requirement information in the template screening request information; the matching unit is used for matching from a preset template library through the type information to obtain first template information; and the screening unit is used for screening from the first template information based on the style requirement information to obtain an initial template.
In a possible embodiment, the screening unit is specifically configured to: extracting weights occupied by all style requirements in the style requirement information to obtain target weight information; acquiring weights of various style requirements corresponding to various templates in the first template information to obtain a template weight information set, wherein the template weight information set comprises template weight information corresponding to various templates; determining the template weight information closest to the target weight information in the template weight information set to obtain target template weight information; and extracting a template corresponding to the weight information of the target template to obtain an initial template.
In a possible embodiment, the adjustment module includes: the preprocessing unit is used for preprocessing the initial template based on the component data information and the component database to obtain an intermediate template; the judging unit is used for judging whether a form component exists in the middle template or not; and the adjusting unit is used for adjusting the form components in the intermediate template through the component data corresponding to the form components if the form components exist in the intermediate template, so as to obtain a target template.
In a possible embodiment, the adjusting unit is specifically configured to: determining a hierarchical structure of the component data through the component data corresponding to the table component; determining header information through the hierarchical structure, wherein the header information is a single-stage header or a multi-stage header; identifying a row structure and a column structure of component data corresponding to the form component to obtain structural information; and modifying the form component in the intermediate template through the header information and the structure information to obtain a target template.
In a possible embodiment, the preprocessing unit is specifically configured to: judging whether target component data exists in the component data information, wherein the target component data is component data displaying a null value; if the target component data exists in the component data information, deleting a component corresponding to the target component data in the initial template to obtain a processed initial template; judging whether the processed initial template needs to be added with components or not through the component data information and the component database; if the processed initial template needs to be added with components, acquiring the components needing to be added, and obtaining the information of the components to be added; and importing the components in the component information to be added into the processed initial template to obtain an intermediate template.
In a possible embodiment, the first generating module is specifically configured to: extracting content information of each component in the initial template; generating a corresponding text to be processed through the content information of each component to obtain text information to be processed; analyzing the text information to be processed through a preset grammar analyzer to obtain target text information; and converting the target text information to obtain the structured query language sentence information.
A third aspect of the present invention provides a report generating apparatus, including: a memory and at least one processor, the memory having instructions stored therein; the at least one processor invokes the instructions in the memory to cause the report generating device to perform the report generating method described above.
A fourth aspect of the present invention provides a computer readable storage medium having instructions stored therein which, when run on a computer, cause the computer to perform the report generating method described above.
In the technical scheme provided by the invention, template screening request information is acquired, and a corresponding template is screened out from a preset template library based on the template screening request information to obtain an initial template; generating structured query language sentence information through each component in the initial template, wherein the structured query language sentence information comprises structured query language sentences corresponding to each component; inquiring in a preset component database through the structured inquiry language statement information to obtain component data information, wherein the component data information comprises component data corresponding to each component; adjusting the initial template through the component data information to obtain a target template; and importing the component data information into the target template to obtain a target report. In the embodiment of the invention, an initial template is screened from a preset template library, structured query language statement information is generated based on each component in the initial template, and query is performed in a preset component database through the structured query language statement information to obtain component data information, the initial template is adjusted based on the component data information and the component database to obtain a target template, and a target report is generated through the component data information, the component database and the target template, so that the report generation efficiency is improved.
Drawings
FIG. 1 is a diagram illustrating an embodiment of a method for generating a report in an embodiment of the present invention;
FIG. 2 is a schematic diagram of another embodiment of a report generating method according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of an embodiment of a report generating apparatus according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of another embodiment of a report generating apparatus according to an embodiment of the present invention;
fig. 5 is a schematic diagram of an embodiment of a report generating apparatus according to an embodiment of the present invention.
Detailed Description
The embodiment of the invention provides a report generation method, a report generation device, report generation equipment and a storage medium.
The terms "first," "second," "third," "fourth" and the like in the description and in the claims and in the above drawings, if any, are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments described herein may be implemented in other sequences than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed or inherent to such process, method, article, or apparatus.
It is to be understood that the execution subject of the present invention may be a report generating device, and may also be a terminal or a server, which is not limited herein. The embodiment of the invention is described by taking a server as an execution main body as an example.
For easy understanding, the following describes a specific flow of an embodiment of the present invention, referring to fig. 1, and one embodiment of a report table generating method in the embodiment of the present invention includes:
101. acquiring template screening request information, and screening out a corresponding template from a preset template library based on the template screening request information to obtain an initial template;
generating a corresponding template vector according to text information corresponding to each template in the template library to obtain template vector information, extracting text information in template screening request information to obtain target text information, generating a target vector according to the target text information, comparing the target vector with each template vector in the template vector information one by one to obtain comparison information, extracting the target template vector from the template vector information through the comparison information, wherein the target template vector is the template vector with the highest similarity with the target vector in the template vector information, and determining the corresponding template based on the target template vector to obtain the initial template.
The initial templates are screened from a preset template library through vector similarity, so that the screening efficiency of the templates is improved.
102. Generating structured query language statement information through each component in the initial template, wherein the structured query language statement information comprises structured query language statements corresponding to each component;
acquiring content information of each component in an initial template, identifying the content information of each component, extracting keywords in the content information of each component to obtain keywords corresponding to each component, generating sentences with complete grammar structures corresponding to each component based on the keywords corresponding to each component to obtain sentences to be processed corresponding to each component, and inputting the sentences to be processed corresponding to each component into a preset language converter to be converted to obtain structured query language sentence information.
103. Inquiring in a preset component database through the structured inquiry language statement information to obtain component data information, wherein the component data information comprises component data corresponding to each component;
analyzing the structured query language statement information through a preset analyzer to obtain target labels corresponding to each structured query language statement, and matching the target labels corresponding to each structured language statement in a preset component database to obtain component data information, wherein each component data corresponds to a target label, each target label corresponds to a structured query language statement, and each structured query language statement corresponds to a component, so that each component data in the component data information corresponds to a component.
104. Adjusting the initial template through the component data information and the component database to obtain a target template;
traversing the component data in the component database, judging whether the component data which are not matched exist in the component database, extracting the component data which are not matched if the component data which are not matched exist in the component database, obtaining unmatched component data information, judging whether target unmatched component data exist in the unmatched component data information, judging whether the target unmatched component data are unmatched component data which are not null values, extracting the target unmatched component data if the target unmatched component data exist in the unmatched component data information, obtaining target unmatched component data information, adding corresponding components in an initial template through the target unmatched component data information, obtaining an initial template after processing, judging whether the target component data are component data which show null values or not in the component data information, deleting the components corresponding to the target component data in the initial template after processing, obtaining an intermediate template, judging whether the intermediate template exists a form component, and modifying the form components in the intermediate template through the form components corresponding to the form components, and obtaining the target template.
105. And generating a target report based on the component data information, the component database and the target template.
The method comprises the steps of caching component data information and target unmatched component data information into a preset cache space, obtaining a target template required format, carrying out format conversion on the component data information and the target unmatched component data information based on the target template required format to obtain processed component data information, wherein each component data in the processed component data information is provided with a first identifier and a second identifier, the first identifier is used for identifying a component corresponding to each component data in the processed component data information, the second identifier is used for identifying a thread corresponding to each component data in the processed component data information, and each component data in the processed component data information is imported into a region corresponding to the target template through multithreading based on the first identifier and the second identifier to obtain the target template.
The data is imported into the report template in a concurrent multithreading mode, so that the data processing efficiency and the importing speed are effectively improved.
In the embodiment of the invention, the initial template is screened from the preset template library, the structured query language statement information is generated based on each component in the initial template, the query is carried out in the preset component database through the structured query language statement information, the component data information is obtained, the initial template is adjusted based on the component data information and the component database, the target template is obtained, and the target report is generated through the component data information, the component database and the target template, so that the report generation efficiency is improved.
Referring to fig. 2, another embodiment of a report generating method in an embodiment of the present invention includes:
201. acquiring template screening request information, and extracting type information and style requirement information in the template screening request information;
when a user needs to make a report, filling template screening request information in a preset position, detecting the preset position in real time by a server, judging whether the preset position is filled with data and storing the data, acquiring the template screening request information if the preset position is filled with the data and storing the data, and extracting type information and style requirement information in the template screening request information; wherein, the type information includes, but is not limited to, financial statement, market statement and sales statement, and the style requirement information includes, but is not limited to, aesthetic degree duty ratio and succinct degree duty ratio. And after the template screening request information is acquired, clearing the information filled in the preset position.
202. Matching is carried out from a preset template library through the type information, so as to obtain first template information;
dividing a plurality of templates in a preset template library according to type information, wherein each type comprises a plurality of templates, comparing the type information with a preset standard type information set by a server, judging whether the type information is accurate or not, detecting the type information through a language detection model if the type information is inaccurate, and outputting a detection result; if the type information is accurate, acquiring a corresponding index number based on the type information, wherein the index number can be one or a combination of a plurality of numbers, letters or symbols, and matching is performed in a preset template library through the index number to obtain first template information.
For example, the preset standard type information set includes a financial report, a market report and a sales report, the type information is a time report, the time report is compared with the financial report, the market report and the sales report one by one, and as the information consistent with the time report does not exist in the financial report, the market report and the sales report, the type information is determined to be inaccurate, the type information is detected through a language detection model, the standard type information corresponding to the time report is determined to be the market report according to the pronunciation of the time report, and the detection result is output, and the detection result is the market report.
203. Screening from the first template information based on the style requirement information to obtain an initial template;
extracting weights occupied by all style requirements in the style requirement information to obtain target weight information; acquiring weights of various style requirements corresponding to various templates in the first template information to obtain a template weight information set, wherein the template weight information set comprises template weight information corresponding to various templates; determining the template weight information closest to the target weight information in the template weight information set to obtain target template weight information; and extracting a template corresponding to the weight information of the target template to obtain an initial template.
For example, the target weight information includes an aesthetic level of 80% and a conciseness level of 20%; the template weight information set comprises first template weight information, second template weight information and third template weight information, wherein the first template weight information comprises an aesthetic degree accounting for 30% and a succinct degree accounting for 70%; the second template weight information comprises an aesthetic degree accounting for 70% and a succinct degree accounting for 30%; the third template weight information comprises an aesthetic degree accounting for 60% and a succinct degree accounting for 40%; and comparing the target weight information with the first template weight information, the second template weight information and the third template weight information one by one, and extracting a template corresponding to the second template weight information to obtain an initial template as the aesthetic degree of the second template weight information is 70% and the succinct degree is 30% and the aesthetic degree of the target weight information is 80% and the succinct degree is 20% which are closest to each other.
204. Generating structured query language statement information through each component in the initial template, wherein the structured query language statement information comprises structured query language statements corresponding to each component;
extracting content information of each component in the initial template; generating a corresponding text to be processed through the content information of each component to obtain text information to be processed; analyzing the text information to be processed through a preset grammar analyzer to obtain target text information; and converting the target text information to obtain the structured query language statement information.
Identifying target areas corresponding to all components in the initial template; extracting the characters in the target area, and storing the extracted characters in a preset storage position to obtain a text to be processed corresponding to each component; deleting the text to be processed corresponding to each component through a grammar parser, and generating a target sentence corresponding to each component based on the processed text to be processed to obtain target text information; and inputting the target text information into a preset language converter for conversion to obtain the structured query language sentence.
205. Inquiring in a preset component database through the structured inquiry language statement information to obtain component data information, wherein the component data information comprises component data corresponding to each component;
the execution of step 205 is similar to that of step 103, and will not be described here.
206. Preprocessing an initial template based on the component data information and the component database to obtain an intermediate template;
judging whether target component data exists in the component data information, wherein the target component data is component data displaying null values; if the component data information contains the target component data, deleting the component corresponding to the target component data in the initial template to obtain a processed initial template; judging whether the processed initial template needs to be added with components or not through the component data information and the component database; if the processed initial template needs to be added with components, acquiring the components needing to be added, and obtaining the information of the components to be added; and importing the components in the component information to be added into the processed initial template to obtain an intermediate template.
In the processing process of the initial template, judging whether the processed initial template needs to be added with components or not through the component data information and the component database, if the initial template needs to be added with components, acquiring the components needing to be added, wherein the obtaining of the component information to be added comprises the following steps: comparing each component data in the component data information with the component data in the component database, judging whether the component data to be processed exist in the component database, wherein the component data to be processed are other component data except for each component data in the component data information in the component database, extracting the component data to be processed if the component data to be processed exist in the component database, obtaining the component data information to be processed, judging whether the component information to be processed exists target component data to be processed, judging whether the component data to be processed are the component data to be processed which are not null values, extracting the target component data to be processed if the target component data to be processed exist, obtaining the target component data information to be processed, and determining that the components need to be added according to the target component data information to be processed, thus obtaining the component information to be added.
207. Judging whether a form component exists in the intermediate template;
And acquiring images of all components in the intermediate template to obtain component image information, performing model detection on the component image information to obtain a detection result, and judging whether a form component exists in the intermediate template based on the detection result.
Performing example segmentation on images in the component image information to obtain detection image information, deleting redundant detection images in the detection image information through a non-maximum suppression algorithm to obtain processed detection image information, performing similarity comparison on each detection image in the processed detection image information and a preset table image one by one to obtain detection image similarity information, and if a target detection image exists in the detection image similarity information, determining that a table component exists in an intermediate template, wherein the target detection image is a detection image with similarity greater than or equal to the preset similarity.
For example, the preset similarity is 75%, the detected image information includes a first detected image, a second detected image, a third detected image, a fourth detected image, a fifth detected image and a sixth detected image, if the fourth detected image is determined to be a redundant object through a non-maximum suppression algorithm, the fourth detected image in the detected image information is deleted to obtain processed detected image information, the processed detected image information includes a first detected image, a second detected image, a third detected image, a fifth detected image and a sixth detected image, and the first detected image is compared with a preset table image to obtain the first similarity; comparing the second detection image with a preset table image to obtain a second similarity; comparing the third detection image with a preset table image to obtain a third similarity; comparing the fifth detection image with a preset table image to obtain a fourth similarity; comparing the sixth detection image with a preset table image to obtain a fifth similarity; if the first similarity is 60%, the second similarity is 10%; the third similarity is 75%, the fourth similarity is 95%, and the fifth similarity is 20%, and since the first similarity 60% is less than the preset similarity 75%, the second similarity 10% is less than the preset similarity 75%, the third similarity 75% is equal to the preset similarity 75%, the fourth similarity 90% is greater than the preset similarity 75% and the fifth similarity 20% is less than the preset similarity 75%, the third detected image corresponding to the third similarity and the fifth detected image corresponding to the fourth similarity are determined to be table images, and the existence of the table component in the intermediate template is determined.
The data are correspondingly processed through the model detection and non-maximum suppression algorithm, so that the accuracy and efficiency of detecting the form component are improved.
208. If the form component exists in the intermediate template, adjusting the form component in the intermediate template through component data corresponding to the form component to obtain a target template;
determining a hierarchical structure of the component data through the component data corresponding to the table component; determining header information through a hierarchical structure, wherein the header information is a single-stage header or a multi-stage header; identifying a row structure and a column structure of component data corresponding to the table component to obtain structural information; and modifying the form components in the intermediate template through the header information and the structure information to obtain the target template.
Defining attributes of data items in component data corresponding to the table components, acquiring first row data items, comparing the first row data items with other row data items one by one, and judging whether parallel layers exist or not; if the parallel hierarchy exists, determining header information, wherein the header information is a multi-stage header; if the parallel hierarchy does not exist, header information is determined, and the header information is a single-stage header. And identifying the transverse cell information and the longitudinal cell information of the component data corresponding to the table component, and determining a row structure and a column structure through the transverse cell information and the longitudinal cell information.
209. And generating a target report based on the component data information, the component database and the target template.
The execution of step 209 is similar to that of step 105 described above, and will not be described here.
In the embodiment of the invention, the initial template is obtained by matching the type information and the style requirement information in the template library, the structural query language statement information is generated by each component in the initial template, the structural query language statement information is queried in the component database to obtain the component data information, the initial template is preprocessed based on the component data information and the component database to obtain the intermediate template, when the form component exists in the intermediate template, the form component in the intermediate template is regulated by the component data corresponding to the form component to obtain the target template, and the target report is generated by the component data information, the component database and the target template, so that the efficiency of generating the target report is improved.
The method for generating a report in the embodiment of the present invention is described above, and the report generating device in the embodiment of the present invention is described below, referring to fig. 3, where an embodiment of the report generating device in the embodiment of the present invention includes:
The screening module 301 is configured to obtain template screening request information, and screen a corresponding template from a preset template library based on the template screening request information to obtain an initial template;
a first generating module 302, configured to generate structured query language sentence information through each component in the initial template, where the structured query language sentence information includes a structured query language sentence corresponding to each component;
the query module 303 is configured to query in a preset component database through the structured query language statement information to obtain component data information, where the component data information includes component data corresponding to each component;
the adjustment module 304 is configured to adjust the initial template through the component data information and the component database to obtain a target template;
the second generating module 305 is configured to generate a target report based on the component data information, the component database and the target template.
In the embodiment of the invention, the initial template is screened from the preset template library, the structured query language statement information is generated based on each component in the initial template, the query is carried out in the preset component database through the structured query language statement information, the component data information is obtained, the initial template is adjusted based on the component data information and the component database, the target template is obtained, the target report is generated through the component data information, the component database and the target template, and the report generation efficiency is improved.
Referring to fig. 4, another embodiment of a report generating apparatus according to an embodiment of the present invention includes:
the screening module 301 is configured to obtain template screening request information, and screen a corresponding template from a preset template library based on the template screening request information to obtain an initial template;
a first generating module 302, configured to generate structured query language sentence information through each component in the initial template, where the structured query language sentence information includes a structured query language sentence corresponding to each component;
the query module 303 is configured to query in a preset component database through the structured query language statement information to obtain component data information, where the component data information includes component data corresponding to each component;
the adjustment module 304 is configured to adjust the initial template through the component data information and the component database to obtain a target template;
the second generating module 305 is configured to generate a target report based on the component data information, the component database and the target template.
Optionally, the screening module 301 includes:
a processing unit 3011, configured to obtain template screening request information, and extract type information and style requirement information in the template screening request information;
A matching unit 3012, configured to match the type information from a preset template library to obtain first template information;
and a screening unit 3013, configured to screen from the first template information based on the style requirement information, so as to obtain an initial template.
Alternatively, the screening unit 3013 may specifically be configured to:
extracting weights occupied by all style requirements in the style requirement information to obtain target weight information; acquiring weights of various style requirements corresponding to various templates in the first template information to obtain a template weight information set, wherein the template weight information set comprises template weight information corresponding to various templates; determining the template weight information closest to the target weight information in the template weight information set to obtain target template weight information; and extracting a template corresponding to the weight information of the target template to obtain an initial template.
Optionally, the adjusting module 304 includes:
the preprocessing unit 3041 is used for preprocessing the initial template based on the component data information and the component database to obtain an intermediate template;
a judging unit 3042 for judging whether a form component exists in the intermediate template;
and the adjusting unit 3043 is configured to adjust the form component in the intermediate template according to the component data corresponding to the form component if the form component exists in the intermediate template, so as to obtain the target template.
Alternatively, the adjusting unit 3043 may be specifically configured to:
determining a hierarchical structure of the component data through the component data corresponding to the table component; determining header information through a hierarchical structure, wherein the header information is a single-stage header or a multi-stage header; identifying a row structure and a column structure of component data corresponding to the table component to obtain structural information; and modifying the form components in the intermediate template through the header information and the structure information to obtain the target template.
Alternatively, the preprocessing unit 3041 may be specifically configured to:
judging whether target component data exists in the component data information, wherein the target component data is component data displaying null values; if the component data information contains the target component data, deleting the component corresponding to the target component data in the initial template to obtain a processed initial template; judging whether the processed initial template needs to be added with components or not through the component data information and the component database; if the processed initial template needs to be added with components, acquiring the components needing to be added, and obtaining the information of the components to be added; and importing the components in the component information to be added into the processed initial template to obtain an intermediate template.
Alternatively, the first generating module 302 may be specifically configured to:
Extracting content information of each component in the initial template; generating a corresponding text to be processed through the content information of each component to obtain text information to be processed; analyzing the text information to be processed through a preset grammar analyzer to obtain target text information; and converting the target text information to obtain the structured query language statement information.
In the embodiment of the invention, the initial template is obtained by matching the type information and the style requirement information in the template library, the structural query language statement information is generated by each component in the initial template, the structural query language statement information is queried in the component database to obtain the component data information, the initial template is preprocessed based on the component data information and the component database to obtain the intermediate template, when the form component exists in the intermediate template, the form component in the intermediate template is regulated by the component data corresponding to the form component to obtain the target template, and the target report is generated by the component data information, the component database and the target template, so that the efficiency of generating the target report is improved.
The report generating device in the embodiment of the present invention is described in detail above in fig. 3 and fig. 4 from the point of view of the modularized functional entity, and the report generating apparatus in the embodiment of the present invention is described in detail below from the point of view of hardware processing.
Fig. 5 is a schematic diagram of a report generating device according to an embodiment of the present invention, where the report generating device 500 may have a relatively large difference due to different configurations or performances, and may include one or more processors (central processing units, CPU) 510 (e.g., one or more processors) and a memory 520, and one or more storage media 530 (e.g., one or more mass storage devices) storing application programs 533 or data 532. Wherein memory 520 and storage medium 530 may be transitory or persistent storage. The program stored in the storage medium 530 may include one or more modules (not shown), each of which may include a series of instruction operations for the report generating apparatus 500. Still further, the processor 510 may be configured to communicate with the storage medium 530 and execute a series of instruction operations in the storage medium 530 on the report generating device 500.
Report generating device 500 may also include one or more power supplies 540, one or more wired or wireless network interfaces 550, one or more input/output interfaces 560, and/or one or more operating systems 531, such as Windows Serve, mac OS X, unix, linux, freeBSD, and the like. Those skilled in the art will appreciate that the report generating device structure shown in FIG. 5 is not limiting of the report generating device and may include more or fewer components than shown, or may combine certain components, or may be a different arrangement of components.
The invention also provides report generating equipment, which comprises a memory and a processor, wherein the memory stores computer readable instructions, and the computer readable instructions, when executed by the processor, cause the processor to execute the steps of the report generating method in the above embodiments.
The present invention also provides a computer readable storage medium, which may be a non-volatile computer readable storage medium, or may be a volatile computer readable storage medium, in which instructions are stored which, when executed on a computer, cause the computer to perform the steps of the report generating method.
It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described systems, apparatuses and units may refer to corresponding procedures in the foregoing method embodiments, which are not repeated herein.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied essentially or in part or all of the technical solution or in part in the form of a software product stored in a storage medium, including instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a read-only memory (ROM), a random access memory (random access memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The above embodiments are only for illustrating the technical solution of the present invention, and not for limiting the same; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims (10)
1. The report generation method is characterized by comprising the following steps:
acquiring template screening request information, screening out a corresponding template from a preset template library based on the template screening request information, and obtaining an initial template;
generating structured query language sentence information through each component in the initial template, wherein the structured query language sentence information comprises structured query language sentences corresponding to each component;
inquiring in a preset component database through the structured inquiry language statement information to obtain component data information, wherein the component data information comprises component data corresponding to each component;
Adjusting the initial template through the component data information and the component database to obtain a target template;
and generating a target report based on the component data information, the component database and the target template.
2. The report generating method as set forth in claim 1, wherein the obtaining the template screening request information, screening the corresponding template from a preset template library based on the template screening request information, and obtaining the initial template includes:
acquiring template screening request information, and extracting type information and style requirement information in the template screening request information;
matching is carried out from a preset template library through the type information, so as to obtain first template information;
and screening from the first template information based on the style requirement information to obtain an initial template.
3. The report generating method according to claim 2, wherein the filtering from the first template information based on the style requirement information to obtain an initial template includes:
extracting weights occupied by all style requirements in the style requirement information to obtain target weight information;
acquiring weights of various style requirements corresponding to various templates in the first template information to obtain a template weight information set, wherein the template weight information set comprises template weight information corresponding to various templates;
Determining the template weight information closest to the target weight information in the template weight information set to obtain target template weight information;
and extracting a template corresponding to the weight information of the target template to obtain an initial template.
4. The report generating method according to claim 1, wherein said adjusting the initial template through the component data information and the component database to obtain a target template includes:
preprocessing the initial template based on the component data information and the component database to obtain an intermediate template;
judging whether a form component exists in the intermediate template;
and if the form component exists in the intermediate template, adjusting the form component in the intermediate template through component data corresponding to the form component to obtain a target template.
5. The report generating method according to claim 4, wherein the adjusting the form component in the intermediate template by the component data corresponding to the form component to obtain the target template includes:
determining a hierarchical structure of the component data through the component data corresponding to the table component;
Determining header information through the hierarchical structure, wherein the header information is a single-stage header or a multi-stage header;
identifying a row structure and a column structure of component data corresponding to the form component to obtain structural information;
and modifying the form component in the intermediate template through the header information and the structure information to obtain a target template.
6. The report generating method as set forth in claim 4, wherein said preprocessing the initial template based on the component data information and the component database to obtain an intermediate template includes:
judging whether target component data exists in the component data information, wherein the target component data is component data displaying a null value;
if the target component data exists in the component data information, deleting a component corresponding to the target component data in the initial template to obtain a processed initial template;
judging whether the processed initial template needs to be added with components or not through the component data information and the component database;
if the processed initial template needs to be added with components, acquiring the components needing to be added, and obtaining the information of the components to be added;
And importing the components in the component information to be added into the processed initial template to obtain an intermediate template.
7. The report generating method as recited in claim 1, wherein said generating structured query language sentence information by each component in said initial template comprises:
extracting content information of each component in the initial template;
generating a corresponding text to be processed through the content information of each component to obtain text information to be processed;
analyzing the text information to be processed through a preset grammar analyzer to obtain target text information;
and converting the target text information to obtain the structured query language sentence information.
8. A report generating apparatus, characterized in that the report generating apparatus includes:
the screening module is used for acquiring template screening request information, screening out corresponding templates from a preset template library based on the template screening request information, and obtaining an initial template;
the first generation module is used for generating structured query language statement information through each component in the initial template, wherein the structured query language statement information comprises structured query language statements corresponding to each component;
The query module is used for querying in a preset component database through the structured query language statement information to obtain component data information, wherein the component data information comprises component data corresponding to each component;
the adjusting module is used for adjusting the initial template through the component data information and the component database to obtain a target template;
and the second generation module is used for generating a target report based on the component data information, the component database and the target template.
9. A report generating apparatus, characterized in that the report generating apparatus comprises: a memory and at least one processor, the memory having instructions stored therein;
the at least one processor invoking the instructions in the memory to cause the report generating device to perform the report generating method of any of claims 1-7.
10. A computer readable storage medium having instructions stored thereon, which when executed by a processor, implement the report generation method of any of claims 1-7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310919604.5A CN117057332A (en) | 2023-07-25 | 2023-07-25 | Report generation method, device, equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310919604.5A CN117057332A (en) | 2023-07-25 | 2023-07-25 | Report generation method, device, equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN117057332A true CN117057332A (en) | 2023-11-14 |
Family
ID=88665339
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310919604.5A Pending CN117057332A (en) | 2023-07-25 | 2023-07-25 | Report generation method, device, equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117057332A (en) |
-
2023
- 2023-07-25 CN CN202310919604.5A patent/CN117057332A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7359851B2 (en) | Method of identifying the language of a textual passage using short word and/or n-gram comparisons | |
EP3716099A1 (en) | Document classification device | |
US7444325B2 (en) | Method and system for information extraction | |
CN111125086B (en) | Method, device, storage medium and processor for acquiring data resources | |
JP2004110161A (en) | Text sentence comparing device | |
US20040139384A1 (en) | Removal of extraneous text from electronic documents | |
EP2631815A1 (en) | Method and device for ordering search results, method and device for providing information | |
US10528609B2 (en) | Aggregating procedures for automatic document analysis | |
CN111986792A (en) | Medical institution scoring method, device, equipment and storage medium | |
CN114495143B (en) | Text object recognition method and device, electronic equipment and storage medium | |
CN111339457B (en) | Method and apparatus for extracting information from web page and storage medium | |
WO2019093172A1 (en) | Similarity index computation device, similarity search device, and similarity index computation program | |
CN117592470A (en) | Low-cost gazette data extraction method driven by large language model | |
US20030126138A1 (en) | Computer-implemented column mapping system and method | |
CN113806492B (en) | Record generation method, device, equipment and storage medium based on semantic recognition | |
CN107341152B (en) | Parameter input method and device | |
JP5324677B2 (en) | Similar document search support device and similar document search support program | |
JP5577546B2 (en) | Computer system | |
CN114297535A (en) | Page display method, device and equipment for query conditions and storage medium | |
CN113344023A (en) | Code recommendation method, device and system | |
CN117057332A (en) | Report generation method, device, equipment and storage medium | |
US20220179890A1 (en) | Information processing apparatus, non-transitory computer-readable storage medium, and information processing method | |
KR20240025253A (en) | Method and apparatus for data structuring of text using a line information | |
JP2002269120A (en) | Device and method for classifying document and program recording medium for performing the document classifying method | |
CN113868495A (en) | Website clustering method, device, 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 |