Text zero-watermark generation and verification method and system based on document layout similarity
Through the text zero watermark generation and verification method based on document layout similarity, the layout feature zero watermark is generated using the SimHash algorithm, which solves the problem of insufficient anti-aggressive and robustness in the existing technology, and realizes the digital documents of the power industry Efficient protection.
Patent Information
- Application Number
- CN202410945158.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-15
- Publication Date
- 2024-11-08
AI Technical Summary
The existing zero-watermarking technology is insufficient in terms of offensive resistance and robustness, especially when document layout changes or partial content adjustments, it is easy to cause watermark verification to fail, and it cannot effectively protect the integrity and copyright of key digital documents in the power industry.
Using the text zero watermark generation and verification method based on document layout similarity, by dividing digital documents into statements, constructing statement length feature sequences, mapping them into ASCII code values, combining watermark information for binary conversion and equal length processing, using SimHash algorithm Generate a zero watermark of layout features and store it in a trusted database. The Hamming distance is calculated during verification to evaluate layout features similarity.
It improves the robustness and reliability of zero watermarks, can effectively verify the authenticity of watermarks when document layout changes, protect the integrity and copyright of digital documents in the power industry and other fields, and is easy to implement and deploy.
Smart Images

Figure CN118916855A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of data security, and in particular relates to a text zero-watermark generation and verification method and system based on document layout similarity. Background Art
[0002] With the development of information technology and the popularization of the Internet, the dissemination and sharing of digital information has become more and more common. However, the accompanying information security issues are also becoming increasingly serious. Digital documents are easily illegally tampered with, misappropriated or maliciously tampered with during the dissemination process, which not only damages the interests of the original author, but may also lead to serious legal disputes and information security issues. Therefore, how to effectively protect the integrity and copyright of digital documents has become an important research topic.
[0003] In the power industry, the process of digitalization and informatization is accelerating, and a large number of key documents such as power design drawings, technical specifications, operating procedures, dispatch records, etc. are gradually saved and transmitted in digital form. These documents are not only important assets of the enterprise, but also the basis for ensuring the safe and stable operation of the power system. Once these documents are illegally tampered with or leaked, serious safety accidents and economic losses may occur. Therefore, the power industry has extremely high requirements for the security and reliability of digital documents.
[0004] Zero watermark technology is a watermark technology that does not modify the original document. It generates a watermark by extracting feature information from the original document and compares the original document with the watermark to verify the authenticity of the document when verification is required. Compared with traditional embedded watermark technology, zero watermark technology has the advantages of not changing the original document content and not affecting the document quality. However, the existing zero watermark technology still has shortcomings in terms of anti-attack and robustness, especially when the document layout changes or part of the content is adjusted, which easily leads to watermark verification failure. Summary of the invention
[0005] In order to address the deficiencies in the prior art, the present invention provides a text zero watermark generation and verification method and system based on document layout similarity, so as to improve the reliability and security of zero watermark technology in practical applications in the power industry, and effectively protect the integrity and confidentiality of key digital documents in the power industry.
[0006] In order to solve the above technical problems, the present invention adopts the following technical solutions.
[0007] The present invention first discloses a text zero watermark generation and verification method based on document layout similarity, the method comprising the following steps:
[0008] Step 1: Divide the digital document into multiple independent sentences, and construct a sentence length feature sequence set of the digital document according to the number of characters of each sentence;
[0009] Step 2: Mapping the sentence length feature sequence into an ASCII code value of a fixed length, and composing the ASCII code value into a layout feature sequence of the data document;
[0010] Step 3: Encode the watermark information containing the author's identity identifier to obtain a watermark code sequence, perform binary conversion and equal length processing on the watermark code sequence and the layout feature sequence of the data document in sequence, and generate a document layout feature sequence combined with the watermark information;
[0011] Step 4: Input the document layout feature sequence combined with the watermark information into the local sensitive hash generator, and use the SimHash algorithm to weight, merge and reduce the dimension of the document layout feature sequence combined with the watermark information to form a layout feature zero watermark;
[0012] Step 5: Store the generated zero watermark in a trusted third-party database.
[0013] The present invention further includes the following preferred embodiments:
[0014] The step 1 further comprises:
[0015] Step 1.1: Get a digital document X, and divide the document X into multiple independent complete sentences by identifying punctuation marks, forming a sentence set T = {t 1 , t 2 ,…t n}, where t i represents the i-th sentence in document X, and the total number of sentences contained in document X is calculated to be n;
[0016] Step 1.2: For each statement t in the set T i , calculate the total number of characters, and get each sentence t i The corresponding sentence length l i ;
[0017] Step 1.3: Place all l i Arrange them in the order in the document and construct the sentence length feature sequence set L of document X = {l 1 ,l 2 ,…l n}.
[0018] The step 2 further comprises:
[0019] Step 2.1: Set the length of each sentence in the digital document X to l i Mapped to a specific ASCII code value through the mapping function map, the mapping function map is defined as follows:
[0020] ri =map(l i )=ascii(l i mod 255)
[0021] Where ascii() represents the mapping of binary numbers to corresponding ASCII symbols;
[0022] Step 2.2: According to the mapping function, each element in the length feature sequence set L is mapped to the corresponding ASCII code value, and the mapping set R = {r 1 ,r 2 ,…r n};
[0023] Step 2.3: Concatenate the elements of the mapping set R in order to obtain the layout feature sequence N = r of document X 1 +r 2 +…+r n .
[0024] The step 3 further comprises:
[0025] Step 3.1: Encode the watermark information m according to UTF-8 encoding to obtain a watermark encoding sequence M; the watermark information includes an identifier indicating the author's identity and a timestamp;
[0026] Step 3.2: Convert the document layout feature sequence N into a binary sequence N′; convert the watermark information encoding sequence M into a binary sequence M′;
[0027] Step 3.3: Calculate the bit length l of the watermark coded binary sequence M′ respectively a and the bit length l of the layout feature sequence N′ of the digital document X b ;
[0028] Step 3.4: Compare the bit lengths l of the two sequences a and l b ; If the two sequences are of different lengths, pad the shorter sequence to make the two sequences equal in length;
[0029] Step 3.5: Perform a bit-by-bit XOR operation on the two equal-length sequences after the padding process to generate a document layout feature sequence combined with the watermark information of the digital document.
[0030] The step 3.4 further comprises:
[0031] Step 3.4.1: If l a > b , then copy the layout feature sequence N′[l a / l b ] parts, and the length is l b*[l a / l b ] bits of new sequence, and then add (l a -l b *[l a / l b ]) bit 0, the concatenation length is l a The new sequence M c ;
[0032] Step 3.4.2: If l a <l b , then the watermark information sequence M′ is copied [l b / l a ] parts, and the sequence length is l a *[l b / l a ] bits of new sequence, and then add (l b -l a *[l b / l a ]) bit 0, the concatenation length is l b The new sequence N c .
[0033] The step 3.5 further comprises:
[0034] Step 3.5.1: If l a > b , then the generated document layout feature sequence P is:
[0035] P=M ′ ⊕N c
[0036] Step 3.5.2: If l a <l b , then the generated document layout feature sequence P is:
[0037] P=M c ⊕N′.
[0039] The step 4 further comprises:
[0040] Step 4.1: Divide the document layout feature sequence P combined with watermark information into multiple feature strings F of equal length i ,i=1,2,…,n, the length of each feature string is c bits;
[0041] Step 4.2: For each feature string F i Assign weight k i ; According to whether the bit value in the feature string is "1" or "0", it is converted to k i or -k i; Let F i [j] is F i The jth bit in the ij for:
[0042]
[0043] Step 4.3: Accumulate the weighted values W of all feature strings at each position j ij , forming an overall sequence string V; the specific calculation method is as follows:
[0044]
[0045] Where V[j] represents the weighted sum of all feature strings at the jth position;
[0046] Step 4.4: Perform dimensionality reduction on the merged sequence V. If V[j] is greater than 0, S[j] is recorded as 1; if V[j] is less than or equal to 0, S[j] is recorded as 0. S[j] represents the dimensionality reduction result of the jth bit of V:
[0047]
[0048] The present invention also discloses a text zero watermark verification method based on document layout similarity using the above-mentioned text zero watermark generation method based on document layout similarity, comprising:
[0049] Step 6: Generate a layout feature zero watermark for the document to be verified using the document layout similarity text zero watermark generation method;
[0050] Step 7: Calculate the Hamming distance between the zero watermark of the layout feature of the document to be verified and the zero watermark of the original document stored in the trusted database to evaluate the similarity of the layout features between the document to be verified and the original document recorded in the trusted database;
[0051] Step 8: Based on the layout feature similarity, output the verification result according to a preset threshold.
[0052] The present invention also discloses a text zero watermark generation system based on document layout similarity using the above-mentioned text zero watermark generation method based on document layout similarity, comprising:
[0053] A division module, used to divide the digital document into a plurality of independent sentences, and construct a sentence length feature sequence set of the digital document according to the number of characters of each sentence;
[0054] A mapping module is used to map the sentence length feature sequence into an ASCII code value of a fixed length, and to compose the layout feature sequence of the data document with the ASCII code value.
[0055] A combination module is used to encode the watermark information containing the author's identity identifier to obtain a watermark code sequence, perform binary conversion and equal length processing on the watermark code sequence and the layout feature sequence of the data document in sequence, and generate a document layout feature sequence combined with the watermark information;
[0056] A zero watermark generation module is used to input the document layout feature sequence combined with watermark information into a local sensitive hash generator, and use the SimHash algorithm to weight, merge and reduce the dimension of the document layout feature sequence combined with watermark information to form a layout feature zero watermark;
[0057] The storage module is used to store the generated zero watermark in a trusted third-party database.
[0058] The present invention also discloses a text zero watermark verification system based on document layout similarity using the above-mentioned text zero watermark verification method based on document layout similarity, comprising:
[0059] A generation module, used for generating a layout feature zero watermark for a document to be verified by using the text zero watermark generation method based on document layout similarity;
[0060] An evaluation module, used for calculating the Hamming distance between the zero watermark of the layout feature of the document to be verified and the zero watermark of the original document stored in the trusted database, so as to evaluate the similarity of the layout features between the document to be verified and the original document recorded in the trusted database;
[0061] The verification module is used to output a verification result based on the layout feature similarity and a preset threshold.
[0062] Accordingly, the present application also discloses a terminal, including a processor and a storage medium;
[0063] The storage medium is used to store instructions;
[0064] The processor is used to operate according to the instructions to execute the steps of the aforementioned text zero watermark generation and verification method based on document layout similarity.
[0065] Correspondingly, the present application also discloses a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the steps of the aforementioned text zero watermark generation and verification method based on document layout similarity are implemented.
[0066] The beneficial effect of the present invention is that, compared with the prior art, the present invention provides a text zero watermark generation and verification method and system based on document layout similarity, which utilizes the layout features of the document to extract and analyze the document's page layout information to generate a zero watermark with high robustness. Watermark generation and verification are performed using only the layout features of the document, and there is no need to embed a large amount of hidden information in the text; it does not require complex encryption algorithms or large-scale calculations, is easy to implement and deploy, and has high practicality and feasibility. BRIEF DESCRIPTION OF THE DRAWINGS
[0067] Figure 1 It is a flow chart of the text zero watermark generation method based on document layout similarity in the present invention.
[0068] Figure 2 It is a flow chart of the text zero watermark verification method based on document layout similarity in the present invention.
[0069] Figure 3 It is the overall flow chart of text zero watermark generation and verification in the present invention. DETAILED DESCRIPTION
[0070] In order to make the purpose, technical solution and advantages of the present invention more clear, the technical solution of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention.
[0071] The embodiments described in this application are only some embodiments of the present invention, not all embodiments. Based on the spirit of the present invention, other embodiments obtained by ordinary technicians in this field without creative work are all within the protection scope of the present invention.
[0072] In view of the shortcomings of the prior art, the present invention proposes a text zero watermark generation and verification method and system based on document layout similarity, which utilizes the layout features of the document to extract and analyze the layout information of the document to generate a zero watermark with high robustness, so that the authenticity of the watermark can still be effectively verified when the document layout changes. First, the document is divided into independent sentences by identifying the punctuation marks in the document, and the length of each sentence is calculated to construct the sentence length feature sequence of the document. Then the length feature sequence is converted into an ASCII code value of a fixed length to form a layout feature sequence of the document, and combined with the watermark information. Next, the layout features combined with the watermark are processed using the SimHash algorithm to generate the final zero watermark and store it in a trusted database. In the verification stage, the same processing flow is performed on the document to be verified, the zero watermark to be verified is generated, and the Hamming distance is compared with the zero watermark in the database, and the set threshold is used to determine whether the document has similar layout features. The present invention utilizes the layout features of the document to generate and verify the zero watermark, has high robustness and practicality, and can effectively protect the integrity and copyright of digital documents in the power industry and other fields.
[0073] See also Figure 1 The text zero watermark generation method based on document layout similarity disclosed in the present invention comprises the following steps:
[0074] Step 1: Divide a digital document into multiple independent sentences, and construct a sentence length feature sequence set of the digital document according to the number of characters of each sentence.
[0075] The step 1 further comprises:
[0076] Step 1.1: Get a digital document X, and divide the document X into multiple independent complete sentences by identifying punctuation marks such as periods, question marks, and exclamation marks, forming a sentence set T = {t 1 , t 2 ,…t n}, where t i It represents the i-th sentence in document X, and the total number of sentences contained in document X is calculated to be n.
[0077] Step 1.2: For each statement t in the set T i , calculate the total number of characters, and get each sentence t i The corresponding sentence length l i .
[0078] Step 1.3: Place all l i Arrange them in the order in the document and construct the sentence length feature sequence set L of document X = {l 1 ,l 2 ,…l n}.
[0079] Step 2: Map the sentence length feature sequence into ASCII code values of fixed length, and compose the ASCII code values into a layout feature sequence of the data document.
[0080] The step 2 further comprises:
[0081] Step 2.1: Set the length of each sentence in the digital document X to l i Mapped to a specific ASCII code value through the mapping function map. The mapping function map takes a statement length l i As input, output a corresponding ASCII code value r i Since there are only 256 8-bit ASCII codes, the mapping function is defined as follows:
[0082] r i =map(l i )=ascii(l i mod 255)
[0083] Where ascii() represents the mapping of binary numbers to corresponding ASCII symbols.
[0084] Step 2.2: According to the mapping function, each element in the length feature sequence set L is mapped to the corresponding ASCII code value, and the mapping set R = {r 1 ,r 2 ,…r n}.
[0085] Step 2.3: Sequence the elements of the mapping set R to obtain the layout feature sequence N of the document X. The document layout feature sequence is represented by N = r 1 +r 2 +…+r n .
[0086] Step 3: Encode the watermark information containing the author's identity to obtain a watermark coding sequence, perform binary conversion and equal-length processing on the watermark coding sequence and the layout feature sequence of the data document in turn, and generate a document layout feature sequence combined with the watermark information.
[0087] The step 3 further comprises:
[0088] Step 3.1: Encode the watermark information m according to UTF-8 encoding to obtain a watermark encoding sequence M. The watermark information includes an identifier indicating the author's identity and a timestamp, etc.
[0089] Step 3.2: Convert the document layout feature sequence and the watermark information encoding sequence into a document layout feature binary sequence and a watermark information encoding binary sequence respectively.
[0090] The step 3.2 further comprises:
[0091] Step 3.2.1: Convert the document layout feature sequence N into a binary sequence N′.
[0092] Step 3.2.2: Convert the watermark information encoding sequence M into a binary sequence M′.
[0093] Step 3.3: Calculate the bit length l of the watermark coded binary sequence M′ respectively a and the bit length l of the layout feature sequence N′ of the digital document X b .
[0094] Step 3.4: Compare the bit lengths l of the two sequences a and l b If the two sequences are of unequal length, pad the shorter sequence to make them equal in length.
[0095] The step 3.4 further comprises:
[0096] Step 3.4.1: If l a > b , then copy the layout feature sequence N′[l a / l b ] parts, and the length is l b *[l a / l b ] bits of new sequence, and then add (l a -l b *[l a / l b ]) bit 0, the concatenation length is l a The new sequence M c .
[0097] Step 3.4.2: If l a <l b , then the watermark information sequence M′ is copied [l b / l a ] parts, and the sequence length is l a *[l b / l a ] bits of new sequence, and then add (l b -l a *[l b / l a ]) bit 0, the concatenation length is l b The new sequence Nc .
[0098] Step 3.5: Perform a bit-by-bit XOR operation on the two equal-length sequences after the padding process to generate a document layout feature sequence combined with the watermark information of the digital document.
[0099] The step 3.5 further comprises:
[0100] Step 3.5.1: If l a > b , then the generated document layout feature sequence P is:
[0101] P=M ′ ⊕N c
[0102] Step 3.5.2: If l a <l b , then the generated document layout feature sequence P is:
[0103] P=M c ⊕N′
[0104] Step 4: Input the document layout feature sequence combined with the watermark information into the local sensitive hash generator, and use the SimHash algorithm to weight, merge and reduce the dimension of the document layout feature sequence combined with the watermark information to form a layout feature zero watermark.
[0105] A locality-sensitive hash generator is a specific algorithm implementation used to process and transform data to enhance its security and recognition. In the present invention, the generator uses the SimHash algorithm to generate zero watermarks. The SimHash algorithm mainly processes long bit sequences by reducing the dimensionality of data. The specific method includes weighting the features, merging them, and then reducing the dimensionality to generate shorter sequences.
[0106] First, a sequence of document features combined with watermark information is received, and then converted into a zero watermark through a series of data processing steps. This method retains the main information of the document while enhancing the uniqueness and security of the generated watermark, effectively converting the document features into a unique and difficult-to-tamper zero watermark, thereby protecting the copyright and integrity of the document without affecting the original content.
[0107] The step 4 further comprises:
[0108] Step 4.1: Divide the document layout feature sequence P combined with watermark information into multiple feature strings F of equal length i ,i=1,2,…,n, the length of each feature string is c bits.
[0109] Step 4.2: For each feature string F i Assign weight ki The weight k i It is usually a positive number. Its specific value depends on the importance of the feature and can range from 0 to positive infinity. According to whether the bit value in the feature string is "1" or "0", it is converted to k i or -k i Let F i [j] is F i The jth bit in the ij for:
[0110]
[0111] Step 4.3: Accumulate the weighted values W of all feature strings at each position j ij , forming an overall sequence string V. The specific calculation method is as follows:
[0112]
[0113] Among them, V[j] represents the weighted sum of all feature strings at the jth position. This step combines the information of all feature strings into a single sequence.
[0114] Step 4.4: Perform dimensionality reduction on the merged sequence V. If V[j] is greater than 0, S[j] is recorded as 1; if V[j] is less than or equal to 0, S[j] is recorded as 0. S[j] represents the dimensionality reduction result of the jth bit of V, which is formally expressed as follows:
[0115]
[0116] S is the final generated layout feature zero watermark, which is a sequence of 0 and 1, reflecting the comprehensive characteristics of each bit of the merged sequence V. The dimensionality reduction process simplifies the data expression while retaining key information, making the processed S an effective zero watermark output that can be used for subsequent verification, representing the characteristic signature of the layout feature of the digital document X, which is used for copyright protection and data integrity verification.
[0117] Step 5: Store the generated zero watermark in a trusted third-party database.
[0118] The storage operation ensures that the zero watermark S can be reliably retrieved when copyright verification or data integrity verification is required. When transmitted to the designated secure database, its storage location and storage time are recorded for future access and verification.
[0119] See also Figure 2 As shown, the verification method of the text zero watermark generation method based on document layout similarity disclosed in the present invention comprises the following steps:
[0120] Step 6: Execute steps 1 to 4 on the document to be verified X′ to obtain the layout feature zero watermark S′ of the document to be verified.
[0121] By generating a zero watermark corresponding to the original document, subsequent copyright verification and data integrity verification can be performed.
[0122] Step 7: Calculate the Hamming distance between the zero watermark S′ of the layout feature of the document to be verified and the zero watermark of the original document stored in the trusted database to evaluate the similarity of the layout features between the document to be verified and the original document recorded in the trusted database.
[0123] The specific steps are as follows:
[0124] Step 7.1: Receive the layout feature zero watermark S′ to be verified and the layout feature zero watermark {S 1 ,S 2 ,…,S u}, where u represents the total number of zero watermarks of layout features in the database.
[0125] Step 7.2: Zero watermark S for each layout feature stored in the trusted database t ,t=1,2,…,u, calculate the Hamming distance H(S t ,S ′ ). Hamming distance H(S t ,S ′ ) indicates that in the sequence S t and S ′ The sum of the digits with different values at the corresponding positions in . The calculation method is as follows:
[0126]
[0127] Among them, ⊕ represents the XOR operation, S t [i] and S ′ [i] are S t and S ′ At the value of the ith position, cl is the length of the zero watermark sequence.
[0128] Step 7.3: Output consists of all H(S t ,S ′ ) is the Hamming distance set
[0129] {H(S 1 ,S ′ ),H(S 2 ,S ′ ),…,H(S u ,S ′ )}.
[0130] Step 8: Based on the layout feature similarity, output the verification result according to a preset threshold.
[0131] Through precise data processing and intelligent decision logic, efficient evaluation of document copyright verification and data integrity is ensured.
[0132] The step 8 further comprises:
[0133] Step 8.1: For the Hamming distance set {H(S 1 ,S ′ ),H(S 2 ,S ′ ),…,H(S u ,S ′ )} are sorted from small to large. The sorted distance set is recorded as {H sorted [1],H sorted [2],…,H sorted [u]}, where H sorted [1] is the smallest Hamming distance, indicating the highest similarity.
[0134] H sorted =sort(H(S t ,S ′ ))
[0135] Step 8.2: According to the preset threshold θ, determine the minimum Hamming distance H after sorting sorted [1] is less than or equal to θ. If H sorted [1]≤θ, then X′ is judged to have similar layout features to the original document, thereby confirming the copyright status or data integrity of document X′. The threshold θ is set according to actual application requirements and previous verification results to distinguish the boundaries of acceptance and rejection.
[0136]
[0137] Step 8.3: Output the verification result, indicating whether to accept that the document to be verified X′ has similar layout features to the original document.
[0138] The beneficial effect of the present invention is that, compared with the prior art, the present invention provides a text zero watermark generation and verification method and system based on document layout similarity, which utilizes the layout features of the document to extract and analyze the document's page layout information to generate a zero watermark with high robustness. Watermark generation and verification are performed using only the layout features of the document, and there is no need to embed a large amount of hidden information in the text; it does not require complex encryption algorithms or large-scale calculations, is easy to implement and deploy, and has high practicality and feasibility.
[0139] The present invention may be a system, a method and / or a computer program product. The present invention also discloses a text zero watermark generation system based on document layout similarity using the above-mentioned text zero watermark generation method based on document layout similarity, comprising:
[0140] A division module, used to divide the digital document into a plurality of independent sentences, and construct a sentence length feature sequence set of the digital document according to the number of characters of each sentence;
[0141] A mapping module is used to map the sentence length feature sequence into an ASCII code value of a fixed length, and to compose the layout feature sequence of the data document with the ASCII code value.
[0142] A combination module is used to encode the watermark information containing the author's identity identifier to obtain a watermark code sequence, perform binary conversion and equal length processing on the watermark code sequence and the layout feature sequence of the data document in sequence, and generate a document layout feature sequence combined with the watermark information;
[0143] A zero watermark generation module is used to input the document layout feature sequence combined with watermark information into a local sensitive hash generator, and use the SimHash algorithm to weight, merge and reduce the dimension of the document layout feature sequence combined with watermark information to form a layout feature zero watermark;
[0144] The storage module is used to store the generated zero watermark in a trusted third-party database.
[0145] The present invention also discloses a text zero watermark verification system based on document layout similarity using the above-mentioned text zero watermark verification method based on document layout similarity, comprising:
[0146] A generation module, used for generating a layout feature zero watermark for a document to be verified by using the text zero watermark generation method based on document layout similarity;
[0147] An evaluation module, used for calculating the Hamming distance between the zero watermark of the layout feature of the document to be verified and the zero watermark of the original document stored in the trusted database, so as to evaluate the similarity of the layout features between the document to be verified and the original document recorded in the trusted database;
[0148] The verification module is used to output a verification result based on the layout feature similarity and a preset threshold.
[0149] Based on the spirit of the present invention, those skilled in the art can easily think that a computer program product can be obtained based on the aforementioned text zero watermark generation and verification method based on document layout similarity. The computer program product may include a computer-readable storage medium, which carries computer-readable program instructions for enabling a processor to implement various aspects of the present disclosure. That is, the present application also includes a terminal, including a processor and a storage medium; the storage medium is used to store instructions; the processor is used to operate according to the instructions to execute the steps of the aforementioned text zero watermark generation and verification method based on document layout similarity.
[0150] Computer readable storage medium can be a tangible device that can keep and store the instructions used by the instruction execution device. Computer readable storage medium can be, for example, - but not limited to - electrical storage device, magnetic storage device, optical storage device, electromagnetic storage device, semiconductor storage device or any suitable combination of the above. More specific examples (non-exhaustive list) of computer readable storage medium include: portable computer disk, hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static random access memory (SRAM), portable compact disk read-only memory (CD-ROM), digital versatile disk (DVD), memory stick, floppy disk, mechanical encoding device, for example, punch card or groove protrusion structure with instructions stored thereon and any suitable combination of the above. Computer readable storage medium used here is not interpreted as instantaneous signal itself, such as radio wave or other free propagating electromagnetic wave, electromagnetic wave propagated by waveguide or other transmission medium (for example, light pulse by optical fiber cable) or electrical signal transmitted by wire.
[0151] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.
[0152] The computer program instructions for performing the operation of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages-such as Smalltalk, C++, etc., and conventional procedural programming languages-such as "C" language or similar programming languages. Computer-readable program instructions may be executed completely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or completely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network-including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA) may be personalized by utilizing the state information of a computer-readable program instruction, and the electronic circuit may execute a computer-readable program instruction, thereby realizing various aspects of the present disclosure.
[0153] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the relevant field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents, and any modifications or equivalent replacements that do not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.
Claims
1. A text zero watermark generation method based on document layout similarity, characterized in that: The following steps are involved: Step 1: Divide the digital document into multiple independent sentences, and construct a sentence length feature sequence set of the digital document according to the number of characters of each sentence; Step 2: Mapping the sentence length feature sequence into an ASCII code value of a fixed length, and composing the ASCII code value into a layout feature sequence of the data document; Step 3: Encode the watermark information containing the author's identity identifier to obtain a watermark code sequence, perform binary conversion and equal length processing on the watermark code sequence and the layout feature sequence of the data document in sequence, and generate a document layout feature sequence combined with the watermark information; Step 4: Input the document layout feature sequence combined with the watermark information into the local sensitive hash generator, and use the SimHash algorithm to weight, merge and reduce the dimension of the document layout feature sequence combined with the watermark information to form a layout feature zero watermark; Step 5: Store the generated zero watermark in a trusted third-party database.
2. The text zero watermark generation method based on document layout similarity according to claim 1 is characterized in that: The step 1 further comprises: Step 1.1: Get a digital document X, and divide the document X into multiple independent complete sentences by identifying punctuation marks, forming a sentence set T = {t1, t2, ...t n }, where t i represents the i-th sentence in document X, and the total number of sentences contained in document X is calculated to be n; Step 1.2: For each statement t in the set T i , calculate the total number of characters, and get each sentence t i The corresponding sentence length l i ; Step 1.3: Place all l i Arrange them in the order in the document and construct the sentence length feature sequence set L = {l1,l2,…l n }.
3. The text zero watermark generation method based on document layout similarity according to claim 2 is characterized in that: The step 2 further comprises: Step 2.1: Set the length of each sentence in the digital document X to l i Mapped to a specific ASCII code value through the mapping function map, the mapping function map is defined as follows: r i =map(l i )=ascii(l i mod 255) Where ascii() represents the mapping of binary numbers to corresponding ASCII symbols; Step 2.2: According to the mapping function, each element in the length feature sequence set L is mapped to the corresponding ASCII code value, and the mapping set R = {r1, r2, ... r n }; Step 2.3: Concatenate the elements of the mapping set R in order to obtain the layout feature sequence N = r1 + r2 + ... + r of document X n .
4. The text zero watermark generation method based on document layout similarity according to claim 3 is characterized in that: The step 3 further comprises: Step 3.1: Encode the watermark information m according to UTF-8 encoding to obtain a watermark encoding sequence M; the watermark information includes an identifier indicating the author's identity and a timestamp; Step 3.2: Convert the document layout feature sequence N into a binary sequence N′; convert the watermark information encoding sequence M into a binary sequence M′; Step 3.3: Calculate the bit length l of the watermark coded binary sequence M′ respectively a and the bit length l of the layout feature sequence N′ of the digital document X b ; Step 3.4: Compare the bit lengths l of the two sequences a and l b ; If the two sequences are of different lengths, pad the shorter sequence to make the two sequences equal in length; Step 3.5: Perform a bit-by-bit XOR operation on the two equal-length sequences after the padding process to generate a document layout feature sequence combined with the watermark information of the digital document.
5. The text zero watermark generation method based on document layout similarity according to claim 4 is characterized in that: The step 3.4 further comprises: Step 3.4.1: If l a > b , then copy the layout feature sequence N′[l a / l b ] parts, and the length is l b *[l a / l b ] bits of new sequence, and then add (l a -l b *[l a / l b ]) bit 0, the concatenation length is l a The new sequence M c ; Step 3.4.2: If l a <l b , then the watermark information sequence M′ is copied [l b / l a ] parts, and the sequence length is l a *[l b / l a ] bits of new sequence, and then add (l b -l a *[l b / l a ]) bit 0, the concatenation length is l b The new sequence N c .
6. The method for generating text zero watermark based on document layout similarity according to claim 5, characterized in that: The step 3.5 further comprises: Step 3.5.1: If l a > b , then the generated document layout feature sequence P is: Step 3.5.2: If l a <l b , then the generated document layout feature sequence P is:
7. The method for generating text zero watermark based on document layout similarity according to claim 6, characterized in that: The step 4 further comprises: Step 4.1: Divide the document layout feature sequence P combined with watermark information into multiple feature strings F of equal length i ,i=1,2,…,n, the length of each feature string is c bits; Step 4.2: For each feature string F i Assign weight k i ; According to whether the bit value in the feature string is "1" or "0", it is converted to k i or -k i ; Let F i [j] is F i The jth bit in the ij for: Step 4.3: Accumulate the weighted values W of all feature strings at each position j ij , forming an overall sequence string V; the specific calculation method is as follows: Where V[j] represents the weighted sum of all feature strings at the jth position; Step 4.4: Perform dimensionality reduction on the merged sequence V. If V[j] is greater than 0, S[j] is recorded as 1; if V[j] is less than or equal to 0, S[j] is recorded as 0. S[j] represents the dimensionality reduction result of the jth bit of V:
8. A text zero watermark verification method based on document layout similarity using the text zero watermark generation method based on document layout similarity according to any one of claims 1 to 7, comprising: Step 6: Generate a layout feature zero watermark for the document to be verified using the document layout similarity text zero watermark generation method; Step 7: Calculate the Hamming distance between the zero watermark of the layout feature of the document to be verified and the zero watermark of the original document stored in the trusted database to evaluate the similarity of the layout features between the document to be verified and the original document recorded in the trusted database; Step 8: Based on the layout feature similarity, output the verification result according to a preset threshold.
9. A text zero watermark generation system based on document layout similarity using the text zero watermark generation method based on document layout similarity according to any one of claims 1 to 7, comprising: A division module, used to divide the digital document into a plurality of independent sentences, and construct a sentence length feature sequence set of the digital document according to the number of characters of each sentence; A mapping module, used for mapping the sentence length feature sequence into an ASCII code value of a fixed length, and composing the ASCII code value into a layout feature sequence of the data document; A combination module is used to encode the watermark information containing the author's identity identifier to obtain a watermark code sequence, perform binary conversion and equal length processing on the watermark code sequence and the layout feature sequence of the data document in sequence, and generate a document layout feature sequence combined with the watermark information; A zero watermark generation module is used to input the document layout feature sequence combined with watermark information into a local sensitive hash generator, and use the SimHash algorithm to weight, merge and reduce the dimension of the document layout feature sequence combined with watermark information to form a layout feature zero watermark; The storage module is used to store the generated zero watermark in a trusted third-party database.
10. A text zero watermark verification system based on document layout similarity using the text zero watermark verification method based on document layout similarity according to claim 8, comprising: A generation module, used for generating a layout feature zero watermark for a document to be verified by using the text zero watermark generation method based on document layout similarity; An evaluation module, used for calculating the Hamming distance between the zero watermark of the layout feature of the document to be verified and the zero watermark of the original document stored in the trusted database, so as to evaluate the similarity of the layout features between the document to be verified and the original document recorded in the trusted database; The verification module is used to output a verification result based on the layout feature similarity and a preset threshold.
11. A terminal comprising a processor and a storage medium; characterized in that: The storage medium is used to store instructions; The processor is configured to operate according to the instructions to execute the steps of the method according to any one of claims 1-8.
12. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method described in any one of claims 1 to 8 are implemented.
Citation Information
Cited By
Zero watermark generation and detection method, device, equipment, medium and product
CN120823085A
Large model generation content traceability technology based on model copyright ID watermark embedding
CN121302334A
A method for content tracing based on large model generation with embedded copyright ID watermarks.
CN121302334B
