An online automatic typesetting system and method based on electronic newspaper layout

The online automatic typesetting system based on FFD and FirstFit algorithms solves the problem of low efficiency in traditional manual typesetting, realizes automated typesetting of news materials, and improves the efficiency of news publishing.

CN113177398BActive Publication Date: 2025-10-28HANGZHOU DIANZI UNIV
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202110436219.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-04-22
Publication Date
2025-10-28
Estimated Expiration
2041-04-22

AI Technical Summary

Technical Problem

Traditional manual typesetting methods result in low efficiency in news publishing, failing to meet the rapid dissemination needs of the modern information society.

Method used

An online automatic typesetting system based on FFD and FirstFit algorithms is adopted. Through the collaborative work of the front-end web module, back-end server module and database module, it realizes automated layout design and typesetting, and uses PDF files and TeX files generated by the LaTeX typesetting system to automatically typeset text and image materials.

Benefits of technology

It enables the automatic layout of news materials without the need for manual editing, thus improving the efficiency of news publishing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure HDA0003033198880000011
    Figure HDA0003033198880000011
  • Figure HDA0003033198880000021
    Figure HDA0003033198880000021
  • Figure HDA0003033198880000031
    Figure HDA0003033198880000031
Patent Text Reader

Abstract

This invention discloses an online automatic typesetting system and method based on electronic newspaper layouts, addressing the problems of manual typesetting and low efficiency in news publishing. The automatic typesetting system includes a front-end web module for receiving typesetting requests, uploading typesetting editing parameters, and displaying typesetting styles; a back-end server module for extracting text and image content from various source files, designing the layout using FFD and FirstFit algorithms, and executing the typesetting job; and a database module that connects to the server via API to store typesetting template information. The back-end server module connects to both the front-end web module and the database module. This system uses an FFD-based typesetting method to achieve automatic layout design and printing, eliminating the need for manual editing of news layouts and improving news publishing efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of typesetting technology, and in particular to an online automatic typesetting system and method based on electronic newspaper layout. Background Technology

[0002] An e-newspaper is a newspaper that stores news and advertisements in digital form on a computer, accessible to readers via telecommunications terminals or home computers. It's a product of the combination of computers and television broadcasting, offering more detailed information than traditional newspapers in the information society. However, like print newspapers, e-newspapers also require layout design for better reader comprehension.

[0003] Traditional typesetting methods rely on manual layout, resulting in low efficiency in news publishing. Therefore, with the development of science and technology, automatic typesetting technology has emerged. For example, the Chinese Patent Office published an invention entitled "A Printing Typesetting System and Method Based on AI-Powered Automatic Typesetting Design for Newspapers and Magazines" on November 27, 2010, with publication number CN112001154A. This invention discloses a printing typesetting system and method based on AI-powered automatic typesetting design for newspapers and magazines, including the following steps: a printing newspaper and magazine typesetting design software system, a page data center, graphic design rules, convolutional kernels of convolutional layers performing convolution on initialized text and images to extract the most representative feature points; using newspaper and magazine page design rules to correct the automatic typesetting design, a survival training set; using the trained page model, combined with the printed newspaper and magazine page layout, performing AI-powered automatic typesetting design on the title, font, font size, and images of the page to be printed, including page structure, color classification, structural layout, and color distribution, generating the printed output newspaper and magazine design page; and finally, mass production using a printing press. This invention is an intelligent typesetting design method that integrates page layout design principles. It is based on AI deep reinforcement learning to achieve automatic printing and typesetting of newspaper and magazine typesetting. Summary of the Invention

[0004] The purpose of this invention is to overcome the problems of manual typesetting and low efficiency in news publishing in the prior art, and to provide an online automatic typesetting system and method based on electronic newspaper layout. This system uses a typesetting method based on FFD algorithm to realize automatic printing typesetting of page design, without the need for manual editing of news layout, and can automatically typeset, thereby improving the efficiency of news publishing.

[0005] To achieve the above objectives, the present invention adopts the following technical solution: an online automatic typesetting system and method based on electronic newspaper layout, comprising:

[0006] The front-end web module is used to receive layout requests, upload layout editing parameters, and display layout styles;

[0007] The backend server module is used to extract the text and image content of each material file, and can use the FFD algorithm and FirstFit algorithm to design the layout and execute the layout job;

[0008] The database module establishes a connection with the server via API and is used to store layout template information;

[0009] The backend server module connects to the frontend web module and the database module, respectively.

[0010] The automatic layout function extracts text and image content from various source files using a backend server algorithm. Following a layout method that integrates page design principles, and after receiving the parameters uploaded to the front-end page, it automatically formats the newsletter using a matching e-newspaper template. The e-newspaper template is preferably a PDF and TeX file generated by a LaTeX typesetting system, containing the overall layout designed using TeX commands. Specifically, during automatic layout, text and image materials are combined into the corresponding TeX file of the e-newspaper template. An FFD algorithm is used to select a TeX file, and then the news materials are filled into the TeX file according to the algorithm's filling order. The resulting TeX file is compiled using xelatex to obtain PDF and TeX files, which are then added to the historical generated template database and returned to the front-end page, completing the automatic layout.

[0011] Preferably, the front-end web module includes:

[0012] The account management module is used to communicate with the server and database, redirect pages, and obtain operation permissions.

[0013] The design operation module communicates with the backend server module to upload relevant text style editing parameters and corresponding graphic files to the server and send an automatic layout signal.

[0014] The history layout module is used to communicate with the backend server module and database module to display previously generated layout information;

[0015] The template browsing module communicates with the backend server module and database module to display the layout information of the current design;

[0016] The download and browsing module communicates with the backend server module, receives text data from the server, displays the formatted e-newsletter, and provides download options.

[0017] If the required parameters are not filled in the design operation module, an automatic layout request cannot be sent. After sending data to the server, if the required parameters do not meet the requirements, the server will return a corresponding error message. After submitting all necessary parameters, the server's automatic layout function will run, automatically formatting the uploaded text and image materials according to the layout method and generating a corresponding PDF file. The returned images can be viewed online and download links can be generated. The front-end web module uses these modules to send a request to the back-end server module for automatic layout when the automatic layout function needs to be activated.

[0018] Preferably, the backend server module includes:

[0019] The front-end and back-end communication module is used to connect the front-end web module and the back-end server module. It includes listening for permission requests, displaying template library data, interacting with historical layout data, requesting necessary layout parameters, and sending back the currently generated layout data. It establishes communication with the account management module, design operation module, historical layout module, template browsing module, and download browsing module, respectively.

[0020] The automatic typesetting module includes a typesetting design unit that integrates page layout design principles, and incorporates the FFD algorithm and the FirstFit algorithm to perform automatic typesetting.

[0021] The database communication module includes specific database data interaction APIs to interact with the server.

[0022] The front-end and back-end communication modules connect to the account management module, design operation module, historical layout module, template browsing module, download browsing module, and automatic layout module, respectively. The automatic layout module connects to the database communication module, which in turn connects to the database module. This front-end and back-end communication module is crucial for interaction between the front-end web module and the back-end server module. It connects all modules within the front-end web module and also connects to the automatic layout module in the back-end server module for information exchange. The front-end and back-end communication module receives automatic layout requests from the front-end web module. If automatic layout is possible, it forwards the request to the automatic layout module for processing; otherwise, it returns a rejection request to the front-end web module. Upon receiving the necessary layout parameters from the front-end web module, the automatic layout module uses its included automatic layout methods to perform template matching and generate a PDF file. The database communication module includes a specific database data interaction API for interaction with the server. The database module establishes a connection with the server through the API, thus connecting to the database communication module.

[0023] Preferably, the database module includes:

[0024] The storage module connects to the server via API and stores user account passwords, historically automatically generated newspapers, and layout templates of various historically excellent newspapers. The storage module also connects to the database communication module. The templates in the storage module are files generated based on the layouts of historically excellent electronic newspapers.

[0025] As a preferred embodiment, the specific steps of the typesetting method are as follows:

[0026] S1: Log in to the account management module, obtain operation permissions, design the operation module, select the news type, upload the relevant text style editing parameters and corresponding graphic files to the server, and send an automatic layout signal;

[0027] S2: The front-end and back-end communication module receives the typesetting signal and transmits it to the automatic typesetting module. The automatic typesetting module constructs an important design rule based on the page design principle and a priority list of the original news material data. Each list item includes the height space occupied by the standardized news content after calculation, and saves the constructed design rules and priority list in the storage module.

[0028] S3: Based on the news type, a signal is sent from the automatic layout module to the database communication module. The database communication module selects the corresponding historical excellent template library from the storage module. Each type of template library contains N different layout templates as candidate templates for intelligent layout.

[0029] S4: Using the information stored in the storage module in step S2, the news is placed into the homepage template browsing module, and the current page information is displayed. Then, using the FFD algorithm in the automatic layout module, the news template is selected from the template library in step S3 according to the number of news items that should be placed in each template.

[0030] The design rules in S2 include establishing corresponding design rules based on the importance of the news, such as rules for first-article news, second-article news, and third-article news. The design rules for first-article news include rules for the font, size, style, and image size of the news title, while the design rules for third-article news include rules for the font and size of the news title. It also includes layout design rules, such as line spacing, whether to use columns, and white space. All these rules are stored in the layout design principle database. The priority list items in S2 include information such as the news title, news lead, news image, and editor's name, and the list items are sorted according to the importance of the news content. In S3, each template includes the maximum height space that can be accommodated within the news section block. In S4, the specific steps of the FFD algorithm and the FirstFit algorithm are used. In step S3, the news type is selected by the user. Based on the news type, a template library is selected from several template libraries. Then, the FFD algorithm is used to select the appropriate number of templates from a template library containing templates with several different layouts, based on the number of news items to be placed.

[0031] Preferably, in step S2, the standardization method is as follows:

[0032] Calculate the height space occupied by the paragraph:

[0033] F=C0×R×∑(C0×N i / c+1)+i×s,

[0034] Calculate the height space occupied by each level of heading:

[0035] H = C k ×R×∑(C k ×H k / c+1)+∑T k ,

[0036] Calculate the height space occupied by the image:

[0037] G=∑h j ,

[0038] The standardization space for news materials is as follows:

[0039] S = F + G + H

[0040] Where C0 represents the body text font size, R represents the line spacing, c represents the width of a column in the template, i represents the number of paragraphs, and N represents the number of paragraphs. i This indicates the number of words in the text corresponding to the paragraph, S represents the paragraph spacing, k represents the headings at each level, and C represents the headings at each level. k H indicates the font size for each level of heading. k Indicates the word count for each level of heading, T kThis indicates the vertical distance between headings and the body text; 'c' represents the width of a column in the template; 'j' represents the number of images; and 'h' represents the vertical distance between headings and the body text. j This indicates the corresponding height dimensions of the image. After standardization, the height space occupied by the news content is the sum of the height space occupied by paragraphs, headings at all levels, and images. Standardization of news materials facilitates template selection.

[0041] Preferably, in step S4, the specific steps for selecting other news templates using the FFD algorithm are as follows:

[0042] S4.1: Sort the news in the news priority list;

[0043] S4.2: Using the FirstFit algorithm, obtain the required number of templates and the news content to be placed in each template from the template library based on the number of news items.

[0044] The FFD algorithm is used to select the required number of templates from a template library based on the number of news items, and to determine the news content to be placed in each template. FFD is an existing technology, also known as 3D free deformation, which allows for simple free deformation of objects. It embeds the object within a mesh and controls the object's geometry by manipulating the mesh points. It is widely used in computer graphics, computer-aided design, and other fields. The FirstFit algorithm is another existing technology, a contiguous physical memory allocation algorithm. FirstFit links free memory blocks in ascending order of address, using a doubly linked list in its implementation. When allocating memory, it searches from the head of the list backwards, meaning from low to high addresses. Once a suitable memory block is found, it is allocated.

[0045] Preferably, in step S4.1, the sorting step specifically includes:

[0046] (1) Sort the news materials from largest to smallest according to the standard height space;

[0047] (2) Then, sort the news headlines from highest to lowest according to a stable sorting method or a bubble sort method, and obtain a set of binary sequences sq such as (headline level L, standard height space S).

[0048] Bubble sort is a relatively simple sorting algorithm in computer science. It works by repeatedly traversing the column of elements to be sorted, comparing adjacent elements one by one, and swapping them if the order (e.g., from largest to smallest, or from Z to A) is incorrect. This process is repeated until no adjacent elements need to be swapped, meaning the column is sorted. The resulting sequence is an ordered set of pairs, sq, which is helpful for calculating the template number.

[0049] Preferably, in step S4.2, the specific steps for obtaining the required number of templates using the FirstFit algorithm are as follows:

[0050] S4.2.1: Input a sorted sequence of binary tuples of length n, sq: (L1, S1), (L2, S2), ..., (Ln, Sn), and template capacity P, let i = 1, j = 1, Pj = P;

[0051] S4.2.2: Take out the i-th element (Li, Si) of the binary sequence and open the j-th container;

[0052] S4.2.3: Determine whether (Li, Si) can be placed into the j-th container. If it can, proceed to step S4. If it cannot, let j = j + 1 and repeat step S3.

[0053] S4.2.4: Place element (Li, Si) into the j-th container. Determine if (Li, Si) is the last element of the sequence. If it is, output the number j of the containers and the sequence of element numbers in each container. If not, let Pj = Pj - P, i = i + 1, j = j + 1, and repeat steps S1 to S4.

[0054] Where P represents the sum of the height dimensions of each column in the template, Pj is the capacity of the j-th container, n represents the sequence length, S represents the standard height space, L represents the title level, and i represents the nth element of the binary sequence to be extracted.

[0055] The FirstFit algorithm is used to obtain the required number of templates, reducing search time and improving typesetting efficiency.

[0056] Therefore, the present invention has the following beneficial effects: it can automatically format news materials without the need for manual editing of news layout, thereby improving the efficiency of news publishing. Attached Figure Description

[0057] Figure 1 This is a schematic diagram of the structure of the present invention;

[0058] Figure 2 This is a flowchart of the typesetting method of the present invention;

[0059] Figure 3 This is a flowchart of the FirstFit algorithm of this invention;

[0060] Figure 4 This is a layout style diagram of the invention;

[0061] In the diagram: 1. Front-end web module; 2. Back-end server module; 3. Back-end server module; 4. Account management module; 5. Design operation module; 6. Historical layout module; 7. Template browsing module; 8. Download browsing module; 9. Front-end and back-end communication module; 10. Automatic layout module; 11. Database communication module; 12. Storage module. Detailed Implementation

[0062] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments:

[0063] This embodiment describes an online automatic typesetting system and method based on electronic newspaper layouts, such as... Figure 1As shown in the diagram, its structure includes: a front-end web module 1 for receiving layout requests, uploading layout editing parameters, and displaying layout styles; a back-end server module 2 for extracting text and image content from various material files, designing layouts using FFD and FirstFit algorithms, and executing layout jobs; and a database module 3 for storing layout template information by establishing a connection with the server via API. The back-end server module 2 is connected to both the front-end web module 1 and the database module 3. The front-end web module 1 includes an account management module 4, a design operation module 5, a history layout module 6, a template browsing module 7, and a download browsing module 8. The account management module 4 communicates with the server and database, performs page redirects, and obtains operation permissions. The design operation module 5 uploads relevant text style editing parameters and corresponding text and image files to the server and sends an automatic layout signal. The history layout module 6 displays previously generated layout information. The template browsing module 7 displays the currently designed layout information. The download browsing module 8 receives text data from the server, displays the already formatted e-newsletter, and provides download functionality. The backend server module 2 includes a frontend-backend communication module 9, an automatic layout module 10, and a database communication module 11. The frontend-backend communication module 9 connects the frontend web module 1 and the backend server module 2. The automatic layout module 10 includes a layout design unit that integrates page layout principles, incorporating FFD and FirstFit algorithms for automatic layout. The database communication module 11 includes a specific database data interaction API for data interaction with the server. The database module 3 includes a storage module 12, which stores user account passwords, historically automatically generated newspapers, and layout style templates of various historically excellent newspapers. The account management module 4, design operation module 5, historical layout module 6, template browsing module 7, and download browsing module 8 are connected to the frontend-backend communication module 9. The automatic layout module 10 is connected to both the frontend-backend communication module 9 and the database communication module 11. The database communication module 11 is connected to the storage module 12. The templates are preferably PDF and TeX files generated by a LaTeX typesetting system, containing the overall layout of the electronic newspaper designed using TeX commands. Specifically, during automatic layout, the text and image materials are combined into the corresponding tex file of the e-newsletter template. The FFD algorithm is used to select a tex file, and then the news materials are filled into the tex file according to the order of the algorithm. The resulting tex file is compiled by xelatex to obtain pdf and tex files, which are added to the historical generated template database and returned to the front-end page to complete the automatic layout.

[0064] like Figure 2 As shown, the automatic typesetting module 10 includes a typesetting method that integrates layout design principles, the steps of which include:

[0065] Step 1: Log in to the account management module 4 to obtain operation permissions, select the news type in the design operation module 5, upload the relevant text style editing parameters and corresponding graphic files to the server, and send an automatic layout signal.

[0066] The second step involves constructing key design rules based on page layout principles. This includes establishing corresponding design rules according to the importance of the news items, such as rules for the first, second, and third news items. The design rules for the first news item include rules for the font, size, style, and image size of the headline, while the rules for the third news item include rules for the font and size of the headline. It also includes page layout design rules, such as line spacing, whether to use columns, and the amount of white space. All these rules are stored in the page layout principle database. A priority list of the original news material data is then constructed. Priority list items include the news headline, lead, news image, and editor's name. List items are sorted according to the importance of the news content, and each item includes the calculated height space occupied by the standardized news content. The height space occupied by the standardized news content is the sum of the height space occupied by paragraphs, headings at all levels, and images. Standardizing news materials facilitates template selection.

[0067] Step 3: Based on the news type, the automatic layout module 10 sends a signal to the database communication module 11. The database communication module 11 then selects the corresponding historical excellent template library from the storage module. Each template library contains N templates of different layouts as candidate templates for intelligent layout. Each template includes the maximum height space that can be accommodated within the news section block. The news type is selected by the user.

[0068] Step 4: Combining the input information from Steps 2 and 3, firstly, using the information from the layout design principle database in Step 1, place the first, second, and third news items into the homepage template; then, use the FFD algorithm to select other news templates: First, sort the news in the news priority list; second, use the FFD algorithm in the automatic layout module 10 to select news templates from the template library in Step S3 based on the number of news items that should be placed in each template. The templates selected using the FFD algorithm are one or more templates selected from the template library, obtaining the number of templates and the content placed in each template.

[0069] like Figure 3 As shown, the FirstFit algorithm flowchart is as follows:

[0070] Step 1: Input an ordered sequence of binary tuples of length n, sq: (L1, S1), (L2, S2), ..., (Li, Si), and template capacity P. Let i = 1, j = 1, and Pj = P.

[0071] Step 2: Take out the \(i\)-th element \((L_i, S_i)\) of the binary tuple sequence and open the \(j\)-th container;

[0072] Step 3: Determine whether \((L_i, S_i)\) can be placed in the \(j\)-th container, that is, determine whether \(S_i < P_j\). If it can, go to Step 4. If not, let \(j = j + 1\) and repeat Step 3;

[0073] Step 4: Place the element \((L_i, S_i)\) into the \(j\)-th container. Determine whether \((L_i, S_i)\) is the last element of the sequence, that is, determine whether \(i = n\). If so, output the value \(j\) of the number of containers at this time, and the sequence of element numbers placed in each container. If not, let \(P_j = P_j - P\), \(i = i + 1\), \(j = j + 1\), and repeat Steps 2 to 4.

[0074] Among them, \(P\) represents the sum of the height dimensions of each column of the template, \(P_j\) is the capacity of the \(j\)-th container, \(n\) represents the sequence length, \(S\) represents the standard height space, \(L\) represents the title level, and \(i\) represents which element of the binary tuple sequence is taken out.

[0075] As Figure 4 shown, the typesetting style finally obtained by this typesetting system.

[0076] The above-described embodiments are only a preferred solution of the present invention and do not impose any form of limitation on the present invention. There are other variations and modifications without exceeding the technical solutions described in the claims.

Claims

1. An online automatic typesetting system based on electronic newspaper layout, characterized in that, The system includes: The front-end web module (1) is used to receive layout requests, upload layout editing parameters, and display layout styles; The backend server module (2) is used to extract the text and image content of each material file and to design the layout using the FFD algorithm and the FirstFit algorithm, and to execute the layout job. The database module (3) establishes a connection with the server via API and is used to store the template information for layout; the backend server module (2) is connected to the frontend web module (1) and the database module (3) respectively; The system also includes an automatic typesetting module (10), which includes a typesetting design unit that integrates page layout design principles, including the FFD algorithm and the FirstFit algorithm, and is capable of automatic typesetting; the automatic typesetting steps include: S1: Log in to the account management module (4), obtain operation permissions, design the operation module (5), select the news type, upload the relevant text style editing parameters and corresponding graphic files to the server and send an automatic layout signal; S2: The front-end and back-end communication module (9) receives the layout signal and transmits the layout signal to the automatic layout module (10). The automatic layout module (10) constructs an important design rule based on the layout design principle and a priority list of the original news material data. Each list item includes the height space occupied by the standardized news content after calculation. The constructed design rules and priority list are stored in the storage module (12). S3: Based on the news type, a signal is sent from the automatic typesetting module (10) to the database communication module (11), and the corresponding historical excellent template library is selected from the storage module (12) through the database communication module (11). Each type of template library contains N different templates as candidate templates for intelligent typesetting. S4: Using the information stored in the storage module (12) in step S2, put the news into the homepage template browsing module (7), display the current page information, and then use the FFD algorithm in the automatic layout module (10) to select the news template from the template library in step S3 according to the number of news items that should be placed in each template. In step S4, the specific steps for selecting other news templates using the FFD algorithm are as follows: S4.1: Sort the news in the news priority list; the sorting steps are as follows: (1) Sort the news materials from largest to smallest according to the standard height space; (2) Then, according to the news headline level, sort the headlines from highest to lowest in a stable sorting or bubble sort, and obtain a set of binary sequences sq such as (headline level L, standard height space S); S4.2: Using the FirstFit algorithm, obtain the required number of templates and the news content to be placed in each template from the template library based on the number of news items; Using the FFD algorithm, the appropriate number of templates are selected from the template library based on the number of news items to be placed. The text and image materials are combined into the corresponding tex file of the e-newsletter template. The FFD algorithm is used to select the tex file, and the news materials are filled into the tex file in the order of the algorithm. The resulting tex file is compiled by xelatex to obtain pdf and tex files, which are added to the historical generated template database and returned to the front-end page to complete the automatic layout.

2. The online automatic typesetting system based on electronic newspaper layout according to claim 1, characterized in that, The aforementioned front-end web module (1) includes: The account management module (4) is used to communicate with the backend server module (2) and the database module (3) to perform page redirection and obtain operation permissions; The design operation module (5) communicates with the backend server module (2) to upload relevant text style editing parameters and corresponding graphic files to the server and send an automatic layout signal; The history layout module (6) is used to communicate with the backend server module (2) and the database module (3) to display previously generated layout information; The template browsing module (7) communicates with the backend server module (2) and the database module (3) to display the layout information of the current design; The download and browsing module (8) communicates with the backend server module (2), receives text data from the server, displays the formatted e-newsletter, and provides downloads.

3. The online automatic typesetting system based on electronic newspaper layout according to claim 2, characterized in that, The backend server module (2) includes: The front-end and back-end communication module (9) is used to connect the front-end web module (1) and the back-end server module (2), including listening permission application, template library data display, historical layout data interaction, necessary layout parameter request, and current generated layout data return. It establishes communication with the account management module (4), design operation module (5), historical layout module (6), template browsing module (7), and download browsing module (8), respectively. The automatic layout module (10) includes a layout design unit that integrates layout design principles, including FFD algorithm and FirstFit algorithm, which can perform automatic layout. The database communication module (11) includes a specific database data interaction API for data interaction with the server.

4. The online automatic typesetting system based on electronic newspaper layout according to claim 3, characterized in that, The database module (3) includes: The storage module (12) establishes a connection with the server via API and is used to store user account passwords, historically automatically generated newspapers, and various layout style templates of historical excellent newspapers. The storage module (12) is connected to the database communication module (11).

5. A method for online automatic typesetting based on the typesetting system of claim 4, characterized in that, The specific steps of the online automatic typesetting method are as follows: S1: Log in to the account management module (4), obtain operation permissions, design the operation module (5), select the news type, upload the relevant text style editing parameters and corresponding graphic files to the server and send an automatic layout signal; S2: The front-end and back-end communication module (9) receives the layout signal and transmits the layout signal to the automatic layout module (10). The automatic layout module (10) constructs an important design rule based on the layout design principle and a priority list of the original news material data. Each list item includes the height space occupied by the standardized news content after calculation. The constructed design rules and priority list are stored in the storage module (12). S3: Based on the news type, a signal is sent from the automatic typesetting module (10) to the database communication module (11), and the corresponding historical excellent template library is selected from the storage module (12) through the database communication module (11). Each type of template library contains N different templates as candidate templates for intelligent typesetting. S4: Using the information stored in the storage module (12) in step S2, put the news into the homepage template browsing module (7), display the current page information, and then use the FFD algorithm in the automatic layout module (10) to select the news template from the template library in step S3 according to the number of news items that should be placed in each template. In step S4, the specific steps for selecting other news templates using the FFD algorithm are as follows: S4.1: Sort the news in the news priority list; the sorting steps are as follows: (1) Sort the news materials from largest to smallest according to the standard height space; (2) Then, according to the news headline level, sort the headlines from highest to lowest in a stable sorting or bubble sort, and obtain a set of binary sequences sq such as (headline level L, standard height space S); S4.2: Using the FirstFit algorithm, obtain the required number of templates and the news content to be placed in each template from the template library based on the number of news items.

6. The online automatic typesetting system and method based on electronic newspaper layout according to claim 5, characterized in that, In step S2, the standardization method is as follows: Calculate the height space occupied by the paragraph: F=C0×R×∑(C0×N i / c+1)+i×s, Calculate the height space occupied by each level of heading: H=C k ×R×∑(C k ×H k / c+1)+∑T k , Calculate the height space occupied by the image: G=∑h j , The standardization space for news materials is as follows: S = F + G + H Where C0 represents the body text font size, R represents the line spacing, c represents the width of a column in the template, i represents the number of paragraphs, and N represents the number of paragraphs. i This indicates the number of words in the text corresponding to the paragraph, S represents the paragraph spacing, k represents the headings at each level, and C represents the headings at each level. k H indicates the font size for each level of heading. k Indicates the word count for each level of heading, T k This indicates the vertical distance between headings and the body text; 'c' represents the width of a column in the template; 'j' represents the number of images; and 'h' represents the vertical distance between headings and the body text. j This indicates the corresponding height dimension of the image.

7. The online automatic typesetting system and method based on electronic newspaper layout according to claim 5, characterized in that, In step S4.2, the specific steps for obtaining the required number of templates using the FirstFit algorithm are as follows: S4.2.1: Input a sorted sequence of binary tuples of length n, sq: (L1, S1), (L2, S2), ..., (Ln, Sn), and template capacity P, let i = 1, j = 1, Pj = P; S4.2.2: Take out the i-th element (Li, Si) of the binary sequence and open the j-th container; S4.2.3: Determine whether (Li, Si) can be placed into the j-th container. If it can, proceed to step S4. If it cannot, let j = j + 1 and repeat step S3. S4.2.4: Place element (Li, Si) into the j-th container. Determine if (Li, Si) is the last element of the sequence. If it is, output the number j of the containers and the sequence of element numbers in each container. If not, let Pj = Pj - P, i = i + 1, j = j + 1, and repeat steps S2 to S4. Where P represents the sum of the height dimensions of each column in the template, Pj is the capacity of the j-th container, n represents the sequence length, S represents the standard height space, L represents the title level, and i represents the nth element of the binary sequence to be extracted.

Citation Information

Patent Citations

  • Printing typesetting system and method based on newspaper layout AI automatic typesetting design

    CN112001154A

  • Information processing apparatus, layout generating method, and computer program product

    CN102609227A

  • An online automatic image and text type setting system and a type setting method thereof

    CN106407173A