Method for generating webpage watermark, computer readable storage medium and computer device
By using SDK and algorithm technology to hide and remove dark watermarks in web pages, it solves the problem of leakage and difficulty in reporting web watermarks after screenshots, realizes timely monitoring and tracking of data leaks, and ensures the security of watermark information.
Patent Information
- Application Number
- CN202210203911.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-02
- Publication Date
- 2024-10-15
- Estimated Expiration
- 2042-03-02
AI Technical Summary
Existing web page watermarks are easily leaked after taking screenshots, and watermark files are difficult to report and track in a timely manner.
By introducing the SDK, real-time self-test is performed to detect abnormal conditions, and RGB or Fourier algorithms are used to hide and remove dark watermarks in web pages to realize real-time monitoring and reporting of watermarks.
Realize timely reporting and tracking of data leakage, ensure the integrity and security of watermark information, and fill in watermark information in a timely manner.
Smart Images

Figure CN114596189B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of image processing, and in particular, relates to a method for generating a webpage watermark, a computer-readable storage medium, and a computer device. Background Art
[0002] The existing method of tracking leaks using web page watermarks is easy to be leaked after the watermark is screenshot, and the watermark file is easy to be deleted, making it impossible to report and track in time. Summary of the invention
[0003] The purpose of this application is to provide a method for generating a webpage watermark, a computer-readable storage medium, and a computer device, aiming to solve the problem that webpage data leakage or deletion cannot be reported in a timely manner.
[0004] In a first aspect, the present application provides a method for generating a webpage watermark, comprising:
[0005] Get the SDK of preset configuration properties according to the project;
[0006] Initialize the information to be watermarked according to the SDK with preset configuration attributes;
[0007] Open a web page that displays the information to be watermarked;
[0008] Initialize the web page of the information to be watermarked according to the information to be watermarked and the preset configuration properties of the SDK;
[0009] Loading watermarks on the information to be watermarked on the initialized web page according to the preset configuration properties of the SDK;
[0010] Start SDK real-time self-check and report any abnormalities detected.
[0011] Furthermore, before the watermark is loaded on the information to be watermarked on the initialized web page according to the preset configuration attributes of the SDK, the method further includes: using the SDK to detect the network to determine whether the watermark information can be returned.
[0012] Furthermore, the method of loading a watermark on the information to be watermarked on the initialized web page according to the preset configuration attributes of the SDK specifically includes: obtaining the initialized web page, and laying the bright watermark on the web page; using the RGB algorithm, converting the web page into pixels, performing RGB color value conversion on the three values of R, G and B of the pixels, and changing the RGB component values of the pixels through the DWT algorithm, or the DCT algorithm, or the FFT algorithm, to hide the dark watermark on the web page; or:
[0013] Using the Fourier algorithm, the web page is Fourier transformed to obtain a frequency domain image, the encoded dark watermark image is spectrally superimposed with the obtained frequency domain image, and then the spectrum of the superimposed dark watermark is inverse Fourier transformed to obtain an image with a Fourier dark watermark.
[0014] Furthermore, the preset configuration attributes include: a watermark loading method, a watermark level, and text information of the web page.
[0015] Furthermore, the information to be watermarked includes: user information, access address and time.
[0016] Furthermore, the SDK is started for real-time self-checking and the detected abnormalities are reported as follows: the SDK performs clear watermark integrity detection, dark watermark integrity detection, SDK JS file integrity detection and access address detection respectively, and when watermark damage, JS file damage and / or abnormalities are detected, the abnormalities are reported.
[0017] Furthermore, after starting the SDK real-time self-check and reporting the detected abnormal situation, it also includes: removing the dark watermark and restoring the web page through RGB inverse decoding or Fourier inverse decoding.
[0018] Further, the method of removing the dark watermark and restoring the web page by RGB inverse decoding or Fourier inverse decoding is specifically as follows: the method of removing the dark watermark and restoring the web page by RGB inverse decoding or Fourier inverse decoding is specifically as follows: converting the web page with the dark watermark into pixels by RGB inverse decoding, and then subtracting the RGB color value of the pixel converted from the web page without the watermark from the RGB color value of the pixel to obtain the RGB color value of the pixel of the watermark image, and obtaining the image containing the watermark content according to the RGB color value of the pixel of the watermark image; or:
[0019] Through Fourier inverse decoding, the web page with the dark watermark is Fourier transformed to obtain a superimposed frequency domain image, the frequency domain image of the web page is removed to obtain the encoded watermark image, and the encoded watermark image is decoded to obtain the watermark picture.
[0020] In a second aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method for generating a web page watermark are implemented.
[0021] In a third aspect, the present application provides a computer device, comprising: one or more processors, a memory, and one or more computer programs, wherein the processor and the memory are connected via a bus, wherein the one or more computer programs are stored in the memory and are configured to be executed by the one or more processors, and when the processor executes the computer program, the steps of the method for generating a web page watermark are implemented.
[0022] In this application, by introducing SDK and performing real-time SDK self-check, when data leakage is detected, it will be reported to the background in a timely manner, and the information of the leaker will be tracked based on the screenshots of the leaked data and the access address reported by the watermark; at the same time, the destruction of the watermark and / or the destruction of the JS file will be reported so that the watermark information can be filled in in time. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 This is a flow chart of a method for generating a web page watermark provided in one embodiment of the present application.
[0024] Figure 2 It is a schematic diagram of a restored watermark provided in an embodiment of the present application.
[0025] Figure 3 It is a specific structural block diagram of a computer device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0026] In order to make the purpose, technical solution and beneficial effects of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0027] In order to illustrate the technical solution described in this application, a specific embodiment is provided below for illustration.
[0028] See also Figure 1 , the method for generating a webpage watermark provided in an embodiment of the present application includes the following steps: It should be noted that if there is substantially the same result, the method for generating a webpage watermark of the present application is not based on Figure 1 The process sequence shown is limited.
[0029] S101, obtaining an SDK with preset configuration properties according to the project;
[0030] S102, initializing the information to be watermarked according to the SDK with preset configuration attributes;
[0031] S103, opening a web page containing information to be watermarked;
[0032] S104, initializing the webpage of the information to be watermarked according to the information to be watermarked and the preset configuration attributes of the SDK;
[0033] S105, loading a watermark on the information to be watermarked on the initialized web page according to the preset configuration properties of the SDK;
[0034] S106: Start SDK real-time self-check and report any abnormalities detected.
[0035] In an embodiment of the present application, before the watermark is loaded on the information to be watermarked on the initialized web page according to the preset configuration attributes of the SDK, it also includes: using the SDK to detect the network to determine whether the watermark information can be returned.
[0036] In an embodiment of the present application, the method of loading a watermark on the information to be watermarked on the initialized web page according to the preset configuration attributes of the SDK is specifically as follows: obtaining the initialized web page, laying the bright watermark on the web page; using the RGB algorithm, converting the web page into pixels, performing RGB color value conversion on the three values of R, G and B of the pixels, changing the RGB component values of the pixels through the DWT algorithm, or the DCT algorithm, or the FFT algorithm, and hiding the dark watermark on the web page; or:
[0037] Using the Fourier algorithm, the web page is Fourier transformed to obtain a frequency domain image, the encoded dark watermark image is spectrally superimposed with the obtained frequency domain image, and then the spectrum of the superimposed dark watermark is inverse Fourier transformed to obtain an image with a Fourier dark watermark.
[0038] In an embodiment of the present application, the preset configuration attributes include: a method of loading a watermark, a level of the watermark, and text information of the web page.
[0039] In an embodiment of the present application, the information to be watermarked includes: user information, access address and time.
[0040] In one embodiment of the present application, the SDK is started for real-time self-checking and the detected abnormalities are reported as follows: the SDK performs clear watermark integrity detection, dark watermark integrity detection, SDK JS file integrity detection and access address detection respectively, and when watermark damage, JS file damage and / or abnormalities are detected, the abnormalities are reported.
[0041] In an embodiment of the present application, after starting the SDK real-time self-check and reporting the detected abnormal situation, it also includes: removing the dark watermark and restoring the web page through RGB inverse decoding or Fourier inverse decoding.
[0042] In one embodiment of the present application, the method of removing the dark watermark and restoring the web page by RGB inverse decoding or Fourier inverse decoding is specifically as follows: removing the dark watermark and restoring the web page by RGB inverse decoding or Fourier inverse decoding is specifically as follows: converting the web page with the dark watermark into pixels by RGB inverse decoding, and then subtracting the RGB color value of the pixel converted from the web page without the watermark from the RGB color value of the pixel to obtain the RGB color value of the pixel of the watermark image, and obtaining the image containing the watermark content according to the RGB color value of the pixel of the watermark image; or:
[0043] Through Fourier inverse decoding, the web page with the dark watermark is Fourier transformed to obtain a superimposed frequency domain image, the frequency domain image of the web page is removed to obtain the encoded watermark image, and the encoded watermark image is decoded to obtain the watermark picture.
[0044] An embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps of the method for generating a web page watermark provided in an embodiment of the present application are implemented.
[0045] Figure 3 A specific structural block diagram of a computer device provided in an embodiment of the present application is shown, wherein a computer device 100 comprises: one or more processors 101, a memory 102, and one or more computer programs, wherein the processor 101 and the memory 102 are connected via a bus, the one or more computer programs are stored in the memory 102, and are configured to be executed by the one or more processors 101, and when the processor 101 executes the computer program, the steps of the method for generating a web page watermark provided in an embodiment of the present application are implemented.
[0046] The computer device includes a server and a terminal, etc. The computer device may be a desktop computer, a mobile terminal or a vehicle-mounted device, and the mobile terminal includes at least one of a mobile phone, a tablet computer, a personal digital assistant or a wearable device, etc.
[0047] The embodiment of the present application introduces SDK and performs real-time self-check of SDK. When data leakage is detected, it will be reported to the background in a timely manner, and the information of the leaker will be tracked based on the screenshot of the leaked data and the access address reported by the watermark. At the same time, the destruction of the watermark and / or the destruction of the JS file will be reported so that the watermark information can be filled in in time.
[0048] A person skilled in the art may understand that all or part of the steps in the various methods of the above embodiments may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the storage medium may include: a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc.
[0049] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present application should be included in the protection scope of the present application.
Claims
1. A method for generating a webpage watermark, characterized in that: include: Get the SDK of preset configuration properties according to the project; Initialize the information to be watermarked according to the SDK with preset configuration attributes; Open a web page that displays the information to be watermarked; Initialize the web page of the information to be watermarked according to the information to be watermarked and the preset configuration properties of the SDK; Loading watermarks on the information to be watermarked on the initialized web page according to the preset configuration properties of the SDK; The watermark loading is to obtain the initialized web page and lay the clear watermark on the web page; Using RGB algorithm, convert web pages into pixels, convert the three values of R, G and B of pixels into RGB color values, change the RGB component values of pixels through DWT algorithm, DCT algorithm or FFT algorithm, and hide the dark watermark in the web page; or: using Fourier algorithm, Fourier transform the web page to obtain frequency domain image, superimpose the frequency spectrum of the encoded dark watermark image with the obtained frequency domain image, and then perform inverse Fourier transform on the spectrum of the superimposed dark watermark to obtain the image with Fourier dark watermark; Start SDK real-time self-check and report detected anomalies; that is, SDK performs clear watermark integrity check, dark watermark integrity check, SDK JS file integrity check and access address check respectively. When anomalies that damage the watermark and / or JS file are detected, the anomaly will be reported.
2. The method according to claim 1, characterized in that Before the watermark is loaded on the information to be watermarked on the initialized web page according to the preset configuration attributes of the SDK, the method further includes: using the SDK to detect the network to determine whether the watermark information can be returned.
3. The method according to claim 1, characterized in that The preset configuration attributes include: a watermark loading method, a watermark level, and text information of a web page.
4. The method according to claim 1, characterized in that The information to be watermarked includes: user information, access address and time.
5. The method according to claim 1, characterized in that The method of starting the SDK real-time self-check and reporting the detected abnormal situation also includes: removing the dark watermark and restoring the web page through RGB inverse decoding or Fourier inverse decoding.
6. The method according to claim 5, characterized in that The method of removing the dark watermark and restoring the web page by RGB inverse decoding or Fourier inverse decoding is as follows: the web page with the dark watermark is converted into pixels by RGB inverse decoding, and then the RGB color value of the pixel is subtracted from the RGB color value of the pixel converted from the web page without the watermark to obtain the RGB color value of the pixel of the watermark image, and the image containing the watermark content is obtained according to the RGB color value of the pixel of the watermark image; or: Through Fourier inverse decoding, the web page with the dark watermark is Fourier transformed to obtain a superimposed frequency domain image, the frequency domain image of the web page is removed to obtain the encoded watermark image, and the encoded watermark image is decoded to obtain the watermark picture.
7. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method for generating a web page watermark as described in any one of claims 1 to 6 are implemented.
8. A computer device comprising: One or more processors, a memory and one or more computer programs, wherein the processor and the memory are connected via a bus, wherein the one or more computer programs are stored in the memory and are configured to be executed by the one or more processors, wherein the processor implements the steps of the method for generating a web page watermark as described in any one of claims 1 to 6 when executing the computer program.
