CN110097488B - Invisible digital watermark generation and extraction method and device - Google Patents

Invisible digital watermark generation and extraction method and device Download PDF

Info

Publication number
CN110097488B
CN110097488B CN201810085009.5A CN201810085009A CN110097488B CN 110097488 B CN110097488 B CN 110097488B CN 201810085009 A CN201810085009 A CN 201810085009A CN 110097488 B CN110097488 B CN 110097488B
Authority
CN
China
Prior art keywords
watermark
information
data
webpage
bar code
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810085009.5A
Other languages
Chinese (zh)
Other versions
CN110097488A (en
Inventor
马越
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Alibaba Group Holding Ltd
Original Assignee
Alibaba Group Holding Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201810085009.5A priority Critical patent/CN110097488B/en
Publication of CN110097488A publication Critical patent/CN110097488A/en
Application granted granted Critical
Publication of CN110097488B publication Critical patent/CN110097488B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing
    • G06T1/0021Image watermarking

Abstract

The application discloses a method for generating an invisible digital watermark, which comprises the following steps: acquiring data information of a watermark to be generated and data information of a host webpage; acquiring host webpage background information according to the host webpage information; taking the background information data of the host webpage and the information data which are different from the background information data by a specified gray scale as bar code coding data, and bar code coding the data information of the watermark to generate coded watermark information; embedding the encoded watermark information into the background information data of the host webpage. The technical difficulties of small information storage amount, invariable watermark information and carrier content fixation and invisible digital watermark in the prior art are solved.

Description

Invisible digital watermark generation and extraction method and device
Technical Field
The application relates to a watermarking technology, in particular to a method for generating and extracting an invisible digital watermark. The application also relates to a device for generating and extracting the invisible digital watermark and an electronic device of the method for generating and extracting the invisible digital watermark.
Background
Traditional watermarks were originally applied to paper, and clamped in the paper rather than on the surface of the paper during the papermaking process, and patterns, figures or characters with bright and dark textures can be seen when light is transmitted. The technology for manufacturing the watermark is still used up to the present, and the technology is improved and improved, so that the technology is adopted in the manufacturing process of paper money, invoice, securities and the like to achieve the purposes of anti-counterfeiting and anti-counterfeiting. With the development of information technology, a digital watermarking technology is generated, information such as a provenance, an author, a company logo and the like of a digital carrier is usually embedded into the digital carrier as a digital watermark, such as a multimedia file, an electronic document and software, the use value of the original carrier is not affected, the original carrier is not easily modified again, and copyright and the like are usually declared to be adopted in the way.
Although the prior art has widely used digital watermarking technology for digital carriers, the watermark content is usually words, patterns, etc., which have a clear content and only play a role in declaration or marking, and the storage space of the watermark content is quite limited, and is usually a small word or a picture, such as a word of company name or a pattern of company logo marked on the digital carrier. The watermark generated by the digital watermarking technology can be encrypted by invisible watermark, but the stored information is small in quantity, is prerendered and unchangeable, and the carrier content is fixed. How to generate a hidden watermark with large information storage capacity and changeable information and carrier content is still a technical problem to be solved.
For example, the application number is: 201410217257.3A Chinese patent application entitled "digital image falsification detection method with invisible watermark" provides a detection method of invisible watermark, specifically, invisible encryption is performed on a digital image, a host image and an encrypted watermark image are respectively represented in a pixel matrix form, the digital image with the invisible watermark is decoded, extracted and restored, if the restored image is the same as the pixel matrix of the host image, the host image is not falsified, otherwise, the host image is falsified.
Although the prior art mentioned above refers to a detection method of an invisible watermark, the detection method is usually used for copyright protection, the watermark only plays a role in identification, the information storage amount is small, the watermark is prerendered and cannot be changed, the carrier content is unchanged, and the requirements of large information storage amount, variable information and carrier content and invisible digital watermark cannot be met.
Disclosure of Invention
The application provides a generation method for an invisible digital watermark and an extraction method for the invisible digital watermark, which are used for solving the technical difficulties of the prior art that the information storage amount of the watermark is small, the watermark information and the carrier content are fixed and invariable, and the invisible digital watermark is realized.
The application provides a method for generating an invisible digital watermark, which comprises the following steps:
acquiring data information of a watermark to be generated and data information of a host webpage;
acquiring host webpage background information according to the host webpage information;
taking the background information data of the host webpage and the information data which are different from the background information data by a specified gray scale as bar code coding data, and bar code coding the data information of the watermark to generate coded watermark information;
Embedding the encoded watermark information into the background information data of the host webpage.
Preferably, the host webpage background information data and the information data different from the background information data by a specified gray scale are taken as barcode coding dark and light data, the watermark data information is barcode coded, and the generation of the coded watermark information specifically comprises:
performing bar code coding on the watermark information to generate first watermark information;
and according to the background information data of the host webpage and the information data which is different from the background information data by a specified gray scale and is barcode coding dark and light data, adjusting the first watermark information code to generate second watermark information, and taking the second watermark information as the coded watermark information.
Preferably, the bar code encoding of the watermark data information specifically includes:
and carrying out one-dimensional bar code coding or two-dimensional bar code coding on the watermark data information.
Preferably, the bar code encoding of the watermark data information specifically includes: performing two-dimensional bar code coding on the watermark data information;
the two-dimensional code comprises any one of the following codes: QRCode, data Matrix, maxi Code, aztec, vericode, PDF417, ultracode, code, or Code 16K.
Preferably, the bar code encoding the watermark data information includes:
selecting a coding system;
determining whether the length of watermark data information to be encoded is less than or equal to the maximum capacity of the selected codebook,
and if not, compressing the watermark data information to be encoded.
Preferably, the bar code encoding the watermark data information includes:
selecting a coding system;
determining whether the length of watermark data information to be encoded is less than or equal to the maximum capacity of the selected codebook,
if not, uploading the watermark data information to be encoded to a server;
receiving a Uniform Resource Locator (URL) of the watermark data information storage to be coded, which is issued by a server side;
and encoding the uniform resource locator.
Preferably, before the watermark data information is bar code encoded, the method further comprises encrypting the watermark data information.
Preferably, the host web page includes: browser web pages or web pages embedded in APP.
Preferably, the encoded watermark information is embedded into the background information data of the host webpage, specifically: embedding the encoded watermark information into the host webpage-webpage background information data in a tiling mode.
The application provides a generation device of an invisible data watermark, which comprises the following components:
the information acquisition unit is used for acquiring the data information of the watermark to be generated and the data information of the host webpage;
the webpage background information acquisition unit is used for extracting the background information of the host webpage from the information data of the host webpage;
the watermark generation unit is used for performing bar code coding on the data information of the watermark according to the data of the background information of the host webpage and the data of the information which is different from the background information by a specified gray scale and is the data of the bar code coding, so as to generate the coded watermark information;
and the watermark embedding unit is used for embedding the encoded watermark information into the background information data of the host webpage.
The application also provides an electronic device for generating the invisible digital watermark, which comprises:
a processor;
a memory for storing a program of a method of generating a hidden watermark, which when read and executed by the processor performs the operations of:
acquiring data information of a watermark to be generated and data information of a host webpage;
acquiring host webpage background information according to the host webpage information;
taking the background information data of the host webpage and the information data which are different from the background information data by a specified gray scale as bar code coding data, and bar code coding the data information of the watermark to generate coded watermark information;
Embedding the encoded watermark information into the background information data of the host webpage.
The application provides an extraction method of an invisible digital watermark, which comprises the following steps:
opening a webpage or a webpage screenshot;
identifying whether the background of the opened webpage or webpage screenshot contains a invisible watermark coded by a bar code;
if yes, extracting the invisible watermark of the bar code contained in the host webpage background;
recovering the invisible watermark of the bar code contained in the host webpage background into a bar code with specified gray scale;
and acquiring data information stored in the bar code for recovering the designated gray scale.
Preferably, the identifying whether the background of the opened webpage or the webpage screenshot contains the invisible watermark encoded by the barcode further includes:
if the background of the opened webpage or webpage screenshot does not contain the invisible watermark of the bar code, ending.
Preferably, the specified gray scale is determined according to the background color of the host webpage, and includes:
reading the background color of the host webpage;
if the background color of the host webpage is white, the color value of the dark part of the invisible watermark coded by the bar code is changed to "#000000", and the color value of the light part is changed to "# FFFFFF".
Preferably, the acquiring the data information stored in the bar code for recovering the designated gray scale includes:
decoding the data information stored in the bar code restored to the specified gray level by using a decoding tool;
and displaying the decoded data information.
The application provides an extraction device of an invisible digital watermark, which comprises:
the invisible watermark carrier acquisition unit is used for opening a carrier webpage or a webpage screenshot of the invisible watermark;
the invisible watermark identifying unit is used for identifying whether the background of the opened webpage or the webpage screenshot contains the invisible watermark of the bar code;
the invisible watermark extraction unit is used for extracting the invisible watermark of the bar code contained in the host webpage background;
the invisible watermark recovery unit is used for recovering the invisible watermark of the barcode code contained in the host webpage background into the barcode with the specified gray level;
and the data information acquisition unit is used for acquiring the data information stored by the bar code for recovering the designated gray scale.
The application also provides an electronic device for extracting the invisible digital watermark, which comprises:
a processor;
a memory for storing a program of a method of extracting a digital watermark in a concealed form, which when read and executed by the processor performs the operations of:
Opening a webpage or a webpage screenshot;
identifying whether the background of the opened webpage or webpage screenshot contains a invisible watermark coded by a bar code;
if yes, extracting the invisible watermark of the bar code contained in the host webpage background;
recovering the invisible watermark of the bar code contained in the host webpage background into a bar code with specified gray scale;
and acquiring data information stored in the bar code for recovering the designated gray scale.
The application provides a method for generating an invisible digital watermark, which is characterized by comprising the following steps of:
obtaining watermark data information to be generated and host webpage background data information;
performing Fourier transform on the background data information of the host webpage to generate frequency domain data;
after the data information of the watermark to be generated is coded, the data information is overlapped into the frequency domain data;
and carrying out inverse Fourier transform on the frequency domain data superimposed with the watermark data information to generate transformed host webpage background data information.
Preferably, the fourier transforming the background data of the host web page includes:
generating a background picture according to the background color information of the host webpage, and performing Fourier transform on the generated background picture to generate a picture of frequency domain data.
Preferably, the encoding the data information of the watermark to be generated, and adding the encoded data information to the frequency domain data, includes:
performing bar code coding on data information to be generated with watermark;
encoding the watermark picture subjected to bar code encoding;
and superposing the encoded watermark picture on a frequency domain data picture generated by the background information data of the host webpage.
Preferably, the bar code encoding of the data information to be watermarked specifically includes:
and carrying out one-dimensional bar code coding or two-dimensional bar code coding on the watermark data information.
Preferably, the bar code encoding of the watermark data information specifically includes: performing two-dimensional bar code coding on the watermark data information;
the two-dimensional code comprises any one of the following codes: QRCode, data Matrix, maxi Code, aztec, vericode, PDF417, ultracode, code, or Code 16K.
Preferably, the bar code encoding the watermark data information includes:
selecting a coding system;
determining whether the length of watermark data information to be encoded is less than or equal to the maximum capacity of the selected codebook,
and if not, compressing the watermark data information to be encoded.
Preferably, the bar code encoding the watermark data information includes:
selecting a coding system;
determining whether the length of watermark data information to be encoded is less than or equal to the maximum capacity of the selected codebook,
if not, uploading the watermark data information to be encoded to a server;
receiving a Uniform Resource Locator (URL) of the watermark data information storage to be coded, which is issued by a server side;
and encoding the uniform resource locator.
Preferably, before the watermark data information is bar code encoded, the method further comprises encrypting the watermark data information.
Preferably, the host web page includes: browser web pages or web pages embedded in APP.
The application provides a device for generating an invisible digital watermark, which comprises the following components:
the data information acquisition unit is used for acquiring watermark data information to be generated and host webpage background data information;
the frequency domain data generating unit is used for carrying out Fourier transform on the background data information of the host webpage to generate frequency domain data;
the watermark data information superposition unit is used for superposing the data information of the watermark to be generated into the frequency domain data after encoding the data information;
and the webpage background data information generating unit is used for carrying out inverse Fourier transform on the frequency domain data superimposed with the watermark data information to generate transformed host webpage background data information.
The application also provides an electronic device for generating the invisible digital watermark, which comprises:
a processor;
a memory for storing a program of a method of generating a digital invisible watermark, which when read and executed by the processor performs the operations of:
obtaining watermark data information to be generated and host webpage background data information;
performing Fourier transform on the background data information of the host webpage to generate frequency domain data;
after the data information of the watermark to be generated is coded, the data information is overlapped into the frequency domain data;
and carrying out inverse Fourier transform on the frequency domain data superimposed with the watermark data information to generate transformed host webpage background data information.
The application provides an extraction method of an invisible digital watermark, which comprises the following steps:
opening a webpage or a webpage screenshot;
identifying whether the background of the opened webpage or webpage screenshot contains a hidden watermark of Fourier transform;
if yes, carrying out Fourier transform and decoding on the invisible watermark of the Fourier transform contained in the host webpage background to obtain a watermark image;
and acquiring data information stored in the watermark image.
Preferably, the identifying whether the background of the opened webpage or the webpage screenshot contains the fourier transform invisible watermark further includes:
If the background of the opened webpage or webpage screenshot does not contain the invisible watermark of Fourier transform, ending.
Preferably, the fourier transforming and decoding the fourier transformed invisible watermark contained in the background of the host webpage includes;
performing Fourier transform on the invisible watermark of the Fourier transform contained in the host webpage background to obtain a frequency domain image;
and decoding the frequency domain image to obtain a watermark image.
Preferably, the acquiring the data information stored in the watermark image includes: one or more of character information, picture information and bar code information.
The application provides an extraction device of an invisible digital watermark, which comprises:
the invisible watermark carrier acquisition unit is used for opening a carrier webpage or a webpage screenshot of the invisible watermark;
the invisible watermark identifying unit is used for identifying whether the background of the opened webpage or the webpage screenshot contains the invisible watermark of Fourier transform or not;
the invisible watermark extraction unit is used for carrying out Fourier transform and decoding on the invisible watermark of the Fourier transform contained in the host webpage background to obtain a watermark image; the invisible watermark recovery unit is used for recovering the invisible watermark of the barcode code contained in the host webpage background into the barcode with the specified gray level;
And the data information acquisition unit is used for watermarking the data information stored in the image.
The application also provides an electronic device for extracting the invisible digital watermark, which comprises:
a processor;
a memory for storing a program of a method of extracting a digital watermark in a concealed form, which when read and executed by the processor performs the operations of:
opening a webpage or a webpage screenshot;
identifying whether the background of the opened webpage or webpage screenshot contains a hidden watermark of Fourier transform;
if yes, carrying out Fourier transform and decoding on the invisible watermark of the Fourier transform contained in the host webpage background to obtain a watermark image;
and acquiring data information stored in the watermark image.
The application provides a webpage generation or refreshing method, which is implemented when the webpage is generated or refreshed.
Compared with the prior art, the method for generating the invisible watermark provided by the application has the advantages that the acquired text content of the pre-generated watermark is converted and stored into the bar code, for example, the two-dimensional code, the color of the bar code is changed according to the background color of the embedded webpage, so that the color of the bar code is close to the background color and is not recognized by naked eyes, the invisible effect is achieved, the color of the bar code is converted into the color with large contrast when the bar code is extracted, the invisible effect of the bar code is easy to operate, the invisible purpose is achieved, and the technical difficulties of small information storage amount of the digital watermark, and the fixed and unchangeable watermark information and carrier content are solved.
Drawings
Fig. 1 is a schematic diagram of a method for generating an invisible digital watermark according to a first embodiment of the present application;
fig. 2 is a schematic diagram of a method for extracting a hidden digital watermark according to a second embodiment of the present application;
fig. 3 is a schematic diagram of a method for generating an invisible digital watermark according to a third embodiment of the present application;
fig. 4 is a schematic diagram of a method for extracting a hidden digital watermark according to a fourth embodiment of the present application;
fig. 5 is a schematic diagram of a generating device of an invisible data watermark according to a first embodiment of the present application;
fig. 6 is a schematic diagram of an electronic device for generating an invisible digital watermark according to a first embodiment of the present application;
fig. 7 is a schematic diagram of an extraction device for a hidden data watermark according to a second embodiment of the present application;
fig. 8 is a schematic diagram of an electronic device for extracting a hidden digital watermark according to a second embodiment of the present application;
fig. 9 is a schematic diagram of a generating device of an invisible data watermark according to a third embodiment of the present application;
fig. 10 is a schematic diagram of an electronic device for generating an invisible digital watermark according to a third embodiment of the present application;
fig. 11 is a schematic diagram of an extraction device for a hidden data watermark according to a fourth embodiment of the present application;
fig. 12 is a schematic diagram of an electronic device for extracting a hidden digital watermark according to a fourth embodiment of the present application;
Detailed Description
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present application. The present application may be embodied in many other forms than those herein described, and those skilled in the art will readily appreciate that the present application may be similarly embodied without departing from the spirit or essential characteristics thereof, and therefore the present application is not limited to the specific embodiments disclosed below.
The first embodiment of the present application provides a method for detailed explanation.
Referring to fig. 1, a method for generating an invisible digital watermark according to a first embodiment of the present application is shown.
Step S101, obtaining data information of watermark to be generated and data information of host webpage.
The step is used for acquiring the data information of the watermark to be generated and the data information of the host webpage embedded by the generated watermark information.
The data information to be watermarked is related to the web page, which is usually obtained from a specified web page, and then the generated watermark is embedded into the specified web page for obtaining the data information, namely the host web page, so that the host web page is the web page for obtaining the data information to be watermarked.
The data information to be watermarked includes various information on the host web page, for example, error prompt information generated by program defects caused by programming reasons, the error prompt information and the web page address generating the program defects are combined into data information, and other information related to the web page, for example, equipment information for browsing the web page, background information of the web page, user information logging in the web page and geographic position information. The data information includes Chinese characters, english, various symbols, pictures and the like. The above data information is not fixed, for example, the error prompt information of the web page disappears due to modification, so that the acquired data information may be empty, or other defects may be generated due to modification, and become other error prompt information; browsing the equipment information of the web page, and when the same web page is browsed on different mobile phones and computers, different equipment information can be generated; the background information of the web page can also change irregularly, for example, the upgrade and the reform of the website, the pushing of new topics, and the background color or the background picture can change; the user information and the geographic position information of the login webpage also change along with the login of different users, and the geographic position information also varies in different regions.
The data information to be generated with the watermark can also be input through the background of the webpage, and then is embedded into the webpage to serve as information on the webpage so as to acquire, for example, website keywords which are arranged for facilitating the website to be recorded by a search engine. In general, the website keywords will not change at will, but in some cases, such as changing the website, when a new layout is added, the modification will be performed, so that the data information input through the background of the web page will also change.
The data information to be watermarked may also be fixed, for example, the title of the first page of the website and the title of the sub-column will not change in general, so the data information may be considered to be fixed.
The data information to be watermarked is data information related to the host web page, that is, a part of the data information of the host web page is usually obtained from the host web page or through the host web page.
Step S102, obtaining the background information of the host webpage according to the information of the host webpage.
The step is used for extracting the background information of the host webpage from the information of the host webpage.
In the above step, when obtaining the data information of the watermark to be generated, the data information of many host web pages is also obtained, including error prompt information in the web pages, addresses (url) of the web pages, browsers used for browsing the web pages, background colors of the web pages, logged user information, etc., then the background information of the web pages, that is, the background color information of the web pages, is extracted from the data information of the web pages, and the background color of the web pages is defined by specific codes in the development process of the web pages, and in general, the codes defining the background color of the web pages are the following two writing methods, wherein one writing method is: body { background-color: # FFFFFF; another writing method is < body bgcolor= "# FFFFFF" >, the six hexadecimal numbers behind# represent the background color value of the web page, and some colors can be directly replaced by english, as written by # FFFFFF above, the represented colors are white, so the portions of the two codes defining the background color of the web page above representing colors can replace # FFFFFF with english characters white, so the two writing methods above can be written by body { background-color: white; both methods of representing colors above are relatively common, so when extracting the background color of a web page, a code defining the background color of the web page is first found, and then a six-bit hexadecimal number (FFFFFF) or english (white) representing the color is extracted in the code.
Step S103, taking the background information data of the host webpage and the information data which is different from the background information data by the specified color contrast as bar code coding dark and light data, and bar code coding the watermark data information to generate coded watermark information.
The step is used for encoding the data information of the watermark by taking the background information data of the host webpage, namely the numerical value of the background color and the numerical value of the color which is different from the background color by the specified color contrast as two different colors of the bar code to be generated, and then encoding the data information of the watermark by the bar code, wherein the color of the encoded watermark information is the two colors of the color which is different from the background color of the host webpage by the specified color contrast.
The bar code is composed of lines or patterns with different colors, and can store a special form of picture of corresponding data. The bar code may be a one-dimensional code consisting of a plurality of "bars" and "spaces" of unequal widths, and the code system of the one-dimensional code includes a common EAN code, 39 codes, cross 25 codes, UPC codes, 128 codes, 93 codes, ISBN codes, codabar codes, and the like. Or a two-dimensional code which records data symbol information on a plane by using a certain specific geometric figure according to a certain rule distribution. The two-dimensional Code system comprises common QRCode, data Matrix, maxi Code, aztec, vericode, PDF417, ultracode, code 49 or Code 16K, code One and the like.
In general, the bar code storing the data information is black and white with obvious contrast, and can also be other colors with obvious contrast, such as blue-white, black-yellow, red-white and the like.
If the bar code storing the data information is a one-dimensional code, the one-dimensional code uses a plurality of 'bars' and 'spaces' with different widths to represent the corresponding letter and number binary data information, and because the data capacity of the stored data information is limited, when the one-dimensional code is used for storing data, a set of database is usually built in the background for storing the data corresponding to the bar code.
For example, a database for storing the webpage program defects is established in the background, each piece of error prompt information is pre-stored in the database as one piece of data, when one piece of webpage program defect is acquired, the data corresponding to the program defect prompt information is firstly searched in the database, then the data code of the one-dimensional code corresponding to the data is acquired, and then the data code is converted into binary data to generate the one-dimensional code.
The two-dimensional code stores data formats of geometric shapes corresponding to binary data represented by 0 and 1, and can store various data formats including Chinese, english, various symbols, pictures and the like, namely various data types such as numerical data, character data and the like.
If the bar code storing the data information is a two-dimensional code, the acquired data needs to be converted into binary data, for example, a section of prompt message "syntax error" of the current webpage program defect is acquired! And firstly, treating the English as a string of characters, finding out the binary number value of ASCII codes corresponding to each character in the string of characters, obtaining the binary data of the prompting information, and storing the obtained binary data in the two-dimensional code. If no program defect occurs in the current webpage, that is, no error prompt information exists, the acquired prompt information is empty, a section of text can be used for indicating that no error prompt exists in the current webpage, for example, no error information is found in the current webpage, and then the section of text information is converted into binary data to be stored in the two-dimensional code.
When the maximum storage capacity of the two-dimensional code reaches thousands of characters, the two-dimensional code is used for storing data, and the diversity of the storage data format and the storage capacity of the two-dimensional code can meet basic requirements, and once the length of acquired data information exceeds the storage capacity of one two-dimensional code, the data can be stored by adopting a method for compressing the data information, for example, the data of which the storage capacity of the two-dimensional code is intercepted can be used for storage, or the acquired ground data information can be uploaded to a server for storage, and then a uniform resource locator (url) for storing the data information is coded and stored to the two-dimensional code.
When the one-dimensional code is used, a corresponding database is created in the background, so that the capacity of storing data information by the one-dimensional code is determined by the background database, and the data format stored by the one-dimensional code is also determined by the corresponding database, wherein the data comprises numerical data, character data and the like.
The host web pages include web pages opened on various devices using various browsers, and web pages embedded in the APP.
And then encoding the acquired watermark data information, for example, selecting a two-dimensional code as an encoding mode, if the length of the watermark data information to be encoded is smaller than or equal to the maximum capacity of a selected code system, directly encoding the watermark data information to be encoded by the two-dimensional code to generate first watermark information, wherein the generated first watermark information is usually in two colors with large gray value differences, for example, black and white, and then encoding the first watermark information into dark and light data according to the background information data of the host webpage and information data with specified gray values different from the background information data by using the barcode code.
Next, the value of the background color of the web page is obtained, and in general, the code defining the background color of the web page is the following two writing methods, wherein one writing method is: body { background-color: # FFFFFF; another writing method is < body bgcolor= "# FFFFFF" >, the six hexadecimal numbers behind# represent the background color value of the web page, and some colors can be directly replaced by english, as written by # FFFFFF above, the represented colors are white, so the portions of the two codes defining the background color of the web page above representing colors can replace # FFFFFF with english characters white, so the two writing methods above can be written by body { background-color: white; the two methods of the color are common, if the background color of the web page is directly written into RGB color represented by six-bit hexadecimal data, the color value of the background of the web page can be directly read, if the background color of the web page is represented by English characters, the obtained English characters representing the color are converted into RGB color represented by six-bit hexadecimal data, and the finally obtained values of the background color of the web page are all colors represented by six-bit hexadecimal data.
After the webpage background color is obtained, the color of the bar code is correspondingly converted according to the webpage background color, if the obtained webpage background color is #FFFFFF and the bar code storing the data information is a two-dimensional bar, the color value of the geometrical shape with the darker color of the two-dimensional bar code storing the data information is converted into "# FEFEFEFE", the geometrical shape with the lighter color is consistent with the background color, and the color value is "# FFFFFF".
According to the above conversion method, the bar code color is converted for different webpage background colors, and for example, the background color value of the webpage is #a8a8a8a8in turn, the darker color part of the bar code can be converted into #a7a7a7in turn, the lighter color part is consistent with the webpage background color, and the color value is #a8a8a8in turn. And then embedding the converted two-dimensional code into the webpage background.
If the bar code storing the data information is a one-dimensional code, the color value of the darker bar of the one-dimensional code storing the data information is converted into "# FEFEFEFEFE", the lighter blank part is consistent with the background color, and the color value is "# FFFFFF".
Although the color of the bar code is very similar to the background color of the webpage after conversion, once the bar code is perceived by a user, the bar code subjected to color conversion is encrypted to prevent the bar code from being cracked, for example, a password is set when the two-dimensional code is generated, and the password is input when the two-dimensional code content is extracted to obtain the two-dimensional code content. The color of the bar code is converted according to the color of the background of the webpage and is similar to the color of the background of the webpage, then the bar code after the color conversion is embedded into the background of the webpage, and the bar code needs to be regulated to a proper size before the embedding, because when the bar code is extracted by a later thread, if the information containing the bar code is provided by a screenshot mode, the size of the bar code needs to be reasonably regulated in order to have a complete bar code in the screenshot when the screenshot is a partial screenshot of the webpage, and the bar code is not deformed when the size is regulated, so that the bar code is preferably scaled in an equal proportion, for example, the length of the bar code is set to be 90 pixels, and the bar code is scaled in an equal proportion, and the width of the bar code is regulated in an equal proportion according to the length, so that the bar code is not deformed after the scaling in an equal proportion.
For the same reason, when the bar code is extracted by the postthread, if the information containing the bar code is provided by the screenshot mode, in order to have a complete bar code in the screenshot when the screenshot is a partial screenshot of the webpage, the bar code subjected to equal-proportion scaling needs to be tiled in the horizontal and vertical directions as a webpage background picture to cover the whole webpage background, so that the tiled bar code picture is positioned above the original background color, and the webpage background added with the hidden bar code is not the pure color but is changed into the background picture.
At this time, the color of the bar code is similar to that of the embedded webpage background, so that the bar code is embedded in the webpage background, the bar code achieves the purpose of stealth in the webpage, and the normal use of the webpage content is not influenced.
In the foregoing embodiments, a method for generating an invisible watermark is provided, and in response thereto, the present application also provides a device for generating an invisible digital watermark, please refer to fig. 5.
The device for generating the invisible digital watermark provided by the embodiment comprises:
an information obtaining unit 501, configured to obtain data information of a watermark to be generated and data information of a host webpage;
A web page background information obtaining unit 502, configured to extract background information of a host web page from information data of the host web page;
a watermark generating unit 503, configured to perform barcode encoding on the data information of the watermark according to the data of the background information of the host webpage and the data of information different from the background information by a specified gray scale, which are the data of the barcode encoding, so as to generate encoded watermark information;
watermark embedding unit 504 is configured to embed the encoded watermark information into the background information data of the host web page.
The application also provides an electronic device for generating the invisible digital watermark, refer to fig. 6.
The application provides an electronic device for generating an invisible digital watermark, which comprises:
a processor 601;
a memory 602 for storing a program of a method of generating a hidden watermark, which when read and executed by the processor performs the following operations:
acquiring data information of a watermark to be generated and data information of a host webpage;
acquiring host webpage background information according to the host webpage information;
taking the background information data of the host webpage and the information data which are different from the background information data by a specified gray scale as bar code coding data, and bar code coding the data information of the watermark to generate coded watermark information;
Embedding the encoded watermark information into the background information data of the host webpage.
Referring to fig. 2, a method for extracting an invisible digital watermark according to a second embodiment of the present application is shown.
Step S201, a webpage or screenshot of the webpage is opened.
When the data information stored in the bar code is extracted, the bar code can be obtained by opening a medium webpage or a screenshot of the webpage stored in the bar code.
In the step of the first embodiment, the barcode is converted according to the background color of the web page and is embedded into the web page background, so when the data information stored in the barcode is to be obtained, the web page or the web page screenshot for storing the barcode is opened first.
Step S202, identify whether the background of the opened web page or web page screenshot contains bar codes.
The step is used for judging whether the background of the opened webpage or the webpage screenshot contains a bar code or not.
Before extracting the bar code, the web page or the screenshot of the web page is opened first to judge whether the background of the opened web page or the screenshot of the web page contains the bar code.
The web page comprises a web page opened by inputting a website through a browser, such as a treasured washing commodity page opened by the browser, and can also be opened by a website transmitted by other modes such as a chat tool, for example, a commodity link transmitted in treasured washing, a webpage opened by the browser and checked, and a web page opened by an APP, such as a result page for searching commodities by using the treasured washing APP, or a commodity link shared by friends is opened by the treasured washing APP, and the web pages can be used for identifying whether a bar code is contained in the background.
The webpage screenshot is a screenshot of a webpage opened by using a browser or an APP, and comprises a screenshot performed by using a shortcut key of a device, a screenshot is performed by using a shortcut key or a combination key on a keyboard of a computer for the webpage opened by using the browser or the APP of the computer, and a screenshot is performed by using a specific screenshot shortcut key or a combination key on the device for other mobile devices such as a mobile phone. The screenshot file may be an integral screenshot of the opened web page, or may be a partial screenshot of the key content in the web page.
After the webpage or the webpage screenshot is opened, judging whether the webpage or the webpage screenshot contains the bar code or not, wherein the bar code is possibly embedded into part of the webpage, so that whether the webpage or the webpage screenshot contains the bar code or not is firstly judged, and when the bar code is embedded, the color of the bar code is converted from the color of the background of the webpage, and the color values of the bar code are similar to the color values of the background of the webpage, so that the bar code cannot be recognized at all by naked eyes, and further recognition is needed.
Step S202-1, open the web page. This step is used to open a web page containing a barcode. After the web page is opened, step S202-2 is next performed to determine whether the web page is provided with a background picture. When judging whether the webpage contains the bar code, firstly acquiring the webpage background picture, wherein when the bar code is embedded into the webpage, the bar code is tiled as the webpage background picture to cover the whole webpage background, so that when the bar code is extracted, only the webpage background picture is required to be extracted, and the bar code picture can be possibly acquired. The process of acquiring the data information stored in the bar code is finished. If the code for setting the background picture of the web page exists in the web page code, but the background picture cannot be determined to contain the bar code, further identification is needed, and step S202-3 is executed to extract the color value of the background picture. When the bar code is initially generated, the color of the bar code is converted according to the background color of the webpage, for example, the background color of the webpage is #FFFFFF, one color of the bar code is the same as the background color of the webpage, the color value of the bar code is #FFFFFF, the other color of the bar code is similar to the background color of the webpage, the color value of the bar code is #FEFEFE, and the specific identification method is that the color value of each pixel point of the obtained background picture is extracted, and then the continuous same colors like each other point are spliced into the picture. The next step is step S202-4, which is to judge whether the pictures spliced by the same color conform to the shape of the bar code. If the pictures spliced according to the continuous same color values of the pixel points conform to the shape of the bar code, namely, the pictures spliced by the color values of #FEFEFEFE and #FFFFFF conform to the shape of the bar code, namely, conform to the 'bars' and 'spaces' with different depths of the one-dimensional code for storing data, and also conform to the geometric figure and the basic shape of the stored data of the two-dimensional code, which are the same as the data length represented by the one-dimensional code, the situation that the bar code is contained in the background picture of the webpage can be judged, then step S202-5 is carried out, and the flow of extracting bar code information is carried out. If the pictures spliced according to the continuous same color values of the pixel points do not conform to the shape of the bar code, step S202-6 is executed, and the process is ended. The process of acquiring the data information stored in the bar code is finished.
The method for judging whether the webpage contains the bar code is very similar to the method for judging whether the screenshot of the webpage contains the bar code or not, namely, judging whether the picture spliced by the color values of all the pixel points in the background of the webpage accords with the shape of the bar code or not, and the method is described below.
If a web page screenshot is opened, when judging whether the web screenshot contains a bar code, firstly extracting color values of all pixel points in the web screenshot, when inserting the converted bar code in the web page background, wherein the two colors contained in the bar code are similar, such as a dark color part with color value of #FEFEFEFE and a light color part with color value of #FFFF, if the picture spliced by the pixel points extracted from the two color values in the web screenshot accords with the shape of the bar code, namely accords with the shape of a one-dimensional code and a two-dimensional code, the web screenshot is judged to contain the bar code, then the next step S203 is entered, and if the picture spliced by the pixel points extracted from the web screenshot does not accord with the shape of the bar code, the process of acquiring the data information stored by the bar code is ended.
And step S203, if yes, extracting the invisible watermark of the bar code contained in the background of the host webpage. The step is used for extracting the bar code obtained in the previous step, and changing the gray level of the bar code into the bar code which can be read.
The bar code is obtained in the webpage or the webpage background, but the color values of the bar code are similar, if the bar code at the moment is rendered on the canvas, the bar code cannot be recognized by the bar code reading equipment, so that the bar code needs to be further restored.
For example, the color value of the obtained dark color part of the bar code is #FEFEFEFE, the color value of the light color part of the bar code is #FFFFFF, and if the color value of the canvas used for rendering is #FFFFFF, the light color part of the bar code is consistent with the color of the canvas, the color value #FEFEFEFEFE of the dark color part of the bar code is converted into #000000, that is, the color of the dark color part of the bar code is changed into black, and the dark color part of the bar code is in clear contrast with the white canvas, so that the restoration of the color contrast of the bar code is completed, and then the bar code with clear contrast is rendered on the canvas. The color of the canvas can be arbitrary, the color contrast of the bar code can be changed appropriately according to the color of the canvas, for example, the color of the canvas is yellow, then the color of the dark part of the bar code can be black or blue, and the light part is consistent with the color of the canvas.
The canvas is used for storing bar codes for restoring color contrast, and can be a host webpage event or a newly built webpage or a blank document which is temporarily opened.
Step S205, the data information stored in the bar code for restoring the specified gradation is acquired.
This step is used to acquire the stored content of the bar code restored to the specified gray level.
In the last step, the bar code has been restored to a color with a distinct gray scale, and the stored content of the bar code is read.
The contents of the bar code are typically decoded and read by a tool having the function of identifying the bar code. Such as a smart phone, a hand-held code scanning terminal, etc.
The intelligent mobile phone opens the APP with the bar code recognition function, reads the bar code through the camera, if the bar code is a one-dimensional code, is used for storing a section of webpage error prompt information, firstly analyzes the one-dimensional code to obtain a data code, then finds the error prompt information matched with the data code through a connected database, and finally displays the error prompt information on the mobile phone, so that the data information stored by the one-dimensional code is obtained through the mobile phone.
If the device for analyzing the one-dimensional code is a handheld code scanning terminal, the handheld terminal is connected with a computer host, the computer host is connected with a database, the handheld terminal scans and analyzes the one-dimensional code to obtain a data code, then the data code is sent to the connected computer host, software installed on the computer host is connected with the database to find out information matched with the data code, and finally the information is displayed on a computer display screen, so that the handheld code scanning terminal and the computer are combined to complete the process of reading the data information of the one-dimensional code.
If the data information is stored in the two-dimensional code, the data information is directly stored in the two-dimensional code, the smart phone opens the APP with the function of identifying the bar code, the bar code is read through the camera, for example, the two-dimensional code stores a section of webpage error prompt, the smart phone APP directly analyzes the data information stored in the two-dimensional code, and then the analyzed webpage error prompt information is displayed on the mobile phone. If the length of the two-dimension code data information stored at the moment is larger than the maximum capacity of the two-dimension code storage, reading a uniform resource locator (url) of watermark data storage, and then opening the uniform resource locator to obtain the data information of final watermark storage. If the device for analyzing the two-dimension code is a handheld code scanning terminal, the handheld terminal is connected with a computer host, the handheld terminal scans and analyzes the two-dimension code, and analyzed contents are displayed on a connected computer display screen.
By the method, the analysis of the bar code data is completed. The device and the method for analyzing the bar code information not only have the two types, for example, the APP installed on the intelligent device can identify the bar code stored on the intelligent device in a long-press mode. And uploading the bar code by a decoding program installed on the computer, decoding and displaying the program from the bar code.
In the above embodiment, a method for extracting a hidden watermark is provided, and in response, the present application also provides an apparatus for extracting a hidden digital watermark, please refer to fig. 7.
The device for extracting the invisible digital watermark provided by the embodiment comprises:
the invisible watermark carrier obtaining unit 701 is configured to open a carrier webpage or a webpage screenshot of the invisible watermark;
the invisible watermark identifying unit 702 is configured to identify whether the background of the opened web page or web page screenshot contains an invisible watermark encoded by a barcode;
the invisible watermark extraction unit 703 is configured to extract an invisible watermark of a barcode code contained in the background of the host webpage;
the invisible watermark recovering unit 704 is configured to recover an invisible watermark that extracts a barcode code contained in the background of the host webpage into a barcode with a specified gray level;
and a data information acquisition unit 705 for acquiring data information stored in the bar code for restoring the specified gradation.
The application also provides an electronic device for extracting the invisible digital watermark, and refer to fig. 8.
The application provides an electronic device for extracting an invisible digital watermark, which comprises:
a processor 801;
a memory 802 for storing a program of a method of extracting a digital watermark in a hidden form, which when read and executed by the processor performs the following operations:
Opening a webpage or a webpage screenshot;
identifying whether the background of the opened webpage or webpage screenshot contains a invisible watermark coded by a bar code;
if yes, extracting the invisible watermark of the bar code contained in the host webpage background;
recovering the invisible watermark of the bar code contained in the host webpage background into a bar code with specified gray scale;
and acquiring data information stored in the bar code for recovering the designated gray scale.
Referring to fig. 3, a method for generating an invisible digital watermark according to a third embodiment of the present application is shown.
Step S301, obtaining watermark data information to be generated and host webpage background data information.
The step is used for generating the data information of the watermark and embedding the generated watermark information into the data information of the host webpage.
The method and content for obtaining the data information of the watermark to be generated and the background data information of the host webpage in this step are the same as those described in step S101 and step S102 in the first embodiment, and will not be repeated here, please refer to step S101 and step S102 in the first embodiment.
Step S302, fourier transform is carried out on the background data information of the host webpage, and frequency domain data are generated.
The method comprises the steps of carrying out Fourier transform on acquired background color data information of a host webpage to generate a frequency domain data picture.
The fourier transform representation can represent a certain function satisfying a certain condition as a trigonometric function (sine and/or cosine function) or a linear combination of their integrals.
The signals are frequency-wise and a signal can be seen as a superposition of innumerable sinusoidal signals of different orders.
The above equation is a fourier transform equation, f (t) refers to the time domain signal (for the signal we are time-dependent, whereas the image we are often space-dependent, and ω refers to frequency). The airspace refers to the spatial domain, and the image that we see daily is the airspace. The time domain signal is replaced by the space domain signal, the frequency of the image refers to the strong condition of image gray scale transformation, the background data information of the host webpage is the space domain, and the space domain data information is transformed into the frequency domain data information according to the gray scale of the image by utilizing a Fourier transformation formula. For example, the obtained background color of the host webpage is "# FFFFFF", then a picture of the background color of the host webpage is generated, and then the background picture of the host webpage is changed into a frequency domain data picture by using a fourier transform formula.
Step S303, after encoding the data information of the watermark to be generated, the data information is superimposed into the frequency domain data
The step is used for superposing the encoded watermark picture and the host webpage background picture after Fourier transformation to generate a frequency domain picture with watermark information.
Firstly, writing data information of watermark to be generated into bar code, the bar code is composed of lines or patterns with different colors, and a special form of picture of corresponding data can be stored. The bar code may be a one-dimensional code consisting of a plurality of "bars" and "spaces" of unequal widths, and the code system of the one-dimensional code includes a common EAN code, 39 codes, cross 25 codes, UPC codes, 128 codes, 93 codes, ISBN codes, codabar codes, and the like. Or a two-dimensional code which records data symbol information on a plane by using a certain specific geometric figure according to a certain rule distribution. The two-dimensional Code system comprises common QRCode, data Matrix, maxi Code, aztec, vericode, PDF417, ultracode, code 49 or Code 16K, code One and the like.
If the bar code storing the data information is a one-dimensional code, the one-dimensional code uses a plurality of 'bars' and 'spaces' with different widths to represent the corresponding letter and number binary data information, and because the data capacity of the stored data information is limited, when the one-dimensional code is used for storing data, a set of database is usually built in the background for storing the data corresponding to the bar code. When the maximum storage capacity of the two-dimensional code reaches thousands of characters, the two-dimensional code is used for storing data, a set of database is not needed to be additionally established because the diversity of the storage data format and the storage capacity of the two-dimensional code can meet the basic requirements, the acquired data information is converted into binary data and then is directly stored in the two-dimensional code, and once the length of the acquired data information exceeds the storage capacity of one two-dimensional code, two or more two-dimensional codes can be adopted for storing data. The data can be stored by adopting a method of compressing the data information, for example, the data of which the storage capacity of the two-dimensional code is intercepted can be used for storage, or the acquired ground data information can be uploaded to a server for storage, and then the uniform resource locator (url) for storing the data information is coded and stored to the two-dimensional code.
When the one-dimensional code is used, a corresponding database is created in the background, so that the capacity of storing data information by the one-dimensional code is determined by the background database, and the data format stored by the one-dimensional code is also determined by the corresponding database, wherein the data comprises numerical data, character data and the like.
The host web pages include web pages opened on various devices using various browsers, and web pages embedded in the APP.
And then, performing bar code coding on the acquired watermark data information, for example, selecting a two-dimensional code as a coding mode, if the length of the watermark data information to be bar coded is smaller than or equal to the maximum capacity of a selected code system, directly performing two-dimensional code coding on the watermark data information to be bar coded, and if the bar code storing the data information is a one-dimensional code, performing one-dimensional code bar code coding on the data information.
The method is characterized in that when the bar code is extracted later, if the information comprising the bar code is provided by a screenshot, and when the screenshot is a partial screenshot of a webpage, the size of the bar code is required to be reasonably adjusted in order to obtain a complete bar code in the screenshot, and the bar code is not deformed while the size is adjusted, so that the best method is to scale the bar code equally, for example, setting the length of the bar code to 90 pixels, and scaling equally in a burst mode, the width of the bar code is adjusted equally according to the length, so that the bar code is not scaled after scaling, regardless of a long one-dimensional code or a square two-dimensional code.
For the same reason, when the bar code is extracted by the postthread, if the information containing the bar code is provided by the screenshot mode, in order to have a complete bar code in the screenshot, the bar code subjected to equal-proportion scaling needs to be tiled in the horizontal and vertical directions as a web page background picture to cover the whole web page background, so that the tiled bar code picture is positioned above the web page background frequency domain picture.
At this time, a fourier transformed frequency domain map of the background of the host web page and the superimposed watermark is obtained.
Step S304, carrying out inverse Fourier transform on the frequency domain data superimposed with the watermark data information to generate transformed host webpage background data information.
And the step is used for carrying out inverse Fourier transform on the frequency domain graph overlapped with the watermark data information to generate the background data information of the host webpage containing the watermark information.
Through step S302 and step S303, the host webpage background frequency domain image is overlapped with the encoded watermark bar code image, the host webpage background frequency domain image overlapped with the encoded watermark bar code image is subjected to inverse Fourier transform in the step, namely inverse Fourier transform operation, namely the host webpage background frequency domain image overlapped with the encoded watermark bar code image is changed into the host webpage background image, the bar code is embedded in the webpage background which cannot be perceived by naked eyes of the inverse transformed background image, and the purpose of invisible bar code is achieved in the webpage without affecting normal use of webpage content.
In the foregoing embodiments, a method for generating an invisible watermark is provided, and in response thereto, the present application also provides a device for generating an invisible digital watermark, please refer to fig. 9.
The device for generating the invisible digital watermark provided by the embodiment comprises:
the data information acquisition unit 901 is configured to acquire watermark data information to be generated and host webpage background data information;
a frequency domain data generating unit 902, configured to perform fourier transform on the background data information of the host webpage, and generate frequency domain data;
a watermark data information superimposing unit 903, configured to encode the data information to be watermarked and superimpose the encoded data information into the frequency domain data;
the webpage background data information generating unit 904 is configured to perform inverse fourier transform on the frequency domain data superimposed with the watermark data information, and generate transformed host webpage background data information.
The application also provides an electronic device for generating the invisible digital watermark, refer to fig. 10.
The application provides an electronic device for generating an invisible digital watermark, which comprises:
a processor 1001;
a memory 1002 for storing a program of a method of generating a digital invisible watermark, which when read and executed by the processor performs the following operations:
Obtaining watermark data information to be generated and host webpage background data information;
performing Fourier transform on the background data information of the host webpage to generate frequency domain data;
after the data information of the watermark to be generated is coded, the data information is overlapped into the frequency domain data;
and carrying out inverse Fourier transform on the frequency domain data superimposed with the watermark data information to generate transformed host webpage background data information.
Referring to fig. 4, a method for extracting an invisible digital watermark according to a fourth embodiment of the present application is shown.
Step S401, a webpage or screenshot of the webpage is opened.
When the data information stored in the bar code is extracted, the step is used for firstly opening a medium webpage or a screenshot of the webpage stored in the bar code to acquire the bar code.
In the third embodiment, the bar code is used to store data information and is embedded into the background of the web page, so when the data information stored by the bar code is to be obtained, the web page or the web page screenshot for storing the bar code is opened first.
Step S402, whether the background of the opened webpage or webpage screenshot contains a hidden watermark of Fourier transform is identified.
The method is used for judging whether the background of the opened webpage or the webpage screenshot contains the invisible watermark of Fourier transform.
The web page comprises a web page opened by inputting a website through a browser, such as a treasured washing commodity page opened by the browser, and can also be opened by a website transmitted by other modes such as a chat tool, for example, a commodity link transmitted in treasured washing, a webpage opened by the browser and checked, and a web page opened by an APP, such as a result page for searching commodities by using the treasured washing APP, or a commodity link shared by friends is opened by the treasured washing APP, and the web pages can be used for identifying whether a background contains a hidden watermark of Fourier transformation.
The webpage screenshot is a screenshot of a webpage opened by using a browser or an APP, and comprises a screenshot performed by using a shortcut key of a device, a screenshot is performed by using a shortcut key or a combination key on a keyboard of a computer for the webpage opened by using the browser or the APP of the computer, and a screenshot is performed by using a specific screenshot shortcut key or a combination key on the device for other mobile devices such as a mobile phone. The screenshot file may be an integral screenshot of the opened web page, or may be a partial screenshot of the key content in the web page.
Judging whether the webpage or the webpage screenshot contains the invisible watermark of the Fourier transform or not, namely, using the inverse process of generating the invisible watermark of the Fourier transform to identify whether the webpage or the webpage screenshot contains the invisible watermark of the Fourier transform or not.
And step S403, carrying out Fourier transform and decoding on the invisible watermark of the Fourier transform contained in the host webpage background to obtain a watermark image.
The step is used for obtaining the Fourier transform invisible watermark contained in the background of the host webpage.
After the webpage or the webpage screenshot is opened, judging whether the webpage or the webpage screenshot contains the invisible watermark of the Fourier transform, wherein the invisible watermark of the Fourier transform is possibly embedded into part of the webpage, so that firstly, judging whether the webpage or the webpage screenshot contains the invisible watermark of the Fourier transform, and further identification is needed because the invisible watermark of the Fourier transform is good in concealment, so that the invisible watermark of the Fourier transform cannot be identified at all by naked eyes.
Step S402-1 opens a web page. This step is used to open a web page containing a fourier transformed invisible watermark. After the web page is opened, step S402-2 is next performed to determine whether the web page is provided with a background picture. When judging whether the webpage contains the bar code, firstly acquiring the webpage background picture, wherein when embedding the invisible watermark of the Fourier transform into the webpage, the invisible watermark of the Fourier transform is tiled on the webpage background, so that when extracting, only the webpage background picture is required to be extracted, and the invisible watermark picture of the Fourier transform can be possibly acquired. I.e. the process of obtaining the fourier transformed invisible watermark stored data information is ended. If the code for setting the background picture of the web page exists in the web page code, but the background picture cannot be determined, the invisible watermark of the fourier transform is included, so that further recognition is needed, step S402-3 is executed, and the part of the web page is intercepted for the fourier transform. The best method is that the Fourier transform is carried out on the intercepted webpage background part according to the inserted position of the invisible watermark of the Fourier transform at the place without content or with less content on the background, so as to obtain the frequency domain data graph. The next step is step S402-4, encoding the frequency domain data map to obtain a fourier transformed invisible watermark, then decoding the invisible watermark, performing step S202-5, judging whether the decoded invisible watermark contains a watermark barcode, and if so, performing step S202-6 to obtain the data information of the barcode watermark. If the watermark bar code cannot be obtained after decoding, step S202-7 is executed, and the process ends. The process of obtaining the invisible watermark of the bar code Fourier transform is finished.
If a web page screenshot is open, S402-3 is performed, and the portion of the web page is truncated to perform a Fourier transform. The best method is that the Fourier transform is carried out on the intercepted webpage background part according to the inserted position of the invisible watermark of the Fourier transform at the place without content or with less content on the background, so as to obtain the frequency domain data graph. The next step is step S402-4, encoding the frequency domain data map to obtain the hidden watermark of fourier transform, then decoding the hidden watermark, if the watermark bar code cannot be obtained after decoding, executing step S202-7, and ending the process. The process of obtaining the invisible watermark of the bar code Fourier transform is finished.
Step S404, obtaining the data information stored in the watermark image.
The step is used for reading the data information stored by the bar code of the invisible watermark of the Fourier transform.
The contents of the bar code are typically decoded and read by a tool having the function of identifying the bar code. Such as a smart phone, a hand-held code scanning terminal, etc.
The intelligent mobile phone opens the APP with the bar code recognition function, reads the bar code through the camera, if the bar code is a one-dimensional code, is used for storing a section of webpage error prompt information, firstly analyzes the one-dimensional code to obtain a data code, then finds the error prompt information matched with the data code through a connected database, and finally displays the error prompt information on the mobile phone, so that the data information stored by the one-dimensional code is obtained through the mobile phone.
If the device for analyzing the one-dimensional code is a handheld code scanning terminal, the handheld terminal is connected with a computer host, the computer host is connected with a database, the handheld terminal scans and analyzes the one-dimensional code to obtain a data code, then the data code is sent to the connected computer host, software installed on the computer host is connected with the database to find out information matched with the data code, and finally the information is displayed on a computer display screen, so that the handheld code scanning terminal and the computer are combined to complete the process of reading the data information of the one-dimensional code.
If the data information is stored in the two-dimensional code, the data information is directly stored in the two-dimensional code, the smart phone opens the APP with the function of identifying the bar code, the bar code is read through the camera, for example, the two-dimensional code stores a section of webpage error prompt, the smart phone APP directly analyzes the data information stored in the two-dimensional code, and then the analyzed webpage error prompt information is displayed on the mobile phone. If the length of the two-dimension code data information stored at the moment is larger than the maximum capacity of the two-dimension code storage, reading a uniform resource locator (url) of watermark data storage, and then opening the uniform resource locator to obtain the data information of final watermark storage. If the device for analyzing the two-dimension code is a handheld code scanning terminal, the handheld terminal is connected with a computer host, the handheld terminal scans and analyzes the two-dimension code, and analyzed contents are displayed on a connected computer display screen.
By the method, the analysis of the bar code data is completed. The device and the method for analyzing the bar code information not only have the two types, for example, the APP installed on the intelligent device can identify the bar code stored on the intelligent device in a long-press mode. And uploading the bar code by a decoding program installed on the computer, decoding and displaying the program from the bar code.
In the above embodiment, a method for extracting a hidden watermark is provided, and in response, the present application also provides an apparatus for extracting a hidden digital watermark, please refer to fig. 11.
The device for extracting the invisible digital watermark provided by the embodiment comprises:
an invisible watermark carrier obtaining unit 1101, configured to open a carrier web page or a web page screenshot of an invisible watermark;
the invisible watermark identifying unit 1102 is configured to identify whether the background of the opened web page or web page screenshot contains a fourier transform invisible watermark;
the invisible watermark extraction unit 1103 is configured to perform fourier transform and decoding on the fourier transformed invisible watermark contained in the background of the host webpage, so as to obtain a watermark image; the invisible watermark recovery unit is used for recovering the invisible watermark of the barcode code contained in the host webpage background into the barcode with the specified gray level;
A data information acquisition unit 1104 for watermarking the data information stored in the image.
The application also provides an electronic device for extracting the invisible digital watermark, and please refer to fig. 12.
The application provides an electronic device for extracting an invisible digital watermark, which comprises:
a processor 1201;
a memory 1202 for storing a program of a method of extracting a digital watermark in a hidden form, which when read and executed by the processor performs the following operations:
opening a webpage or a webpage screenshot;
identifying whether the background of the opened webpage or webpage screenshot contains a hidden watermark of Fourier transform;
if yes, carrying out Fourier transform and decoding on the invisible watermark of the Fourier transform contained in the host webpage background to obtain a watermark image;
and acquiring data information stored in the watermark image.
The fifth embodiment of the application provides a webpage generating or refreshing method.
The embodiment is used for executing the step of regenerating the watermark bar code if the data information for generating the watermark changes when the meat page is generated or refreshed. The step of regenerating the watermark bar code is to execute step S101-step S104.
Although the present application has been described with reference to the above embodiments, it should be understood that the present application is not limited thereto, and that various changes and modifications may be made by those skilled in the art without departing from the spirit and scope of the present application, and therefore, the scope of the present application is defined by the appended claims.
In one typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include volatile memory in a computer-readable medium, random Access Memory (RAM) and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of computer-readable media.
1. Computer readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for a computer include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device. Computer readable media, as defined herein, does not include non-transitory computer readable media (transmission media), such as modulated data signals and carrier waves.
2. It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.

Claims (18)

1. The method for generating the invisible digital watermark is characterized by comprising the following steps of:
acquiring data information of a watermark to be generated and data information of a host webpage;
acquiring host webpage background information according to the host webpage information;
and performing bar code coding on the data information of the watermark, wherein the bar code coding comprises the following steps: preprocessing watermark data information to be encoded based on the capacity of an encoding system, and generating encoded watermark information by taking background information data of the host webpage and information data which are different from the background information data by specified gray scales as data of bar code encoding darkness and light colors;
embedding the encoded watermark information into the background information data of the host webpage.
2. The method for generating an invisible digital watermark according to claim 1, wherein the method for generating encoded watermark information comprises the steps of encoding the watermark data information by using the background information data of the host web page and information data different from the background information data by a specified gray scale as barcode encoded dark and light data, and encoding the watermark data information by the barcode, wherein the method comprises the steps of:
performing bar code coding on the watermark information to generate first watermark information;
and according to the background information data of the host webpage and the information data which is different from the background information data by a specified gray scale and is barcode coding dark and light data, adjusting the first watermark information code to generate second watermark information, and taking the second watermark information as the coded watermark information.
3. The method for generating an invisible digital watermark according to claim 1 or 2, wherein the bar code encoding of the watermark data information is specifically:
and carrying out one-dimensional bar code coding or two-dimensional bar code coding on the watermark data information.
4. The method for generating an invisible digital watermark according to claim 1 or 2, wherein the bar code encoding of the watermark data information is specifically: performing two-dimensional bar code coding on the watermark data information;
The two-dimensional bar code comprises any one of the following codes: QRCode, data Matrix, maxi Code, aztec, vericode, PDF417, ultracode, code, or Code 16K.
5. The method for generating an invisible digital watermark according to claim 1 or 2, wherein bar code encoding the watermark data information comprises:
selecting a coding system;
judging whether the length of the watermark data information to be encoded is smaller than or equal to the maximum capacity of the selected code system, and if not, compressing the watermark data information to be encoded.
6. The method for generating an invisible digital watermark according to claim 1 or 2, wherein bar code encoding the watermark data information comprises:
selecting a coding system;
determining whether the length of watermark data information to be encoded is less than or equal to the maximum capacity of the selected codebook,
if not, uploading the watermark data information to be encoded to a server;
receiving a Uniform Resource Locator (URL) of the watermark data information storage to be coded, which is issued by a server side;
and encoding the uniform resource locator.
7. The method of claim 1 or 2, further comprising encrypting the watermark data information before bar coding the watermark data information.
8. The method for generating an invisible digital watermark according to claim 1, wherein the host web page comprises: browser web pages or web pages embedded in APP.
9. The method for generating an invisible digital watermark according to claim 1, wherein the embedding of the encoded watermark information into the host web page background information data is specifically: embedding the encoded watermark information into the host webpage-webpage background information data in a tiling mode.
10. A device for generating an invisible data watermark, comprising:
the information acquisition unit is used for acquiring the data information of the watermark to be generated and the data information of the host webpage;
the webpage background information acquisition unit is used for extracting the background information of the host webpage from the information data of the host webpage;
the watermark generation unit is used for carrying out bar code coding on the data information of the watermark, and comprises the following steps: preprocessing watermark data information to be encoded based on the capacity of an encoding system, and generating encoded watermark information according to the background information data of the host webpage and information data which differ from the background information data by a specified gray scale, wherein the information data is bar code encoded dark and light data;
And the watermark embedding unit is used for embedding the encoded watermark information into the background information data of the host webpage.
11. An electronic device for generating an invisible digital watermark, comprising:
a processor;
a memory for storing a program of a method of generating a hidden watermark, which when read and executed by the processor performs the operations of:
acquiring data information of a watermark to be generated and data information of a host webpage;
acquiring host webpage background information according to the host webpage information;
and performing bar code coding on the data information of the watermark, wherein the bar code coding comprises the following steps: preprocessing watermark data information to be encoded based on the capacity of an encoding system, and generating encoded watermark information by taking background information data of the host webpage and information data which are different from the background information data by specified gray scales as data of bar code encoding darkness and light colors;
embedding the encoded watermark information into the background information data of the host webpage.
12. An extraction method of an invisible digital watermark generated based on claim 1, comprising:
opening a webpage or a webpage screenshot;
identifying whether the background of the opened webpage or webpage screenshot contains a invisible watermark coded by a bar code;
If yes, extracting the invisible watermark of the bar code contained in the host webpage background;
recovering the invisible watermark extracted from the barcode code contained in the background of the host webpage into a barcode with specified gray scale, wherein the specified gray scale is determined according to the contrast ratio of the background color of the host webpage and the color of the invisible watermark;
and acquiring data information stored in the bar code for recovering the designated gray scale.
13. The method for extracting a hidden digital watermark according to claim 12, wherein said identifying whether the background of the opened web page or web page screenshot contains a barcode coded hidden watermark, further comprises:
if the background of the opened webpage or webpage screenshot does not contain the invisible watermark of the bar code, ending.
14. The method of claim 12, wherein determining the specified gray scale according to the contrast between the background color of the host web page and the color of the invisible watermark comprises:
reading the background color of the host webpage;
if the background color of the host webpage is white, the color value of the dark part of the invisible watermark coded by the bar code is changed to "#000000", and the color value of the light part is changed to "# FFFFFF".
15. The method for extracting an invisible digital watermark according to claim 12, wherein the acquiring the data information stored in the barcode for recovering the specified gray scale comprises:
decoding the data information stored in the bar code restored to the specified gray level by using a decoding tool;
and displaying the decoded data information.
16. An extraction device based on the invisible digital watermark generated in claim 1, comprising:
the invisible watermark carrier acquisition unit is used for opening a carrier webpage or a webpage screenshot of the invisible watermark;
the invisible watermark identifying unit is used for identifying whether the background of the opened webpage or the webpage screenshot contains the invisible watermark of the bar code;
the invisible watermark extraction unit is used for extracting the invisible watermark of the bar code contained in the host webpage background;
the invisible watermark recovery unit is used for recovering the invisible watermark which is obtained by extracting the barcode codes contained in the background of the host webpage into the barcode with the specified gray level, and the specified gray level is determined according to the contrast ratio of the background color of the host webpage and the color of the invisible watermark;
and the data information acquisition unit is used for acquiring the data information stored by the bar code for recovering the designated gray scale.
17. An electronic device for extracting an invisible digital watermark generated according to claim 1, comprising:
a processor;
a memory for storing a program of a method of extracting a digital watermark in a concealed form, which when read and executed by the processor performs the operations of:
opening a webpage or a webpage screenshot;
identifying whether the background of the opened webpage or webpage screenshot contains a invisible watermark coded by a bar code;
if yes, extracting the invisible watermark of the bar code contained in the host webpage background;
recovering the invisible watermark extracted from the barcode code contained in the background of the host webpage into a barcode with specified gray scale, wherein the specified gray scale is determined according to the contrast ratio of the background color of the host webpage and the color of the invisible watermark;
and acquiring data information stored in the bar code for recovering the designated gray scale.
18. A method for generating or refreshing a web page, wherein the method for generating the invisible digital watermark according to any one of claims 1 to 9 is performed during the generation or refreshing of the web page.
CN201810085009.5A 2018-01-29 2018-01-29 Invisible digital watermark generation and extraction method and device Active CN110097488B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810085009.5A CN110097488B (en) 2018-01-29 2018-01-29 Invisible digital watermark generation and extraction method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810085009.5A CN110097488B (en) 2018-01-29 2018-01-29 Invisible digital watermark generation and extraction method and device

Publications (2)

Publication Number Publication Date
CN110097488A CN110097488A (en) 2019-08-06
CN110097488B true CN110097488B (en) 2023-10-24

Family

ID=67442163

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810085009.5A Active CN110097488B (en) 2018-01-29 2018-01-29 Invisible digital watermark generation and extraction method and device

Country Status (1)

Country Link
CN (1) CN110097488B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110909322B (en) * 2019-11-29 2020-12-11 杭州天谷信息科技有限公司 Intelligent printing document processing system and method based on HVS
CN112529757B (en) * 2020-12-04 2024-01-19 平安科技(深圳)有限公司 Screen information protection method, device, computer equipment and readable storage medium
CN112581549B (en) * 2020-12-16 2023-08-01 合肥图溯信息技术有限公司 Picture tracing method, storage medium, electronic device and host device

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1889428A (en) * 2006-08-01 2007-01-03 西南交通大学 Biological characteristic data safety hidden transmitting method under network environment
CN101149779A (en) * 2007-11-06 2008-03-26 天津市阿波罗信息技术有限公司 Method for embedding government application file content in paper medium
TW200849135A (en) * 2007-06-12 2008-12-16 Univ Nat Chunghsing A robust watermarking method for high dynamic range images
CN103500350A (en) * 2013-10-11 2014-01-08 北京邮电大学 Chinese-sensible code and digital watermark-based anti-counterfeit method
CN104408684A (en) * 2014-12-13 2015-03-11 天津远目科技有限公司 Digital watermarking method with high robustness
CN107622470A (en) * 2017-09-01 2018-01-23 杭州趣维科技有限公司 A kind of real-time robust embedding algorithm and extracting method based on Quick Response Code

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1889428A (en) * 2006-08-01 2007-01-03 西南交通大学 Biological characteristic data safety hidden transmitting method under network environment
TW200849135A (en) * 2007-06-12 2008-12-16 Univ Nat Chunghsing A robust watermarking method for high dynamic range images
CN101149779A (en) * 2007-11-06 2008-03-26 天津市阿波罗信息技术有限公司 Method for embedding government application file content in paper medium
CN103500350A (en) * 2013-10-11 2014-01-08 北京邮电大学 Chinese-sensible code and digital watermark-based anti-counterfeit method
CN104408684A (en) * 2014-12-13 2015-03-11 天津远目科技有限公司 Digital watermarking method with high robustness
CN107622470A (en) * 2017-09-01 2018-01-23 杭州趣维科技有限公司 A kind of real-time robust embedding algorithm and extracting method based on Quick Response Code

Also Published As

Publication number Publication date
CN110097488A (en) 2019-08-06

Similar Documents

Publication Publication Date Title
CN111191414B (en) Page watermark generation method, identification method, device, equipment and storage medium
US9177238B2 (en) Techniques for generating customized two-dimensional barcodes
KR100548983B1 (en) Computer system and method for verifying the authenticity of digital documents
CN110097488B (en) Invisible digital watermark generation and extraction method and device
US20040001606A1 (en) Watermark fonts
US20140306019A1 (en) Techniques for generating customized two-dimensional barcodes
Kim et al. Watermarking two dimensional data object identifier for authenticated distribution of digital multimedia contents
CN110766594B (en) Information hiding method and device, detection method and device and anti-counterfeiting tracing method
MX2007001598A (en) Systems and methods for authenticating objects using multiple-level image encoding and decoding.
US9934457B2 (en) Method of securing a two-dimensional barcode
US20160092409A1 (en) Method for obfuscating the display of text
CN112085643B (en) Image desensitization processing method, verification method and device, equipment and medium
Alkhafaji et al. Payload capacity scheme for quran text watermarking based on vowels with kashida
CN110322386A (en) A kind of insertion of digital text watermarking and detection method and device
Su et al. A new watermarking scheme for colour image using QR decomposition and ternary coding
Hill et al. Embedding metadata in images at time of capture using physical Quick Response (QR) codes
Tsai et al. QR code beautification by instance segmentation (IS-QR)
Noore et al. Embedding biometric identifiers in 2D barcodes for improved security
CN109816077A (en) A kind of hidden method of two-dimensional barcode information, device, electronic equipment and storage medium
AU2010238503B2 (en) Two dimensional information symbol
CN112069850A (en) Service providing method, device, equipment and storage medium based on two-dimension code
CN116703427A (en) Anti-counterfeiting tracing method combining dot matrix code and digital watermark
US20190163944A1 (en) Composite information bearing devices
CN114756794A (en) Webpage information anti-leakage method and device
CN104424619B (en) Information processing equipment and information processing method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant