Multimedia network-oriented electronic publication automatic typesetting system and method

Through the adaptive font size calculation model and dynamic layout algorithm, the compatibility issues of multimedia electronic publications on different devices and browsers are solved, and efficient and high-quality multimedia content typesetting and file transmission are achieved.

CN120654655AInactive Publication Date: 2025-09-16SUZHOU DIGITAL POWER CULTURE COMM CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510792076.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-13
Publication Date
2025-09-16
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Existing automatic typesetting technology for electronic publications cannot effectively handle the dynamic layout adaptation and playback synchronization of multimedia elements, resulting in compatibility issues and affecting typesetting effects and efficiency.

Method used

Adaptive font size calculation model, content analysis module, layout planning module, dynamic content processing module and multimedia adaptation module are adopted, combined with ARIMA time series analysis and dynamic layout algorithm to achieve adaptive typesetting and terminal adaptation of multimedia content.

Benefits of technology

It improves the compatibility of multimedia elements on different devices and browsers, ensures the normal playback of multimedia elements such as video and audio, avoids page layout confusion, improves typesetting effects and efficiency, reduces file size, and improves transmission efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120654655A_ABST
    Figure CN120654655A_ABST
Patent Text Reader

Abstract

The invention discloses a multimedia network-oriented electronic publication automatic typesetting system and a multimedia network-oriented electronic publication automatic typesetting method, which relate to the technical field of electronic publication typesetting, and comprise a typesetting module for customizing multiple parameters of an initial layout of an electronic publication reader according to the type of a media terminal, analyzing and identifying the type of the media terminal by adopting equipment UA or API (Application Program Interface), establishing an adaptive font size calculation model to dynamically generate a basic typesetting rule, and outputting the basic typesetting rule to a layout planning module and a typesetting rule library; according to the invention, a basic typesetting rule is dynamically generated by establishing an adaptive font size calculation model, dynamic content data is acquired in a content analysis module by adopting an FFmpeg audio and video processing technology and an ARIMA time sequence analysis model, and format conversion and terminal adaptation are carried out by adopting a dynamic coding optimization algorithm and a multimedia cross-format compatible conversion algorithm. The compatibility of the electronic publication to the multimedia elements on different browsers and devices is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of electronic publication typesetting, and in particular to an automatic typesetting system and method for electronic publications oriented to multimedia networks. Background Art

[0002] With the development of multimedia network technology, the forms of electronic publications are becoming increasingly diverse. In addition to traditional text and pictures, they also contain multimedia content such as audio, video, animation, and dynamic content. However, the existing automatic typesetting technology for electronic publications has many shortcomings.

[0003] For example, the traditional EPUB standard's layout engine is primarily oriented towards static content and cannot dynamically handle layout adaptation and playback synchronization issues for video and audio. Consequently, compatibility issues exist when processing multimedia elements. Different browsers and devices have different support for multimedia formats such as audio and video, resulting in some multimedia elements not being able to play properly. It is difficult to layout dynamic content. The size changes of animations and interactive elements may cause confusion and misalignment in the page layout, affecting the overall layout effect. The existing responsive web design methods find it difficult to unify the layout rules of the fixed size of printed materials and the dynamic viewports of digital devices, resulting in inefficient multi-version generation and unsuitability for cross-terminal network environments.

[0004] Therefore, there is an urgent need to propose an automatic typesetting system and method for electronic publications for multimedia networks, which can support an adaptive method of mixed typesetting of dynamic content such as audio, video, and animation and static content such as text and images, and is particularly suitable for electronic publications that can be used across terminals such as mobile devices, printed materials, and AR / VR devices.

[0005] The above information disclosed in this Background section is only for enhancement of understanding of the background of the present disclosure and therefore it may contain information that does not form the prior art that is already known to a person of ordinary skill in the art. Summary of the Invention

[0006] The purpose of the present invention is to provide an automatic typesetting system and method for electronic publications for multimedia networks. The present invention dynamically generates basic typesetting rules by constructing an adaptive font size calculation model in a typesetting module, obtains content metadata by designing a content analysis module, combines a typesetting rule library, uses an adaptive grid algorithm and a reinforcement learning layout optimization algorithm to plan page layout, and adopts a dynamic layout algorithm to automatically adjust the page layout scheme to solve the problems in the above-mentioned background technology.

[0007] To achieve the above objectives, the present invention provides the following technical solutions: an automatic typesetting system for electronic publications on multimedia networks, comprising a layout module that customizes multiple parameters of the initial layout of the electronic publication reader according to the type of media terminal, uses the device UA or API to parse and identify the media terminal type, establishes an adaptive font size calculation model to dynamically generate basic typesetting rules, and outputs the generated basic typesetting rules to a layout planning module and a typesetting rule library; Content Analysis Module: This module parses the original content of electronic publications, extracts semantic tags using the BERT model, extracts visual features using the ResNet-50 image recognition algorithm, extracts format, duration, and resolution using FFmpeg audio and video processing technology, and uses the ARIMA time series analysis model to monitor the changing patterns of dynamic content and predict update frequency. The module then outputs content metadata and passes it to the layout planning module and the dynamic content processing module. Layout planning module: Receives content metadata from the content analysis module, combines it with the typesetting rule library, uses the adaptive grid algorithm and reinforcement learning layout optimization algorithm to plan the page layout, generates a page layout plan with a JSON structure, and transmits it to the automatic typesetting execution and storage output module; Layout rule library: This stores layout rules adapted for different types of media terminals. It has a built-in Drools rule management engine and a semantic mapping table for processing dynamic content. This library is used for dynamic rule matching and provides the content analysis module, layout planning module, dynamic content processing module, and multimedia adaptation module with the standards and specifications required for layout. Dynamic content processing module: This module monitors the changing patterns of dynamic content and predicts update frequency based on the ARIMA time series analysis model. When dynamic content updates are detected in real time, it automatically adjusts the page layout using a dynamic layout algorithm, outputs the updated layout instructions, and passes them to the automatic typesetting execution and storage output module. Multimedia Adaptation Module: This module extracts format, duration, and resolution data based on the FFmpeg audio and video processing technology in the content analysis module. Combined with network status data, it uses a dynamic encoding optimization algorithm and a multimedia cross-format compatible conversion algorithm to perform format conversion and terminal adaptation, and outputs multimedia element data. Automatic typesetting execution and saving output module: receives the page layout plan, updated layout instructions and adapted multimedia element data, uses CSSGrid / Flexbox rendering engine to convert the page layout plan into CSS code, uses WebGL rendering technology to convert the layout information of the updated layout instructions into the actual typesetting page, generates interactive HTML / CSS / JS page typesetting results, and exports electronic publications in PDF / EPUB / HTML electronic document formats based on the typesetting results, uses Brotli to compress text resources and WebP to optimize image compression algorithm for file size optimization and storage.

[0008] Optionally, the steps of establishing the adaptive font size calculation model are as follows: Enter the media terminal type, and use the preset font size benchmark values ​​to enter parameter information for the screen viewport size, reading distance, and font type. Taking a single column as an example, the base text size for mobile devices and e-readers is the same, both 14px, and the base headline font size is the same, both 24px. The base text size for desktop devices is 18px, and the base headline font size is 32px. The base text size for smart TVs is 36px, and the base headline font size is 64px. For double columns, the base text size and base headline font size are both halved, and for multi-columns, the base text size and base headline font size are scaled by the multiple of the single column. The default reading distance for mobile devices, desktop devices, and e-readers is 40cm. The default reading distance for smart TVs is 150cm. Font types include Songti, Heiti and Kaiti; The dynamic calculation formula for designing adaptive font size based on parameter information is: ,and , , where Represents the final font size output by the adaptive font size calculation model, Expressed as the font size base value, Expressed as the viewport scaling factor of the media endpoint, Expressed as a compensation factor for reading distance, The font factor expressed as the font type, and , Indicates the actual screen width of the input media terminal. Indicates the actual screen height of the input media terminal. Expressed as the screen width value of the reference media terminal, Expressed as the screen height value of the reference media terminal, Indicates the screen viewport size of the actual input media terminal. Expressed as the screen viewport size of the reference media terminal, Expressed as the benchmark reading distance, Indicates the actual reading distance; And the calculation formula for line spacing is , where Indicates line spacing, Expressed as a fixed multiple, Expressed as font size, unit pixel px; The calculation formula for segment spacing is ,and , , where Expressed as The paragraph spacing before the level heading, Expressed as the paragraph spacing coefficient, Expressed as The paragraph spacing after the level heading, Expressed as the paragraph spacing coefficient, Expressed as Level title, and ; Basic typesetting rules include determining the parameter values ​​of the main text font size, title font size, line spacing, paragraph spacing, and paragraph spacing, which are dynamically calculated and output through an adaptive font size calculation model.

[0009] Optionally, the steps of extracting semantic labels by the BERT model are as follows: Input the original content of the electronic publication, parse the text sentences and list them, use the WordPiece algorithm to convert each sentence into a token sequence, and then convert the token sequence into an embedding vector. The expression of the text sentence list is , where a list of sentences represented as text, Indicated as the first a sentence; The expression of Token sequence is , where Represented as a classification mark, Represents a separator; The expression of the embedding vector is , where Represented as the embedding vector that converts the Token sequence, is represented as a real matrix, Expressed as including and The sequence length, is represented as the embedding dimension, and ; Embedding vector Input into the pre-trained BERT model, use the Transformer encoder in the pre-trained BERT model for encoding, learn the contextual representation of the text, and use the multi-head self-attention mechanism and feedforward neural network to calculate the BERT model output; Extract semantic features from the BERT model output and take the output vector corresponding to the [CLS] tag as the semantic representation of the entire text; Use the fully connected layer to classify the extracted semantic features, output the label probability distribution, and obtain the semantic label with the maximum label probability distribution as the text. The calculation formula of the label probability distribution is ,and , where Represents the given input A sequence of sentences When , the probability distribution of label y is, Represented as semantic labels, Represented as the weight matrix of the fully connected layer, It is represented as extracting the [CLS] vector through the Transformer encoder, Represented as the bias vector of the fully connected layer, Represented as the predicted semantic label, It is expressed as a mathematical function that finds the class label with the highest probability from the probability distribution.

[0010] Optionally, the steps of extracting visual features using the ResNet-50 image recognition algorithm are as follows: Input the original content of the electronic publication, parse the original content image and perform the initial convolution layer operation to obtain the preprocessed image. The image pixel size of the preprocessed image must meet the input requirements of the ResNet-50 model. The expression of the preprocessed image is ,and , Where, Represented as a preprocessed image, It is represented as the convolution kernel size, Expressed as a step size of 2, Represented as the input image height, Represented as the input image width, Expressed as the number of RGB channels, Represented as input image; The pre-processed image is input into the ResNet-50 image recognition algorithm, which is calculated by stacking residual blocks and then gradually extracting image features through convolutional layers and pooling layers. The calculation formula is , where Expressed as The residual block outputs the feature map, Expressed as activation function, Expressed as The input feature map of the residual block, is represented as the residual function of the three-layer convolution operation, and The three-layer convolution includes Convolution, reducing the number of channels and dimensionality reduction processing, Convolution, spatial feature extraction, Convolution, restore the number of channels and increase the dimension; The global average pooling calculation formula of image features is: ,and , where Represented as the first output of the global average pooling image feature vectors, is represented as the feature map height, and , is represented as the feature map width, and , Represented as a scalar element in a vector, is represented as a feature map input, and .

[0011] The image feature dimensionality reduction is performed through the last fully connected layer of the ResNet-50 image recognition algorithm as the visual features of the output image. The calculation formula for the fully connected layer feature dimensionality reduction is: , where Represented as the image feature vector after dimensionality reduction, Represented as the weight matrix of the fully connected layer, Represented as the bias vector of the fully connected layer.

[0012] Optionally, the steps of performing page layout planning of the adaptive grid algorithm are as follows: Create a basic grid based on the width, height, and number of columns of the device viewport, including the number of rows and columns, and the width and height of the cells. The calculation formula for the width and height of the cells is: ,and , where Expressed as the width of the cell, Expressed as the height of the cell; The element priority weight is calculated based on the content metadata, where the calculation formula of the element priority weight is: ,and , where Including text, pictures, video / animation streams and dynamic content, and the weight coefficient of audio and video is 0.6, the weight coefficient of dynamic content is 0.5, the weight coefficient of pictures is 0.4, and the weight coefficient of text is 0.3. , Represented as the historical frequency of user interaction with the element, Respectively expressed as corresponding 、 、 The weight value of Use the greedy placement algorithm to traverse the elements in descending order of priority, try to find continuous free areas in the grid, and set matching rules. The matching rule is set to place the element directly in the free area when the width of the element is ≤ the width of the free area and the height of the element is ≤ the height of the free area. When the width of the element is greater than the width of the idle area, or the height of the element is greater than the height of the idle area, space compression is triggered, and , the size of the new element after compression is ; When faced with overlapping elements, a conflict resolution algorithm is used to initiate grid reconstruction, adjust and optimize the page layout.

[0013] Optionally, the steps of the Drools rule management engine and the semantic mapping table processing dynamic content are as follows: Define the Drools rule language DRL syntax in the typesetting rule library to write business rules for typesetting requirements; Insert content metadata as facts into Drools' working memory; Use the Drools rule engine to match facts inserted into the working memory with rules in the rule base; By executing modification or decision RHS actions, the processed content information is output and typesetting instructions are generated; Construct a semantic mapping table to record the mapping relationship between different semantic tags and typesetting rules; Associating the semantic tags extracted by the content analysis module with the semantic mapping table to find the corresponding typesetting rules for semantic tag matching; The dynamic content is typeset according to the associated typesetting rules.

[0014] Optionally, the steps of obtaining the multimedia element data are as follows: Use the FFmpeg tool to establish a relationship with the original multimedia files containing audio, video and animation, use FFmpeg's functions to execute commands, parse the multimedia files, and extract the format, duration and resolution data from the file's metadata; Use integrated network monitoring tools to obtain real-time network status information through the network interface, including network bandwidth, packet loss rate, and delay parameters; A dynamic encoding optimization algorithm is used to adjust multimedia encoding information according to network bandwidth, and a multimedia cross-format compatible conversion algorithm is used to convert multimedia files into new formats suitable for different terminal devices and browsers. The encoding information includes real-time encoding bit rate, video resolution scaling ratio, image quality loss assessment, and playback compatibility score calculation. The formula for calculating the real-time encoding bit rate is: , where Expressed as real-time encoding bit rate, Expressed as bandwidth utilization, Expressed as network bandwidth, Expressed as safety margin; The calculation formula for video resolution scaling is: , where Expressed as video resolution scaling ratio, Expressed as the original bit rate, It is expressed to maintain the area ratio; The calculation formula for evaluating image quality loss is: , where Expressed as the image quality loss assessment value, is represented as the maximum value of the pixel, and , Expressed as the mean square error between the original frame and the compressed frame; The calculation formula for calculating the playback compatibility score is ,and , where Expressed as a playback compatibility score, Expressed as the weight coefficient of the corresponding browser format support, Expressed as browser format support, and , Expressed as the weight coefficient of the corresponding device decoding coverage, is expressed as device decoding coverage, and ; The format, duration, and resolution data of the extracted multimedia files are integrated with the encoding information and new format content after network bandwidth adjustment and adaptation processing to form a complete multimedia element data set.

[0015] The automatic typesetting method of electronic publications for multimedia networks comprises the following steps: S1. Customize multiple parameters of the initial layout of the electronic publication reader based on the media terminal type, use the device UA or API to parse and identify the media terminal type, establish an adaptive font size calculation model to dynamically generate basic layout rules, and output them to the layout planning module and layout rule library; S2. Parse the original content of electronic publications, extract semantic tags using the BERT model, extract visual features using the ResNet-50 image recognition algorithm, extract format, duration, and resolution using FFmpeg audio and video processing technology, and use the ARIMA time series analysis model to monitor the changing patterns of dynamic content and predict update frequency. Output content metadata and pass it to the layout planning module and dynamic content processing module. S3, receiving content metadata from the content analysis module, combining it with the typesetting rule library, using the adaptive grid algorithm and reinforcement learning layout optimization algorithm to plan the page layout, generating a page layout solution with a JSON structure, and transmitting it to the automatic typesetting execution and storage output module; S4 stores layout rules adapted to different types of media terminals, has a built-in Drools rule management engine, and sets up a semantic mapping table to process dynamic content. This is used for dynamic rule matching, providing the content analysis module, layout planning module, dynamic content processing module, and multimedia adaptation module with the standards and specifications required for layout. S5. Monitor the changing patterns of dynamic content and predict the update frequency based on the ARIMA time series analysis model. When dynamic content updates are detected in real time, use the dynamic layout algorithm to automatically adjust the page layout scheme, output the updated layout instructions, and pass them to the automatic typesetting execution and storage output module; S6. Extracting format, duration, and resolution data based on the FFmpeg audio and video processing technology in the content analysis module, combining it with network status data, and using a dynamic encoding optimization algorithm and a multimedia cross-format compatibility conversion algorithm to perform format conversion and terminal adaptation, output multimedia element data, and pass it to the automatic typesetting execution and storage output module; S7. Receive the page layout plan, updated layout instructions, and adapted multimedia element data, use the CSSGrid / Flexbox rendering engine to convert the page layout plan into CSS code, use WebGL rendering technology to convert the layout information of the updated layout instructions into the actual layout page, generate the interactive HTML / CSS / JS page layout results, and export the electronic publication in the electronic document format of PDF / EPUB / HTML based on the layout results. Use Brotli to compress text resources and WebP to optimize image compression algorithms for file size optimization and storage.

[0016] A computer device comprises: a memory and a processor; the memory stores a computer program, and the processor implements the steps of the above-mentioned multimedia network-oriented electronic publication automatic typesetting system when executing the computer program.

[0017] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the above-mentioned automatic typesetting system for electronic publications oriented to multimedia networks.

[0018] In the above technical solution, the technical effects and advantages provided by the present invention are: The present invention establishes an adaptive font size calculation model to dynamically generate basic typesetting rules. In the content analysis module, it uses FFmpeg audio and video processing technology and the ARIMA time series analysis model to obtain dynamic content data. By employing a dynamic encoding optimization algorithm and a multimedia cross-format compatible conversion algorithm for format conversion and terminal adaptation, the present invention effectively solves the problem that the traditional EPUB standard typesetting engine cannot dynamically process video and audio layout adaptation and playback synchronization. It overcomes the compatibility issues caused by different browsers and devices supporting different multimedia formats, improves the compatibility of electronic publications with multimedia elements on different browsers and devices, and ensures that multimedia elements such as video and audio can be played normally in various environments. By using the ARIMA time series analysis model to monitor the changing patterns of dynamic content and predict the update frequency, and combining it with a dynamic layout algorithm to automatically adjust the page layout, we can avoid page layout confusion and misalignment caused by changes in the size of animations and interactive elements, improve the layout of dynamic content, and provide users with a better reading experience. Based on multimedia element data, the CSS Grid / Flexbox rendering engine is used to convert the page layout plan into CSS code, and the WebGL rendering technology is used to convert the layout information into the actual typesetting page. Combined with Brotli compressed text resources and WebP optimized image compression algorithm, the file size is optimized for storage. This not only unifies the typesetting rules of different terminals, improves the efficiency of multi-version generation, and enables electronic publications to adapt to various devices in a multimedia network environment, but also effectively reduces file size, improves the efficiency of file transmission in a network environment, and is more conducive to the dissemination of electronic publications. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, a brief introduction to the drawings required for use in the embodiments will be given below. Obviously, the drawings described below are only some embodiments recorded in the present invention. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.

[0020] Figure 1 This is a module block diagram of the automatic typesetting system for electronic publications in multimedia networks according to the present invention.

[0021] Figure 2 The present invention is a flow chart of the automatic typesetting method for electronic publications in a multimedia network.

[0022] Figure 3 This is a rule triggering flow chart of the typesetting rule library of the present invention. DETAILED DESCRIPTION

[0023] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, these example embodiments are provided so that the description of this disclosure will be thorough and complete and will fully convey the concepts of the example embodiments to those skilled in the art.

[0024] Example 1 The present invention provides Figure 1 The illustrated automatic typesetting system for electronic publications for multimedia networks includes a layout module that customizes multiple parameters of the initial layout of the electronic publication reader based on the media terminal type, including page size, columns, and margins, and determines paragraph styles and object styles based on the page size. It uses device UA or API parsing to identify the media terminal type, establishes an adaptive font size calculation model, and dynamically generates basic typesetting rules for text font size, title font size, line spacing, paragraph spacing, and paragraph spacing, and outputs these to the layout planning module and typesetting rule library. Specifically, the custom rules for multiple parameters are as follows: Utilize device UA or API parsing to identify media terminal types, including identifying media terminal types through browser device UA strings, including mobile devices, desktop devices, e-readers, and smart TVs, and utilizing device APIs to detect the screen size, pixel density, and operating system of each media terminal type; Multiple parameters include layout size, columns, margins, and paragraph and object styles are determined based on the layout size; The following table shows the values ​​of multiple parameters determined based on the different types of media terminals:

[0025] Specifically, the steps for establishing the adaptive font size calculation model are as follows: Enter the media terminal type, and use the preset font size benchmark values ​​to enter parameter information for the screen viewport size, reading distance, and font type. Taking a single column as an example, the base text size for mobile devices and e-readers is the same, both 14px, and the base headline font size is the same, both 24px. The base text size for desktop devices is 18px, and the base headline font size is 32px. The base text size for smart TVs is 36px, and the base headline font size is 64px. For double columns, the base text size and base headline font size are both halved, and for multi-columns, the base text size and base headline font size are scaled by the multiple of the single column. The default reading distance for mobile devices, desktop devices, and e-readers is 40cm. The default reading distance for smart TVs is 150cm. Font types include Songti, Heiti and Kaiti; The dynamic calculation formula for designing adaptive font size based on parameter information is: ,and , , where Represents the final font size output by the adaptive font size calculation model, Expressed as the font size base value, Expressed as the viewport scaling factor of the media endpoint, Expressed as a compensation factor for reading distance, The font factor expressed as the font type, and , Indicates the actual screen width of the input media terminal. Indicates the actual screen height of the input media terminal. Expressed as the screen width value of the reference media terminal, Expressed as the screen height value of the reference media terminal, Indicates the screen viewport size of the actual input media terminal. Expressed as the screen viewport size of the reference media terminal, Expressed as the benchmark reading distance, Indicates the actual reading distance; And the calculation formula for line spacing is , where Indicates line spacing, Expressed as a fixed multiple, Expressed as font size, unit pixel px; The calculation formula for segment spacing is ,and , , where Expressed as The paragraph spacing before the level heading, Expressed as the paragraph spacing coefficient, Expressed as The paragraph spacing after the level heading, Expressed as the paragraph spacing coefficient, Expressed as Level title, and ; The basic typesetting rules include determining the parameter values ​​of the main text font size, title font size, line spacing, paragraph spacing, and paragraph spacing, which are dynamically calculated and output through an adaptive font size calculation model. For example, in the adaptive font size calculation model, the media terminal is input as a desktop device in single-column mode, and the preset font size benchmark values ​​include a main text font size benchmark value of 18px, a title font size benchmark value of 32px, an input screen viewport size of 1920x1080px, a reading distance benchmark default value of 40cm, and parameter information of a bold font type. Assuming that the actual width and height of the desktop device screen are 1860x1080px and the actual reading distance is 60cm, the basic typesetting rules are output according to the adaptive font size calculation model, where: Including the output text font size is , title font size ,symbol For rounding calculation; Line spacing includes text line spacing , title line spacing ; Paragraph spacing includes title and body, and the spacing before the title paragraph , spacing after title paragraph , and the default paragraph spacing coefficient of the first-level title is 1.5, and the paragraph spacing coefficient is 1; Spacing before body paragraph , spacing after the body paragraph , and the default paragraph spacing coefficient for the text is 0.5, and the paragraph spacing coefficient is 0.5.

[0026] Content Analysis Module: This module analyzes the original content of electronic publications, including dynamic content such as text, images, video / animation streams, and real-time data. It uses the BERT model to extract semantic tags, the ResNet-50 image recognition algorithm to extract visual features, and FFmpeg audio and video processing technology to extract format, duration, and resolution. It also uses the ARIMA time series analysis model to monitor the changing patterns of dynamic content and predict update frequency. The module then outputs content metadata and passes it to the layout planning module and the dynamic content processing module. Specifically, the steps for extracting semantic labels by the BERT model are as follows: Input the original content of the electronic publication, parse the text sentences and list them, use the WordPiece algorithm to convert each sentence into a token sequence, and then convert the token sequence into an embedding vector. The expression of the text sentence list is , where a list of sentences represented as text, Indicated as the first a sentence; The expression of Token sequence is , where Represented as a classification mark, Represents a separator; The expression of the embedding vector is , where Represented as the embedding vector that converts the Token sequence, is represented as a real matrix, Expressed as including and The sequence length, is represented as the embedding dimension, and ; Embedding vector Input into the pre-trained BERT model, use the Transformer encoder in the pre-trained BERT model for encoding, learn the contextual representation of the text, and use the multi-head self-attention mechanism and feedforward neural network to calculate the BERT model output. The calculation formula of the multi-head self-attention mechanism is ,and , , where Represented as the output value of the multi-head self-attention mechanism, Represented as a softmax function, Represented as query matrix, key matrix and value matrix respectively, Represented as transpose, 、 、 are all represented as learnable projection matrices corresponding to the query matrix, key matrix, and value matrix, and , is represented as the key vector dimension used to scale the attention scores, Denoted as the embedding dimension, Expressed as 12 heads; The calculation formula of the feedforward neural network is , where is represented as the output of the feedforward neural network, Represented as ReLU activation function, Represented as the output of the multi-head self-attention mechanism, Represented as the first layer learnable weight matrix, Represented as the first layer bias vector, Represented as the first layer linear transformation result, Represented as the second layer learnable weight matrix, Represented as the second layer bias vector; The expression of residual connection is , where Represented as a multi-head self-attention mechanism and residual connections of a feedforward neural network; Extract semantic features from the BERT model output and take the output vector corresponding to the [CLS] tag as the semantic representation of the entire text; Use the fully connected layer to classify the extracted semantic features, output the label probability distribution, and obtain the semantic label with the maximum label probability distribution as the text. The calculation formula of the label probability distribution is ,and , where Represents the given input A sequence of sentences When , the probability distribution of label y is, Represented as semantic labels, Represented as the weight matrix of the fully connected layer, It is represented as extracting the [CLS] vector through the Transformer encoder, Represented as the bias vector of the fully connected layer, Represented as the predicted semantic label, It is expressed as a mathematical function that finds the class label with the highest probability from the probability distribution.

[0027] Specifically, the steps for extracting visual features using the ResNet-50 image recognition algorithm are as follows: Input the original content of the electronic publication, parse the original content image and perform the initial convolution layer operation to obtain the preprocessed image. The image pixel size of the preprocessed image must meet the input requirements of the ResNet-50 model. The expression of the preprocessed image is ,and , Where, Represented as a preprocessed image, It is represented as the convolution kernel size, Expressed as a step size of 2, Represented as the input image height, Represented as the input image width, Expressed as the number of RGB channels, Represented as input image; The pre-processed image is input into the ResNet-50 image recognition algorithm, which is calculated by stacking residual blocks and then gradually extracting image features through convolutional layers and pooling layers. The calculation formula is , where Expressed as The residual block outputs the feature map, Expressed as activation function, Expressed as The input feature map of the residual block, is represented as the residual function of the three-layer convolution operation, and The three-layer convolution includes Convolution, reducing the number of channels and dimensionality reduction processing, Convolution, spatial feature extraction, Convolution, restore the number of channels and increase the dimension; The global average pooling calculation formula of image features is: ,and , where Represented as the first output of the global average pooling image feature vectors, is represented as the feature map height, and , is represented as the feature map width, and , Represented as a scalar element in a vector, is represented as a feature map input, and .

[0028] The image feature dimensionality reduction is performed through the last fully connected layer of the ResNet-50 image recognition algorithm as the visual features of the output image. The calculation formula for the fully connected layer feature dimensionality reduction is: , where Represented as the image feature vector after dimensionality reduction, Represented as the weight matrix of the fully connected layer, Represented as the bias vector of the fully connected layer.

[0029] Specifically, the steps for extracting format, duration, and resolution using FFmpeg audio and video processing technology are as follows: Use FFmpeg command line tool to directly read the file header information of audio and video files and extract the file format information from it; By parsing the metadata of audio and video files, the duration information of the audio and video is obtained, and the resolution information of the video, including width and height, is extracted.

[0030] Specifically, the steps for obtaining content metadata are as follows: Use the ARIMA time series model to calculate the update interval for the dynamic content of the input historical update timestamp sequence, and use autoregressive AR and moving average MA for fitting processing to output the predicted update interval; Metadata such as semantic tags, visual features, format, duration, resolution, and predicted update interval are received and integrated to obtain content metadata.

[0031] Layout planning module: Receives content metadata from the content analysis module, combines it with the typesetting rule library, uses the adaptive grid algorithm and reinforcement learning layout optimization algorithm to plan the page layout, generates a page layout plan with a JSON structure, and transmits it to the automatic typesetting execution and storage output module; Specifically, the steps for page layout planning using the adaptive grid algorithm are as follows: Create a basic grid based on the width, height, and number of columns of the device viewport, including the number of rows and columns, and the width and height of the cells. The calculation formula for the width and height of the cells is: ,and , where Expressed as the width of the cell, Expressed as the height of the cell; The element priority weight is calculated based on the content metadata, where the calculation formula of the element priority weight is: ,and , where Including text, pictures, video / animation streams and dynamic content, and the weight coefficient of audio and video is 0.6, the weight coefficient of dynamic content is 0.5, the weight coefficient of pictures is 0.4, and the weight coefficient of text is 0.3. , Represented as the historical frequency of user interaction with the element, Respectively expressed as corresponding 、 、 The weight value of Use the greedy placement algorithm to traverse the elements in descending order of priority, try to find continuous free areas in the grid, and set matching rules. The matching rule is set to place the element directly in the free area when the width of the element is ≤ the width of the free area and the height of the element is ≤ the height of the free area. When the width of the element is greater than the width of the idle area, or the height of the element is greater than the height of the idle area, space compression is triggered, and , the size of the new element after compression is ; When faced with overlapping elements, a conflict resolution algorithm is used to initiate grid reconstruction, adjust and optimize the page layout.

[0032] Specifically, the steps of page layout planning by the reinforcement learning layout optimization algorithm are as follows: The page layout of an electronic publication is considered as an environment. The state of the environment is composed of content metadata and layout scheme information in the typesetting rule library. The state space includes elements, sizes, positions, types, update flags, and device viewport width and height parameters. Defines actions for adjusting layout elements. The action space includes scaling, folding, line breaking, and paging. Design a reward function to evaluate the quality of each action based on performance rationality, aesthetics, and user experience factors; The reinforcement learning PPO algorithm is used to continuously try different actions in the environment, and learn the optimal page layout strategy and network update based on the feedback of the reward function.

[0033] Layout rule library: This stores layout rules adapted for different types of media terminals. It has a built-in Drools rule management engine and a semantic mapping table for processing dynamic content. This library is used for dynamic rule matching and provides the content analysis module, layout planning module, dynamic content processing module, and multimedia adaptation module with the standards and specifications required for layout. Specifically, the steps for the Drools rule management engine and semantic mapping table to process dynamic content are as follows: Define the Drools rule language DRL syntax in the typesetting rule library to write business rules for typesetting requirements; Insert content metadata as facts into Drools' working memory; Use the Drools rule engine to match facts inserted into the working memory with rules in the rule base; By executing modification or decision RHS actions, the processed content information is output and typesetting instructions are generated; Construct a semantic mapping table to record the mapping relationship between different semantic tags and typesetting rules; Associating the semantic tags extracted by the content analysis module with the semantic mapping table to find the corresponding typesetting rules for semantic tag matching; The dynamic content is typeset according to the associated typesetting rules.

[0034] Dynamic content processing module: This module monitors the changing patterns of dynamic content and predicts update frequency based on the ARIMA time series analysis model. When dynamic content updates are detected in real time, it automatically adjusts the page layout using a dynamic layout algorithm, outputs the updated layout instructions, and passes them to the automatic typesetting execution and storage output module. Specifically, the steps for the dynamic layout algorithm to automatically adjust the page layout scheme are as follows: Get the JSON structure of the current page layout state, obtain dynamic content update events, including elements, new content size, and update type, and extract the predicted update interval of the ARIMA time series analysis model and input it into the dynamic layout algorithm; Prioritize each layout element on the page and assess the extent to which each layout element will be affected based on the impact analysis of the updated content. Based on the priority and impact of layout elements, actual adjustments are made to the page layout according to the established adjustment strategies for in-situ scaling, horizontal expansion, vertical folding, element position, element size, and space allocation. During the adjustment process, the effects of the layout adjustments are previewed in real time to verify whether the adjusted layout meets the page's typesetting requirements and visual aesthetics. After the adjustment is completed, the new layout plan is organized into detailed instructions to generate updated layout instructions.

[0035] Multimedia Adaptation Module: This module extracts format, duration, and resolution data based on the FFmpeg audio and video processing technology in the content analysis module. Combined with network status data, it uses a dynamic encoding optimization algorithm and a multimedia cross-format compatibility conversion algorithm to perform format conversion and terminal adaptation. It then outputs multimedia element data to ensure normal playback across different browsers and devices, and passes the multimedia element data to the automatic typesetting, execution, and storage output module. Specifically, the steps for obtaining multimedia element data are as follows: Use the FFmpeg tool to establish a relationship with the original multimedia files containing audio, video and animation, use FFmpeg's functions to execute commands, parse the multimedia files, and extract the format, duration and resolution data from the file's metadata; Use integrated network monitoring tools to obtain real-time network status information through the network interface, including network bandwidth, packet loss rate, and delay parameters; A dynamic encoding optimization algorithm is used to adjust multimedia encoding information according to network bandwidth, and a multimedia cross-format compatible conversion algorithm is used to convert multimedia files into new formats suitable for different terminal devices and browsers. The encoding information includes real-time encoding bit rate, video resolution scaling ratio, image quality loss assessment, and playback compatibility score calculation. The formula for calculating the real-time encoding bit rate is: , where Expressed as real-time encoding bit rate, Expressed as bandwidth utilization, Expressed as network bandwidth, Expressed as safety margin; The calculation formula for video resolution scaling is: , where Expressed as video resolution scaling ratio, Expressed as the original bit rate, It is expressed to maintain the area ratio; The calculation formula for evaluating image quality loss is: , where Expressed as the image quality loss assessment value, is represented as the maximum value of the pixel, and , Expressed as the mean square error between the original frame and the compressed frame; The calculation formula for calculating the playback compatibility score is ,and , where Expressed as a playback compatibility score, Expressed as the weight coefficient of the corresponding browser format support, Expressed as browser format support, and , Expressed as the weight coefficient of the corresponding device decoding coverage, is expressed as device decoding coverage, and ; The format, duration, and resolution data of the extracted multimedia files are integrated with the encoding information and new format content after network bandwidth adjustment and adaptation processing to form a complete multimedia element data set.

[0036] Automatic typesetting execution and saving output module: Receives page layout schemes, updated layout instructions and adapted multimedia element data, uses CSSGrid / Flexbox rendering engines to convert page layout schemes into CSS code, uses HTML5Canvas elements in WebGL rendering technology to implement complex animations and 3D content rendering, uses graphics processors GPU for hardware accelerated synthesis, combines shaders to control rendering details, and thus converts the layout information of updated layout instructions into actual typesetting pages, generates interactive HTML / CSS / JS page typesetting results, and exports electronic publications in PDF / EPUB / HTML electronic document formats based on the typesetting results, uses Brotli compressed text resources and WebP optimized image compression algorithms for optimized file size storage, and supports efficient publishing and dissemination in multimedia network environments.

[0037] Specifically, the actual conversion steps of the typesetting page are as follows: Parse the page layout scheme, updated layout instructions and adapted multimedia element data, and extract layout, style and content information; Use the CSS Grid / Flexbox rendering engine to convert the page layout plan into CSS code containing element style, position, and size information based on layout, style, and content information; For complex animations and 3D content, the HTML5 Canvas element in WebGL rendering technology is used for rendering. At the same time, the graphics processor (GPU) is used for hardware-accelerated synthesis, shifting the rendering process from the CPU to the GPU to improve rendering performance. Shaders are also used to control lighting effects and texture mapping rendering details. Convert the layout information of the updated layout instructions into the actual typesetting page, and accurately arrange and display the elements according to the layout plan and rendering results; Combined with JavaScript code, add interactive functions such as click events of elements and triggering of animation effects to the page, and generate interactive HTML / CSS / JS page layout results; Verify and debug the generated pages to ensure their compatibility and display effects on different browsers and devices; Export electronic publications in PDF / EPUB / HTML electronic document formats from the generated typesetting results according to actual needs.

[0038] Specifically, the steps for file size optimization are as follows: Use the Brotli algorithm to configure compression level parameters and compress text resources; Filter out all JPEG and PNG format image files that need to be optimized on the page, first convert the selected images to be optimized into WebP format, then use the WebP optimization image compression algorithm, adjust the image quality and transparency compression parameters of WebP according to the characteristics and usage scenarios of the selected images to be optimized, and optimize the WebP format images. Among them, the image quality of WebP is related to the image file size, and the relationship between the image file size and the image quality of WebP is expressed as follows: , where The file size of the WebP image in bytes. is the image quality, and , Expressed as an empirical coefficient based on different image contents, It is expressed as an empirical coefficient based on the characteristics of the WebP encoder. Expressed as a constant representing the basic cost of the image; Combine and store the compressed text resources and the image files that have been optimized for WebP format.

[0039] Example 2 The present invention provides Figure 2 The method for automatically typesetting electronic publications for multimedia networks includes the following steps: S1. Customize multiple parameters of the initial layout of the electronic publication reader based on the media terminal type, use the device UA or API to parse and identify the media terminal type, establish an adaptive font size calculation model to dynamically generate basic layout rules, and output them to the layout planning module and layout rule library; S2. Parse the original content of electronic publications, extract semantic tags using the BERT model, extract visual features using the ResNet-50 image recognition algorithm, extract format, duration, and resolution using FFmpeg audio and video processing technology, and use the ARIMA time series analysis model to monitor the changing patterns of dynamic content and predict update frequency. Output content metadata and pass it to the layout planning module and dynamic content processing module. S3, receiving content metadata from the content analysis module, combining it with the typesetting rule library, using the adaptive grid algorithm and reinforcement learning layout optimization algorithm to plan the page layout, generating a page layout solution with a JSON structure, and transmitting it to the automatic typesetting execution and storage output module; S4 stores layout rules adapted to different types of media terminals, has a built-in Drools rule management engine, and sets up a semantic mapping table to process dynamic content. This is used for dynamic rule matching, providing the content analysis module, layout planning module, dynamic content processing module, and multimedia adaptation module with the standards and specifications required for layout. S5. Monitor the changing patterns of dynamic content and predict the update frequency based on the ARIMA time series analysis model. When dynamic content updates are detected in real time, use the dynamic layout algorithm to automatically adjust the page layout scheme, output the updated layout instructions, and pass them to the automatic typesetting execution and storage output module; S6. Extracting format, duration, and resolution data based on the FFmpeg audio and video processing technology in the content analysis module, combining it with network status data, and using a dynamic encoding optimization algorithm and a multimedia cross-format compatibility conversion algorithm to perform format conversion and terminal adaptation, output multimedia element data, and pass it to the automatic typesetting execution and storage output module; S7. Receive the page layout plan, updated layout instructions, and adapted multimedia element data, use the CSSGrid / Flexbox rendering engine to convert the page layout plan into CSS code, use WebGL rendering technology to convert the layout information of the updated layout instructions into the actual layout page, generate the interactive HTML / CSS / JS page layout results, and export the electronic publication in the electronic document format of PDF / EPUB / HTML based on the layout results. Use Brotli to compress text resources and WebP to optimize image compression algorithms for file size optimization and storage.

[0040] The automatic typesetting method for electronic publications for multimedia networks provided in an embodiment of the present invention is implemented by the above-mentioned automatic typesetting system for electronic publications for multimedia networks. The specific method and process of the automatic typesetting method for electronic publications for multimedia networks are detailed in the embodiment of the above-mentioned automatic typesetting system for electronic publications for multimedia networks, and will not be repeated here.

[0041] The above formulas are all dimensionless and numerical calculations. The formulas are obtained by collecting a large amount of data and performing software simulation to obtain the most recent real situation. The preset parameters in the formulas are set by technicians in this field according to actual conditions.

[0042] The above embodiments can be implemented in whole or in part by software, hardware, firmware or any other combination. When implemented using software, the above embodiments can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer program are loaded or executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center via wired or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that contains one or more available media sets. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium. The semiconductor medium can be a solid-state drive.

[0043] It should be understood that in the various embodiments of the present application, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0044] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0045] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.

Claims

1. An automatic typesetting system for electronic publications oriented to multimedia networks, characterized by: It includes a layout module: based on the media terminal type, it customizes multiple parameters of the initial layout of the electronic publication reader, uses the device UA or API to parse and identify the media terminal type, establishes an adaptive font size calculation model to dynamically generate basic layout rules, and outputs them to the layout planning module and layout rule library; Content Analysis Module: This module parses the original content of electronic publications, extracts semantic tags using the BERT model, extracts visual features using the ResNet-50 image recognition algorithm, extracts format, duration, and resolution using FFmpeg audio and video processing technology, and uses the ARIMA time series analysis model to monitor the changing patterns of dynamic content and predict update frequency. The module then outputs content metadata and passes it to the layout planning module and the dynamic content processing module. Layout planning module: Receives content metadata from the content analysis module, combines it with the typesetting rule library, uses the adaptive grid algorithm and reinforcement learning layout optimization algorithm to plan the page layout, generates a page layout plan with a JSON structure, and transmits it to the automatic typesetting execution and storage output module; Layout rule library: This stores layout rules adapted for different types of media terminals. It has a built-in Drools rule management engine and a semantic mapping table for processing dynamic content. This library is used for dynamic rule matching and provides the content analysis module, layout planning module, dynamic content processing module, and multimedia adaptation module with the standards and specifications required for layout. Dynamic content processing module: This module monitors the changing patterns of dynamic content and predicts update frequency based on the ARIMA time series analysis model. When dynamic content updates are detected in real time, it automatically adjusts the page layout using a dynamic layout algorithm, outputs the updated layout instructions, and passes them to the automatic typesetting execution and storage output module. Multimedia Adaptation Module: This module extracts format, duration, and resolution data based on the FFmpeg audio and video processing technology in the content analysis module. Combined with network status data, it uses a dynamic encoding optimization algorithm and a multimedia cross-format compatible conversion algorithm to perform format conversion and terminal adaptation, and outputs multimedia element data. Automatic typesetting execution and saving output module: receives the page layout plan, updated layout instructions and adapted multimedia element data, uses CSSGrid / Flexbox rendering engine to convert the page layout plan into CSS code, uses WebGL rendering technology to convert the layout information of the updated layout instructions into the actual typesetting page, generates interactive HTML / CSS / JS page typesetting results, and exports electronic publications in PDF / EPUB / HTML electronic document formats based on the typesetting results, uses Brotli to compress text resources and WebP to optimize image compression algorithm for file size optimization and storage.

2. The automatic typesetting system for electronic publications in multimedia networks according to claim 1 is characterized in that: The steps for establishing the adaptive font size calculation model are as follows: Enter the media terminal type, and use the preset font size benchmark values ​​to enter parameter information for the screen viewport size, reading distance, and font type. Taking a single column as an example, the base text size for mobile devices and e-readers is the same, both 14px, and the base headline font size is the same, both 24px. The base text size for desktop devices is 18px, and the base headline font size is 32px. The base text size for smart TVs is 36px, and the base headline font size is 64px. For double columns, the base text size and base headline font size are both halved, and for multi-columns, the base text size and base headline font size are scaled by the multiple of the single column. The default reading distance for mobile devices, desktop devices, and e-readers is 40cm. The default reading distance for smart TVs is 150cm. Font types include Songti, Heiti and Kaiti; The dynamic calculation formula for designing adaptive font size based on parameter information is: ,and , , where Represents the final font size output by the adaptive font size calculation model, Expressed as the font size base value, Expressed as the viewport scaling factor of the media endpoint, Expressed as a compensation factor for reading distance, The font factor expressed as the font type, and , Indicates the actual screen width of the input media terminal. Indicates the actual screen height of the input media terminal. Expressed as the screen width value of the reference media terminal, Expressed as the screen height value of the reference media terminal, Indicates the screen viewport size of the actual input media terminal. Expressed as the screen viewport size of the reference media terminal, Expressed as the benchmark reading distance, Indicates the actual reading distance; And the calculation formula for line spacing is , where Indicates line spacing, Expressed as a fixed multiple, Expressed as font size, unit pixel px; The calculation formula for segment spacing is ,and , , where Expressed as The paragraph spacing before the level heading, Expressed as the paragraph spacing coefficient, Expressed as The paragraph spacing after the level heading, Expressed as the paragraph spacing coefficient, Expressed as Level title, and ; Basic typesetting rules include determining the parameter values ​​of the main text font size, title font size, line spacing, paragraph spacing, and paragraph spacing, which are dynamically calculated and output through an adaptive font size calculation model.

3. The automatic typesetting system for electronic publications in multimedia networks according to claim 2, characterized in that: The steps of extracting semantic labels by the BERT model are as follows: Input the original content of the electronic publication, parse the text sentences and list them, use the WordPiece algorithm to convert each sentence into a token sequence, and then convert the token sequence into an embedding vector. The expression of the text sentence list is , where a list of sentences represented as text, Indicated as the first a sentence; The expression of Token sequence is , where Represented as a classification mark, Represents a separator; The expression of the embedding vector is , where Represented as the embedding vector that converts the Token sequence, is represented as a real matrix, Expressed as including and The sequence length, is represented as the embedding dimension, and ; Embedding vector Input into the pre-trained BERT model, use the Transformer encoder in the pre-trained BERT model for encoding, learn the contextual representation of the text, and use the multi-head self-attention mechanism and feedforward neural network to calculate the BERT model output; Extract semantic features from the BERT model output and take the output vector corresponding to the [CLS] tag as the semantic representation of the entire text; Use the fully connected layer to classify the extracted semantic features, output the label probability distribution, and obtain the semantic label with the maximum label probability distribution as the text. The calculation formula of the label probability distribution is ,and , where Represents the given input A sequence of sentences When , the probability distribution of label y is, Represented as semantic labels, Represented as the weight matrix of the fully connected layer, It is represented as extracting the [CLS] vector through the Transformer encoder, Represented as the bias vector of the fully connected layer, Represented as the predicted semantic label, It is expressed as a mathematical function that finds the class label with the highest probability from the probability distribution.

4. The automatic typesetting system for electronic publications in multimedia networks according to claim 3 is characterized in that: The steps of extracting visual features using the ResNet-50 image recognition algorithm are as follows: Input the original content of the electronic publication, parse the original content image and perform the initial convolution layer operation to obtain the preprocessed image. The image pixel size of the preprocessed image must meet the input requirements of the ResNet-50 model. The expression of the preprocessed image is ,and , Where, Represented as a preprocessed image, It is represented as the convolution kernel size, Expressed as a step size of 2, Represented as the input image height, Represented as the input image width, Expressed as the number of RGB channels, Represented as input image; The pre-processed image is input into the ResNet-50 image recognition algorithm, which is calculated by stacking residual blocks and then gradually extracting image features through convolutional layers and pooling layers. The calculation formula is , where Expressed as The residual block outputs the feature map, Expressed as activation function, Expressed as The input feature map of the residual block, is represented as the residual function of the three-layer convolution operation, and The three convolution layers include Convolution, reducing the number of channels and dimensionality reduction processing, Convolution, spatial feature extraction, Convolution, restore the number of channels and increase the dimension; The global average pooling calculation formula of image features is: ,and , where Represented as the first output of the global average pooling image feature vectors, is represented as the feature map height, and , is represented as the feature map width, and , Represented as a scalar element in a vector, is represented as a feature map input, and ; The image feature dimensionality reduction is performed through the last fully connected layer of the ResNet-50 image recognition algorithm as the visual features of the output image. The calculation formula for the fully connected layer feature dimensionality reduction is: , where Represented as the image feature vector after dimensionality reduction, Represented as the weight matrix of the fully connected layer, Represented as the bias vector of the fully connected layer.

5. The automatic typesetting system for electronic publications in multimedia networks according to claim 4 is characterized in that: The steps of the page layout planning of the adaptive grid algorithm are as follows: Create a basic grid based on the width, height, and number of columns of the device viewport, including the number of rows and columns, and the width and height of the cells. The calculation formula for the width and height of the cells is: ,and , where Expressed as the width of the cell, Expressed as the height of the cell; The element priority weight is calculated based on the content metadata, where the calculation formula of the element priority weight is: ,and , where Including text, pictures, video / animation streams and dynamic content, and the weight coefficient of audio and video is 0.6, the weight coefficient of dynamic content is 0.5, the weight coefficient of pictures is 0.4, and the weight coefficient of text is 0.

3. , Represented as the historical frequency of user interaction with the element, Respectively expressed as corresponding 、 、 The weight value of Use the greedy placement algorithm to traverse the elements in descending order of priority, try to find continuous free areas in the grid, and set matching rules. The matching rule is set to place the element directly in the free area when the width of the element is ≤ the width of the free area and the height of the element is ≤ the height of the free area. When the width of the element is greater than the width of the idle area, or the height of the element is greater than the height of the idle area, space compression is triggered, and , the size of the new element after compression is ; When faced with overlapping elements, a conflict resolution algorithm is used to initiate grid reconstruction, adjust and optimize the page layout.

6. The automatic typesetting system for electronic publications in multimedia networks according to claim 5, characterized in that: The steps of the Drools rule management engine and semantic mapping table processing dynamic content are as follows: Define the Drools rule language DRL syntax in the typesetting rule library to write business rules for typesetting requirements; Insert content metadata as facts into Drools' working memory; Use the Drools rule engine to match facts inserted into the working memory with rules in the rule base; By executing modification or decision RHS actions, the processed content information is output and typesetting instructions are generated; Construct a semantic mapping table to record the mapping relationship between different semantic tags and typesetting rules; Associating the semantic tags extracted by the content analysis module with the semantic mapping table to find the corresponding typesetting rules for semantic tag matching; The dynamic content is typeset according to the associated typesetting rules.

7. The automatic typesetting system for electronic publications in multimedia networks according to claim 6 is characterized in that: The steps for obtaining the multimedia element data are as follows: Use the FFmpeg tool to establish a relationship with the original multimedia files containing audio, video and animation, use FFmpeg's functions to execute commands, parse the multimedia files, and extract the format, duration and resolution data from the file's metadata; Use integrated network monitoring tools to obtain real-time network status information through the network interface, including network bandwidth, packet loss rate, and delay parameters; A dynamic encoding optimization algorithm is used to adjust multimedia encoding information according to network bandwidth, and a multimedia cross-format compatible conversion algorithm is used to convert multimedia files into new formats suitable for different terminal devices and browsers. The encoding information includes real-time encoding bit rate, video resolution scaling ratio, image quality loss assessment, and playback compatibility score calculation. The formula for calculating the real-time encoding bit rate is: , where Expressed as real-time encoding bit rate, Expressed as bandwidth utilization, Expressed as network bandwidth, Expressed as safety margin; The calculation formula for video resolution scaling is: , where Expressed as video resolution scaling ratio, Expressed as the original bit rate, It is expressed to maintain the area ratio; The calculation formula for evaluating image quality loss is: , where Expressed as the image quality loss assessment value, is represented as the maximum value of the pixel, and , Expressed as the mean square error between the original frame and the compressed frame; The calculation formula for calculating the playback compatibility score is ,and , where Expressed as a playback compatibility score, Expressed as the weight coefficient of the corresponding browser format support, is expressed as browser format support, and , Expressed as the weight coefficient of the corresponding device decoding coverage, is expressed as device decoding coverage, and ; The format, duration, and resolution data of the extracted multimedia files are integrated with the encoding information and new format content after network bandwidth adjustment and adaptation processing to form a complete multimedia element data set.

8. A method for automatically typesetting electronic publications for multimedia networks, implemented by the automatic typesetting system for electronic publications for multimedia networks according to any one of claims 1 to 7, characterized in that: The steps are as follows: S1. Customize multiple parameters of the initial layout of the electronic publication reader based on the media terminal type, use the device UA or API to parse and identify the media terminal type, establish an adaptive font size calculation model to dynamically generate basic layout rules, and output them to the layout planning module and layout rule library; S2. Parse the original content of electronic publications, extract semantic tags using the BERT model, extract visual features using the ResNet-50 image recognition algorithm, extract format, duration, and resolution using FFmpeg audio and video processing technology, and use the ARIMA time series analysis model to monitor the changing patterns of dynamic content and predict update frequency. Output content metadata and pass it to the layout planning module and dynamic content processing module. S3, receiving content metadata from the content analysis module, combining it with the typesetting rule library, using the adaptive grid algorithm and reinforcement learning layout optimization algorithm to plan the page layout, generating a page layout solution with a JSON structure, and transmitting it to the automatic typesetting execution and storage output module; S4 stores layout rules adapted to different types of media terminals, has a built-in Drools rule management engine, and sets up a semantic mapping table to process dynamic content. This is used for dynamic rule matching, providing the content analysis module, layout planning module, dynamic content processing module, and multimedia adaptation module with the standards and specifications required for layout. S5. Monitor the changing patterns of dynamic content and predict the update frequency based on the ARIMA time series analysis model. When dynamic content updates are detected in real time, use the dynamic layout algorithm to automatically adjust the page layout scheme, output the updated layout instructions, and pass them to the automatic typesetting execution and storage output module; S6. Extracting format, duration, and resolution data based on the FFmpeg audio and video processing technology in the content analysis module, combining it with network status data, and using a dynamic encoding optimization algorithm and a multimedia cross-format compatibility conversion algorithm to perform format conversion and terminal adaptation, output multimedia element data, and pass it to the automatic typesetting execution and storage output module; S7. Receive the page layout plan, updated layout instructions, and adapted multimedia element data, use the CSSGrid / Flexbox rendering engine to convert the page layout plan into CSS code, use WebGL rendering technology to convert the layout information of the updated layout instructions into the actual layout page, generate the interactive HTML / CSS / JS page layout results, and export the electronic publication in the electronic document format of PDF / EPUB / HTML based on the layout results. Use Brotli to compress text resources and WebP to optimize image compression algorithms for file size optimization and storage.

9. A computer device comprising: A memory and a processor; the memory stores a computer program, characterized in that when the processor executes the computer program, it implements the steps of the automatic typesetting system for electronic publications for multimedia networks as described in any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the automatic typesetting system for electronic publications oriented to multimedia networks according to any one of claims 1 to 7 are implemented.

Citation Information

Cited By

  • Dynamic typesetting optimization method for internet barrier-free reading

    CN122242443A