CN112258607B - Slide rendering method and device and electronic equipment - Google Patents

Slide rendering method and device and electronic equipment Download PDF

Info

Publication number
CN112258607B
CN112258607B CN202011150480.1A CN202011150480A CN112258607B CN 112258607 B CN112258607 B CN 112258607B CN 202011150480 A CN202011150480 A CN 202011150480A CN 112258607 B CN112258607 B CN 112258607B
Authority
CN
China
Prior art keywords
target
content
slide
template
rendering
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.)
Active
Application number
CN202011150480.1A
Other languages
Chinese (zh)
Other versions
CN112258607A (en
Inventor
孟燃
游景元
姚宏杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Taikang Asset Management Co ltd
Taikang Insurance Group Co Ltd
Original Assignee
Taikang Asset Management Co ltd
Taikang Insurance Group Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Taikang Asset Management Co ltd, Taikang Insurance Group Co Ltd filed Critical Taikang Asset Management Co ltd
Priority to CN202011150480.1A priority Critical patent/CN112258607B/en
Publication of CN112258607A publication Critical patent/CN112258607A/en
Application granted granted Critical
Publication of CN112258607B publication Critical patent/CN112258607B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/60Editing figures and text; Combining figures or text

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Processing Or Creating Images (AREA)
  • Document Processing Apparatus (AREA)

Abstract

The embodiment of the application provides a slide rendering method, a slide rendering device and electronic equipment, and relates to the technical field of slide rendering. The method comprises the following steps: acquiring variable information about a target slide template; copying the first content of the original slide into a target slide template according to the target slide template to obtain a target slide containing the first content; translating the second content in the first target page of the target slide according to the target language and variable information corresponding to the target slide template to obtain target content conforming to the grammar format of the target language; and rendering the first target page according to the target content to obtain a rendered second target page. According to the scheme, the target slides can be automatically translated and rendered through the target language corresponding to the target slide template, so that not only can the workload be reduced, but also the format writing of the target slides is more flexible, the degree of freedom is higher, and finally the diversified slide presentation effect is realized.

Description

Slide rendering method and device and electronic equipment
Technical Field
The present application relates to the technical field of slide rendering, and in particular, to a slide rendering method, apparatus and electronic device.
Background
In the related business scenario, taking a foundation net value trend chart as an example, a common solution is to manually acquire internal data, then manually go to an external data source to search trend, calculate the situation of excess performance at each time point through a performance comparison level calculation mode, paste the situation to a table, generate the trend chart through the table, and take time and effort, and possibly make mistakes in manual processing.
The above example may be only a partial content of a page in a customer report, a complete customer report generally contains quite a lot of similar information, even if a similar data generating system is provided, such as a product with automatic extraction and clear data, the data of the slide needs to be filled manually, the workload is high, or even if some automatic report generating systems are provided, the report is highly customized, such as modification and update, a lot of development work is still required, and the cost is high.
Disclosure of Invention
The application provides a slide rendering method, a slide rendering device and electronic equipment, so that the problems that operations such as report generation and update are required to be manually processed and the workload is large in the prior art are solved to a certain extent.
In a first aspect of the present application, there is provided a slide rendering method, including:
acquiring variable information about a target slide template;
copying first content of an original slide into the target slide template according to the target slide template to obtain a target slide containing the first content;
translating the second content in the first target page of the target slide according to the target language corresponding to the target slide template and the variable information to obtain target content conforming to the grammar format of the target language;
and rendering the first target page according to the target content to obtain a rendered second target page.
Optionally, the copying the first content of the original slide into the target slide template according to the target slide template to obtain a target slide containing the first content includes:
copying the first content of the original slide into a memory;
and sorting the first content according to the target slide template, and copying the sorted first content to different pages of the target slide template to obtain a target slide containing the first content.
Optionally, before translating the second content in the first target page of the target slide according to the target language corresponding to the target slide template and the variable information to obtain the target content conforming to the target language grammar format, the method further includes:
performing format conversion processing on the third content in the first target page to obtain a decomposition element;
and preprocessing the decomposition elements according to the target language corresponding to the target slide template to obtain second content conforming to the grammar format of the target language.
Optionally, the performing format conversion processing on the third content in the first target page to obtain a decomposition element includes:
performing format conversion processing on the third content in the first target page to obtain LXML format content;
and decomposing the LXML format content by using an element tree library ETREE to obtain decomposed elements.
Optionally, the rendering the first target page according to the target content to obtain a rendered second target page includes:
converting the target content into LXML format target content;
and rendering the first target page according to the target content in the LXML format to obtain a rendered second target page.
Optionally, the preprocessing includes at least one of:
merging rendering table cells;
removing the blank space and tab;
the annotation is deleted.
Optionally, the variable information includes: variable name and variable content.
In a second aspect of the present application, there is provided a slide rendering apparatus, including:
the acquisition module is used for acquiring variable information about the target slide template;
the copying module is used for copying the first content of the original slide into the target slide template according to the target slide template to obtain a target slide containing the first content;
the translation module is used for translating the second content in the first target page of the target slide according to the target language corresponding to the target slide template and the variable information to obtain target content conforming to the grammar format of the target language;
and the rendering module is used for rendering the first target page according to the target content to obtain a rendered second target page.
In a third aspect of the present application, there is also provided an electronic device, including a processor, a communication interface, a memory, and a communication bus, where the processor, the communication interface, and the memory complete communication with each other through the communication bus;
a memory for storing a computer program;
and a processor for implementing the steps in the slide rendering method as described above when executing the program stored on the memory.
In a fourth aspect of the application, there is also provided a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements a method of rendering a slide as described above.
In a fifth aspect of embodiments of the present application, there is also provided a computer program product containing instructions which, when run on a computer, cause the computer to perform a method of rendering a slide as described above.
Aiming at the prior art, the application has the following advantages:
according to the embodiment of the application, the first content of the original slide is copied into the target slide template according to the target slide template by acquiring the variable information about the target slide template, so that the target slide containing the first content is obtained, the second content in the first target page of the target slide is translated according to the target language corresponding to the target slide template and the variable information, the target content conforming to the target language grammar format is obtained, the first target page is rendered according to the target content, and the rendered second target page is obtained, therefore, the target slide can be translated and rendered automatically through the target language corresponding to the target slide template, the workload can be reduced, the format of the target slide is written more flexibly, the degree of freedom is higher, and finally the diversified slide presentation effect is realized.
The foregoing description is only an overview of the present application, and is intended to be implemented in accordance with the teachings of the present application in order that the same may be more clearly understood and to make the same and other objects, features and advantages of the present application more readily apparent.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments will be briefly described below.
Fig. 1 is a flow chart of a slide rendering method according to an embodiment of the present application;
FIG. 2 is a schematic diagram of a selection interface of a target slide template according to an embodiment of the present application;
fig. 3 is a specific flow diagram of a slide rendering method according to an embodiment of the present application;
FIG. 4 is a schematic diagram of a page before slide rendering according to an embodiment of the present application;
FIG. 5 is a schematic diagram of a page rendered by a slide according to an embodiment of the present application;
fig. 6 is a block diagram of a slide rendering apparatus according to an embodiment of the present application;
fig. 7 is a block diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all embodiments of the application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
The terms first, second and the like in the description and in the claims, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged, as appropriate, such that embodiments of the present application may be implemented in sequences other than those illustrated or described herein, and that the objects identified by "first," "second," etc. are generally of a type, and are not limited to the number of objects, such as the first object may be one or more. Furthermore, in the description and claims, "and/or" means at least one of the connected objects, and the character "/", generally means that the associated object is an "or" relationship.
As shown in fig. 1, an embodiment of the present application provides a slide rendering method, where the method includes:
step 101, variable information about a target slide template is acquired.
Alternatively, the variable information may include, but is not limited to, the following: variable name and variable content.
Specifically, parameter entering calculation is performed according to service requirements, program writing content of a target slide template and the like, and variable information such as variable names, variable content and the like can be obtained.
It should be noted that the target slide template is one of a plurality of slide templates selected by the user according to the service requirement and the technical requirement.
And 102, copying first content of an original slide into the target slide template according to the target slide template to obtain a target slide containing the first content.
Specifically, in the step 102, the content (i.e., the first content) in the original slide is copied to the target slide template, so that a target slide including the content in the original slide may be obtained. In other words, the target slide is a slide formed by adding the first content in the target slide template.
And step 103, translating the second content in the first target page of the target slide according to the target language corresponding to the target slide template and the variable information to obtain target content conforming to the grammar format of the target language.
Specifically, in step 103, the target language used by the target slide template may be directly applied, the translator is used to translate the content (i.e., the second content) in one of the pages (i.e., the first target page) in the target slide, and by inputting the variable information, the second content may be directly translated and replaced, so as to obtain the target content conforming to the grammar format of the target language. In other words, the target content is translated from the second content and conforms to the syntax format of the target language.
Specifically, the second content in the first target page of the target slide is translated, only the content part is replaced, the format is reserved, and operations such as circulation, judgment and the like are mainly supported, namely the original format is not influenced, and the modification degree of freedom is higher. The target language may be set as required, for example: the Jinja2 language, jinja2 is the dominant template language in the programming of the computer programming language Python global Wide area network (Web).
It should be noted that the first content and the second content may be subordinate relations, that is, the first content includes the second content; or the first content and the second content are the same content, i.e. the target slide has only one page of content.
And 104, rendering the first target page according to the target content to obtain a rendered second target page.
Specifically, in step 104, the first target page where the target content is located may be rendered according to the target content, so as to obtain a second target page after rendering. In other words, the second target page is obtained after the first target page is rendered.
It should be noted that the above embodiment of the present application may be mainly applied to a platform integrating collaboration services of clients of an organization, where the platform has a main function of cleaning and processing the first content of the original slide into required data by a series of calculations based on the service input parameters (such as start date, report date, calculation tool, etc.) by a stream engine, and implementing various forms of data application, transformation, copying, etc. of the report according to the slide template (i.e. target slide template) customized by the service. Before the system is applied, customer service personnel and sales personnel manually go to the system to take the number, combine, calculate, compare and the like, and the system is assisted by a form formula and the like, but still takes a plurality of hours, the generated report still needs to be manually regulated, and the platform is automatically generated, so that the workload of business personnel on the customer report is greatly relieved, errors caused by manual calculation and inquiry are avoided, and the functions of simplifying the business process, improving the user experience, improving the timeliness, saving the manpower, improving the system stability, improving the core system function and the like are realized.
In the above embodiment of the present application, by acquiring variable information about a target slide template, copying first content of an original slide into the target slide template according to the target slide template to obtain a target slide including the first content, translating second content in a first target page of the target slide according to a target language corresponding to the target slide template and the variable information to obtain target content conforming to a grammar format of the target language, and rendering the first target page according to the target content to obtain a rendered second target page, thereby, not only reducing workload, but also enabling format writing of the target slide to be more flexible and having higher degree of freedom, and finally realizing diversified slide presentation effects.
Optionally, in step 102, copying the first content of the original slide into the target slide template according to the target slide template to obtain a target slide containing the first content may specifically include:
copying the first content of the original slide into a memory;
and sorting the first content according to the target slide template, and copying the sorted first content to different pages of the target slide template to obtain a target slide containing the first content.
Specifically, first content of an original slide is copied into a memory, then the first content in the memory can be paged according to a target slide template selected by a user, and the paged first content is copied into different pages of the target slide to obtain the target slide containing the first content. In other words, the first content is distributed in different pages of the target slide, facilitating translation and rendering of the different pages of the target slide, respectively.
Optionally, before the step 103, the method may further include:
performing format conversion processing on the third content in the first target page to obtain a decomposition element;
and preprocessing the decomposition elements according to the target language corresponding to the target slide template to obtain second content conforming to the grammar format of the target language.
Specifically, after obtaining the target slide containing the first content, the third content contained in the first target page may be first subjected to format conversion processing, so as to obtain decomposed elements, such as: forms, pictures, etc.; and then, preprocessing the decomposition element according to the target language used by the target slide template, so that the decomposition element becomes a grammar format conforming to the target language, namely second content, so that the target language can be used for reading, the introduction of the template language is supported, and the data can be distinguished into different types for translation and rendering, thereby improving the efficiency and the accuracy.
The implementation manner of the preprocessing can be a preset regular LXML substitution manner, that is, a preset regular expression is used to perform regular substitution on the decomposed LXML format file (i.e., decomposed element). LXML is a file in extensible markup language (Extensible Markup Language, XML) or hypertext markup language (Hyper Text Markup Language, HTML) format.
The present application is not particularly limited herein.
Optionally, the preprocessing includes, but is not limited to, at least one of:
merging rendering table cells;
removing the blank space and tab;
the annotation is deleted.
Specifically, the preprocessing may implement a function of merging cells of the table in the decomposition element, or the preprocessing may implement a function of removing spaces and tabs of the table in the decomposition element, or the preprocessing may implement a function of deleting comments (may be a partial comment or may be a complete comment) in the decomposition element, and the like, which is not particularly limited herein.
Optionally, the step of performing format conversion processing on the third content in the first target page to obtain a decomposition element may specifically include:
performing format conversion processing on the third content in the first target page to obtain LXML format content;
and decomposing the LXML format content by using an Element Tree (ETREE) to obtain decomposed elements.
Specifically, the format of the third content in the first target page is converted into LXML format, that is, the third content is decomposed into LXML format content, so that objects included in the third content can be separated, for example: separated into a chart part, a text part and the like. After obtaining the LXML format content, decomposing the converted LXML format content by ETREEs, so as to obtain decomposition elements, such as: forms, pictures, etc. to facilitate identification. Among them, ETREE is a library written in python language for parsing tree element files, such as: XML, etc.
Optionally, the step 104 may render the first target page according to the target content to obtain a rendered second target page, which may specifically include:
converting the target content into LXML format target content;
and rendering the first target page according to the target content in the LXML format to obtain a rendered second target page.
Specifically, the target content obtained after translation is subjected to format conversion, converted back to the target content in the LXML format, and then the first target page is rendered according to the target content in the LXML format.
It should be noted that, in the above manner, all pages in the target slide are circularly rendered page by page until the translation and rendering of all pages are completed. In addition, the carrier attached to the embodiment can be an integrated platform of organization collaborative services, can also be provided for a jupyterhub (a jupyterNotook server supporting multiple users, used for creating, managing and acting on multiple interactive Notebook jupyterNotook instances, having expansibility and customizable) high-performance computing platform, and the like, can also be directly used by codes, and can be used in a form of appointed rendering templates and rendering data, and is not particularly limited.
Optionally, after the rendered second target page is obtained, if all the pages of the entire target slide are rendered, services such as downloading and sending mail can be provided.
The foregoing is described in detail by way of a specific example, but is not limited thereto:
the embodiment of the application can be applied to a mechanism customer collaborative service integrated platform and a plurality of embodiments thereof, and as shown in fig. 2, a selection interface schematic diagram of a selection target slide template is shown, taking an a 005-annuity casting manifold report PPT as an example, and input parameters thereof are as follows: creating process 21 (e.g., choose A005-yearly project report PPT), combination code 22 (e.g., choose AI0J 11-asset), calculation tool 23, report template 24, start date 25 (e.g., choose 2020-06-01), and report date 26 (e.g., choose 2020-06-30). Selecting the "universal standard version data processing script v2.3 containing distribution (only end of month data can be used)" in the calculation tool 23 in the input parameters to calculate the input parameters; after the input parameters are calculated, all the input parameters are filled into the target slide templates selected from the report templates 24 for implementing various forms of data application, deformation, copying, etc. of the report, wherein the selected report templates (i.e., the target slide templates) in fig. 2 are: template-202006-contains distribution (only end of month data can be used).
Besides the above application scenarios, the present application is also applicable to multiple scenarios such as pension reports, resource management client reports, bank client reports, etc., and is not limited in detail herein.
Referring to fig. 3, after copying the first content of the original slide into the memory, step 301 is performed to sort the slides, in other words, sort the first content according to the selected target slide template, and copy the first content after sorting into different pages of the target slide template, so as to obtain the target slide containing the first content, i.e. complete slide sorting.
Step 302, converting the third content in the first target page into LXML format content, in other words, converting the third content into format conversion processing, so as to obtain LXML format content.
And 303, decomposing the LXML format content by using an element tree library ETREE to obtain decomposed elements.
Step 304, preprocessing the decomposition element to obtain second content conforming to the grammar format of the target language; in other words, the decomposition element is preprocessed according to the target language corresponding to the target slide template, so as to obtain the second content conforming to the grammar format of the target language.
And 305, translating the second content according to the target language corresponding to the target slide template and the variable information, and obtaining the target content conforming to the grammar format of the target language.
Step 306, converting the target content into target content in LXML format.
And step 307, rendering the first target page according to the target content in the LXML format, so as to obtain a rendered second target page. And then carrying out cyclic processing according to the steps until all the pages are rendered.
As shown in fig. 4, which is a schematic diagram of a page before rendering, the steps 301 to 307 may be used to obtain a schematic diagram of a page after rendering as shown in fig. 5. The variable information is an array, each set of variable information is an array tuple, and as shown in fig. 5, the first array is the "fluidity asset" plus the latter is an array, and the code with tr before rendering is not displayed, only the judgment is made.
In fig. 4, the combined bin in the "for first ttype, subgroup in combined bin holding case" is a variable information name, which indicates that this variable information is circulated; each element in the array is inserted into a first type first and a subgroup subgrouping (only two contents per element), such as a first array (liquidity):
firsttype = liquidity asset;
subgrouping = [ { ' Primary category ', ' asset category ', ' monetary market fund ', ' market value ', ' 23255491.1 ', ' duty ratio ', ' aggregate duty ratio ', ' fluid asset ', ' asset category ', ' monetary pension product ', ' market value ', ' 137401953.6 ', ' duty ratio ', ' 4.2 ', ' aggregate duty ratio ', ' 8.5 ', ' Primary category ', ' asset category ', ' other fluid asset ', ' market value ', ' duty ratio ', ' total duty ratio ', ' 3.6 ', ' aggregate duty ratio ', ' and recycle subgrouping. Other arrays (e.g., fixed revenue-class assets, equity-class assets, etc.) are similar to the above-described forms and are not described in detail.
In "for item in subgroup" in fig. 4, taking the first element as an example, "item. First class classification" in fig. 4 is empty in fig. 5, i.e., there is no specific content; "item. Asset class" in FIG. 4 corresponds to the asset class monetary market fund in the liquidity asset of the asset class column in FIG. 5; "item. Market" in FIG. 4 corresponds to 23255491.1 in the liquidity asset of the market column in FIG. 5; "item. Duty" in FIG. 4 corresponds to 0.7 in the flow asset of the duty column in FIG. 5; the "item total duty" in fig. 4 is empty in fig. 5, that is, there is no specific content, and the whole process is to automatically and circularly display the content of the code in fig. 4, so that the workload can be reduced.
The above is only one rendering example, and in practice, the rendering example is only related to code logic and variable contents, and is not only capable of rendering according to the above conditions.
In summary, in the above embodiment of the present application, according to the target language and variable information corresponding to the target slide template, the second content in the first target page of the target slide is translated to obtain the target content conforming to the grammar format of the target language, and the first target page is rendered according to the target content to obtain the rendered second target page, so that the whole process does not need to be participated by a developer, and a large number of slides with similar formats can be repeatedly worked; if the business personnel need to modify the slide style, the format of the slide style is directly modified without the participation of developers; in addition, in general, the institution clients regularly need a relatively formal client report, and the report has certain characteristics, namely, the report is similar to a plurality of report content data contents, but the market is changed in a huge way, the investment direction changes in each month, and the follow-up investment viewpoint contents need to be updated regularly; if some macro analysis and other contents are needed to be added, the slide template is directly modified, the degree of freedom is higher, the method can be used for generating reports of various slide forms, and the output and conversion of various format data in the slide are realized.
As shown in fig. 6, a slide rendering apparatus 600 provided in an embodiment of the present application includes:
an acquisition module 601, configured to acquire variable information about a target slide template;
the copying module 602 is configured to copy, according to the target slide template, first content of an original slide into the target slide template, to obtain a target slide including the first content;
the translation module 603 is configured to translate, according to a target language corresponding to the target slide template and the variable information, the second content in the first target page of the target slide to obtain target content conforming to the grammar format of the target language;
and the rendering module 604 is configured to render the first target page according to the target content, so as to obtain a rendered second target page.
In the above embodiment of the present application, by acquiring variable information about a target slide template, copying first content of an original slide into the target slide template according to the target slide template to obtain a target slide including the first content, translating second content in a first target page of the target slide according to a target language corresponding to the target slide template and the variable information to obtain target content conforming to a grammar format of the target language, and rendering the first target page according to the target content to obtain a rendered second target page, thereby, not only reducing workload, but also enabling format writing of the target slide to be more flexible and having higher degree of freedom, and finally realizing diversified slide presentation effects.
Optionally, the replication module 602 includes:
the first copying unit is used for copying the first content of the original slide into the memory;
and the second copying unit is used for paging the first content according to the target slide template, and copying the paged first content to different pages of the target slide template to obtain a target slide containing the first content.
Optionally, the apparatus further includes:
the first processing module is used for performing format conversion processing on the third content in the first target page to obtain a decomposition element;
and the second processing module is used for preprocessing the decomposition elements according to the target language corresponding to the target slide template to obtain second content conforming to the grammar format of the target language.
Optionally, the first processing module includes:
the processing unit is used for carrying out format conversion processing on the third content in the first target page to obtain LXML format content;
and the decomposition unit is used for decomposing the LXML format content by using an element tree library ETREE to obtain decomposed elements.
Optionally, the rendering module 604 includes:
a conversion unit for converting the target content into target content in LXML format;
and the rendering unit is used for rendering the first target page according to the target content in the LXML format to obtain a rendered second target page.
Optionally, the preprocessing includes at least one of:
merging rendering table cells;
removing the blank space and tab;
the annotation is deleted.
Optionally, the variable information includes: variable name and variable content.
It should be noted that, the embodiment of the slide rendering device is a device corresponding to the slide rendering method, and all implementation manners of the embodiment of the method are applicable to the embodiment of the device, so that the same technical effects as those of the embodiment of the device can be achieved, and are not repeated herein.
In summary, in the above embodiment of the present application, according to the target language and variable information corresponding to the target slide template, the second content in the first target page of the target slide is translated to obtain the target content conforming to the grammar format of the target language, and the first target page is rendered according to the target content to obtain the rendered second target page, so that the whole process does not need to be participated by a developer, and a large number of slides with similar formats can be repeatedly worked; if the business personnel need to modify the slide style, the format of the slide style is directly modified without the participation of developers; in addition, in general, the institution clients regularly need a relatively formal client report, and the report has certain characteristics, namely, the report is similar to a plurality of report content data contents, but the market is changed in a huge way, the investment direction changes in each month, and the follow-up investment viewpoint contents need to be updated regularly; if some macro analysis and other contents are needed to be added, the slide template is directly modified, the degree of freedom is higher, the method can be used for generating reports of various slide forms, and the output and conversion of various format data in the slide are realized.
The embodiment of the application also provides an electronic device, as shown in fig. 7, which comprises a processor 701, a communication interface 702, a memory 703 and a communication bus 704, wherein the processor 701, the communication interface 702 and the memory 703 complete communication with each other through the communication bus 704.
A memory 703 for storing a computer program.
The processor 701 is configured to execute the program stored in the memory 703, and implement the following steps:
acquiring variable information about a target slide template;
copying first content of an original slide into the target slide template according to the target slide template to obtain a target slide containing the first content;
translating the second content in the first target page of the target slide according to the target language corresponding to the target slide template and the variable information to obtain target content conforming to the grammar format of the target language;
and rendering the first target page according to the target content to obtain a rendered second target page.
Optionally, when the processor 701 is configured to execute a program stored in the memory 703, the following steps are specifically implemented:
copying the first content of the original slide into a memory;
and sorting the first content according to the target slide template, and copying the sorted first content to different pages of the target slide template to obtain a target slide containing the first content.
Optionally, before translating the second content in the first target page of the target slide according to the target language corresponding to the target slide template and the variable information to obtain the target content conforming to the target language grammar format, when the processor 701 is configured to execute the program stored on the memory 703, the following steps are further implemented:
performing format conversion processing on the third content in the first target page to obtain a decomposition element;
and preprocessing the decomposition elements according to the target language corresponding to the target slide template to obtain second content conforming to the grammar format of the target language.
Optionally, when the processor 701 is configured to execute a program stored in the memory 703, the following steps are specifically implemented:
performing format conversion processing on the third content in the first target page to obtain LXML format content;
and decomposing the LXML format content by using an element tree library ETREE to obtain decomposed elements.
Optionally, when the processor 701 is configured to execute a program stored in the memory 703, the following steps are specifically implemented:
converting the target content into LXML format target content;
and rendering the first target page according to the target content in the LXML format to obtain a rendered second target page.
Optionally, the preprocessing includes at least one of:
merging rendering table cells;
removing the blank space and tab;
the annotation is deleted.
Optionally, the variable information includes: variable name and variable content.
The communication bus mentioned by the above electronic device may be a peripheral component interconnect standard (Peripheral Component Interconnect, abbreviated as PCI) bus or an extended industry standard architecture (Extended Industry Standard Architecture, abbreviated as EISA) bus, or the like. The communication bus may be classified as an address bus, a data bus, a control bus, or the like. For ease of illustration, the figures are shown with only one bold line, but not with only one bus or one type of bus.
The communication interface is used for communication between the terminal and other devices.
The memory may include random access memory (Random Access Memory, RAM) or non-volatile memory (non-volatile memory), such as at least one disk memory. Optionally, the memory may also be at least one memory device located remotely from the aforementioned processor.
The processor may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU for short), a network processor (Network Processor, NP for short), etc.; but also digital signal processors (Digital Signal Processing, DSP for short), application specific integrated circuits (Application Specific Integrated Circuit, ASIC for short), field-programmable gate arrays (Field-Programmable Gate Array, FPGA for short) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
In yet another embodiment of the present application, a computer-readable storage medium is provided, in which instructions are stored, which when run on a computer, cause the computer to perform the slide rendering method described in the above embodiment.
In a further embodiment of the present application, a computer program product containing instructions is also provided, which when run on a computer, causes the computer to perform the method of rendering slides described in the above embodiments.
In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, produces a flow or function in accordance with embodiments of the present application, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions may be stored in or transmitted from one computer-readable storage medium to another, for example, by wired (e.g., coaxial cable, optical fiber, digital Subscriber Line (DSL)), or wireless (e.g., infrared, wireless, microwave, etc.). The computer readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that contains an integration of one or more available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid State Disk (SSD)), etc.
It is noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
In this specification, each embodiment is described in a related manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for system embodiments, since they are substantially similar to method embodiments, the description is relatively simple, as relevant to see a section of the description of method embodiments.
The foregoing description is only of the preferred embodiments of the present application and is not intended to limit the scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application are included in the protection scope of the present application.

Claims (9)

1. A method of rendering a slide, comprising:
acquiring variable information about a target slide template;
copying first content of an original slide into the target slide template according to the target slide template to obtain a target slide containing the first content;
translating the second content in the first target page of the target slide according to the target language corresponding to the target slide template and the variable information to obtain target content conforming to the grammar format of the target language;
rendering the first target page according to the target content to obtain a rendered second target page;
before translating the second content in the first target page of the target slide according to the target language corresponding to the target slide template and the variable information to obtain target content conforming to the grammar format of the target language, the method further comprises:
performing format conversion processing on the third content in the first target page to obtain a decomposition element;
and preprocessing the decomposition elements according to the target language corresponding to the target slide template to obtain second content conforming to the grammar format of the target language.
2. The method of claim 1, wherein copying the first content of the original slide into the target slide template according to the target slide template to obtain a target slide containing the first content comprises:
copying the first content of the original slide into a memory;
and sorting the first content according to the target slide template, and copying the sorted first content to different pages of the target slide template to obtain a target slide containing the first content.
3. The method of claim 1, wherein the performing format conversion processing on the third content in the first target page to obtain a decomposition element includes:
performing format conversion processing on the third content in the first target page to obtain LXML format content;
and decomposing the LXML format content by using an element tree library ETREE to obtain decomposed elements.
4. The method of claim 3, wherein the rendering the first target page according to the target content to obtain a rendered second target page comprises:
converting the target content into LXML format target content;
and rendering the first target page according to the target content in the LXML format to obtain a rendered second target page.
5. The method of claim 1, wherein the pre-treatment comprises at least one of:
merging rendering table cells;
removing the blank space and tab;
the annotation is deleted.
6. The method of claim 1, wherein the variable information comprises: variable name and variable content.
7. A slide rendering apparatus, comprising:
the acquisition module is used for acquiring variable information about the target slide template;
the copying module is used for copying the first content of the original slide into the target slide template according to the target slide template to obtain a target slide containing the first content;
the translation module is used for translating the second content in the first target page of the target slide according to the target language corresponding to the target slide template and the variable information to obtain target content conforming to the grammar format of the target language;
the rendering module is used for rendering the first target page according to the target content to obtain a rendered second target page;
the first processing module is used for performing format conversion processing on the third content in the first target page to obtain a decomposition element;
and the second processing module is used for preprocessing the decomposition elements according to the target language corresponding to the target slide template to obtain second content conforming to the grammar format of the target language.
8. An electronic device, comprising: a processor, a communication interface, a memory, and a communication bus; the processor, the communication interface and the memory complete communication with each other through a communication bus;
a memory for storing a computer program;
a processor for implementing the steps in the slide rendering method according to any one of claims 1 to 6 when executing a program stored on a memory.
9. A computer-readable storage medium, on which a computer program is stored, characterized in that the program, when executed by a processor, implements a method of rendering a slide according to any one of claims 1 to 6.
CN202011150480.1A 2020-10-23 2020-10-23 Slide rendering method and device and electronic equipment Active CN112258607B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011150480.1A CN112258607B (en) 2020-10-23 2020-10-23 Slide rendering method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011150480.1A CN112258607B (en) 2020-10-23 2020-10-23 Slide rendering method and device and electronic equipment

Publications (2)

Publication Number Publication Date
CN112258607A CN112258607A (en) 2021-01-22
CN112258607B true CN112258607B (en) 2023-09-15

Family

ID=74261772

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011150480.1A Active CN112258607B (en) 2020-10-23 2020-10-23 Slide rendering method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN112258607B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106339363A (en) * 2015-07-07 2017-01-18 北京神州泰岳软件股份有限公司 PPT report making method and device
CN107783949A (en) * 2016-08-24 2018-03-09 北京神州泰岳软件股份有限公司 A kind for the treatment of method and apparatus of PPT documents
CN109815448A (en) * 2019-02-02 2019-05-28 天津字节跳动科技有限公司 Lantern slide generation method and device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8619088B2 (en) * 2010-03-31 2013-12-31 Blackberry Limited Slide preparation

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106339363A (en) * 2015-07-07 2017-01-18 北京神州泰岳软件股份有限公司 PPT report making method and device
CN107783949A (en) * 2016-08-24 2018-03-09 北京神州泰岳软件股份有限公司 A kind for the treatment of method and apparatus of PPT documents
CN109815448A (en) * 2019-02-02 2019-05-28 天津字节跳动科技有限公司 Lantern slide generation method and device

Also Published As

Publication number Publication date
CN112258607A (en) 2021-01-22

Similar Documents

Publication Publication Date Title
Trisovic et al. A large-scale study on research code quality and execution
CN109933752B (en) Method and device for exporting electronic document
CN110457439B (en) One-stop intelligent writing auxiliary method, device and system
AU2009238294B2 (en) Data transformation based on a technical design document
US8176412B2 (en) Generating formatted documents
US7568184B1 (en) Software documentation generator
US11792257B2 (en) Form engine
US20080028340A1 (en) Tree view for reusable data markup language
US20050198042A1 (en) Chart view for reusable data markup language
CN112905178B (en) Service function page generation method, device, equipment and medium
CN111126008B (en) Code generation method and device based on XSD, computer equipment and storage medium
CN112258607B (en) Slide rendering method and device and electronic equipment
CN115115353B (en) Document content-based approval and approval content generation method and device
CN117216042A (en) Construction method and device of data standardization platform
CN109542890B (en) Data modification method, device, computer equipment and storage medium
CN108228688B (en) Template generation method, system and server based on XBRL
KR20070062800A (en) Method for transforming of electronic document based on mapping rule and system thereof
CN115718754A (en) Electronic accounting archive data query method and device and electronic equipment
CN111882419B (en) Method and device for quality inspection of files and server
CN115579096A (en) Automatic generation and analysis verification method, system and storage medium for drug alert E2B R3 standard report
CN111435476A (en) Manuscript compiling processing method, device, equipment and storage medium
CN111221846B (en) Automatic translation method and device for SQL sentences
US20220350680A1 (en) Central Event Catalog
Romero Automated BCF Data Extraction For BIM QC Communication
KR20220052135A (en) Method for providing documentation service based on block editor, server and computer program thereof

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant