Webpage watermark implanting method and device, electronic equipment and storage medium

By determining the carrying container in the web page, generating and implanting a watermark background image, and forming a reverse background through color adjustment, the content leakage problem caused by the watermark restoration time difference is solved, and the security of web page content is improved.

CN119211435APending Publication Date: 2024-12-27CHINA MOBILE ONLINE SERVICES CO LTD +1
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411193950.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-28
Publication Date
2024-12-27

AI Technical Summary

Technical Problem

In the prior art, there is a time difference in watermark restoration, resulting in the problem of web page content leakage still within the time difference.

Method used

By determining the container can be carried from multiple containers based on the target watermark and the container style information of each container to be implanted in the web page, a new background image is generated and a watermark is implanted, and color adjustment is performed to generate a reverse background, combined with the watermark background image , form a watermarked web page, thereby preventing users from tampering with the watermark and preventing content leakage.

Benefits of technology

Effectively prevent users from tampering with watermarks, preventing web page content from leaking, and improving the security of web page content.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119211435A_ABST
    Figure CN119211435A_ABST
Patent Text Reader

Abstract

The invention provides a webpage watermark implanting method and device, electronic equipment and a storage medium, and the method comprises the steps: determining a loadable container from a plurality of containers based on a target watermark and the container style information of each container in a webpage to be implanted; generating a newly added background image corresponding to the loadable container, and implanting the target watermark into the newly added background image to obtain a watermark background image; and performing color adjustment on the original background of the loadable container to obtain a reverse background, so as to obtain the webpage containing the watermark based on the reverse background and the watermark background image. According to the method provided by the invention, the reverse background is obtained by performing color adjustment on the original background of the loadable container, so that the webpage containing the watermark is obtained based on the reverse background image and the watermark background image implanted with the target watermark, the idea of tampering the watermark by the user is prevented from the subjective willingness of the user, the content of the webpage is prevented from being leaked, and the user experience is improved. And the security of the webpage content is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a method, device, electronic device and storage medium for embedding watermarks into a web page. Background Art

[0002] Blind watermark is an important way to prevent information from being leaked by malicious dissemination. Compared with the clear watermark, it has the advantages of better appearance, better concealment and stronger anti-attack. In the display of web pages, the application of blind watermark is becoming more and more extensive. The current blind watermark technology of web pages is mainly based on digital blind watermark in the frequency domain, that is, by using the method in the web page to add a layer of picture to the top layer of the web page, the frequency domain blind watermark is implanted in the corresponding picture. And based on the monitoring of the watermark recovery event, the deleted watermark layer is restored.

[0003] However, when restoring the watermark based on the above method, there is a time difference in the watermark restoration, and the webpage content may still be leaked within the time difference. Summary of the invention

[0004] The present invention provides a webpage watermark embedding method, device, electronic device and storage medium, which are used to solve the defect in the prior art that the webpage content is still leaked within the time difference due to the time difference of watermark restoration.

[0005] The present invention provides a method for embedding a watermark in a web page, comprising: Determine a loadable container from multiple containers based on the target watermark and container style information of each container to be embedded in the webpage; Generate a new background image corresponding to the load-bearing container, and implant the target watermark into the new background image to obtain a watermark background image; The original background of the carrying container is color-adjusted to obtain a reverse background, so as to obtain a webpage containing a watermark based on the reverse background and the watermark background image.

[0006] According to a method for embedding a watermark in a web page provided by the present invention, the color of the original background of the loadable container is adjusted to obtain a reverse background, and a web page containing a watermark is obtained based on the reverse background and the watermark background image, comprising: In the case that the original background does not have color adjustment, color adjustment is performed on the original background to obtain a reverse background; The watermark background image is displayed on the reverse background to obtain the watermarked web page; the watermark background image is carried based on the segmentation element.

[0007] According to a method for embedding a watermark in a web page provided by the present invention, the watermark background image is displayed on the reverse background to obtain the web page containing the watermark, comprising: Implanting the target watermark into the page image to be implanted in the webpage to obtain a watermark page image; The watermark background image and the watermark page image are displayed on the reverse background to obtain the watermarked web page.

[0008] According to a method for embedding a watermark in a web page provided by the present invention, the step of embedding the target watermark into the page image to be embedded in the web page to obtain the watermark page image comprises: Based on the corresponding minimum bearing image sizes of the page image and the target watermark, obtaining image size comparison results of each side of the page image; Based on the image size comparison results of each edge, the page image is resized to obtain an adjusted page image; The target watermark is implanted into the adjustment page image to obtain the watermark page image.

[0009] According to a method for embedding a watermark in a web page provided by the present invention, the method of determining a loadable container from a plurality of containers based on a target watermark and container style information of each container to be embedded in the web page comprises: Comparing the minimum bearing image size corresponding to the target watermark with the container size in the container style information of each container to obtain a container size comparison result of each side of each container; The load-bearing container is determined from the plurality of containers based on the comparison results of the container sizes of the respective sides.

[0010] According to a webpage watermark embedding method provided by the present invention, the determining of the loadable container from the multiple containers based on the container size comparison results of the respective edges includes: When the comparison result of the container sizes of the respective edges is greater than the minimum image-bearing size, determining a candidate container from the plurality of containers; Determine the load-bearing container from the candidate containers based on a random selection algorithm; The number of the load-bearing containers is multiple.

[0011] The present invention also provides a webpage watermark embedding device, comprising: Selecting a container unit, and determining a loadable container from a plurality of containers based on the target watermark and container style information of each container to be embedded in the web page; A watermark embedding unit generates a new background image corresponding to the loadable container, and implants the target watermark into the new background image to obtain a watermark background image; The anti-tampering unit adjusts the color of the original background of the load-bearing container to obtain a reverse background, so as to obtain a watermarked web page based on the reverse background and the watermark background image.

[0012] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, a watermark embedding method for a web page as described above is implemented.

[0013] The present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the watermark embedding method for a web page as described in any one of the above is implemented.

[0014] The present invention also provides a computer program product, including a computer program, wherein when the computer program is executed by a processor, the watermark embedding method for a web page as described above is implemented.

[0015] The web page watermark implantation method, device, electronic device and storage medium provided by the present invention obtain a reverse background by adjusting the color of the original background of the load-bearing container, and obtain a watermarked web page based on the reverse background and the watermark background image with the target watermark implanted. This prevents users from tampering with the watermark from the user's subjective intention, prevents the content of the web page from being leaked, and ensures the security of the web page content. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0017] Figure 1 This is one of the flow charts of the method for embedding a watermark in a web page provided by the present invention; Figure 2 It is a schematic diagram of the process of obtaining a web page containing a watermark provided by the present invention; Figure 3 is a schematic diagram of an image adjustment operation provided by the present invention; Figure 4 This is the second flow chart of the method for embedding a watermark in a web page provided by the present invention; Figure 5 It is a structural schematic diagram of a watermark embedding device for a web page provided by the present invention; Figure 6 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0018] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0019] It should be noted that blind watermarks are mainly divided into spatial domain blind watermarks and frequency domain blind watermarks. Among them, the principle of spatial domain (pixel domain) blind watermarks is to hide the watermark information in the pixels of the image. The method of using it in a web page is to implant the picture containing the watermark information into the top layer of the web page, adjust the transparency of the watermark picture to a very low value, and set it to be unclickable, so as to achieve the purpose of visual and operational imperception, and it is necessary to trace the source by analyzing the hue difference. However, the spatial domain blind watermark adds a watermark layer with higher transparency to the upper layer of the web page, and the hue difference is needed to decode the watermark. As a result, the obtained watermark image is easily modified by beauty software such as PS and loses the traceability ability, and when there are fewer pure color areas in the web page, the superimposed image is not easy to trace the source.

[0020] In addition, the principle of frequency domain blind watermarking is to use some transformation methods to convert the image into the frequency domain, such as Fourier transform, discrete cosine transform, wavelet transform, etc. Then, add a watermark to the image in the frequency domain, and then convert the image into the spatial domain through inverse transformation to form a watermarked image.

[0021] Currently, the main method for watermark tampering prevention in web pages is to add node / attribute detection in the web page code. That is, when a blind watermark node or attribute is detected to have changed, the watermark element is regenerated and loaded. However, when the watermark layer is deleted, the monitoring watermark restoration event is triggered. Since there is a time difference in watermark restoration, the web page content leaked within the time difference does not contain the watermark information, and there is a problem of leakage of web page content without watermark.

[0022] In view of the above problems, the present invention provides a method for embedding watermarks in web pages, so as to realize the user's subjective unwillingness to delete the watermark layer in the web page, thereby improving the security of the web page content. Figure 1 FIG. 1 is a flow chart of a method for embedding a watermark in a web page provided by the present invention. Figure 1 As shown, the method includes: Step 110, determining a loadable container from a plurality of containers based on the target watermark and container style information of each container to be embedded in the web page; Here, the target watermark refers to information that is embedded in the content of a web page and is not easily noticeable but can be detected or identified in a specific way, that is, it can be a blind watermark. The watermark content of the target watermark can be text, pattern, serial number, company logo or text with special meaning, etc. It should be noted that the size of the minimum bearing image corresponding to target watermarks of different sizes is different. For example, the larger the size of the target watermark, the larger the size of the corresponding minimum bearing image; conversely, the smaller it is. Therefore, the bearing container here refers to a container whose background image can bear the target watermark.

[0023] In addition, the web page to be implanted may contain multiple containers, and each container may be considered to be responsible for the content layout of the corresponding area in the web page. The container may be a wrapper or carrier of elements such as text, pictures, links, etc. in the web page. The container style information of each container here may refer to the appearance and layout information used to define each content section in the web page to be implanted, and may include style information such as the size information, position attribute information, background image information, font information, etc. of the container.

[0024] Specifically, the target watermark can be obtained and encoded, and the minimum image size can be calculated based on the encoded watermark. Then, the minimum image size can be compared with the container size of each container to determine the loadable container from all containers to be embedded in the web page. For example, a container whose length and width are both larger than the minimum image size can be used as a loadable container. It should be noted that the number of loadable containers here can be multiple.

[0025] Step 120, generating a new background image corresponding to the load-bearing container, and implanting the target watermark into the new background image to obtain a watermark background image; Here, the newly added background image may refer to an image that is the same as the original background of the load-bearing container. Specifically, first, the corresponding newly added background image can be generated based on the size and color value data of the load-bearing container. Then, the frequency domain data can be obtained by performing Fourier transform on the newly added background image. Then, the encoded target watermark is superimposed on the frequency domain data, and the frequency domain data superimposed with the target watermark is inversely Fourier transformed to obtain the watermark background image, that is, the background image containing the target watermark. It can be understood that by obtaining a picture resource that is consistent with the size and color of the original container, it is used as a necessary carrier for the frequency domain blind watermark that is widely distributed on the web page. That is, the target watermark is more widely distributed in the web page to be implanted.

[0026] Step 130 , adjusting the color of the original background of the carrying container to obtain a reverse background, so as to obtain a watermarked webpage based on the reverse background and the watermark background image.

[0027] Here, the original background of the container can be based on an image, such as an image of white or other colors; the original background can also be set by the color value data of the front-end attribute, such as the background attribute in CSS (Cascading Style Sheets), which can be (255, 255, 255).

[0028] In addition, the reverse background here may refer to a background that is opposite in color to the original background of the load-bearing container. Correspondingly, when the original background is an image, the reverse background is an image with a color opposite to that of the original background; when the original background is obtained through the color value data of the front-end attribute, the reverse background is a color value opposite to that of the original background.

[0029] It is understandable that, usually in a web page, in order to make the text, pictures and other contents in the web page appear more clearly, there is a certain contrast in color between the background image of the web page and the text, pictures and other contents in the web page. For example, if the background image of the web page is white, the text in the web page is usually black. Therefore, the reverse background can also be considered as a background with a color similar to the text content carried by the loadable container. For example, if the text in the web page is black, the color of the reverse background is also black.

[0030] Specifically, the color of each original background of the load-bearing container can be adjusted to obtain the reverse background of each load-bearing container. For example, if the background color value of the original background is (r, g, b), the color value of the adjusted reverse background is (255-r, 255-g, 255-b). It can be understood that when the color of the original background of the load-bearing container is adjusted to obtain the reverse background, the reverse background is the background of the load-bearing container. Furthermore, a watermarked web page can be obtained by displaying a watermarked background image on the reverse background.

[0031] It should be noted that when a user deletes the watermark background image, the background image in the web page is displayed as a reverse background, and the reverse background is an image with a color similar to the text and other contents in the web page. As a result, the user is subjectively unwilling to delete the watermark background image, that is, to delete the watermark layer. Moreover, even if the user deletes the watermark background image, the text and other contents cannot be clearly displayed in the image obtained afterwards, which prevents the web page content that should be protected by the watermark from being leaked, and ensures the security of the web page content.

[0032] The method provided by the embodiment of the present invention adjusts the color of the original background of the load-bearing container to obtain a reverse background, and obtains a watermarked web page based on the reverse background and a watermark background image in which a target watermark has been implanted. This prevents users from tampering with the watermark from the user's subjective will, prevents the content of the web page from being leaked, and ensures the security of the web page content.

[0033] Based on any of the above embodiments, step 130 includes: In the case that the original background does not have color adjustment, color adjustment is performed on the original background to obtain a reverse background; The watermark background image is displayed on the reverse background to obtain the watermarked web page; the watermark background image is carried based on the segmentation element.

[0034] Here, the partition element may refer to a DIV element (division), which is used to carry the regional layout of each partition in the web page.

[0035] Specifically, first, determine whether the original background of the loadable container has been color-adjusted. If the original background has not been color-adjusted, it means that this container may be used as a loadable container for the first time, and the background color corresponding to the container has not been color-adjusted. Then, the original background of the loadable container may be color-adjusted, and the color of the original background may be adjusted to a color value opposite to the original background color to obtain a reverse background. It is understandable that if the original background has been color-adjusted, it means that the background color of the container has been color-adjusted in reverse, and the background of the container is a reverse background, and then the background color of the container may not be adjusted.

[0036] It should be noted that by judging whether the original background of the loadable container has color adjustment, it is determined that the background of the loadable container is a reverse background, which lays a foundation for preventing users from deleting the target watermark.

[0037] Next, a DIV element can be created above the loadable container, and the DIV element is used to carry the watermark background image embedded with the blind watermark, thereby realizing the display of the web page content and the target watermark, and obtaining a web page containing a watermark.

[0038] In one embodiment, Figure 2 is a schematic diagram of the process of obtaining a web page containing a watermark provided by the present invention, such as Figure 2As shown, the actual page effect corresponding to the original container, the actual page effect corresponding to the container after adding the blind watermark, and the actual page effect after the blind watermark layer is deleted are included. Among them, the container content of the original container includes the original background and text content, and the actual page display effect is the container background and text content. The color value of the original background is (a, b, c), for example, white. The color value of the original background is reversed, and the color is adjusted to (255-r, 255-g, 255-b), that is, black. Then, the container content of the original container and the new container background are displayed on this black background. The new container background here is the container image after the blind watermark is implanted. Therefore, the actual page display effect of the web page after adding the blind watermark is the same as the display effect of the original web page. However, when the blind watermark layer is deleted, that is, the new container background is deleted, the actual page effect of the container after removing the blind watermark is the background and text content after the color value is adjusted, that is, all displayed as black content.

[0039] It should be noted that the created DIV element is above the loadable container, that is, above the background corresponding to the loadable container, that is, above the reverse background. For example, the watermark background image can be above the loadable container layer and below the text layer.

[0040] It should also be noted that the watermark background image based on the segmentation element can be understood as using the watermark background image containing the target watermark as the background image of the area corresponding to the segmentation element, which can cover the entire web page or a partial area of ​​the web page.

[0041] It is understandable that compared to the prior art of directly adding a layer of watermark image to the top layer of the web page, in order to achieve the purpose of user imperception, the opacity of the image implanted with the frequency domain blind watermark needs to be reduced to a very low level, which will result in a large loss of frequency domain information and make it impossible to trace the source. The method provided in the embodiment of the present invention does not need to reduce the opacity of the watermark background image by carrying the watermark background image through the segmentation element, which is also convenient for tracing the blind watermark. In addition, the watermark background image carried by the segmentation element allows the blind watermark to be displayed more flexibly, and it is more maintainable and adaptable, and it is also more difficult to remove.

[0042] Based on any of the above embodiments, the step of displaying the watermark background image on the reverse background to obtain the watermarked webpage includes: Implanting the target watermark into the page image to be implanted in the webpage to obtain a watermark page image; The watermark background image and the watermark page image are displayed on the reverse background to obtain the watermarked web page.

[0043] Here, the page image to be embedded in the webpage refers to the image resource to be embedded in the webpage, such as the illustration displayed in the webpage. Thus, the page image may include multiple illustrations of different sizes.

[0044] Specifically, first, by identifying the front-end resource type, image resources can be selected, that is, the page image can be obtained. After obtaining the watermark implantation request sent by the front end to the back end, the page image and the resource information of each container sent by the front end are accepted. Then, the target watermark is implanted in the page image and the loadable container in the container. Here, the watermark is implanted in the page image, and it can also be a Fourier transform of the page image to generate frequency domain data. Then, the encoded watermark is superimposed on the frequency domain data, and the frequency domain data of the superimposed watermark data information is inversely Fourier transformed to generate a watermark page image. Finally, the watermark background image and the watermark page image are displayed on the reverse background to obtain a watermarked web page, which further makes it difficult for the target watermark to be maliciously deleted, thereby improving the robustness of the implanted target watermark.

[0045] In order to further improve the comprehensiveness of blind watermarking in web pages and break through the limitations of blind watermarking in web pages, based on any of the above embodiments, the step of implanting the target watermark into the page image to be implanted in the web page to obtain the watermark page image includes: Based on the corresponding minimum bearing image sizes of the page image and the target watermark, obtaining image size comparison results of each side of the page image; Based on the image size comparison results of each edge, the page image is resized to obtain an adjusted page image; The target watermark is implanted into the adjustment page image to obtain the watermark page image.

[0046] Here, the minimum bearing image size refers to the size of the smallest image used to bear the target watermark, which can reflect the minimum capacity requirement for embedding the target watermark.

[0047] Specifically, the target watermark can be encoded and the minimum image size can be calculated by encoding the data, for example, the length can be , width is The length and width of the page image can be recorded as and Next, each side of the page image is compared with each corresponding value in the minimum bearing image size to obtain the image size comparison result of each side. Then, the page image can be copied respectively, and the copied page image can be resized based on the image size comparison result of each side to obtain the adjusted page image.

[0048] Specifically, when the image size comparison results of each edge are that the page image size is greater than or equal to the minimum bearing image size, it means that the page image capacity meets the minimum capacity requirement of the target watermark, and the page image size adjustment may not be performed; when the image size comparison results of any edge are that the page image size is less than the minimum bearing image size, it means that the page image capacity does not meet the minimum capacity requirement of the target watermark, and the page image size adjustment may be performed so that the adjusted page image capacity meets the minimum capacity requirement of the target watermark. For example, when Greater than or equal to ,and Greater than or equal to In the case of , no resizing of the page image may be performed; when Less than or, Less than In the case of the page image, the page image is resized. The resizing here may be a proportional stretching operation on the page image.

[0049] In one embodiment, the page image that does not meet the minimum capacity requirement is adjusted by further comparing and ; Figure 3 is a schematic diagram of the image adjustment operation provided by the present invention, such as Figure 3 As shown in the figure Respectively represent the size of the stretched image, that is, adjust the size of the page image. In this case, the page image can be stretched proportionally. .when In this case, the page image can be stretched proportionally. It is understandable that when and are respectively less than and In the case of the above, the image is stretched proportionally based on the size ratio with the largest difference from the minimum image size, so that the sizes of each side of the adjusted page image after stretching meet the minimum image size.

[0050] Finally, the target watermark can be implanted into the adjusted page image, and the size of the image implanted with the target watermark can be restored to the original size to obtain the watermarked page image. Therefore, the image size of the watermarked page image here is the same as the image size of the original page image.

[0051] It should be noted that the size of each side of the page image is compared by the minimum image size corresponding to the target watermark, and the page images that can be directly implanted with the target watermark and the page images that cannot be directly implanted with the target watermark are screened according to the comparison results of each side. The page images that cannot be implanted with the target watermark are upgraded in resources, that is, the size is adjusted, so that the image resources that can be implanted with the target watermark are more abundant, thereby improving the comprehensiveness of web page watermark implantation, so as to achieve 100% web page watermark implantation.

[0052] Based on any of the above embodiments, step 110 includes: Comparing the minimum bearing image size corresponding to the target watermark with the container size in the container style information of each container to obtain a container size comparison result of each side of each container; The load-bearing container is determined from the plurality of containers based on the comparison results of the container sizes of the respective sides.

[0053] Specifically, first, the minimum bearing image size corresponding to the target watermark can be compared with the container size in the container style information of each container to obtain the container size comparison results of each side of each container. For example, the length of each side of the container can be compared with the minimum bearing image size corresponding to each side. Then, when the container size comparison results of each side are that the size of the container is greater than or equal to the minimum bearing image size, it means that the capacity of the background image corresponding to the container meets the minimum capacity requirement of the target watermark, and this container can be used as a bearing container; when the container size comparison result of any side is that the size of the container is less than the minimum bearing image size, it means that the capacity of the background image corresponding to the container does not meet the minimum capacity requirement of the target watermark, and this container cannot be used as a bearing container for this target watermark.

[0054] Finally, the container sizes of all edges whose comparison results show that the container size is greater than or equal to the minimum image size can be selected as candidate containers, and all candidate containers can be selected as loadable containers. Alternatively, some candidate containers can be selected as loadable containers based on the target watermark implantation requirements.

[0055] Based on any of the above embodiments, the step of determining the load-bearing container from the plurality of containers based on the container size comparison results of the respective edges includes: When the comparison result of the container sizes of the respective edges is greater than the minimum image-bearing size, determining a candidate container from the plurality of containers; Determine the load-bearing container from the candidate containers based on a random selection algorithm; The number of the load-bearing containers is multiple.

[0056] Specifically, the containers whose comparison results of the container sizes of all sides are that the size of the container is greater than or equal to the container corresponding to the minimum bearing image size can be used as candidate containers. Here, the number of candidate containers can be multiple. Then, based on a random selection algorithm, a bearable container can be randomly selected from multiple candidate containers. The random selection algorithm here can be a random selection algorithm such as a simple random sampling algorithm or a stratified sampling algorithm, and the embodiments of the present invention do not make specific limitations on this.

[0057] It should be noted that the random selection algorithm ensures the unpredictability of the target watermark being added to the newly added background image corresponding to the bearable container, making unauthorized copying or tampering more difficult, thereby improving the robustness of the web page implanted watermark.

[0058] Based on any of the above embodiments, Figure 4 is the second flowchart of the watermark implantation method for a web page provided by the present invention. As Figure 4 shown, the method includes: First, when receiving a user's access to a page configured with a blind watermark, read the front-end file, select pictures, and send the pictures to the back-end. And send data such as the identification, background color value, and size of each container on the current page to the back-end. Then, perform size judgments on the picture resources and each container respectively.

[0059] Among them, for the size judgment of the picture resources, it can be detected by the back-end whether the size of the picture resources meets the blind watermark size requirements. When the size of the picture resources meets the blind watermark size requirements, blind watermark information can be embedded in the picture resources to obtain a watermarked picture; when the size of the picture resources does not meet the blind watermark size requirements, the picture resources can be enlarged proportionally until they meet the blind watermark size requirements, and then the enlarged picture resources are implanted with a blind watermark to obtain a watermarked picture. And the watermarked picture is restored to the size of the original picture resources.

[0060] In addition, for the size judgment of each container, it can be detected by the back-end whether the container size meets the blind watermark size requirements. When the container size meets the blind watermark size requirements, multiple containers can be randomly selected from the qualified containers as bearable containers; the containers whose container sizes do not meet the blind watermark size requirements and the unselected containers can be left untreated. Container picture resources can be generated based on the size and color value data of the bearable containers. Then, a blind watermark is implanted in the container picture resources to obtain a watermarked container picture.

[0061] Furthermore, storing the original front-end resource file, the watermarked picture, and the watermarked container picture can be in the data structure of <ID, resource file, resource file after implanting the blind watermark> and stored in a distributed file system. Thus, the original front-end resource file and the front-end resource file after implanting the blind watermark can be requested.

[0062] It should be noted that compared with the prior art, the fixed watermark information is encapsulated into the page code in a componentized form, the markup structure, style and behavior are hidden, and isolated from other codes on the page to improve the concealment of the watermark. However, due to the use of frequency domain blind watermarks in web pages, the watermark content often needs to change according to the user identification information due to traceability needs, and cannot be uniformly preset. Therefore, the practicality and flexibility of componentized encapsulation in the field of web page blind watermarks are poor. The method provided in an embodiment of the present invention, by storing the resource file with the blind watermark implanted in the file system, can implant the watermark by calling the corresponding service. Instead of componentized encapsulation, the flexibility of web page watermarks is improved.

[0063] Furthermore, the watermarked image and the watermarked container image are transmitted back to the front end. That is, the front end receives the watermarked image and the watermarked container image obtained from the file server respectively. At this time, it is necessary to determine whether the background color of the loadable container is modified for the first time. If it is the first modification, the background color of the loadable container is filled with a complementary color; if it is not the first modification, and the background color is filled with a complementary color, a DIV element is created above the loadable container to carry the watermarked container image. A new DIV creation event listener is not created to listen to the user deleting the watermarked container image.

[0064] Then, the front-end page loads the watermarked image, the watermarked container image, and other front-end resources to obtain the watermarked web page. It should be noted that if the newly created DIV content is modified, such as color value modification, resource deletion, etc., the front-end resource file and the front-end resource file with the blind watermark implanted are requested again, and the original front-end resource file, the watermarked image, and the watermarked container image are obtained from the distributed file system to reload the watermark. If no changes are detected in the newly created DIV content, the watermarked web page is displayed normally.

[0065] Based on any of the above embodiments, Figure 5 Schematic diagram of the structure of the watermark embedding device for a web page provided by the present invention. Figure 5 As shown, the device comprises: A container selection unit 510 determines a loadable container from a plurality of containers based on a target watermark and container style information of each container to be embedded in the web page; The watermark embedding unit 520 generates a new background image corresponding to the loadable container, and embeds the target watermark into the new background image to obtain a watermark background image; The anti-tampering unit 530 performs color adjustment on the original background of the carrying container to obtain a reverse background, so as to obtain a watermarked webpage based on the reverse background and the watermark background image.

[0066] The device provided by the embodiment of the present invention obtains a reverse background by adjusting the color of the original background of the load-bearing container, and obtains a watermarked web page based on the reverse background and the watermark background image with the target watermark implanted. This prevents users from tampering with the watermark from the user's subjective intention, prevents the content of the web page from being leaked, and ensures the security of the web page content.

[0067] Based on any of the above implementations, the tamper-proof unit is specifically used for: In the case that the original background does not have color adjustment, color adjustment is performed on the original background to obtain a reverse background; The watermark background image is displayed on the reverse background to obtain the watermarked web page; the watermark background image is carried based on the segmentation element.

[0068] Based on any of the above implementations, the tamper-proof unit is further specifically used for: Implanting the target watermark into the page image to be implanted in the webpage to obtain a watermark page image; The watermark background image and the watermark page image are displayed on the reverse background to obtain the watermarked web page.

[0069] Based on any of the above implementations, the tamper-proof unit is further specifically used for: Based on the corresponding minimum bearing image sizes of the page image and the target watermark, obtaining image size comparison results of each side of the page image; Based on the image size comparison results of each edge, the page image is resized to obtain an adjusted page image; The target watermark is implanted into the adjustment page image to obtain the watermark page image.

[0070] Based on any of the above implementations, the container unit is selected to be specifically used for: Comparing the minimum bearing image size corresponding to the target watermark with the container size in the container style information of each container to obtain a container size comparison result of each side of each container; The load-bearing container is determined from the plurality of containers based on the comparison results of the container sizes of the respective sides.

[0071] Based on any of the above implementations, the container unit is further specifically used for: When the comparison result of the container sizes of the respective edges is greater than the minimum image-bearing size, determining a candidate container from the plurality of containers; Determine the load-bearing container from the candidate containers based on a random selection algorithm; The number of the load-bearing containers is multiple.

[0072] Figure 6 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 6 As shown, the electronic device may include: a processor 610, a communication interface 620, a memory 630 and a communication bus 640, wherein the processor 610, the communication interface 620 and the memory 630 communicate with each other through the communication bus 640. The processor 610 may call the logic instructions in the memory 630 to execute the watermark implantation method of the web page, the method comprising: determining a loadable container from a plurality of containers based on the target watermark and the container style information of each container to be implanted in the web page; generating a newly added background image corresponding to the loadable container, and implanting the target watermark into the newly added background image to obtain a watermark background image; adjusting the color of the original background of the loadable container to obtain a reverse background, so as to obtain a web page containing a watermark based on the reverse background and the watermark background image.

[0073] In addition, the logic instructions in the above-mentioned memory 630 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0074] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the watermark implantation method for a web page provided by the above-mentioned methods, and the method includes: determining a loadable container from multiple containers based on the target watermark and container style information of each container in the web page to be implanted; generating a new background image corresponding to the loadable container, and implanting the target watermark into the new background image to obtain a watermark background image; adjusting the color of the original background of the loadable container to obtain a reverse background, so as to obtain a watermarked web page based on the reverse background and the watermark background image.

[0075] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, it is implemented to execute the watermark implantation method for a web page provided by the above-mentioned methods. The method includes: determining a loadable container from multiple containers based on the target watermark and container style information of each container in the web page to be implanted; generating a new background image corresponding to the loadable container, and implanting the target watermark into the new background image to obtain a watermark background image; adjusting the color of the original background of the loadable container to obtain a reverse background, so as to obtain a watermarked web page based on the reverse background and the watermark background image.

[0076] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0077] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0078] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for embedding a watermark in a web page, characterized in that: include: Determine a loadable container from multiple containers based on the target watermark and container style information of each container to be embedded in the webpage; Generate a new background image corresponding to the load-bearing container, and implant the target watermark into the new background image to obtain a watermark background image; The original background of the carrying container is color-adjusted to obtain a reverse background, so as to obtain a webpage containing a watermark based on the reverse background and the watermark background image.

2. The method for embedding a watermark in a web page according to claim 1, characterized in that: The color adjustment of the original background of the load-bearing container to obtain a reverse background, and obtaining a webpage containing a watermark based on the reverse background and the watermark background image, comprises: In the case that the original background does not have color adjustment, color adjustment is performed on the original background to obtain a reverse background; The watermark background image is displayed on the reverse background to obtain the watermarked web page; the watermark background image is carried based on the segmentation element.

3. The method for embedding a watermark in a web page according to claim 2, characterized in that: The step of displaying the watermark background image on the reverse background to obtain the watermarked webpage includes: Implanting the target watermark into the page image to be implanted in the webpage to obtain a watermark page image; The watermark background image and the watermark page image are displayed on the reverse background to obtain the watermarked web page.

4. The method for embedding a watermark in a web page according to claim 3, characterized in that: The step of implanting the target watermark into the page image to be implanted into the webpage to obtain the watermark page image comprises: Based on the corresponding minimum bearing image sizes of the page image and the target watermark, obtaining image size comparison results of each side of the page image; Based on the image size comparison results of each edge, the page image is resized to obtain an adjusted page image; The target watermark is implanted into the adjustment page image to obtain the watermark page image.

5. The method for embedding a watermark in a web page according to any one of claims 1 to 4, characterized in that: The step of determining a loadable container from a plurality of containers based on the target watermark and the container style information of each container to be embedded in the webpage includes: Comparing the minimum bearing image size corresponding to the target watermark with the container size in the container style information of each container to obtain a container size comparison result of each side of each container; The load-bearing container is determined from the plurality of containers based on the comparison results of the container sizes of the respective sides.

6. The method for embedding a watermark in a web page according to claim 5, characterized in that: The step of determining the load-bearing container from the plurality of containers based on the container size comparison results of the respective sides includes: When the comparison result of the container sizes of the respective edges is greater than the minimum image-bearing size, determining a candidate container from the plurality of containers; Determine the load-bearing container from the candidate containers based on a random selection algorithm; The number of the load-bearing containers is multiple.

7. A watermark embedding device for a web page, characterized in that: include: Selecting a container unit, and determining a loadable container from a plurality of containers based on the target watermark and container style information of each container to be embedded in the web page; A watermark embedding unit generates a new background image corresponding to the loadable container, and implants the target watermark into the new background image to obtain a watermark background image; The anti-tampering unit adjusts the color of the original background of the load-bearing container to obtain a reverse background, so as to obtain a watermarked web page based on the reverse background and the watermark background image.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the method for embedding a watermark in a web page as claimed in any one of claims 1 to 6 is implemented.

9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the watermark embedding method for a web page as claimed in any one of claims 1 to 6 is implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the watermark embedding method for a web page as claimed in any one of claims 1 to 6 is implemented.

Citation Information

Cited By

  • Page watermark generation method and device, electronic equipment, storage medium and program product

    CN119919271A

  • Page watermark generation method, device, electronic device, storage medium and program product

    CN119919271B