Dynamic watermark embedding method and device based on text statistical features and optimization strategy

By embedding watermark information into the statistical attributes of text content, the problem of insufficient retention of source information in plain text watermarks is solved, the stability and parsability of watermarks in editing and complex processing scenarios are improved, and the applicability and controllability of the method are enhanced.

CN121637465BActive Publication Date: 2026-04-21CHENGDU SIWEI CENTURY TECH
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHENGDU SIWEI CENTURY TECH
Filing Date
2026-02-05
Publication Date
2026-04-21

AI Technical Summary

Technical Problem

Existing text watermarking technologies are insufficient in preserving source information when text content is copied or disseminated in plain text form after the formatting is removed. Furthermore, the stability and parsability of source information are insufficient after editing operations such as semantic rewriting, synonym replacement, or structural adjustment. In particular, effective identification of source information becomes difficult after processing by artificial intelligence models.

Method used

By employing a dynamic watermark embedding method based on text statistical features and optimization strategies, watermark information is embedded into the statistical attributes of the text itself. A stable second statistical unit is used as the watermark carrier medium. The watermark embedding capacity is adaptively adjusted based on the statistical attributes of the text content through optimization strategies. A mapping rule between the watermark bit sequence and the second statistical unit is constructed and locally modified to ensure the stability and parsability of the watermark information.

Benefits of technology

This method effectively preserves watermark information when the text is transmitted in plain text form, improves the robustness of the watermark in editing, reflow, and synonym replacement scenarios, enhances the applicability of the method and its stability and parsability in complex semantic processing scenarios, and reduces the impact on text quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121637465B_ABST
    Figure CN121637465B_ABST
Patent Text Reader

Abstract

This invention discloses a dynamic watermark embedding method and apparatus based on text statistical features and optimization strategies, relating to the field of digital watermarking technology. The method includes: S1 obtaining the text content to be embedded; S2 splitting the text content; S3 analyzing the split text content to obtain second statistical units; S4 encoding watermark information; S5 constructing mapping rules; S6 checking whether each second statistical unit meets the watermark embedding conditions, proceeding to S8 if it does, otherwise proceeding to S7; S7 modifying and optimizing the text content to be embedded; S8 obtaining the watermark-embedded text. By selecting a stable second statistical unit as the watermark carrier medium and embedding the watermark information into the statistical attributes of the text itself, the robustness of the watermark in editing, reflowing, and synonym replacement scenarios is improved. Furthermore, the watermark embedding capacity is adaptively adjusted according to the statistical attributes of the text content, reducing the impact of text modification on semantics, structure, and expression quality while meeting the watermark embedding requirements, thus enhancing the applicability of the method.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of digital watermarking technology, and in particular to a dynamic watermark embedding method and apparatus based on text statistical features and optimization strategies. Background Technology

[0002] Existing text watermarking and traceability technologies still have certain limitations in practical applications, especially in application scenarios with diverse forms of text dissemination, where their applicability and stability need to be further improved.

[0003] Format-based or spatial watermarks typically rely on a document's layout or physical structure, and their information capacity is relatively limited. When text is copied to plain text or undergoes format conversion, the relevant watermark information is often difficult to retain, thus limiting the ability to trace the source in scenarios involving the dissemination of unformatted text.

[0004] Text watermarking methods based on statistical features or transform domains can embed watermark information to a certain extent. However, after the text undergoes common editing operations such as rearrangement, semantic rewriting, or synonym replacement, the stability of the watermark may still be affected, thereby reducing the reliability of tracing the source in non-original propagation scenarios.

[0005] Deep learning-based text watermarking methods have certain advantages in handling complex content transformations, but they typically rely on large-scale training data and high computational resources, resulting in relatively high implementation costs. Furthermore, these methods often require close integration of the watermark embedding process with the text generation process, which may affect the quality or stability of the generated text in some application scenarios. Additionally, the internal decision-making process of their models is not easily interpreted, potentially introducing additional uncertainties.

[0006] Explicit tagging based on cryptography offers strong tamper-proof capabilities, but its tagging information typically exists independently of the text content itself. When the text content is extracted separately and disseminated in plain text form, the relevant external tags are difficult to retain along with the content, thus limiting its applicability in tracing scenarios where the content has been separated from its original carrier.

[0007] In summary, the existing technology still has room for improvement in the following typical application scenarios, and the related traceability needs have not yet been fully met:

[0008] Challenge 1: How to improve the retention of traceability information when text content is stripped of formatting and copied or distributed in plain text form?

[0009] Challenge 2: How to improve the stability and parsability of source information after text content has undergone editing operations such as semantic rewriting, synonym replacement, or structural adjustment?

[0010] Challenge 3: After text content has been processed by artificial intelligence models through paraphrasing, summarizing, or style transfer, how can we effectively identify source information under certain conditions? Summary of the Invention

[0011] The purpose of this invention is to design a dynamic watermark embedding method and apparatus based on text statistical features and optimization strategies to solve the above problems.

[0012] The present invention achieves the above objectives through the following technical solutions:

[0013] Dynamic watermarking embedding methods based on text statistical features and optimization strategies include:

[0014] S1. Obtain the text content to be embedded;

[0015] S2. Divide the text content to be embedded into multiple first statistical units;

[0016] S3. Perform statistical analysis on each first statistical unit to obtain the second statistical unit;

[0017] S4. Obtain the watermark information to be embedded and encode the watermark information into a watermark bit sequence;

[0018] S5. Construct the mapping rule between the watermark bit sequence and the second statistical unit;

[0019] S6. Determine whether the statistical attributes of each second statistical unit meet the watermark embedding conditions; if they all meet the conditions, then take the text content to be embedded as the optimal text content and proceed to S8; otherwise, proceed to S7.

[0020] S7. Modify and optimize the text content to be embedded to obtain the optimal text content, then proceed to S8; specifically including:

[0021] S71. Count the number s of second statistical units that do not meet the watermark embedding conditions, take all the positions of the single second statistical unit that does not meet the watermark embedding conditions as potential modification positions, and count the number N of candidate modification schemes for all potential modification positions, where s and N are both positive integers.

[0022] S72. Construct a population consisting of multiple candidate modification schemes for the j-th second statistical unit. Each individual in the population... All candidate modifications included at a potential modification location are represented as: Where P is the population size, and k is the k-th individual. This represents the activation result at the i-th position of the k-th individual. This represents the allocation result for the k-th individual. This represents the selection result of the k-th individual, i∈N. N represents the number of candidate modification schemes with potential modification locations;

[0023] S73. Initialize the population;

[0024] S74. Evolve the initial population and analyze it to obtain the optimal individual. The position in the optimal individual where the modification is performed is the optimal modification position.

[0025] S75. Based on the optimal individual, perform modification operations on the current text content to obtain the modified text content; remove the currently modified second statistical unit from the second statistical units that do not meet the watermark embedding conditions, and let s=s-1;

[0026] S76. Determine if the termination condition is met. If yes, use the modified text content as the optimal text content and proceed to S8; otherwise, let... And return S72, where t is the current iteration number;

[0027] S8. According to the mapping rules, embed the watermark bit sequence into the statistical attributes of the second statistical unit of the optimal text content to obtain the watermark-embedded text.

[0028] A dynamic watermark embedding device based on text statistical features and optimization strategies includes:

[0029] Storage: Storage is used to store computer programs;

[0030] Executor: The executor is used to execute the computer program stored in the storage, which, when executed, implements the dynamic watermark embedding method based on text statistical features and optimization strategies as described above.

[0031] The beneficial effects of this invention are as follows: This method embeds watermark information into the statistical attributes of the text itself, which can still be effectively preserved when the text is disseminated in plain text form; by selecting a stable second statistical unit as the watermark carrier medium, the robustness of the watermark in editing, reflowing, and synonym replacement scenarios is improved; and the watermark embedding capacity is adaptively adjusted according to the statistical attributes of the text content, which reduces the impact of text modification on semantics, structure, and expression quality while meeting the watermark embedding requirements, thereby enhancing the applicability of the method. Attached Figure Description

[0032] Figure 1 This is a flowchart of the dynamic watermark embedding method based on text statistical features and optimization strategies of the present invention;

[0033] Figure 2 This is a schematic diagram illustrating the modification and optimization of text using the dynamic watermark embedding method based on text statistical features and optimization strategies according to the present invention. Detailed Implementation

[0034] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.

[0035] Therefore, the following detailed description of the embodiments of the invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the invention without inventive effort are within the scope of protection of the invention.

[0036] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.

[0037] In the description of this invention, it should be understood that the terms "upper," "lower," "inner," "outer," "left," "right," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings, or the orientation or positional relationship commonly used when the product of this invention is in use, or the orientation or positional relationship commonly understood by those skilled in the art. They are only used to facilitate the description of this invention and to simplify the description, and are not intended to indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this invention.

[0038] Furthermore, the terms "first," "second," etc., are used only to distinguish descriptions and should not be interpreted as indicating or implying relative importance.

[0039] In the description of this invention, it should also be noted that, unless otherwise explicitly specified and limited, terms such as "set" and "connection" should be interpreted broadly. For example, "connection" can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium; it can be a connection within two components. Those skilled in the art can understand the specific meaning of the above terms in this invention according to the specific circumstances.

[0040] The specific embodiments of the present invention will now be described in detail with reference to the accompanying drawings.

[0041] like Figure 1 As shown, the dynamic watermark embedding method based on text statistical features and optimization strategies includes:

[0042] S1. Obtain the text content T to be embedded.

[0043] S2. Divide the text content to be embedded into multiple first statistical units u'. U is the set of the first statistical units, and M is the total number of the first statistical units.

[0044] S3. Perform statistical analysis on each of the first statistical units to obtain the second statistical units; specifically including:

[0045] S31. Use the stability screening function to perform preliminary screening on the first statistical unit, and obtain the set of the first statistical unit after preliminary screening. , represented as: ,in, The minimum frequency threshold, The frequency ranking ratio threshold, For the i-th first statistical unit, The frequency of occurrence for each first statistical unit, The first statistical unit

[0046] Ranked by frequency of occurrence from highest to lowest and These are the first statistical unit sets after preliminary screening. Minimum and maximum values ​​of quantity The set of the first statistical units, M is the total number of the first statistical unit;

[0047] S32. Analyze the first statistical unit after preliminary screening. Statistical stability score and semantically low sensitivity score , represented as: , ,in, The frequency of occurrence of each first statistical unit after initial screening. The first statistical unit after preliminary screening Ranked by frequency of occurrence from highest to lowest The preset minimum frequency threshold, , The weighting coefficients for frequency factors. The weighting coefficients for ranking factors. ; This is an entity-sensitive indicator function, used when the first statistical unit after initial screening... The value is 1 when it belongs to key entity information such as personal name, place name, organization name, proper noun, numerical value or time; otherwise, the value is 0. This is a logic-sensitive indicator function, used when the first statistical unit after initial screening... The value is 1 when it belongs to the logical constraint words of the categories of negation, condition, limitation, causation or conclusion; otherwise, the value is 0. This is a location-sensitive indicator function, used when the first statistical unit after initial screening... The value is 1 when it is located in a high semantic risk position such as a title, the first sentence of a paragraph, a concluding sentence, or a conditional clause; otherwise, the value is 0. , For entity-sensitive indicator constant coefficients, For logic-sensitive indicator constant coefficients, For position-sensitive indication constant coefficients, Statistical stability score The system comprehensively reflects the frequency of occurrence of statistical units in the text and their relative stability. Through the above-mentioned low-sensitivity semantic scoring, the risk of adjusting statistical units that carry key semantic or logical information can be effectively reduced.

[0048] S33. Based on statistical stability score and semantically low sensitivity score Analysis of the first statistical unit after preliminary screening Joint stability score , represented as: ,in, , To calculate the weighting coefficients for the stability score, The weighting coefficients for semantically low-sensitivity scores. ;

[0049] S34. The first statistical unit after preliminary screening that meets the screening criteria is used as the second statistical unit; the screening criteria are: ,and ,in, This is the set of the second statistical units; The preset joint stability threshold, This represents the maximum total value of the second statistical unit. This is the minimum total value of the second statistical unit.

[0050] By introducing the above-mentioned joint stability evaluation and semantic low-sensitivity constraint screening mechanism, it is possible to effectively avoid modification of key semantics, logical structure and entity information of text while ensuring the stability of statistical features. This allows the watermark embedding process to mainly act on the decorative statistical structure that has little impact on text understanding, thereby improving the stability and parsing of watermarks in editing, rewriting and complex dissemination scenarios without significantly affecting the semantic consistency and readability of the text.

[0051] By screening the first statistical unit, we focus on the survival probability of statistical attributes during text propagation, changing the purpose of statistical modeling from "describing text" to "screening carrier structures that can survive for a long time," which helps improve the stability of watermark propagation. This forms a constraint relationship with the subsequent "statistical attribute mapping + optimized embedding." If this screening is not performed, the subsequent optimization algorithm cannot work in the limited and low-risk solution space, and the watermark embedding will degenerate into highly perturbed random modification.

[0052] Therefore, in this application, the stable statistical unit screening is to construct a "watermark carrying space that can be constrained by an optimizable algorithm", the effect of which has not been recognized or utilized in the prior art.

[0053] S4. Obtain the watermark information to be embedded and encode the watermark information into a watermark bit sequence. Specifically, based on the binary bit sequence encoded by the watermark information to be embedded, generate length indication information to indicate the length of the watermark payload, and combine the length indication information with the watermark bit sequence to form a watermark bit sequence containing a length field and a watermark payload field. The length indication information can adopt a binary representation of a preset bit length to indicate the number of bits in the subsequent watermark payload field. The encoding method is BCH encoding, LDPC code, or other encoding methods with error correction capabilities to improve the watermark recovery success rate under the condition of statistical feature perturbation.

[0054] S5. Construct the mapping rule between the watermark bit sequence and the second statistical unit, specifically: for any second statistical unit... Define the embedded objective function Represented as: and constraints Watermark bit sequence , ; m is the modulus, mod is the modulo operation, when m=2, Equivalent to parity mapping; when m≠2, the modulo operation result is used as an intermediate statistical feature, after... After binarization, embedded target watermark bits are generated; in one embodiment, Binarization can be achieved through a binary mapping of the modulus set: defining two disjoint subsets of the modulus. ,and Then there are the judgment rules: In another embodiment, Binarization can be used for interval-based binary mapping: defining interval thresholds. ,and Then there are the judgment rules: , This represents the frequency of occurrence of the second statistical unit.

[0055] S6. Determine whether the statistical attributes of each second statistical unit meet the watermark embedding conditions; if all are met, then the text content to be embedded is taken as the optimal text content, and proceed to S8; otherwise, proceed to S7; when all second statistical units meet the conditions... When the statistical attributes of the second statistical unit satisfy the watermark embedding condition, the statistical attributes include the parity of the frequency of occurrence of the second statistical unit, the relationship between the frequency of occurrence and the preset modulus value, and the interval category to which the frequency of occurrence belongs. When the frequency of the statistical unit is odd, the corresponding watermark bit is the first value; when the frequency of the statistical unit is even, the corresponding watermark bit is the second value.

[0056] S7. Modify and optimize the embedded text content to obtain the optimal text content, then proceed to S8; for example... Figure 2 As shown, it specifically includes:

[0057] S71. Count the number s of second statistical units that do not meet the watermark embedding conditions, take all the positions of the single second statistical unit that does not meet the watermark embedding conditions as potential modification positions, and count the number N of candidate modification schemes for all potential modification positions, where s and N are both positive integers.

[0058] S72. Construct a population consisting of multiple candidate modification schemes for the j-th second statistical unit. Each individual in the population... All candidate modifications included at a potential modification location are represented as: Where P is the population size, and k is the k-th individual. This represents the activation result at the i-th position of the k-th individual. This represents the allocation result for the k-th individual. This represents the selection result of the k-th individual, i∈N. The activation result, allocation result, and selection result satisfy the following constraints: , ;

[0059] S73. Initialize the population; specifically: initialize each potential modification location using an activation strategy, an operation type allocation strategy, and a new word selection strategy to achieve population initialization. The activation strategy is expressed as: "~" indicates "follows a distribution", Bernoulli ( ) represents the initial activation probability Bernoulli distribution (0-1 distribution). This is the activation probability, typically set to [0.05, 0.2]. Position i is determined by the activation probability. Activated modification, i.e. =1; the operation type allocation strategy is expressed as: , , It is a categorical distribution. It is a probability vector. , Let the probability of a deletion operation be denoted as . To add operation probability, The probability of a replacement operation is commonly set to... , , The new word selection strategy involves cost-weighted random selection from the candidate word set, with lower-cost words having a higher probability of being selected, as shown below: , It is a set of candidate words. It is the estimated cost of the word "v". It is an exponential transformation. It is about selecting strength parameters. , Based on the probability weight of each candidate word Perform weighted random selection from the candidate word set Randomly select a word from the list;

[0060] S74. Evolution of the initial population and analysis to obtain the optimal individual. The optimal individual The location to be modified is the optimal modification location; specifically, it includes:

[0061] (1) By adjusting the adaptive exploration probability The activation, allocation, and selection results of potential modification sites are randomly perturbed to achieve the evolution of the initialized population; adaptive exploration probability is implemented. Represented as: ,in, It is the initial exploration probability. , It is an exponentially decaying term. A value greater than 0 indicates an attenuation coefficient. It is the current population diversity; q represents the level of diversity of the target population; q represents the moderating strength of diversity. This represents the maximum number of iterations.

[0062] Each individual Activation result after perturbation at the i-th position , represented as ,in, , The probability of flipping the activation result;

[0063] When individual The activation result of the i-th position is the perturbed allocation result after the modification is performed as follows: Control the frequency of changes in allocation results ,in, To randomly select an operation, the backslash "\" indicates that the currently used operation is excluded from all three operation types {-1, 1, 2}. The remaining set of operation types;

[0064] The perturbation-adjusted selection result is expressed as: , For semantic neighbor set, , It is the cosine similarity of word vectors. The cosine similarity threshold is... POS stands for Part-of-Speech Tagging. ,like =1, perform a modification operation on position i, if =0, no modification operation is performed on position i; ,like =-1, the allocation result is a deletion operation, if =0 if and only if When =0, the allocation result is unchanged; if =1, the allocation result is an addition operation, if =2, the allocation result is a replacement operation; for If and only if It is valid when ∈{1,2}; during the evolution process, the activation result, allocation result and selection result of the modified position can be randomly perturbed by adjusting the exploration probability to increase the coverage of the search space; Indicates whether a modification operation is performed at the i-th position; Indicates the corresponding operation type; Indicates the words to be added or replaced when necessary;

[0065] (2) Analyze the fitness of all individuals in the population after evolution. And select the one with the highest fitness. Famous individuals as elites to form an elite group fitness Represented as: ,in, This represents the total cost of modification; It is a dynamic penalty weight that increases over time; These are specific penalties; It is a quality weighting coefficient. It is a quality award item. , For individuals Ranked by fitness from highest to lowest Population size;

[0066] (3) Activate the result =1, for elites 'each position Perform the modification operation and evaluate neighboring locations. The modification cost, and an analysis of the changes in modification cost. ,in, The distance from position i is the position length;

[0067] (4) Analyze the operational cost of the modified position i under all allocation results. When the minimum operating cost Then the allocation result of the currently modified position i individual will be... The allocation result was modified to minimize the operating cost. , , ,in; , , These are the frequency ranking weight coefficient, semantic risk weight coefficient, and stability cost weight coefficient, which satisfy... ; The cost of frequency ranking for removing words, It is the semantic risk cost of the deletion operation. It is the stability cost of deleting words; It is the cost of adding frequency ranking of words. It is the semantic risk cost of the add operation. It is the stability cost of adding vocabulary; It is the sum of the frequency ranking costs of the original word and the new word. It is the new word weight discount factor. It is the semantic risk cost of the replacement operation. It is the sum of the stability costs of the original word and the new word. The original word at the current position i. The contextual information feature of position i, and the cost perturbation constant. =0.05;

[0068] (5) Determine the modified allocation result Whether it is an addition or replacement, if yes, proceed to (6); otherwise, use the currently modified elite as the memory bank. A historical interpretation , enter (7);

[0069] (6) The candidate vocabulary set at position i Select words as selection results And use the currently modified elites as a memory bank. A historical interpretation Then enter (7), which is represented as: ,in, This refers to the change in the penalty item after the word is changed; It is the penalty weight. To indicate the current position From the original state Change to vocabulary The price to be paid For the parameter taker operator, find the 'v' that makes the following expression the minimum value, instead of returning the minimum value itself;

[0070] (7) Based on the modified elite set The system learns activation strategies, operation type allocation strategies, and new word selection strategies to generate a new individual at position i. The fitness of this new individual is compared with that of the existing individual at position i, and the individual with higher fitness is added to the memory bank. Those with lower scores will be discarded, specifically:

[0071] Activation strategy: When generating a new individual, position i is given by probability activation, The probability that the i-th gene locus of a new individual will be "activated" or set to "1";

[0072] Operation type allocation strategy: For each position i, statistically analyze the operation type distribution. ,in, , Let O be the number of individuals in the elite set ε who take operation o at position i. This refers to the occurrence of operation type o in the elite set ε;

[0073] New word selection strategy: For each (i,o) combination, compile a set of high-frequency words. The new individual selects from the statistically high-frequency vocabulary set by frequency weighting. For the word v in the elite collection Frequency of occurrence in Frequency threshold;

[0074] (8) Based on historical interpretation In memory bank Search for similar individuals , represented as: ,in, To find the function from set M smallest element , Hamming distance is used to measure the difference between two solutions;

[0075] (9) Based on similar individuals Make local improvements to obtain improved individuals. , represented as: ,in, It is a local search algorithm. This is the initial solution for the local search algorithm;

[0076] (10) Determine the individual to improve Does the condition for exiting the iteration meet? If so, then the current improved individual... As the best individual in the current second statistical unit, it enters S75; otherwise, the current improved individual is... Add to memory and update memory , and let t=t+1, then return to (1);

[0077] If the first, second, or third condition is met, then the iteration exit condition is satisfied; the first condition is that the fluctuation of the optimal fitness is less than the convergence threshold. , represented as: The second condition is that the penalty value is less than the penalty fluctuation threshold, expressed as: ,in, The optimal fitness is for generation t. This represents the average of the best fitness values ​​from the most recent L generations. Let be the absolute deviation between the optimal fitness and the mean in generation t. The penalty value is the optimal individual value in generation t; max-min represents the fluctuation range of the penalty values ​​in the most recent L generations; the third condition is that the iteration number t reaches the maximum iteration number. ;

[0078] Update memory bank Obtain the updated memory bank , represented as: ,in, This means sorting by fitness F and taking the top K data as data in the memory; To clarify the basis for the sorting, It is the fitness function. This is the best individual in the t-th generation of the population;

[0079] S75. Based on the optimal individual, perform modification operations on the current text content to obtain the modified text content and update the relevant statistical attributes; remove the currently modified second statistical unit from the second statistical units that do not meet the watermark embedding condition, and set the current removal quantity s'=s'+1; the tuple of the optimal modification scheme for the modified text content. This describes the optimal modification operation and related information in the current text state, and is represented as: ,in The optimal modification location; The optimal modification position allocation result has a value range of {-1, 1, 2}, and the corresponding modification operations are {delete, add, replace}; The original words to be operated on at the optimal modification position, the deleted words, the replaced words, and the null values ​​to be added; New words for operations at the optimal modification position, newly added words, newly replaced words, and null values ​​caused by deletion;

[0080] S76. Determine if the termination condition is met. If yes, use the modified text content as the optimal text content and proceed to S8; otherwise, let... And return S72; the termination condition is that the current number of removals s' equals s.

[0081] This step avoids the uncontrollable semantic risks caused by random or empirical modifications in existing technologies.

[0082] S8. According to the mapping rules, embed the watermark bit sequence into the statistical attributes of the second statistical unit of the optimal text content to obtain the watermark-embedded text.

[0083] Unlike existing technologies that rely on text format, layout information, or external markers, this method focuses on the text content itself. By analyzing, filtering, and controlling the statistical features in the text, it implicitly encodes the watermark information into the statistical structure of the text, thus creating an intrinsic connection between the watermark information and the text content. The watermark information is not explicitly attached to the text but is carried by adjusting the statistical attributes of the statistical units. Through this method, even if the text is converted into plain text or disseminated without the original carrier, the watermark information still has a high retention probability.

[0084] Unlike existing techniques that directly select arbitrary statistical features as watermark carriers, this method performs stability screening on the first statistical unit and further introduces semantic low-sensitivity constraints and joint stability evaluation methods to improve the overall balance between robustness, readability, and semantic consistency. Through screening, modifications to key semantics, logical structure, and entity information can be effectively avoided, so that watermark embedding mainly affects the decorative statistical structure with little impact on text understanding, thereby improving the survival and parsing of watermarks in scenarios such as editing, reflow, synonym replacement, and semantic rewriting.

[0085] By making local modifications to the text content to adjust the corresponding statistical attributes, the watermark bits are embedded. Adjusting the corresponding statistical attributes improves the watermark capacity adaptability and parsing determinism, while also enhancing the recovery reliability under editing and rewriting disturbances.

[0086] This method models the text modification involved in watermark embedding as a constrained optimization problem. It defines decision variables including "whether to modify, modification type (delete / add / replace), and candidate words," and combines these with an evaluation / fitness function reflecting factors such as statistical perturbation, semantic consistency risk, and changes in text fluency. A group search is performed in the solution space consisting of multiple candidate modification schemes. The optimization strategy dynamically balances exploratory and exploitative searches and introduces a historical best-case memory mechanism (memory update, diversity maintenance, and memory-guided local improvement) to guide subsequent search processes. This prioritizes modification schemes with minimal impact on overall text quality while ensuring successful watermark embedding. This method significantly improves the stability and controllability of watermarks in complex semantically preservative processing scenarios (including AI paraphrasing and style transfer).

[0087] A dynamic watermark embedding device based on text statistical features and optimization strategies includes:

[0088] Storage: Storage is used to store computer programs;

[0089] Executor: The executor is used to execute the computer program stored in the storage, which, when executed, implements the dynamic watermark embedding method based on text statistical features and optimization strategies as described above.

[0090] The advantages of this method are as follows: It uses the statistical attributes of the text content itself as the foundation and selects stable second statistical units through a joint stability evaluation of "statistical stability + semantic low sensitivity constraint." This allows the watermark to preferentially attach to statistical structures that are less likely to disappear and have lower semantic risk during editing, rewriting, and reordering, thereby improving its survival ability in non-original propagation scenarios while reducing the probability of affecting key entities and logical semantics. Simultaneously, this method introduces structured encoding of length indication information in the embedding stage and can combine it with error correction encoding to enhance its robustness against disturbances. This allows the extraction stage to determine the payload length first and correct statistical disturbances, improving parsing efficiency. This method offers high certainty and recovery success rate. Furthermore, it models the watermark embedding process as a constrained optimization problem and introduces a group search optimization strategy with a memory mechanism. It dynamically plans and globally optimizes the modification location and method, effectively reducing the impact on text readability, fluency, and semantic consistency while satisfying embedding constraints. Compared to existing methods that rely on fixed rules or local adjustments, this method exhibits higher stability, controllability, and applicability in semantically preserving processing scenarios such as complex editing, synonym replacement, and AI paraphrasing / summarizing. Moreover, it does not require large-scale model training, thus achieving a better balance between technical effectiveness and implementation cost.

[0091] The technical solutions of the present invention are not limited to the specific embodiments described above. Any technical modifications made in accordance with the technical solutions of the present invention fall within the protection scope of the present invention.

Claims

1. A dynamic watermark embedding method based on text statistical features and optimization strategies, characterized in that, include: S1. Obtain the text content to be embedded; S2. Divide the text content to be embedded into multiple first statistical units; S3. Perform statistical analysis on each first statistical unit to obtain the second statistical unit; S4. Obtain the watermark information to be embedded and encode the watermark information into a watermark bit sequence; S5. Construct a mapping rule between the watermark bit sequence and the second statistical unit; the mapping rule is that for any second statistical unit... Define the embedded objective function Represented as: and constraints Watermark bit sequence , ; m is the modulus, mod is the modulo operation, when m=2, Equivalent to parity mapping; when m≠2, the modulo operation result is used as an intermediate statistical feature, after... After binarization, the embedded target watermark bits are generated; This represents the frequency of occurrence of the second statistical unit; S6. Determine whether the statistical attributes of each second statistical unit satisfy the watermark embedding condition; if all satisfy, then take the text content to be embedded as the optimal text content and proceed to S8; otherwise, proceed to S7; where, when all second statistical units satisfy At that time, the statistical attributes of the second statistical unit satisfy the watermark embedding condition; S7. Modify and optimize the text content to be embedded to obtain the optimal text content, then proceed to S8; specifically including: S71. Count the number s of second statistical units that do not meet the watermark embedding conditions, take all the positions of the single second statistical unit that does not meet the watermark embedding conditions as potential modification positions, and count the number N of candidate modification schemes for all potential modification positions, where s and N are both positive integers. S72. Construct a population consisting of multiple candidate modification schemes for the j-th second statistical unit. Each individual in the population... All candidate modifications included at a potential modification location are represented as: Where P is the population size, and k is the k-th individual. This represents the activation result at the i-th position of the k-th individual. This represents the allocation result for the k-th individual. This represents the selection result of the k-th individual, i∈N. N represents the number of candidate modification schemes with potential modification locations; S73. Initialize the population; S74. Evolve the initial population and analyze it to obtain the optimal individual. The position in the optimal individual where the modification is performed is the optimal modification position. S75. Based on the optimal individual, perform modification operations on the current text content to obtain the modified text content; remove the currently modified second statistical unit from the second statistical units that do not meet the watermark embedding conditions, and set the current removal quantity s'=s'+1; S76. Determine if the termination condition is met. If yes, use the modified text content as the optimal text content and proceed to S8; otherwise, let... And return S72, where t is the current iteration number; S8. According to the mapping rules, embed the watermark bit sequence into the statistical attributes of the second statistical unit of the optimal text content to obtain the watermark-embedded text.

2. The dynamic watermark embedding method based on text statistical features and optimization strategies according to claim 1, characterized in that, S3 includes: S31. Use the stability screening function to perform preliminary screening on the first statistical unit, and obtain the set of the first statistical unit after preliminary screening. , represented as: ,in, The minimum frequency threshold, The frequency ranking ratio threshold, For the i-th first statistical unit, The frequency of occurrence for each first statistical unit, The first statistical unit Ranked by frequency of occurrence from highest to lowest and These are the first statistical unit sets after preliminary screening. Minimum and maximum values ​​of quantity The set of the first statistical units, M is the total number of the first statistical unit; S32. Analyze the first statistical unit after preliminary screening. Statistical stability score and semantically low sensitivity score , represented as: , ,in, The frequency of occurrence of each first statistical unit after initial screening. The first statistical unit after preliminary screening Ranked by frequency of occurrence from highest to lowest The preset minimum frequency threshold, The weighting coefficients for frequency factors. The weighting coefficients for ranking factors. ; For entity-sensitive indicator functions, For logic-sensitive indicator functions, For position-sensitive indication functions, For entity-sensitive indicator constant coefficients, For logic-sensitive indicator constant coefficients, For position-sensitive indication constant coefficients, ; S33. Based on statistical stability score and semantically low sensitivity score Analysis of the first statistical unit after preliminary screening Joint stability score , represented as: ,in, To calculate the weighting coefficients for the stability score, The weighting coefficients for semantically low-sensitivity scores. ; S34. The first statistical unit after preliminary screening that meets the screening criteria is used as the second statistical unit; the screening criteria are: ,and ,in, This is the set of the second statistical units; The preset joint stability threshold, This represents the maximum total value of the second statistical unit. This is the minimum total value of the second statistical unit.

3. The dynamic watermark embedding method based on text statistical features and optimization strategies according to claim 1, characterized in that, In S73, each potential modification location is initialized using an activation strategy, an operation type allocation strategy, and a new word selection strategy to achieve population initialization. The activation strategy is expressed as follows: "~" indicates "follows a distribution", Bernoulli ( ) represents the initial activation probability The Bernoulli distribution; the operation type allocation strategy is represented as: , , It is a categorical distribution. It is a probability vector. , Let the probability of a deletion operation be denoted as . To add operation probability, The new word selection strategy is represented as the probability of the replacement operation: , It is a set of candidate words. It is the estimated cost of candidate word v. It is an exponential transformation. It is about selecting strength parameters. , Based on the probability weight of each candidate word Perform weighted random selection from the candidate word set Randomly select a word from the list.

4. The dynamic watermark embedding method based on text statistical features and optimization strategies according to claim 1, characterized in that, S74 includes: (1) By adjusting the adaptive exploration probability The activation, allocation, and selection results of potential modification sites are randomly perturbed to achieve the evolution of the initialized population; adaptive exploration probability is implemented. Represented as: ,in, It is the initial exploration probability. It is an exponentially decaying term. It is the attenuation coefficient. It is the current population diversity; q represents the level of diversity of the target population; q represents the moderating strength of diversity. The maximum number of iterations; for each individual Activation result after perturbation at the i-th position , represented as: ,in, , To activate the probability of flipping the result, Indicates whether a modification operation is performed at the i-th position; when an individual The activation result at the i-th position is the perturbed allocation result when the modification is performed. Represented as: Control the frequency of changes in allocation results Represented as: ,in, To select an operation randomly, the "\" symbol indicates that the currently used operation is excluded from all three operation types {-1, 1, 2}. The remaining set of operation types Indicates the corresponding operation type; the selection result after perturbation. Represented as: , For semantic neighbor set, , It is the cosine similarity of word vectors. The cosine similarity threshold is used, and POS is the part-of-speech tagging. ,like =1, perform a modification operation on position i, if =0, no modification operation is performed on position i; ,like =-1, the allocation result is a deletion operation, if =0 if and only if When =0, the allocation result is unchanged; if =1, the allocation result is an addition operation, if =2, the allocation result is a replacement operation; for If and only if It is valid when ∈{1,2}. Indicates the words to be added or replaced when necessary; (2) Analyze the fitness of all individuals in the population after evolution. And select the one with the highest fitness. Famous individuals as elites to form an elite group fitness Represented as: ,in, This represents the total cost of modification; It is a dynamic penalty weight; These are specific penalties; It is a quality weighting coefficient. It is a quality award item. For individuals Ranked by fitness from highest to lowest Population size; (3) Activate the result =1, for elites 'each position Perform the modification operation and evaluate neighboring locations. The modification cost, and an analysis of the changes in modification cost. ,in, The distance from position i is the position length; (4) Analyze the operational cost of the modified position i under all allocation results. When the minimum operating cost Then the allocation result of the currently modified position i individual will be... The allocation result was modified to minimize the operating cost. , , ,in; , , These are the frequency ranking weight coefficient, semantic risk weight coefficient, and stability cost weight coefficient, which satisfy... ; The cost of frequency ranking for removing words, It is the semantic risk cost of the deletion operation. It is the stability cost of deleting words; It is the cost of adding frequency ranking of words. It is the semantic risk cost of the add operation. It is the stability cost of adding vocabulary; It is the sum of the frequency ranking costs of the original word and the new word. It is the new word weight discount factor. It is the semantic risk cost of the replacement operation. It is the sum of the stability costs of the original word and the new word. The original word at the current position i. For the contextual information features of position i, The constant is the operating cost disturbance constant; (5) Determine the modified allocation result Whether it is an addition or replacement, if yes, proceed to (6); otherwise, use the currently modified elite as the memory bank. A historical interpretation , enter (7); (6) The candidate vocabulary set at position i Select words as selection results And use the currently modified elites as a memory bank. A historical interpretation Then enter (7), which is represented as: ,in, This refers to the change in the penalty item after the word is changed; It is the penalty weight. To indicate the current position From the original state Change to vocabulary The price to be paid This is the parameter fetching operator; (7) Based on the modified elite set The system learns activation strategies, operation type allocation strategies, and new word selection strategies to generate a new individual at position i. The fitness of this new individual is compared with that of the existing individual at position i, and the individual with higher fitness is added to the memory bank. Those with lower scores will be discarded, specifically: Activation strategy: When generating a new individual, position i is given by probability activation, The probability that the i-th gene locus of a new individual will be "activated" or set to "1"; Operation type allocation strategy: For each position i, publish the statistical operation type. ,in , Let O be the number of individuals in the elite set ε who take operation o at position i. This refers to the occurrence of operation type o in the elite set ε; New word selection strategy: For each (i,o) combination, compile a set of high-frequency words. The new individual selects from the statistically high-frequency vocabulary set by frequency weighting. For the word v in the elite collection Frequency of occurrence in Frequency threshold; (8) Based on historical interpretation In memory bank Search for similar individuals , represented as: ,in, To find the function from set M smallest element , Hamming distance is used to measure the difference between two solutions; (9) Based on similar individuals Make local improvements to obtain improved individuals. , represented as: ,in, It is a local search algorithm. This is the initial solution for the local search algorithm; (10) Determine the individual to improve Does the condition for exiting the iteration meet? If so, then the current improved individual... As the best individual in the current second statistical unit, it enters S75; otherwise, the current improved individual is... Add to memory and update memory , and let t=t+1, then return to (1).

5. The dynamic watermark embedding method based on text statistical features and optimization strategies according to claim 4, characterized in that, Update memory bank Obtain the updated memory bank , represented as: ,in, This means sorting by fitness F and taking the top K data as the data in the memory. To clarify the basis for the sorting, It is the best individual in the t-th generation of the population.

6. The dynamic watermark embedding method based on text statistical features and optimization strategies according to claim 4, characterized in that, In (10), if the first condition, the second condition, or the third condition is met, then the iteration exit condition is met; the first condition is that the fluctuation of the optimal fitness is less than the convergence threshold. , represented as: ; The second condition is that the penalty value is less than the penalty fluctuation threshold, which is expressed as: ,in, The optimal fitness is for generation t. This represents the average of the best fitness values ​​from the most recent L generations. Let be the absolute deviation between the optimal fitness and the mean in generation t. The penalty value is the optimal individual value in generation t; max-min represents the fluctuation range of the penalty values ​​in the most recent L generations; the third condition is that the iteration number t reaches the maximum iteration number. .

7. The dynamic watermark embedding method based on text statistical features and optimization strategies according to claim 1, characterized in that, In S76, the termination condition is that the current elimination number s' equals s.

8. A dynamic watermark embedding device based on text statistical features and optimization strategies, characterized in that, include: Storage: Storage is used to store computer programs; Executor: The executor is used to execute the computer program stored in the storage, which, when executed, implements the dynamic watermark embedding method based on text statistical features and optimization strategies as described in any one of claims 1-7.

Citation Information

Patent Citations

  • Controllable text watermark embedding method based on reinforcement learning strategy model

    CN120974466A

  • Large model generation content traceability technology based on model copyright ID watermark embedding

    CN121302334A