Watermark embedding and extracting method and device, equipment, storage medium and product

By converting the watermark into a completely opaque masked watermark and adding it to the display page of the carrier object in the form of a floating picture, the problem of occluding the content of the carrier object by the watermark is solved, and the readability of the display content is improved.

CN119444543APending Publication Date: 2025-02-14中移信息技术有限公司 +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411571265.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-05
Publication Date
2025-02-14

AI Technical Summary

Technical Problem

The display content of the display page of the carrier object is low, mainly due to the occlusion of the content of the carrier object by the watermark, which causes the visual effect to be disturbed.

Method used

By generating a pure transparent mask template image of the carrier object to be embedded in the target watermark, embed the target watermark into the pure transparent mask template image, obtain a completely opaque mask watermark and add it to the carrier object as a floating picture. display multiple areas to be embedded in the page.

Benefits of technology

The concealment and uniform distribution of watermarks are achieved, and the watermarks are avoided from obstructing the content of the carrier object, thereby improving the readability of the display content of the display page of the carrier object.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119444543A_ABST
    Figure CN119444543A_ABST
Patent Text Reader

Abstract

The invention discloses a watermark embedding and extracting method and device, equipment, a storage medium and a product, relates to the technical field of digital watermarking, and discloses a watermark extracting method which comprises the following steps: generating a pure transparent mask template image of a carrier object to be embedded with a target watermark; embedding the target watermark into the pure transparent mask layer template image to obtain a completely non-transparent mask layer watermark; dividing the display page of the carrier object into a plurality of to-be-embedded areas, and adding the completely non-transparent mask watermark to each to-be-embedded area in the form of a floating picture, thereby solving the problem of low readability of the display content of the display page of the carrier object. The present invention improves readability of display content of a display page of a carrier object.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of digital watermark technology, and in particular to watermark embedding and extraction methods, devices, equipment, storage media and products. Background Art

[0002] With the rapid development of the digital age, the easy duplication and dissemination of carrier objects such as web pages, multimedia, documents, software, etc. have also brought serious security risks, such as unauthorized copying, tampering and illegal dissemination. In order to protect the copyright and security of carrier objects, effective measures need to be taken to prevent the carrier objects from being illegally used.

[0003] Watermark is a technology that adds identification information to the carrier object, which is used to protect the copyright of the carrier object, ensure the authenticity of the carrier object and improve the security of the carrier object. The watermark can be information in the form of text, picture, QR code, etc., which is embedded in each page or specific location of the carrier object, so that the carrier object can be identified and tracked when it is copied, printed or disseminated.

[0004] In the related art, a watermark is selected or created, inserted into a carrier object, and the position, size, and transparency of the watermark are adjusted according to actual needs. Since a watermark is generally added to a carrier object in the form of a clear watermark, the watermark blocks the content of the carrier object, which interferes with the visual effect of the carrier object to a certain extent, resulting in reduced readability of the displayed content of the display page of the carrier object. Summary of the invention

[0005] The main purpose of the present application is to provide a watermark embedding and extraction method, device, equipment, storage medium and product, aiming to solve the problem of low readability of displayed content of a display page of a carrier object.

[0006] To achieve the above purpose, the present application proposes a watermark embedding method, which includes:

[0007] Generate a pure transparent mask template image of a carrier object to be embedded with a target watermark;

[0008] Embedding the target watermark into the pure transparent mask template image to obtain a completely opaque mask watermark;

[0009] The display page of the carrier object is divided into a plurality of areas to be embedded, and the completely opaque mask watermark is added to each of the areas to be embedded in the form of a floating picture.

[0010] In one embodiment, the step of dividing the display page of the carrier object into a plurality of to-be-embedded areas, and adding the completely opaque mask watermark in the form of a floating picture to each of the to-be-embedded areas comprises:

[0011] Obtaining the page size of the display page of the carrier object;

[0012] According to the page size, dividing the displayed page into a plurality of to-be-embedded areas of the same size;

[0013] The completely opaque mask watermark is added to each of the to-be-embedded areas in the form of a floating picture.

[0014] In one embodiment, the step of generating a pure transparent mask template image of a carrier object to be embedded with a target watermark comprises:

[0015] generating an image having the same page size as the display page of the carrier object;

[0016] The channel values ​​of the R channel, the G channel and the B channel of the image are all set to 255, and the channel value of the Alpha channel of the image is set to 0, so as to obtain the pure transparent mask template image.

[0017] In one embodiment, the step of embedding the target watermark into the pure transparent mask template image to obtain a completely opaque mask watermark includes:

[0018] Converting the pure transparent mask template image into a pure transparent canvas;

[0019] Determine the watermark size according to the target watermark size and the pure transparent mask template image size;

[0020] Embedding the target watermark into a pure transparent canvas based on the watermark size;

[0021] The filling color of the watermark in the pure transparent canvas is set to obtain the completely opaque mask watermark.

[0022] In one embodiment, the step of setting the filling color of the watermark in the pure transparent canvas to obtain the completely opaque mask watermark includes:

[0023] The channel values ​​of the watermark in the pure transparent canvas in the R channel, the G channel and the B channel are all set to 0, and the channel value of the Alpha channel is set to 1, so as to obtain the completely opaque mask watermark.

[0024] In addition, to achieve the above purpose, the present application also proposes a watermark extraction method, comprising:

[0025] Taking a screenshot of the carrier object to which the target watermark has been added, to obtain a screenshot image, wherein the carrier object to which the target watermark has been added is obtained by the watermark embedding method described above;

[0026] Determine a pixel difference between an original pixel value and a reference pixel value of each pixel point in the screenshot image, and enlarge the pixel difference;

[0027] The original pixel value is updated by using the enlarged pixel difference value to obtain the target watermark in the screenshot image.

[0028] In one embodiment, the step of determining a pixel difference between an original pixel value and a reference pixel value of each pixel point in the screenshot image and expanding the pixel difference comprises:

[0029] Converting the screenshot image into a grayscale image;

[0030] Performing a scaling operation on the grayscale image to obtain a scaled grayscale image;

[0031] Determine a pixel difference between an original pixel value and a reference pixel value of each pixel in the grayscale image;

[0032] The pixel difference is enlarged to obtain an enlarged pixel difference.

[0033] In one embodiment, the step of expanding the pixel difference to obtain the expanded pixel difference includes:

[0034] Determine the pixel difference magnification factor;

[0035] The enlarged pixel difference is obtained according to the product of the difference enlargement factor and the pixel difference.

[0036] In addition, to achieve the above purpose, the present application also proposes a watermark embedding device, comprising:

[0037] A generating module, used for generating a pure transparent mask template image of a carrier object to be embedded with a target watermark;

[0038] An embedding module, used for embedding the target watermark into the pure transparent mask template image to obtain a completely opaque mask watermark;

[0039] The adding module is used to divide the display page of the carrier object into a plurality of areas to be embedded, and add the completely opaque mask watermark to each of the areas to be embedded in the form of a floating picture.

[0040] In addition, to achieve the above purpose, the present application also proposes a watermark extraction device, comprising:

[0041] A screenshot module is used to take a screenshot of the carrier object to which the target watermark has been added to obtain a screenshot image;

[0042] An enlargement module, used to determine a pixel difference between an original pixel value and a reference pixel value of each pixel point in the screenshot image, and to enlarge the pixel difference;

[0043] The extraction module is used to update the original pixel value with the enlarged pixel difference value to obtain the target watermark in the screenshot image.

[0044] In addition, to achieve the above-mentioned purpose, the present application also proposes an electronic device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the watermark embedding method described above, or the computer program is configured to implement the steps of the watermark extraction method described above.

[0045] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the watermark embedding method described above are implemented, or when the computer program is executed by a processor, the steps of the watermark extraction method described above are implemented.

[0046] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, it implements the steps of the watermark embedding method described above, or when the computer program is executed by a processor, it implements the steps of the watermark extraction method described above.

[0047] Compared with the related art, the present application generates a pure transparent mask template image of a carrier object to be embedded with a target watermark; embeds the target watermark into the pure transparent mask template image to obtain a completely opaque mask watermark; divides the display page of the carrier object into multiple areas to be embedded, and adds the completely opaque mask watermark in the form of a floating picture to each of the areas to be embedded, thereby achieving the effect of watermark embedding. The watermark embedding method adopted in the present application converts the target watermark into a completely opaque mask watermark, that is, obtains a dark watermark, which is almost invisible and does not block the content of the display page of the carrier object. The completely opaque mask watermark is added to each area to be embedded in the form of a picture through area division and gridding processing, which can ensure the uniform distribution and concealment of the dark watermark in the display page of the carrier object, thereby improving the readability of the displayed content of the display page of the carrier object. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0049] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0050] Figure 1 A schematic diagram of a flow chart of the first embodiment of the watermark embedding method of the present application;

[0051] Figure 2 A detailed flow chart of the first embodiment of the watermark embedding method of the present application is provided;

[0052] Figure 3 A schematic diagram of a flow chart provided for the second embodiment of the watermark embedding method of the present application;

[0053] Figure 4 A screenshot of the document after the watermark is embedded in this application;

[0054] Figure 5 This is a schematic diagram of the effect of extracting watermarks using the watermark extraction algorithm of this application;

[0055] Figure 6 This is a schematic diagram of the module structure of the watermark embedding device of this application;

[0056] Figure 7 This is a schematic diagram of the module structure of the watermark extraction device of this application;

[0057] Figure 8 This is a schematic diagram of the structure of the electronic device of this application.

[0058] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0059] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.

[0060] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.

[0061] In the related art, a watermark is selected or created, inserted into a carrier object, and the position, size, and transparency of the watermark are adjusted according to actual needs. Since a watermark is generally added to a carrier object in the form of a clear watermark, the watermark blocks the content of the carrier object, which interferes with the visual effect of the carrier object to a certain extent, resulting in reduced readability of the displayed content of the display page of the carrier object.

[0062] In response to the above problems, the present application proposes a watermark embedding method, the main technical scheme of which includes: generating a pure transparent mask template image of a carrier object to be embedded with a target watermark; embedding the target watermark into the pure transparent mask template image to obtain a completely opaque mask watermark; dividing the display page of the carrier object into a plurality of areas to be embedded, and adding the completely opaque mask watermark in the form of a floating picture to each of the areas to be embedded. The watermark embedding method adopted in the present application converts the target watermark into a completely opaque mask watermark, that is, obtains a dark watermark, which is almost invisible and does not block the content of the display page of the carrier object. The completely opaque mask watermark is added to each area to be embedded in the form of a picture through area division and gridding processing, which can ensure the uniform distribution and concealment of the dark watermark in the display page of the carrier object, thereby improving the readability of the displayed content of the display page of the carrier object.

[0063] In addition, the present application sets a pure transparent mask template image. The use of a pure transparent mask template image means that the watermark can be superimposed on any background without being affected by the background color, so that the embedded watermark does not block the content displayed by the carrier object itself, thereby improving the visual effect of the content displayed by the carrier object.

[0064] In addition, the target watermark is embedded in the pure transparent mask template image, and the filling color of the target watermark is set to obtain a completely opaque mask watermark. By using pixel value difference technology to add the target watermark to the carrier object, a dark watermark with low human perception can be added to the carrier object quickly and efficiently, effectively improving the security of the carrier object while minimizing the impact on the appearance of the carrier object.

[0065] It should be noted that the execution subject of this embodiment may be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, etc. The following takes an electronic device as an example to illustrate this embodiment and the following embodiments.

[0066] Based on this, the present application embodiment provides a watermark embedding method, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the watermark embedding method of the present application.

[0067] In this embodiment, the watermark embedding method includes steps S10 to S30:

[0068] Step S10, generating a pure transparent mask template image of a carrier object to be embedded with a target watermark;

[0069] It should be noted that the target watermark refers to the identification information to be embedded in the carrier object. Watermarking is a technology that adds identification information to the carrier object to protect the copyright of the carrier object, ensure the authenticity of the carrier object and improve the security of the carrier object. The watermark can be information in the form of text, pictures, QR codes, etc., which are embedded in each page or specific location of the carrier object. This enables the carrier object to be identified and tracked when it is copied, printed or disseminated. The target watermark can be the company name of a company, or the employee number or other identification information of an employee. For example, the user account information for logging into the system containing the carrier object is obtained as the target watermark; the target watermark can also include the time when the user logged into the system. For another example, the user account information for accessing a web page is obtained as the target watermark, and the target watermark can also include any of the following information: user access time, device information used by the user to access the web page, and address information.

[0070] It should be noted that the carrier object refers to the object in which the watermark information needs to be embedded. The carrier object can be a digital carrier, such as a web page, multimedia, document, software, etc. When the carrier object is a document application scenario, it includes Word documents, PDF documents, PPT documents, etc. When the carrier object is a software application scenario, it includes chat software. The carrier object can also be other objects with a solid color background to facilitate watermark embedding. This application takes the carrier object as a Word document as an example.

[0071] In a feasible implementation, obtaining the carrier object to be embedded with the target watermark includes: using a Word document processing library to read a Word document stored on a hard disk. Alternatively, downloading the Word document from the network through an HTTP request. Alternatively, allowing a user to select or input a path of a Word document through a graphical user interface, thereby obtaining the carrier object to be embedded with the target watermark.

[0072] It should be noted that the pure transparent mask template image is usually a binary image or mask of the same size as the carrier object, which is used to define the area where the watermark is embedded. The pure transparent mask template image can be completely black, that is, all pixel values ​​are 0, indicating an area where no watermark is embedded, or it can be an image containing white or a specific color area, that is, an area where a watermark is embedded.

[0073] In a feasible implementation, generating a pure transparent mask template image of a carrier object to be embedded with a target watermark includes: manually drawing the pure transparent mask template image using image editing software. Alternatively, automatically generating the pure transparent mask template image based on the characteristics of the carrier object such as edge detection, specific color area detection, etc.

[0074] In another feasible implementation, generating a pure transparent mask template image of a carrier object to be embedded with a target watermark may also be: parsing the carrier object to obtain the size information of the carrier object, and then generating a pure transparent mask template image of the carrier object according to the size information of the carrier object. The size information of the carrier object may be the height and width of the current display page of the carrier object, and generating a pure transparent mask template image that is consistent with the height and width.

[0075] In another feasible implementation, generating a pure transparent mask template image of a carrier object to be embedded with a target watermark may also be: generating an image with the same page size as the display page of the carrier object, setting the channel values ​​of the color channel and the transparency channel of the carrier object to be embedded with the target watermark, and obtaining a pure transparent mask template image.

[0076] The pure transparent mask template image may include four channels, namely, R channel, G channel, B channel and Alpha channel, wherein the R channel, G channel and B channel are all color channels, and the Alpha channel is a channel indicating transparency.

[0077] In another feasible implementation, generating a pure transparent mask template image of a carrier object to be embedded with a target watermark may also be: generating an image with the same page size as the display page of the carrier object; setting the channel values ​​of the R channel, G channel and B channel of the image to 255, and setting the channel value of the Alpha channel of the image to 0, to obtain the pure transparent mask template image.

[0078] The R channel mentioned above is the red channel. When the channel value of the R channel is set to 255, it means that the highest color intensity is reached on the red channel. The range of the red channel is 0 to 255, and 255 represents the maximum value of the red component. The G channel mentioned above is the green channel. When the channel value of the G channel is set to 255, it means that the highest color intensity is also reached on the green channel. The range of the green channel is also 0 to 255, and 255 represents the maximum value of the green component. The B channel mentioned above is the blue channel. When the channel value of the B channel is set to 255, it means that the highest color intensity is also reached on the blue channel. The range of the blue channel is 0 to 255, and 255 represents that the highest color intensity is also reached on the blue channel. Since the values ​​of the three channels of R, G, and B are all 255, this color is represented as white in the RGB color space. White is one of the pure colors in the RGB color space, which is a mixture of equal amounts of red, green, and blue light. When the channel value of the Alpha channel is set to 1, it means that this color is completely opaque. In image processing, the alpha channel is used to represent the transparency of an image, ranging from 0 to 1, or 0 to 255, depending on the bit depth of the image, with 0 representing full transparency and 1 or 255 representing full opacity. (255, 255, 255, 1) represents a fully opaque white.

[0079] This embodiment obtains a purely transparent mask template image by setting the channel values ​​of each channel of the mask template. The use of a purely transparent mask template image means that the watermark can be superimposed on any background without being affected by the background color, so that the embedded watermark does not block the content displayed by the carrier object itself, thereby improving the visual effect of the content displayed by the carrier object.

[0080] Step S20, embedding the target watermark into the pure transparent mask template image to obtain a completely opaque mask watermark;

[0081] It should be noted that the mask watermark refers to a mask template containing the target watermark. A completely opaque mask watermark achieves the effect of a dark watermark.

[0082] In a feasible implementation, the pure transparent mask template image can be converted into a pure transparent canvas, the target watermark can be directly embedded in the pure transparent canvas, and the filling color of the target watermark can be set to obtain a completely opaque mask watermark.

[0083] In another feasible implementation, the pure transparent mask template image can be converted into a pure transparent canvas, the target watermark can be directly embedded in the pure transparent canvas, and the channel values ​​of the target watermark in the R channel, G channel and B channel are set to 0, and the channel value in the Alpha channel is set to 1, so as to obtain the completely opaque mask watermark.

[0084] In another possible implementation, referring to Figure 2 , step S20 comprises:

[0085] Step S21, converting the pure transparent mask template image into a pure transparent canvas;

[0086] It should be noted that a pure transparent canvas refers to an image container or image element that can be used to draw graphics or images that can be embedded in a carrier object. For example, the Canvas in the HTML language can be used to draw images on a web page. By controlling the pixels of the Canvas, graphics or images can be drawn, including strings, to facilitate the subsequent embedding of watermarks. The size of the pure transparent canvas created here can be the same as the size of the target watermark.

[0087] Step S22, determining the watermark size according to the target watermark size and the pure transparent mask template image size;

[0088] It should be noted that the target watermark size refers to the size of the target watermark, and the pure transparent mask template image size refers to the size of the pure transparent mask template image. The pure transparent mask template image size can be determined according to the page size of the display page of the carrier object. The watermark size refers to the watermark size obtained by adapting the target watermark size and the pure transparent mask template image size, that is, the watermark size of the present application can be adaptively adjusted to adapt to the pure transparent mask template image size.

[0089] Step S23, embedding the target watermark into a pure transparent canvas based on the watermark size;

[0090] Embed a resized, targeted watermark into a pure transparent canvas.

[0091] Step S24, setting the filling color of the watermark in the pure transparent canvas to obtain the completely opaque mask watermark.

[0092] It should be noted that the filling color of the watermark is obtained by setting the channel values ​​of the color channel and the transparency channel. The target watermark can be directly embedded in a pure transparent canvas, and the channel values ​​of the target watermark in the color channel and the channel used to represent transparency can be set to obtain a completely opaque mask watermark.

[0093] The above-mentioned channels include four channels, namely R channel, G channel, B channel and Alpha channel, that is, the filling color of the above-mentioned watermark is (R, G, B, Alpha). Among them, the R channel, G channel and B channel are all color channels, and the Alpha channel is a channel indicating transparency. The channel values ​​of the watermark in each grid can be set to 0 in the R channel, G channel and B channel, and the channel value in the Alpha channel can be set to 1, so as to obtain a completely opaque mask watermark.

[0094] The R channel mentioned above is the red channel. When the channel value of the R channel is set to 0, it means that there is no color intensity on the red channel. The range of the red channel is 0 to 255, and 0 represents no red component at all. The G channel mentioned above is the green channel. When the channel value of the G channel is set to 0, it means that there is no color intensity on the green channel. The range of the green channel is also 0 to 255, and 0 represents no green component at all. The B channel mentioned above is the blue channel. When the channel value of the B channel is set to 0, it means that there is no color intensity on the blue channel. The range of the blue channel is 0 to 255, and 0 represents no blue component at all. Since the values ​​of the three channels of R, G, and B are all 0, this color is represented as black in the RGB color space. However, it should be noted that the black here is not completely opaque black, because there is also an Alpha channel value to consider. When the channel value of the Alpha channel is 1, it means that this color is completely opaque. The channel value of the Alpha channel ranges from 0 to 1, or 0 to 255. 0 represents complete transparency, while 1 or 255 represents complete opacity.

[0095] The fill color of the watermark is (0, 0, 0, 1), which means a completely opaque black. This color is usually used to embed invisible watermark information in an image because black does not visually interfere with the content of the original image. At the same time, the opacity value of the Alpha channel ensures that the embedding of the watermark information does not affect the overall visual effect of the image, thereby achieving the hidden effect of the watermark and improving the security of the carrier object.

[0096] In this embodiment, the purely transparent mask template image is converted into a purely transparent canvas; the watermark size is determined according to the target watermark size and the purely transparent mask template image size; the target watermark is embedded into the purely transparent canvas based on the watermark size; the filling color of the watermark in the purely transparent canvas is set to obtain the completely opaque mask watermark, thereby achieving the effect of embedding the target watermark in the purely transparent canvas, and because the mask watermark is completely opaque, it is ensured that the embedding of the watermark information will not affect the overall visual effect of the image, thereby achieving the watermark hiding effect and improving the security of the carrier object.

[0097] In another feasible implementation, step S20 includes: converting the pure transparent mask template image into a pure transparent canvas; dividing the pure transparent canvas into a preset number of grids based on a preset grid size; determining the watermark size of each grid according to the target watermark size and the preset grid size; embedding the target watermark into each grid in turn based on the watermark size of each grid; setting the fill color of the watermark in each grid to obtain the completely opaque mask watermark.

[0098] It should be noted that the preset grid size can be set according to actual conditions, for example, it can be set according to the size of the pure transparent canvas and / or the size of the target watermark, wherein the larger the size of the transparent canvas, the larger the preset grid size is set, and the larger the size of the target watermark, the larger the preset grid size is set. For example, the generated pure transparent canvas can be divided into m rows and n columns to form m*n grids of the same size, where m and n can be user-defined. Of course, the pure transparent canvas can also be divided into multiple grids of inconsistent sizes.

[0099] It should be noted that the preset number can also be set according to actual conditions, for example, according to the size of the transparent canvas and / or the size of the target watermark, wherein, when the size of the transparent canvas is larger, the number of preset grids set is more, and when the size of the target watermark is larger, the number of preset grids set is more, thereby achieving adaptive grid division.

[0100] It should be noted that one target watermark can be set for each grid, or, when the target watermark is large, multiple grids are required to embed one target watermark.

[0101] It should be noted that the watermark size of each grid refers to the size of the watermark that each grid can accommodate. The size of the watermark that each grid can accommodate is different, which requires considering the type of watermark and the overlapping part of the watermark and the grid.

[0102] When setting a target watermark per grid, it is necessary to determine how many target watermarks or scaled versions of the target watermark can be accommodated under the preset grid size. Next, calculate the size to which the target watermark needs to be scaled to fit the grid. This usually involves calculating the ratio of the width and height of the watermark to the width and height of the grid unit, and choosing an appropriate scaling ratio, which should ensure that the watermark remains recognizable and clear after scaling. Next, using the calculated scaling ratio, scale the target watermark to the size of the grid unit, which can be achieved through the scaling function in the image processing library, such as Python's PIL or OpenCV library. Next, if the calculated watermark size does not exactly match the grid unit size, and this mismatch has a significant impact on the placement or visual effect of the watermark, it is necessary to adjust the grid size or the scaling ratio of the watermark to achieve the best effect. Finally, place the scaled watermark in the appropriate position in the grid, which may require considering the alignment, spacing between watermarks, and the boundaries of the grid. Make the target watermark automatically scaled based on the grid size.

[0103] When the target watermark is large, the maximum overlapping area between the watermark and the grid can be calculated, and then the watermark size of each grid can be determined based on the maximum overlapping area. In this case, each grid only embeds part of the watermark information of a target watermark, rather than the entire target watermark.

[0104] After determining the watermark size that each grid can accommodate, the target watermark is embedded into each grid in turn based on the watermark size of each grid.

[0105] In this embodiment, the pure transparent canvas is divided into a preset number of grids based on a preset grid size; the watermark size of each grid is determined according to the target watermark size and the preset grid size; the target watermark is embedded into each grid in turn based on the watermark size of each grid; the channel value of the watermark in each grid in each channel is set to obtain the completely opaque mask watermark, thereby achieving the effect of embedding the target watermark in the pure transparent canvas, and because the mask watermark is completely opaque, it is ensured that the embedding of the watermark information will not affect the overall visual effect of the image, thereby achieving the watermark hiding effect and improving the security of the carrier object.

[0106] Step S30, dividing the display page of the carrier object into a plurality of areas to be embedded, and adding the completely opaque mask watermark in the form of a floating picture to each of the areas to be embedded.

[0107] After obtaining the completely opaque mask watermark, the display page of the carrier object is divided into a plurality of areas to be embedded, and the completely opaque mask watermark is added to each area to be embedded in the form of a floating picture to obtain the watermark embedding effect.

[0108] In a feasible implementation, the page size of the display page of the carrier object can be obtained; based on the page size, the display page is divided into a plurality of areas to be embedded of the same size; and the completely opaque mask watermark is added to each of the areas to be embedded in the form of a floating image.

[0109] It should be noted that the watermark is treated as an independent image element, rather than being directly integrated or embedded with the content of the carrier object. Floating images usually mean that the watermark can be freely moved and positioned on the page without being restricted by the layout of the carrier object content.

[0110] It should be noted that each display page is divided into multiple areas to be embedded. The size of each area to be embedded can be consistent or adjusted according to actual conditions. For example, the display page can be divided into m rows and n columns to form m*n grids of the same size. m and n can be customized by the user, and each grid represents an area to be embedded.

[0111] In another feasible implementation, each display page associated with the carrier object can be obtained; each display page is divided into multiple areas to be embedded, and a completely opaque mask watermark is added in the form of a floating image to each area to be embedded after each display page of the carrier object is divided.

[0112] For example, obtain the initial Word document to be embedded with the target watermark. Call the Document method of the python-docx library to parse the initial Word document to obtain the word file object target_doc. Get the page object of the initial Word document through target_doc.sections[0], and then get the width width and height height of the display page of the initial Word document through section.page_width and section.page_height; then, generate a mask template mask with specified width and height dimensions, so as to achieve the purpose of generating a mask template for the carrier object. The size of the pure transparent mask template image used in this application is height = 80, width = 800, and its essence is a 4-channel picture, and the 4 channels are R channel, G channel, B channel and Alpha channel; the channel values ​​of the R channel, G channel, and B channel are all set to 255, and the channel value of the Alpha channel is set to 0, indicating a pure transparent mask template image.

[0113] The pure transparent mask template image is converted to a canvas through the ImageDraw.Draw(mask) method, and the canvas handle is output as draw_mask. According to the target watermark size and the pure transparent mask template image size, the watermark size is determined; the target watermark is embedded into the pure transparent canvas based on the watermark size; the fill color of the watermark in the pure transparent canvas is set to obtain a completely opaque mask watermark. Among them, the fill color of the watermark is (0, 0, 0, 1), which represents the channel values ​​of the R channel, G channel, B channel and Alpha channel respectively, thereby generating a completely opaque mask watermark watermark_mask.

[0114] In order to implement the method of adding a floating image to the display page of the initial Word document, the floating image needs to be placed under the text. This application is based on the python-docx library coding implementation:

[0115] Get the word file object target_doc and the completely opaque mask watermark watermark_mask, and use the word document processing technology to cover the completely opaque mask watermark watermark_mask to each display page of the word file object target_doc. According to the width width and height height of the display page of the initial Word document, divide the display page of the initial Word document into m rows and n columns to form m*n grids of the same size. m and n can be customized by the user. Add the generated completely opaque mask watermark watermark_mask to each divided grid in turn by adding a floating image. Until each display page of the word file object target_doc is processed, the target watermark is embedded successfully. After the target watermark is successfully embedded, the carrier object with the target watermark added is output. There is no obvious difference in visual effect between the Word document embedded with the target watermark and the initial Word document, and the watermark information has low perception to the human eye.

[0116] In this embodiment, a pure transparent mask template image of a carrier object to be embedded with a target watermark is generated; the target watermark is embedded into the pure transparent mask template image to obtain a completely opaque mask watermark; the display page of the carrier object is divided into a plurality of areas to be embedded, and the completely opaque mask watermark is added to each of the areas to be embedded in the form of a floating picture, thereby achieving the effect of watermark embedding. The watermark embedding method adopted in the present application converts the target watermark into a completely opaque mask watermark, that is, a dark watermark is obtained. The dark watermark is almost invisible and does not block the content of the display page of the carrier object. The completely opaque mask watermark is added to each area to be embedded in the form of a picture through area division and gridding processing, which can ensure the uniform distribution and concealment of the dark watermark in the display page of the carrier object, thereby improving the readability of the displayed content of the display page of the carrier object.

[0117] Based on the same inventive concept, the present application embodiment provides a watermark extraction method, referring to Figure 3 , Figure 3 This is a flow chart of the first embodiment of the watermark extraction method of the present application.

[0118] In this embodiment, the watermark embedding method includes steps S110 to S130:

[0119] Step S110, taking a screenshot of the carrier object to which the target watermark has been added, to obtain a screenshot image;

[0120] It should be noted that the target watermark refers to the identification information to be embedded in the carrier object. Watermarking is a technology that adds identification information to the carrier object to protect the copyright of the carrier object, ensure the authenticity of the carrier object and improve the security of the carrier object. The watermark can be information in the form of text, pictures, QR codes, etc., which are embedded in each page or specific location of the carrier object. This enables the carrier object to be identified and tracked when it is copied, printed or disseminated. The target watermark can be the company name of a company, or the employee number or other identification information of an employee. For example, the user account information for logging into the system containing the carrier object is obtained as the target watermark; the target watermark can also include the time when the user logged into the system. For another example, the user account information for accessing a web page is obtained as the target watermark, and the target watermark can also include any of the following information: user access time, device information used by the user to access the web page, and address information.

[0121] It should be noted that the carrier object refers to the object in which the watermark information needs to be embedded. The carrier object can be a digital carrier, such as a web page, multimedia, document, software, etc. When the carrier object is a document application scenario, it includes Word documents, PDF documents, PPT documents, etc. When the carrier object is a software application scenario, it includes chat software. The carrier object can also be other objects with a solid color background to facilitate watermark embedding. This application takes the carrier object as a Word document as an example.

[0122] The target watermark can be embedded into the carrier object based on the watermark embedding method described above to obtain the carrier object to which the target watermark has been added. The watermark embedding method refers to the above embodiment and will not be described in detail here.

[0123] It should be noted that a screenshot can be taken at any position of the carrier object with the target watermark added thereto to obtain a screenshot image, and the screenshot image here can be one or more.

[0124] Step S120, determining a pixel difference between an original pixel value and a reference pixel value of each pixel point in the screenshot image, and enlarging the pixel difference;

[0125] It should be noted that the screenshot image includes a watermark area and a non-watermark area. There are multiple pixels in both the watermark area and the non-watermark area. Each pixel has a corresponding pixel value, and the pixel values ​​of the pixels in the watermark area and the non-watermark area are different.

[0126] It should be noted that the purpose of expanding the pixel difference is to identify the target watermark in the carrier object so as to be able to identify and track the source of the leakage and effectively improve the security of the carrier object.

[0127] It should be noted that the reference pixel value can be set according to actual conditions, for example, set to 255.

[0128] It should be noted that the pixel difference value represents the brightness change of each pixel relative to the reference pixel value.

[0129] In a feasible implementation manner, the pixel difference between the watermark area and the non-watermark area may be determined, and the pixel difference may be expanded to obtain an expanded pixel difference.

[0130] In another feasible implementation, a pixel difference magnification factor may be determined, and the enlarged pixel difference may be obtained by multiplying the difference magnification factor and the pixel difference.

[0131] In another feasible implementation, the screenshot image can also be converted into a grayscale image; the grayscale image can be scaled to obtain a scaled grayscale image; the pixel difference between the original pixel value and the reference pixel value of each pixel point in the grayscale image can be determined; and the pixel difference can be expanded to obtain an expanded pixel difference.

[0132] It should be noted that the screenshot image may contain three color channels of red, green and blue, that is, a color image, which can be converted into a grayscale image by, for example, weighted averaging. A grayscale image is an image with only one color channel, and its pixel value usually represents brightness, ranging from 0 to 255.

[0133] It should be noted that in order to further speed up the watermark extraction efficiency, some preprocessing of the grayscale image is required. For example, to avoid large calculation amount due to large image size, the grayscale image needs to be scaled to change its size. For example, an interpolation algorithm can be used to scale the grayscale image to obtain a scaled grayscale image.

[0134] In a feasible implementation, the pixel difference between the original pixel value and the reference pixel value of each pixel point in the grayscale image can be determined, and the pixel difference magnification factor can be determined; the enlarged pixel difference can be obtained based on the product of the difference magnification factor and the pixel difference.

[0135] It should be noted that the pixel difference magnification factor here can be customized according to the actual situation. Enlarging the pixel difference can enhance the contrast in the image or highlight certain features. For example, if the base pixel value is selected as the average brightness of the image, the enlarged pixel difference will make the bright and dark areas in the image more distinct.

[0136] For example, the document screenshot image after embedding the watermark is as follows: Figure 4 As shown, the schematic diagram of the effect of watermark extraction algorithm extracting watermark is as follows Figure 5 shown.

[0137] In this embodiment, the watermark information in the carrier object screenshot can be successfully extracted through the pixel difference technology, and the source of the leakage can be identified and tracked, effectively improving the security of the carrier object.

[0138] This application also provides a watermark embedding device, please refer to Figure 6 , the watermark embedding device comprises:

[0139] A generating module 10, used for generating a pure transparent mask template image of a carrier object to be embedded with a target watermark;

[0140] An embedding module 20, used for embedding the target watermark into the pure transparent mask template image to obtain a completely opaque mask watermark;

[0141] The adding module 30 is used to divide the display page of the carrier object into a plurality of areas to be embedded, and add the completely opaque mask watermark to each of the areas to be embedded, wherein the completely opaque mask watermark is added to the display page in the form of a floating picture.

[0142] Optionally, the adding module 30 is also used to obtain the page size of the display page of the carrier object; divide the display page into multiple areas to be embedded with the same size according to the page size; and add the completely opaque mask watermark to each of the areas to be embedded in the form of a floating image.

[0143] Optionally, the generation module 10 is also used to generate an image with the same page size as the display page of the carrier object; set the channel values ​​of the R channel, G channel and B channel of the image to 255, and set the channel value of the Alpha channel of the image to 0, so as to obtain the pure transparent mask template image.

[0144] Optionally, the embedding module 20 is also used to convert the pure transparent mask template image into a pure transparent canvas; determine the watermark size according to the target watermark size and the pure transparent mask template image size; embed the target watermark into the pure transparent canvas based on the watermark size; set the fill color of the watermark in the pure transparent canvas to obtain the completely opaque mask watermark.

[0145] Optionally, the embedding module 20 is further configured to set the channel values ​​of the watermark in the pure transparent canvas in the R channel, the G channel and the B channel to 0, and set the channel value of the Alpha channel to 1, so as to obtain the completely opaque mask watermark.

[0146] The watermark embedding device provided by the present application adopts the watermark embedding method in the above embodiment, which can solve the problem of low readability of the displayed content of the display page of the carrier object. Compared with the prior art, the beneficial effects of the watermark embedding device provided by the present application are the same as the beneficial effects of the watermark embedding method provided by the above embodiment, and other technical features in the watermark embedding device are the same as the features disclosed in the above embodiment method, which will not be repeated here.

[0147] Based on the same inventive concept, this application also provides a watermark extraction device, please refer to Figure 7 , the watermark extraction device comprises:

[0148] A screenshot module 30 is used to take a screenshot of the carrier object to which the target watermark has been added to obtain a screenshot image;

[0149] An enlargement module 40, used to determine a pixel difference between an original pixel value and a reference pixel value of each pixel point in the screenshot image, and to enlarge the pixel difference;

[0150] The extraction module 50 is used to update the original pixel value with the enlarged pixel difference value to obtain the target watermark in the screenshot image.

[0151] Optionally, the expansion module 40 is also used to convert the screenshot image into a grayscale image; scale the grayscale image to obtain a scaled grayscale image; determine the pixel difference between the original pixel value and the reference pixel value of each pixel point in the grayscale image; and expand the pixel difference to obtain an expanded pixel difference.

[0152] Optionally, the extraction module 50 is further configured to determine a pixel difference magnification factor; and obtain the enlarged pixel difference according to the product of the difference magnification factor and the pixel difference.

[0153] The watermark extraction device provided by the present application adopts the watermark extraction method in the above embodiment, which can improve the security of the carrier object. Compared with the prior art, the beneficial effects of the watermark extraction device provided by the present application are the same as the beneficial effects of the watermark extraction method provided by the above embodiment, and other technical features in the watermark extraction device are the same as the features disclosed in the above embodiment method, which will not be repeated here.

[0154] Based on the same inventive concept, the present application provides an electronic device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the watermark embedding method in the above-mentioned first embodiment or execute the watermark extraction method in the above-mentioned second embodiment.

[0155] Reference below Figure 8 , which shows a schematic diagram of the structure of an electronic device suitable for implementing the embodiments of the present application. The electronic devices in the embodiments of the present application may include but are not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 8 The electronic device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0156] like Figure 8 As shown, the electronic device may include a processing device 1001 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the electronic device are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows an electronic device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have alternatively.

[0157] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.

[0158] The electronic device provided by the present application adopts the watermark embedding method in the above embodiment, which can improve the readability of the displayed content of the display page of the carrier object. Compared with the prior art, the beneficial effects of the electronic device provided by the present application are the same as the beneficial effects of the watermark embedding method provided by the above embodiment, and other technical features in the electronic device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.

[0159] Alternatively, the electronic device provided by the present application can improve the security of the carrier object by using the watermark extraction method in the above embodiment. Compared with the prior art, the beneficial effects of the electronic device provided by the present application are the same as the beneficial effects of the watermark extraction method provided by the above embodiment, and the other technical features in the electronic device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.

[0160] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0161] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0162] Based on the same inventive concept, the present application provides a computer-readable storage medium having computer-readable program instructions, i.e., a computer program, stored thereon, the computer-readable program instructions being used to execute the watermark embedding method in the first embodiment or the watermark extraction method in the second embodiment.

[0163] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.

[0164] The computer-readable storage medium may be included in the electronic device, or may exist independently without being installed in the electronic device.

[0165] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by an electronic device, the electronic device generates a pure transparent mask template image of a carrier object to be embedded with a target watermark; embeds the target watermark into the pure transparent mask template image to obtain a completely opaque mask watermark; divides the display page of the carrier object into multiple areas to be embedded, and adds the completely opaque mask watermark to each of the areas to be embedded in the form of a floating picture. Alternatively, the electronic device takes a screenshot of the carrier object to which the target watermark has been added to obtain a screenshot image; determines the pixel difference between the original pixel value and the reference pixel value of each pixel point in the screenshot image, and expands the pixel difference; updates the original pixel value using the expanded pixel difference to obtain the target watermark in the screenshot image.

[0166] Computer program code for performing the operations of the present application may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0167] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0168] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.

[0169] The readable storage medium provided by the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned watermark embedding method, and can improve the readability of the displayed content of the display page of the carrier object. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the present application are the same as the beneficial effects of the watermark embedding method provided by the above-mentioned embodiment, and will not be repeated here.

[0170] Alternatively, the readable storage medium provided by the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned watermark extraction method, and can improve the security of the carrier object. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the present application are the same as the beneficial effects of the watermark extraction method provided by the above-mentioned embodiment, and will not be repeated here.

[0171] Based on the same inventive concept, the present application also provides a computer program product, including a computer program, which implements the steps of the watermark embedding method as described above when executed by a processor. The computer program product provided by the present application can improve the readability of the displayed content of the display page of the carrier object. Compared with the prior art, the beneficial effects of the computer program product provided by the present application are the same as the beneficial effects of the watermark embedding method provided by the above embodiment, which will not be described in detail here.

[0172] Alternatively, when the computer program is executed by the processor, the steps of the watermark extraction method described above are implemented. The computer program product provided by the present application can improve the security of the carrier object. Compared with the prior art, the beneficial effects of the computer program product provided by the present application are the same as the beneficial effects of the watermark extraction method provided by the above embodiment, which will not be described in detail here.

[0173] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.

Claims

1. A watermark embedding method, characterized in that: The method comprises: Generate a pure transparent mask template image of a carrier object to be embedded with a target watermark; Embedding the target watermark into the pure transparent mask template image to obtain a completely opaque mask watermark; The display page of the carrier object is divided into a plurality of areas to be embedded, and the completely opaque mask watermark is added to each of the areas to be embedded in the form of a floating picture.

2. The method according to claim 1, characterized in that The step of dividing the display page of the carrier object into a plurality of to-be-embedded areas, and adding the completely opaque mask watermark in the form of a floating picture to each of the to-be-embedded areas comprises: Obtaining the page size of the display page of the carrier object; According to the page size, dividing the display page into a plurality of to-be-embedded areas of the same size; The completely opaque mask watermark is added to each of the to-be-embedded areas in the form of a floating picture.

3. The method according to claim 1, characterized in that The step of generating a pure transparent mask template image of a carrier object to be embedded with a target watermark comprises: generating an image having the same page size as the display page of the carrier object; The channel values ​​of the R channel, the G channel and the B channel of the image are all set to 255, and the channel value of the Alpha channel of the image is set to 0, so as to obtain the pure transparent mask template image.

4. The method according to claim 1 or 3, characterized in that The step of embedding the target watermark into the pure transparent mask template image to obtain a completely opaque mask watermark comprises: Converting the pure transparent mask template image into a pure transparent canvas; Determine the watermark size according to the target watermark size and the pure transparent mask template image size; Embedding the target watermark into a pure transparent canvas based on the watermark size; The filling color of the watermark in the pure transparent canvas is set to obtain the completely opaque mask watermark.

5. The method according to claim 4, characterized in that The step of setting the filling color of the watermark in the pure transparent canvas to obtain the completely opaque mask watermark comprises: The channel values ​​of the watermark in the pure transparent canvas in the R channel, the G channel and the B channel are all set to 0, and the channel value of the Alpha channel is set to 1, so as to obtain the completely opaque mask watermark.

6. A watermark extraction method, characterized in that: The method comprises: Taking a screenshot of the carrier object to which the target watermark has been added, to obtain a screenshot image, wherein the carrier object to which the target watermark has been added is obtained by the watermark embedding method according to any one of claims 1 to 5; Determine a pixel difference between an original pixel value and a reference pixel value of each pixel point in the screenshot image, and enlarge the pixel difference; The original pixel value is updated by using the enlarged pixel difference value to obtain the target watermark in the screenshot image.

7. The method according to claim 6, characterized in that The step of determining the pixel difference between the original pixel value and the reference pixel value of each pixel point in the screenshot image and expanding the pixel difference comprises: Converting the screenshot image into a grayscale image; Performing a scaling operation on the grayscale image to obtain a scaled grayscale image; Determine a pixel difference between an original pixel value and a reference pixel value of each pixel in the grayscale image; The pixel difference is enlarged to obtain an enlarged pixel difference.

8. The method according to claim 7, characterized in that The step of enlarging the pixel difference to obtain the enlarged pixel difference comprises: Determine the pixel difference magnification factor; The enlarged pixel difference is obtained according to the product of the difference enlargement factor and the pixel difference.

9. A watermark embedding device, characterized in that: The watermark embedding device comprises: A generating module, used for generating a pure transparent mask template image of a carrier object to be embedded with a target watermark; An embedding module, used for embedding the target watermark into the pure transparent mask template image to obtain a completely opaque mask watermark; The adding module is used to divide the display page of the carrier object into a plurality of areas to be embedded, and add the completely opaque mask watermark to each of the areas to be embedded in the form of a floating picture.

10. A watermark extraction device, characterized in that: The watermark extraction device comprises: A screenshot module is used to take a screenshot of the carrier object to which the target watermark has been added to obtain a screenshot image; An enlargement module, used to determine a pixel difference between an original pixel value and a reference pixel value of each pixel point in the screenshot image, and to enlarge the pixel difference; The extraction module is used to update the original pixel value with the enlarged pixel difference value to obtain the target watermark in the screenshot image.

11. An electronic device, characterized in that: The electronic device comprises: a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the watermark embedding method as described in any one of claims 1 to 5, or the computer program is configured to implement the steps of the watermark extraction method as described in any one of claims 6 to 8.

12. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the watermark embedding method as described in any one of claims 1 to 5 are implemented, or when the computer program is executed by a processor, the steps of the watermark extraction method as described in any one of claims 6 to 8 are implemented.

13. A computer program product, characterized in that The computer program product comprises a computer program, which implements the steps of the watermark embedding method according to any one of claims 1 to 5 when executed by a processor, or implements the steps of the watermark extraction method according to any one of claims 6 to 8 when executed by a processor.