Method and device for generating ppt file, computer device and medium

By acquiring web and non-web data and using resource mapping tables to replace target element data to generate PPT files, the problem of generating PPT files without an office suite is solved, achieving fast and efficient file generation.

CN117112812BActive Publication Date: 2026-03-27XIAMEN HUANLEGUANG TECH CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-03
Publication Date
2026-03-27

AI Technical Summary

Technical Problem

Without a suitable office suite, it is difficult to generate PPT files in the current technology.

Method used

By acquiring web page data and/or non-web page data, determining the second target data based on attribute characteristics, replacing the target element data using a resource mapping table, and generating a PPT file.

Benefits of technology

It enables the quick and efficient generation of PPT files without the need for office suites, simplifying the file generation process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117112812B_ABST
    Figure CN117112812B_ABST
Patent Text Reader

Abstract

The present disclosure provides a PPT file generation method, device, computer equipment and medium, comprising: obtaining first target data, the first target data comprising; determining the second target data corresponding to the first target data based on the attribute characteristics of the first target data, the second target data comprising slide data for making a PPT file and content element data of the first target data, the content element data corresponding to the attribute characteristics; replace the resource data in the second target data based on the preset string to obtain the third target data, the resource data being used to describe the target element data in the second target data; determine the PPT file based on the target element data, the resource mapping table and the third target data. Thus, the third target data suitable for the PPT document is generated from the first target data, and the PPT file is generated by combining the target element data and the resource mapping table, so that the generation process is free from the shackles of office suites, and the PPT file can be quickly and effectively generated.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] Embodiments of the present disclosure relate to the technical field of data processing, and in particular, to a PPT file generation method and device, a computer device and a medium. BACKGROUND

[0002] PPT (PowerPoint) can be demonstrated on a projector or a computer, and can also be printed out to make a film for wider application. Using PPT can not only create a presentation, but also hold a face-to-face meeting, a remote meeting or an online presentation for an audience on the Internet.

[0003] In related technologies, when an external data is needed to make a PPT file, a corresponding office suite must be installed on a computer, a new PPT file without content is created by using the office suite, and relevant content is added to the PPT file to generate a complete PPT file.

[0004] However, the above implementation method is difficult to generate a PPT file without a corresponding office suite. SUMMARY

[0005] The embodiments described herein provide a PPT file generation method, device, computer device and medium, which overcome the above problems.

[0006] In a first aspect, according to the content of the present disclosure, a PPT file generation method is provided, comprising:

[0007] obtaining first target data, the first target data comprising web page data and / or non-web page data;

[0008] determining second target data corresponding to the first target data based on attribute features of the first target data, the second target data comprising slide data for making the PPT file and content element data of the first target data, the content element data corresponding to the attribute features;

[0009] replacing resource data in the second target data based on a preset string to obtain third target data, the resource data being used to describe target element data in the second target data, the target element data being data in the content element data, the target element data comprising pictures, texts, shapes or audio and video, and the string and the resource identifier of the target element data being stored in a resource mapping table in a one-to-one mapping manner;

[0010] determining the PPT file based on the target element data, the resource mapping table and the third target data.

[0011] In a second aspect, according to the content of the disclosure, a PPT file generation apparatus is provided, comprising:

[0012] An acquisition module is configured to acquire first target data, wherein the first target data comprises webpage data and / or non-webpage data.

[0013] A first determination module is configured to determine second target data corresponding to the first target data based on attribute features of the first target data, wherein the second target data comprises slide data for making the PPT file and content element data of the first target data, and the content element data corresponds to the attribute features.

[0014] A replacement module is configured to replace resource data in the second target data based on a preset string to obtain third target data, wherein the resource data is used to describe target element data in the second target data, the target element data is data in the content element data, the target element data comprises pictures, texts, shapes or audio and video, and the string and resource identifiers of the target element data are stored in a resource mapping table in a one-to-one mapping manner.

[0015] A second determination module is configured to determine the PPT file based on the target element data, the resource mapping table and the third target data.

[0016] In a third aspect, a computer device is provided, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements steps of the PPT file generation method in any one of the above embodiments when executing the computer program.

[0017] In a fourth aspect, a computer readable storage medium is provided, wherein the computer readable storage medium stores a computer program, and the computer program implements steps of the PPT file generation method in any one of the above embodiments when executed by a processor.

[0018] The method for generating a PPT file provided in the embodiments of the present application comprises the following steps: obtaining first target data, the first target data comprising webpage data and / or non-webpage data; determining second target data corresponding to the first target data based on attribute features of the first target data, the second target data comprising slide data for generating a PPT file and content element data of the first target data, the content element data corresponding to the attribute features; obtaining third target data by replacing resource data in the second target data with a preset string, the resource data being used to describe target element data in the second target data, the target element data being data in the content element data, the target element data comprising pictures, texts, shapes or audio and video, the string and resource identifiers of the target element data being stored in a resource mapping table in a one-to-one mapping manner; and determining a PPT file based on the target element data, the resource mapping table and the third target data. In this way, the third target data adapted to the PPT file is generated from the first target data, and the PPT file is generated in combination with the target element data and the resource mapping table, so that the generation process is free from the constraints of office suites and the PPT file can be quickly and effectively generated.

[0019] The above description is only a summary of the technical solutions of the embodiments of the present application. In order to more clearly understand the technical means of the embodiments of the present application, the embodiments of the present application can be implemented according to the content of the description, and in order to make the above and other purposes, features and advantages of the embodiments of the present application more obvious and easy to understand, the specific implementation manner of the present application will be described below. BRIEF DESCRIPTION OF DRAWINGS

[0020] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings of the embodiments will be briefly described below. It should be noted that the drawings described below only relate to some embodiments of the present application, but not limit the present application, wherein:

[0021] Figure 1 is a flowchart of a method for generating a PPT file provided by the present application.

[0022] Figure 2 is a structural diagram of a PPT file generation device provided by the present application.

[0023] Figure 3 is a structural diagram of a computer device provided by the present application.

[0024] It should be noted that the elements in the drawings are schematic and not drawn to scale. DETAILED DESCRIPTION

[0025] In order to make the objects, technical solutions and advantages of the embodiments of the present disclosure clearer, the following will clearly and completely describe the technical solutions of the embodiments of the present disclosure in conjunction with the drawings. Obviously, the described embodiments are part of the embodiments of the present disclosure, rather than all the embodiments. Based on the described embodiments of the present disclosure, all other embodiments obtained by a person of ordinary skill in the art without creative effort belong to the scope of protection of the present disclosure.

[0026] Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this present subject matter belongs. It will be further understood that terms, such as those defined in commonly used dictionaries, should be interpreted as having a meaning that is consistent with their meaning in the context of the specification and relevant art and will not be interpreted in an idealized or overly formal sense unless expressly so defined herein. As used herein, the statement that two or more parts are "connected" or "coupled" together refer to an indirect or direct connection or coupling.

[0027] Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the application. The appearances of the phrase "in an embodiment" in various places in the specification are not necessarily all referring to the same embodiment, nor are they necessarily mutually exclusive of one another. A person of ordinary skill in the art will readily recognize from the disclosure herein, given the total volume of this application that one or more passages that are described as an embodiment is / are also an embodiment of another embodiment.

[0028] The term "and / or", merely used as a description of associated objects, means that there can be three relationships, for example, A and / or B, which can represent the three cases of A existing, A and B existing, and B existing. In addition, the character " / " herein generally represents that the front and rear associated objects are in an "or" relationship. Terms such as "first" and "second" are merely used to distinguish one component (or part of a component) from another component (or another part of a component).

[0029] In the description of the present application, unless otherwise specified, the meaning of "a plurality of" is two or more (including two), and similarly, "a plurality of groups" means two or more groups (including two groups).

[0030] In order for those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings.

[0031] Figure 1 is a flowchart of a PPT file generation method provided by an embodiment of the present disclosure. As shown in Figure 1As shown, the specific process of the PPT file generation method includes:

[0032] S110, acquiring first target data.

[0033] The first target data includes web page data and / or non-web page data.

[0034] The web page data can be the content displayed in the page of the browser, or data describing the content. When acquiring the web page data, the browser can be operated by events such as mouse dragging / clicking to select the material content needed to make the PPT file as the first target data.

[0035] The non-web page data is content that is not acquired in the display page of the browser, which can be content acquired from other software.

[0036] It should be noted that when the first target data is web page data, the display form of the first target data can be in the form of text, image, audio and video, etc., and when the first target data is non-web page data, the display form of the first target data can be in the form of screenshot, paste, etc.

[0037] In some embodiments, based on the attribute characteristics of the first target data, the second target data corresponding to the first target data is determined, and the method can further include:

[0038] When the first target data is web page data, the attribute characteristics of the selected content elements are identified by using a preset interface in the browser to which the web page data belongs, to obtain the attribute characteristics of the first target data.

[0039] For example, when the first target data is web page data, the interface DOMAPI (such as Window.getComputedStyle()) in the browser to which the web page data belongs is used to read the attribute characteristics of one or more pre-selected contents, to obtain the attribute characteristics of the first target data.

[0040] When the first target data is non-web page data, the image information corresponding to the first target data is acquired, and the attribute characteristics of each content element in the image information are identified to obtain the attribute characteristics of the first target data.

[0041] For example, when the first target data is non-web page data, the non-web page data can be made into an image information by using screenshot or picture generation, and the attribute characteristics of each content element in the image information are identified by using image matching and other recognition algorithms to obtain the attribute characteristics of the first target data.

[0042] The attribute features of the first target data include: a type, a font, a font color, a font size, text content, a web canvas distance, a width, a height, a fill color, an outline color, or a shape path.

[0043] When the first target data is web data and non-web data, a preset interface in a browser to which the web data belongs is used to identify attribute features of the selected content elements to obtain web features, and image information corresponding to the first target data is obtained to identify attribute features of each content element in the image information to obtain non-web features, and repeated features in the web features and the non-web features are removed to obtain the attribute features of the first target data. Thus, when the combined data of the web data and the non-web data is used as the attribute features of the first target data, the data effectiveness of the attribute features is improved by removing the repeated features.

[0044] In S120, second target data corresponding to the first target data is determined based on the attribute features of the first target data.

[0045] The second target data is a temporary data generated by the first target data. The second target data includes slide data of a PPT file and content element data of the first target data.

[0046] The content element data corresponds to the attribute features. That is, the content element data is data corresponding to the content elements, and the attribute features can be understood as a description of the content elements. For example, when the attribute features are element font color, the content element data is blue.

[0047] In S130, resource data in the second target data is replaced based on a preset string to obtain third target data.

[0048] The resource data is used to describe target element data in the second target data, the target element data is data in the content element data, and the target element data can include: a picture (similar data), a word, a shape, or an audio / video. For example, the target element data includes a picture, a word, a shape, or an audio / video.

[0049]

[0050] The string and a resource identifier of the target element data are stored in a resource mapping table in a one-to-one correspondence. The resource identifier of the target element data can be, for example, a picture name. The resource identifier of the target element data and the string can be used to generate an XML data format resource mapping table.

[0051] In S140, a PPT file is determined based on the target element data, the resource mapping table, and the third target data.

[0052] The target element data is used to describe the resource data, the resource mapping table stores a resource representation of the target element data and a string replacing the target element data, the target element data in the third target data is replaced by the string, and the PPT file is generated by using the association among the target element data, the resource mapping table and the third target data.

[0053] In the embodiment, the first target data is obtained, the first target data includes web page data and / or non-web page data, second target data corresponding to the first target data is determined based on attribute features of the first target data, the second target data includes slide data of the PPT file and content element data of the first target data, the content element data corresponds to the attribute features, resource data in the second target data is replaced by a preset string to obtain third target data, the resource data is used to describe target element data in the second target data, the target element data is data in the content element data, the target element data includes pictures, texts, shapes or audio and video, the string and a resource identifier of the target element data are stored in a resource mapping table in a mutual mapping manner, and the PPT file is determined based on the target element data, the resource mapping table and the third target data. In this way, the third target data adapted to the PPT file is generated from the first target data, the PPT file is generated by combining the target element data and the resource mapping table, the generation process is independent of office suites, and the PPT file can be quickly and effectively generated.

[0054] In some embodiments, the second target data corresponding to the first target data is determined based on the attribute features of the first target data, and the method includes:

[0055] The content element data of the first target data is determined based on data corresponding to the attribute features of the first target data, and the slide data of the PPT file is determined based on element information included in the first target data, the slide data including the number of slides, the original width of the slides, the original height of the slides and the original background color of the slides.

[0056] In the determination of the content element data of the first target data based on the data corresponding to the attribute features of the first target data, the content element data of the first target data can be determined based on the data corresponding to the attribute features of the first target data and the type of the first target data. The data corresponding to the attribute features of the first target data can be a feature value of the attribute features of the first target data.

[0057] For example, when the type of the first target data is text, the content element data of the first target data can include the size of the text font, the color selection of the text, the type of the text font, the information of the text content, the distance value from the left side of the web page canvas and the distance value from the top of the web page canvas.

[0058] When the type of the first target data is a picture, the content element data of the first target data can include a distance value from the left edge of the webpage canvas, a distance value from the top of the webpage canvas, an image width value, an image height value, and a pixel value.

[0059] When the type of the first target data is a shape, the content element data of the first target data can include a distance value from the left edge of the webpage canvas, a distance value from the top of the webpage canvas, an image width value, an image height value, a fill color selection, an outline color selection, and specific path data of the shape.

[0060] The element information included in the first target data can include content elements and non-content elements in the first target data. It is worth noting that the content elements referred to herein are elements required for making the PPT file in the first target data, and the non-content elements are elements not required for making the PPT file in the first target data. The content elements and the non-content elements can be of the same type, i.e., when the content elements are text, the non-content elements can also be text. The number of pages of the slides in the slide data for making the PPT file can be determined by the element information included in the first target data.

[0061] The original width of the slide, the original height of the slide, and the original background color of the slide in the slide data can be pre-set, such as the original width of the slide being set to 25.4 cm, the original height of the slide being set to 14.29 cm, and the original background color of the slide being set to white.

[0062] Each page of the PPT file includes one or more content element data, and the content element data includes data corresponding to one element or data corresponding to multiple elements. For example, each page of the PPT file can include two content element data, and each content element data can include data corresponding to two elements.

[0063] For example, the determined second target data can be as follows:

[0064]

[0065]

[0066]

[0067] Therefore, the content element data of the first target data is determined by the attribute feature corresponding data of the first target data, and the slide data for making the PPT file is determined based on the element information included in the first target data, thereby effectively determining the second target data corresponding to the first target data.

[0068] In some embodiments, the PPT file is determined based on the target element data, the resource mapping table and the third target data, and includes:

[0069] The data format of the third target data is converted into an XML format to obtain third target data in the XML format; the target element data, the resource mapping table and the third target data in the XML format are compressed to obtain a target compressed package; and the file extension of the target compressed package is modified into a file extension corresponding to the PPT file to obtain the PPT file.

[0070] The data format of the third target data is converted into an XML format by using a format converter to obtain third target data in the XML format. The target element data, the resource mapping table and the third target data in the XML format are compressed by using a zip compression algorithm to obtain a zip format target compressed package. The.zip format of the target compressed package is modified into.pptx, and then the PPT file is quickly generated.

[0071] In some embodiments, the third target data in the XML format includes multiple pages of slides, each page of slide corresponds to a serial number identifier and a resource mapping table, and the serial number identifier of the slide is included in the storage file name of the resource mapping table. The storage file name of the resource mapping table can be slide{n}.xml, n is the serial number identifier of the slide, and the serial number identifier one-to-one corresponds to the serial number identifier in the resource mapping table.

[0072] The target element data, the resource mapping table and the third target data in the XML format are compressed to obtain a target compressed package, including:

[0073] Based on the serial number identifier corresponding to each slide, all resource mapping tables, target element data corresponding to the resource mapping tables and third target data in the XML format corresponding to the resource mapping tables are sequentially compressed to obtain a target compressed package.

[0074] Based on the serial number identifier corresponding to each slide, the multiple resource mapping tables, target element data corresponding to the resource mapping tables and third target data in the XML format corresponding to the resource mapping tables are sequentially arranged to obtain a generated document after sequential arrangement. The document is data-compressed to effectively obtain the target compressed package, thereby ensuring that the data sequence relationship between the finally generated PPT file and the first target data corresponds.

[0075] In some embodiments, after the target element data, the resource mapping table and the third target data in the XML format are compressed to obtain a target compressed package, the method of the present embodiment can further include:

[0076] When the file extension of the target compressed package is not successfully modified to the file extension corresponding to the PPT file, a pre-warning prompt information is generated, the pre-warning prompt information is used to describe an error indication in the modification process; based on the error indication in the modification process, modification error part information is modified until the file extension of the target compressed package after modification is successfully modified to the file extension corresponding to the PPT file, and the PPT file is obtained.

[0077] When the file extension of the target compressed package is not successfully modified to the file extension corresponding to the PPT file, a pre-warning prompt information is generated, the pre-warning prompt information is used to describe an error indication in the modification process; based on the error indication in the modification process, modification error part information is modified until the file extension of the target compressed package after modification is successfully modified to the file extension corresponding to the PPT file, and the PPT file is obtained.

[0078] In some embodiments, after the PPT file is determined, the embodiment method can further include:

[0079] Based on the type of the content element data in each slide, the original width, the original height and the original background color in each slide are updated; based on the similarity between the content data forms of each two connected slides, the switching effect between the two connected slides is updated, so as to update the PPT file.

[0080] For example, when the type of the content element data in the slide is text, the original width and the original height can be increased / decreased based on the text size; when the text size is less than a preset size threshold, the original width and the original height can be reduced; when the text size is greater than the preset size threshold, the original width and the original height can be increased. The original background color is adjusted to a light color, so as to ensure the font viewing effect of the PPT file.

[0081] When the type of the content element data in the slide is a picture, the original width and the original height can be increased / decreased based on the picture size; when the picture size exceeds a preset size threshold, the original width and the original height can be increased; when the picture size does not exceed the preset size threshold, the original width and the original height can be reduced. The original background color is adjusted to a color corresponding to the color of the picture, for example, when the picture background is white, the original background color is adjusted to blue.

[0082] The similarity between the content data forms of each two connected slides can be used to describe the content correlation between the two connected slides. Based on the similarity between the content data forms of each two connected slides, updating the transition effect between the two connected slides can include: when the numerical value of the similarity between the content data forms of each two connected slides is greater than a preset similarity threshold, adjusting the transition effect between the two connected slides to be fade-in / fade-out / no effect (page turning); when the numerical value of the similarity between the content data forms of each two connected slides is less than the preset similarity threshold, adjusting the transition effect between the two connected slides to be rotation cut-in / cut-out. Thus, the visual display effect of the PPT file can be improved, and the data correlation between two pages of slides can be implicitly prompted to the viewer.

[0083] Figure 2 A structural schematic diagram of a PPT file generation device provided in the embodiment is provided. The PPT file generation device can include an acquisition module 210, a first determination module 220, a replacement module 230, and a second determination module 240. Wherein:

[0084] The acquisition module 210 is configured to acquire first target data, wherein the first target data includes web page data and / or non-web page data.

[0085] The first determination module 220 is configured to determine second target data corresponding to the first target data based on attribute features of the first target data, wherein the second target data includes slide data for creating the PPT file and content element data of the first target data, and the content element data corresponds to the attribute features.

[0086] The replacement module 230 is configured to replace resource data in the second target data based on a preset string to obtain third target data, wherein the resource data is used to describe target element data in the second target data, the target element data is data in the content element data, the target element data includes pictures, texts, shapes, or audio and video, and the string and the resource identifier of the target element data are stored in a resource mapping table in a one-to-one mapping manner.

[0087] The second determination module 240 is configured to determine the PPT file based on the target element data, the resource mapping table, and the third target data.

[0088] In the embodiment, the third determination module can be further included.

[0089] The third determining module is configured to: when the first target data is the webpage data, identify attribute features of the selected content elements by using a preset interface in a browser to which the webpage data belongs, to obtain the attribute features of the first target data; when the first target data is the non-webpage data, obtain image information corresponding to the first target data, identify attribute features corresponding to each content element in the image information, to obtain the attribute features of the first target data; when the first target data is the webpage data and the non-webpage data, identify attribute features of the selected content elements by using a preset interface in a browser to which the webpage data belongs, to obtain webpage features; and obtain image information corresponding to the first target data, identify attribute features corresponding to each content element in the image information, to obtain non-webpage features; and remove repeated features in the webpage features and the non-webpage features, to obtain the attribute features of the first target data; wherein the attribute features of the first target data include: a type to which the first target data belongs, a font to which the first target data belongs, a font color, a font size, text content, a webpage canvas distance, a width, a height, a fill color, a stroke color, or a shape path.

[0090] In this embodiment, the first determining module 220 is configured to:

[0091] determine the content element data of the first target data based on attribute features of the first target data, and determine the slide data of the PPT file based on element information contained in the first target data, wherein the slide data includes: a number of slides, an original width of the slide, an original height of the slide, and an original background color of the slide; wherein each slide of the PPT file contains one or more content element data, and the content element data includes: data corresponding to one element or data corresponding to multiple elements.

[0092] In this embodiment, the second determining module 240 is configured to:

[0093] convert the data format of the third target data into an XML format to obtain the third target data in the XML format, compress the target element data, the resource mapping table, and the third target data in the XML format to obtain a target compression package, and modify a file extension of the target compression package into a file extension corresponding to the PPT file to obtain the PPT file.

[0094] In this embodiment, the third target data in the XML format includes: multiple slides, each slide corresponds to a serial number identifier and one resource mapping table, and the serial number identifier corresponding to the slide is included in a storage file name of the resource mapping table.

[0095] The second determining module 240 is specifically configured to:

[0096] Based on the serial number corresponding to each slide, sequentially compress all the resource mapping tables, the target element data corresponding to the resource mapping tables, and the third target data in the XML format corresponding to the data format of the resource mapping tables, to obtain the target compression package.

[0097] In this embodiment, the method further comprises an generating module and a modifying module.

[0098] The generating module is configured to generate a warning prompt information when the file extension of the target compression package is not successfully modified to the file extension corresponding to the PPT file, wherein the warning prompt information is used to describe an error indication in the modifying process.

[0099] The modifying module is configured to modify the error part information based on the error indication in the modifying process, until the file extension of the target compression package after the modification is successfully modified to the file extension corresponding to the PPT file, to obtain the PPT file.

[0100] In this embodiment, the method further comprises an updating module.

[0101] The updating module is configured to update the original width, the original height, and the original background color in each slide based on the type of the content element data in each slide, and update the switching effect between two connected slides based on the similarity between the content data forms of the two connected slides, to update the PPT file.

[0102] The PPT file generation apparatus provided by the present disclosure can execute the method embodiments, and the specific implementation principles and technical effects can be referred to the method embodiments, which will not be described here again.

[0103] The present disclosure also provides a computer device. For details, please refer to Figure 3 , Figure 3 The present disclosure also provides a computer device. For details, please refer to

[0104] The computer device includes a memory 310 and a processor 320 which are communicatively connected through a system bus. It is noted that only the computer device with components 310-320 is shown in the figure, but it is understood that not all of the shown components are required to be implemented, and more or less components can be alternatively implemented. Among them, those skilled in the art can understand that the computer device herein is a device capable of automatically performing numerical calculation and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), digital signal processors (DSPs), embedded devices, etc.

[0105] The computer device can be a desktop computer, a notebook computer, a palm computer, a cloud server, and the like. The computer device can interact with the user through a keyboard, a mouse, a remote controller, a touchpad, a voice control device, and the like.

[0106] The memory 310 includes at least one type of readable storage medium, including non-volatile memory or volatile memory, for example, flash memory, a hard disk, a multimedia card, a card-type memory (e.g., SD or DX memory, etc.), random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), a magnetic memory, a magnetic disk, an optical disk, etc. The RAM can include static RAM or dynamic RAM. In some embodiments, the memory 310 can be an internal storage unit of the computer device, for example, a hard disk or a memory of the computer device. In other embodiments, the memory 310 can also be an external storage device of the computer device, for example, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) card, or a flash card, etc. equipped on the computer device. Of course, the memory 310 can include both an internal storage unit and an external storage device of the computer device. In the present embodiment, the memory 310 is generally used to store an operating system and various application software installed on the computer device, for example, program codes of the above-described method, etc. In addition, the memory 310 can also be used to temporarily store various data that has been output or will be output.

[0107] The processor 320 is generally used to perform the overall operation of the computer device. In the present embodiment, the memory 310 is used to store program codes or instructions, which include computer operation instructions, and the processor 320 is used to execute the program codes or instructions stored in the memory 310 or process data, for example, run the program codes of the above-described method.

[0108] In this document, the bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, among others. The bus system can be a system of address, data, and control buses, for example. For the sake of presentation, the detailed wiring for bus transactions has been omitted, except for the interconnection of buses themselves. In practice, the bus transactions are often moved along multiple parallel lines using a variety of bus protocols.

[0109] Another embodiment of the present application further provides a computer readable medium, which can be a computer readable signal medium or a computer readable storage medium. A processor in a computer reads the computer readable program code stored in the computer readable medium, so that the processor can perform the function actions specified in each step or combination of steps in the above method; and generates a device implementing the function actions specified in each block or combination of blocks in the block diagram.

[0110] The computer readable medium includes, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or apparatus, or any suitable combination of the foregoing, for storing program codes or instructions, and the program codes include computer operation instructions. The processor is used to execute the program codes or instructions of the above method stored in the memory.

[0111] The definition of the memory and the processor can refer to the description of the foregoing computer device embodiment, which will not be repeated here.

[0112] In several embodiments provided in the present application, it should be understood that the disclosed system, device and method can be implemented in other ways. For example, the device embodiment described above is only schematic, for example, the division of the module or unit is only a logical function division, and actual implementation can have another division manner, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the displayed or discussed each other can be indirect coupling or communication connection through some interface, device or unit, which can be electrical, mechanical or other forms.

[0113] The function units or modules in each embodiment of the present application can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of software function unit.

[0114] If the integrated unit is implemented in the form of a software function unit and sold or used as an independent product, it can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application essentially or say the part that contributes to the prior art or the whole or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a number of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to execute all or part of the steps of the methods in the various embodiments of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various media that can store program codes.

[0115] In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The application can be implemented by means of both hardware and software, and any combination thereof. In the device claim enumerating several means, several of these means can be embodied by one and the same item of hardware. The mere fact that certain measures are recited in mutually different claims does not indicate that a combination of these measures cannot be used to advantage. The use of relative terms such as "first", "second" and "third", etc. does not connote any prioritization, but such terms are used to distinguish a certain feature from another feature with the same name. The steps of the methods described in the above embodiments should not be understood as necessarily limited in their sequence, except when this is explicitly specified.

[0116] The above embodiments are only used to illustrate the technical solutions of the present application, rather than limit them; even though the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: it can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement for part of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A method for generating a PPT file, characterized in that, include: Acquire first target data, which includes: web page data and / or non-web page data; Based on the attribute characteristics of the first target data, second target data corresponding to the first target data is determined. The second target data includes slide data for creating the PPT file and content element data of the first target data. The content element data corresponds to the attribute characteristics. When the type of the first target data is text, the content element data of the first target data includes: text font size, text color selection, text font type, text content information, distance from the left side of the webpage canvas, and distance from the top of the webpage canvas. When the type of the first target data is image, the content element data of the first target data includes: distance from the left side of the webpage canvas, distance from the top of the webpage canvas, image width, image height, and pixel values. When the type of the first target data is shape, the content element data of the first target data includes: distance from the left side of the webpage canvas, distance from the top of the webpage canvas, image width, image height, fill color selection, stroke color selection, and specific path data of the shape. The slide data includes: the number of slides, the original width of the slide, the original height of the slide, and the original background color of the slide. The resource data in the second target data is replaced by a preset string to obtain the third target data. The resource data is used to describe the target element data in the second target data. The target element data is the data in the content element data. The target element data includes: images, text, shapes, or audio and video. The strings and the resource identifiers of the target element data are mapped to each other and stored in a resource mapping table. When the target element data is an image, the resource identifier of the target element data is the image name. The PPT file is determined based on the target element data, the resource mapping table, and the third target data.

2. The method according to claim 1, characterized in that, Before determining the second target data corresponding to the first target data based on the attribute features of the first target data, the method further includes: When the first target data is the webpage data, a preset interface in the browser to which the webpage data belongs is used to identify the attribute features of the selected content element and obtain the attribute features of the first target data. When the first target data is the non-web page data, obtain the image information corresponding to the first target data, identify the attribute features corresponding to each content element in the image information, and obtain the attribute features of the first target data. When the first target data consists of the web page data and the non-web page data, a preset interface in the browser to which the web page data belongs is used to identify the attribute features of the selected content elements to obtain web page features; and image information corresponding to the first target data is obtained, and attribute features corresponding to each content element in the image information are identified to obtain non-web page features; duplicate features in the web page features and the non-web page features are removed to obtain the attribute features of the first target data. The attribute features of the first target data include: type, font, font color, font size, text content, webpage canvas distance, width, height, fill color, stroke color, or shape path.

3. The method according to claim 1, characterized in that, The step of determining the second target data corresponding to the first target data based on the attribute features of the first target data includes: Based on the data corresponding to the attribute features of the first target data, the content element data of the first target data is determined; Based on the element information contained in the first target data, determine the slide data for creating the PPT file; Each slide of the PPT file contains one or more content element data, which includes data corresponding to one element or data corresponding to multiple elements.

4. The method according to claim 3, characterized in that, The step of determining the PPT file based on the target element data, the resource mapping table, and the third target data includes: The data format of the third target data is converted into XML format to obtain the third target data in XML format; The target element data, the resource mapping table, and the third target data in XML format are compressed to obtain a target compressed package; The PPT file is obtained by changing the file extension of the target compressed package to the file extension corresponding to the PPT file.

5. The method according to claim 4, characterized in that, The third target data, which is in XML format, includes: multiple slides, each slide having a corresponding serial number identifier and a resource mapping table, wherein the filename of the resource mapping table includes the serial number identifier corresponding to the slide; The step of compressing the target element data, the resource mapping table, and the third target data in XML format to obtain a target compressed package includes: Based on the sequence number identifier corresponding to each slide, all the resource mapping tables, the target element data corresponding to the resource mapping tables, and the third target data in XML format corresponding to the resource mapping tables are sequentially compressed to obtain the target compressed package.

6. The method according to claim 4, characterized in that, Also includes: If the file extension of the target compressed package is not successfully changed to the file extension corresponding to the PPT file, an early warning message is generated. The early warning message is used to describe the error indication during the modification process. Based on the error indications during the modification process, the erroneous information is modified until the file extension of the target compressed package is successfully changed to the file extension corresponding to the PPT file, thus obtaining the PPT file.

7. The method according to claim 4, characterized in that, Also includes: Based on the type of the content element data in each slide, update the original width, original height, and original background color of each slide; Based on the similarity between the content data formats of each pair of connected slides, the transition effect between the two connected slides is updated to update the PPT file.

8. A device for generating PPT files, characterized in that, include: The acquisition module is used to acquire first target data, which includes web page data and / or non-web page data. A first determining module is used to determine second target data corresponding to the first target data based on the attribute features of the first target data. The second target data includes slide data for creating the PPT file and content element data of the first target data, wherein the content element data corresponds to the attribute features. When the type of the first target data is text, the content element data of the first target data includes: text font size, text color selection, text font type, text content information, distance from the left side of the webpage canvas, and distance from the top of the webpage canvas. When the type of the first target data is image, the content element data of the first target data includes: distance from the left side of the webpage canvas, distance from the top of the webpage canvas, image width, image height, and pixel values. When the type of the first target data is shape, the content element data of the first target data includes: distance from the left side of the webpage canvas, distance from the top of the webpage canvas, image width, image height, fill color selection, stroke color selection, and specific path data of the shape. The slide data includes: the number of slides, the original width of the slide, the original height of the slide, and the original background color of the slide. The replacement module is used to replace resource data in the second target data based on a preset string to obtain third target data. The resource data is used to describe target element data in the second target data. The target element data is data in the content element data, and the target element data includes: images, text, shapes, or audio / video. The string and the resource identifier of the target element data are mutually mapped and stored in a resource mapping table. When the target element data is an image, the resource identifier of the target element data is the image name. The second determining module is used to determine the PPT file based on the target element data, the resource mapping table, and the third target data.

9. A computer device, characterized in that, It includes a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the PPT file generation method as described in any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When a computer program is executed by a processor, it implements the method for generating a PPT file as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Method and device for converting XML document into PPTX document

    CN101963956A

  • Method, device and equipment for converting webpage into PPT (PowerPoint)

    CN114491097A