Multi-code fusion-based PDF (Portable Document Format) file watermark protection method, equipment and medium

By generating watermark information through multi-encoding fusion technology and embedding it in a lossy or lossless manner, the problem of uneven protection strength and low tamper detection accuracy in PDF file watermark protection is solved, and efficient watermark protection and tamper detection are achieved.

CN121167686APending Publication Date: 2025-12-19INSPUR ZHUOSHU BIG DATA IND DEV CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511170169.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-20
Publication Date
2025-12-19

AI Technical Summary

Technical Problem

Existing watermark protection methods for PDF files suffer from uneven protection levels and low accuracy in tamper detection.

Method used

Employing multi-encoding fusion technology, a matrix algorithm combining three-phase encoding and multi-level tree set split encoding is used to generate watermark information by combining the three-channel characteristics of color documents. Based on the size ratio of the protected area, a lossy or lossless embedding strategy is selected for real-time tampering detection.

Benefits of technology

It achieves lossless protection and efficient tamper detection of the protected area, improves the concealment and anti-cracking properties of watermark information, reduces the false judgment rate, and ensures the integrity of key content and the reliability of tamper tracing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121167686A_ABST
    Figure CN121167686A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a PDF (Portable Document Format) file watermark protection method and device based on multi-code fusion and a medium, belongs to the technical field of digital image security, and solves the problem of unbalanced protection strength of existing PDF file security protection. Comprising the following steps: determining a protection area in a target PDF file in response to different protection area selection modes; on the basis of a matrix algorithm of fusion of three-phase coding and multilevel tree set splitting coding, coding processing is carried out on the protection area to generate watermark information; determining different watermark embedding strategies based on the size proportion of the protection area in the target PDF file, so as to embed the watermark information into the corresponding position of the target PDF file through the different watermark embedding strategies; and comparing the authentication matrix for performing real-time calculation on the target PDF file with the authentication matrix corresponding to the extracted watermark information, and performing tampering detection on the target PDF file based on a comparison result.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of digital image security, and particularly relates to a PDF file watermark protection method and device based on multi-encoding fusion and a medium. BACKGROUND

[0002] With the continuous advancement of digitalization, the authenticity and integrity of images and documents as key information carriers are of great importance. Although traditional digital signature and encryption technology can ensure the security of data transmission, it is difficult to effectively deal with malicious tampering of document content in the transmission link and to provide continuous protection for the content itself.

[0003] Although digital watermarking technology has become a research hotspot, the existing scheme has obvious shortcomings. On the one hand, the existing technology adopts a one-size-fits-all protection strategy for different area ratios of the protection region, which may affect the content loss due to excessive protection in a small area, and it is difficult to achieve comprehensive protection due to insufficient protection in a large area, so that the protection strength and the area of the protected content are not matched. On the other hand, most schemes rely on a single channel or a simple multi-channel merging strategy, and the attack resistance of the authentication information is weak, and the capacity is limited in the limited redundant space. Therefore, the existing method has the problems of uneven protection strength and low tamper detection accuracy. SUMMARY

[0004] The embodiments of the present application provide a PDF file watermark protection method and device based on multi-encoding fusion and a medium, which are used to solve the technical problems that the existing PDF file security protection has the problems of uneven protection strength and low tamper detection accuracy.

[0005] The embodiments of the present application adopt the following technical solutions:

[0006] The embodiments of the present application provide a PDF file watermark protection method based on multi-encoding fusion. The method comprises the following steps: determining a protection region in a target PDF file in response to different protection region selection modes; performing encoding processing on the protection region based on a matrix algorithm of fusion of three-phase encoding and multi-level tree set splitting encoding to generate watermark information; determining different watermark embedding strategies based on the size proportion ratio of the protection region in the target PDF file, so as to embed the watermark information into the corresponding position of the target PDF file through different watermark embedding strategies; comparing the authentication matrix obtained by real-time calculation of the target PDF file and the authentication matrix corresponding to the extracted watermark information, and performing tamper detection on the target PDF file based on the comparison result.

[0007] In an implementation manner of the present application, the protection area is determined in the target PDF file in response to different protection area selection manners, and specifically includes: in response to an automatic protection area selection instruction, converting the target PDF file into image data format; traversing the image data through a preset feature extraction algorithm, identifying and selecting candidate feature points with corner point features; screening the candidate feature points to obtain effective feature points; analyzing the distribution characteristics of the effective feature points through a minimum inscribed rectangle algorithm to obtain a minimum inscribed rectangle enclosing the effective feature points; and determining the protection area according to the corner point feature saliency degree corresponding to the effective feature points and the distribution set characteristics of the effective feature points in the minimum inscribed rectangle.

[0008] In an implementation manner of the present application, the protection area is determined in the target PDF file in response to different protection area selection manners, and specifically includes: in response to an active protection area selection instruction, receiving a frame selection area selected by a user in the target PDF file through interactive operation; determining the corner point coordinates corresponding to the frame selection area to determine boundary coordinate parameters based on the corner point coordinates; determining the position information and size information of the frame selection area in the target PDF file based on the boundary coordinate parameters to obtain the protection area.

[0009] In an implementation manner of the present application, the protection area is encoded to generate watermark information based on a matrix algorithm fused with three-phase encoding and multi-level tree set splitting encoding, and specifically includes: performing three-phase encoding on the protection area to generate a first matrix with the same size as the protection area; performing multi-level tree set splitting encoding on the protection area, and intercepting the numerical sequence obtained after the encoding to obtain a second matrix with the same size as the protection area; and fusing and encrypting the first matrix and the second matrix to obtain the watermark information.

[0010] In an implementation manner of the present application, the first matrix and the second matrix are fused and encrypted to obtain the watermark information, and specifically includes: performing element-by-element binary encoding XOR gate operation on the first matrix and the second matrix to obtain a fusion matrix; based on the three-channel characteristics of the color document, the fusion matrix is expanded into a three-dimensional matrix form to generate three-dimensional matrix watermark information.

[0011] In an implementation manner of the present application, different watermark embedding strategies are determined based on the size proportion ratio of the protection area in the target PDF file, and specifically includes: if the size proportion ratio of the protection area in the target PDF file is greater than a preset proportion threshold, a lossy watermark embedding strategy is started; wherein the lossy watermark embedding strategy is a global embedding of the watermark information in the target PDF file; and if the size proportion ratio of the protection area in the target PDF file is not greater than the preset proportion threshold, a lossless watermark embedding strategy is started; wherein the lossless watermark embedding strategy is to embed the watermark information in the area outside the protection area corresponding to the target PDF.

[0012] In an implementation form of the present application, the authentication matrix calculated in real time for the target PDF file and the authentication matrix extracted from the watermark information are compared, and based on the comparison result, tampering detection is performed on the target PDF file, specifically including: when performing watermark detection on the target PDF file, the protection area consistent with the embedding stage is re-determined, and a real-time three-dimensional authentication matrix is re-generated for the protection area; the target PDF file is parsed to extract the embedded authentication matrix in the form of a three-dimensional matrix; the extracted authentication matrix and the real-time three-dimensional authentication matrix are compared element by element according to the corresponding channels and positions; based on the preset domain division rule, the comparison results in each domain are integrated into a group of Boolean values; the Boolean values are matched with the preset misplacement error truth table, and based on the matching result, tampering detection is performed on the target PDF file; wherein the preset misplacement error truth table includes a mapping relationship between different domain-level Boolean judgment value combinations and corresponding pixel tampering positions.

[0013] In an implementation form of the present application, in response to different protection area selection methods, before determining the protection area in the target PDF file, the method further includes: pre-processing the target PDF file; wherein the pre-processing at least includes any one of the following: parsing the format information of the target PDF file and converting it into a preset target format to unify the structure parameters of the target PDF file; identifying and removing interference information existing in the target PDF file; wherein the interference information at least includes one of annotations, comments, original watermarks, hidden layers, redundant metadata and invalid blank areas; performing content integrity verification on the target PDF file after the structure parameter unification and the interference information removal, and repairing if there is content damage.

[0014] The PDF file watermark protection device based on multi-coding fusion provided by the embodiments of the present application includes: at least one processor; and a memory in communication connection with the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to: determine the protection area in the target PDF file in response to different protection area selection methods; perform coding processing on the protection area based on a matrix algorithm of fusion of three-phase coding and multi-level tree set splitting coding to generate watermark information; determine different watermark embedding strategies based on the size proportion ratio of the protection area in the target PDF file, to embed the watermark information into the corresponding position of the target PDF file through different watermark embedding strategies; compare the authentication matrix calculated in real time for the target PDF file and the authentication matrix corresponding to the watermark information, and perform tampering detection on the target PDF file based on the comparison result.

[0015] The nonvolatile computer storage medium provided by the embodiment of the application stores computer executable instructions, which are configured to: determine a protection area in a target PDF file in response to different protection area selection modes; perform encoding processing on the protection area based on a matrix algorithm of three-phase coding and multi-level tree set splitting coding fusion to generate watermark information; determine different watermark embedding strategies based on the size proportion ratio of the protection area in the target PDF file, so as to embed the watermark information into a corresponding position of the target PDF file through the different watermark embedding strategies; compare an authentication matrix for real-time calculation of the target PDF file and an authentication matrix corresponding to the extracted watermark information, and perform tamper detection on the target PDF file based on a comparison result.

[0016] The above at least one technical solution adopted by the embodiment of the application can achieve the following beneficial effects: the embodiment of the application uses the area proportion threshold value, uses the lossless protection mode for the target area smaller than the threshold value, and embeds the watermark information only in the unprotected area, so as to ensure zero pollution of the key content; the full-image lossy protection mode is started for the area larger than the threshold value, the protection strength and the visual quality are balanced through the global optimization embedding algorithm, and the problem of excessive or insufficient protection caused by the traditional one-size-fits-all solution is solved. Secondly, the three-dimensional matrix coding technology is used to strengthen the concealment and anti-cracking of the watermark information, a multi-direction authentication matrix is constructed in combination with the three-channel characteristics of the color document, and the arithmetic coding compression technology is used to improve the information embedding capacity in the limited redundant space, and the robustness and embedding efficiency are taken into account. In addition, the dynamic authentication strategy based on the protection area reduces the misjudgment rate caused by the interference of the non-protection area, and provides a reliable basis for tamper tracing. BRIEF DESCRIPTION OF DRAWINGS

[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed to be used in the embodiments or the prior art description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments described in the present application, and other drawings can be obtained by those skilled in the art without creative labor. In the drawings:

[0018] Figure 1 A PDF file watermark protection method based on multi-coding fusion is provided for the embodiment of the present application;

[0019] Figure 2 A protection area selection flowchart is provided for the embodiment of the present application;

[0020] Figure 3 A multi-domain embedded watermark flowchart is provided for the embodiment of the present application;

[0021] Figure 4A structure schematic diagram of a PDF file watermark protection device based on multi-encoding fusion is provided in the embodiments of the present application.

[0022] Reference signs:

[0023] 200: PDF file watermark protection device based on multi-encoding fusion, 201: processor, 202: memory. DETAILED DESCRIPTION

[0024] The embodiments of the present application provide a PDF file watermark protection method, device and medium based on multi-encoding fusion.

[0025] In order for those skilled in the art to better understand the technical solutions in the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all the embodiments. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without creative labor should be within the scope of protection of the present application.

[0026] The technical solutions provided by the embodiments of the present application will be described in detail below with reference to the drawings.

[0027] Figure 1 A flowchart of a PDF file watermark protection method based on multi-encoding fusion is provided in the embodiments of the present application. As shown in the figure, the PDF file watermark protection method based on multi-encoding fusion includes the following steps: Figure 1

[0028] S101, determining a protection area in a target PDF file in response to different protection area selection modes.

[0029] In an implementation manner of the present application, first, a preprocessing operation is performed on the target PDF file to remove possible interference information in the file, unify the file format and parsing standard, and provide a stable data basis for the subsequent selection of the protection area and the embedding of the watermark.

[0030] Specifically, the preprocessing at least includes any one of the following: parsing the format information of the target PDF file and converting it into a preset target format to unify the structure parameters of the target PDF file. Identifying and removing interference information existing in the target PDF file; wherein the interference information at least includes one of annotations, comments, original watermarks, hidden layers, redundant metadata and invalid blank areas. The target PDF file after the structure parameter unification and the interference information removal is subjected to content integrity verification, and if there is content damage, it is repaired.

[0031] ​Specifically, the embodiment of the present application first analyzes the original format information of the target PDF file, including page size, resolution, font attribute, compression mode and other structural parameters, converts the file into a format conforming to the preset standard, and realizes the unification of the structural parameters of the target PDF file. Secondly, the embodiment of the present application identifies the interference information existing in the PDF file structure through deep analysis of the PDF file structure. The interference information at least includes one of annotations, comments, original watermarks, hidden layers, redundant metadata and invalid blank areas. For the identified interference information, its storage location in the file is located, and it is removed from the file. In addition, the embodiment of the present application also performs content integrity checking on the target PDF file after the structural parameter unification and interference information removal, detects whether the content is damaged due to format conversion or information removal, such as text garbled code, image distortion, graphic defects and other problems. If the content is found to be damaged, it is repaired according to the characteristics of the core content of the document to ensure the integrity and accuracy of the core content of the document.

[0032] In an implementation manner of the present application, in response to the automatic selection of the protection region instruction, the target PDF file is converted into an image data format. The image data is traversed through a preset feature extraction algorithm, candidate feature points with corner feature are identified and selected, the candidate feature points are screened, and effective feature points are obtained. The distribution characteristics of the effective feature points are analyzed through the minimum inscribed rectangle algorithm, and the minimum inscribed rectangle surrounding the effective feature points is obtained. According to the saliency degree of the corner feature corresponding to the effective feature points and the distribution centralized characteristics of the effective feature points in the minimum inscribed rectangle, the protection region is determined.

[0033] Figure 2 A protection region selection flowchart provided by the embodiment of the present application is shown as Figure 2 When the protection region in the target PDF file is determined, if the automatic selection mode is used, the Corner-ROI feature extraction algorithm is used to select and identify the feature points in the PDF file, and then the minimum inscribed rectangle algorithm is used to analyze the distribution of the feature points, and the region with the most significant feature and the most concentrated distribution is determined as the protection region to be protected.

[0034] Furthermore, the preprocessed PDF file is parsed and converted into a processable image data format. The Corner-ROI feature extraction algorithm is used to traverse each pixel region in the image data, identifying and selecting points with significant corner features. These points are typically locations of abrupt pixel value changes, such as the turning points of text edges, the corners of graphic outlines, or the boundary points of key information areas, as candidate feature points. The extracted candidate feature points are then filtered to remove false feature points caused by image noise, blurring, or other interference factors, retaining valid feature points with stable spatial distribution characteristics. The minimum inscribed moment algorithm is used to perform geometric analysis on the distribution of valid feature points, calculating the minimum rectangular boundary that can enclose all valid feature points. By analyzing the distribution density of feature points within this rectangle, the region where feature points are most concentrated is determined. Combining the salience of valid feature points, such as the sharpness of corners, the gradient of surrounding pixel changes, and the concentration of distribution, the region with the most significant and concentrated features is comprehensively determined as the area to be protected, and the minimum circumscribed boundary of this region is used as the specific range of the protected area.

[0035] In one implementation of this application, in response to an active command to select a protected area, a bounding box region selected by the user in a target PDF file through interactive operation is received. The corner coordinates corresponding to the bounding box region are determined, and boundary coordinate parameters are determined based on these corner coordinates. Based on the boundary coordinate parameters, the position and size information of the bounding box region in the target PDF file are determined to obtain the protected area.

[0036] Figure 2 A flowchart for selecting a protection region is provided for an embodiment of this application, such as... Figure 2 As shown, the selection of the protected area can be divided into automatic selection and active selection. Specifically, when the protected area is determined in the target PDF file, if the active selection method is adopted, the user selects the area to be protected through interactive operation. The system obtains the four corner coordinates of the selected area to determine the specific boundary coordinate parameters of the protected area. These parameters will serve as the basis for the range of subsequent watermark information embedding conditions.

[0037] Further, the embodiment of the present application provides a visual interactive interface to fully display the content of the preprocessed PDF file, and supports the user to frame the area to be protected on the interface through mouse, touch and other interactive methods. The framing operation can display the selection range in real time. When the user completes the framing operation, the coordinates of the four vertices of the framed area are captured in real time. The coordinates are based on the global coordinate system of the PDF file, contain the position parameters in the horizontal and vertical directions, and accurately reflect the boundary of the framed area. The captured four-corner coordinates are standardized to eliminate the coordinate deviation caused by page scaling and display proportion difference, and are uniformly mapped to the original coordinate system of the PDF file to ensure the consistency and accuracy of the coordinate parameters. Based on the standardized four-corner coordinate parameters, the boundary range data of the protected area is generated to clearly indicate the specific position and size of the area in the PDF file, which serves as the range basis for embedding the watermark information in the subsequent process to obtain the protected area.

[0038] In S102, a matrix algorithm based on the fusion of three-phase encoding and multi-level set splitting encoding is used to encode the protected area to generate the watermark information.

[0039] In one implementation of the present application, the three-phase encoding is performed on the protected area to generate a first matrix with the same size as the protected area, and the multi-level set splitting encoding is performed on the protected area, and the obtained numerical sequence after encoding is intercepted to obtain a second matrix with the same size as the protected area. The first matrix and the second matrix are fused and encrypted to obtain the watermark information.

[0040] Specifically, in the process of generating the watermark information according to the embodiment of the present application, the following three stages are included:

[0041] The first stage of encoding: three-phase encoding (3D-encoding) is performed on the determined protected area to generate a binary matrix with the same size as the protected area.

[0042] The second stage of encoding: multi-level set splitting encoding (SPIHT encoding, SPIHT-encoding) is performed on the protected area, and the numerical sequence obtained after encoding is intercepted. The length of the code formed after the interception matches the size of the binary matrix of the protected area.

[0043] The third stage of encoding: the three-phase encoding matrix generated in the first stage and the SPIHT encoding matrix generated in the second stage are fused and encrypted. The fusion process adopts a binary encoding XOR gate operation, and finally the watermark encoding information in the form of a three-dimensional matrix is obtained.

[0044] Specifically, the determined protection area is digitally parsed and converted into matrix data corresponding to the size of the area. Using a three-phase encoding rule, the characteristics of each element in the matrix, such as pixel value, color channel difference, etc., are analyzed and mapped to binary values of 0 or 1, and finally a binary matrix completely consistent with the size of the protection area is generated.

[0045] Further, for the same protection area, a multi-level tree set splitting encoding is performed: first, the digital information of the protection area is wavelet transformed to construct a multi-level tree structure of coefficients; then, through multiple rounds of set splitting, a numerical sequence containing the detailed features of the protection area is generated according to the importance of the coefficients. According to the size of the binary matrix generated in the first stage, the numerical sequence is truncated so that the length of the truncated code completely matches the size of the binary matrix, and the truncated sequence is converted into a matrix form to obtain the SPIHT encoding matrix.

[0046] Finally, the three-phase encoding binary matrix of the first stage and the SPIHT encoding matrix of the second stage are taken as operation objects, and the elements at corresponding positions in the two matrices are executed one by one to form a fusion matrix. Combined with the three-channel characteristics of the color PDF document, the information of the fusion matrix is expanded according to the channel dimension to construct a three-dimensional matrix structure containing spatial position and channel features, and finally the watermark encoding information in the form of a three-dimensional matrix is obtained.

[0047] S103, based on the size proportion of the protection area in the target PDF file, different watermark embedding strategies are determined to embed watermark information into the corresponding position of the target PDF file through different watermark embedding strategies.

[0048] In an implementation manner of the present application, if the size proportion of the protection area in the target PDF file is greater than a preset proportion threshold, a lossy watermark embedding strategy is started; wherein the lossy watermark embedding strategy is to perform global embedding of watermark information on the target PDF file. If the size proportion of the protection area in the target PDF file is not greater than the preset proportion threshold, a lossless watermark embedding strategy is started; wherein the lossless watermark embedding strategy is to embed watermark information in the area of the target PDF corresponding to the protection area.

[0049] Figure 3 A multi-domain embedded watermark flowchart provided by an embodiment of the present application is shown in FIG. 1. Figure 3 As shown in FIG. 1, when the area of the selected protection area is greater than a preset proportion threshold, such as 50%, of the total area of the PDF file, a lossy watermark embedding method is used. Since the watermark information embedded in this case may interfere with the protection area, a global embedding algorithm is selected to complete the global embedding of the watermark information under the premise of minimizing the impact on the protection area.

[0050] When the selected protection area is less than or equal to 50% of the total area of the PDF file, a lossless watermark embedding method is used to embed watermark information only in the area outside the protection area, ensuring that the embedding process does not cause any pollution to the protection area, and realizing lossless protection of the protection area. In the embedding process, the redundant space of the non-protection area, such as the subtle adjustment of pixel value and the redundant information of color channel, is used to carry watermark data, ensuring that the content of the protection area is not affected, and realizing zero-pollution protection of the key area.

[0051] As shown in Figure 3 After the embedding of the watermark information is completed, the processed image data is converted back to the PDF file format to ensure the compatibility and integrity of the file format. The converted PDF file is checked to detect the embedding effectiveness of the watermark information and the visual consistency of the document content, and the final watermark PDF file is output after confirmation.

[0052] S104, compare the authentication matrix calculated in real time for the target PDF file with the authentication matrix corresponding to the extracted watermark information, and perform tamper detection on the target PDF file based on the comparison result.

[0053] In an implementation manner of the present application, when performing watermark detection on the target PDF file, the protection area consistent with the embedding stage is re-determined, and a real-time three-dimensional authentication matrix is re-generated for the protection area. The target PDF file is parsed to extract the embedded three-dimensional matrix form authentication matrix, and the extracted authentication matrix and the real-time three-dimensional authentication matrix are compared element by element according to the corresponding channel and corresponding position. Based on the preset domain division rule, the comparison results in each domain are integrated into a group of Boolean values. The Boolean values are matched with the preset misplacement error truth table, and based on the matching result, tamper detection is performed on the target PDF file, wherein the preset misplacement error truth table includes a mapping relationship between different domain-level Boolean judgment value combinations and corresponding pixel tamper positions.

[0054] Specifically, when detecting the watermark of the target PDF file, the protection area is re-determined in the same way as in the watermark embedding stage, ensuring that the protection area in the detection stage completely matches the protection area in the embedding stage in terms of position and range. For the re-determined protection area, the three-phase encoding is performed to generate a binary matrix of corresponding size, SPIHT encoding is performed, and the encoded matrix matching the size of the binary matrix is intercepted, and then the two matrices are fused and encrypted through a binary encoding XOR gate operation, and a real-time three-dimensional authentication matrix is generated in combination with the three-channel characteristics of the color document, which reflects the feature information of the current target PDF file protection area. The target PDF file is parsed and processed, and according to the strategy during watermark embedding, the three-dimensional matrix form of the authentication matrix embedded before is extracted, which contains the original feature information of the protection area in the watermark embedding stage. The extracted embedded authentication matrix and the real-time generated three-dimensional authentication matrix are compared, and each element is compared one by one according to the corresponding channel and the same spatial position, and if the element values are the same, it is marked as matching, and if they are different, it is marked as not matching, and the comparison results of all positions are recorded. According to the preset domain division rule, the target PDF file is divided into multiple independent domains. The comparison results of all elements in each domain are integrated, and the matching state of each element is combined into a group of Boolean values to form the domain-level Boolean judgment value of the domain, reflecting the overall matching situation of the entire domain. The preset misplacement error truth table is called, which defines the mapping relationship between different domain-level Boolean judgment value combinations and specific pixel tampering positions in advance. The domain-level Boolean judgment value combination of each domain is matched with the entries in the truth table, and the specific pixel tampering coordinates corresponding to each mismatching condition are determined according to the matching results, so as to realize the tampering detection of the target PDF file and accurately locate the tampered pixel position.

[0055] Figure 4 A structure diagram of a PDF file watermark protection device based on multi-coding fusion provided by an embodiment of the present application. As shown in Figure 4As shown, the PDF file watermark protection device 200 based on multi-encoding fusion includes: at least one processor 201; and a memory 202 connected in communication with the at least one processor 201; wherein the memory 202 stores instructions executable by the at least one processor 201, and the instructions are executed by the at least one processor 201 to enable the at least one processor 201 to: determine a protection area in a target PDF file in response to different protection area selection modes; encode the protection area based on a matrix algorithm of fusion of three-phase encoding and multi-level tree set splitting encoding to generate watermark information; determine different watermark embedding strategies based on the size proportion ratio of the protection area in the target PDF file, to embed the watermark information into the corresponding position of the target PDF file through different watermark embedding strategies; compare the authentication matrix for real-time calculation of the target PDF file and the authentication matrix corresponding to the extracted watermark information, and perform tamper detection on the target PDF file based on the comparison result.

[0056] The non-volatile computer storage medium provided by the embodiments of the present application stores computer executable instructions, and the computer executable instructions are configured to: determine a protection area in a target PDF file in response to different protection area selection modes; encode the protection area based on a matrix algorithm of fusion of three-phase encoding and multi-level tree set splitting encoding to generate watermark information; determine different watermark embedding strategies based on the size proportion ratio of the protection area in the target PDF file, to embed the watermark information into the corresponding position of the target PDF file through different watermark embedding strategies; compare the authentication matrix for real-time calculation of the target PDF file and the authentication matrix corresponding to the extracted watermark information, and perform tamper detection on the target PDF file based on the comparison result.

[0057] Each of the embodiments in the present application is described in a progressive manner, and the same or similar parts between each of the embodiments can be referred to each other. Each of the embodiments focuses on the difference from other embodiments. In particular, for the device, equipment, and non-volatile computer storage medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the part of the method embodiments.

[0058] The above only describes the embodiments of the present application and is not intended to limit the present application. The embodiments of the present application can be variously changed and modified by those skilled in the art. These modifications or replacements do not make the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A method for watermarking protection of a PDF file based on multi- encoding fusion, characterized in that, The method comprises: determining a protection area in a target PDF file in response to different protection area selection modes; encoding the protection area based on a matrix algorithm combining three-phase encoding and multi-level tree set splitting encoding to generate watermark information; determining different watermark embedding strategies based on the size proportion of the protection area in the target PDF file, so as to embed the watermark information into the corresponding position of the target PDF file through different watermark embedding strategies; comparing the authentication matrix obtained by real-time calculation of the target PDF file with the authentication matrix corresponding to the watermark information, and detecting tampering of the target PDF file based on the comparison result.

2. The multi-encoding fusion based PDF file watermarking protection method of claim 1, wherein, The method of determining a protection area in a target PDF file in response to different protection area selection modes comprises: converting the target PDF file into image data format in response to an automatic protection area selection instruction; identifying and selecting candidate feature points with corner feature points through a preset feature extraction algorithm to traverse the image data; screening the candidate feature points to obtain effective feature points; analyzing the distribution characteristics of the effective feature points through a minimum inscribed circle algorithm to obtain a minimum inscribed circle enclosing the effective feature points; determining the protection area according to the saliency of the corner feature points corresponding to the effective feature points and the distribution characteristics of the effective feature points in the minimum inscribed circle.

3. The multi-encoding fusion based PDF file watermarking protection method of claim 1, wherein, The method of determining a protection area in a target PDF file in response to different protection area selection modes comprises: receiving a selected framing area in the target PDF file through interactive operation of a user in response to an active protection area selection instruction; determining the corner coordinates corresponding to the framing area to determine the boundary coordinate parameters based on the corner coordinates; determining the position information and size information of the framing area in the target PDF file based on the boundary coordinate parameters to obtain the protection area.

4. The multi-encoding fusion based PDF file watermarking protection method of claim 1, wherein, The method of encoding the protection area based on a matrix algorithm combining three-phase encoding and multi-level tree set splitting encoding to generate watermark information comprises: performing three-phase encoding on the protection area to generate a first matrix with the same size as the protection area; performing multi-level tree set splitting encoding on the protection area, and intercepting the numerical sequence obtained after encoding to obtain a second matrix with the same size as the protection area; fusing and encrypting the first matrix and the second matrix to obtain the watermark information.

5. The multi-encoding fusion based PDF file watermarking protection method of claim 4, wherein, The method of fusing and encrypting the first matrix and the second matrix to obtain the watermark information comprises: performing element-by-element binary encoding XOR gate operation on the first matrix and the second matrix to obtain a fusion matrix; extending the fusion matrix into a three-dimensional matrix form based on the three-channel characteristics of color documents to generate three-dimensional matrix watermark information.

6. The multi-encoding fusion based PDF file watermarking protection method of claim 1, wherein, The method of determining different watermark embedding strategies based on the size proportion of the protection area in the target PDF file comprises: if the size proportion of the protection region in the target PDF file is greater than a preset proportion threshold, a lossy watermark embedding strategy is started; wherein the lossy watermark embedding strategy is to perform global embedding of watermark information on the target PDF file; if the size proportion of the protection region in the target PDF file is not greater than a preset proportion threshold, a lossless watermark embedding strategy is started; wherein the lossless watermark embedding strategy is to embed watermark information in a region outside the protection region corresponding to the target PDF.

7. The multi-encoding fusion based PDF file watermarking protection method of claim 1, wherein, The authentication matrix calculated in real time for the target PDF file and the authentication matrix obtained by extracting the watermark information are compared, and based on the comparison result, tampering detection is performed on the target PDF file, specifically including: When performing watermark detection on the target PDF file, the protection region consistent with the embedding stage is re-determined, and a real-time three-dimensional authentication matrix is re-generated for the protection region; The target PDF file is parsed, and the embedded three-dimensional matrix form authentication matrix is extracted; the extracted authentication matrix and the real-time three-dimensional authentication matrix are compared element by element according to the corresponding channel and the corresponding position; Based on a preset domain division rule, the comparison results in each domain are integrated into a group of Boolean values; The Boolean values are matched with a preset misplacement error truth table, and based on the matching result, tampering detection is performed on the target PDF file; wherein the preset misplacement error truth table includes a mapping relationship between different domain-level Boolean judgment value combinations and corresponding pixel tampering positions.

8. The multi-encoding fusion based PDF file watermarking protection method of claim 1, wherein, The method further comprises the following steps before determining the protection region in the target PDF file in response to different protection region selection methods: Preprocessing the target PDF file; The preprocessing at least includes any one of the following: Parsing the format information of the target PDF file and converting it into a preset target format to unify the structure parameters of the target PDF file; Identifying and removing interference information existing in the target PDF file; wherein the interference information at least includes one of annotations, comments, original watermarks, hidden layers, redundant metadata and invalid blank areas; Performing content integrity verification on the target PDF file after structure parameter unification and interference information removal, and repairing if there is content damage.

9. A PDF file watermarking apparatus based on multi-encoding fusion, characterized by, The device includes a memory for storing computer program instructions and a processor for executing program instructions, wherein when the computer program instructions are executed by the processor, the device is triggered to perform the method of any one of claims 1-8.

10. A non-transitory computer storage medium storing computer-executable instructions that, when executed, cause a computer to perform: The computer executable instructions can perform the method of any one of claims 1-8. The computer executable instructions can perform the method of any one of claims 1-8.