Watermark adding method, watermark adding device and electronic equipment
By matching and combining user identification information with the graphical encryption rule base, an encrypted watermark is generated and integrated into the page background, which solves the problems of poor confidentiality and low security of existing watermark technology and achieves high-security information protection.
Patent Information
- Application Number
- CN202311435480.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-31
- Publication Date
- 2024-10-18
AI Technical Summary
Existing watermark technology has poor confidentiality and low security, and is easy to be identified and cracked, leading to information leakage and data theft.
By obtaining the user identification information associated with the target page, the graphical encryption rule base is used to match the original characters into basic encryption graphics, and combine them according to the character combination rules to generate an encrypted watermark, which is blended into the page background to increase concealment and security.
It effectively improves the security protection of watermarks, increases the difficulty of cracking, avoids information leakage and data theft, and improves information security.
Smart Images

Figure CN118797584A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of computer technology, and in particular relates to a watermark adding method, a watermark adding device and an electronic device. Background Art
[0002] Watermark anti-leakage technology refers to adding certain identifiable digital information to files, web pages, and other pages, such as account numbers, time, and geographic location. At present, the most common watermarking technology for pages is explicit watermarking, which is an explicit watermark that usually displays user names and other information directly on the page. This watermarking method is simple to process and highly user-perceived, but has poor confidentiality and low security. The set watermark is easy to identify and crack, which may cause information leakage and data theft. Summary of the invention
[0003] The embodiments of the present application provide a watermark adding method, a watermark adding device and an electronic device, which can prevent information leakage and data theft.
[0004] In a first aspect, an embodiment of the present application provides a method for adding a watermark, the method comprising: obtaining user identification information associated with a target page, the user identification information comprising a plurality of original characters; determining a basic encryption graphic corresponding to each original character by matching each of the original characters with a basic encryption graphic in a graphical encryption rule library, wherein the graphical encryption rule library comprises a mapping relationship between the original characters and the basic encryption graphics; obtaining an encrypted watermark by combining the basic encryption graphics corresponding to each of the original characters according to a character combination rule; and adding the encrypted watermark to the target page.
[0005] In a second aspect, an embodiment of the present application provides a watermark adding device, the device comprising: an acquisition module, used to acquire user identification information associated with a target page, the user identification information comprising a plurality of original characters; a determination module, used to determine a basic encryption graphic corresponding to each of the original characters by matching each of the original characters with a basic encryption graphic in a graphical encryption rule library, wherein the graphical encryption rule library comprises a mapping relationship between the original characters and the basic encryption graphics; a combination module, used to obtain an encrypted watermark by combining the basic encryption graphics corresponding to each of the original characters according to a character combination rule; and an adding module, used to add the encrypted watermark to the target page.
[0006] In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the method described in the first aspect.
[0007] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.
[0008] In a fifth aspect, an embodiment of the present application provides a chip, comprising a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the method described in the first aspect.
[0009] In an embodiment of the present application, by obtaining user authentication information associated with a target page, and matching each original character in the user authentication information with a basic encrypted graphic in a graphical encryption rule library, the basic encrypted graphic corresponding to each original character can be determined, and then the basic encrypted graphic corresponding to each original character is combined according to a character combination rule to obtain an encrypted watermark. Finally, the encrypted watermark is added to the target page. This further improves the security protection of the watermark itself while avoiding the exposure of the watermark information, preventing attackers from discovering and maliciously destroying the watermark, and can effectively increase the difficulty of cracking the watermark content. In addition, by encrypting the watermark, information leakage and data theft can be avoided, thereby improving information security. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] Figure 1 This is a flow chart of a method for adding a watermark provided in an embodiment of the present application;
[0011] Figure 2 This is another flow chart of a method for adding a watermark provided in an embodiment of the present application;
[0012] Figure 3 This is another flow chart of a method for adding a watermark provided in an embodiment of the present application;
[0013] Figure 4 It is a structural schematic diagram of a watermark adding device provided in an embodiment of the present application;
[0014] Figure 5 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0015] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0016] In conjunction with the accompanying drawings, a watermark adding method, a watermark adding device and an electronic device provided in the embodiments of the present application are described in detail through specific embodiments and their application scenarios.
[0017] Figure 1 A method for adding a watermark provided by an embodiment of the present application is shown. The method can be executed by an electronic device, and the electronic device may include: a server and / or a terminal device. In other words, the method can be executed by software or hardware installed in the electronic device, and the method includes the following steps:
[0018] S110: Acquire user identification information associated with the target page, wherein the user identification information includes a plurality of original characters.
[0019] Among them, obtaining user identification information associated with the target page means obtaining organizational information or user information related to the target page. Such organizational information or user information is digital information that can identify the identity, such as account number, time, geographic location, etc. In this way, when the target page is screenshotted or photographed, the intercepted page will have these watermark information. Once the intercepted file is leaked, the watermark information can be used to trace the source of the leak, quickly handle the incident, and reduce the potential for accidents. It should be noted that the target page can include pictures, files, web pages, etc. in various formats.
[0020] Exemplarily, the user identification information may include the following aspects:
[0021] (1) User account information, such as user name, password, and other data used for authentication and authorization. For example, when a user performs a download operation, he needs to log in to a website. When the server of the website receives the user's download request, it can obtain the user's login username as user identification information.
[0022] (2) User personal information, such as name, gender, contact information, and other identity information.
[0023] (3) Organizational information, such as company name, department name, company bank account information, etc. For example, if a certain company XX produces a courseware, before disseminating the courseware, it is necessary to obtain relevant information of the company XX and use the relevant information as user identification information to add a watermark, which can be used for intellectual property protection, thereby preventing others from disseminating and misappropriating the courseware.
[0024] (4) Device information, such as the device model, operating system, IP address, operation time, etc. used by the user. For example, when a user performs a download operation, he needs to log in to a website. When the server of the website receives the user's download request, the device model and IP address of the terminal operated by the user can be used as user identification information.
[0025] The user identification information includes a plurality of original characters, which means that each user identification information is composed of a plurality of original characters. For example, a user identification information is a user name, and the user name is: AABC#@! !, that is, the user identification information is composed of eight original characters, 'A', 'A', 'B', 'C', '#', '@', '! ', and '! '.
[0026] In S110 , by acquiring user identification information associated with the target page, a watermark may be generated using the user identification information, thereby tracing and confirming the source of the file.
[0027] S120: Determine the basic encryption pattern corresponding to each original character by matching each original character with the basic encryption pattern in the graphical encryption rule library.
[0028] The graphical encryption rule base includes a mapping relationship between the original characters and the basic encryption graphics.
[0029] It is understandable that, in a web page, an explicit watermark is watermark information that is encrypted by directly adding DOM elements to the page or drawing through Canvas, but an explicit watermark will destroy the readability and integrity of the page and cause data leakage. For those who steal the page content, the watermark can also be destroyed by operations such as cropping, blurring, and intentional concealment. In the embodiment of the present application, encryption of each original character can be achieved by matching the basic encryption graphic corresponding to each of the original characters from the graphical encryption rule library, which can avoid the leakage of watermark information. It should be noted that the graphical encryption rule library can be set in advance, and the basic encryption graphic can also be set according to user needs.
[0030] S130: The encrypted watermark is obtained by combining the basic encrypted graphics corresponding to each of the original characters according to the character combination rules.
[0031] It is understandable that, in order to further enhance the encryption of the watermark, the basic encryption graphics corresponding to each of the original characters may be combined according to character combination rules to obtain an encrypted watermark.
[0032] S140: Add the encrypted watermark to the target page.
[0033] In one implementation, the adding the encrypted watermark to the target page may include the following steps:
[0034] S142: Acquire coordinates and size data of a target element, wherein the target element includes at least one of the following: the target page, or a page component in the target page.
[0035] The target element can be a target page or a page component in the target page, and the page component includes but is not limited to buttons and lists. In other words, the target element is an object when adding a watermark, that is, if the target element is a target page, the watermark can be directly added to the page; if the target element is a page component in the target page, the watermark can be directly added to the page component.
[0036] S144: Based on the size data of the target element, adjust the size data of the encrypted watermark, and based on the coordinates of the target element, determine at least one target coordinate of the encrypted watermark in the target page.
[0037] S146: Determine, according to the background color of the target element, a target color whose similarity to the background color is within a preset range.
[0038] S148: Add the encrypted watermark of the target color to at least one of the target coordinates.
[0039] Regarding the above S144-S148, the following is an example in which the target elements are the target page and the page component in the target page. If the target element is the target page, it means that the watermark is integrated into the background image drawing, and the size of the encrypted watermark is scaled and adjusted by obtaining the target page size data to maintain the aesthetics of the page after adding the watermark. By obtaining the coordinates of the target page, the location where the encrypted watermark is added in the target page can be determined. After determining at least one target coordinate and size data of the encrypted watermark, a brush close to the background color can be selected in combination with the background color of the target page, and drawn at multiple target coordinates to generate a watermark pattern with a certain regularity. If the target element is a page element in the target page, it means that the watermark is integrated into the page element, and the size of the encrypted watermark is scaled and adjusted by obtaining the page element size data to maintain the aesthetics of the page after adding the watermark. By obtaining the coordinates of the target page, the location where the encrypted watermark is added in the page element can be determined. After determining at least one target coordinate and size data of the encrypted watermark, a brush close to the background color can be selected in combination with the background color of the page element, and drawn at multiple target coordinates to generate a watermark pattern with a certain regularity. Optionally, when integrating a watermark into a page element, only one watermark may be drawn according to the size of the page element.
[0040] In this implementation, the problems of high user perception of obvious watermarks, poor reading experience and low anti-destruction ability can be solved. The watermark is dissolved into the page, and is painted into the page with a brush close to the theme color of the page according to elements such as the theme background of the page, so that user-unaware use is achieved. On the basis of improving the user reading experience, the anti-destruction ability of the watermark is further enhanced. This is because the graphical watermark is fused with the page for strong concealment, making the watermark almost visually imperceptible, thereby improving the security of the watermark and avoiding malicious damage to the watermark by data leakers, thereby ensuring traceability when leaked information, and at the same time preventing the inability to track and trace the source due to pixel problems.
[0041] In an embodiment of the present application, by obtaining user authentication information associated with the target page, and matching each original character in the user authentication information with the basic encrypted graphics in the graphical encryption rule library, the basic encrypted graphics corresponding to each original character can be determined, and then the basic encrypted graphics corresponding to each original character are combined according to the character combination rules to obtain an encrypted watermark. Finally, the encrypted watermark is added to the target page. On the basis of avoiding the leakage of watermark information, the security protection of the watermark itself is further improved, and attackers are prevented from discovering and maliciously destroying the watermark. The difficulty of cracking the watermark content can be effectively increased. In addition, by encrypting the watermark, information leakage and data theft can be avoided, thereby improving information security.
[0042] Figure 2 FIG. 1 is another flow chart of a method for adding a watermark provided in an embodiment of the present application. Figure 2 As shown, the method may include the following steps:
[0043] S210: Acquire user identification information associated with the target page, where the user identification information includes a plurality of original characters.
[0044] For details about S210, please refer to Figure 1 In the illustrated embodiment, the description of S110 is not repeated here.
[0045] S220: Construct a character set and M basic graphic elements.
[0046] Wherein, the character set includes N preset characters, N is greater than or equal to 1, and the N preset characters include a plurality of the original characters. Exemplarily, the N preset characters may include 26 uppercase and lowercase English letters, 10 numbers 0-9, 21 commonly used characters such as! , @, #,? , _, etc., CJK identical Chinese characters, etc. The M basic graphic elements may include rectangles, diamonds, triangles, solid dots, hollow dots, long lines, short lines, punctuation marks, and other graphics and symbols. Optionally, symbol graphics of different colors can be used as a basic graphic element respectively, for example, a rectangle with a red border can be used as a basic graphic element, and a rectangle with a blue border can be used as another basic graphic element.
[0047] Optionally, the M basic graphic elements may be formed by Morse code.
[0048] S230: Constructing the graphical encryption rule library based on the M basic graphic elements and the N preset characters.
[0049] In one implementation, S230 may include the following steps:
[0050] S232: Divide the M types of basic graphic elements into spacer graphics and character graphics.
[0051] The number of the spacing patterns is 1, and the number of the character patterns is the difference between M and 1.
[0052] That is, one basic graphic element among the M basic graphic elements is used as a spacer graphic, and (M-1) basic graphic elements are used as character graphics.
[0053] S234: Determine a maximum number of graphic digits X based on the number of the character graphics and the number of the preset characters.
[0054] Wherein, the maximum number of graphic bits is less than or equal to the number of character graphics.
[0055] It is understandable that, based on the number of character graphics, the maximum number of graphic digits that can satisfy the preset number of characters through permutations and combinations is calculated. Where f represents the number of character graphics (M-1), d is the maximum number of graphic bits, and when the number of character graphics and the number of preset characters are determined, the (preset number of characters) Calculate the maximum number of graphic digits X. That is to say, from (M-1) character graphics, select X character graphics for permutation and combination, and get exactly N permutations and combinations, and these N permutations and combinations correspond to the N preset characters one by one. Therefore, it is necessary to determine the maximum number of graphic digits first.
[0056] S236: Select X types of character graphics from (M-1) types of character graphics, and perform permutations and combinations to generate Y types of basic encryption graphics, where Y is equal to N.
[0057] After determining the maximum number of graphic digits X, X character graphics can be selected from (M-1) character graphics for permutation and combination to obtain Y, or N, basic encryption graphics. It should be noted that the selection method of the X character graphics is not specifically limited in this application, and those skilled in the art can set it according to actual conditions.
[0058] S238: Constructing the graphical encryption rule library by establishing a one-to-one mapping relationship between the N types of preset characters and the Y types of basic encryption graphics.
[0059] It is understandable that associating and mapping each preset character in the character set with a different basic encryption pattern can ensure that all preset characters in the character set can be mapped to a unique basic encryption pattern.
[0060] S240: Determine the basic encryption graph corresponding to each original character by matching each original character with the basic encryption graph in the graphical encryption rule library.
[0061] The graphical encryption rule base includes a mapping relationship between the original characters and the basic encryption graphics.
[0062] S250: The basic encrypted graphics corresponding to each of the original characters are combined according to character combination rules to obtain an encrypted watermark.
[0063] S260: Add the encrypted watermark to the target page.
[0064] For details about S240-S260, please refer to Figure 1 In the illustrated embodiment, the description of S120 - S140 will not be repeated here.
[0065] In an embodiment of the present application, a character set and M basic graphic elements are first constructed, and then the graphical encryption rule library is constructed based on them. In this way, after obtaining the user authentication information associated with the target page, each original character in the user authentication information can be matched with the basic encrypted graphics in the graphical encryption rule library, so that the basic encrypted graphics corresponding to each original character can be determined, and then the basic encrypted graphics corresponding to each original character are combined according to the character combination rules to obtain an encrypted watermark. Finally, the encrypted watermark is added to the target page. On the basis of avoiding the leakage of watermark information, the security protection of the watermark itself is further improved, and attackers are prevented from discovering and maliciously destroying the watermark, which can effectively increase the difficulty of cracking the watermark content. Moreover, by encrypting the watermark, information leakage and data theft can be avoided, thereby improving information security.
[0066] Furthermore, in one implementation, the encrypted watermark includes the spacing pattern and the basic encryption pattern corresponding to each of the original characters, wherein the spacing pattern exists between each two adjacent basic encryption patterns. The spacing pattern is used to space between each two adjacent basic encryption patterns, so that during decryption, the original characters can be quickly restored one by one, thereby improving the flexibility of decryption.
[0067] In another implementation, the character combination rule may include at least one of the following:
[0068] (1) An initial combination, wherein the initial combination is to arrange and combine the basic encryption patterns corresponding to each of the original characters according to the order of each of the original characters in the user identification information.
[0069] Exemplarily, assuming that the user identification information is "ABC", the basic encryption pattern representing the character 'A' may be "┤▽☆╦", the basic encryption pattern representing the character 'B' may be "▽┤╦☆", and the basic encryption pattern representing the character 'C' may be "╦☆▽┤", where the spacing pattern is "●". Then, by combining according to the initial combination, it can be determined that the encrypted watermark of the user identification information is "┤▽☆╦●▽┤╦☆●╦☆▽┤".
[0070] (2) Offset combination, wherein the offset combination is to offset and combine the basic encrypted graphics corresponding to each of the original characters according to the preset offset corresponding to each of the original characters.
[0071] Continuing to refer to the example in (1) above, assuming that the preset offset is 1 character, the order of "ABC" in the encrypted watermark is "CAB". Then, by combining according to the offset combination, it can be determined that the encrypted watermark of the user authentication information is "╦☆▽┤●┤▽☆╦●▽┤╦☆".
[0072] (3) Reversal combination, wherein the reversal combination is to reverse and combine the basic encryption patterns corresponding to each of the original characters according to the order of each of the original characters in the user identification information.
[0073] Continuing to refer to the example in (1) above, taking horizontal inversion as an example, the basic encrypted pattern "┤▽☆╦" representing the character 'A' can be "╦☆▽├" after horizontal inversion; the basic encrypted pattern "▽┤╦☆" representing the character 'B' can be "☆╦├▽" after horizontal inversion; the basic encrypted pattern "╦☆▽┤" representing the character 'C' can be "├▽☆╦" after inversion; then, by combining according to the inversion combination, it can be determined that the encrypted watermark of the user authentication information is "╦☆▽├●☆╦├▽●├▽☆╦".
[0074] Optionally, the above combination methods can be arbitrarily superimposed. For example, an inversion combination is performed first and then an offset combination is performed. The technology refers to the examples in (1)-(3) above. The final encrypted watermark is “├▽☆╦●╦☆▽├●☆╦├▽”.
[0075] Based on the above embodiments, the method of constructing the M basic graphic elements may include at least one of the following:
[0076] (1) A plurality of graphic element templates of different complexity are set, wherein the graphic element template of each complexity includes at least one of the basic graphic elements.
[0077] It is understandable that the graphic elements in the template are all sufficiently recognizable individually and are relatively beautiful pictures after being combined. Optionally, the templates can be divided into three levels according to complexity. Among them, each level of template can include a different number of basic graphic elements.
[0078] (2) Obtaining a basic image uploaded by a user device; in response to a marking operation on the basic image, determining a characteristic mark corresponding to the basic image; determining an initial graphic element based on the characteristic mark; and in response to a determination operation on the initial graphic element, determining the initial graphic element as the basic graphic element.
[0079] Exemplarily, the basic image can be an image of other contents and types such as an xx system interface image, an xx design image, etc. The marking operation refers to marking the image when uploading the basic image, that is, marking the area that can be used as the basic graphic element. Then, after receiving the marked basic image, the initial graphic element can be determined according to the characteristic mark corresponding to the basic image, and a confirmation operation for the initial graphic element can be initiated. After confirmation by the user device, the initial graphic element can be determined as the basic graphic element. It should be noted that the user device can upload multiple images at the same time, and multiple marking operations can be performed on each image separately, that is, each image can have multiple characteristic marks, and each characteristic mark can correspond to an initial graphic element.
[0080] In this implementation, element graphic templates are produced by screening basic graphics that are individually sufficiently recognizable and have good visual effects when combined, thereby ensuring the aesthetics and readability of the final graphic watermark.
[0081] like Figure 3 As shown, it is another flow chart of the method for adding a watermark provided in the embodiment of the application. Specifically, the method may include the following steps:
[0082] S310: Construct basic graphic elements.
[0083] Among them, the construction methods of basic graphic elements can include the following two methods:
[0084] (1) The system has built-in graphic element templates from which users can choose. The graphic elements in the templates are all sufficiently recognizable individually and are more beautiful when combined. Templates are divided into three levels according to complexity. Among them, the level 1 template has 3 basic graphic elements; the level 2 template has 4 basic graphic elements; and the level 3 template has 5 basic graphic elements.
[0085] (2) The user uploads a picture, such as a system interface picture, and tags the picture. Based on the picture tags, the system uses image recognition technology to parse and obtain the graphic elements that meet the requirements. The parsed graphics are confirmed or adjusted by the user.
[0086] S320: Obtain basic graphic elements and character sets.
[0087] Use the element graphics selected by the user as the basic graphic elements or directly use the basic graphic elements in the template. At least 3 basic graphic elements are selected and up to 5 are supported. The more basic graphics are selected, the more complex the encrypted graphics generated will be, and the better the cracking resistance will be.
[0088] S330: Generate a mapping relationship table between characters and encrypted graphics through a graphics mapping model.
[0089] Based on the basic graphic elements and in accordance with the graphic mapping model, the process of generating the mapping relationship between the characters and the encrypted graphics may include:
[0090] (1) randomly selecting one of the basic graphic elements as the spacing graphic, and using the remaining basic graphic elements as character graphics, and randomly sorting them;
[0091] (2) Based on the number of character graphics, calculate the maximum number of graphic digits that can be used to satisfy the number of character sets through permutations and combinations;
[0092] (3) Based on the maximum number of graphic digits, different encryption graphics are formed by arranging and combining character graphics;
[0093] (4) Associatively map each character in the character set with a different encryption pattern, until all characters in the character set have been mapped to an encryption pattern.
[0094] S340: storing the set of character encryption graphic mappings to generate a graphic encryption rule base.
[0095] S350: User logs in.
[0096] S360: The system sends the watermark information (such as user name) to the watermark API.
[0097] The system sends the information that needs to be displayed as a watermark to the watermark API. This data includes but is not limited to: user name information, address information, department information, and other data used to identify system users.
[0098] S370: The watermark API obtains the detailed display data and then calls the encryption API.
[0099] The watermark API receives the data, obtains the detailed information according to the logic, and then sends the data to the encryption API.
[0100] S380: The encryption API encrypts the information based on the graphical encryption rule library to form a graphical encryption watermark.
[0101] The encryption API calls the graphical encryption rule library to encrypt data. The encryption process includes:
[0102] (1) Decomposing the data to be encrypted into a set of single characters;
[0103] (2) Based on the character encryption pattern mapping relationship, obtain the basic encryption pattern corresponding to each original character;
[0104] (3) The basic encrypted graph obtained by the conversion is generated into a complete encrypted graph according to certain combination rules, wherein the character combination rules include original combination, offset, inversion, etc.
[0105] S390: The drawing API merges the graphical encrypted watermark with the page elements and draws.
[0106] The drawing API combines the current page theme style and fuses the encrypted graphics into the page to draw a watermark. Exemplarily, the drawing method may include at least one of the following:
[0107] (1) Drawing with background image integration: Obtain the page size coordinates and the size data of the encrypted image; Calculate the target coordinates where the watermark needs to be drawn based on the page coordinates and the size of the encrypted image; Select a brush close to the background color based on the page background color; Draw at multiple target coordinates to generate a watermark pattern with a certain regularity.
[0108] (2) Integration into page elements: Obtain the coordinates and size data of specific elements (buttons, lists) on the page; adjust the original size of the encrypted graphic (reduce or enlarge) based on the size of the page elements; calculate the target coordinates where the watermark needs to be drawn; select a brush with a similar color based on the element color; and draw the watermark at the target coordinates.
[0109] In the above embodiment, the whole process of watermark generation, encryption and drawing is realized. This embodiment can realize the above Figure 1-Figure 2 In each process of the illustrated embodiment, the graphic watermark generated by the graphic encryption technology can draw the user's identity authentication information in the target page in an aesthetically pleasing graphic form, achieving the purpose of watermark leakage prevention without reducing the user's reading experience. At the same time, because the graphic watermark is dissolved in the page elements, the watermark has a strong concealment, which can prevent the malicious destruction of the watermark by the data leaker, and greatly ensure the traceability of the leaked information.
[0110] Figure 4 A schematic diagram of the structure of a watermark adding device provided by an embodiment of the present application is shown as follows: Figure 4 As shown, the watermark adding device 400 may include: an acquisition module 410 , a determination module 420 , a combination module 430 and an adding module 440 .
[0111] In this embodiment, the acquisition module 410 is used to obtain user identification information associated with the target page, and the user identification information includes multiple original characters; the determination module 420 is used to determine the basic encryption graphic corresponding to each original character by matching each original character with the basic encryption graphic in the graphical encryption rule library, wherein the graphical encryption rule library includes the mapping relationship between the original characters and the basic encryption graphics; the combination module 430 is used to obtain an encrypted watermark by combining the basic encryption graphics corresponding to each original character according to the character combination rules; the adding module 440 is used to add the encrypted watermark to the target page.
[0112] In one implementation, the watermark adding device 400 also includes: a first construction module, used to construct a character set and M basic graphic elements, wherein the character set includes N preset characters, N is greater than or equal to 1, and the N preset characters include a plurality of the original characters; a second construction module, used to construct the graphical encryption rule library based on the M basic graphic elements and the N preset characters.
[0113] In one implementation, the second construction module is used to: divide the M types of basic graphic elements into spacing graphics and character graphics, wherein the number of the spacing graphics is 1, and the number of the character graphics is the difference between M and 1; determine the maximum number of graphic bits X based on the number of the character graphics and the number of the preset characters, wherein the maximum number of graphic bits is less than or equal to the number of the character graphics; generate Y types of the basic encryption graphics by selecting X types of the character graphics from (M-1) types of the character graphics for permutation and combination, wherein Y is equal to N; and construct the graphical encryption rule library by establishing a one-to-one mapping relationship between the N types of preset characters and the Y types of the basic encryption graphics.
[0114] In one implementation, the encrypted watermark includes the spacing pattern and a basic encryption pattern corresponding to each of the original characters, wherein the spacing pattern exists between every two adjacent basic encryption patterns.
[0115] In one implementation, the character combination rule includes at least one of the following: an initial combination, wherein the initial combination is to arrange and combine the basic encrypted graphics corresponding to each of the original characters according to the order of each of the original characters in the user identification information; an offset combination, wherein the offset combination is to offset and combine the basic encrypted graphics corresponding to each of the original characters according to a preset offset corresponding to each of the original characters; a reverse combination, wherein the reverse combination is to reverse and combine the basic encrypted graphics corresponding to each of the original characters according to the order of each of the original characters in the user identification information.
[0116] In one implementation, the adding module 440 is used to: obtain the coordinates and size data of the target element, wherein the target element includes at least one of the following: the target page, the page component in the target page; based on the size data of the target element, adjust the size data of the encrypted watermark, and based on the coordinates of the target element, determine at least one target coordinate of the encrypted watermark in the target page; based on the background color of the target element, determine a target color whose similarity to the background color is within a preset range; and add the encrypted watermark of the target color at at least one of the target coordinates.
[0117] In one implementation, constructing M types of the basic graphic elements includes: setting a plurality of graphic element templates of different complexity, wherein the graphic element templates of each complexity respectively include at least one of the basic graphic elements.
[0118] In one implementation, constructing M types of the basic graphic elements includes: obtaining a basic image uploaded by a user device; determining a characteristic mark corresponding to the basic image in response to a marking operation on the basic image; determining an initial graphic element based on the characteristic mark; and determining the initial graphic element as the basic graphic element in response to a determination operation on the initial graphic element.
[0119] The watermark adding device provided in the embodiment of the present application can realize Figure 1-Figure 3 To avoid repetition, the various processes implemented in the illustrated method embodiment will not be described again here.
[0120] The watermark adding device in the embodiment of the present application may be a device, or a component, an integrated circuit, or a chip in an electronic device. The embodiment of the present application does not specifically limit this.
[0121] The watermark adding device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.
[0122] Optional, such as Figure 5 As shown, the embodiment of the present application also provides an electronic device 500, including a processor 501, a memory 502, a program or instruction stored in the memory 502 and executable on the processor 501, and the program or instruction is executed by the processor 501 to achieve the above Figure 1-Figure 3 The various processes of the method embodiment shown can achieve the same technical effect, and will not be described again here to avoid repetition.
[0123] The embodiment of the present application also provides a readable storage medium on which a program or instruction is stored. When the program or instruction is executed by a processor, the above Figure 1-Figure 3 The various processes of the method embodiment shown can achieve the same technical effect, and will not be described again here to avoid repetition.
[0124] The processor is a processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0125] The present application also provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the above Figure 1-Figure 3 To avoid repetition, the various processes of the illustrated method embodiment will not be described again here.
[0126] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.
[0127] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.
[0128] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0129] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.
Claims
1. A method for adding a watermark, characterized in that: The method comprises: Acquire user identification information associated with the target page, wherein the user identification information includes a plurality of original characters; Determining the basic encryption graph corresponding to each original character by matching each original character with a basic encryption graph in a graphical encryption rule library, wherein the graphical encryption rule library includes a mapping relationship between the original character and the basic encryption graph; The encrypted watermark is obtained by combining the basic encrypted graphics corresponding to each of the original characters according to the character combination rules; The encrypted watermark is added to the target page.
2. The method according to claim 1, characterized in that Before determining the basic encryption graph corresponding to each original character by matching each original character with the basic encryption graph in the graphical encryption rule base, the method further includes: Constructing a character set and M basic graphic elements, wherein the character set includes N preset characters, N is greater than or equal to 1, and the N preset characters include a plurality of the original characters; The graphical encryption rule library is constructed based on the M basic graphic elements and the N preset characters.
3. The method according to claim 2, characterized in that The step of constructing the graphical encryption rule library based on the M basic graphic elements and the N preset characters includes: Divide the M basic graphic elements into spacer graphics and character graphics, wherein the number of the spacer graphics is 1, and the number of the character graphics is the difference between M and 1; Determine a maximum number of graphic digits X based on the number of the character graphics and the number of the preset characters, wherein the maximum number of graphic digits is less than or equal to the number of the character graphics; By selecting X types of the character graphics from (M-1) types of the character graphics and performing permutations and combinations, Y types of the basic encryption graphics are generated, where Y is equal to N; The graphical encryption rule library is constructed by establishing a one-to-one mapping relationship between the N types of preset characters and the Y types of basic encryption graphics.
4. The method according to claim 3, characterized in that The encrypted watermark includes the spacing pattern and a basic encryption pattern corresponding to each of the original characters, wherein the spacing pattern exists between every two adjacent basic encryption patterns.
5. The method according to claim 4, characterized in that The character combination rule includes at least one of the following: An initial combination, wherein the initial combination is to arrange and combine the basic encryption patterns corresponding to each of the original characters according to the order of each of the original characters in the user identification information; Offset combination, wherein the offset combination is to offset and combine the basic encrypted graphics corresponding to each of the original characters according to the preset offset corresponding to each of the original characters; The reverse combination is to reverse and combine the basic encrypted graphics corresponding to each original character according to the sequence of each original character in the user identification information.
6. The method according to claim 1, characterized in that The step of adding the encrypted watermark to the target page comprises: Acquire coordinates and size data of a target element, wherein the target element includes at least one of the following: the target page, or a page component in the target page; Based on the size data of the target element, adjusting the size data of the encrypted watermark, and based on the coordinates of the target element, determining at least one target coordinate of the encrypted watermark in the target page; According to the background color of the target element, determining a target color whose similarity to the background color is within a preset range; At at least one of the target coordinates, the encrypted watermark of the target color is added.
7. The method according to claim 3, characterized in that Constructing M kinds of basic graphic elements, including: A plurality of graphic element templates of different complexity are set, wherein the graphic element template of each complexity respectively includes at least one of the basic graphic elements.
8. The method according to claim 3, characterized in that Constructing M kinds of basic graphic elements, including: Get the basic image uploaded by the user's device; In response to a marking operation on the base picture, determining a feature mark corresponding to the base picture; Determining an initial graphic element according to the characteristic mark; In response to a determination operation on the initial graphic element, the initial graphic element is determined as the basic graphic element.
9. A watermark adding device, characterized in that: The device comprises: An acquisition module, used to acquire user identification information associated with a target page, wherein the user identification information includes a plurality of original characters; A determination module, configured to determine a basic encryption pattern corresponding to each of the original characters by matching each of the original characters with a basic encryption pattern in a graphical encryption rule library, wherein the graphical encryption rule library includes a mapping relationship between the original characters and the basic encryption patterns; A combination module, used for combining the basic encryption graphics corresponding to each of the original characters according to the character combination rules to obtain an encrypted watermark; An adding module is used to add the encrypted watermark to the target page.
10. An electronic device, characterized in that: The method comprises a processor, a memory and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the watermark adding method as described in any one of claims 1 to 8.
