Data processing method and device, equipment, medium and product

By employing a semantic association composite key and a combination of Haar wavelet transform and discrete Fourier transform in text watermarking technology, a text-specific fingerprint key is generated. This solves the problems of precision loss and key vulnerability in discrete character encoding of text watermarking, and achieves high security and integrity of text data.

CN121543070APending Publication Date: 2026-02-17中移信息技术有限公司 +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511857383.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-10
Publication Date
2026-02-17

AI Technical Summary

Technical Problem

Existing text watermarking technologies are prone to precision loss when processing discrete character encoding, leading to distortion or loss of watermark information. Furthermore, traditional keys are unrelated to the text and are easily cracked in batches.

Method used

By acquiring the text to be processed, the initial watermark data is determined based on the user identifier and timestamp, the first error correction code is generated, and the error correction code is permuted and encrypted based on the semantic association composite key of the target keywords and embedded in the text. The watermark is embedded by combining Haar wavelet transform and discrete Fourier transform to generate a text-specific fingerprint key.

Benefits of technology

It enhances the security and integrity of text data, avoids the risk of mass cracking caused by key leakage, and ensures the stability and anti-interference capability of watermark information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121543070A_ABST
    Figure CN121543070A_ABST
Patent Text Reader

Abstract

The invention discloses a data processing method and device, equipment, a medium and a product. The invention relates to the technical field of computers. The method comprises the steps of obtaining a to-be-processed text; determining initial watermark data according to the user identifier and the timestamp; generating a first error correction code according to the initial watermark data, a cyclic redundancy check code and the length of the to-be-processed text; screening the to-be-processed text to obtain a target keyword; on the basis of a semantic association composite key corresponding to the target keyword, performing replacement encryption on a first error correction code to obtain a target error correction code; and embedding the target error correction code into the to-be-processed text to obtain a watermark-embedded text, through the technical scheme of the invention, the security and integrity of text data can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of computer technology, and in particular to a data processing method, apparatus, device, medium and product. Background Technology

[0002] With the rapid development of internet information dissemination, the security and integrity of text data have received increasing attention.

[0003] Digital watermarking technology, as an effective means of information hiding, is widely used in copyright protection, content authentication, and anti-counterfeiting traceability of text content. Currently, most text watermarking technologies employ steganography methods based on Discrete Cosine Transform (DCT) to embed watermark information into the frequency domain features of the text.

[0004] However, since text data is essentially discrete character encoding and does not possess the characteristics of a continuous signal, DCT is prone to precision loss when processing such discrete data. In particular, after inverse DCT, integer sequence reconstruction errors may occur, leading to distortion or loss of watermark information. Summary of the Invention

[0005] This invention provides a data processing method, apparatus, device, medium, and product to improve the security and integrity of text data.

[0006] According to one aspect of the present invention, a data processing method is provided, comprising:

[0007] Get the text to be processed;

[0008] The initial watermark data is determined based on the user identifier and timestamp;

[0009] Based on the initial watermark data, the cyclic redundancy check code, and the length of the text to be processed, a first error correction code is generated;

[0010] The text to be processed is filtered to obtain target keywords;

[0011] Based on the semantic association composite key corresponding to the target keyword, the first error correction code is permuted and encrypted to obtain the target error correction code;

[0012] The target error correction code is embedded into the text to be processed to obtain the text with the watermark embedded.

[0013] According to another aspect of the present invention, a data processing apparatus is provided, the data processing apparatus comprising:

[0014] The text to be processed acquisition module is used to acquire the text to be processed;

[0015] The initial watermark data determination module is used to determine the initial watermark data based on the user identifier and timestamp.

[0016] The first error correction code generation module is used to generate a first error correction code based on the initial watermark data, the cyclic redundancy check code, and the length of the text to be processed.

[0017] The target keyword determination module is used to filter the text to be processed to obtain target keywords;

[0018] The target error correction code determination module is used to perform permutation encryption on the first error correction code based on the semantic association composite key corresponding to the target keyword to obtain the target error correction code;

[0019] The watermark-embedded text generation module is used to embed the target error correction code into the text to be processed to obtain watermark-embedded text.

[0020] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:

[0021] At least one processor; and

[0022] A memory communicatively connected to the at least one processor; wherein,

[0023] The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the data processing method according to any embodiment of the present invention.

[0024] According to another aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions for causing a processor to execute and implement the data processing method described in any embodiment of the present invention.

[0025] According to another aspect of the present invention, a computer program product is provided, which, when executed by a processor, implements the data processing method as described in any of the embodiments of the present invention.

[0026] This invention involves: acquiring the text to be processed; determining initial watermark data based on user identifier and timestamp; generating a first error correction code based on the initial watermark data, cyclic redundancy check (CRC) code, and the length of the text to be processed; filtering the text to be processed to obtain target keywords; encrypting the first error correction code using a semantically associated composite key corresponding to the target keywords to obtain a target error correction code; and embedding the target error correction code into the text to be processed to obtain watermarked text. Through semantically associated composite key technology, the key is upgraded from a general random string to a text-specific fingerprint, with the key strongly bound to the text theme, ensuring that keys for different texts are completely independent. This increases the difficulty of brute-force attacks; even if the random key is leaked, attackers need to simultaneously obtain the text theme keywords to crack the code, completely avoiding the risk of a single key leak compromising all texts, thereby improving the security and integrity of text data.

[0027] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description

[0028] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0029] Figure 1 This is a flowchart of a data processing method according to an embodiment of the present invention;

[0030] Figure 2 This is a schematic diagram of the structure of a data processing device according to an embodiment of the present invention;

[0031] Figure 3 This is a schematic diagram of the structure of an electronic device according to an embodiment of the present invention. Detailed Implementation

[0032] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0033] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0034] It is understood that before using the technical solutions disclosed in the various embodiments of this disclosure, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in this disclosure in an appropriate manner in accordance with relevant laws and regulations, and user authorization should be obtained.

[0035] Example 1

[0036] Figure 1 This is a flowchart illustrating a data processing method provided in an embodiment of the present invention. This embodiment is applicable to adding watermarks to text. The method can be executed by the data processing device in this embodiment of the invention, which can be implemented in software and / or hardware, such as... Figure 1 As shown, the method specifically includes the following steps:

[0037] S110, Obtain the text to be processed.

[0038] In this embodiment, the text to be processed is the text to which a watermark is to be added, that is, the text for which data security needs to be guaranteed.

[0039] S120, determine the initial watermark data based on the user identifier and timestamp.

[0040] In this embodiment, the method for determining the initial watermark data based on the user identifier and timestamp can be as follows: generate the initial watermark data based on the user identifier, timestamp, and copyright owner identifier. Alternatively, the method for determining the initial watermark data based on the user identifier and timestamp can be as follows: concatenate the user identifier and timestamp to obtain the initial watermark data.

[0041] In a specific example, the user ID (16 bits) and timestamp (32 bits) are concatenated to form the initial 48-bit watermark data W_base.

[0042] It should be noted that the user identifier can be a user ID, with a fixed length (e.g., 16 bits, supporting 65,536 users), and uses hexadecimal encoding (e.g., UID_00A1). The timestamp uses a Unix timestamp (32 bits, accurate to the second, covering up to 2106).

[0043] S130, generate a first error correction code based on the initial watermark data, the cyclic redundancy check code, and the length of the text to be processed.

[0044] In this embodiment, the Cyclic Redundancy Check (CRC) code is the CRC code corresponding to the text to be processed. The CRC code can be obtained as follows: convert each byte in the text to be processed into a binary string to obtain binary data. Use this binary data as the original data (length n). Pre-set the check code length to r. Pad the end of the original data with zeros to obtain new binary data (length n+r). Perform modulo-2 division between the new binary data and the target polynomial to obtain an r-bit remainder. Use this r-bit remainder as the CRC code corresponding to the text to be processed. It should be noted that converting each byte in the text to be processed into a binary string to obtain binary data can be done as follows: Encoding standardization: uniformly convert the text to be processed into UTF-8 encoding (strong compatibility) to ensure a unique mapping from characters to bytes. Binary conversion: convert the byte corresponding to each UTF-8 character (1-4 bytes / character) into an 8-bit binary string (padding with leading zeros if less than 8 bits). Concatenate all the binary strings to form continuous binary data.

[0045] In a specific example, the UTF-8 encoding of the text "HELLO" is 48454C4C4F (hexadecimal), which is converted to binary data as 0100100001000101010011000100110001001111.

[0046] In this embodiment, the method for generating the first error correction code based on the initial watermark data, the cyclic redundancy check (CRC) code, and the length of the text to be processed can be as follows: First watermark data is generated based on the initial watermark data and the CRC code; the interleaving block size is determined based on the length of the text to be processed; and the first error correction code is generated based on the first watermark data and the interleaving block size. Alternatively, the method for generating the first error correction code based on the initial watermark data, the CRC code, and the length of the text to be processed can be as follows: First watermark data is generated based on the initial watermark data and the CRC code; the first watermark data is encoded to obtain an initial error correction code; the interleaving block size is determined based on the length of the text to be processed; the initial error correction code is interleaved based on the interleaving block size to obtain an interleaved initial error correction code; and the interleaved initial error correction code is extended based on a quasi-cyclic low-density parity-check (CRC) code to obtain the first error correction code.

[0047] Optionally, based on the initial watermark data, the cyclic redundancy check code, and the length of the text to be processed, a first error correction code is generated, including:

[0048] The first watermark data is generated based on the initial watermark data and the cyclic redundancy check code.

[0049] In this embodiment, the method for generating the first watermark data based on the initial watermark data and the cyclic redundancy check code can be: adding an 8-bit CRC check code (based on the CRC-8 algorithm, polynomial 0x07) to generate 56-bit first watermark data W_raw.

[0050] The first watermark data is encoded to obtain the initial error correction code.

[0051] In this embodiment, the first watermark data is encoded and extended to meet the requirements of error correction coding. Reed-Solomon coding is chosen for this purpose. Reed-Solomon coding has burst error correction capabilities, efficiently utilizes redundancy, and is mature and stable. This coding is suitable for symbol-level error correction and can correct burst errors, thus it is applicable to text character-level errors.

[0052] In this embodiment, the first watermark data is encoded using RS(255,223) error correction code, expanding it into a 255-byte RS code. The advantage of RS code is its ability to correct sudden errors (it can repair 16-byte consecutive errors), laying the foundation for the watermark's resistance to batch tampering / deletion. For example, if 10% of the text is continuously deleted, the RS code can quickly locate and correct the error.

[0053] The size of the interleaving block is determined based on the length of the text to be processed.

[0054] In this embodiment, the interleaving block size: The interleaving block size is dynamically calculated according to the length L of the text to be processed. Block_size = floor(sqrt(L)). If L is greater than 8, the interleaving block size is 4. If L is less than or equal to 8, the interleaving block size is 2.

[0055] Based on the interleaving block size, perform interleaving processing on the initial error correction code to obtain the interleaved initial error correction code.

[0056] In this embodiment, the initial error correction code is divided into multiple blocks according to the interleaving block size, and the positions of the bits within each block are permuted. For example, the bits [b0, b1, b2, b3] within the block are permuted to obtain [b2, b0, b3, b1].

[0057] It should be noted that traditional interleaving uses a fixed block size and cannot adapt to the characteristic of "sentences with different lengths" in the text (such as a long sentence with 20 characters and a short sentence with 8 characters). In this embodiment, an adaptive interleaving block size is adopted to address this characteristic defect.

[0058] In this embodiment, continuous burst errors are scattered into discrete small errors, making it easier for subsequent error correction codes to handle; at the same time, it adapts to sentences of different lengths and is more flexible than fixed interleaving.

[0059] Based on the quasi-cyclic low-density parity-check code, expand the interleaved initial error correction code to obtain the first error correction code.

[0060] In this embodiment, after encoding with a quasi-cyclic low-density parity-check code (Quasi-Cyclic Low-Density Parity-Check, QC-LDPC) with a code rate of 1 / 2, the length of the information bits is equal to the length of the parity-check bits (code rate R = k / m = 1 / 2, where k is the length of the information bits and m is the total code length after encoding), which has both excellent error correction performance and the characteristic of being easy to implement in hardware.

[0061] In this embodiment, the first error correction code is 510 bits.

[0062] In this embodiment, use a QC-LDPC code (quasi-cyclic low-density parity-check code) with a code rate of 1 / 2 to encode the interleaved bit stream and expand it to 510 bits. The parity-check matrix is designed based on the text character frequency. For example, the elements of the parity-check matrix corresponding to high-frequency characters such as "的" and "是" are more "robust", enabling the LDPC code to adapt to the character distribution characteristics of the text and further improving the error correction recovery rate in scenarios such as "text editing, format conversion", etc.

[0063] S140, screen the text to be processed to obtain the target keyword.

[0064] In this embodiment, the method for filtering the text to be processed to obtain target keywords can be as follows: target keywords are filtered from the text using the Term Frequency-Inverse Document Frequency (TF-IDF) algorithm. Target keywords are semantic anchors of the text and can accurately represent the core content of the text.

[0065] In this embodiment, the method for filtering the text to be processed to obtain target keywords can be as follows: obtain the TF-IDF values ​​of all words in the text to be processed, and select the top-N words with the highest ranking (such as top 10 or top 20) as the target keywords of the text to be processed.

[0066] In this embodiment, TF (Term Frequency) represents the frequency of a word in a single document; the more times a word appears, the higher the TF value. IDF (Inverse Document Frequency) represents the scarcity of a word in the entire document set; the higher the IDF value, the more few documents a word appears in. The calculation logic of TF-IDF value is: TF-IDF value = TF value × IDF value, taking into account both the concentration of a word in a single document and its uniqueness in the overall set.

[0067] It should be noted that, for the text to be processed, the TF-IDF values ​​of all its words are sorted from high to low; the top-N words with the highest ranking (such as top 10 or top 20) are selected as the target keywords of the text to be processed, and these target keywords and their TF-IDF weights are output as features representing the core semantics of the document.

[0068] In a specific example, [('Artificial Intelligence', 0.095), ('Text Watermark', 0.082), ('Large Language Model', 0.078), ('Algorithm', 0.065), ('Embedding', 0.058)]. The topic keywords (such as "artificial intelligence" and "text watermark") extracted by TF-IDF and the character frequency distribution are two parallel feature vectors. Together, they constitute the "semantic fingerprint" of the text, providing a basis for subsequent watermark encoding and embedding. For example, the watermark signal can be modulated and hidden based on the presence, weight, or frequency distribution of these keywords.

[0069] S150, based on the semantic association composite key corresponding to the target keyword, the first error correction code is permuted and encrypted to obtain the target error correction code.

[0070] In this embodiment, the first error correction code is permuted and encrypted based on the semantic association composite key corresponding to the target keyword to obtain the target error correction code. The method is as follows: generate the semantic association composite key corresponding to the target keyword according to the random key and the hash key corresponding to the target keyword, and permutate and encrypt the first error correction code based on the semantic association composite key corresponding to the target keyword to obtain the target error correction code.

[0071] Optionally, based on the semantic association composite key corresponding to the target keyword, the first error-correcting code is permuted and encrypted to obtain the target error-correcting code, including:

[0072] Perform a cryptographic hash operation on the target keyword to obtain the hash key.

[0073] In this embodiment, the method of performing a cryptographic hash operation on the target keyword to obtain the hash key can be as follows: perform a Secure Hash Algorithm 256-bit (SHA-256) on the target keyword to obtain the hash key.

[0074] In this embodiment, a SHA-256 cryptographic hash operation is performed on the target keyword to convert the variable-length target keyword (e.g., "artificial intelligence" is 4 characters) into a fixed 256-bit hash key.

[0075] The "irreversibility" (it is impossible to reverse-engineer the keyword from the hash key) and "uniqueness" (hash keys for different keywords have almost no collisions) of SHA-256 transform the target keyword into an "immutable digital fingerprint".

[0076] Generate a random key using a cryptographically secure random number generator.

[0077] In this embodiment, a 256-bit random key Rand_key is generated using a Cryptographically Secure Pseudo-Random Number Generator (CSPRNG).

[0078] The random key increases the "uncertainty" of the key, avoiding reliance solely on the predictability of the keyword hash (even if an attacker knows that "artificial intelligence" is a keyword, they cannot calculate the hash key in advance).

[0079] The semantically associated composite key is obtained by performing an XOR operation between the hash key and the random key.

[0080] In this embodiment, the Hash_key and Rand_key are subjected to an exclusive OR (XOR) operation to obtain the semantically associated composite key Composite_key.

[0081] The functions of XOR are: reversibility (only by simultaneously knowing both the hash key and the Rand key can the other be deduced); lightweight (fast operation speed, does not affect real-time performance); and correlation (the composite key simultaneously carries the "text topic" (hash key) and the "random uncertainty" (Rand key).

[0082] The first error-correcting code is permuted and encrypted using a semantically associated composite key to obtain the target error-correcting code.

[0083] In this embodiment, the core objective of semantic association composite key generation is to construct an encryption key strongly bound to the text topic, addressing the pain points of traditional fixed random keys being unrelated to the text and easily cracked in batches. This embodiment mainly uses a three-layer design of target keyword extraction, hash solidification, and random fusion to deeply associate the key with the text content.

[0084] In this embodiment, the key is strongly associated with the target keyword, binding the watermark to the target keyword. Texts with different target keywords are encrypted in different ways. Even if the random key is leaked, the watermark cannot be decrypted without the target keyword in the text, greatly improving text security.

[0085] This embodiment employs a key-text-topic strongly correlated data encryption method to ensure the uniqueness of the watermark. This means different texts have different target keywords, different hash keys, and different composite keys (even if the rand key is the same, the keys for different texts will be completely different). This method also ensures high security: if the rand key is leaked, an attacker needs to obtain both the "target keyword" and the hash key to generate the composite key (all are indispensable). Furthermore, with traditional fixed keys, once leaked, the watermarks of all texts can be cracked; however, in this embodiment, each text has an independent key (dependent on its own topic), completely avoiding the risk of mass leaks. This key-text-topic strongly correlated data encryption scheme transforms the key from a general random string into a text-specific fingerprint, significantly improving the security and resistance to attacks of the watermark encryption.

[0086] S160, embed the target error correction code into the text to be processed to obtain the text with embedded watermark.

[0087] In this embodiment, the method of embedding the target error correction code into the text to be processed to obtain the watermarked text can be as follows: divide the text to be processed into multiple text blocks; perform one-dimensional Haar discrete wavelet transform decomposition on each text block to obtain the initial approximation coefficients and initial detail coefficients of each text block; determine the watermarked text based on the initial approximation coefficients, the initial detail coefficients of each text block and the target error correction code.

[0088] In a specific example, the input is: the text to be processed, T, and the target error correction code, W; the output is: the watermarked text, Tw (which is readable and has no significant difference from the original text).

[0089] Optionally, the target error correction code is embedded into the text to be processed to obtain the watermarked text, including:

[0090] Divide the text to be processed into multiple text blocks.

[0091] In this embodiment, the block size is obtained, and the text to be processed is divided into multiple text blocks based on the block size. The block size is dynamically adjusted based on the local complexity of the text to be processed. It should be noted that the local complexity can be obtained by calculating the character entropy value or information density within a sliding window. Smaller blocks are used for high-entropy regions (information-dense) to improve the watermark content and concealment, while larger blocks are used for low-entropy regions (repetition / blankness), or these regions are selectively skipped to reduce computational load.

[0092] Perform one-dimensional Haar discrete wavelet transform decomposition on each text block to obtain the initial approximation coefficients and initial detail coefficients of each text block.

[0093] In this embodiment, low-frequency core features are extracted based on one-dimensional Haar Discrete Wavelet Transform (Haar DWT). These low-frequency core features include initial approximation coefficients and initial detail coefficients. In a specific example, a level 1 one-dimensional Haar DWT decomposition is performed on each text block Xi, yielding: initial approximation coefficients Ai: length L / 2, preserving the core features of the text block (such as the overall coding distribution of the sentence). Initial detail coefficients Di: length L / 2, corresponding to the local details of the text (such as differences between individual characters). Only the approximation coefficients Ai are modified, while the detail coefficients Di remain unchanged, avoiding damage to the local readability of the text.

[0094] The text after watermarking is determined based on the initial approximation coefficients of each text block, the initial detail coefficients of each text block, and the target error correction code.

[0095] In this embodiment, the method for determining the watermarked text based on the initial approximation coefficients, initial detail coefficients, and target error correction code of each text block can be as follows: Perform a one-dimensional discrete Fourier transform on the initial approximation coefficients of each text block to obtain the frequency domain coefficients of each text block; embed the target error correction code into the frequency domain coefficients of each text block to obtain the watermarked frequency domain coefficients of each text block; perform an inverse discrete Fourier transform on the watermarked frequency domain coefficients of each text block to obtain the first approximation coefficients of each text block; merge the first approximation coefficients of each text block with the initial detail coefficients of each text block, and perform an inverse discrete wavelet transform to obtain the watermarked text block; map the watermarked text block to characters and concatenate them to obtain the watermarked text.

[0096] Optionally, the watermarked text is determined based on the initial approximation coefficients of each text block, the initial detail coefficients of each text block, and the target error correction code, including:

[0097] The frequency domain coefficients of each text block are obtained by performing a one-dimensional discrete Fourier transform on the initial approximation coefficients of each text block.

[0098] In this embodiment, a one-dimensional DFT is performed on each approximation coefficient block Ai to obtain the frequency domain coefficients Fi = DFT(Ai).

[0099] The target error correction code is embedded into the frequency domain coefficients of each text block to obtain the frequency domain coefficients of each text block after watermarking.

[0100] In this embodiment, the frequency domain position selection is as follows: avoid DC component (DC, the first coefficient): the DC component corresponds to the average value of the signal, and modification will seriously affect the readability of the text; avoid high frequency component (the last 10% coefficient): high frequency component is easily interfered with by noise and has poor robustness; select mid frequency component (the middle 60% coefficient): it has both robustness and imperceptibility.

[0101] In this embodiment, frequency domain amplitude modulation (balancing detectability and imperceptibility) is employed. For the frequency domain coefficients Fi of each text block, the intermediate frequency component of the frequency domain coefficients Fi is selected, and the modification rule is as follows: ,in, For target error correction codes, The embedding strength is set to (empirical value 0.01 ≤ α ≤ 0.05, which needs to be adjusted according to the text type). Let Fi be the k-th intermediate frequency component of the frequency domain coefficients. The frequency domain coefficients after embedding the target error correction code into the kth intermediate frequency component of the frequency domain coefficients Fi of text block i are the frequency domain coefficients after embedding the watermark.

[0102] It should be noted that, to avoid watermark embedding compromising text readability, the embedding strength is dynamically adjusted using the Just Noticeable Difference (JND) principle. The solution provided in this embodiment uses residual compensation inverse transform technology to strictly constrain the ASCII codes of the inverse-transformed characters to within the printable range: the residual compensation mechanism limits coefficient changes to within the "Just Noticeable Difference," maintaining a text readability retention rate of ≥99% (percentage of printable characters), completely resolving the garbled character problem caused by traditional inverse transforms. The appearance and semantics of the embedded text are almost identical to the original text.

[0103] Perform an inverse discrete Fourier transform on the frequency domain coefficients of each text block after embedding the watermark to obtain the first approximate coefficients of each text block.

[0104] In this embodiment, the Inverse Discrete Fourier Transform (IDFT) is the inverse operation of the Discrete Fourier Transform, and its core function is to restore the frequency domain discrete signal to the time domain discrete signal.

[0105] In this embodiment, the frequency domain coefficients of text block i after embedding the watermark are... Performing IDFT yields the modified approximation coefficients, which are the first approximation coefficients of text block i. .

[0106] The first approximation coefficients of each text block are combined with the initial detail coefficients of each text block, and an inverse discrete wavelet transform is performed to obtain the text block with watermark added.

[0107] In this embodiment, the Inverse Discrete Wavelet Transform (IDWT) is used as the inverse operation of the Discrete Wavelet Transform to restore the decomposition coefficients (approximation coefficients + detail coefficients) in the wavelet domain to the original time-domain or spatial-domain signal.

[0108] In this embodiment, the first approximation coefficient of text block i is... Initial detail coefficients of text block i Merge, execute IDWT, and obtain the watermarked text block i: .

[0109] The watermarked text block is mapped to characters and then concatenated to obtain the watermarked text.

[0110] In this embodiment, the watermarked text block i is reverse mapped to a character (Unicode encoding to character), and all watermarked text blocks are concatenated to obtain the watermarked text Tw, thus completing the entire text watermark embedding process.

[0111] This embodiment proposes a multi-resolution analysis of text data based on Haar wavelet transform (DWT) to extract local features, and introduces discrete Fourier transform (DFT) into the low-frequency subband after DWT decomposition to enhance the robustness of the watermark to global modifications. The error correction coding utilizes Reed-Solomon's superior burst error correction capability, thus constructing a complete text watermark management technology solution that combines local and global characteristics.

[0112] Optionally, the target error correction code is embedded into the frequency domain coefficients of each text block to obtain the frequency domain coefficients of each text block after watermarking, including:

[0113] Obtain the mid-frequency components of the frequency domain coefficients of each text block.

[0114] In this embodiment, the mid-frequency component of the frequency domain coefficients of each text block is the middle 60% of the frequency domain coefficients of each text block. This part of the frequency domain features corresponds to the overall semantic attributes of the text (such as the character distribution of topic keywords and the macroscopic rules of sentence structure), and has strong stability and anti-interference ability.

[0115] The target error correction code is embedded into the mid-frequency component of the frequency domain coefficients of each text block to obtain the frequency domain coefficients of each text block after watermarking.

[0116] In this embodiment, a four-layer design—RS code to resist burst errors, adaptive interleaving to break down errors, LDPC code to adapt to text, and semantic encryption to bind to the theme—generates a watermark with three major advantages: strong error correction: capable of handling high error rates (>5%) and burst deletions (over 10%) (far exceeding the capabilities of traditional single-bit error correction); text adaptation: the interleaving block size and LDPC parity matrix are tailored to the text characteristics, avoiding "destroying the text for error correction"; and high security: the watermark is strongly correlated with the text theme, the encryption method is dynamically adjusted, and the anti-cracking capability is enhanced. The encrypted watermark output by the technical solution provided in this embodiment not only retains core copyright information but also possesses anti-interference, anti-tampering, and anti-cracking characteristics, laying a solid foundation for subsequent text embedding.

[0117] In this embodiment, the error correction capability can be extended from a single bit to correct multiple bits and recover deletions or insertions without significantly increasing the redundancy rate.

[0118] To further optimize the efficiency of the watermark embedding algorithm, this embodiment adopts a GPU / FPGA acceleration scheme. Based on GPU parallel computing, computationally intensive tasks such as Haar wavelet transform (DWT), discrete Fourier transform (DFT), and watermark embedding are accelerated. By integrating an FPGA hardware acceleration module, high-speed pipelined processing is achieved, further shortening processing time. In addition to hardware acceleration, software-level optimizations are also implemented, including code-level optimizations of core algorithms such as watermark generation and DCT transform, such as vectorized instruction set support, loop unrolling, and cache optimization. An asynchronous processing mechanism is used to execute watermark embedding and text transmission in parallel, reducing overall waiting time.

[0119] To address the limitations of traditional fixed interleaving in adapting to text length and the lack of semantic integration in soft-decision decoding, this embodiment proposes a strong error correction scheme of "adaptive segmented interleaving + weighted soft-decision decoding": Adaptive segmented interleaving dynamically adjusts the interleaving block size according to the text sentence length L, dividing the RS codeword into N blocks and performing bit position permutations within each block, thus breaking down continuous burst errors into discrete small errors. Weighted soft-decision decoding applies a weighted log-likelihood ratio based on sentence position (increasing the weight of the last bit in the sentence to 1.5 times) to the LDPC codeword, combining text semantic features to optimize decoding accuracy. The burst error correction capability is improved from 5% in existing technologies to 15%, adapting to the structural characteristics of text sentences of varying lengths.

[0120] To address the issues of traditional keys being text-independent and easily cracked in bulk, this embodiment proposes a composite key scheme of "text topic + random factor": Topic fingerprint generation: SHA-256 hashing is performed on the TF-IDF keywords of the text to obtain an immutable topic fingerprint Hash_key; Composite key generation: Hash_key is XORed with a cryptographic random key Rand_key to generate a semantically associated composite key; Encryption permutation: LDPC codewords are permuted and encrypted using the composite key, with the permutation table adjusted by the semantic similarity of the keywords. The key is strongly correlated with the text topic, and different text keys are independent, increasing the difficulty of brute-force attacks and avoiding the risk of bulk leakage.

[0121] In existing technologies, text watermarking techniques mostly employ steganography based on Discrete Cosine Transform (DCT) to embed watermark information into the frequency domain features of the text. Since text data is essentially discrete character encoding and does not possess the characteristics of a continuous signal, DCT is prone to precision loss when processing such discrete data, especially after inverse DCT, where integer sequence reconstruction errors may occur, leading to watermark information distortion or loss. To address these issues, the technical solution provided in this embodiment completely solves the adaptability problems of traditional DWT+DCT through a semantic texture fusion HaarDWT+DFT combined transform: replacing DCT with DFT improves adaptability to discrete text data and avoids integer reconstruction errors of DCT; fusing text semantic texture (character frequency weighting) makes the frequency domain features more closely match the text theme, significantly enhancing stability and reducing the watermark distortion rate from 8% to below 1%, making it less prone to watermark loss even with slight text editing.

[0122] The technical solution of this embodiment involves: acquiring the text to be processed; determining initial watermark data based on user identifier and timestamp; generating a first error correction code based on the initial watermark data, cyclic redundancy check (CRC) code, and the length of the text to be processed; filtering the text to be processed to obtain target keywords; encrypting the first error correction code using a semantic association composite key corresponding to the target keywords to obtain a target error correction code; and embedding the target error correction code into the text to be processed to obtain watermarked text. Through semantic association composite key technology, the key is upgraded from a general random string to a text-specific fingerprint, with the key strongly bound to the text theme, and the keys for different texts being completely independent. This increases the difficulty of brute-force attacks; even if the random key is leaked, attackers need to simultaneously obtain the text theme keywords to crack the code, completely avoiding the risk of a single key leak compromising all texts.

[0123] Example 2

[0124] Figure 2 This is a schematic diagram of a data processing device provided in an embodiment of the present invention. This embodiment is applicable to data processing applications. The device can be implemented using software and / or hardware, and can be integrated into any device that provides data processing functionality, such as… Figure 2 As shown, the data processing device specifically includes: a text acquisition module 210, an initial watermark data determination module 220, a first error correction code generation module 230, a target keyword determination module 240, a target error correction code determination module 250, and a text generation module 260 with embedded watermark.

[0125] The text to be processed module is used to acquire the text to be processed.

[0126] The initial watermark data determination module is used to determine the initial watermark data based on the user identifier and timestamp.

[0127] The first error correction code generation module is used to generate a first error correction code based on the initial watermark data, the cyclic redundancy check code, and the length of the text to be processed.

[0128] The target keyword determination module is used to filter the text to be processed to obtain target keywords;

[0129] The target error correction code determination module is used to perform permutation encryption on the first error correction code based on the semantic association composite key corresponding to the target keyword to obtain the target error correction code;

[0130] The watermark-embedded text generation module is used to embed the target error correction code into the text to be processed to obtain watermark-embedded text.

[0131] The above-described products can perform the methods provided in any embodiment of the present invention, and have the corresponding functional modules and beneficial effects for performing the methods.

[0132] Example 3

[0133] Figure 3 A schematic diagram of an electronic device 10 that can be used to implement embodiments of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.

[0134] like Figure 3 As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 can also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0135] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0136] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as data processing methods.

[0137] In some embodiments, the data processing method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or mounted on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the data processing method described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to perform the data processing method by any other suitable means (e.g., by means of firmware).

[0138] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0139] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0140] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0141] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0142] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or middleware components (e.g., application servers), or frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.

[0143] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.

[0144] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.

[0145] This invention also provides a computer program product, including a computer program that, when executed by a processor, implements the data processing method according to any embodiment of the invention.

[0146] In implementing the computer program product, computer program code for performing the operations of this invention can be written in one or more programming languages ​​or a combination thereof. Programming languages ​​include object-oriented programming languages ​​such as Java, Smalltalk, and C++, as well as conventional procedural programming languages ​​such as C or similar languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can 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 it can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0147] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. A data processing method, characterized by, The method comprises the following steps: acquiring a text to be processed; determining initial watermark data according to a user identifier and a timestamp; generating a first error correction code according to the initial watermark data, a cyclic redundancy check code and a length of the text to be processed; screening the text to be processed to obtain a target keyword; performing substitution encryption on the first error correction code based on a semantic association composite key corresponding to the target keyword to obtain a target error correction code; embedding the target error correction code in the text to be processed to obtain a text after watermark embedding.

2. The method of claim 1, wherein, The method for generating a first error correction code according to initial watermark data, a cyclic redundancy check code and a length of the text to be processed comprises the following steps: generating first watermark data according to the initial watermark data and the cyclic redundancy check code; encoding the first watermark data to obtain an initial error correction code; determining an interleaving block size according to the length of the text to be processed; performing interleaving processing on the initial error correction code based on the interleaving block size to obtain interleaved initial error correction code; performing extension on the interleaved initial error correction code based on a quasi-cyclic low-density parity-check code to obtain the first error correction code.

3. The method of claim 1, wherein, The method for performing substitution encryption on the first error correction code based on a semantic association composite key corresponding to the target keyword to obtain a target error correction code comprises the following steps: performing an encryption hash operation on the target keyword to obtain a hash key; generating a random key through a cryptographically secure random number generator; performing an exclusive or operation on the hash key and the random key to obtain the semantic association composite key; performing substitution encryption on the first error correction code based on the semantic association composite key to obtain the target error correction code.

4. The method of claim 1, wherein, The method for embedding the target error correction code in the text to be processed to obtain a text after watermark embedding comprises the following steps: dividing the text to be processed into a plurality of text blocks; performing one-dimensional Haar discrete wavelet transform decomposition on each text block to obtain initial approximation coefficients and initial detail coefficients of each text block; determining a text after watermark embedding according to the initial approximation coefficients of each text block, the initial detail coefficients of each text block and the target error correction code.

5. The method of claim 4, wherein, The method for determining a text after watermark embedding according to the initial approximation coefficients of each text block, the initial detail coefficients of each text block and the target error correction code comprises the following steps: performing one-dimensional discrete Fourier transform on the initial approximation coefficients of each text block to obtain frequency domain coefficients of each text block; embedding the target error correction code in the frequency domain coefficients of each text block to obtain frequency domain coefficients of each text block after watermark embedding; performing inverse discrete Fourier transform on the frequency domain coefficients of each text block after watermark embedding to obtain first approximation coefficients of each text block; combining the first approximation coefficients of each text block with the initial detail coefficients of each text block and performing inverse discrete wavelet transform to obtain text blocks after watermark addition; mapping the text blocks after watermark addition into characters and splicing to obtain a text after watermark embedding.

6. The method of claim 5, wherein, The method for embedding the target error correction code in the frequency domain coefficients of each text block to obtain frequency domain coefficients of each text block after watermark embedding comprises the following steps: obtaining medium frequency components of the frequency domain coefficients of each text block; embedding the target error correction code in the medium frequency components of the frequency domain coefficients of each text block to obtain frequency domain coefficients of each text block after watermark embedding.

7. A data processing apparatus, characterized by, The method comprises the following steps: a text to be processed acquisition module is configured to acquire a text to be processed; The initial watermark data determination module is used to determine the initial watermark data based on the user identifier and timestamp. The first error correction code generation module is used to generate a first error correction code based on the initial watermark data, the cyclic redundancy check code, and the length of the text to be processed. The target keyword determination module is used to filter the text to be processed to obtain target keywords; The target error correction code determination module is used to perform permutation encryption on the first error correction code based on the semantic association composite key corresponding to the target keyword to obtain the target error correction code; The watermark-embedded text generation module is used to embed the target error correction code into the text to be processed to obtain watermark-embedded text.

8. An electronic device, comprising: The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the data processing method according to any one of claims 1-6.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that cause a processor to execute the data processing method according to any one of claims 1-6.

10. A computer program product, characterised in that, The computer program product includes a computer program that, when executed by a processor, implements the data processing method according to any one of claims 1-6.