Dynamic watermark embedding method and device based on text statistical characteristics and optimization strategy
By selecting stable text statistical units and optimizing their attributes, watermark information is implicitly embedded in the text statistical structure, solving the problem of insufficient traceability information retention in existing technologies and improving stability and parsability in complex scenarios.
Patent Information
- Application Number
- CN202610163605.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-02-05
- Publication Date
- 2026-03-10
- Estimated Expiration
- 2046-02-05
Smart Images

Figure CN121637465A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of digital watermarking technology, and in particular to a dynamic watermark embedding method and device based on text statistical features and optimization strategies. BACKGROUND
[0002] Existing text watermarking and traceability related technologies still have certain limitations in actual application, especially in application scenarios where text dissemination forms are diversified, and their applicability and stability need to be further improved.
[0003] Format domain or spatial domain watermarking usually relies on the layout format or physical structure information of the document, and its information capacity is relatively limited. When the text is copied as plain text or after format conversion processing, the relevant watermark information is often difficult to preserve, thereby limiting the traceability capability in the format-free text dissemination scenario.
[0004] Text watermarking methods based on statistical features or transform domains can embed watermark information to some extent, but their watermark stability may still be affected after common editing operations such as text rearrangement, semantic rewriting, or synonym substitution, thereby reducing the reliability of traceability in non-original dissemination scenarios.
[0005] Text watermarking methods based on deep learning have certain advantages in handling complex content transformations, but they usually rely on large-scale training data and high computational resources, and the implementation cost is relatively high. At the same time, such methods often need to tightly integrate the watermark embedding process with the text generation process, which may affect the quality or stability of the generated text in some application scenarios, and the internal decision-making process of the model is not easy to explain, which may bring additional uncertainty.
[0006] Explicit marking methods based on cryptography have strong tamper resistance, but the marking information is usually independent of the text content itself. When the text content is extracted separately and disseminated in plain text form, the relevant external markers are difficult to preserve along with the content, thereby having the problem of insufficient applicability in the traceability scenario after the content is separated from the original carrier.
[0007] Based on the above analysis, the existing technology still has room for improvement in the following typical application scenarios, and the related traceability requirements have not been fully met:
[0008] Problem 1: In the case where the text content is stripped of format and copied or disseminated in plain text form, how to improve the preservation capability of traceability information?
[0009] Problem 2: After the text content has undergone editing operations such as semantic rewriting, synonym substitution, or structure adjustment, how to improve the stability and analyzability of traceability information?
[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 ratio 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] An executor; the executor is used to execute a computer program stored in the memory, 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 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 Ranked by frequency of occurrence from highest to lowest and These are the first statistical unit sets after preliminary screening. The minimum and maximum values of the quantity, where U is the set of the first statistical unit. M is the total number of the first statistical unit;
[0046] 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.
[0047] 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. ;
[0048] 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 represents the minimum total value of the second statistical unit.
[0049] 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.
[0050] 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.
[0051] 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.
[0052] 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.
[0053] 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 performed as an interval-based binary mapping: define an interval threshold T, and... Then there are the judgment rules: , This represents the frequency of occurrence of the second statistical unit.
[0054] S6. Determine whether the statistical attributes of each second statistical unit meet the watermark embedding conditions; if all meet, then take the text content to be embedded 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.
[0055] 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:
[0056] 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.
[0057] 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: , ;
[0058] 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. The operation type allocation strategy is expressed as follows: , , It is a categorical distribution. It is a probability vector. , The probability of a deletion operation. 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;
[0059] 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:
[0060] (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.
[0061] Each individual Activation result after perturbation at the i-th position , represented as ,in, , The probability of flipping the activation result;
[0062] 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;
[0063] 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 Perform a modification operation on position i, if No modification operation is performed on position i; ,like The allocation result is a deletion operation. If and only if When the assignment result is unchanged, the allocation result is as follows: The allocation result is an addition operation, if The allocation result is a replacement operation; for If and only if It is effective at the time; during the evolution process, the activation results, allocation results and selection results of the modified location can be randomly perturbed by adjusting the exploration probability in order 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;
[0064] (2) Analyze the fitness of all individuals in the population after evolution. And select the one with the highest fitness. Individuals with the name X form an elite set. 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 The ranking is based on fitness from high to low, where P is the population size.
[0065] (3) Activate the result For the elite 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;
[0066] (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. ;
[0067] (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);
[0068] (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 moving the current position i 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;
[0069] (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:
[0070] 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";
[0071] 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 ε;
[0072] 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;
[0073] (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;
[0074] (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;
[0075] (10) Determine the individual to be improved 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);
[0076] 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 denoted as 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. ;
[0077] 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 fitness function. This is the best individual in the t-th generation of the population;
[0078] 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;
[0079] 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.
[0080] This step avoids the uncontrollable semantic risks caused by random or empirical modifications in existing technologies.
[0081] S8. According to the mapping rules, embed the watermark ratio sequence into the statistical attributes of the second statistical unit of the optimal text content to obtain the watermark embedded text.
[0082] 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.
[0083] 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.
[0084] 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.
[0085] 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).
[0086] A dynamic watermark embedding device based on text statistical features and optimization strategies includes:
[0087] Storage: Storage is used to store computer programs;
[0088] An executor; the executor is used to execute a computer program stored in the memory, which, when executed, implements the dynamic watermark embedding method based on text statistical features and optimization strategies as described above.
[0089] 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.
[0090] 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 strategy, characterized in that, The method comprises the following steps: S1, obtaining text content to be embedded; S2, splitting the text content to be embedded into a plurality of first statistical units; S3, performing statistical analysis on each first statistical unit to obtain second statistical units; S4, obtaining watermark information to be embedded, and encoding the watermark information into a watermark bit sequence; S5, constructing a mapping rule between the watermark bit sequence and the second statistical units; S6, determining whether the statistical properties of each second statistical unit meet the watermark embedding condition; if all meet, the text content to be embedded is taken as optimal text content, and S8 is entered; Otherwise, S7 is entered; S7, modifying and optimizing the text content to be embedded to obtain optimal text content, and then entering S8; specifically comprising: S71, counting the number s of second statistical units that do not meet the watermark embedding condition, taking all positions of a single second statistical unit that does not meet the watermark embedding condition as potential modification positions, and counting the number N of candidate modification schemes of all potential modification positions, both s and N being positive integers; S72, constructing a population consisting of a plurality of candidate modification schemes of the jth second statistical unit, each individual of the population including all candidate modification schemes at one potential modification position, denoted as: ; wherein P is the population size, k is the kth individual, denotes the activation result of the ith position of the kth individual, denotes the assignment result of the kth individual, denotes the selection result of the kth individual, i∈N, , N is the number of candidate modification schemes with potential modification positions; S73, initializing a population; S74, evolving the initialized population, and analyzing to obtain an optimal individual, the position of which is modified in the optimal individual being an optimal modification position; S75, performing a modification operation on the current text content according to the optimal individual to obtain modified text content; removing the second statistical unit that is currently modified from the second statistical units that do not meet the watermark embedding condition, and letting the current removal number 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, embedding the watermark bit sequence into the statistical properties of the second statistical units of the optimal text content according to the mapping rule to obtain watermark embedded text. 2.The method of claim 1, wherein, In S3, it comprises: S31, performing a preliminary screening on the first statistical units using a stability screening function to obtain a set of first statistical units after preliminary screening is represented as: wherein, is a minimum frequency threshold, is a frequency sorting proportion threshold, is the ith first statistical unit, is the appearance frequency of each first statistical unit, is the first statistical unit the ranking of the appearance frequency from high to low, and are respectively the set of first statistical units after preliminary screening the minimum and maximum values of the number, is the set of first statistical units, M is the total number of first statistical units; S32, analyzing the first statistical units after the preliminary screening statistical stability score and semantic low sensitivity score , is expressed as: , wherein, is the frequency of occurrence of each first statistical unit after the preliminary screening, is the first statistical unit after the preliminary screening ranked by frequency of occurrence from high to low, is a preset minimum frequency threshold, is a weight coefficient of the frequency factor, is a weight coefficient of the ranking factor, ; is an entity-sensitive indication function, is a logical-sensitive indication function, is a location-sensitive indication function, is an entity-sensitive indication constant coefficient, is a logical-sensitive indication constant coefficient, is a location-sensitive indication constant coefficient, ; S33, the statistical stability score and the semantic low sensitivity score analyzing the first statistical unit after the preliminary screening the joint stability score is expressed as: wherein, is a weight coefficient of the statistical stability score, is a weight coefficient of the semantic low sensitivity score, ; S34, taking the first statistical unit after the preliminary screening that meets the screening condition as a second statistical unit; the screening condition is: , and wherein, is a set of second statistical units; is a preset joint stability threshold, is a maximum value of the total amount of second statistical units, is a minimum value of the total amount of second statistical units. 3.The method of claim 1, wherein, In S5, the mapping rule is to map any second statistical unit to a target function defined as: ; and constrain the watermark bit sequence , ; m is the modulus, mod is the modulus operation, when m=2, it is equivalent to the parity mapping; when m≠2, the modulus operation result is used as an intermediate statistical feature, which is binarized to generate the embedded target watermark bit; The frequency of the second statistical unit is .
4. The method of claim 3, wherein, In S6, when the second statistical unit both satisfies the statistical property of the second statistical unit satisfies the watermark embedding condition. 5.The method of claim 1, wherein, In S73, each potential modification position is initialized by activating the strategy, the operation type assignment strategy and the new word selection strategy, the initialization of the population is realized, the activation strategy is represented as: , " ~ " represents " subject to distribution ", Bernoulli ( ) is the initial activation probability Bernoulli distribution; the operation type assignment strategy is represented as: , , is the classification distribution, is the probability vector, , is the deletion operation probability, is the addition operation probability, is the replacement operation probability, the new word selection strategy is represented as: , is the candidate vocabulary set, is the estimated cost of the candidate vocabulary v, is the exponential transformation, is the selection intensity parameter, , is a weighted random selection of a word from the candidate vocabulary set According to the probability weight of each candidate vocabulary. 6.The method of claim 1, wherein, In S74, it comprises: (1) Adjusting the adaptive exploration probability The activation result, assignment result and selection result of the potential modification position are randomly disturbed to realize the evolution of the initialized population; the adaptive exploration probability is expressed as: wherein, is the initial exploration probability, is an exponential decay term, is a decay coefficient, is the current population diversity; is the target diversity level; q is the diversity adjustment strength, is the maximum number of iterations; the i-th position of each individual after disturbance is expressed as: wherein, , is the probability of activation result flipping, indicates whether the i-th position performs a modification operation; when the activation result of the i-th position of the individual is to perform a modification, the disturbed assignment result is expressed as: , which controls the frequency of assignment result change is expressed as: wherein, is a random selection operation, and the "\ " symbol indicates that from the total three operation types {-1, 1, 2}, the operation currently in use is excluded , the remaining operation type set, indicates the corresponding operation type; the disturbed selection result is expressed as: , is the semantic neighbor set, is the word vector cosine similarity, is the cosine similarity threshold, and POS is the part-of-speech tag; , if , the modification operation is performed on the i-th position, if , the modification operation is not performed on the i-th position; , if , the assignment result is a deletion operation, if , the assignment result is no modification only when , if , the assignment result is an addition operation, if , the assignment result is a replacement operation; for , it is valid only when , if Indicates the chosen vocabulary when addition or replacement is required. (2) Analyze the fitness of all individuals in the evolved population and select the top individuals as the elite X to form an elite set ; the fitness is represented as: , where represents the total modification cost; is a dynamic penalty weight; is a specific penalty term; is a quality weight coefficient, is a quality reward term, and the individual is ranked by fitness from high to low, and P is the population size; (3) Activate the result For the elite 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) Analyzing the operation cost of the modified position i under all allocation results When the minimum operation cost , the allocation result of the current modified position i individual is modified to the allocation result of the minimum operation cost , , Wherein, , , are the frequency ranking weight coefficient, the semantic risk weight coefficient and the stability cost weight coefficient respectively, satisfying ; is the frequency ranking cost of deleting the vocabulary, is the semantic risk cost of the deletion operation, is the stability cost of deleting the vocabulary; is the frequency ranking cost of adding the vocabulary, is the semantic risk cost of the addition operation, is the stability cost of adding the vocabulary; is the sum of the frequency ranking costs of the original word and the new word, is the new word weight discount factor, is the semantic risk cost of the replacement operation, is the sum of the stability costs of the original word and the new word, is the original vocabulary at the current position i, is the context information feature of the position i, is the operation cost disturbance constant; (5) judge the modified allocation result whether it is addition or replacement, if yes, go to (6); otherwise, take the current modified elite as a memory one history solution in the memory , go to (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: At the time of generating a new individual, the position i is activated with a probability activation, the probability that the i-th gene position of the new individual is "activated" or set to "1"; Operation type assignment strategy: for each position i, count the operation type publication where , is the number of individuals in the elite set ε that employ operation o at position i, is the occurrence of operation type o in the elite set ε; New word selection strategy: for each (i, o) combination, the set of high frequency words is counted , the new individual selects from the set of high frequency words by frequency weighting, the frequency of the vocabulary v in the elite set , the frequency threshold; (8) According to the historical solution In the memory bank Search for similar individuals , denoted as: Where, is the element from the set M that makes the function Minimum, Hamming distance is used to measure the difference between two solutions; (9) according to the similar individual performing local improvement to obtain an improved individual is expressed as: wherein, is a local search algorithm, is an initial solution of the local search algorithm; (10) Determine the individual to be improved 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).
7. The method of claim 6, wherein the embedding of the dynamic watermark based on the text statistical features and the optimization strategy is characterized by, updating the memory pool obtaining the updated memory pool is denoted as: wherein, denotes sorting by fitness F, taking the top K as data in the memory pool, is the basis for explicit sorting, is the optimal individual in the t th generation population.
8. The method of claim 6, wherein, In (10), the first condition, the second condition or the third condition is satisfied, then the jump-out iteration condition is satisfied; the first condition is that the optimal fitness fluctuation is less than a convergence threshold , is expressed as: ; The second condition is that the penalty value is less than a penalty fluctuation threshold, denoted as: wherein, is the optimal fitness of the tth generation; is the average of the optimal fitness of the last L generations; is the absolute deviation of the optimal fitness of the tth generation from the average, is the penalty value of the optimal individual of the tth generation; max-min is the fluctuation range of the penalty value of the last L generations; and the third condition is that the iteration number t reaches a maximum iteration number . 9.The method of claim 1, wherein, In S76, the termination condition is that the current removal number s' is equal to s.
10. A dynamic watermark embedding device based on text statistical features and optimization strategies, characterized in that, The storage is used for storing a computer program; The executor is used for executing the computer program stored in the storage, and when the computer program is executed, the method for dynamically embedding a watermark based on text statistical features and an optimization strategy according to any one of claims 1-9 is realized.
Citation Information
Patent Citations
Digital archive safe circulation tracking method and system based on dynamic watermark
CN120145346A
Generative AI output-based domestic credible watermark embedding and tracing method and system
CN120832661A
Controllable text watermark embedding method based on reinforcement learning strategy model
CN120974466A
Text watermarking method and device, storage medium and electronic equipment
CN121120352A
Large model generation content traceability technology based on model copyright ID watermark embedding
CN121302334A