Manuscript generation method and device based on user configuration, equipment and storage medium
Through the user-configured document generation method, variable replacement, data format conversion and rendering are performed on the PPT template, which realizes the generation of PPT, and solves the inefficiency problem caused by the cumbersome production methods of the existing PPT.
Patent Information
- Application Number
- CN202411465332.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-18
- Publication Date
- 2025-05-02
AI Technical Summary
The existing PPT production methods are cumbersome, resulting in inefficient production, especially when making complex presentations, which requires a lot of time and effort.
Through the document generation method based on user configuration, the target configuration file of the target graphic presentation is obtained, and variable replacement, data format conversion and rendering processing operations are performed on the target graphic presentation template, thereby realizing the generation automation of personalized configuration PPT.
The production process of PPT is simplified, the production efficiency of PPT is improved, and the production efficiency of PPT is solved, resulting in the inefficient production process caused by the cumbersome PPT production process.
Smart Images

Figure CN119918520A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the fields of data processing and financial technology, and in particular to a document generation method, device, computer equipment and computer-readable storage medium based on user configuration. Background Art
[0002] With the development of science and technology and the increasing popularity of office automation, the application field of PPT (PowerPoint, i.e. graphic presentation) is becoming more and more extensive. At present, when making PPT, users need to design and edit the layout, style and content of each slide page from scratch, and need to manually select and adjust elements such as fonts, colors, backgrounds, and finally manually add text, pictures, videos and other content. Therefore, the target PPT production method is not only cumbersome in production process, but also requires a lot of time and energy, especially when making more complex presentation PPT.
[0003] Therefore, how to solve the low efficiency of PPT production caused by the cumbersome PPT production process has become a technical problem that needs to be solved urgently. Summary of the invention
[0004] The main purpose of this application is to provide a document generation method, device, computer equipment and computer-readable storage medium based on user configuration, aiming to solve the technical problem of low PPT production efficiency caused by the cumbersome PPT production process.
[0005] To achieve the above object, the present application provides a document generation method based on user configuration, and the document generation method based on user configuration includes the following steps:
[0006] When a document generation instruction is detected, obtaining a target configuration file of a target graphic presentation;
[0007] Based on the target configuration file, performing variable replacement, data format conversion and rendering processing operations on at least one page of the target graphic presentation template to obtain each page of the target graphic presentation;
[0008] Based on the target graphic presentations on each page, the target graphic presentations are summarized and generated to realize the automated generation of the personalized configuration PPT.
[0009] In addition, to achieve the above-mentioned purpose, the present application also provides a document generation device based on user configuration, and the document generation device based on user configuration includes:
[0010] A configuration file acquisition module, used for acquiring a target configuration file of a target graphic presentation when a document generation instruction is detected;
[0011] A document template configuration module, used to perform variable replacement, data format conversion and rendering processing operations on at least one page of the document in the target graphic presentation template based on the target configuration file to obtain each page of the target graphic presentation;
[0012] The presentation generation module is used to generate the target graphic presentation based on the target graphic presentations on each page, so as to realize the automatic generation of the personalized configuration PPT.
[0013] In addition, to achieve the above-mentioned purpose, the present application also provides a computer device, which includes a processor, a memory, and a document generation program based on user configuration stored in the memory and executable by the processor, wherein when the document generation program based on user configuration is executed by the processor, the steps of the document generation method based on user configuration as described above are implemented.
[0014] In addition, to achieve the above-mentioned purpose, the present application also provides a computer-readable storage medium, on which a document generation program based on user configuration is stored, wherein when the document generation program based on user configuration is executed by a processor, the steps of the document generation method based on user configuration as described above are implemented.
[0015] The present application provides a document generation method, device, computer equipment and computer-readable storage medium based on user configuration. The method obtains a target configuration file of a target graphic presentation when a document generation instruction is detected; based on the target configuration file, at least one page of the document in the target graphic presentation template is subjected to variable replacement, data format conversion and rendering processing operations to obtain each page of the target graphic presentation; based on the each page of the target graphic presentation, the target graphic presentation is summarized and generated to realize the automatic generation of a personalized configuration PPT. In the above manner, the present application provides a configurable PPT generation method, that is, based on the target configuration file configured by the user, the target graphic presentation template is subjected to personalized configuration operations such as variable replacement, data format conversion and rendering processing operations to generate the target graphic presentation, thereby realizing the automatic generation of a personalized configuration PPT, simplifying the PPT production process, improving the PPT production efficiency, and solving the technical problem of low PPT production efficiency caused by the cumbersome PPT production process. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 It is a flowchart of a first embodiment of a method for generating a document based on user configuration according to the present invention;
[0017] Figure 2 It is a flow chart of a second embodiment of a method for generating a document based on user configuration according to the present invention;
[0018] Figure 3 Generate a flowchart for the target graphic presentation summary;
[0019] Figure 4 Draw a diagram for the graph Figure 1 ;
[0020] Figure 5 Draw a diagram for the graph Figure 2 ;
[0021] Figure 6 It is a flowchart of a third embodiment of a method for generating a document based on user configuration according to the present invention;
[0022] Figure 7 A schematic diagram of a document generation device based on user configuration according to the present invention;
[0023] Figure 8 The figure is a schematic diagram of the hardware structure of a computer device involved in an embodiment of the present invention.
[0024] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0025] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0026] The flowcharts shown in the accompanying drawings are only examples and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may also be decomposed, combined or partially merged, so the actual execution order may change according to actual conditions.
[0027] It should be understood that the terms used in this application specification are only for the purpose of describing specific embodiments and are not intended to limit the application. As used in this application specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.
[0028] It should be further understood that the term “and / or” used in the specification and appended claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0029] The user configuration-based document generation method involved in the embodiment of the present application is mainly applied to computer equipment. The user configuration-based document generation device can be a PC, a portable computer, a mobile terminal, or other device with display and processing functions.
[0030] In conjunction with the accompanying drawings, some embodiments of the present application are described in detail below. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.
[0031] Reference Figure 1 , Figure 1 It is a flowchart diagram of the first embodiment of the method for generating a document based on user configuration of the present invention.
[0032] like Figure 1 As shown, an embodiment of the present application provides a document generation method based on user configuration, and the document generation method based on user configuration includes steps S100 to S300.
[0033] In this embodiment, the document generation method based on user configuration includes the following steps:
[0034] Step S100: when a document generation instruction is detected, obtaining a target configuration file of a target graphic presentation document;
[0035] Currently, users need to design and edit the layout, style and content of each slide page from scratch, and need to manually select and adjust elements such as fonts, colors, backgrounds, and finally manually add text, pictures, videos, etc. Therefore, the target PPT production method is not only cumbersome, but also takes a lot of time and effort, especially when making more complex presentation PPTs.
[0036] In order to solve the above problems, in this embodiment, a configurable PPT generation method is provided, that is, based on the target configuration file configured by the user, personalized configuration operations such as variable replacement, data format conversion and rendering processing operations are performed on the target graphic presentation template to generate the target graphic presentation, thereby realizing the automated generation of personalized configuration PPT, simplifying the PPT production process, improving the PPT production efficiency, and solving the technical problem of low PPT production efficiency caused by the cumbersome PPT production process.
[0037] Specifically, the user can configure the template through the configuration file, configure the parameters of the target graphic presentation (ie, the target PPT), and generate a configuration file of the target PPT as the target configuration file.
[0038] The target configuration file includes target values corresponding to configurable parameters of the target PPT page relative to the target graphic presentation template (ie, the target PPT template).
[0039] For example, the target configuration file includes but is not limited to template_code (used to represent the business scenario of ppt), template_file_key (used to represent the file key of ppt), item_index (used to represent the index of ppt page in ppt), handle_type (used to represent the processing method of each ppt page, 0 is used to represent no processing, 1 is used to represent processing), data_process_bean (used to represent the processor required for ppt page data processing), render_bean (used to represent the processor required for ppt page rendering), and ext_info (used to represent the configuration of extensible ppt).
[0040] Furthermore, when the document generation instruction is detected, before obtaining the target configuration file of the target graphic presentation, the method further includes:
[0041] When receiving the target configuration file uploaded by the user, the target configuration file is verified according to the configuration file definition rule to verify the configuration data in the target configuration file.
[0042] In this embodiment, in order to facilitate the identification of configuration parameters, the definition rules of each configuration parameter can be declared in advance to generate a configuration file definition rule. When receiving the target configuration file uploaded by the user, the configuration file definition rule is used to perform format verification on each configuration parameter in the target configuration file to prevent the configuration parameter from being unrecognizable.
[0043] Step S200: Based on the target configuration file, performing variable replacement, data format conversion and rendering processing operations on at least one page of the target graphic presentation template to obtain each page of the target graphic presentation;
[0044] In this embodiment, based on the configuration parameters in the target configuration file, at least one page of the document in the target PPT template is subjected to variable replacement, data format conversion and rendering processing operations to obtain each page of the target graphic presentation.
[0045] Specifically, according to the various configuration parameters in the target configuration file, determine whether each ppt page configuration needs to be processed. If not, it is output as is according to the ppt template; if processing is required, it must first pass through the configured data_process_bean to pull the business data, and then convert the data format into the format defined by pptData, and then pass through render_bean (general rendering class) for processing.
[0046] Different scenario types correspond to different document templates. The target graphic presentation template can be determined according to the target business scenario corresponding to the target PPT.
[0047] Furthermore, in order to reduce the difficulty of generating PPT templates and improve the generation efficiency of PPT templates, the specifications of PPT template text variable definitions, configuration parameters based on PPT pages, general rendering parameter formats of PPT pages and general rendering processes of PPT pages are generated in advance according to the definition rules of text variables.
[0048] 1. Define the template variable format, which is used to define placeholders such as the following format "$A1", fix the special character $, add uppercase letters, and add a digit format; define the variable placeholder of the template, which should not be too short (too short will easily collide with the PPT template content) nor too long (too long will easily change the PPT text style).
[0049] 2. Configurable parameters based on ppt page:
[0050] template_code (ppt business scenario)
[0051] template_file_key (ppt file key)
[0052] item_index (index of the ppt page in the ppt)
[0053] handle_type (processing method, 0-no processing required, 1-processing required)
[0054] data_process_bean (processor required for ppt page data processing)
[0055] render_bean (processor required for ppt page rendering)
[0056] ext_info (extensible ppt configuration)
[0057] This provides a general and configurable solution for generating ppts based on ppt templates. Users do not need to pay attention to the underlying rendering implementation of ppts, but only need to generate pptData that meets the requirements. The generation of pptData can be personalized according to the required ppt pages. Therefore, by adopting this solution, the difficulty of developers generating ppts is greatly reduced, and development efficiency is improved.
[0058] 3. Define the generalized pptData format, such as whether variable replacement is supported, whether image replacement, chart drawing, table generation, ppt page deletion, etc. are required).
[0059] 4. Define a general ppt rendering process to define each ppt page to generate converted pptData data, which is then processed by a general ppt rendering process class to generate the final business ppt through the following process.
[0060] Step S300: Based on the target graphic presentations on each page, the target graphic presentation is generated in a summarized manner to realize the automated generation of the personalized configuration PPT.
[0061] In this embodiment, after performing at least one of variable replacement, data format conversion, and rendering processing operations on each page of the target PPT template based on the target configuration file, each page of the target graphic presentation is obtained. The target graphic presentations on each page are summarized to generate a final target PPT.
[0062] Furthermore, document verification operations such as PPT document page deduplication, repeated word detection, and typo detection can be performed on each page of the target graphic presentation to further improve the accuracy of PPT generation.
[0063] The present embodiment provides a document generation method based on user configuration, which obtains a target configuration file of a target graphic presentation when a document generation instruction is detected; based on the target configuration file, performs variable replacement, data format conversion, and rendering processing operations on at least one page of the document in the target graphic presentation template to obtain each page of the target graphic presentation; based on the each page of the target graphic presentation, the target graphic presentation is summarized and generated to realize the automatic generation of a personalized configuration PPT. In the above manner, the present embodiment provides a configurable PPT generation method, that is, based on the target configuration file configured by the user, performs personalized configuration operations such as variable replacement, data format conversion, and rendering processing operations on the target graphic presentation template to generate the target graphic presentation, thereby realizing the automatic generation of a personalized configuration PPT, simplifying the PPT production process, improving the PPT production efficiency, and solving the technical problem of low PPT production efficiency caused by the cumbersome PPT production process.
[0064] Reference Figure 2 , Figure 2 It is a flowchart diagram of the second embodiment of the document generation method based on user configuration of the present invention.
[0065] Based on the above Figure 1 In the embodiment shown, in this embodiment, the step S200 specifically includes:
[0066] Step S210, obtaining a page of the target graphic presentation template according to a preset order as the current page, and determining a variable replacement rule, a data conversion rule and a rendering process flow according to the target configuration file;
[0067] Step S220, based on the variable replacement rule, replace the variables in the current page document with target business data, and according to the data conversion rule, convert the relevant data in the current page document from the current format to the target format, to obtain a processed document corresponding to the current page document;
[0068] Step S230, obtaining the next page document in the target graphic presentation template as the current page document, until the processed documents corresponding to all the page documents in the target graphic presentation template are obtained;
[0069] Step S240, according to the rendering process flow, calling the corresponding rendering process class, rendering the processing documents corresponding to all the page documents, and obtaining the target graphic presentation documents of each page.
[0070] In this embodiment, Figure 3 As shown, according to the order of the documents in the target PPT template, such as from large to small or from small to large, each page of the document in the target PPT template is obtained in turn and used as the current page document respectively, so as to configure each page of the document in the target PPT template one by one.
[0071] According to the configuration parameters corresponding to the target PPT document in the target configuration file, each page of the target PPT template is configured one by one.
[0072] Specifically, if the target page document (which may include one or more pages) marked in the target configuration file is subjected to target operation processing, such as variable replacement of the first page document, it can also be variable replacement of the document with variables in the target PPT template. According to the data conversion rules, the relevant data in the current page document is converted from the current format to the target format, and the processed document corresponding to the current page document is obtained. That is, whether it needs to be processed based on the ppt page configuration. If it does not need to be processed, it is output as it is according to the ppt template. If it needs to be processed, it needs to first pass through the configured data_process_bean to pull the business data, and then convert the data format into the format defined by pptData, and then pass through render_bean (general rendering class) for processing.
[0073] Then, the next page document in the target graphic presentation template is obtained as the current page document, until the processing documents corresponding to all the page documents in the target graphic presentation template are obtained. According to the rendering process flow, the corresponding rendering process class is called to render the processing documents corresponding to all the page documents to obtain the target graphic presentations of each page.
[0074] Furthermore, after obtaining a page of the target graphic presentation template according to a preset order as the current page of the document, the method further includes:
[0075] Determining whether to delete the current page document according to the to-be-deleted page identifier in the target configuration file;
[0076] If it is determined to delete the current page document, the current page document is deleted, and the next page document is obtained as the current page document.
[0077] In this embodiment, each page of the document in the target PPT template is obtained in turn for deletion judgment, that is, the document page identifier to be deleted is determined according to the target configuration file to determine whether each page of the document in the target PPT template needs to be deleted.
[0078] Specifically, the page to be deleted can be a specific page number, such as deleting the manuscript pages after page 15, that is, deleting all the manuscripts in the target PPT template from page 16 to the last page. The page to be deleted can be deleting manuscript pages containing one or more types of data.
[0079] Furthermore, after replacing the variables in the current page document with target business data based on the variable replacement rule, the method further includes:
[0080] According to the target configuration file, determining whether there is a chart to be drawn on the current page document;
[0081] If it is determined that the current page document has the chart to be drawn, then determining the type of the chart to be drawn according to the data type of the target business data;
[0082] According to the target business data and the type of the chart to be drawn, a chart is drawn and / or filled at a preset position of the current page document.
[0083] In this embodiment, a chart filling or table generation can be performed through a target configuration file. Specifically, according to the target configuration file, it is determined whether the current page document has a chart to be drawn. Specifically, it can be determined whether the page has a parameter identifier corresponding to the chart to be drawn. If not, it is determined that the current page document does not need a chart to be drawn; if so, it is determined that the current page document has the chart to be drawn. If it is determined that the current page document has the chart to be drawn, then Figure 4 and Figure 5 As shown, according to the data type of the target business data, the type of chart to be drawn is determined; according to the target business data and the type of chart to be drawn, the chart is drawn and / or filled in the preset position of the current page document. Among them, the chart types include but are not limited to pie charts and bar charts.
[0084] Furthermore, the location of the data referenced by the chart can be specified, and the corresponding business data can be obtained based on the location to draw the chart and / or fill the chart.
[0085] Furthermore, before determining the variable replacement rule, the data conversion rule and the rendering process flow according to the target configuration file, the method further includes:
[0086] Determining a processing method identifier of the current page document according to the target configuration file;
[0087] When the processing mode identifier is the first processing identifier, the current page document is outputted as is;
[0088] When the processing mode identifier is the second processing identifier, the following is performed: determining a variable replacement rule, a data conversion rule and a rendering processing flow according to the target configuration file.
[0089] In this embodiment, whether processing is required is determined based on the ppt page configuration. If processing is not required, the data is output as is according to the ppt template. If processing is required, the configured data_process_bean is first used to pull the business data, and then the data format is converted into the format defined by pptData, and then processed by render_bean (a general rendering class).
[0090] See also Figure 6 , Figure 6 It is a flowchart diagram of the third embodiment of the method for generating a document based on user configuration of the present invention.
[0091] Based on the above Figure 1 In the embodiment shown, in this embodiment, after step S200, the following steps are further included:
[0092] Step S400, determining the address of the mark to be replaced and the address of the target picture in the target graphic presentation template according to the target configuration file;
[0093] Step S500: replacing the picture to be replaced with the target picture based on the picture identifier to be replaced and the target picture address.
[0094] In this embodiment, the target PPT template can be further set to replace the image through the target configuration file. For example, according to the target configuration file, the address of the identification to be replaced and the address of the target image in the target graphic presentation template are determined; and based on the identification of the image to be replaced and the address of the target image, the image to be replaced is replaced with the target image.
[0095] Specifically, the template of the corresponding target configuration file is as follows:
[0096]
[0097]
[0098]
[0099]
[0100] See also Figure 7 , Figure 7 This is a functional module diagram of a document generation device based on user configuration provided in an embodiment of the present application.
[0101] like Figure 7 As shown, the document generation device 700 based on user configuration includes:
[0102] The configuration file acquisition module 10 is used to acquire a target configuration file of a target graphic presentation when a document generation instruction is detected;
[0103] A document template configuration module 20, for performing variable replacement, data format conversion and rendering processing operations on at least one page of the target graphic presentation template based on the target configuration file to obtain each page of the target graphic presentation;
[0104] The presentation generation module 30 is used to generate the target graphic presentation based on the target graphic presentations on each page, so as to realize the automation of the generation of the personalized configuration PPT.
[0105] Furthermore, the document template configuration module 20 specifically includes:
[0106] A current page document confirmation unit is used to obtain a page document in the target graphic presentation template according to a preset order as the current page document, and determine variable replacement rules, data conversion rules and rendering processing flow according to the target configuration file;
[0107] A current page document processing unit, configured to replace the variables in the current page document with target business data based on the variable replacement rule, and convert the relevant data in the current page document from a current format to a target format according to the data conversion rule, so as to obtain a processed document corresponding to the current page document;
[0108] A current page document updating unit, used to obtain the next page document in the target graphic presentation template as the current page document, until the processed documents corresponding to all the page documents in the target graphic presentation template are obtained;
[0109] The target document generation unit is used to call the corresponding rendering processing class according to the rendering processing flow, and perform rendering processing on the processing documents corresponding to all the page documents to obtain the target graphic presentation documents of each page.
[0110] Furthermore, the document template configuration module 20 specifically includes:
[0111] A document deletion judgment unit, used to judge whether to delete the current page document according to the to-be-deleted page identifier in the target configuration file;
[0112] The current page document deleting unit is used to delete the current page document if it is determined to delete the current page document, and obtain a next page document as the current page document.
[0113] Furthermore, the document generation device 700 based on user configuration further includes a document chart drawing module, and the document chart drawing module includes:
[0114] A chart drawing judgment unit, used for judging whether there is a chart to be drawn on the current page document according to the target configuration file;
[0115] a chart drawing determination unit, configured to determine the type of the chart to be drawn according to the data type of the target business data if it is determined that the current page document has the chart to be drawn;
[0116] A chart drawing generating unit is used to draw and / or fill a chart at a preset position of the current page document according to the target business data and the type of the chart to be drawn.
[0117] Furthermore, the document generation device 700 based on user configuration further includes a document processing confirmation module, and the document processing confirmation module includes:
[0118] A processing mode confirmation unit, used to determine a processing mode identifier of the current page document according to the target configuration file;
[0119] A document original output unit, used for outputting the current page document original when the processing mode identifier is the first processing identifier;
[0120] The document processing confirmation unit is used to execute, when the processing method identifier is the second processing identifier: determining variable replacement rules, data conversion rules and rendering processing flow according to the target configuration file.
[0121] Furthermore, the document generation device 700 based on user configuration further includes a document image replacement module, and the document image replacement module includes:
[0122] A to-be-replaced picture confirmation unit, used to determine the to-be-replaced identification address and the target picture address in the target graphic presentation template according to the target configuration file;
[0123] The picture-to-be-replaced replacing unit is configured to replace the picture-to-be-replaced with the target picture based on the picture-to-be-replaced identifier and the target picture address.
[0124] Furthermore, the document generation device 700 based on user configuration further includes a configuration file verification module, and the configuration file verification module is used to:
[0125] When receiving the target configuration file uploaded by the user, the target configuration file is verified according to the configuration file definition rule to verify the configuration data in the target configuration file.
[0126] It should be noted that those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described device and each module can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0127] The above-mentioned device can be implemented in the form of a computer program. Figure 8 Runs on the computer device shown.
[0128] See also Figure 8 , Figure 8 A schematic block diagram of the structure of a computer device provided in an embodiment of the present application. The computer device may be a server.
[0129] See also Figure 8 The computer device includes a processor, a memory and a network interface connected through a system bus, wherein the memory may include a non-volatile storage medium and an internal memory.
[0130] The non-volatile storage medium can store an operating system and a computer program. The computer program includes program instructions, and when the program instructions are executed, the processor can execute any document generation method based on user configuration.
[0131] The processor is used to provide computing and control capabilities and support the operation of the entire computer equipment.
[0132] The internal memory provides an environment for the operation of the computer program in the non-volatile storage medium. When the computer program is executed by the processor, the processor can execute any document generation method based on user configuration.
[0133] The network interface is used for network communication, such as sending assigned tasks, etc. Those skilled in the art will appreciate that Figure 8The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0134] It should be understood that the processor may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0135] In one embodiment, the processor is used to run a computer program stored in the memory to implement the following steps:
[0136] When a document generation instruction is detected, obtaining a target configuration file of a target graphic presentation;
[0137] Based on the target configuration file, performing variable replacement, data format conversion and rendering processing operations on at least one page of the target graphic presentation template to obtain each page of the target graphic presentation;
[0138] Based on the target graphic presentations on each page, the target graphic presentations are summarized and generated to realize the automated generation of the personalized configuration PPT.
[0139] In one embodiment, the processor is used to run a computer program stored in the memory to implement the following steps:
[0140] Obtaining a page of the target graphic presentation template according to a preset order as the current page, and determining variable replacement rules, data conversion rules and rendering processing flow according to the target configuration file;
[0141] Based on the variable replacement rule, the variables in the current page document are replaced with target business data, and according to the data conversion rule, the relevant data in the current page document is converted from the current format to the target format to obtain the processed document corresponding to the current page document;
[0142] Obtaining the next page document in the target graphic presentation template as the current page document, until the processed documents corresponding to all page documents in the target graphic presentation template are obtained;
[0143] According to the rendering process flow, the corresponding rendering process class is called to render the processing documents corresponding to all the page documents to obtain the target graphic presentation documents of each page.
[0144] In one embodiment, the processor is used to run a computer program stored in the memory to implement the following steps:
[0145] Determining whether to delete the current page document according to the to-be-deleted page identifier in the target configuration file;
[0146] If it is determined to delete the current page document, the current page document is deleted, and the next page document is obtained as the current page document.
[0147] In one embodiment, the processor is used to run a computer program stored in the memory to implement the following steps:
[0148] According to the target configuration file, determining whether there is a chart to be drawn on the current page document;
[0149] If it is determined that the current page document has the chart to be drawn, then determining the type of the chart to be drawn according to the data type of the target business data;
[0150] According to the target business data and the type of the chart to be drawn, a chart is drawn and / or filled at a preset position of the current page document.
[0151] In one embodiment, the processor is used to run a computer program stored in the memory to implement the following steps:
[0152] Determining a processing method identifier of the current page document according to the target configuration file;
[0153] When the processing mode identifier is the first processing identifier, the current page document is outputted as is;
[0154] When the processing mode identifier is the second processing identifier, the following is performed: determining a variable replacement rule, a data conversion rule and a rendering processing flow according to the target configuration file.
[0155] In one embodiment, the processor is used to run a computer program stored in the memory to implement the following steps:
[0156] Determine, according to the target configuration file, the address of the identification to be replaced and the address of the target picture in the target graphic presentation template;
[0157] Based on the to-be-replaced picture identifier and the target picture address, the to-be-replaced picture is replaced with the target picture.
[0158] In one embodiment, the processor is used to run a computer program stored in the memory to implement the following steps:
[0159] When receiving the target configuration file uploaded by the user, the target configuration file is verified according to the configuration file definition rule to verify the configuration data in the target configuration file.
[0160] A computer-readable storage medium is also provided in an embodiment of the present application, wherein the computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and the processor executes the program instructions to implement any one of the document generation methods based on user configuration provided in the embodiments of the present application.
[0161] The computer-readable storage medium may be an internal storage unit of the computer device described in the foregoing embodiment, such as a hard disk or memory of the computer device. The computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a smart memory card (SmartMedia Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc., equipped on the computer device.
[0162] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.
Claims
1. A method for generating a document based on user configuration, characterized in that: The document generation method based on user configuration comprises the following steps: When a document generation instruction is detected, obtaining a target configuration file of a target graphic presentation; Based on the target configuration file, performing variable replacement, data format conversion and rendering processing operations on at least one page of the target graphic presentation template to obtain each page of the target graphic presentation; Based on the target graphic presentations on each page, the target graphic presentations are summarized and generated to realize the automated generation of the personalized configuration PPT.
2. The method for generating a document based on user configuration according to claim 1, characterized in that: The step of performing variable replacement, data format conversion, and rendering processing operations on at least one page of a target graphic presentation template based on the target configuration file to obtain each page of the target graphic presentation specifically includes: Obtaining a page of the target graphic presentation template according to a preset order as the current page, and determining variable replacement rules, data conversion rules and rendering processing flow according to the target configuration file; Based on the variable replacement rule, the variables in the current page document are replaced with target business data, and according to the data conversion rule, the relevant data in the current page document is converted from the current format to the target format to obtain the processed document corresponding to the current page document; Obtaining the next page document in the target graphic presentation template as the current page document, until the processed documents corresponding to all page documents in the target graphic presentation template are obtained; According to the rendering process flow, the corresponding rendering process class is called to perform rendering process on the processing documents corresponding to all the page documents to obtain the target graphic presentation documents of each page.
3. The method for generating a document based on user configuration according to claim 2, characterized in that: After obtaining a page of the target graphic presentation template according to a preset order as the current page of the document, the method further includes: Determining whether to delete the current page document according to the to-be-deleted page identifier in the target configuration file; If it is determined to delete the current page document, the current page document is deleted, and the next page document is obtained as the current page document.
4. The method for generating a document based on user configuration according to claim 2, characterized in that: After replacing the variables in the current page document with target business data based on the variable replacement rule, the method further includes: According to the target configuration file, determining whether there is a chart to be drawn on the current page document; If it is determined that the current page document has the chart to be drawn, then determining the type of the chart to be drawn according to the data type of the target business data; According to the target business data and the type of the chart to be drawn, a chart is drawn and / or filled at a preset position of the current page document.
5. The method for generating a document based on user configuration according to claim 2, characterized in that: Before determining the variable replacement rule, data conversion rule and rendering process flow according to the target configuration file, the method further includes: Determining a processing method identifier of the current page document according to the target configuration file; When the processing mode identifier is the first processing identifier, the current page document is outputted as is; When the processing mode identifier is the second processing identifier, the following is performed: determining a variable replacement rule, a data conversion rule and a rendering processing flow according to the target configuration file.
6. The method for generating a document based on user configuration according to claim 1, characterized in that: After performing variable replacement, data format conversion and rendering processing operations on at least one page of the target graphic presentation template based on the target configuration file, the method further includes: Determine, according to the target configuration file, the address of the identification to be replaced and the address of the target picture in the target graphic presentation template; Based on the to-be-replaced picture identifier and the target picture address, the to-be-replaced picture is replaced with the target picture.
7. The method for generating a document based on user configuration according to any one of claims 1 to 6, characterized in that: In the case where the document generation instruction is detected, before obtaining the target configuration file of the target graphic presentation, the method further includes: When receiving the target configuration file uploaded by the user, the target configuration file is verified according to the configuration file definition rule to verify the configuration data in the target configuration file.
8. A document generation device based on user configuration, characterized in that: The document generation device based on user configuration includes: A configuration file acquisition module, used for acquiring a target configuration file of a target graphic presentation when a document generation instruction is detected; A document template configuration module, used to perform variable replacement, data format conversion and rendering processing operations on at least one page of the document in the target graphic presentation template based on the target configuration file to obtain each page of the target graphic presentation; The presentation generation module is used to generate the target graphic presentation based on the target graphic presentations on each page, so as to realize the automatic generation of the personalized configuration PPT.
9. A computer device, characterized in that: The computer device includes a processor, a memory, and a document generation program based on user configuration stored in the memory and executable by the processor, wherein when the document generation program based on user configuration is executed by the processor, the steps of the document generation method based on user configuration as described in any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a document generation program based on user configuration, wherein when the document generation program based on user configuration is executed by a processor, the steps of the document generation method based on user configuration as claimed in any one of claims 1 to 7 are implemented.