CN-122021556-A - Document generation method, device, equipment and storage medium
Abstract
The embodiment of the disclosure provides a document generation method, a device, equipment and a storage medium. The method comprises the steps of responding to received original data for generating a target document, carrying out preliminary processing on the original data to obtain analysis data corresponding to the original data, then generating a document body of the target document based on a document structure in a configuration template corresponding to the target document, obtaining object data corresponding to the target document based on the type of the object data and the analysis data, and then filling the object data into a corresponding position of the document body to generate the target document. The technical scheme of the embodiment of the disclosure solves the problems of low writing efficiency and insufficient availability of statistical documents in petrochemical enterprises in the related technology, effectively ensures that the generated target documents cannot have the problems of missing data, insufficient consistency and the like, and remarkably improves the availability and reliability of the target documents.
Inventors
- XI XIN
- LI JIEXI
- GUO ZHIJUN
- LIU KUN
- ZHANG JIANTAO
- LIU GAOYUN
- LIU PENG
- PENG HUI
- YIN HAO
- MA XIAOFENG
Assignees
- 昆仑数智科技有限责任公司
- 中国石油天然气集团有限公司
Dates
- Publication Date
- 20260512
- Application Date
- 20241112
Claims (14)
- 1. A document generation method, comprising: in response to received original data for generating a target document, performing preliminary processing on the original data to obtain analysis data corresponding to the original data, wherein the preliminary processing comprises data cleaning; Generating a document body of the target document based on a document structure in a configuration template corresponding to the target document, wherein the configuration template comprises the document structure and the object data type of the target document; obtaining object data corresponding to the target document based on the object data type and the analysis data; and filling the object data into the corresponding position of the document body to generate the target document.
- 2. The method according to claim 1, wherein said preliminary processing of the raw data in response to the received raw data for generating the target document to obtain the analysis data corresponding to the raw data comprises: Acquiring first-type original data in a data system based on a pre-configured data acquisition interface, wherein the first-type original data is used for representing original data stored in the data system; Acquiring second-type original data corresponding to the target document based on the data type requirement of the target document, wherein the second-type original data is used for representing the original data acquired based on a mode other than the data acquisition interface; And performing preliminary processing on the original data to obtain the analysis data.
- 3. The method of claim 2, wherein the data system comprises a production data system, a server database, a third party system; the acquiring the first kind of original data in the data system based on the pre-configured data acquisition interface comprises the following steps: Transmitting data information to be acquired to the data system based on the data acquisition interface, wherein the data system is used for transmitting corresponding target data to the data acquisition interface based on the data information, and the data information comprises a source address and field information corresponding to the target data; and determining the target data received by the data acquisition interface as the first type of original data.
- 4. The method of claim 2, wherein the preliminary processing of the raw data to obtain the analysis data comprises: labeling the original data based on the source of the original data; preprocessing the marked original data to obtain preprocessed original data, wherein the preprocessing comprises data cleaning, standardization processing and outlier processing; inputting the preprocessed original data into a machine learning algorithm based on a pre-configured index library, and outputting first type index data corresponding to the original data; calculating second class index data corresponding to the processed original data based on an index calculation formula in the index library; Generating analysis texts corresponding to the first type index data and the second type index data based on the first type index data and the second type index data and the corresponding numerical thresholds; And taking the first category index data, the second category index data and the analysis text as the analysis data.
- 5. The method of claim 4, wherein said using said first type of index data, said second type of index data, and said analysis result as said analysis data further comprises: And storing the analysis data based on the configuration information in the index library, and recording a storage position corresponding to the analysis data.
- 6. The method of claim 4, wherein generating the analysis text corresponding to the first and second category of index data based on the first and second category of index data and the corresponding numerical threshold comprises: generating a corresponding index data comparison result based on the first type index data and the second type index data and the corresponding numerical threshold; Generating a corresponding text to be filled based on the configured text template and the types of the index data; and filling the index data comparison result into the text to be filled to obtain the analysis text.
- 7. The method of claim 5, wherein generating a document body of the target document based on the document structure in the target document corresponding configuration template comprises: Determining a chapter structure contained in the target document, a target position of object data to be added in the target document and object data information of each target position based on a document structure in the configuration template, wherein the object data information comprises the types of the object data and storage positions of corresponding analysis data; Generating a document body of the target document based on the chapter structure, the target location, and the object data information; the obtaining the object data corresponding to the target document based on the object data type and the analysis data includes: and generating corresponding object data based on the object data information based on the object data type and the analysis data.
- 8. The method of claim 7, wherein the object data categories include static text data, dynamic text data, and chart data, The generating, based on the object data category and the analysis data, object data corresponding to the object data information includes: If the object data type is static text data, determining the static text of a storage position in the object data information as the object data; If the object data type is dynamic text data, replacing placeholders contained in dynamic texts at storage positions in the object data information with corresponding analysis data to obtain the object data; if the object data type is chart data, the object data is generated based on a chart format and corresponding analysis data contained in a storage position in the object data information.
- 9. The method according to any one of claims 1 to 8, wherein the configuration template is obtained by: Obtaining a document structure in the configuration template based on the document structure identifier in the entered document data; Determining a target position of the document structure, which needs to be filled with object data; Determining the object data type of each target position based on the data characteristics of each target position in the document data; determining object data information corresponding to each target position based on a pre-configured index library, the object data types and the target positions; a configuration template is generated based on the document structure, the target location, and the object data information.
- 10. The method of claim 9, wherein the index library is obtained by: And generating an index library based on the characteristic information of the index required by the target document, wherein the characteristic information comprises an original data source corresponding to the index, a corresponding calculation mode and a corresponding numerical threshold, and the corresponding calculation mode comprises an index calculation formula and/or a machine learning algorithm required by calculating the index.
- 11. A document generating apparatus, characterized in that the document generating apparatus comprises: The determining module is used for responding to received original data for generating a target document, performing preliminary processing on the original data to obtain analysis data corresponding to the original data, wherein the preliminary processing comprises data cleaning; the processing module is used for generating a document body of the target document based on the document structure in the corresponding configuration template of the target document, wherein the configuration template comprises the document structure and the object data type of the target document; the calculation module is used for obtaining object data corresponding to the target document based on the object data type and the analysis data; and the generating module is used for filling the object data into the corresponding position of the document body and generating the target document.
- 12. A control apparatus, characterized by comprising: At least one processor; and a memory communicatively coupled to the at least one processor; Wherein the memory stores instructions executable by the at least one processor to cause the control device to perform the document generation method of any one of claims 1 to 10.
- 13. A computer-readable storage medium having stored therein computer-executable instructions which, when executed by a processor, are adapted to carry out the document generation method of any one of claims 1 to 10.
- 14. A computer program product comprising computer-executable instructions for implementing the document generation method of any one of claims 1 to 10 when executed by a processor.
Description
Document generation method, device, equipment and storage medium Technical Field The disclosure relates to the technical field of petrochemical production, in particular to a document generation method, a document generation device, document generation equipment and a document storage medium. Background In the production process management of petrochemical enterprises, the production process and equipment operation related data are counted regularly, and related statistical documents such as process technology month report, device operation data report and the like are established, so that related personnel can conveniently and effectively manage each link of the enterprise production process, and production links needing improvement or equipment needing maintenance can be found in time. In the related technology, the compiling of the statistical document is mainly completed manually by related personnel, and the related personnel need to search various data in each system, sort and summarize the data, and then compile the document. The whole process is long in time consumption and low in efficiency, and the problems of insufficient data consistency, high error risk and the like in the document are easy to occur in manual writing, so that the availability of the statistical document is insufficient. Disclosure of Invention The embodiment of the disclosure provides a document generation method, a device, equipment and a storage medium, which are used for solving the problems of low writing efficiency and insufficient availability of statistical documents in petrochemical enterprises in the related technology. In a first aspect, an embodiment of the present disclosure provides a document generating method, including: In response to received original data for generating a target document, performing preliminary processing on the original data to obtain analysis data corresponding to the original data, wherein the preliminary processing comprises data cleaning; Generating a document body of the target document based on a document structure in a configuration template corresponding to the target document, wherein the configuration template comprises the document structure and the object data type of the target document; obtaining object data corresponding to the target document based on the object data type and the analysis data; And filling the object data into the corresponding position of the document body to generate the target document. In a second aspect, an embodiment of the present disclosure provides a document generating apparatus including: the determining module is used for responding to received original data for generating the target document, performing preliminary processing on the original data to obtain analysis data corresponding to the original data, wherein the preliminary processing comprises data cleaning; the processing module is used for generating a document body of the target document based on the document structure in the corresponding configuration template of the target document, wherein the configuration template comprises the document structure of the target document and the type of the object data; the computing module is used for obtaining object data corresponding to the target document based on the object data type and the analysis data; And the generating module is used for filling the object data into the corresponding position of the document body and generating the target document. In a third aspect, embodiments of the present disclosure further provide a control apparatus, including: At least one processor; And a memory communicatively coupled to the at least one processor; Wherein the memory stores instructions executable by the at least one processor to cause the control device to perform the document generation method as in the first aspect of the present disclosure. In a fourth aspect, embodiments of the present disclosure also provide a computer-readable storage medium having stored therein computer-executable instructions that, when executed by a processor, are configured to implement a document generation method as in the first aspect of the present disclosure. In a fifth aspect, embodiments of the present disclosure also provide a computer program product comprising computer-executable instructions for implementing a document generation method as in the first aspect of the present disclosure when executed by a processor. According to the document generation method, device and equipment and storage medium, initial processing is conducted on original data in response to the received original data for generating a target document, analysis data corresponding to the original data are obtained, then a document body of the target document is generated based on a document structure in a configuration template corresponding to the target document, object data corresponding to the target document are obtained based on the type of the object data and the analysis data, and