Watermarking method and system based on content detection

By setting content matching and avoidance rules during the system development phase, monitoring changes in the page document model, and automatically detecting and generating watermarks, the problem of incomplete watermark addition is solved, and automatic adjustment and uniform coverage of watermarks are achieved.

CN115688060BActive Publication Date: 2026-03-17IND BANK CO +1
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-08
Publication Date
2026-03-17

AI Technical Summary

Technical Problem

Existing technologies for adding watermarks proactively predict page content, leading to issues such as omissions of business pages and uneven watermark coverage.

Method used

During system development, content matching rules are set, page document model changes are monitored, watermarks are automatically detected and generated through matching degree analysis, and the angle and density are adjusted to cover all areas. Custom rules and avoidance rules for different businesses are supported and merged to ensure the integrity of watermark coverage.

Benefits of technology

It achieves watermark coverage effects for different application scenarios, including custom application domains for corresponding application scenarios, including applications on browser pages.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115688060B_ABST
    Figure CN115688060B_ABST
Patent Text Reader

Abstract

The application provides a watermark adding method and system based on content detection, comprising the following steps: step 1, setting content matching rules in the system development stage; step 2, monitoring the document model of a page, the change of data in the model, and performing matching degree analysis on the document model content and the rules set by the system in the page running stage; step 3, detecting the width, height and area of the document model region after the matching degree meets the preset requirements, and executing watermark generation and addition. The application defines matching rules in scripts, allows custom rule coverage, detects the front and back changes of HTML content during program running, can supplement information such as watermarks as needed, and effectively avoids the omission problem of business pages with manually added watermarks.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of watermarking technology, and more specifically, to a watermarking method and system based on content detection. Background Technology

[0002] Currently, applications and system pages that require watermarks use a proactive approach: knowing in advance whether the page content involves sensitive information and then adding the watermark.

[0003] Patent document CN110796583A (application number: CN201911020395.0) discloses a stylized visible watermarking method. This method involves extracting content from the watermark, representing its style, and performing image style transformation to change the watermark style. It then uses an image salient target detection method to obtain the size and position of the salient target in the image to be watermarked, determines the size and placement of the selected watermark, and adds the stylized watermark around the salient target.

[0004] This processing method, which proactively adds watermarks and anticipates potential omissions of watermarks on some existing business pages, also leads to issues where watermark density and angle tend to be consistent across containers of varying widths and heights, resulting in some critical data not being covered by the watermark. Summary of the Invention

[0005] To address the shortcomings of existing technologies, the purpose of this invention is to provide a watermarking method and system based on content detection.

[0006] The watermarking method based on content detection provided by the present invention includes:

[0007] Step 1: During the system development phase, set the content matching rules;

[0008] Step 2: During the page execution phase, monitor changes in the page's document model and the data within the model, and perform a matching degree analysis on the document model content and the rules set by the system.

[0009] Step 3: After the matching degree meets the preset requirements, detect the width, height and area of ​​the document model area, and perform watermark generation and addition.

[0010] Preferably, step 1 includes: establishing matching rules and avoidance rules, injecting the matching rules and avoidance rules into the global model during program writing, and introducing preset detection scripts and matching scripts.

[0011] Preferably, step 2 includes:

[0012] Step 2.1: Capture the set matching rules and avoidance rules, and merge them with the script's preset rules using the same item exclusion and difference fusion methods;

[0013] Step 2.2: When the page document model changes, execute the document content and rule matching detection function to identify whether the changed document model conforms to the merged rules, and output a document model that meets the preset requirements.

[0014] Preferably, the entire page content is retrieved, and after triggering relevant button clicks or API requests, new content is retrieved again. The content information before and after is compared, and if there is a difference, it indicates that the page document model has changed.

[0015] For each piece of content / list obtained from the browser page, perform regular expression matching tests and tests to see if it conforms to the avoidance rules. Finally, obtain all matching results. If any result is a match, add a watermark to the browser page.

[0016] Preferably, step 3 includes:

[0017] Step 3.1: Detect the area, area ratio, width and height of the document model in the overall page, and input the required watermark angle and density information;

[0018] Step 3.2: Based on angle and density information, as well as the text information of the watermark, generate watermark fragments and repeat the watermark fragments;

[0019] Step 3.3: Add the generated watermark information to the document model of the page.

[0020] The content detection-based watermarking system provided by the present invention includes:

[0021] Module M1: Sets content matching rules during the system development phase;

[0022] Module M2: During the page execution phase, it monitors changes in the page's document model and the data within the model, and performs a matching degree analysis on the document model content and the rules set by the system.

[0023] Module M3: After the matching degree meets the preset requirements, it detects the width, height and area of ​​the document model region, and performs watermark generation and addition.

[0024] Preferably, the module M1 includes: establishing matching rules and avoidance rules, injecting the matching rules and avoidance rules into the global model during program writing, and introducing preset detection scripts and matching scripts.

[0025] Preferably, the module M2 includes:

[0026] Module M2.1: Captures the set matching and avoidance rules, and merges them with the script's preset rules using the same item exclusion and difference fusion methods;

[0027] Module M2.2: When the page document model changes, execute the document content and rule matching detection function to identify whether the changed document model conforms to the merged rules, and output a document model that meets the preset requirements.

[0028] Preferably, the entire page content is retrieved, and after triggering relevant button clicks or API requests, new content is retrieved again. The content information before and after is compared, and if there is a difference, it indicates that the page document model has changed.

[0029] For each piece of content / list obtained from the browser page, perform regular expression matching tests and tests to see if it conforms to the avoidance rules. Finally, obtain all matching results. If any result is a match, add a watermark to the browser page.

[0030] Preferably, the module M3 includes:

[0031] Module M3.1: Detects the area, area ratio, width and height of the document model in the overall page, and inputs the angle and density information of the required watermark;

[0032] Module M3.2: Based on angle, density information, and watermark text information, generate watermark fragments and repeat the watermark fragments;

[0033] Module M3.3: Adds the generated watermark information to the document model of the page.

[0034] Compared with the prior art, the present invention has the following beneficial effects:

[0035] (1) When a watermark pattern needs to be added, the watermark can be added automatically to avoid the problem of watermark loss due to insufficient coverage of the business page.

[0036] (2) Adjust the watermark density and tilt angle to avoid some key information not being covered by the watermark and to prevent the watermark from being too dense;

[0037] (3) Define matching rules within the script and allow custom rules to override them. Detect changes in HTML content before and after the program runs. Supplement watermark and other information as needed to effectively avoid omissions in business pages where watermarks are manually added. Attached Figure Description

[0038] Other features, objects, and advantages of the present invention will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings:

[0039] Figure 1 This is a flowchart of the method of the present invention. Detailed Implementation

[0040] The present invention will now be described in detail with reference to specific embodiments. These embodiments will help those skilled in the art to further understand the present invention, but do not limit the invention in any way. It should be noted that those skilled in the art can make several changes and improvements without departing from the concept of the present invention. These all fall within the protection scope of the present invention.

[0041] Example:

[0042] This invention relates to a method for automatically adding watermarks and automatically adjusting the angle and density of content detection. Specifically, it involves using built-in watermark configuration rules and custom matching rules to trigger the identification and detection of page content changes during system operation, thereby automatically adding watermark backgrounds to the page, and automatically adjusting the watermark density and angle based on the width and height detection of content partitions.

[0043] This invention is applicable to accessing application pages in a browser. When the content or text presented on the page changes, it performs rule matching and avoidance parsing on the changed content to determine whether the page needs to be supplemented with a privacy watermark, thus preventing information leakage caused by screenshots.

[0044] Specifically, the implementation method of this invention includes the following steps:

[0045] Step 1: During the system development phase, set the content matching rules according to the agreed method;

[0046] Step 2: During the page execution phase, monitor changes in the page's document model and the data within the model, and perform a matching degree analysis on the document model content and the rules set by the system.

[0047] Step 3: Once a rule match is found, check the width, height, and area of ​​the document model region, and then generate and add the watermark.

[0048] Step 1 includes the following steps:

[0049] Step 1.1: Establish core matching rules and avoidance rules according to the agreed-upon method. For example, matching rules for province, city, and district addresses on the page, and avoidance rules for data that is already encrypted;

[0050] Step 1.2: When writing the program, inject the rules into the system's global model;

[0051] Step 1.3: When writing the program, include the detection script, matching script, etc. contained in this method.

[0052] Matching rules: Content matching is performed using regular expressions. For example, / ^1\d{10} / is used to match mobile phone numbers, and / .+(?=.*[province|city|autonomous prefecture|autonomous region])(?=.*[region|county|town|street|building|room|number])[^]{8,}$ / is used to match addresses, etc.

[0053] Avoidance rules: If the province, city, or district match rule is met, but consecutive special characters (such as ***) already exist, then avoidance will be performed. Privacy processing has been done on this data.

[0054] Step 2 includes the following steps:

[0055] Step 2.1: When the system is running, it first captures the matching rules and avoidance rules set by the system, and then merges them with the rules preset by the script using methods such as identical item exclusion and difference fusion.

[0056] To enhance usability, the tool's methods include built-in matching rules, such as the regular expression matching rules for phone numbers and addresses mentioned above; and avoidance rules, such as avoiding consecutive asterisks; allowing customization, such as changing the privacy characters in the avoidance rules from consecutive asterisks to consecutive #; during merging, matching rules and avoidance rules are overridden for the same items, such as unifying the avoidance rules from consecutive asterisks to consecutive #; and handling the merging of differences, such as adding other matching rules besides phone numbers and addresses.

[0057] Step 2.2: When the page document model changes, except for changes caused by adding watermarks, execute the document content and rule matching detection function to identify whether the changed document model conforms to the rules fused in Step 2.1, and output the matching document model nodes;

[0058] The browser retrieves the entire page's content text using its own methods. After triggering actions such as button clicks or API requests, it retrieves new content text again. By comparing the before and after content text, any discrepancies indicate a change in the page's document model. For each piece of content / list retrieved from the browser page, it performs regular expression matching tests against matching rules and tests for compliance with avoidance rules. Finally, it obtains all matching results. If any item is true, it means a watermark needs to be added to the current page, and the watermark addition method is executed to populate the browser page.

[0059] Step 3 includes the following steps:

[0060] Step 3.1: Based on the document model output in Step 2, detect the area, area ratio, width and height of the document model in the overall page, and input the required watermark angle and density information;

[0061] Step 3.2: Based on angle and density information, as well as the text information of the watermark, generate watermark fragments and repeat the watermark fragments;

[0062] Step 3.3: Add the generated watermark information to the document model of the page.

[0063] The watermarking system based on content detection provided by the present invention includes: module M1: setting content matching rules during the system development phase; module M2: monitoring changes in the document model and data within the model during the page operation phase, and performing matching degree analysis on the document model content and the rules set by the system; module M3: after the matching degree meets the preset requirements, detecting the width, height, and area of ​​the document model region, and performing watermark generation and addition.

[0064] Module M1 includes: establishing matching rules and avoidance rules; injecting matching rules and avoidance rules into the global model during program writing; and introducing preset detection scripts and matching scripts. Module M2 includes: Module M2.1: capturing the set matching rules and avoidance rules, and merging them with the preset rules of the script using the same-item exclusion and difference fusion methods; Module M2.2: when the page document model changes, executing the document content and rule matching detection function, identifying whether the changed document model conforms to the merged rules, and outputting a document model that meets the preset requirements. The entire page content is obtained. After triggering relevant button clicks or interface requests, new content is obtained again. By comparing the presented content information before and after, if there is a difference, it indicates that the page document model has changed. For the content / list obtained from the browser page, regular expression matching tests and avoidance rule tests are performed one by one to obtain all matching results. If any result is a match, a watermark is added to the browser page. The module M3 includes: Module M3.1: Detects the area, area ratio, width and height of the document model in the overall page, and inputs the angle and density information of the required watermark; Module M3.2: Generates watermark fragments based on the angle and density information and the text information of the watermark, and repeats the watermark fragments; Module M3.3: Adds the generated watermark information to the document model of the page.

[0065] This invention automatically supplements watermarks based on rule and document model content detection, improving watermark coverage. It adopts a coverage detection method to achieve automatic adjustment of watermark angle density and supports custom matching rules and avoidance rules under different business scenarios.

[0066] Those skilled in the art will understand that, in addition to implementing the system, apparatus, and their modules provided by this invention in purely computer-readable program code, the same program can be implemented in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers by logically programming the method steps. Therefore, the system, apparatus, and their modules provided by this invention can be considered a hardware component, and the modules included therein for implementing various programs can also be considered structures within the hardware component; alternatively, modules for implementing various functions can be considered both software programs implementing the method and structures within the hardware component.

[0067] Specific embodiments of the present invention have been described above. It should be understood that the present invention is not limited to the specific embodiments described above, and those skilled in the art can make various changes or modifications within the scope of the claims, which do not affect the essence of the present invention. Unless otherwise specified, the embodiments and features described in this application can be arbitrarily combined with each other.

Claims

1. A content detection based watermark adding method, characterized by, The method comprises the following steps: Step 1: setting content matching rules in the system development stage; Step 2: in the page running stage, the document model of the page is monitored, the change of data in the model is monitored, the matching degree of the document model content and the rules set by the system is analyzed; Step 3: after the matching degree meets the preset requirement, the width, height and area of the document model region are detected, and the watermark generation and addition are performed; The step 1 comprises: establishing matching rules and avoidance rules, injecting the matching rules and the avoidance rules into the global model during program writing, and introducing preset detection scripts and matching scripts; The step 2 comprises: Step 2.1: capturing the set matching rules and avoidance rules, and merging the rules with the rules preset by the scripts by using the same item exclusion and difference fusion method; Step 2.2: when the page document model changes, the matching detection function of the document content and the rules is executed, whether the changed document model meets the merged rules is identified, and the document model meeting the preset requirement is output; The content script of the entire page is acquired, new content script is acquired again after the action of triggering the relevant button click and interface request, the presented content script information before and after the comparison is compared, and if there is a difference, it indicates that the page document model changes; The content / list acquired from the browser page is tested by using the regular matching one by one, and whether the avoidance rules are met is tested, finally, all matching results are obtained, and if there is any one result matching, the watermark is added and filled into the browser page.

2. The content detection based watermark adding method of claim 1, wherein, The step 3 comprises: Step 3.1: detecting the area, area ratio and width and height of the document model in the whole page, and inputting the angle and density information of the required watermark; Step 3.2: based on the angle, density information and text information of the watermark, a watermark segment is generated, and the watermark segment is repeated; Step 3.3: the generated watermark information is added to the document model of the page.

3. A content detection based watermark adding system characterized by, The method comprises the following steps: Module M1: setting content matching rules in the system development stage; Module M2: in the page running stage, the document model of the page is monitored, the change of data in the model is monitored, the matching degree of the document model content and the rules set by the system is analyzed; Module M3: after the matching degree meets the preset requirement, the width, height and area of the document model region are detected, and the watermark generation and addition are performed; The module M1 comprises: establishing matching rules and avoidance rules, injecting the matching rules and the avoidance rules into the global model during program writing, and introducing preset detection scripts and matching scripts; The module M2 comprises: Module M2.1: capturing the set matching rules and avoidance rules, and merging the rules with the rules preset by the scripts by using the same item exclusion and difference fusion method; Module M2.2: when the page document model changes, the matching detection function of the document content and the rules is executed, whether the changed document model meets the merged rules is identified, and the document model meeting the preset requirement is output; The content script of the entire page is acquired, new content script is acquired again after the action of triggering the relevant button click and interface request, the presented content script information before and after the comparison is compared, and if there is a difference, it indicates that the page document model changes; For the content / list obtained from the browser page, regular matching test is performed one by one, and whether the test meets the avoidance rule is tested, and finally all matching results are obtained, if any one result is matched, the watermark is added to the browser page.

4. The content detection based watermark adding system of claim 3, wherein, The module M3 comprises: Module M3.1: detecting the area, area ratio, width and height of the document model in the whole page, and inputting the angle and density information of the required watermark; Module M3.2: generating a watermark segment based on the angle, density information, and text information of the watermark, and repeating the watermark segment; Module M3.3: adding the generated watermark information to the document model of the page.

Citation Information

Patent Citations

  • Stylized visible watermark adding method

    CN110796583A

  • Webpage watermark adding method and system, intelligent equipment and medium

    CN112328979A

  • Text watermark adding and applying method and device

    CN114547562A