[go: up one dir, main page]

CN118607471A - Graphic typesetting method, device, computing device and machine-readable storage medium - Google Patents

Graphic typesetting method, device, computing device and machine-readable storage medium Download PDF

Info

Publication number
CN118607471A
CN118607471A CN202410862205.4A CN202410862205A CN118607471A CN 118607471 A CN118607471 A CN 118607471A CN 202410862205 A CN202410862205 A CN 202410862205A CN 118607471 A CN118607471 A CN 118607471A
Authority
CN
China
Prior art keywords
typesetting
template
target
image
graphic
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202410862205.4A
Other languages
Chinese (zh)
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.)
Zhongke Yungu Technology Co Ltd
Original Assignee
Zhongke Yungu Technology 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 Zhongke Yungu Technology Co Ltd filed Critical Zhongke Yungu Technology Co Ltd
Priority to CN202410862205.4A priority Critical patent/CN118607471A/en
Publication of CN118607471A publication Critical patent/CN118607471A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/103Formatting, i.e. changing of presentation of documents
    • G06F40/109Font handling; Temporal or kinetic typography
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/103Formatting, i.e. changing of presentation of documents
    • G06F40/106Display of layout of documents; Previewing
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • G06F40/186Templates
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/60Editing figures and text; Combining figures or text

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • General Engineering & Computer Science (AREA)
  • Processing Or Creating Images (AREA)
  • Document Processing Apparatus (AREA)

Abstract

本申请实施例公开了一种图文排版方法、装置、计算设备及机器可读存储介质,涉及图文处理技术领域。图文排版方法包括:响应接收到的图文编辑指令,确定用户插入的图文内容;确定图文内容对应的主题关键词;获取主题关键词对应的第一数量的排版模板;根据第一数量的排版模板分别对图文内容进行排版,生成第一数量的排版预览界面;确定用户基于排版预览界面选择的目标排版模板;基于目标排版模板对图文内容进行排版,生成图文内容的排版结果。可以根据图文内容对应的主题,获取不同的排版模板,不仅提高了图文内容的排版样式的多样性,还能够对应实际的图文内容进行排版,提高了排版后图文内容的视觉效果。

The embodiments of the present application disclose a graphic typesetting method, device, computing device and machine-readable storage medium, and relate to the field of graphic processing technology. The graphic typesetting method includes: responding to a received graphic editing instruction, determining the graphic content inserted by the user; determining the subject keywords corresponding to the graphic content; obtaining a first number of typesetting templates corresponding to the subject keywords; typeset the graphic content according to the first number of typesetting templates, and generating a first number of typesetting preview interfaces; determining the target typesetting template selected by the user based on the typesetting preview interface; typeset the graphic content based on the target typesetting template, and generating a typesetting result of the graphic content. Different typesetting templates can be obtained according to the subject corresponding to the graphic content, which not only improves the diversity of the typesetting style of the graphic content, but also can typeset corresponding to the actual graphic content, thereby improving the visual effect of the graphic content after typeset.

Description

图文排版方法、装置、计算设备及机器可读存储介质Graphic typesetting method, device, computing device and machine-readable storage medium

技术领域Technical Field

本申请涉及图文处理技术领域,具体地涉及一种图文排版方法、装置、计算设备及机器可读存储介质。The present application relates to the field of image and text processing technology, and specifically to an image and text typesetting method, device, computing equipment and machine-readable storage medium.

背景技术Background Art

随着信息技术的快速发展,电子文档形式的图文内容逐步取代了纸质文档。若采用自定义的方式进行图文排版,需要开发人员利用HTML(Hyper Text Markup Language,超文本标记语言)等前端技术进行编程。实际的图文排版场景中,大部分用户通常不具备编程能力。用户过于依赖开发人员和UI(User Interface,用户界面)设计人员对提供的图文内容进行排版,使得图文内容的排版效率低下。With the rapid development of information technology, graphic content in the form of electronic documents has gradually replaced paper documents. If a customized approach is used for graphic typesetting, developers need to use front-end technologies such as HTML (Hyper Text Markup Language) for programming. In actual graphic typesetting scenarios, most users usually do not have programming capabilities. Users rely too much on developers and UI (User Interface) designers to typeset the provided graphic content, making the typesetting efficiency of graphic content low.

为了提高图文内容的排版效率,通常用户会利用预先提供排版模板进行图文排版。排版模板在固定位置上预留有可编辑区域,用户可以对可编辑区域进行插入图文内容等操作,进而实现对图文内容的排版。然而,通常提供的排版模板的样式单一,使得图文内容的排版样式重复度过高,进而导致图文内容的排版样式的多样性过低。In order to improve the typesetting efficiency of graphic content, users usually use pre-provided typesetting templates to typeset graphic content. The typesetting template reserves an editable area at a fixed position, and the user can insert graphic content into the editable area to achieve typesetting of the graphic content. However, the typesetting templates usually provided have a single style, which makes the typesetting style of graphic content too repetitive, and thus leads to too low diversity of typesetting styles of graphic content.

发明内容Summary of the invention

本申请实施例的目的是提供一种图文排版方法、装置、计算设备及机器可读存储介质,图文排版方法用以解决现有技术中图文内容的排版样式的多样性过低。The purpose of the embodiments of the present application is to provide a graphic typesetting method, apparatus, computing device and machine-readable storage medium, wherein the graphic typesetting method is used to solve the problem that the diversity of typesetting styles of graphic content in the prior art is too low.

为了实现上述目的,本申请第一方面提供一种图文排版方法,图文排版方法包括:In order to achieve the above-mentioned purpose, the first aspect of the present application provides a method for typesetting a graphic and text, and the method for typesetting a graphic and text comprises:

响应接收到的图文编辑指令,确定用户插入的图文内容;In response to the received graphic editing instruction, determine the graphic content inserted by the user;

确定图文内容对应的主题关键词;Determine the subject keywords corresponding to the graphic content;

获取主题关键词对应的第一数量的排版模板;Obtain a first number of layout templates corresponding to the subject keywords;

根据第一数量的排版模板分别对图文内容进行排版,生成第一数量的排版预览界面;Typesetting the graphic and text contents respectively according to the first number of typesetting templates, and generating a first number of typesetting preview interfaces;

确定用户基于排版预览界面选择的目标排版模板;Determine the target layout template selected by the user based on the layout preview interface;

基于目标排版模板对图文内容进行排版,生成图文内容的排版结果。The graphic content is typeset based on the target typesetting template to generate a typesetting result of the graphic content.

本申请的实施例中,图文排版方法还包括:In an embodiment of the present application, the graphic typesetting method further includes:

响应接收到的模板编辑指令,根据用户对目标排版模板的编辑操作,得到目标排版模板的更新信息;In response to the received template editing instruction, according to the user's editing operation on the target typesetting template, the update information of the target typesetting template is obtained;

基于目标排版模板的更新信息,得到更新后的排版结果。Based on the updated information of the target typesetting template, an updated typesetting result is obtained.

本申请的实施例中,基于目标排版模板的更新信息,得到更新后的排版结果,包括:In an embodiment of the present application, based on the update information of the target typesetting template, an updated typesetting result is obtained, including:

基于目标排版模板的更新信息,得到更新后的排版结果,并将目标排版模板的更新计数加一;Based on the update information of the target typesetting template, an updated typesetting result is obtained, and the update count of the target typesetting template is increased by one;

图文排版方法还包括:Graphics and text layout methods also include:

在更新计数超过预设阈值的情况下,基于目标排版模板对应的所有更新信息,更新目标排版模板。When the update count exceeds a preset threshold, the target layout template is updated based on all update information corresponding to the target layout template.

本申请的实施例中,基于目标排版模板对图文内容进行排版,生成图文内容的排版结果,包括:In the embodiment of the present application, the graphic content is typeset based on the target typesetting template to generate a typesetting result of the graphic content, including:

解析图文内容对应的HTML文档,得到HTML结构和至少一个HTML元素;Parse the HTML document corresponding to the graphic content to obtain the HTML structure and at least one HTML element;

根据HTML结构和所有HTML元素,构建图文内容对应的DOM树,其中,DOM树包括至少一个节点,且每个节点对应一个HTML元素;According to the HTML structure and all HTML elements, a DOM tree corresponding to the graphic content is constructed, wherein the DOM tree includes at least one node, and each node corresponds to an HTML element;

基于目标排版模板对应DOM树进行计算与布局,得到待渲染DOM树;Calculate and layout the DOM tree corresponding to the target layout template to obtain the DOM tree to be rendered;

渲染待渲染DOM树的中节点,生成图文内容的排版结果;Render the middle node of the DOM tree to be rendered and generate the layout result of the graphic content;

图文排版方法还包括:Graphics and text layout methods also include:

响应接收到的图文内容编辑指令,根据用户对图文内容的编辑操作,得到更新后的图文内容;In response to the received graphic content editing instruction, according to the user's editing operation on the graphic content, an updated graphic content is obtained;

基于更新后的图文内容,更新待渲染DOM树;Based on the updated graphic content, update the DOM tree to be rendered;

渲染更新后的待渲染DOM树的中节点,得到更新后的排版结果。Render the updated middle node of the DOM tree to be rendered to obtain the updated layout result.

本申请的实施例中,获取主题关键词对应的第一数量的排版模板,包括:In an embodiment of the present application, obtaining a first number of layout templates corresponding to the subject keywords includes:

获取主题关键词对应的第二数量的排版模板,并分别获取每个排版模板的使用计数;Obtain a second number of typesetting templates corresponding to the subject keyword, and respectively obtain a usage count of each typesetting template;

根据所有排版模板的使用计数,从第二数量的排版模板中筛选出第一数量的排版模板;Filtering the first number of layout templates from the second number of layout templates according to usage counts of all layout templates;

确定用户基于排版预览界面选择的目标排版模板,包括:Determine the target layout template selected by the user based on the layout preview interface, including:

确定用户基于排版预览界面选择的目标排版模板,并更新目标排版模板的使用计数。Determine the target layout template selected by the user based on the layout preview interface, and update the usage count of the target layout template.

本申请的实施例中,生成第一数量的排版预览界面之后,还包括:In an embodiment of the present application, after generating the first number of layout preview interfaces, the method further includes:

响应接收到的额外模板预览请求,生成第三数量的排版预览界面,其中,第三数量大于第一数量,且小于或等于第二数量。In response to the received additional template preview request, a third number of layout preview interfaces is generated, wherein the third number is greater than the first number and less than or equal to the second number.

本申请的实施例中,确定图文内容对应的主题关键词,包括:In the embodiment of the present application, determining the subject keywords corresponding to the graphic content includes:

获取图文内容对应的至少一个排版关键词;Obtain at least one layout keyword corresponding to the graphic content;

根据所有的排版关键词,确定图文内容对应的主题关键词。Based on all the typesetting keywords, determine the theme keywords corresponding to the graphic content.

本申请第二方面提供一种图文排版装置,图文排版装置包括:A second aspect of the present application provides a graphic typesetting device, the graphic typesetting device comprising:

图文内容确定模块,用于响应接收到的图文编辑指令,确定用户插入的图文内容;The graphic content determination module is used to respond to the received graphic editing instruction and determine the graphic content inserted by the user;

关键词确定模块,用于确定图文内容对应的主题关键词;A keyword determination module is used to determine the subject keywords corresponding to the graphic content;

排版模板获取模块,用于获取主题关键词对应的第一数量的排版模板;A typesetting template acquisition module, used to acquire a first number of typesetting templates corresponding to the subject keyword;

预览界面生成模块,用于根据第一数量的排版模板分别对图文内容进行排版,生成第一数量的排版预览界面;A preview interface generation module, used to typeset the graphic content according to a first number of typesetting templates, and generate a first number of typesetting preview interfaces;

排版模板确定模块,用于确定用户基于排版预览界面选择的目标排版模板;A layout template determination module is used to determine a target layout template selected by a user based on a layout preview interface;

排版结果生成模块,用于基于目标排版模板对图文内容进行排版,生成图文内容的排版结果。The typesetting result generation module is used to typeset the graphic content based on the target typesetting template and generate the typesetting result of the graphic content.

本申请第三方面提供一种计算设备,包括:A third aspect of the present application provides a computing device, including:

存储器,被配置成存储指令;以及a memory configured to store instructions; and

处理器,被配置成从存储器调用指令以及在执行指令时能够实现上述的图文排版方法。The processor is configured to call instructions from the memory and implement the above-mentioned graphic typesetting method when executing the instructions.

本申请第四方面提供一种机器可读存储介质,该机器可读存储介质上存储有指令,该指令用于使得机器执行上述的图文排版方法。A fourth aspect of the present application provides a machine-readable storage medium having instructions stored thereon, the instructions being used to enable a machine to execute the above-mentioned graphic typesetting method.

本申请提供一种图文排版方法,图文排版方法包括:响应接收到的图文编辑指令,确定用户插入的图文内容;确定图文内容对应的主题关键词;获取主题关键词对应的第一数量的排版模板;根据第一数量的排版模板分别对图文内容进行排版,生成第一数量的排版预览界面;确定用户基于排版预览界面选择的目标排版模板;基于目标排版模板对图文内容进行排版,生成图文内容的排版结果。利用排版模板对图文内容进行排版,提高了图文排版的效率。同时,可以根据图文内容对应的主题,获取不同的排版模板,不仅提高了图文内容的排版样式的多样性,还能够对应实际的图文内容进行排版,提高了排版后图文内容的视觉效果。The present application provides a graphic typesetting method, which includes: responding to a received graphic editing instruction, determining the graphic content inserted by the user; determining the subject keywords corresponding to the graphic content; obtaining a first number of typesetting templates corresponding to the subject keywords; typeset the graphic content according to the first number of typesetting templates, and generating a first number of typesetting preview interfaces; determining a target typesetting template selected by the user based on the typesetting preview interface; typeset the graphic content based on the target typesetting template, and generating a typesetting result of the graphic content. Typesetting the graphic content using the typesetting template improves the efficiency of graphic typesetting. At the same time, different typesetting templates can be obtained according to the subject corresponding to the graphic content, which not only improves the diversity of the typesetting style of the graphic content, but also can typeset corresponding to the actual graphic content, thereby improving the visual effect of the graphic content after typesetting.

本申请实施例的其它特征和优点将在随后的具体实施方式部分予以详细说明。Other features and advantages of the embodiments of the present application will be described in detail in the subsequent specific implementation section.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

附图是用来提供对本申请实施例的进一步理解,并且构成说明书的一部分,与下面的具体实施方式一起用于解释本申请实施例,但并不构成对本申请实施例的限制。在附图中:The accompanying drawings are used to provide a further understanding of the embodiments of the present application and constitute a part of the specification. Together with the following specific implementations, they are used to explain the embodiments of the present application, but do not constitute a limitation on the embodiments of the present application. In the accompanying drawings:

图1示意性示出了根据本申请实施例的图文排版方法的第一种流程示意图;FIG1 schematically shows a first flow chart of a method for typesetting text and images according to an embodiment of the present application;

图2示意性示出了根据本申请实施例的图文排版方法的第二种流程示意图;FIG2 schematically shows a second flow chart of the method for typesetting text and images according to an embodiment of the present application;

图3示意性示出了根据本申请实施例的获取排版模板的应用示例图;FIG3 schematically shows an example diagram of an application of obtaining a typesetting template according to an embodiment of the present application;

图4示意性示出了根据本申请实施例的图文排版装置的结构示意图。FIG4 schematically shows a structural diagram of a graphic typesetting device according to an embodiment of the present application.

具体实施方式DETAILED DESCRIPTION

为使本申请实施例的目的、技术方案和优点更加清楚,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,应当理解的是,此处所描述的具体实施方式仅用于说明和解释本申请实施例,并不用于限制本申请实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动的前提下所获得的所有其他实施例,都属于本申请保护的范围。In order to make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. It should be understood that the specific implementation methods described herein are only used to illustrate and explain the embodiments of the present application, and are not used to limit the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

需要说明,若本申请实施例中有涉及方向性指示,则该方向性指示仅用于解释在某一特定姿态(如附图所示)下各部件之间的相对位置关系、运动情况等,如果该特定姿态发生改变时,则该方向性指示也相应地随之改变。It should be noted that if directional indication is involved in the embodiments of the present application, the directional indication is only used to explain the relative position relationship, movement status, etc. between the components under a certain specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indication will also change accordingly.

另外,若本申请实施例中有涉及“第一”、“第二”等的描述,则该“第一”、“第二”等的描述仅用于描述目的,而不能理解为指示或暗示其相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括至少一个该特征。另外,各个实施例之间的技术方案可以相互结合,但是必须是以本领域普通技术人员能够实现为基础,当技术方案的结合出现相互矛盾或无法实现时应当认为这种技术方案的结合不存在,也不在本申请要求的保护范围之内。In addition, if there are descriptions involving "first", "second", etc. in the embodiments of the present application, the descriptions of "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or suggesting their relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in the field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such combination of technical solutions does not exist and is not within the scope of protection required by this application.

实施例一Embodiment 1

请参阅图1,图1示意性示出了根据本申请实施例的图文排版方法的第一种流程示意图。如图1所示,本申请实施例提供一种图文排版方法,图文排版方法包括下列步骤:Please refer to Figure 1, which schematically shows a first flow chart of a method for typesetting text and images according to an embodiment of the present application. As shown in Figure 1, an embodiment of the present application provides a method for typesetting text and images, and the method for typesetting text and images includes the following steps:

S110,响应接收到的图文编辑指令,确定用户插入的图文内容。S110, responding to the received graphic and text editing instruction, determining the graphic and text content inserted by the user.

本申请的图文排版方法应用于计算设备,本实施例中的计算设备提供图文内容的编辑器。编辑器通常是指用于创建和编辑包含文本、图片、视频等内容的工具或平台。通常编辑器提供了直观的编辑器界面,用户可以直接在编辑器界面进行操作,生成图文编辑指令,进而使得用户无需学习编程技术。计算设备响应接收的图文编辑指令,确定用户插入的图文内容,以及图文内容的类型。图文内容的类型是根据实际需求设置的,可以是文本和图片等,在此不做限定。The graphic typesetting method of the present application is applied to a computing device, and the computing device in the present embodiment provides an editor for graphic content. An editor generally refers to a tool or platform for creating and editing content including text, pictures, videos, etc. Usually, the editor provides an intuitive editor interface, and the user can directly operate in the editor interface to generate graphic editing instructions, thereby eliminating the need for the user to learn programming techniques. The computing device responds to the received graphic editing instructions to determine the graphic content inserted by the user, as well as the type of graphic content. The type of graphic content is set according to actual needs, and can be text, pictures, etc., which is not limited here.

S120,确定图文内容对应的主题关键词。S120, determining the subject keywords corresponding to the graphic content.

所有图文内容均完成插入之后,确定图文内容对应的主题关键词。需要理解的是,可以是用户人工根据图文内容确定主题关键词,也可以是利用机器学习算法对图文内容进行识别,并得到机器学习算法输出的主题关键词,进而确定图文内容对应的主题关键词,在此不做赘述。主题关键词的字词内容是根据实际需求设置的,可以是美食、旅行及学术等字词内容,在此不做限定。After all the graphic and text content has been inserted, determine the subject keywords corresponding to the graphic and text content. It should be understood that the user can manually determine the subject keywords based on the graphic and text content, or use a machine learning algorithm to identify the graphic and text content and obtain the subject keywords output by the machine learning algorithm, and then determine the subject keywords corresponding to the graphic and text content. I will not go into details here. The word content of the subject keyword is set according to actual needs, and can be words such as food, travel, and academics, which are not limited here.

本申请的实施例中,确定图文内容对应的主题关键词,包括:In the embodiment of the present application, determining the subject keywords corresponding to the graphic content includes:

获取图文内容对应的至少一个排版关键词;Obtain at least one layout keyword corresponding to the graphic content;

根据所有的排版关键词,确定图文内容对应的主题关键词。Based on all the typesetting keywords, determine the theme keywords corresponding to the graphic content.

为了得到与图文内容匹配的主题关键词,根据图文内容获取至少一个排版关键词。根据所有的排版关键词一并分析图文内容对应的主题,确定图文内容对应的主题关键词。具体地,假设获取到的排版关键词为“米饭”和“蔬菜”,在所有的排版关键词对应着同一个主题的情况下,根据所有的排版关键词,确定图文内容对应的主题关键词为“美食”。假设获取到的排版关键词为“美食”和“旅行”,由于每个排版关键词分别对应一个主题,将所有的排版关键词进行合并,确定图文内容对应的主题关键词为“美食旅行”。In order to obtain the theme keywords that match the graphic content, obtain at least one typesetting keyword based on the graphic content. Analyze the themes corresponding to the graphic content based on all the typesetting keywords, and determine the theme keywords corresponding to the graphic content. Specifically, assuming that the obtained typesetting keywords are "rice" and "vegetables", when all the typesetting keywords correspond to the same theme, determine that the theme keywords corresponding to the graphic content are "food" based on all the typesetting keywords. Suppose that the obtained typesetting keywords are "food" and "travel", since each typesetting keyword corresponds to a theme, all the typesetting keywords are merged to determine that the theme keywords corresponding to the graphic content are "food travel".

S130,获取主题关键词对应的第一数量的排版模板。S130, obtaining a first number of typesetting templates corresponding to the subject keywords.

通常图文的排版场景中提供的排版模板的样式单一,所有类型的图文内容均通过样式单一的排版模板进行排版,使得图文内容的排版样式重复度过高,进而导致图文内容的排版样式的多样性过低。本申请的实施例中,UI设计师等开发人员预先确定多个主题关键词,并对应每个主题关键词设计好多个排版模板。Usually, the layout templates provided in the layout scenario of graphics and texts have a single style, and all types of graphics and texts are laid out using a single-style layout template, which makes the layout style of the graphics and texts too repetitive, and thus leads to too low diversity of the layout style of the graphics and texts. In the embodiment of the present application, developers such as UI designers predetermine multiple theme keywords and design multiple layout templates corresponding to each theme keyword.

确定用户插入的图文内容对应的目标主题关键词,进而获取目标主题关键词对应的第一数量的排版模板。对应主题关键词提供排版模板,提高了图文模板的选择多样性。同时,提供的排版模板可以对应图文内容的主题进行排版,进一步提高了排版后图文内容的视觉效果。Determine the target theme keyword corresponding to the graphic content inserted by the user, and then obtain the first number of layout templates corresponding to the target theme keyword. Providing layout templates corresponding to the theme keyword improves the selection diversity of graphic templates. At the same time, the provided layout template can be typeset according to the theme of the graphic content, further improving the visual effect of the graphic content after typesetting.

S140,根据第一数量的排版模板分别对图文内容进行排版,生成第一数量的排版预览界面。S140, typeset the graphic and text contents respectively according to a first number of typeset templates, and generate a first number of typeset preview interfaces.

根据第一数量的排版模板分别对图文内容进行排版,即每个排版模板分别对图文内容进行排版,生成排版模板对应的排版预览界面,直到生成的排版预览界面的数量为第一数量。通过提供多个排版预览界面,以便于用户确定图文内容排版后的视觉效果。The graphic content is typeset according to the first number of typesetting templates, that is, each typesetting template typeset the graphic content, and a typesetting preview interface corresponding to the typesetting template is generated until the number of generated typesetting preview interfaces reaches the first number. By providing multiple typesetting preview interfaces, the user can determine the visual effect of the graphic content after typesetting.

S150,确定用户基于排版预览界面选择的目标排版模板。S150, determining the target layout template selected by the user based on the layout preview interface.

本实施例中通过编辑器界面显示每个排版模板对应的排版预览界面,用户通过排版预览界面确定最终选择的目标排版模板。具体地,用户在对不需要进行修改的情况下,可以通过人机交互装置在编辑器界面进行点击等操作,根据所需选择的目标排版模板,生成模板选择指令。计算设备响应模板选择指令,确定用户基于排版预览界面选择的目标排版模板。In this embodiment, the typesetting preview interface corresponding to each typesetting template is displayed through the editor interface, and the user determines the target typesetting template finally selected through the typesetting preview interface. Specifically, when the user does not need to modify the typesetting template, the user can click on the editor interface through the human-computer interaction device to generate a template selection instruction according to the target typesetting template to be selected. The computing device responds to the template selection instruction and determines the target typesetting template selected by the user based on the typesetting preview interface.

S160,基于目标排版模板对图文内容进行排版,生成图文内容的排版结果。S160, typeset the graphic content based on the target typesetting template to generate a typesetting result of the graphic content.

在确定了用户选择的目标排版模板之后,基于目标排版模板对图文内容进行排版,生成图文内容的排版结果。为便于理解,本申请的实施例中以图文内容为大量图片为例,利用排版模板进行一行多图、多图拼接及可滑动的轮播图等形式进行图文内容排版,以得到排版后的图文内容。After determining the target layout template selected by the user, the graphic content is layouted based on the target layout template to generate a layout result of the graphic content. For ease of understanding, in the embodiment of the present application, the graphic content is a large number of pictures as an example, and the layout template is used to layout the graphic content in the form of multiple pictures in one row, multiple pictures spliced together, and a slideable carousel picture to obtain the layout of the graphic content.

即使用户无法利用HTML等前端技术进行编程,仍可以利用排版模板对图文内容进行排版,降低了对开发人员和UI设计人员的依赖,提高了图文排版的效率。同时,可以根据图文内容对应的主题,获取不同的排版模板,不仅提高了图文内容的排版样式的多样性,还能够对应实际的图文内容进行排版,提高了排版后图文内容的视觉效果。Even if users cannot use HTML and other front-end technologies for programming, they can still use layout templates to layout graphic content, reducing the dependence on developers and UI designers and improving the efficiency of graphic layout. At the same time, different layout templates can be obtained according to the theme of the graphic content, which not only improves the diversity of graphic content layout styles, but also can be used to layout the actual graphic content, improving the visual effect of the graphic content after layout.

请参阅图2,图2示意性示出了根据本申请实施例的图文排版方法的第二种流程示意图。Please refer to FIG. 2 , which schematically shows a second flow chart of the image and text typesetting method according to an embodiment of the present application.

如图2所示,本申请的实施例中,图文排版方法还包括:As shown in FIG. 2 , in an embodiment of the present application, the graphic typesetting method further includes:

S170,响应接收到的模板编辑指令,根据用户对目标排版模板的编辑操作,得到目标排版模板的更新信息。S170, responding to the received template editing instruction, and obtaining update information of the target typesetting template according to the user's editing operation on the target typesetting template.

用户通过排版预览界面对排版后的图文内容的视觉效果进行预览,确定是否需要对选择的目标排版模板进行修改。在用户确定需要对目标排版模板进行修改的情况下,用户可以通过人机交互设备对排版模板进行编辑操作,并生成模板编辑指令。计算设备响应模板编辑指令,根据用户对目标排版模板的编辑操作,得到目标排版模板的更新信息。The user previews the visual effect of the typesetting graphic content through the typesetting preview interface to determine whether the selected target typesetting template needs to be modified. If the user determines that the target typesetting template needs to be modified, the user can edit the typesetting template through the human-computer interaction device and generate a template editing instruction. The computing device responds to the template editing instruction and obtains the update information of the target typesetting template according to the user's editing operation on the target typesetting template.

S180,基于目标排版模板的更新信息,得到更新后的排版结果。S180, obtaining an updated typesetting result based on the update information of the target typesetting template.

基于目标排版模板的更新信息,确定更新后的目标排版模板,并利用更新后的排版模板对图文内容进行排版,得到更新后的排版结果。Based on the update information of the target typesetting template, an updated target typesetting template is determined, and the updated typesetting template is used to typeset the graphic content to obtain an updated typesetting result.

本申请的实施例中,基于目标排版模板的更新信息,得到更新后的排版结果,包括:In an embodiment of the present application, based on the update information of the target typesetting template, an updated typesetting result is obtained, including:

基于目标排版模板的更新信息,得到更新后的排版结果,并将目标排版模板的更新计数加一;Based on the update information of the target typesetting template, an updated typesetting result is obtained, and the update count of the target typesetting template is increased by one;

图文排版方法还包括:Graphics and text layout methods also include:

在更新计数超过预设阈值的情况下,基于目标排版模板对应的所有更新信息,更新目标排版模板。When the update count exceeds a preset threshold, the target layout template is updated based on all update information corresponding to the target layout template.

在用户确定不需要再对排版模板进行修改操作的情况下,计算设备不再接收到的模板编辑指令,基于目标排版模板的更新信息,得到更新后的排版结果,同时,将目标排版模板的更新计数加一。需要理解的是,用户对排版模板进行修改操作可以是修改颜色及修改尺寸等,在此不做限定。When the user determines that the typesetting template does not need to be modified, the computing device no longer receives the template editing instruction, obtains the updated typesetting result based on the update information of the target typesetting template, and increases the update count of the target typesetting template by 1. It should be understood that the user's modification operation on the typesetting template can be to modify the color and size, etc., which is not limited here.

通过排版模板的更新计数,确定用户使用修改后的排版模板进行图文内容排版的频率。在更新计数超过预设阈值的情况下,获取每次将目标排版模板的更新计数加一时对应的更新信息。基于目标排版模板对应的所有更新信息,更新目标排版模板。用户后续对图文内容排版时,利用更新后的目标排版模板对图文内容进行排版,以得到更加符合用户需求的排版后的图文内容。The update count of the layout template is used to determine the frequency with which the user typeset the graphic content using the modified layout template. When the update count exceeds the preset threshold, the update information corresponding to each time the update count of the target layout template is increased by one is obtained. Based on all the update information corresponding to the target layout template, the target layout template is updated. When the user typesets the graphic content subsequently, the updated target layout template is used to typeset the graphic content to obtain typeset graphic content that better meets the user's needs.

本申请的实施例中,基于目标排版模板对图文内容进行排版,生成图文内容的排版结果,包括:In the embodiment of the present application, the graphic content is typeset based on the target typesetting template to generate a typesetting result of the graphic content, including:

解析图文内容对应的HTML文档,得到HTML结构和至少一个HTML元素;Parse the HTML document corresponding to the graphic content to obtain the HTML structure and at least one HTML element;

根据HTML结构和所有HTML元素,构建图文内容对应的DOM树,其中,DOM树包括至少一个节点,且每个节点对应一个HTML元素;According to the HTML structure and all HTML elements, a DOM tree corresponding to the graphic content is constructed, wherein the DOM tree includes at least one node, and each node corresponds to an HTML element;

基于目标排版模板对应DOM树进行计算与布局,得到待渲染DOM树;Calculate and layout the DOM tree corresponding to the target layout template to obtain the DOM tree to be rendered;

渲染待渲染DOM树的中节点,生成图文内容的排版结果;Render the middle node of the DOM tree to be rendered and generate the layout result of the graphic content;

图文排版方法还包括:Graphics and text layout methods also include:

响应接收到的图文内容编辑指令,根据用户对图文内容的编辑操作,得到更新后的图文内容;In response to the received graphic content editing instruction, according to the user's editing operation on the graphic content, an updated graphic content is obtained;

基于更新后的图文内容,更新待渲染DOM树;Based on the updated graphic content, update the DOM tree to be rendered;

渲染更新后的待渲染DOM树的中节点,得到更新后的排版结果。Render the updated middle node of the DOM tree to be rendered to obtain the updated layout result.

通常图文排版场景中用户插入的图文内容的文档形式为HTML文档。图文内容对应的HTML文档由一系列的标签、文本内容及图像组成,标签用于描述文档中的各种元素。完成图文内容的编辑之后,解析图文内容对应的HTML文档,得到HTML文档的HTML结构和至少一个HTML元素,其中,多个HTML元素可以嵌套在一起,形成一个层次结构。Usually, the document format of the graphic content inserted by the user in the graphic typesetting scenario is an HTML document. The HTML document corresponding to the graphic content consists of a series of tags, text content and images. Tags are used to describe various elements in the document. After the editing of the graphic content is completed, the HTML document corresponding to the graphic content is parsed to obtain the HTML structure and at least one HTML element of the HTML document, where multiple HTML elements can be nested together to form a hierarchical structure.

根据HTML结构和所有HTML元素,获取HTML结构与每个HTML元素的嵌套关系。基于HTML结构与每个HTML元素的嵌套关系构建图文内容对应的DOM(Document Object Model,文档对象模型)树。DOM树包括至少一个节点,且每个节点对应一个HTML元素,开发人员可以通过DOM API(Application Programming Interface,应用程序编程接口)来访问和操作各个节点。According to the HTML structure and all HTML elements, the nesting relationship between the HTML structure and each HTML element is obtained. Based on the nesting relationship between the HTML structure and each HTML element, a DOM (Document Object Model) tree corresponding to the graphic content is constructed. The DOM tree includes at least one node, and each node corresponds to an HTML element. Developers can access and operate each node through the DOM API (Application Programming Interface).

基于目标排版模板对应DOM树进行计算与布局。具体地,获取目标排版模板的预设配置数据,并通过预设配置数据对DOM树进行样式的计算与布局,得到待渲染DOM树渲染待渲染DOM树的中节点,生成图文内容的排版结果。需要理解的是,可以通过渲染待渲染DOM树的中节点,生成排版预览界面,以便于用户预览排版后的图文内容。Calculate and layout the DOM tree corresponding to the target layout template. Specifically, obtain the preset configuration data of the target layout template, and calculate and layout the style of the DOM tree through the preset configuration data, obtain the middle node of the DOM tree to be rendered, and generate the layout result of the graphic content. It should be understood that a layout preview interface can be generated by rendering the middle node of the DOM tree to be rendered, so that users can preview the graphic content after typeset.

在用户确定需要对图文内容进行修改的情况下,用户可以通过人机交互设备对图文内容进行编辑操作,并生成图文内容编辑指令。计算设备响应图文内容编辑指令,根据用户对图文内容的编辑操作,得到更新后的图文内容。需要理解的是,编辑操作是根据实际需求设置的,可以是新增、删减及修改等操作,在此不做限定。人机交互设备也是根据实际需求设置的,可以是键盘和鼠标等设备,在此不做限定。When the user determines that the graphic content needs to be modified, the user can edit the graphic content through the human-computer interaction device and generate graphic content editing instructions. The computing device responds to the graphic content editing instructions and obtains the updated graphic content based on the user's editing operations on the graphic content. It should be understood that the editing operation is set according to actual needs, and can be operations such as adding, deleting, and modifying, which are not limited here. The human-computer interaction device is also set according to actual needs, and can be devices such as keyboards and mice, which are not limited here.

计算设备的编辑器基于更新后的图文内容,更新待渲染DOM树。渲染更新后的待渲染DOM树的中节点,得到更新后的排版结果。即使用户无法利用HTML等前端技术进行编程,仍可以利用排版模板对图文内容进行排版,用户也可以通过图文内容编辑指令对图文内容进行编辑,并利用排版模板对更新后的图文内容进行排版,降低了对开发人员和UI设计人员的依赖,提高了图文排版的效率。The editor of the computing device updates the DOM tree to be rendered based on the updated graphic content. The middle node of the updated DOM tree to be rendered is rendered to obtain an updated typesetting result. Even if the user cannot use front-end technologies such as HTML for programming, the typesetting template can still be used to typeset the graphic content. The user can also edit the graphic content through the graphic content editing instructions, and use the typesetting template to typeset the updated graphic content, which reduces the dependence on developers and UI designers and improves the efficiency of graphic typesetting.

本申请的实施例中,获取主题关键词对应的第一数量的排版模板,包括:In an embodiment of the present application, obtaining a first number of layout templates corresponding to the subject keywords includes:

获取主题关键词对应的第二数量的排版模板,并分别获取每个排版模板的使用计数;Obtain a second number of typesetting templates corresponding to the subject keyword, and respectively obtain a usage count of each typesetting template;

根据所有排版模板的使用计数,从第二数量的排版模板中筛选出第一数量的排版模板;Filtering the first number of layout templates from the second number of layout templates according to usage counts of all layout templates;

确定用户基于排版预览界面选择的目标排版模板,包括:Determine the target layout template selected by the user based on the layout preview interface, including:

确定用户基于排版预览界面选择的目标排版模板,并更新目标排版模板的使用计数。Determine the target layout template selected by the user based on the layout preview interface, and update the usage count of the target layout template.

请参阅图3,图3示意性示出了根据本申请实施例的获取排版模板的应用示例图。Please refer to FIG. 3 , which schematically shows an application example diagram of obtaining a typesetting template according to an embodiment of the present application.

如图所示,本申请的实施例中示出了主题关键词01、主题关键词02及主题关键词03。具体地,主题关键词01为“美食”,主题关键词02为“旅行”,主题关键词03为“学术”,每个主题关键词对应第二数量的排版模板。每次用户基于排版预览界面选择排版模板时,确定用户基于排版预览界面选择的目标排版模板,并更新目标排版模板的使用计数。As shown in the figure, in the embodiment of the present application, theme keyword 01, theme keyword 02 and theme keyword 03 are shown. Specifically, theme keyword 01 is "food", theme keyword 02 is "travel", theme keyword 03 is "academic", and each theme keyword corresponds to the second number of typesetting templates. Each time the user selects a typesetting template based on the typesetting preview interface, the target typesetting template selected by the user based on the typesetting preview interface is determined, and the usage count of the target typesetting template is updated.

在确定了图文内容对应的主题关键词之后,获取主题关键词对应的第二数量的排版模板,并分别获取每个排版模板的使用计数。After determining the subject keyword corresponding to the graphic content, a second number of typesetting templates corresponding to the subject keyword are obtained, and the usage count of each typesetting template is obtained respectively.

根据所有排版模板的使用计数,确定用户对不同排版模板的喜欢,进而从第二数量的排版模板中筛选出第一数量的排版模板。提供第一数量的排版模板供用户进行选择,提高了图文内容的排版样式的多样性。同时,通过排版模板的使用计数对排版模板进行筛选,能够准确地提供用户所需求的排版模板,进而提升了用户体验。According to the usage counts of all typesetting templates, the user's preference for different typesetting templates is determined, and then the first number of typesetting templates are screened out from the second number of typesetting templates. The first number of typesetting templates are provided for the user to choose from, thereby improving the diversity of typesetting styles of graphic content. At the same time, by screening the typesetting templates according to the usage counts of the typesetting templates, the typesetting templates required by the user can be accurately provided, thereby improving the user experience.

本申请的实施例中,生成第一数量的排版预览界面之后,还包括:In an embodiment of the present application, after generating the first number of layout preview interfaces, the method further includes:

响应接收到的额外模板预览请求,生成第三数量的排版预览界面,其中,第三数量大于第一数量,且小于或等于第二数量。In response to the received additional template preview request, a third number of layout preview interfaces is generated, wherein the third number is greater than the first number and less than or equal to the second number.

用户对第一数量的排版预览界面进行浏览之后,可以从第一数量的排版模板中选择出目标排版模板,也可以请求展示更多的排版模板。在用户请求展示更多的排版模板的情况下,计算设备响应接收到的额外模板预览请求,生成第三数量的排版预览界面,其中,第三数量大于第一数量,且小于或等于第二数量。After browsing the first number of layout preview interfaces, the user can select a target layout template from the first number of layout templates, or request to display more layout templates. In the case where the user requests to display more layout templates, the computing device generates a third number of layout preview interfaces in response to the received additional template preview request, wherein the third number is greater than the first number and less than or equal to the second number.

为便于理解,本申请的实施例中第一数量为3,且第二数量为9。第三数量可以根据接收到额外模板预览请求的次数不断增加,举例而言,假设第一次接收到额外模板预览请求,第三数量可以为6,即生成6个排版模板对应的排版预览界面。第二次接收到额外模板预览请求,第三数量可以为9,即生成9个排版模板对应的排版预览界面。通过响应额外模板预览请求,为用户提供更多的可预览的排版模板,进一步提高了图文内容的排版样式的多样性。For ease of understanding, in the embodiment of the present application, the first number is 3, and the second number is 9. The third number can be continuously increased according to the number of times the additional template preview request is received. For example, assuming that the additional template preview request is received for the first time, the third number can be 6, that is, 6 typesetting preview interfaces corresponding to typesetting templates are generated. When the additional template preview request is received for the second time, the third number can be 9, that is, 9 typesetting preview interfaces corresponding to typesetting templates are generated. By responding to the additional template preview request, more previewable typesetting templates are provided to the user, further improving the diversity of typesetting styles of graphic content.

本申请提供一种图文排版方法,图文排版方法包括:响应接收到的图文编辑指令,确定用户插入的图文内容;确定图文内容对应的主题关键词;获取主题关键词对应的第一数量的排版模板;根据第一数量的排版模板分别对图文内容进行排版,生成第一数量的排版预览界面;确定用户基于排版预览界面选择的目标排版模板;基于目标排版模板对图文内容进行排版,生成图文内容的排版结果。利用排版模板对图文内容进行排版,提高了图文排版的效率。同时,可以根据图文内容对应的主题,获取不同的排版模板,不仅提高了图文内容的排版样式的多样性,还能够对应实际的图文内容进行排版,提高了排版后图文内容的视觉效果。The present application provides a graphic typesetting method, which includes: responding to a received graphic editing instruction, determining the graphic content inserted by the user; determining the subject keywords corresponding to the graphic content; obtaining a first number of typesetting templates corresponding to the subject keywords; typeset the graphic content according to the first number of typesetting templates, and generating a first number of typesetting preview interfaces; determining a target typesetting template selected by the user based on the typesetting preview interface; typeset the graphic content based on the target typesetting template, and generating a typesetting result of the graphic content. Typesetting the graphic content using the typesetting template improves the efficiency of graphic typesetting. At the same time, different typesetting templates can be obtained according to the subject corresponding to the graphic content, which not only improves the diversity of the typesetting style of the graphic content, but also can typeset corresponding to the actual graphic content, thereby improving the visual effect of the graphic content after typesetting.

实施例二Embodiment 2

请参阅图4,图4示意性示出了根据本申请实施例的图文排版装置的结构示意图。如图4所示,图文排版装置200包括:Please refer to FIG4 , which schematically shows a schematic diagram of the structure of a graphic typesetting device according to an embodiment of the present application. As shown in FIG4 , the graphic typesetting device 200 includes:

图文内容确定模块210,用于响应接收到的图文编辑指令,确定用户插入的图文内容;The graphic content determination module 210 is used to respond to the received graphic editing instruction and determine the graphic content inserted by the user;

关键词确定模块220,用于确定图文内容对应的主题关键词;Keyword determination module 220, used to determine the subject keywords corresponding to the graphic content;

排版模板获取模块230,用于获取主题关键词对应的第一数量的排版模板;The typesetting template acquisition module 230 is used to acquire a first number of typesetting templates corresponding to the subject keyword;

预览界面生成模块240,用于根据第一数量的排版模板分别对图文内容进行排版,生成第一数量的排版预览界面;A preview interface generating module 240 is used to respectively typeset the graphic content according to a first number of typesetting templates to generate a first number of typesetting preview interfaces;

排版模板确定模块250,用于确定用户基于排版预览界面选择的目标排版模板;A layout template determination module 250 is used to determine a target layout template selected by a user based on the layout preview interface;

排版结果生成模块260,用于基于目标排版模板对图文内容进行排版,生成图文内容的排版结果。The typesetting result generating module 260 is used to typeset the graphic content based on the target typesetting template and generate the typesetting result of the graphic content.

本申请的实施例中,图文排版装置200还包括:In the embodiment of the present application, the graphic typesetting device 200 further includes:

更新信息获取模块,用于响应接收到的模板编辑指令,根据用户对目标排版模板的编辑操作,得到目标排版模板的更新信息;An update information acquisition module is used to respond to the received template editing instruction and obtain the update information of the target typesetting template according to the user's editing operation on the target typesetting template;

排版结果更新模块,用于基于目标排版模板的更新信息,得到更新后的排版结果。The typesetting result updating module is used to obtain updated typesetting results based on the updated information of the target typesetting template.

本申请的实施例中,更新信息获取模块,还用于基于目标排版模板的更新信息,得到更新后的排版结果,并将目标排版模板的更新计数加一;In the embodiment of the present application, the update information acquisition module is further used to obtain the updated typesetting result based on the update information of the target typesetting template, and increase the update count of the target typesetting template by one;

图文排版装置200还包括:The graphic typesetting device 200 also includes:

排版模板更新模块,用于在更新计数超过预设阈值的情况下,基于目标排版模板对应的所有更新信息,更新目标排版模板。The layout template update module is used to update the target layout template based on all update information corresponding to the target layout template when the update count exceeds a preset threshold.

本申请的实施例中,排版结果生成模块260包括:In the embodiment of the present application, the typesetting result generating module 260 includes:

文档解析子模块,用于解析图文内容对应的HTML文档,得到HTML结构和至少一个HTML元素;The document parsing submodule is used to parse the HTML document corresponding to the graphic content to obtain the HTML structure and at least one HTML element;

DOM树构建子模块,用于根据HTML结构和所有HTML元素,构建图文内容对应的DOM树,其中,DOM树包括至少一个节点,且每个节点对应一个HTML元素;The DOM tree construction submodule is used to construct a DOM tree corresponding to the graphic content according to the HTML structure and all HTML elements, wherein the DOM tree includes at least one node, and each node corresponds to an HTML element;

计算与布局子模块,用于基于目标排版模板对应DOM树进行计算与布局,得到待渲染DOM树;The calculation and layout submodule is used to calculate and layout the DOM tree corresponding to the target layout template to obtain the DOM tree to be rendered;

结果生成子模块,用于渲染待渲染DOM树的中节点,生成图文内容的排版结果;The result generation submodule is used to render the middle node of the DOM tree to be rendered and generate the typesetting results of the graphic content;

图文排版装置200还包括:The graphic typesetting device 200 also includes:

图文内容更新模块,用于响应接收到的图文内容编辑指令,根据用户对图文内容的编辑操作,得到更新后的图文内容;The graphic content updating module is used to respond to the received graphic content editing instruction and obtain the updated graphic content according to the user's editing operation on the graphic content;

DOM树更新模块,用于基于更新后的图文内容,更新待渲染DOM树;DOM tree update module, used to update the DOM tree to be rendered based on the updated graphic content;

更新后DOM树渲染模块,用于渲染更新后的待渲染DOM树的中节点,得到更新后的排版结果。The updated DOM tree rendering module is used to render the updated middle node of the DOM tree to be rendered to obtain the updated layout result.

本申请的实施例中,排版模板获取模块230包括:In the embodiment of the present application, the typesetting template acquisition module 230 includes:

使用计数获取子模块,用于获取主题关键词对应的第二数量的排版模板,并分别获取每个排版模板的使用计数;A usage count acquisition submodule is used to acquire a second number of typesetting templates corresponding to the subject keyword, and respectively acquire a usage count of each typesetting template;

排版模板筛选子模块,用于根据所有排版模板的使用计数,从第二数量的排版模板中筛选出第一数量的排版模板;A typesetting template screening submodule, used for screening out a first number of typesetting templates from a second number of typesetting templates according to usage counts of all typesetting templates;

排版模板确定模块250,还用于确定用户基于排版预览界面选择的目标排版模板,并更新目标排版模板的使用计数。The typesetting template determination module 250 is also used to determine the target typesetting template selected by the user based on the typesetting preview interface, and to update the usage count of the target typesetting template.

本申请的实施例中,图文排版装置200还包括:In the embodiment of the present application, the graphic typesetting device 200 further includes:

界面生成模块,用于响应接收到的额外模板预览请求,生成第三数量的排版预览界面,其中,第三数量大于第一数量,且小于或等于第二数量。The interface generation module is used to generate a third number of layout preview interfaces in response to the received additional template preview request, wherein the third number is greater than the first number and less than or equal to the second number.

本申请的实施例中,关键词确定模块220包括:In the embodiment of the present application, the keyword determination module 220 includes:

排版关键词获取子模块,用于获取图文内容对应的至少一个排版关键词;A typesetting keyword acquisition submodule, used to acquire at least one typesetting keyword corresponding to the graphic content;

主题关键词确定子模块,用于根据所有的排版关键词,确定图文内容对应的主题关键词。The subject keyword determination submodule is used to determine the subject keywords corresponding to the graphic content based on all the typesetting keywords.

本申请实施例还提供一种计算设备,包括:The present application also provides a computing device, including:

存储器,被配置成存储指令;以及a memory configured to store instructions; and

处理器,被配置成从存储器调用指令以及在执行指令时能够实现上述的图文排版方法。The processor is configured to call instructions from the memory and implement the above-mentioned graphic typesetting method when executing the instructions.

本实施例中的图文内容确定模块210、关键词确定模块220、排版模板获取模块230、预览界面生成模块240、排版模板确定模块250及排版结果生成模块260等均作为程序单元存储在存储器中,由处理器执行存储在存储器中的上述程序单元来实现相应的功能。The graphic content determination module 210, keyword determination module 220, typesetting template acquisition module 230, preview interface generation module 240, typesetting template determination module 250 and typesetting result generation module 260 in this embodiment are all stored in the memory as program units, and the processor executes the above program units stored in the memory to realize the corresponding functions.

处理器中包含内核,由内核去存储器中调取相应的程序单元。内核可以设置一个或以上,通过调整内核参数来解决现有技术中图文内容的排版样式的多样性过低的问题。The processor includes a kernel, which retrieves the corresponding program unit from the memory. One or more kernels can be set, and the problem of low diversity of typesetting styles of graphic content in the prior art can be solved by adjusting kernel parameters.

存储器可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM),存储器包括至少一个存储芯片。The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and/or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.

本申请实施例还提供一种机器可读存储介质,该机器可读存储介质上存储有指令,该指令用于使得机器执行上述的图文排版方法。An embodiment of the present application also provides a machine-readable storage medium, on which instructions are stored, and the instructions are used to enable a machine to execute the above-mentioned graphic typesetting method.

本领域内的技术人员应明白,本申请的实施例可提供为方法、系统或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.

本申请是参照根据本申请实施例的方法、设备(系统)、计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present application is described with reference to the flowchart and/or block diagram of the method, device (system), and computer program product according to the embodiment of the present application. It should be understood that each process and/or box in the flowchart and/or block diagram, as well as the combination of the process and/or box in the flowchart and/or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device produce a device for implementing the functions specified in one process or multiple processes in the flowchart and/or one box or multiple boxes in the block diagram.

这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device that implements the functions specified in one or more processes in the flowchart and/or one or more boxes in the block diagram.

这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions may also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, whereby the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more processes in the flowchart and/or one or more boxes in the block diagram.

在一个典型的配置中,计算设备包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存。In a typical configuration, a computing device includes one or more processors (CPU), input/output interfaces, network interfaces, and memory.

存储器可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。存储器是计算机可读介质的示例。The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and/or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括暂存电脑可读媒体(transitory media),如调制的数据信号和载波。Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

还需要说明的是,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、商品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、商品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括要素的过程、方法、商品或者设备中还存在另外的相同要素。It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

以上仅为本申请的实施例而已,并不用于限制本申请。对于本领域技术人员来说,本申请可以有各种更改和变化。凡在本申请的精神和原理之内所作的任何修改、等同替换、改进等,均应包含在本申请的权利要求范围之内。The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.

Claims (10)

1. The image-text typesetting method is characterized by comprising the following steps of:
determining the content of the graphics context inserted by the user in response to the received graphics context editing instruction;
Determining a theme keyword corresponding to the image-text content;
Obtaining a first number of typesetting templates corresponding to the topic keywords;
Typesetting the image-text contents according to the first number of typesetting templates respectively to generate a first number of typesetting preview interfaces;
determining a target typesetting template selected by the user based on the typesetting preview interface;
and typesetting the image-text content based on the target typesetting template to generate typesetting results of the image-text content.
2. The method according to claim 1, wherein the graphic composition method further comprises:
responding to the received template editing instruction, and obtaining the updating information of the target typesetting template according to the editing operation of the user on the target typesetting template;
and obtaining the updated typesetting result based on the updating information of the target typesetting template.
3. The method according to claim 2, wherein the obtaining the updated typesetting result based on the updated information of the target typesetting template includes:
based on the updating information of the target typesetting template, obtaining the updated typesetting result, and adding one to the updating count of the target typesetting template;
the image-text typesetting method also comprises the following steps:
and under the condition that the update count exceeds a preset threshold value, updating the target typesetting template based on all the update information corresponding to the target typesetting template.
4. The method according to claim 1, wherein the typesetting the content based on the target typesetting template generates a typesetting result of the content, including:
Analyzing an HTML document corresponding to the image-text content to obtain an HTML structure and at least one HTML element;
Constructing a DOM tree corresponding to the image-text content according to the HTML structure and all the HTML elements, wherein the DOM tree comprises at least one node, and each node corresponds to one HTML element;
Calculating and laying out the DOM tree based on the target typesetting template to obtain a DOM tree to be rendered;
rendering the middle node of the DOM tree to be rendered, and generating a typesetting result of the image-text content;
the image-text typesetting method also comprises the following steps:
Responding to the received image-text content editing instruction, and obtaining updated image-text content according to the editing operation of a user on the image-text content;
Updating the DOM tree to be rendered based on the updated image-text content;
And rendering the updated middle node of the DOM tree to be rendered to obtain the updated typesetting result.
5. The method according to claim 1, wherein the obtaining a first number of typesetting templates corresponding to the topic keyword includes:
obtaining a second number of typesetting templates corresponding to the topic keywords, and respectively obtaining the use count of each typesetting template;
Screening a first number of typesetting templates from a second number of typesetting templates according to the usage count of all typesetting templates;
The determining the target typesetting template selected by the user based on the typesetting preview interface comprises the following steps:
and determining a target typesetting template selected by the user based on the typesetting preview interface, and updating the use count of the target typesetting template.
6. The method of claim 5, wherein after generating the first number of composition preview interfaces, further comprising:
and responding to the received additional template preview request, and generating a third number of typesetting preview interfaces, wherein the third number is larger than the first number and smaller than or equal to the second number.
7. The method according to claim 1, wherein the determining the topic keyword corresponding to the teletext content comprises:
Acquiring at least one typesetting keyword corresponding to the image-text content;
and determining the theme keywords corresponding to the image-text content according to all the typesetting keywords.
8. The utility model provides a picture and text typesetting device which characterized in that, picture and text typesetting device includes:
the image-text content determining module is used for responding to the received image-text editing instruction and determining the image-text content inserted by the user;
The keyword determining module is used for determining a theme keyword corresponding to the image-text content;
The typesetting template acquisition module is used for acquiring a first number of typesetting templates corresponding to the topic keywords;
the preview interface generation module is used for typesetting the image-text contents according to the first number of typesetting templates respectively to generate a first number of typesetting preview interfaces;
The typesetting template determining module is used for determining a target typesetting template selected by the user based on the typesetting preview interface;
And the typesetting result generating module is used for typesetting the image-text contents based on the target typesetting template to generate typesetting results of the image-text contents.
9. A computing device, comprising:
A memory configured to store instructions; and
A processor configured to invoke the instructions from the memory and to enable a teletext method according to any one of claims 1-7 when executing the instructions.
10. A machine-readable storage medium having stored thereon instructions for causing a machine to perform a method of teletext according to any one of claims 1-7.
CN202410862205.4A 2024-06-28 2024-06-28 Graphic typesetting method, device, computing device and machine-readable storage medium Pending CN118607471A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410862205.4A CN118607471A (en) 2024-06-28 2024-06-28 Graphic typesetting method, device, computing device and machine-readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410862205.4A CN118607471A (en) 2024-06-28 2024-06-28 Graphic typesetting method, device, computing device and machine-readable storage medium

Publications (1)

Publication Number Publication Date
CN118607471A true CN118607471A (en) 2024-09-06

Family

ID=92548244

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410862205.4A Pending CN118607471A (en) 2024-06-28 2024-06-28 Graphic typesetting method, device, computing device and machine-readable storage medium

Country Status (1)

Country Link
CN (1) CN118607471A (en)

Similar Documents

Publication Publication Date Title
CN111428457B (en) Automatic formatting of data tables
US10691875B2 (en) Populating visual designs with web content
KR101312867B1 (en) Markup based extensibility for user interfaces
US8791955B2 (en) Method, system, and computer-readable medium for creating and laying out a graphic within an application program
JP5336569B2 (en) Method and computer-readable medium for fitting text to a shape in a graphic
CN106033471B (en) A kind of method and apparatus handling list
US20140208203A1 (en) Key-Frame based Authoring and Generation of Highly Resizable Document Layout
KR101773574B1 (en) Method for chart visualizing of data table
CN113535165A (en) Interface generation method and device, electronic equipment and computer readable storage medium
US7750924B2 (en) Method and computer-readable medium for generating graphics having a finite number of dynamically sized and positioned shapes
CN106354483B (en) Data processing method and device and electronic equipment
US9141596B2 (en) System and method for processing markup language templates from partial input data
CN104915186B (en) A kind of method and apparatus making the page
JP4303079B2 (en) System and method for conversion between text formatting or markup language formatting and outline structure
CN117289905B (en) Application software development method and device, storage medium and electronic equipment
JP2009048450A (en) Document management program and thumbnail display method
CN112825038A (en) Visual page making method based on general component language specification and related product
CN110928540A (en) Page generation method and device
US20150161085A1 (en) Natural language-aided hypertext document authoring
CN112748917B (en) Graph display method and device
CN118607471A (en) Graphic typesetting method, device, computing device and machine-readable storage medium
CN111475156B (en) Page code generation method and device, electronic equipment and storage medium
US20030154462A1 (en) Software maintenance material generation apparatus and generation program therefor
US10915599B2 (en) System and method for producing transferable, modular web pages
CN114154095A (en) Page picture generation method, device, equipment and storage medium

Legal Events

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