A method and apparatus for generating digital printed archives
By parsing and standardizing file formats, combined with GPU parallel computing and deep neural networks, the problems of compatibility of multiple file formats and poor image processing effects have been solved, achieving high-quality digital printed archive generation and strong copyright protection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-03
- Publication Date
- 2026-04-03
AI Technical Summary
Existing technologies suffer from incomplete file content extraction or poor format compatibility when processing multi-format files, resulting in poor image processing quality. Furthermore, traditional watermarking technologies are vulnerable to attacks and cannot effectively prevent piracy.
The original file content is extracted using parsing tools corresponding to the file format. A GPU parallel computing format conversion engine is used for text and image processing. Combined with super-resolution optimization and vectorization conversion, watermark information is generated and embedded in digital printed archives. Copyright protection is achieved through generative adversarial networks and discrete cosine transform.
It achieves compatibility with multiple file formats and cross-platform compatibility, improves the clarity and layout consistency of printed materials, enhances copyright protection capabilities, and prevents piracy.
Smart Images

Figure CN120805107B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of digital printing technology, and in particular to a method and apparatus for generating digital printed archives. Background Technology
[0002] With the rapid development of digital printing technology, the creation of digital printing archives has become an important part of the printing industry. Digital printing archives not only need to ensure high-quality output of printed materials, but also need to ensure the editability, cross-platform compatibility, and copyright protection of the documents.
[0003] Existing technologies often rely on a single parsing tool when processing multi-format files, resulting in incomplete extraction of file content or poor format compatibility. In addition, in image processing, existing technologies mostly rely on traditional interpolation methods for super-resolution optimization, which makes it difficult to recover true high-frequency information, leading to a decline in print quality. In terms of copyright protection, traditional watermarking technology is easily attacked or removed, and cannot effectively prevent piracy. Summary of the Invention
[0004] In view of the aforementioned existing problems, the present invention is proposed.
[0005] Therefore, the present invention provides a method for generating digital printed archives to solve the problems of poor image processing effect and insufficient copyright protection in the process of generating digital printed archives.
[0006] To solve the above-mentioned technical problems, the present invention provides the following technical solution:
[0007] In a first aspect, the present invention provides a method for generating digital printed archives, comprising,
[0008] Based on the file format of the original file uploaded by the user, the content of the original file is extracted using the parsing tool corresponding to the file format, and the extracted content of the original file is stored in a unified format to obtain structured document data;
[0009] Based on a GPU parallel computing format conversion engine, the text content in structured document data is converted into print format. At the same time, the image content in the structured document data is color mapped, and super-resolution optimization and vectorization conversion are performed to obtain a primary digital print archive.
[0010] By extracting the layout information of the original file, the layout of the primary digital printing archive is set, and a general encoding detection is performed to obtain the intermediate digital printing archive.
[0011] Watermark information is generated using Generative Adversarial Network (GAN), and then embedded into the images and page backgrounds of intermediate digital printed archives by combining Discrete Cosine Transform (DCT) and Inverse DCT, thus obtaining digital printed archives.
[0012] As a preferred embodiment of the method for generating digital printed archives according to the present invention, the steps of extracting the content of the original file according to the file format of the original file uploaded by the user using a parsing tool corresponding to the file format, and storing the extracted original file content in a unified format to obtain structured document data are as follows.
[0013] The file format of the original file is determined by extracting the file extension of the original file uploaded by the user.
[0014] Based on the original file format, the corresponding parsing tool is used to extract the content of the original file;
[0015] By reading the file header of the original file, it is determined whether the file encoding is a universal encoding. If the file encoding of the original file is a universal encoding, no format standardization operation is required. Otherwise, the file encoding of the original file is converted to a universal encoding by calling the character set conversion library.
[0016] The original document content is standardized to output structured document data.
[0017] In a preferred embodiment of the method for generating digital printed archives according to the present invention, the specific steps for converting the text content in the structured document data into a printing format are as follows:
[0018] The text processing tasks in the structured document data are assigned to the GPU computing cores of the GPU parallel computing format conversion engine;
[0019] Use Ghostscript to generate PDF / X format files, embed all text content into the PDF / X format files, and obtain PDF / X format text files.
[0020] As a preferred embodiment of the method for generating digital printed archives according to the present invention, the specific steps of color mapping, super-resolution optimization, and vectorization conversion of image content in structured document data are as follows:
[0021] The image processing tasks in the structured document data are assigned to the GPU image processing core of the GPU parallel computing format conversion engine;
[0022] According to the ICC color profile, the color values of the images in the structured document data are mapped to the CMYK color space to obtain a CMYK image;
[0023] A super-resolution optimization method based on a physical optics model is used to optimize the super-resolution of CMYK images, as shown in the following expression:
[0024]
[0025] O(f)=P(f)×e -jφ(f) ;
[0026] Where I2 is the CMYK image optimized through super-resolution, F -1 is the inverse Fourier transform operator, F is the Fourier transform operator, I1 is the CMYK image, O(f) is the optical transfer function, f is the spatial frequency variable, P(f) is the modulation transfer function, j is the imaginary unit, and φ(f) is the phase transfer function.
[0027] An adaptive vectorization transformation method based on mathematical topology optimization and Bézier curve fitting is used to perform vectorization transformation on the super-resolution optimized CMYK image;
[0028] The vectorized CMYK image is embedded into a PDF / X format text file to obtain a primary digital print archive.
[0029] In a preferred embodiment of the method for generating digital printed archives according to the present invention, the image is vectorized using an adaptive vectorization conversion method based on mathematical topology optimization and Bézier curve fitting. The specific steps are as follows:
[0030] Calculate the grayscale value of the image after super-resolution optimization to obtain a grayscale image;
[0031] Sobel filtering is used to calculate the gradient changes in the vertical and horizontal directions of a grayscale image, detect edge intensity, and extract edge features from the grayscale image.
[0032] By calculating the Hough transform formula, straight lines and curves in grayscale images can be identified.
[0033] If a group of consecutive edge pixels are at the same distance or angle from the origin, then the group of edge pixels is considered to be on a straight line. Conversely, if a group of consecutive edge pixels are at the same distance but different angles from the origin, then the group of pixels is considered to be on a curve.
[0034] For edge pixels on a straight line, the edge pixels at both ends are used as control points to fit a polyline.
[0035] For a curve, calculate the curvature of each edge pixel on the curve;
[0036] The spacing of control points is dynamically adjusted based on the curvature changes of pixels at the upper edge of the curve.
[0037] Based on the adjustment and allocation of control points, a Bézier curve is generated for fitting, completing the vectorization conversion of the super-resolution optimized CMYK image.
[0038] In a preferred embodiment of the method for generating digital printed archives according to the present invention, the following steps are taken: The layout of the primary digital printed archive is set by extracting the layout information of the original document, and a general encoding detection is performed to obtain the intermediate digital printed archive.
[0039] The layout of the primary digital print archive is initially set according to the layout of the original document;
[0040] Using the built-in PDF parsing tool of PDF / X files, extract the text content of the initial digital print archive after preliminary layout settings, and convert it into a universal encoding.
[0041] If the encoding conversion fails, it means that the text of the initial digital print archive, after the initial layout settings, contains non-standard encoded legal characters.
[0042] Use regular expressions to match control characters and hidden characters in non-general encoding legal characters, and then delete the control characters and hidden characters.
[0043] The original encoding of erroneous characters in the legal characters of non-universal encoding is detected by a character set detection algorithm. The original encoding of the erroneous characters is then converted back to the universal encoding to obtain the intermediate digital printing file.
[0044] In a preferred embodiment of the method for generating digital printed archives according to the present invention, the watermark information is generated using a generative adversarial network, and then embedded into the images and page backgrounds of the intermediate digital printed archive using discrete cosine transform and inverse transform to obtain the digital printed archive. The specific steps are as follows.
[0045] User identity information, printing batch information, and printing equipment information are obtained by user-provided and queried printing logs;
[0046] The user identity information, printing batch information, and printing equipment information are respectively calculated using a hash algorithm to obtain the identity identifier, printing batch identifier, and printing equipment identifier;
[0047] The unique watermark information is obtained by hashing and fusing the identity identifier, printing batch identifier, and printing equipment identifier.
[0048] The unique watermark information is transformed into a unique watermark matrix through the reshape operation;
[0049] The generator uses a deep convolutional neural network to convolve the unique watermark matrix to obtain a unique watermark.
[0050] Upsampling is performed through transposed convolution to gradually enlarge the size of the unique watermark, and the Tanh activation function is used to generate the final watermark.
[0051] Based on discrete cosine transform, the final watermark is embedded into a clean image to obtain a watermarked image;
[0052] The discriminator is trained by inputting known watermarked images and clean images respectively. The discriminator gives the probability that the input image is a watermarked image and calculates the cross-entropy loss. The discriminator parameters are adjusted by minimizing the cross-entropy loss value.
[0053] The generator continuously minimizes the L2 norm of the watermarked image and the clean image by adjusting the final watermark it generates;
[0054] When the discriminator gives a 50% probability that the input image is a watermarked image, it means that the discriminator cannot distinguish between clean images and watermarked images, thus completing the training of the adversarial watermark generation network and outputting the final watermark.
[0055] PDFBox is used to parse intermediate digital printed archives, extract all images and page backgrounds, and perform discrete cosine transform on each image and page background to obtain the DCT coefficient matrix of each image and page background.
[0056] The final watermark is embedded in the DCT coefficient matrix of each image and page background. The image and page background with the final watermark are obtained by performing a discrete cosine inverse transform on the DCT coefficient matrix of the image and page background with the final watermark.
[0057] Replace each image and page background with the corresponding images and page backgrounds in the intermediate digital print archive one by one to obtain the digital print archive.
[0058] Secondly, the present invention provides a digital printed archive generation device, including a standardized template, a parallel computing template, a layout setting template, and a watermark encryption template;
[0059] The standardized template is used to extract the content of the original file according to the file format of the original file uploaded by the user, using the parsing tool corresponding to the file format, and store the extracted original file content in a unified format to obtain structured document data;
[0060] The parallel computing template is used to convert the text content in the structured document data into the printing format based on the GPU parallel computing format conversion engine. At the same time, it performs color mapping, super-resolution optimization and vectorization conversion on the image content in the structured document data to obtain a primary digital printing archive.
[0061] The layout template is used to set the layout of the primary digital printing archive by extracting the layout information of the original file, and to perform general encoding detection to obtain the intermediate digital printing archive.
[0062] The watermark encryption template is used to generate watermark information using a generative adversarial network, and then embeds the watermark information into the images and page backgrounds of the intermediate digital printed archives by combining discrete cosine transform and inverse transform, thus obtaining the digital printed archives.
[0063] Thirdly, the present invention provides a computer device including a memory and a processor, wherein the memory stores a computer program, wherein when the computer program is executed by the processor, it implements any step of the method for generating digital printed archives as described in the first aspect of the present invention.
[0064] Fourthly, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein, when the computer program is executed by a processor, it implements any step of the method for generating digital printed archives as described in the first aspect of the present invention.
[0065] The beneficial effects of this invention are as follows: By parsing and standardizing file formats, this invention solves the compatibility problem of multi-format files, ensuring that text, images, and other content are accurately extracted and uniformly stored, avoiding garbled characters and cross-platform compatibility issues. Based on GPU parallel computing for format conversion and image processing, and utilizing super-resolution optimization and vectorization conversion of physical optics models, it significantly improves the clarity and color reproduction of printed materials while reducing ink consumption. By extracting the layout information of the original file and performing universal encoding detection, it ensures that the layout design of the printed material is consistent with the original file, enhancing the cross-device compatibility and readability of the file. By using deep neural networks and DCT encoding to generate watermarks with strong concealment and high resistance to attacks, it effectively protects the copyright of digital printed archives and prevents piracy and illegal copying. Attached Figure Description
[0066] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0067] Figure 1 This is a flowchart of the method for generating digital printed archives in Example 1.
[0068] Figure 2 This is a block diagram of the digital printed archive generation device in Example 1. Detailed Implementation
[0069] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
[0070] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of the invention. Therefore, the invention is not limited to the specific embodiments disclosed below.
[0071] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The phrase "in one embodiment" appearing in different places in this specification does not necessarily refer to the same embodiment, nor is it a single or selective embodiment that is mutually exclusive with other embodiments.
[0072] Example 1, referring to Figure 1 and Figure 2 This is the first embodiment of the present invention, which provides a method for generating digital printed archives, including the following steps:
[0073] S1. Based on the file format of the original file uploaded by the user, use the parsing tool corresponding to the file format to extract the content of the original file, and store the extracted content of the original file in a unified format to obtain structured document data.
[0074] The file format of the original file is determined by extracting the file extensions (such as .docx, .pdf, .html, .xml, and .jpg) of the user-uploaded original file.
[0075] Based on the original file format, the corresponding parsing tool is used to extract the content (such as text, representations, and images) of the original file;
[0076] For example, for Word documents, the Open XML SDK is used to parse and extract the document structure (paragraphs, headings, tables, images);
[0077] For PDF documents, PDFBox is used to parse the PDF structure and extract the text layer, image layer, and form fields. For vector graphics, path parsing is used to extract editable text.
[0078] For scanned documents or image formats, Tesseract OCR is used for text recognition and layout analysis to distinguish between body text, headings, and tables;
[0079] Since different original files use different character encodings, a unified encoding conversion is required to avoid garbled characters and cross-platform compatibility issues.
[0080] By reading the file header of the original file, it is determined whether the file encoding is a universal encoding (such as UTF-8). If the original file encoding is a universal encoding, no format standardization operation is required. Otherwise, the original file encoding is converted to a universal encoding by calling a character set conversion library (such as iconv and Python codecs).
[0081] Furthermore, when it is impossible to determine the file encoding by reading the file header of the original file, a character set detection algorithm (such as the chardet library) is used to identify the encoding based on the byte distribution pattern in the original file.
[0082] The original file content is standardized to output structured document data;
[0083] Specifically, all heading formats are standardized and converted to standard hierarchical representations (such as H1, H2, H3). The spacing between paragraphs with the most common spacing is used as the uniform paragraph spacing to avoid paragraph connection errors caused by format parsing. If the original file uses space indentation, it is uniformly converted to CSS / style indentation. Table border styles are standardized to ensure the editability of the original file content and to ensure smooth subsequent text processing.
[0084] S2. Based on a GPU parallel computing format conversion engine, the text content in the structured document data is converted into the printing format. At the same time, the image content in the structured document data is color mapped, and super-resolution optimization and vectorization conversion are performed to obtain a primary digital printing archive.
[0085] The task of parsing structured document data is divided into text processing tasks and image processing tasks, and the allocation of computing resources ensures that GPU computing resources are fully utilized and improves processing efficiency.
[0086] The text processing tasks in structured document data are assigned to the GPU computing cores (CUDA Cores) of the GPU parallel computing format conversion engine;
[0087] Use Ghostscript to generate PDF / X format files, embed all text content into the PDF / X format files, and obtain a text file in PDF / X format;
[0088] The image processing tasks in the structured document data are assigned to the GPU image processing cores (Tensor Cores or RT Cores) of the GPU parallel computing format conversion engine.
[0089] According to the ICC color profile, the color values in the structured document data are mapped to the CMYK color space to obtain a CMYK image;
[0090] Specifically, the color values of the images in the structured document data are first mapped to the CMY color space. In order to optimize the printing effect, grayscale compensation is used, that is, the minimum value of each CMY channel is extracted as black (K value). This ensures that the black part is handled by a separate black color channel, instead of mixing the three colors C, M and Y to generate black, thereby reducing ink consumption and improving printing quality.
[0091] Based on the perspective of optical imaging, this paper proposes a super-resolution optimization method based on physical optics model (SR-POM) by reverse derivation of the optical imaging process. It does not rely on large-scale training data and is applicable to different types of low-resolution images. At the same time, it uses optical modeling to recover real high-frequency information, reduce artifacts, and improve printing quality.
[0092] A super-resolution optimization method based on the Physical Optics Model (SR-POM) is used to optimize the super-resolution of CMYK images, as shown in the following expression:
[0093]
[0094] O(f)=P(f)×e -jφ(f) ;
[0095] Where I2 is the CMYK image optimized through super-resolution, F -1 is the inverse Fourier transform operator, F is the Fourier transform operator, I1 is the CMYK image, O(f) is the optical transfer function, f is the spatial frequency variable, P(f) is the modulation transfer function, j is the imaginary unit, and φ(f) is the phase transfer function.
[0096] An adaptive vectorization transformation method based on mathematical topology optimization and Bézier curve fitting is used to perform vectorization transformation on the super-resolution optimized CMYK image;
[0097] The grayscale value of the CMYK image after super-resolution optimization is calculated to obtain the grayscale image, as shown in the following expression:
[0098] I g (x,y)=0.299R(x,y)+0.587G(x,y)+0.114B(x,y);
[0099] Among them, I g is the grayscale value, (x,y) is the edge pixel, and R, G and B are the red, green and blue channel values, respectively;
[0100] The Sobel filter is used to calculate the gradient changes in the vertical and horizontal directions of a grayscale image, detect edge intensity, and extract edge features from the grayscale image. The expression is as follows:
[0101]
[0102] A x (x,y)=I g (x+1,y)-I g (x-1,y);
[0103] A y (x,y)=I g (x,y+1)-I g (x, y-1);
[0104] Among them, A s Let A be the gradient magnitude, (x, y) be the edge pixel, and A be the gradient magnitude. x Let A be the gradient in the horizontal direction. x For the vertical gradient, I g Grayscale value;
[0105] By calculating the Hough transform formula, straight lines and curves in grayscale images can be identified. The expression is as follows:
[0106] ρ = x sinθ + y cosθ;
[0107]
[0108] Where ρ is the distance from the line to the origin, x and y are the horizontal and vertical coordinates of the edge pixel, respectively, and θ is the angle of the line;
[0109] If a group of consecutive edge pixels are at the same distance or angle from the origin, then the group of edge pixels is considered to be on a straight line. Conversely, if a group of consecutive edge pixels are at the same distance but different angles from the origin, then the group of pixels is considered to be on a curve.
[0110] For edge pixels on a straight line, instead of dividing into multiple control points, the edge pixels at both ends are directly used as control points to fit the polyline.
[0111] For a curve, the curvature of each edge pixel on the curve is calculated using the following expression:
[0112]
[0113] Where K(x,y) is the curvature of the edge pixel (x,y) on the curve, X' represents the first derivative in the x-direction at the edge pixel (x,y), Y' represents the first derivative in the y-direction at the edge pixel (x,y), X” represents the second derivative in the x-direction at the edge pixel (x,y), and Y” represents the second derivative in the y-direction at the edge pixel (x,y).
[0114] The spacing of control points is dynamically adjusted based on the curvature changes of pixels at the upper edge of the curve, as shown in the following expression:
[0115]
[0116] Where L(x,y) is the control point spacing at edge pixel (x,y), k1 is the basic control point density to prevent some areas from having no control points at all, and k2 is the curvature influence factor.
[0117] Set control points on the curve according to the spacing between the control points;
[0118] Based on the control points set on the straight lines and curves, the Bézier curve equation is used to generate Bézier curves to fit adjacent curves and straight lines, thus completing the vectorization conversion of the super-resolution optimized CMYK image.
[0119] The vectorized CMYK image is embedded into a PDF / X format text file to obtain a primary digital print archive.
[0120] Specifically, the vectorized images should be embedded according to their positions in the original files to ensure the overall readability of the file content.
[0121] S3. By extracting the layout information of the original file, the layout of the primary digital printing archive is set, and a general encoding test is performed to obtain the intermediate digital printing archive.
[0122] The layout of the initial digital print archive is initially set according to the layout of the original document to ensure that the printed matter conforms to the user's design for the document content format and layout.
[0123] Because some layout information (such as alignment and character spacing) may be lost when converting and processing text and images, and in order to ensure the editability of the original file and to prevent garbled characters and cross-device compatibility issues during subsequent processing and format conversion, the layout information of the text has been changed when standardizing the content of the original file.
[0124] Specifically, the layout rules for the primary digital print archive are set by referring to the text line spacing, paragraph spacing, and alignment of the original document, as well as the image position rules, size rules, and spacing rules with text and tables, and the column width rules and spacing rules with text and images, to ensure that the layout design of the printed material is consistent with that of the original document.
[0125] Using the built-in PDF parsing tool of PDF / X files, extract the text content of the initial digital print archive after preliminary layout settings, and convert it into a universal encoding.
[0126] Since the primary printed archive is essentially a PDF / X file containing all the text content of the structured data and CMYK images converted to vector, the text content of the primary digital printed archive after the initial layout setting can be extracted directly using the PDF / X file's built-in PDF parsing tool. This is more convenient and faster, and avoids the incompatibility and low extraction quality problems that may occur when using third-party parsing tools.
[0127] If the encoding conversion fails, it means that the text of the initial digital print file after the initial layout setting contains non-standard encoded legal characters (including control characters, hidden characters, and incorrectly encoded characters);
[0128] Use regular expressions to match control characters and hidden characters in non-general encoding legal characters, and then delete the control characters and hidden characters.
[0129] The original encoding of erroneous characters in legal characters of non-universal encoding is detected using a character set detection algorithm;
[0130] By employing a character-by-character mapping strategy, the original encoding with errors is converted back into a universal encoding, resulting in intermediate-level digital printed archives.
[0131] S4. Generate watermark information using generative adversarial network, and embed the watermark information into the images and page backgrounds in the intermediate digital printed archive by combining discrete cosine transform and inverse transform, thus obtaining the digital printed archive.
[0132] The user identity information, printing batch information (including printing batch changes and timestamps), and printing equipment information are respectively calculated using the hash algorithm (SHA-256) to obtain the identity identifier, printing batch identifier, and printing equipment identifier;
[0133] The unique watermark information is obtained by hashing and fusing the identity identifier, printing batch identifier, and printing equipment identifier.
[0134] The unique watermark information is converted into a 16×16 unique watermark matrix through the reshape operation;
[0135] The generator uses a deep convolutional neural network to convolve the unique watermark matrix to obtain a unique watermark.
[0136] Upsampling is performed by transposing convolution to gradually enlarge the size of the unique watermark, and the Tanh activation function is used to generate the final watermark. The Tanh activation function keeps the watermark pixels between [-1,1] to ensure that it is visually invisible.
[0137] Based on discrete cosine transform, the final watermark is embedded into a clean image to obtain a watermarked image;
[0138] The discriminator is trained by inputting known watermarked images and clean images respectively. The discriminator provides the probability that the input image is a watermarked image and a clean image respectively, and the cross-entropy loss function is calculated.
[0139] By using gradient descent to adjust parameters such as the discriminator's learning rate and weight matrix, the cross-loss value is minimized, thereby improving the ability to distinguish between watermarked and clean images.
[0140] The generator continuously minimizes the L2 norm of the watermarked image and the clean image by adjusting the final watermark generated, thereby improving the concealment of the final watermark.
[0141] When the discriminator gives a 50% probability that the input image is a watermarked image, it means that the discriminator cannot distinguish between clean images and watermarked images, thus completing the training of the adversarial watermark generation network and outputting the final watermark.
[0142] PDFBox is used to parse intermediate digital printed archives, extract all images and page backgrounds, and perform discrete cosine transform on each image and page background to obtain the DCT coefficient matrix of each image and page background.
[0143] The final watermark is embedded in the DCT coefficient matrix of each image and page background, and the image and page background with the final watermark are obtained by inverse discrete cosine transform.
[0144] It should be noted that the final watermark is a frequency domain signal. By performing discrete cosine transform on the images and page backgrounds in intermediate digital printed archives, the time domain signal (images and page backgrounds) is converted into a frequency domain signal (DCT coefficient matrix), which allows the final watermark to be successfully embedded. Then, through inverse discrete cosine transform, the images and page backgrounds are restored, completing the embedding of the final watermark and effectively improving the copyright protection of digital printed archives.
[0145] Replace each image and page background with the corresponding images and page backgrounds in the intermediate digital print archive one by one to obtain the digital print archive.
[0146] This embodiment also provides a digital printed archive generation device, including: a standardized template, a parallel computing template, a layout setting template, and a watermark encryption template; the standardized template is used to extract the content of the original file according to the file format of the original file uploaded by the user, using a parsing tool corresponding to the file format, and storing the extracted original file content in a unified format to obtain structured document data; the parallel computing template is used to convert the format of the text content in the structured document data into the printing format based on a GPU parallel computing format conversion engine, and simultaneously perform color mapping, super-resolution optimization, and vectorization conversion on the image content in the structured document data to obtain a primary digital printed archive; the layout setting template is used to set the layout of the primary digital printed archive by extracting the layout information of the original file, and perform general encoding detection to obtain an intermediate digital printed archive; the watermark encryption template is used to generate watermark information using a generative adversarial network, and embed the watermark information into the images and page backgrounds in the intermediate digital printed archive by combining discrete cosine transform and inverse transform to obtain the digital printed archive.
[0147] This embodiment also provides a computer device applicable to the method of generating digital printed archives, including: a memory and a processor; the memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement the method of generating digital printed archives as proposed in the above embodiment.
[0148] The computer device can be a terminal, comprising a processor, memory, communication interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, carrier networks, NFC (Near Field Communication), or other technologies. The display screen can be an LCD screen or an e-ink screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad on the computer device's casing, or an external keyboard, touchpad, or mouse.
[0149] This embodiment also provides a storage medium storing a computer program that, when executed by a processor, implements the method for generating digital printed archives as described in the above embodiments. The storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read Only Memory (EPROM), Programmable Red-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.
[0150] In summary, this invention solves the compatibility problem of multi-format files through file format parsing and standardization, ensuring that text, images, and other content are accurately extracted and uniformly stored, avoiding garbled characters and cross-platform compatibility issues. Based on GPU parallel computing for format conversion and image processing, and utilizing super-resolution optimization and vectorization conversion using physical optics models, it significantly improves the clarity and color reproduction of printed materials while reducing ink consumption. By extracting the layout information of the original file and performing universal encoding detection, it ensures that the layout design of the printed material is consistent with the original file, enhancing the cross-device compatibility and readability of the file. By using deep neural networks and DCT encoding to generate a watermark with strong concealment and high resistance to attacks, it effectively protects the copyright of digital printed archives and prevents piracy and illegal copying.
[0151] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.
Claims
1. A method for generating digital printed archives, characterized in that: include, Based on the file format of the original file uploaded by the user, the content of the original file is extracted using the parsing tool corresponding to the file format, and the extracted content of the original file is stored in a unified format to obtain structured document data; Based on a GPU parallel computing format conversion engine, the text content in structured document data is converted into print format. The image content in the structured document data undergoes color mapping, super-resolution optimization, and vectorization conversion to obtain a preliminary digital print archive. The specific steps are as follows: The image processing tasks in the structured document data are assigned to the GPU image processing core of the GPU parallel computing format conversion engine; According to the ICC color profile, the color values of the images in the structured document data are mapped to the CMYK color space to obtain a CMYK image; A super-resolution optimization method based on a physical optics model is used to optimize the super-resolution of CMYK images, as shown in the following expression: ; ; in, This is a CMYK image optimized through super-resolution. This is the inverse Fourier transform operator. For Fourier transform operators, For CMYK images, For optical transfer function, For spatial frequency variables, For modulation transfer function, The imaginary unit, For phase transfer function; An adaptive vectorization transformation method based on mathematical topology optimization and Bézier curve fitting is used to perform vectorization transformation on the super-resolution optimized CMYK image; The vectorized CMYK image is embedded into a PDF / X format text file to obtain a primary digital print archive. By extracting the layout information of the original file, the layout of the primary digital printing archive is set, and a general encoding detection is performed to obtain the intermediate digital printing archive. Watermark information is generated using Generative Adversarial Network (GAN), and then embedded into the images and page backgrounds of intermediate digital printed archives by combining Discrete Cosine Transform (DCT) and Inverse DCT, thus obtaining digital printed archives.
2. The method for generating digital printed archives as described in claim 1, characterized in that: The process involves extracting the content of the original file based on its file format using a corresponding parsing tool, and then storing the extracted content in a unified format to obtain structured document data. The specific steps are as follows: The file format of the original file is determined by extracting the file extension of the original file uploaded by the user. Based on the original file format, the corresponding parsing tool is used to extract the content of the original file; By reading the file header of the original file, it is determined whether the file encoding is a universal encoding. If the file encoding of the original file is a universal encoding, no format standardization operation is required. Otherwise, the file encoding of the original file is converted to a universal encoding by calling the character set conversion library. The original document content is standardized to output structured document data.
3. The method for generating digital printed archives as described in claim 2, characterized in that: The specific steps for converting the text content in structured document data into print format are as follows. The text processing tasks in the structured document data are assigned to the GPU computing cores of the GPU parallel computing format conversion engine; Use Ghostscript to generate PDF / X format files, embed all text content into the PDF / X format files, and obtain PDF / X format text files.
4. The method for generating digital printed archives as described in claim 3, characterized in that: The image is vectorized using an adaptive vectorization method based on mathematical topology optimization and Bézier curve fitting. The specific steps are as follows. Calculate the grayscale value of the image after super-resolution optimization to obtain a grayscale image; Sobel filtering is used to calculate the gradient changes in the vertical and horizontal directions of a grayscale image, detect edge intensity, and extract edge features from the grayscale image. By calculating the Hough transform formula, straight lines and curves in grayscale images can be identified. If a group of consecutive edge pixels are at the same distance or angle from the origin, then the group of edge pixels is considered to be on a straight line. Conversely, if a group of consecutive edge pixels are at the same distance but different angles from the origin, then the group of pixels is considered to be on a curve. For edge pixels on a straight line, the edge pixels at both ends are used as control points to fit a polyline. For a curve, calculate the curvature of each edge pixel on the curve; The spacing of control points is dynamically adjusted based on the curvature changes of pixels at the upper edge of the curve. Based on the adjustment and allocation of control points, a Bézier curve is generated for fitting, completing the vectorization conversion of the super-resolution optimized CMYK image.
5. The method for generating digital printed archives as described in claim 4, characterized in that: The process involves extracting the layout information from the original file, setting the layout of the primary digital printing archive, and performing general encoding detection to obtain the intermediate digital printing archive. The specific steps are as follows. The layout of the primary digital print archive is initially set according to the layout of the original document; Using the built-in PDF parsing tool of PDF / X files, extract the text content of the initial digital print archive after preliminary layout settings, and convert it into a universal encoding. If the encoding conversion fails, it means that the text of the initial digital print archive, after the initial layout settings, contains non-standard encoded legal characters. Use regular expressions to match control characters and hidden characters in non-general encoding legal characters, and then delete the control characters and hidden characters. The original encoding of erroneous characters in the legal characters of non-universal encoding is detected by a character set detection algorithm. The original encoding of the erroneous characters is then converted back to the universal encoding to obtain the intermediate digital printed archive.
6. The method for generating digital printed archives as described in claim 5, characterized in that: The process involves using a generative adversarial network to generate watermark information, and then embedding the watermark information into the images and page backgrounds of the intermediate digital printed archive using discrete cosine transform and inverse transform, thus obtaining the digital printed archive. The specific steps are as follows. User identity information, printing batch information, and printing equipment information are obtained by user-provided and queried printing logs; The user identity information, printing batch information, and printing equipment information are respectively calculated using a hash algorithm to obtain the identity identifier, printing batch identifier, and printing equipment identifier; The unique watermark information is obtained by hashing and fusing the identity identifier, printing batch identifier, and printing equipment identifier. The unique watermark information is converted into a unique watermark matrix through the reshape operation; The generator uses a deep convolutional neural network to convolve the unique watermark matrix to obtain a unique watermark. Upsampling is performed through transposed convolution to gradually enlarge the size of the unique watermark, and the Tanh activation function is used to generate the final watermark. Based on discrete cosine transform, the final watermark is embedded into a clean image to obtain a watermarked image; The discriminator is trained by inputting known watermarked images and clean images respectively. The discriminator gives the probability that the input image is a watermarked image and calculates the cross-entropy loss. The discriminator parameters are adjusted by minimizing the cross-entropy loss value. The generator minimizes the L2 norm of the watermarked image and the clean image by adjusting the final watermark generated; When the discriminator gives a 50% probability that the input image is a watermarked image, it means that the discriminator cannot distinguish between clean images and watermarked images, thus completing the training of the adversarial watermark generation network and outputting the final watermark. PDFBox is used to parse intermediate digital printed archives, extract all images and page backgrounds, and perform discrete cosine transform on each image and page background to obtain the DCT coefficient matrix of each image and page background. The final watermark is embedded in the DCT coefficient matrix of each image and page background. The image and page background with the final watermark are obtained by performing a discrete cosine inverse transform on the DCT coefficient matrix of the image and page background with the final watermark. Replace each image and page background with the corresponding images and page backgrounds in the intermediate digital print archive one by one to obtain the digital print archive.
7. An apparatus for generating digital printed archives, based on the method for generating digital printed archives according to any one of claims 1 to 6, characterized in that: This includes standardized templates, parallel computing templates, layout templates, and watermark encryption templates; The standardized template is used to extract the content of the original file according to the file format of the original file uploaded by the user, using the parsing tool corresponding to the file format, and store the extracted original file content in a unified format to obtain structured document data; The parallel computing template is used to convert the text content in the structured document data into the printing format based on the GPU parallel computing format conversion engine. At the same time, it performs color mapping, super-resolution optimization and vectorization conversion on the image content in the structured document data to obtain a primary digital printing archive. The layout template is used to set the layout of the primary digital printing archive by extracting the layout information of the original file, and to perform general encoding detection to obtain the intermediate digital printing archive. The watermark encryption template is used to generate watermark information using a generative adversarial network, and then embeds the watermark information into the images and page backgrounds of the intermediate digital printed archives by combining discrete cosine transform and inverse transform, thus obtaining the digital printed archives.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, it implements the steps of the method for generating digital printed archives according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by the processor, it implements the steps of the method for generating digital printed archives according to any one of claims 1 to 6.
Citation Information
Patent Citations
Real-time blind image restoration method
CN104820969A
Digitally printed anti-copy document and processes and products therefor
US20060284411A1