Corpus-based watermarking method, device, equipment and medium

Through the watermark addition method based on corpus, the watermark location and configuration parameters are determined, and the effective protection of data privacy is achieved without affecting user reading, and the problem of watermark addition affecting the reading effect in the prior art is solved.

CN118657652BActive Publication Date: 2025-02-07ZHONGDIAN DATA IND CO LTD +1
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411131770.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-19
Publication Date
2025-02-07
Estimated Expiration
2044-08-19

AI Technical Summary

Technical Problem

When adding watermarks in the prior art, it is easy to affect the user's reading effect and cannot effectively protect data privacy without affecting the user's reading.

Method used

Using the corpus-based watermark addition method, we can determine the watermark position and current watermark element in the export image of the large model, obtain the watermark configuration parameters in the corpus, and determine and add watermarks based on these parameters to ensure that the watermark is only added to the required positions and elements. .

Benefits of technology

It realizes effective protection of data privacy without affecting the user's reading effect, improving the accuracy and effect of watermark addition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118657652B_ABST
    Figure CN118657652B_ABST
Patent Text Reader

Abstract

The present application discloses a corpus-based watermark adding method, device, equipment and medium, and relates to the field of image processing technology. The present application discloses a corpus-based watermark adding method, including: determining a large model export image in a first display page, and determining a watermark position to be watermarked in the large model export image, and a current watermark element at the watermark position; obtaining a watermark configuration parameter corresponding to the large model export image in a preset corpus; determining at least one first watermark according to the watermark configuration parameter and the watermark size of the current watermark element; adding the at least one first watermark to the current watermark element, obtaining a large model export image with the first watermark added, and outputting the large model export image with the first watermark added. The present application can improve the watermark adding effect, and protect data privacy without affecting the user's reading effect.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to a specific field of image processing technology, and in particular to a corpus-based watermarking method, device, equipment and medium. Background Art

[0002] In front-end development practice, you may encounter a scenario where you need to add watermarks to images when exporting them. For example, in the application of a large dialogue model, in order to protect data privacy, you need to add watermarks to the exported images. However, the current watermarking scheme has certain defects. For example, when adding watermarks to images based on the watermarks in the database, the entire page containing the image will be watermarked, which will affect the user's reading experience. Therefore, how to improve the effect of watermarking and protect data privacy without affecting the user's reading effect has become an urgent problem that needs to be solved.

[0003] The above contents are only used to assist in understanding the technical solution of the present application and do not constitute an admission that the above contents are prior art. Summary of the invention

[0004] The main purpose of this application is to provide a corpus-based watermarking method, device, equipment and medium, aiming to solve the technical problem of how to improve the watermarking effect and protect data privacy without affecting the user's reading effect.

[0005] To achieve the above purpose, the present application proposes a corpus-based watermarking method, which includes:

[0006] Determine a large model export image in a first display page, and determine a watermark position to be watermarked in the large model export image, and a current watermark element at the watermark position;

[0007] Obtaining watermark configuration parameters corresponding to the large model exported image in a preset corpus;

[0008] Determine at least one first watermark according to the watermark configuration parameters and the watermark size of the current watermark element;

[0009] The at least one first watermark is added to the current watermark element to obtain a large model derived image with the first watermark added thereto, and the large model derived image with the first watermark added thereto is output.

[0010] In one embodiment, the step of determining a watermark position to be watermarked in the large model derived image and a current watermark element at the watermark position comprises:

[0011] If a designated element instruction input by the user is received within the preset display time, determining whether the position specified by the designated element instruction is located in the image position area corresponding to the large model exported image in the first display page;

[0012] If it is located in the image position area, the position specified by the specified element instruction is determined to be the watermark position, and the image element at the watermark position is determined to be the current watermark element.

[0013] In one embodiment, the step of determining the watermark position to be watermarked in the large model derived image and the current watermark element at the watermark position further includes:

[0014] If the designated element instruction input by the user is not received within the preset display time, the image position area is determined to be the watermark position, and the image element at the watermark position is determined to be the current watermark element.

[0015] In one embodiment, the watermark configuration parameters include watermark text content and rotation angle.

[0016] The step of determining at least one first watermark according to the watermark configuration parameters and the watermark size of the current watermark element comprises:

[0017] The watermark display content of the preset initial watermark is updated according to the watermark text content to obtain a second watermark;

[0018] Rotate the second watermark according to the rotation angle to obtain a first watermark;

[0019] The watermark quantity of the first watermark is determined according to the watermark size of the current watermark element.

[0020] In one embodiment, the step of adding the at least one first watermark to the current watermark element comprises:

[0021] Determining whether the current watermark element includes a scalable vector graphic;

[0022] If a scalable vector graphic is included, determining a matching watermark image in the corpus corresponding to the scalable vector graphic, replacing the scalable vector graphic in the current watermark element with the matching watermark image, and obtaining an updated current watermark element;

[0023] The at least one first watermark is added to the updated current watermark element.

[0024] In one embodiment, the step of adding the at least one first watermark to the current watermark element further comprises:

[0025] For each of the first watermarks, an absolute positioning element for carrying the first watermark is constructed, and the first watermark is wrapped according to the absolute positioning element, and the absolute positioning element wrapped with the first watermark is added to the current watermark element.

[0026] In one embodiment, after the step of adding the at least one first watermark to the current watermark element, the method further comprises:

[0027] Determining a second display page according to the first display page with the first watermark added thereto, wherein the second display page is a debugging page, and displaying a large model export image with the first watermark in the second display page;

[0028] If a modification instruction input by the user is received, it is determined that the first watermark corresponding to the modification instruction in the second display page is the watermark to be modified, and the watermark configuration parameters of the watermark to be modified are adjusted according to the modification instruction. After the watermark configuration parameter adjustment of the watermark to be modified is completed and a confirmation instruction input by the user is received, a large model export image containing the modified first watermark is output.

[0029] In addition, to achieve the above purpose, the present application also proposes a corpus-based watermark adding device, comprising:

[0030] A first determination module is used to determine a large model export image in a first display page, and determine a watermark position to be watermarked in the large model export image, and a current watermark element at the watermark position;

[0031] An acquisition module, used for acquiring watermark configuration parameters corresponding to the large model exported image in a preset corpus;

[0032] A second determining module, configured to determine at least one first watermark according to the watermark configuration parameters and the watermark size of the current watermark element;

[0033] The watermark adding module is used to add the at least one first watermark to the current watermark element, obtain the large model export image with the first watermark added, and output the large model export image with the first watermark added.

[0034] In addition, to achieve the above-mentioned purpose, the present application also proposes a corpus-based watermark adding device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, and the computer program is configured to implement the steps of the corpus-based watermark adding method as described above.

[0035] In addition, to achieve the above objectives, the present application also proposes a medium, which is a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the corpus-based watermark adding method described above are implemented.

[0036] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps of the corpus-based watermark adding method described above are implemented.

[0037] In the embodiment of the present application, by determining the large model export image in the first display page, and determining the watermark position to be watermarked in the large model export image, and the current watermark element at the watermark position. Then, it is not necessary to add watermarks to the entire first display page, and only the watermark position of the large model export image needs to be determined to add watermarks. The watermark position to be watermarked and the current watermark element to be protected for data privacy can also be determined according to the actual scenario. Determine the watermark configuration parameters corresponding to the large model export image in the corpus, determine at least one first watermark according to the watermark configuration parameters and the watermark size of the current watermark element, and then add at least one first watermark to the current watermark element to obtain and output the large model export image with the first watermark added. Then, it can be achieved that only the current watermark element to which watermarks need to be added is watermarked, which can not affect the user's reading effect on the area where watermarks are not added, and can effectively protect the data privacy of the large model export image. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] 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.

[0039] 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.

[0040] Figure 1 A flowchart of the first embodiment of the corpus-based watermark adding method of the present application is provided;

[0041] Figure 2 A schematic diagram of a scenario of adding watermarks to images exported from a large model in the corpus-based watermarking method of the present application;

[0042] Figure 3A flowchart of the second embodiment of the corpus-based watermark adding method of the present application is provided;

[0043] Figure 4 A schematic diagram of the process of the corpus-based watermark adding method of the present application;

[0044] Figure 5 This is a module schematic diagram of a corpus-based watermark adding device according to an embodiment of the present application;

[0045] Figure 6 Schematic diagram of the device structure of the hardware operating environment involved in the corpus-based watermark adding method in the embodiment of the present application.

[0046] 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

[0047] 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.

[0048] 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.

[0049] Due to the large variety of front-end frameworks, there are also many types of watermark libraries. Different projects use different watermark libraries, which leads to high maintenance costs and poor applicability. Moreover, when adding watermarks, watermarks are added to the entire page, which affects the user's reading experience and cannot be added to some parts according to different scenarios.

[0050] Therefore, in order to avoid the above defects, in this embodiment, a corpus-based watermark adding method is provided, which can be written based on native JavaScript and has very good compatibility. When using it, just introduce the library file, and design a watermark configuration management module, which can modify and overwrite various parameters of the watermark. The code logic is clear, which further reduces the difficulty of getting started. It can also meet the needs of different scenarios, and watermarks can be added to the entire system by default. In other special scenarios, users can modify and set the watermark according to their needs to meet the corresponding scene requirements. And the watermark image corresponding to the watermark can be adjusted and set, and the name, size, clarity, format and other parameters of the watermark image can be configured according to user needs to adapt to different scene requirements. In addition, all SVG (Scalable Vector Graphics, scalable vector graphics) icons of the exported page can be replaced with equivalent watermark icons without affecting the page display, and then exported normally. In addition, a debugging page will be built to display the exported watermark image on the page so that users can intuitively and conveniently view the effects of the relevant configuration. In the process of generating the watermark, an a tag (page hyperlink element) will be created, and then the download attribute and href (watermark image) attribute will be added to trigger the click behavior, and the browser will automatically download the browser watermark.

[0051] It should be noted that the execution subject of this embodiment can 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, a corpus-based watermark adding device, etc. The following takes a corpus-based watermark adding device as an example to illustrate this embodiment and the following embodiments.

[0052] Based on this, the embodiment of the present application provides a corpus-based watermark adding method, referring to Figure 1 , Figure 1 This is a flowchart of the first embodiment of the corpus-based watermark adding method of the present application.

[0053] In this embodiment, the corpus-based watermark adding method includes steps S10 to S40.

[0054] Step S10, determining a large model export image in the first display page, and determining a watermark position to be watermarked in the large model export image, and a current watermark element at the watermark position;

[0055] It should be noted that the large model export image can be an image output by the large model in the large model dialogue scenario. For example, if the enterprise A server has a large model and the enterprise B server does not have a large model, the enterprise A server can use the large model to train the model, output an image with partial data privacy, and use this image as the large model export image. At this time, if the large model export image needs to be sent to the enterprise B server, it is necessary to add a watermark to the part of the large model export image involving data privacy to protect the image privacy, and then send the watermarked image to the enterprise B server.

[0056] The first display page may be a page for displaying the large model export image. The first display page may be a browser page or a display window. The first display page at least includes the overall image of the large model export image. Optionally, the first display page may be enlarged or reduced so that the user can more intuitively view the image effect of the large model export image.

[0057] The watermark position may be a position area in the first display page where a watermark needs to be added. Optionally, this embodiment mainly adds a watermark to the large model export image, so the watermark position in the first display page where a watermark can be added may be at least one image position in the area where the large model export image is located in the first display page.

[0058] The current watermark element may be data that needs to be watermarked at the watermark position in the first display page to protect data privacy. The current watermark element may be an image, text, or other characters. For example, if the large model exported image is a portrait image, and the watermark position is the position of the mouth in the portrait image, then the current watermark element is the mouth image in the portrait image. If the large model exported image includes text and a portrait image, and the watermark position is the position of the text, then the current watermark element is the text in the large model exported image.

[0059] Optionally, after acquiring the large model export image, a first display page containing the large model export image may be displayed in the device. And according to certain rules, a watermark position to be watermarked in the large model export image may be determined in the first display page, and the element at the watermark position may be used as the current watermark element. Optionally, there may be multiple watermark positions or one watermark position, which is not limited here.

[0060] Optionally, a certain rule may include determining the watermark position according to relevant instructions input by the user. It may also be determining the fixed privacy data set in advance, determining whether there are elements (such as text, partial images, etc.) matching the fixed privacy data in the large model exported image, and if so, determining the location of the matching element as the watermark position. It may also be other rules (such as determining the watermark position according to a neural network), which are not limited here.

[0061] In a feasible embodiment, in step S10, the step of determining the watermark position to be watermarked in the large model derived image and the current watermark element at the watermark position includes steps a10-a20.

[0062] Step a10, if a designated element instruction input by a user is received within a preset display time, determining whether the position designated by the designated element instruction is located in an image position area corresponding to the large model exported image in the first display page;

[0063] Step a20, if it is located in the image position area, determining the position specified by the specified element instruction as the watermark position, and determining the image element at the watermark position as the current watermark element;

[0064] It should be noted that the preset display time may be a time period set in advance by the user, such as 5s, 10s, etc. The preset display time may be the time during which the first display page is displayed in the device. The designated element instruction may be an instruction input by the user in the device, such as displaying the first display page in the display interface of the device. If it is detected that the user touches the first display page and the pressure generated by the touch is greater than a certain pressure threshold, it is determined to generate a designated element instruction, so as to identify the user's intention according to the designated element instruction and determine the specific location where the user wants to add a watermark to the large model exported image.

[0065] Optionally, if a designated element instruction input by a user is received within a preset display time, the position specified by the designated element instruction in the first display page can be determined, and when the position specified by the designated element instruction is located in the image position area corresponding to the large model exported image in the first display page, it can be used as the watermark position. Optionally, in one scenario, after receiving the designated element instruction, the position specified by the designated element instruction can be first determined to determine whether the position is in the image position area corresponding to the large model exported image in the first display page. If the position specified by the designated element instruction is within the image position area, the designated element instruction is determined to be a valid instruction, and the position specified by the designated element instruction can be used as the watermark position. If the position specified by the designated element instruction is not within the image position area, the designated element instruction can be determined to be an invalid instruction, and a corresponding prompt message can be output to wait for the user to output a new designated element instruction again. Optionally, after determining the watermark position, the image element at the watermark position can be directly used as the current watermark element.

[0066] In a feasible embodiment, in step a11, the image position area corresponding to the large model exported image in the first display page is divided into virtual cells to obtain a plurality of virtual cells;

[0067] Step a12, determining a matching virtual cell in a plurality of virtual cell regions that matches the position specified by the specified element instruction, and using the region where the matching virtual cell is located as the watermark position.

[0068] Optionally, a full image of the large model export image may be displayed in the image location area.

[0069] Optionally, the image position area in the first display page may be divided into virtual cells to obtain a plurality of virtual cells, each of which includes a partial image of the large model derived image.

[0070] Optionally, the position specified by the specified element instruction is determined, and the virtual cell where the position is located is determined, and the virtual cell where the position is located is used as the matching virtual cell. The area where the matching virtual cell is located is used as the watermark position.

[0071] Optionally, in one scenario, a horizontal and vertical coordinate system may be constructed for the first display page, with the lower left corner of the large model exported image as the origin, and the width and height of the large model exported image as the horizontal and vertical coordinate axes. The coordinates corresponding to the position specified by the specified element instruction are determined. The coordinates are used as the watermark position to be added.

[0072] In this embodiment, after receiving the designated element instruction input by the user within the preset display time, and when the position specified by the designated element instruction is located in the image position area, the position specified by the designated element instruction is directly determined as the watermark position, and the image element at the watermark position is used as the current watermark element. Then, according to the actual scene requirements, different positions in the large model exported image can be selected for watermarking, thereby avoiding the phenomenon of adding watermarks to the entire page.

[0073] In a feasible embodiment, in step S10, the step of determining the watermark position to be watermarked in the large model derived image and the current watermark element at the watermark position also includes step a30.

[0074] Step a30: If no designated element instruction input by the user is received within the preset display time, the image position area is determined to be the watermark position, and the image element at the watermark position is determined to be the current watermark element.

[0075] Optionally, if no designated element instruction is received from the user within a preset time period, the large model export image in the first display page can be directly used as the current watermark element, that is, a watermark needs to be added to the entire large model export image.

[0076] In addition, in one scenario, if a track curve manually drawn by a user is received in the first display page, the position area corresponding to the track curve is determined as the watermark position. If the end of the track curve is connected, the position area contained in the track curve is used as the watermark position. Optionally, in one scenario embodiment, the first display page can also be used as the current watermark element, that is, the watermark can be directly added to the entire first display page.

[0077] In this embodiment, when no specified element instruction is received within the preset display time, it can be determined that the image position area corresponding to the large model exported image is the watermark position, that is, it is necessary to add a watermark to the entire large model exported image, thereby effectively protecting the data privacy of the large model exported image.

[0078] Step S20, obtaining watermark configuration parameters corresponding to the large model exported image in a preset corpus;

[0079] Optionally, the corpus may store relevant requirements and specific requirements for exporting images from a large model, and watermark configuration parameters corresponding to the relevant requirements and specific requirements.

[0080] Optionally, relevant requirements and specific requirements of the large model exported image may be determined according to the corpus, and then watermark configuration parameters corresponding to the large model exported image may be determined.

[0081] Optionally, the requirements for the large model exported images may include image quality, such as resolution and color mode (such as RGB mode). File format, such as PNG format, JPEG format, etc. File size, which can be reflected by the degree of compression. Browser compatibility, that is, it is necessary to ensure that the images exported from the large model can be correctly displayed on mainstream browsers, etc.

[0082] Optionally, the specific requirements for exporting large model images may include the size of the exported image, such as width and height, file name rules, such as how to name the exported file, and storage location, i.e., determining the location where the exported image needs to be stored, such as a local hard disk.

[0083] Optionally, watermark configuration parameters for configuring basic watermark information can be selected in the corpus according to the relevant requirements and specific requirements of the large model for exporting images, and the basic watermark information can be configured according to the watermark configuration parameters. Optionally, the watermark configuration parameters can include watermark text content and rotation angle, and can also include other parameters, such as color, size, font, etc. Optionally, the basic watermark information configuration can include watermark type, transparency, font / icon, color, size, rotation angle, watermark text, etc.

[0084] Step S30, determining at least one first watermark according to the watermark configuration parameters and the watermark size of the current watermark element;

[0085] Optionally, the watermark size of the current watermark element may be the size of the area corresponding to the current watermark element in the first display page, such as width and height.

[0086] Optionally, after obtaining the watermark configuration parameters according to the corpus, the watermark parameters of the initial watermark preset in the watermark library can be configured according to the watermark configuration parameters to generate the first watermark. And the number of first watermarks that can be configured in the area where the current watermark element is located can be determined according to the watermark size of the current watermark element and the size parameter of the first watermark.

[0087] In a feasible embodiment, the watermark configuration parameters include watermark text content and rotation angle.

[0088] Step S30, a step of determining at least one first watermark according to the watermark configuration parameters and the watermark size of the current watermark element, includes steps b10-b30.

[0089] Step b10, updating the watermark display content of the preset initial watermark according to the watermark text content to obtain a second watermark;

[0090] Step b20, rotating the second watermark according to the rotation angle to obtain a first watermark;

[0091] Step b30: determining the watermark quantity of the first watermark according to the watermark size of the current watermark element.

[0092] Optionally, the initial watermark can be obtained through a pre-set watermark library. The initial watermark can be pre-set in the watermark library. Optionally, after determining the watermark configuration parameters based on the corpus, such as the watermark text content and the rotation angle, the initial watermark can be configured according to the watermark configuration parameters.

[0093] Optionally, the watermark display content of the initial watermark may be determined, and the watermark copy content may be updated to the initial watermark, so that the initial watermark displays the watermark copy content, that is, the watermark display content of the initial watermark is updated to the watermark copy content.

[0094] Optionally, when multiple initial watermarks are obtained from the watermark library and multiple watermark text contents are obtained according to the corpus, the watermark text content that matches the initial watermark can be determined according to the watermark configuration parameters for each initial watermark, and then the watermark display content in the initial watermark is updated to the watermark text content that matches it. Optionally, the watermark text contents can also be combined to obtain combined content, and then the watermark display content in the initial watermark is updated to the watermark text content that matches it.

[0095] Optionally, the number of watermarks of the initial watermark is consistent with the number of watermarks of the first watermark, and both can be determined according to the watermark size of the current watermark. Optionally, the size parameter of the initial watermark can be determined, and then a corresponding mathematical calculation is performed according to the size parameter of the initial watermark and the watermark size of the current watermark element to determine the number of watermarks of the first watermark.

[0096] Optionally, after the watermark display content in the initial watermark is updated to the watermark text content, a second watermark is obtained, and whether the second watermark needs to be rotated is determined according to the rotation angle. If the rotation is not required, the second watermark can be directly used as the first watermark. If the rotation is required, the second watermark is rotated according to the rotation angle, and the second watermark after the rotation is used as the first watermark. For example, when the rotation angle is 0, it can be determined that the rotation is not required, and when the rotation angle is not 0, it is determined that the rotation is required.

[0097] Optionally, in one scenario, after obtaining the second watermark, multiple second watermarks may be combined and the watermark obtained after the combination is used as the first watermark. For example, if a second watermark is obtained, the second watermark may be rotated according to the rotation angle, and then the second watermark after the rotation is overlapped with the second watermark before the rotation to complete the combination and obtain a new watermark, which is used as the first watermark.

[0098] In this embodiment, watermark configuration parameters such as watermark text content and rotation angle are determined according to the corpus, the watermark display content of the initial watermark is updated according to the watermark text content, and the rotation processing is performed according to the rotation angle to obtain the first watermark, and the number of first watermarks is determined according to the watermark size of the current watermark element. Then, the validity of the at least one first watermark obtained can be guaranteed.

[0099] Step S40, adding the at least one first watermark to the current watermark element to obtain a large model derived image with the first watermark added, and outputting the large model derived image with the first watermark added.

[0100] Optionally, after determining at least one first watermark, the first watermark may be added to the location of the current watermark element to obtain a large model export image with the first watermark added, and the large model export image with the first watermark added is output. Figure 2 As shown in FIG. 1 , if the first watermark is a box of “I am a watermark”, then the box of “I am a watermark” is added to the large model export image, and the following can be obtained: Figure 2 The large model export image with the first watermark added is shown.

[0101] Optionally, when there are multiple first watermarks corresponding to the current watermark element, multiple first watermarks may be added to the location of the current watermark element. Optionally, when there are multiple current watermark elements, the first watermark may be added to each current watermark element.

[0102] Optionally, in one scenario, when adding the first watermark to the current watermark element, each first watermark generated by the watermark library may be different, that is, the style of the first watermark may be constantly changing.

[0103] Optionally, in a scenario, the Y frame image (i.e., brightness component image), U frame image (i.e., chrominance component image), and V frame image (i.e., another chrominance component image) of the large model derived image in the first display page can also be determined, and the target image to be watermarked can be determined. The target image can be at least one of the Y frame image, the U frame image, and the V frame image. If it is necessary to add a watermark to the U frame image. Then, the watermark position to be watermarked in the U frame image and the corresponding current watermark element can be determined, and the corresponding watermark configuration parameters in the corpus can be obtained. At least one first watermark is determined according to the watermark configuration parameters and the watermark size of the current watermark element, and at least one first watermark is added to the position of the current watermark element in the U frame image, thereby completing the watermarking of the U frame image, and then the U frame image with the watermark added is merged with the Y frame image and the V frame image to obtain the large model derived image with the first watermark added.

[0104] In this embodiment, by determining the large model export image in the first display page, and determining the watermark position to be watermarked in the large model export image, and the current watermark element at the watermark position. Then, it is not necessary to add watermarks to the entire first display page, and the watermark position to be watermarked and the current watermark element to be protected for data privacy can be directly determined according to the actual scenario. The watermark configuration parameters corresponding to the large model export image in the corpus are determined, and at least one first watermark is determined according to the watermark configuration parameters and the watermark size of the current watermark element, and then at least one first watermark is added to the current watermark element to obtain and output the large model export image with the first watermark added. In addition, it can be achieved that only the current watermark element to which watermarks need to be added is watermarked, which does not affect the user's reading effect on the image area to which watermarks are not added, and can effectively protect the data privacy of the large model export image.

[0105] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can refer to the above introduction, and will not be repeated later. Figure 3 In step S40, the step of adding the at least one first watermark to the current watermark element includes steps c10-c30.

[0106] Step c10, determining whether the current watermark element includes a scalable vector graphic;

[0107] Step c20, if a scalable vector graphic is included, determining a matching watermark image corresponding to the scalable vector graphic in the corpus, replacing the scalable vector graphic in the current watermark element with the matching watermark image, and obtaining an updated current watermark element;

[0108] Step c30: adding the at least one first watermark to the updated current watermark element.

[0109] In this embodiment, after at least one first watermark is generated based on the corpus, when the watermark is added to the large model exported image in the first display page, it can be determined whether there is SVG (Scalable Vector Graphics) in the current watermark element. If there is a scalable vector graphic, a matching watermark image matching the scalable vector graphic will be searched in the corpus, and the scalable vector graphic in the current watermark element will be replaced with the matching watermark image to update the current water element and obtain an updated current watermark element. Then, at least one first watermark is added to the current watermark element, that is, added to the location of the current watermark element.

[0110] In this embodiment, when the current watermark element includes a scalable vector graphic, a matching watermark image in the corpus that matches it is determined and replaced with the matching watermark image to obtain an updated current watermark element, and then at least one first watermark is added to the updated current watermark element, thereby ensuring the effect of watermark addition, making the large model exported image with the first watermark added clearer and more effective.

[0111] In a feasible embodiment, in step S40, the step of adding the at least one first watermark to the current watermark element further includes step d10.

[0112] Step d10: for each first watermark, construct an absolute positioning element for carrying the first watermark, wrap the first watermark according to the absolute positioning element, and add the absolute positioning element wrapped with the first watermark to the current watermark element.

[0113] Optionally, for each first watermark, when adding the first watermark to the current watermark element, a new HTML (Hyper Text Markup Language) element may be created, and the HTML element may be set to be absolutely positioned, and then the HTML element set to be absolutely positioned may be used as an absolutely positioned element. The absolutely positioned element may be freely positioned at any position on the first display page.

[0114] Optionally, the absolutely positioned element may be used as an absolutely positioned container, and the first watermark may be placed in the absolutely positioned container, thereby wrapping the first watermark through the absolutely positioned element.

[0115] Optionally, the position and size of the current watermark element may be determined, and the absolute positioning element wrapped with the first watermark may be parameterized so that it can cover the current watermark element. The absolute positioning element wrapped with the first watermark may then be added to the current watermark element, for example, as a child element of the current watermark element.

[0116] In this embodiment, by constructing an absolute positioning element for each first watermark, and then wrapping the first watermark, the absolute positioning element wrapped with the first watermark is added to the current watermark element, thereby ensuring the effective implementation of the watermark adding process, so that the first watermark is successfully added to the large model exported image.

[0117] In a feasible embodiment, after step S40, the step of adding the at least one first watermark to the current watermark element, steps e10-e20 are included.

[0118] Step e10, determining a second display page according to the first display page with the first watermark added thereto, wherein the second display page is a debugging page, and displaying a large model export image with the first watermark in the second display page;

[0119] Step e20: If a modification instruction input by the user is received, determine that the first watermark corresponding to the modification instruction in the second display page is the watermark to be modified, adjust the watermark configuration parameters of the watermark to be modified according to the modification instruction, and when the watermark configuration parameter adjustment of the watermark to be modified is completed and a confirmation instruction input by the user is received, output a large model export image containing the modified first watermark.

[0120] Optionally, a debugging module may be set to determine debugging parameters corresponding to the debugging module and a debugging interface (ie, a second display page), and the first watermark may be modified and adjusted in the second display page.

[0121] Optionally, after the first watermark is added to the current watermark element, the effect can be displayed through the second display page. If the user needs to make modifications and adjustments, the corresponding modification instructions can be entered in the second display page to determine the first watermark that needs to be modified and the watermark configuration parameters that need to be modified and adjusted, and then the watermark configuration parameters of the first watermark are adjusted according to the relevant parameters entered by the user to obtain the modified first watermark and display it. If the user is not satisfied, the modification and adjustment can be continued until the confirmation instruction entered by the user is detected, and then the large model export image containing the modified first watermark is output. If the modification instruction entered by the user is not received, and the confirmation instruction is directly received, the large model export image containing the first watermark is directly output.

[0122] In this embodiment, the second display page is determined based on the first display page with the first watermark added, and the first watermark can be adjusted in the second display page according to the modification instruction input by the user, so that the large model exported image with the first watermark added can be more in line with user needs, thereby ensuring the watermark adding effect.

[0123] In addition, to assist in understanding the overall process of the corpus-based watermark adding method in this embodiment, an example is given below.

[0124] For example, you can set the default parameters of the watermark, and configure the basic information of the watermark according to the requirements of the large model export image to determine the watermark configuration parameters, such as rotation angle, watermark text, color and other configuration items. Optionally, you can configure the parameters of each configuration item according to the specific requirements of the large model export image, configure the rotation angle of the watermark in the rotation angle configuration item, configure the watermark text content in the watermark text configuration item, and configure the watermark color in the color configuration item.

[0125] You can set the watermark overlay element. In the first display page, if the user does not explicitly specify a specific element, the watermark library can use the entire page as the default watermark application object, that is, the current watermark element. If the user specifies it, the specified element will be used as the current watermark element, and watermarks can be added to different locations according to actual scene requirements.

[0126] Optionally, a debugging module can be added to increase the debugging page. A debugging parameter corresponding to the debugging module can be set. After the watermark is added to the current watermark element, it can be displayed on the debugging page. The user can debug the displayed watermark according to the debugging parameter.

[0127] Optionally, the watermark can be rendered according to the target element, and the size parameters of the current watermark element, such as width and height, can be obtained. The number of watermarks to be added is determined based on the size parameters. Other watermark configuration parameters can also be obtained from the corpus, such as watermark text content and rotation angle, and a watermark is generated based on the watermark text and rotation angle. The displayed content of the watermark is the watermark text content. And if there is SVG on the page, the SVG will be replaced with the same watermark icon, and then the watermark will be wrapped with an absolutely positioned element and added to the target element, where the target element is in the current watermark element. And after the watermarks have been added, they are displayed, and the large model export image containing the watermark is exported.

[0128] For example, Figure 4 As shown, the watermark library is encapsulated, and the watermark-related configuration is set according to the corpus, including title, color, font size, rotation angle, width, height, and element. Then determine whether to set the element. If so, set the watermark element and render the watermark until the end. If not, directly render the watermark until the end.

[0129] In addition, to achieve the above purpose, refer to Figure 5 , the present application also proposes a corpus-based watermark adding device, comprising:

[0130] A first determination module A10 is used to determine a large model derived image in a first display page, and determine a watermark position to be watermarked in the large model derived image, and a current watermark element at the watermark position;

[0131] An acquisition module A20 is used to acquire watermark configuration parameters corresponding to the large model exported image in a preset corpus;

[0132] A second determining module A30, configured to determine at least one first watermark according to the watermark configuration parameters and the watermark size of the current watermark element;

[0133] The watermark adding module A40 is used to add the at least one first watermark to the current watermark element, obtain the large model export image with the first watermark added, and output the large model export image with the first watermark added.

[0134] In one embodiment, the first determining module A10 is used to:

[0135] If a designated element instruction input by the user is received within the preset display time, determining whether the position specified by the designated element instruction is located in the image position area corresponding to the large model exported image in the first display page;

[0136] If it is located in the image position area, the position specified by the specified element instruction is determined to be the watermark position, and the image element at the watermark position is determined to be the current watermark element.

[0137] In one embodiment, the first determining module A10 is used to:

[0138] If the designated element instruction input by the user is not received within the preset display time, the image position area is determined to be the watermark position, and the image element at the watermark position is determined to be the current watermark element.

[0139] In one embodiment, the watermark configuration parameters include watermark text content and rotation angle, and the second determination module A30 is used to:

[0140] The watermark display content of the preset initial watermark is updated according to the watermark text content to obtain a second watermark;

[0141] Rotate the second watermark according to the rotation angle to obtain a first watermark;

[0142] The watermark quantity of the first watermark is determined according to the watermark size of the current watermark element.

[0143] Optionally, the watermark adding module A40 is used to:

[0144] Determining whether the current watermark element includes a scalable vector graphic;

[0145] If a scalable vector graphic is included, determining a matching watermark image in the corpus corresponding to the scalable vector graphic, replacing the scalable vector graphic in the current watermark element with the matching watermark image, and obtaining an updated current watermark element;

[0146] The at least one first watermark is added to the updated current watermark element.

[0147] Optionally, the watermark adding module A40 is used to:

[0148] For each of the first watermarks, an absolute positioning element for carrying the first watermark is constructed, and the first watermark is wrapped according to the absolute positioning element, and the absolute positioning element wrapped with the first watermark is added to the current watermark element.

[0149] Optionally, the watermark adding module A40 is used to:

[0150] Determining a second display page according to the first display page with the first watermark added thereto, wherein the second display page is a debugging page, and displaying a large model export image with the first watermark in the second display page;

[0151] If a modification instruction input by the user is received, it is determined that the first watermark corresponding to the modification instruction in the second display page is the watermark to be modified, and the watermark configuration parameters of the watermark to be modified are adjusted according to the modification instruction. After the watermark configuration parameter adjustment of the watermark to be modified is completed and a confirmation instruction input by the user is received, a large model export image containing the modified first watermark is output.

[0152] The corpus-based watermark adding device provided by the present application adopts the corpus-based watermark adding method in the above embodiment, which can improve the watermark adding effect and protect data privacy without affecting the user's reading effect. Compared with the prior art, the beneficial effects of the corpus-based watermark adding device provided by the present application are the same as the beneficial effects of the corpus-based watermark adding method provided by the above embodiment, and other technical features in the corpus-based watermark adding device are the same as the features disclosed in the above embodiment method, which will not be repeated here.

[0153] The present application provides a corpus-based watermark adding 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 corpus-based watermark adding method in the above-mentioned embodiment 1.

[0154] Reference below Figure 6, which shows a schematic diagram of the structure of a corpus-based watermark adding device suitable for implementing the embodiment of the present application. The corpus-based watermark adding device in the embodiment of the present application may include but is 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 6 The 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.

[0155] like Figure 6 As shown, the corpus-based watermark adding 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 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 corpus-based watermarking device to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows a corpus-based watermarking 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.

[0156] 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.

[0157] The corpus-based watermark adding device provided by the present application adopts the corpus-based watermark adding method in the above embodiment, which can improve the watermark adding effect and protect data privacy without affecting the user's reading effect. Compared with the prior art, the beneficial effects of the corpus-based watermark adding device provided by the present application are the same as the beneficial effects of the corpus-based watermark adding method provided by the above embodiment, and other technical features in the corpus-based watermark adding device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.

[0158] 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.

[0159] 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.

[0160] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the corpus-based watermark adding method in the above-mentioned embodiment.

[0161] 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: Random Access Memory), a read-only memory (ROM: Read Only Memory), an erasable programmable read-only memory (EPROM: Erasable Programmable Read Only Memory or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM: CD-Read Only Memory), 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, which may 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: Radio Frequency), etc., or any suitable combination of the above.

[0162] The computer-readable storage medium may be included in the corpus-based watermark adding device; or may exist independently without being assembled into the corpus-based watermark adding device.

[0163] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by a corpus-based watermark adding device, the corpus-based watermark adding device can execute the step flow of the corpus-based watermark adding method.

[0164] 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).

[0165] 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.

[0166] 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.

[0167] 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 corpus-based watermarking method, which can improve the watermarking effect and protect data privacy without affecting the user's reading effect. 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 corpus-based watermarking method provided by the above-mentioned embodiment, and will not be repeated here.

[0168] The present application also provides a computer program product, including a computer program, which implements the steps of the above-mentioned corpus-based watermark adding method when executed by a processor.

[0169] The computer program product provided by the present application can improve the effect of watermarking, and protect data privacy without affecting the reading effect of users. 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 corpus-based watermarking method provided by the above embodiment, and will not be repeated here.

[0170] 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 corpus-based watermarking method, characterized in that: The method includes: Determine a large model export image in a first display page, and determine a watermark position to be watermarked in the large model export image, and a current watermark element at the watermark position; Acquire watermark configuration parameters corresponding to the large model exported image in a preset corpus; wherein the watermark configuration parameters are screened out in the corpus according to relevant requirements and specific requirements of the large model exported image, wherein the relevant requirements include image quality, file format, file size and browser compatibility, and the specific requirements include size, file name rules and storage location of the large model exported image; Determine at least one first watermark according to the watermark configuration parameters and the watermark size of the current watermark element; Adding the at least one first watermark to the current watermark element to obtain a large model derived image with the first watermark added thereto, and outputting the large model derived image with the first watermark added thereto; The step of determining the watermark position to be watermarked in the large model derived image and the current watermark element at the watermark position includes: If a designated element instruction input by the user is received within the preset display time, determining whether the position specified by the designated element instruction is located in the image position area corresponding to the large model exported image in the first display page; If it is located in the image position area, the image position area corresponding to the large model exported image in the first display page is divided into virtual cells to obtain multiple virtual cells, and a matching virtual cell that matches the position specified by the specified element instruction is determined among the multiple virtual cells, and the area where the matching virtual cell is located is used as the watermark position, and the image element at the watermark position is determined as the current watermark element; The step of adding the at least one first watermark to the current watermark element comprises: Determining whether the current watermark element includes a scalable vector graphic; If a scalable vector graphic is included, determining a matching watermark image in the corpus corresponding to the scalable vector graphic, replacing the scalable vector graphic in the current watermark element with the matching watermark image, and obtaining an updated current watermark element; The at least one first watermark is added to the updated current watermark element.

2. The method according to claim 1, characterized in that The step of determining the watermark position to be watermarked in the large model derived image and the current watermark element at the watermark position also includes: If the designated element instruction input by the user is not received within the preset display time, the image position area is determined to be the watermark position, and the image element at the watermark position is determined to be the current watermark element.

3. The method according to claim 1, characterized in that The watermark configuration parameters include watermark text content and rotation angle. The step of determining at least one first watermark according to the watermark configuration parameters and the watermark size of the current watermark element comprises: The watermark display content of the preset initial watermark is updated according to the watermark text content to obtain a second watermark; Rotate the second watermark according to the rotation angle to obtain a first watermark; The watermark quantity of the first watermark is determined according to the watermark size of the current watermark element.

4. The method according to claim 1, characterized in that The step of adding the at least one first watermark to the current watermark element further comprises: For each of the first watermarks, an absolute positioning element for carrying the first watermark is constructed, and the first watermark is wrapped according to the absolute positioning element, and the absolute positioning element wrapped with the first watermark is added to the current watermark element.

5. The method according to any one of claims 1 to 4, characterized in that: After the step of adding the at least one first watermark to the current watermark element, the method further comprises: Determining a second display page according to the first display page with the first watermark added thereto, wherein the second display page is a debugging page, and displaying a large model export image with the first watermark in the second display page; If a modification instruction input by the user is received, it is determined that the first watermark corresponding to the modification instruction in the second display page is the watermark to be modified, and the watermark configuration parameters of the watermark to be modified are adjusted according to the modification instruction. After the watermark configuration parameter adjustment of the watermark to be modified is completed and a confirmation instruction input by the user is received, a large model export image containing the modified first watermark is output.

6. A corpus-based watermark adding device, characterized in that: The corpus-based watermark adding device comprises: A first determination module is used to determine the large model exported image in the first display page, and determine the watermark position to be watermarked in the large model exported image, and the current watermark element at the watermark position; wherein, the determination of the watermark position to be watermarked in the large model exported image, and the current watermark element at the watermark position, includes: if a designated element instruction input by a user is received within a preset display time, then determining whether the position specified by the designated element instruction is located in the image position area corresponding to the large model exported image in the first display page; if it is located in the image position area, performing virtual cell division on the image position area corresponding to the large model exported image in the first display page to obtain multiple virtual cells, determining a matching virtual cell among the multiple virtual cells that matches the position specified by the designated element instruction, using the area where the matching virtual cell is located as the watermark position, and determining the image element at the watermark position as the current watermark element; An acquisition module is used to acquire watermark configuration parameters corresponding to the large model exported image in a preset corpus; wherein the watermark configuration parameters are screened out in the corpus according to relevant requirements and specific requirements of the large model exported image, wherein the relevant requirements include image quality, file format, file size and browser compatibility, and the specific requirements include the size, file name rule and storage location of the large model exported image; A second determining module, configured to determine at least one first watermark according to the watermark configuration parameters and the watermark size of the current watermark element; A watermark adding module, used for adding the at least one first watermark to the current watermark element, obtaining a large model export image with the first watermark added, and outputting the large model export image with the first watermark added, wherein adding the at least one first watermark to the current watermark element includes determining whether the current watermark element contains a scalable vector graphic; if it contains a scalable vector graphic, determining a matching watermark image corresponding to the scalable vector graphic in the corpus, replacing the scalable vector graphic in the current watermark element with the matching watermark image, and obtaining an updated current watermark element; adding the at least one first watermark to the updated current watermark element.

7. A corpus-based watermarking device, characterized in that: The 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 corpus-based watermark adding method according to any one of claims 1 to 5.

8. A medium, characterized in that The medium is a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the corpus-based watermark adding method according to any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Tamper-proof front-end watermark creating method and application thereof

    CN114936336A

  • Copyright information embedding and verification method and device, equipment, medium and product

    CN117077091A

  • Watermark adding method and device and electronic equipment

    CN118503936A