Watermark embedding method, watermark extraction method, and apparatus

By embedding watermarks in e-commerce web pages using homographs and digital encoding algorithms, the problem of easily removed web page watermarks is solved, and watermark embedding and extraction are made more secure and robust without changing the display.

CN114626968BActive Publication Date: 2025-12-16BEIJING WODONG TIANJUN INFORMATION TECH CO LTD +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210327059.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-30
Publication Date
2025-12-16
Estimated Expiration
2042-03-30

AI Technical Summary

Technical Problem

Existing technologies make it easy to remove webpage watermarks in e-commerce scenarios, especially on white backgrounds or when compressed multiple times, making it difficult to effectively protect the copyright and security of sensitive data.

Method used

The identification information is encoded into a watermark code using a homograph and a digital encoding algorithm. After being encrypted with a key, the watermark code is embedded into the field to be processed, generating the target field after watermark encoding. The homograph controls the underlying encoding and display format of the characters to ensure that the watermark is not easily detected.

Benefits of technology

It improves text security and watermark concealment without changing text format and content display, ensuring that the watermark can still be correctly extracted when the format is changed or modified, and has good robustness.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114626968B_ABST
    Figure CN114626968B_ABST
Patent Text Reader

Abstract

Embodiments of the present disclosure provide a watermark embedding method, a watermark extraction method and device. The watermark embedding method comprises the following steps: first, obtaining a to-be-processed field in a to-be-processed text and a watermark insertion length of the to-be-processed field; then, encoding identification information into watermark code based on a coding system of a homograph code table and a digital coding algorithm; determining a to-be-encrypted watermark corresponding to the watermark code based on the watermark insertion length and the watermark code; encrypting the to-be-encrypted watermark based on a key to obtain an encrypted watermark; and finally, encoding the encrypted watermark into the to-be-processed field based on the homograph code table to generate a target field with watermark code, wherein the watermark is embedded by using a control character of the homograph code table on the basis of a general webpage watermark, and only the underlying coding and display form of the to-be-processed field are changed, without any change to the text format and expression content, thereby improving the security of the to-be-processed text and the target field in the to-be-processed text.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] Embodiments of the present disclosure relate to the field of information security technology, in particular to the field of text copyright protection and information processing technology, and more particularly to a watermark embedding method and a watermark extraction method and device. BACKGROUND

[0002] With the continuous development and progress of science and technology, people obtain information by browsing relevant front-end web pages, which has become a main melody in today's society. Correspondingly, in the complex information resources, various problems such as private use of copyright, security of information channels, etc. are endless. For example, in the e-commerce scenario, order data as core sensitive data will cause user privacy leakage if leaked, which will expose users to risks such as fraud, and also have a negative impact on the company and affect the company's business development. However, due to the particularity of the e-commerce scenario, core sensitive data will be used by relevant personnel, such as customer service querying order information to solve user needs, etc. The current watermark adding scheme for front-end web pages is usually to protect the content in any web page based on a unified web page watermark.

[0003] However, due to the fact that the background of the web page is often a single color, if the background of the web page is a white background, simply increasing the brightness of the picture can easily remove the watermark, or multiple compressions during transmission of the picture through social software will cause the watermark to be blurred. Even for web pages with rich colors such as pictures, there are currently ways to remove watermarks based on deep learning, such as noise2noise technology, which can remove the watermark in the web page. SUMMARY

[0004] Embodiments of the present disclosure provide a watermark embedding method, a watermark extraction method, a device, an electronic device and a computer readable medium.

[0005] In a first aspect, embodiments of the present disclosure provide a watermark embedding method, which comprises: obtaining a to-be-processed field in a to-be-processed text and a watermark insertion length of the to-be-processed field; encoding identification information into a watermark code based on a coding system of a homograph different code table and a digital coding algorithm; determining a to-be-encrypted watermark corresponding to the watermark code based on the watermark insertion length and the watermark code; encrypting the to-be-encrypted watermark based on a key to obtain an encrypted watermark; and encoding the encrypted watermark into the to-be-processed field based on the homograph different code table to generate a target field after watermark coding.

[0006] In some embodiments, the encoding mechanism based on the homograph code table and the digital encoding algorithm encodes the identification information into the watermark code, including: encoding the identification information into an initial watermark code based on the digital encoding algorithm; obtaining a first watermark length of the initial watermark code, and determining whether the first watermark length is less than a watermark insertion length; in response to determining that the first watermark length is less than the watermark insertion length, performing a conversion on the initial watermark code based on the encoding mechanism of the homograph code table to obtain the watermark code.

[0007] In some embodiments, based on the watermark insertion length and the watermark code, the watermark code corresponding to the to-be-encrypted watermark is determined, including: in response to determining that a second watermark length of the watermark code is less than the watermark insertion length, performing a calculation on the watermark code based on an error correction code algorithm to generate an error correction code corresponding to the watermark code; based on the watermark code and the error correction code, generating a spliced watermark corresponding to the watermark code; in response to determining that a third watermark length of the spliced watermark is less than the watermark insertion length, performing a length processing on the spliced watermark based on the watermark insertion length to obtain the to-be-encrypted watermark corresponding to the watermark code.

[0008] In some embodiments, based on the homograph code table, the encrypted watermark is encoded into the to-be-processed field to generate a target field after watermark encoding, including: based on the homograph code table, the encrypted watermark is encoded into the to-be-processed field to generate a display field of the target field; based on the homograph code table, a Unicode encoding of the target field is determined; based on the display field and the Unicode encoding of the target field, the target field after watermark encoding is generated.

[0009] In some embodiments, the method further includes: in response to obtaining the target field after watermark encoding, storing the identification information and a text identifier corresponding to the to-be-processed text.

[0010] In a second aspect, embodiments of the present disclosure provide a watermark extraction method, including: decoding a target field in a target text based on a homograph code table to obtain an encrypted watermark corresponding to the target field; decrypting the encrypted watermark based on a key to obtain a to-be-encrypted watermark corresponding to the encrypted watermark; in response to determining that the to-be-encrypted watermark is complete, determining a watermark code corresponding to the to-be-encrypted watermark based on a watermark insertion length of the target field; and determining the watermark code as a target watermark code corresponding to the target field.

[0011] In some embodiments, in response to determining that the to-be-encrypted watermark is complete, the watermark code corresponding to the to-be-encrypted watermark is determined based on the watermark insertion length of the target field, including: in response to determining that the to-be-encrypted watermark is complete, checking whether the to-be-encrypted watermark is correct through an error correction code; and in response to determining that the to-be-encrypted watermark is correct, determining the watermark code corresponding to the to-be-encrypted watermark based on the watermark insertion length of the target field.

[0012] In some embodiments, the method further comprises: in response to determining that the to-be-encrypted watermark is incomplete, determining a suspected code in the to-be-encrypted watermark; performing traversal selection on the suspected code based on the homograph code table to obtain a plurality of suspected watermark codes corresponding to the suspected code; respectively checking the plurality of suspected watermark codes by error correction codes to obtain a suspected watermark code that passes the check; and determining the watermark code as the target watermark code corresponding to the target field, comprising: determining the watermark code and the suspected watermark code that passes the check as the target watermark code corresponding to the target field.

[0013] In some embodiments, the method further comprises: in response to determining that the to-be-encrypted watermark is incomplete, determining a suspected code in the to-be-encrypted watermark; performing traversal selection on the suspected code based on the homograph code table to obtain a plurality of suspected watermark codes corresponding to the suspected code; respectively checking the plurality of suspected watermark codes by error correction codes to obtain a suspected watermark code that passes the check; and determining the watermark code as the target watermark code corresponding to the target field, comprising: determining the watermark code and the suspected watermark code that passes the check as the target watermark code corresponding to the target field.

[0014] In some embodiments, the method further comprises: in response to determining that the to-be-encrypted watermark is incomplete, determining a suspected code in the to-be-encrypted watermark; performing traversal selection on the suspected code based on the homograph code table to obtain a plurality of suspected watermark codes corresponding to the suspected code; respectively checking the plurality of suspected watermark codes by error correction codes to obtain a suspected watermark code that passes the check; and determining the watermark code as the target watermark code corresponding to the target field, comprising: determining the watermark code and the suspected watermark code that passes the check as the target watermark code corresponding to the target field.

[0015] In some embodiments, the method further comprises: in response to determining that the to-be-encrypted watermark is incomplete, determining a suspected code in the to-be-encrypted watermark; performing traversal selection on the suspected code based on the homograph code table to obtain a plurality of suspected watermark codes corresponding to the suspected code; respectively checking the plurality of suspected watermark codes by error correction codes to obtain a suspected watermark code that passes the check; and determining the watermark code as the target watermark code corresponding to the target field, comprising: determining the watermark code and the suspected watermark code that passes the check as the target watermark code corresponding to the target field.

[0016] In some embodiments, the encoding module is further configured to: encode the identification information into an initial watermark code based on a digital encoding algorithm; obtain a first watermark length of the initial watermark code, and determine whether the first watermark length is less than a watermark insertion length; in response to determining that the first watermark length is less than the watermark insertion length, perform a radix conversion on the initial watermark code based on a coding radix of the isomorphic code table to obtain the watermark code.

[0017] In some embodiments, the determining module is further configured to: in response to determining that the second watermark length of the watermark code is less than the watermark insertion length, perform a calculation on the watermark code based on an error correction code algorithm to generate an error correction code corresponding to the watermark code; generate a spliced watermark corresponding to the watermark code based on the watermark code and the error correction code; and in response to determining that a third watermark length of the spliced watermark is less than the watermark insertion length, perform a length processing on the spliced watermark based on the watermark insertion length to obtain a to-be-encrypted watermark corresponding to the watermark code.

[0018] In some embodiments, the generating module is further configured to: encode the encrypted watermark into the to-be-processed field based on the isomorphic code table to generate a display field of the target field; determine a Unicode encoding of the target field based on the isomorphic code table; and generate the target field after watermark encoding based on the display field and the Unicode encoding of the target field.

[0019] In some embodiments, the apparatus further includes a storage module configured to: in response to obtaining the target field after watermark encoding, store the identification information and a text identifier corresponding to the to-be-processed text.

[0020] In a fourth aspect, embodiments of the present disclosure provide a watermark extraction apparatus, which includes: a decoding module configured to decode a target field in a target text based on an isomorphic code table to obtain an encrypted watermark corresponding to the target field; a decryption module configured to decrypt the encrypted watermark based on a key to obtain a to-be-encrypted watermark corresponding to the encrypted watermark; a determining module configured to, in response to determining that the to-be-encrypted watermark is complete, determine a watermark code corresponding to the to-be-encrypted watermark based on a watermark insertion length of the target field; and determine the watermark code as a target watermark code corresponding to the target field.

[0021] In some embodiments, the determining module is further configured to: in response to determining that the to-be-encrypted watermark is complete, verify whether the to-be-encrypted watermark is correct through an error correction code; and in response to determining that the to-be-encrypted watermark is correct, determine a watermark code corresponding to the to-be-encrypted watermark based on a watermark insertion length of the target field.

[0022] In some embodiments, the determining module is further configured to: in response to determining that the to-be-encrypted watermark is incomplete, determine a suspected code in the to-be-encrypted watermark; perform traversal selection on the suspected code based on the homograph code table to obtain a plurality of suspected watermark codes corresponding to the suspected code; respectively perform verification on the plurality of suspected watermark codes by using error correction codes to obtain a suspected watermark code that is verified to be correct; and determine the watermark code and the suspected watermark code that is verified to be correct as a target watermark code corresponding to the target field.

[0023] In some embodiments, the decoding module is further configured to: obtain a target image including a target text, and determine a target region of a target field in the target image; perform detection on the target region based on a text detection algorithm to obtain first position information of the target field; determine second position information of each target character in the target field based on a character recognition algorithm and the first position information; perform character segmentation on the target field based on the second position information of each target character to obtain each target character in the target field; respectively perform character recognition and decoding on each target character based on the homograph code table to obtain a decoding result corresponding to each target character; and obtain an encrypted watermark corresponding to the target field based on the decoding result corresponding to each target character.

[0024] In some embodiments, the apparatus further includes a generating module configured to: in response to determining the target watermark code corresponding to the target field, decode the target watermark code based on an encoding system of the homograph code table and a numerical encoding algorithm to obtain target identification information corresponding to the target watermark code; determine whether the target identification information exists in a plurality of identification information associated with a text identification of the target text; and in response to determining that the target identification information exists, generate prompt information including the target identification information.

[0025] In a fifth aspect, embodiments of the present disclosure provide an electronic device, including: one or more processors; a storage device having one or more programs stored thereon; and when the one or more programs are executed by the one or more processors, the one or more processors implement the watermark embedding method and the watermark extraction method as described in any of the embodiments of the first aspect and the second aspect.

[0026] In a sixth aspect, embodiments of the present disclosure provide a computer-readable medium having a computer program stored thereon, and the computer program is executed by a processor to implement the watermark embedding method and the watermark extraction method as described in any of the embodiments of the first aspect and the second aspect.

[0027] The watermark embedding method provided by the embodiment of the present disclosure comprises the following steps: an execution subject first acquires a to-be-processed field in a to-be-processed text and a watermark insertion length of the to-be-processed field, then encodes identification information into watermark code based on a coding system of a homograph and a digital coding algorithm, determines a to-be-encrypted watermark corresponding to the watermark code based on the watermark insertion length and the watermark code, encrypts the to-be-encrypted watermark based on a key to obtain an encrypted watermark, and finally encodes the encrypted watermark into the to-be-processed field based on the homograph to generate a target field after watermark encoding. The to-be-processed field in the to-be-processed text can be automatically extracted, and on the basis of a general webpage watermark, the watermark is embedded by using a control character of the homograph, only the underlying coding and display form of the to-be-processed field are changed, the text format and expression content are not changed at all, the display of the to-be-processed field is not affected at all, the watermark embedding has no trace and is not easy to be perceived and discovered, and the watermark embedding has good concealment, thereby improving the security of the to-be-processed text and the target field in the to-be-processed text, and the correct extraction of the watermark is not affected by format change, paragraph adjustment and partial modification of the text, and the watermark has good robustness. BRIEF DESCRIPTION OF DRAWINGS

[0028] Other features, objects, and advantages of the present disclosure will become more apparent from the following detailed description of non-limiting embodiments made with reference to the accompanying drawings:

[0029] Figure 1 is an exemplary system architecture diagram to which one embodiment of the present disclosure can be applied;

[0030] Figure 2A is a flowchart of one embodiment of the watermark embedding method according to the present disclosure;

[0031] Figure 2B is a schematic diagram of watermark embedding on an original page according to the watermark embedding method of the present disclosure;

[0032] Figure 3 is a flowchart of one embodiment of encoding identification information into watermark code according to the present disclosure;

[0033] Figure 4 is a flowchart of one embodiment of determining a to-be-encrypted watermark corresponding to watermark code according to the present disclosure;

[0034] Figure 5 is a flowchart of one embodiment of the watermark extraction method according to the present disclosure;

[0035] Figure 6 is a flowchart of another embodiment of the watermark extraction method according to the present disclosure;

[0036] Figure 7 is a flowchart of still another embodiment of the watermark extraction method according to the present disclosure;

[0037] Figure 8 is a structural schematic diagram of one embodiment of a watermark embedding device according to the present disclosure;

[0038] Figure 9 is a structural schematic diagram of one embodiment of a watermark extracting device according to the present disclosure;

[0039] Figure 10 is a structural schematic diagram of an electronic device suitable for implementing embodiments of the present disclosure. DETAILED DESCRIPTION

[0040] The present disclosure will be further described below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely intended for the purpose of illustration of the relevant disclosure and are not intended to limit the disclosure. In addition, it should be noted that only parts related to the disclosure are shown in the accompanying drawings for the purpose of description.

[0041] It should be noted that the embodiments in the present disclosure and the features in the embodiments can be combined with each other without conflict. The present disclosure will be described in detail below with reference to the accompanying drawings and in conjunction with the embodiments.

[0042] Figure 1 An exemplary system architecture 100 of watermark embedding methods, watermark extracting methods and devices to which embodiments of the present disclosure can be applied is shown.

[0043] As shown in Figure 1 , the system architecture 100 can include terminal devices 104, 105, 106, a network 107, servers 101, 102, 103. The network 107 is a medium for providing a communication link between the terminal devices 104, 105, 106 and the servers 101, 102, 103. The network 107 can include various connection types, such as wired, wireless communication links or optical fiber cables, etc.

[0044] A user can interact with the servers 101, 102, 103 belonging to the same server cluster through the terminal devices 104, 105, 106 through the network 107 to receive or send information, etc. Various applications can be installed on the terminal devices 104, 105, 106, such as an item display application, a data analysis application, a search application, etc.

[0045] The terminal device 104, 105, 106 can be hardware or software. When the terminal device is hardware, it can be various electronic devices with a display screen and supporting communication with the server, including but not limited to a smart phone, a tablet computer, a laptop computer, a desktop computer, and the like. When the terminal device is software, it can be installed in the above-mentioned electronic devices. It can be implemented as multiple software or software modules, or as a single software or software module. No specific limitation is made herein.

[0046] The server 101, 102, 103 can be a server providing various services, for example, a background server receiving a request sent by a terminal device establishing a communication connection therewith. The background server can receive and analyze the request sent by the terminal device, and generate a processing result.

[0047] The server 101, 102, 103 can obtain a to-be-processed field in a to-be-processed text and a watermark insertion length of the to-be-processed field, then encode the identification information into a watermark code based on a coding system of the homograph table and a numerical coding algorithm, determine a to-be-encrypted watermark corresponding to the watermark code based on the watermark insertion length and the watermark code, encrypt the to-be-encrypted watermark based on a key to obtain an encrypted watermark, and finally encode the encrypted watermark into the to-be-processed field based on the homograph table to generate a target field after watermark coding.

[0048] Alternatively, the server 101, 102, 103 can decode a target field in a target text based on a homograph table to obtain an encrypted watermark corresponding to the target field, then decrypt the encrypted watermark based on a key to obtain a to-be-encrypted watermark corresponding to the encrypted watermark, determine a watermark code corresponding to the to-be-encrypted watermark based on a watermark insertion length of the target field in response to determining that the to-be-encrypted watermark is complete, and finally determine the watermark code as a target watermark code corresponding to the target field.

[0049] It should be noted that the server can be hardware or software. When the server is hardware, it can be various electronic devices providing various services for terminal devices. When the server is software, it can be implemented as multiple software or software modules providing various services for terminal devices, or as a single software or software module providing various services for terminal devices. No specific limitation is made herein.

[0050] It should be noted that the watermark embedding method and the watermark extraction method provided by the embodiments of the present disclosure can be executed by the server 101, 102, 103. Correspondingly, the watermark embedding device and the watermark extraction device are arranged in the server 101, 102, 103.

[0051] It should be understood that, Figure 1The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.

[0052] refer to Figure 2A The diagram illustrates a flow 200 of an embodiment of a watermark embedding method according to the present disclosure. The watermark embedding method includes the following steps:

[0053] Step 210: Obtain the fields to be processed and the watermark insertion length of the fields to be processed in the text to be processed.

[0054] In this step, the watermark embedding method runs on the execution entity (e.g., Figure 1 Servers 101, 102, and 103 can receive text to be processed from terminal devices via the network or read text to be processed from a local storage database. This text to be processed can be information that needs to be displayed to the user on the terminal device screen, and may include some sensitive fields. These fields can represent sensitive information related to the user and may be information pre-set by the operator based on the type of text to be processed. Therefore, different types of text to be processed can correspond to different fields. For example, the text to be processed may be order data, and sensitive information related to the user may include the user's mobile phone number, email address, order number, product information, shipping address, etc.

[0055] After obtaining the text to be processed, the aforementioned execution entity can analyze and process the text to extract the fields to be processed, thereby obtaining one or more fields from the text. The execution entity can calculate the field length for each field, which can be done by counting the number of characters in the field that need to be embedded with a watermark. This field length is then used as the watermark insertion length, representing the number of bits of watermark to be embedded in the field. For example, if the field to be processed is 123456789, then every character in the field needs to be embedded with a watermark, and the calculated watermark insertion length for the field is 9 bits.

[0056] The aforementioned executing entity can obtain the fields to be processed in the text to be processed through any means supported by relevant technologies, and determine the watermark insertion length of the fields to be processed based on the fields to be processed. This disclosure does not make any specific limitations in this regard.

[0057] Step 220: Encode the identification information into a watermark code based on the encoding base and digital encoding algorithm of the homograph table.

[0058] In this step, the above execution subject can obtain a homograph different code table capable of different forms of the same character, which can be a table with multiple different forms of the same character, and can be a Unicode encoding table. The Unicode encoding table includes some characters with different encodings but similar or identical shapes. For example, '0' and '0' have Unicode encodings 0030 and 1D7CE, respectively. A homograph different code table containing 62 characters including numbers and English uppercase and lowercase letters, and each character has 6 different encoding tables, can be used. Different homograph different code tables can correspond to different encoding systems, such as binary, hexadecimal, octal, etc., which can represent how many different forms a character can correspond to. For example, some Unicode encoding tables can be as follows:

[0059]

[0060]

[0061] The above execution subject can also obtain the identification information of the user who needs to operate the to-be-processed text. The identification information can be a user identification of variable length containing numbers, English or Chinese characters, etc. The above execution subject can use a number encoding algorithm to encode the obtained identification information, i.e., the mapping from identification information to number encoding can be performed through hash or incremental number encoding, so as to obtain the pure number encoding corresponding to the identification information. Then the above execution subject needs to convert the number encoding corresponding to the identification information into the same encoding result as the encoding system of the homograph different code table according to the encoding system of the homograph different code table, i.e., the watermark encoding corresponding to the identification information.

[0062] Step 230, based on the watermark insertion length and the watermark encoding, determining the watermark corresponding to the watermark encoding to be encrypted.

[0063] In this step, after the above execution subject obtains the watermark encoding corresponding to the identification information, the encoding length of the watermark encoding can be determined, i.e., the number of encoded characters in the watermark encoding. Then the above execution subject can compare the watermark insertion length with the encoding length of the watermark encoding. If the encoding length of the watermark encoding is less than the watermark insertion length, the length of the watermark encoding can be padded according to the watermark insertion length and the encoding length of the watermark encoding. The zero padding operation can be performed in front of the watermark encoding to obtain the watermark corresponding to the watermark encoding to be encrypted. The character length of the watermark to be encrypted is the same as the watermark insertion length.

[0064] As an example, the watermark code is 43033231, the to-be-processed field is 0123456789, the watermark insertion length of the to-be-processed field is 10 bits, the code length of the watermark code is determined to be 8 bits through calculation, the above execution subject performs zero padding operation on the watermark code, and two zeros need to be padded in front of the watermark code to become 0043033231, and the to-be-encrypted watermark corresponding to the watermark code is 0043033231.

[0065] In step 240, the to-be-encrypted watermark is encrypted based on the key to obtain an encrypted watermark.

[0066] In this step, after the above execution subject obtains the to-be-encrypted watermark corresponding to the watermark code, the key for encryption can be further obtained. The above execution subject can generate a random sequence according to the encryption algorithm and the key, and encrypt the to-be-encrypted watermark by using the random sequence to obtain the encrypted watermark.

[0067] The above execution subject can encrypt the to-be-encrypted watermark in any manner supported by related technologies to obtain the encrypted watermark encrypted based on the key, which is not specifically limited in the present disclosure.

[0068] In step 250, the encrypted watermark is encoded into the to-be-processed field based on the homograph different code table to generate a target field after watermark encoding.

[0069] In this step, after the above execution subject obtains the encrypted watermark, the encrypted watermark can be encoded into the to-be-processed field according to the homograph different code table, and the original form of the to-be-processed field is replaced by the form corresponding to the encrypted watermark in the homograph different code table for each character in the to-be-processed field to generate a target field after watermark encoding.

[0070] Specifically, the above execution subject can determine the same bit character in the encrypted watermark for each bit character in the to-be-processed field, and replace the original form of the to-be-processed field by the form corresponding to the same bit character in the homograph different code table to generate a target field after watermark encoding.

[0071] Reference Figure 2BAs an example, the encrypted watermark is 1303304032, the to-be-processed field included in the original page is 0123456789, and the execution subject can perform bit-by-bit encoding replacement, that is, the first bit '0' in the to-be-processed field is determined as the first bit '1' in the encrypted watermark, the execution subject can determine the performance character with the column number '0' and the row number '1' in the same-form different-code table, and replace the first bit '0' in the to-be-processed field with the performance character; then the execution subject determines the second bit '1' in the to-be-processed field, determines the second bit '3' in the encrypted watermark, and the execution subject can determine the performance character with the column number '1' and the row number '3' in the same-form different-code table, and replace the second bit '1' in the to-be-processed field with the performance character; then the execution subject determines the third bit '2' in the to-be-processed field, determines the third bit '0' in the encrypted watermark, and the execution subject can determine the performance character with the column number '2' and the row number '0' in the same-form different-code table, and replace the third bit '2' in the to-be-processed field with the performance character. The execution subject performs bit-by-bit encoding replacement on the to-be-processed field in the above manner, and obtains the target field after watermark encoding as 0123456789, so that the to-be-processed field in the original page is watermarked, the watermark embedding of the original page is completed, and the target field displayed in the watermarked page is 0123456789.

[0072] As an optional implementation, the step 250 of encoding the encrypted watermark into the to-be-processed field based on the same-form different-code table to generate the target field after watermark encoding can include the following steps: encoding the encrypted watermark into the to-be-processed field based on the same-form different-code table to generate a display field of the target field; determining the Unicode encoding of the target field based on the same-form different-code table; and generating the target field after watermark encoding based on the display field and the Unicode encoding of the target field.

[0073] Specifically, the execution subject can determine the character at the same bit in the encrypted watermark for each character in the to-be-processed field, and replace the original performance form of the to-be-processed field with the performance form corresponding to the character at the same bit in the same-form different-code table to generate a display field of the target field. The display field can be directly displayed to the user in the replaced performance form. Then the execution subject can determine the Unicode encoding of each replaced character in the display field in the same-form different-code table, so as to determine the Unicode encoding of the target field. Finally, the execution subject can take the Unicode encoding of the target field as the hidden encoding of each character in the target field, and take the display field as the display encoding of the target field, so as to generate the target field after watermark encoding.

[0074] In the present implementation, the target field after watermark encoding is generated by encoding the target field based on the display field and the Unicode encoding, which does not change the text format and visible content and does not affect the display of the to-be-processed field at all, and the Unicode encoding is used as the hidden encoding of each character in the target field to ensure that the target field has been changed and the watermark embedding is completed.

[0075] The watermark embedding method provided by the embodiments of the present disclosure can automatically extract the to-be-processed field in the to-be-processed text, and embed the watermark by using the homograph table to control the characters on the basis of the general web page watermark, only change the underlying encoding and display form of the to-be-processed field, do not change the text format and expression content at all, do not affect the display of the to-be-processed field at all, and do not leave any trace of watermark embedding, which is not easy to be detected and discovered, has good concealment, improves the security of the to-be-processed text and the target field in the to-be-processed text, and does not affect the correct extraction of the watermark when the text is changed in format, adjusted in paragraph, or modified in part, and has good robustness.

[0076] Reference Figure 3 , Figure 3 A flowchart of one embodiment of encoding the identification information into watermark encoding is shown, i.e., the above-mentioned step 220, which can include the following steps:

[0077] Step 310, encoding the identification information into initial watermark encoding based on the digital encoding algorithm.

[0078] In this step, the execution subject can use the digital encoding algorithm to digitally encode the obtained identification information, i.e., can map the identification information to digital encoding through hash or self-incrementing digital encoding, so as to obtain the initial watermark encoding corresponding to the identification information.

[0079] Step 320, obtaining a first watermark length of the initial watermark encoding, and determining whether the first watermark length is less than the watermark insertion length.

[0080] In this step, after the execution subject obtains the initial watermark code corresponding to the identification information, the initial watermark code needs to be subjected to data length statistics to obtain the first watermark length of the initial watermark code. Specifically, the execution subject can count the data amount of the initial watermark code, determine the data amount included in the initial watermark code, and take the data amount as the first watermark length of the initial watermark code.

[0081] The execution subject can compare the first watermark length of the initial watermark code with the watermark insertion length, determine whether the first watermark length is less than the watermark insertion length, and if the first watermark length is less than the watermark insertion length, the execution subject can directly execute the subsequent step. If the first watermark length is not less than the watermark insertion length, the execution subject can analyze the data of the identification information, determine the data information in the identification information that does not affect the uniqueness of the identification information, and delete the data information from the identification information to reduce the data length of the identification information, so that the first watermark length of the initial watermark code of the identification information after deletion is less than the watermark insertion length. The execution subject can directly use a digital encoding algorithm to digitally encode the identification information after deletion to generate the initial watermark code corresponding to the identification information.

[0082] Step 330, in response to determining that the first watermark length is less than the watermark insertion length, performing a radix conversion on the initial watermark code based on the encoding radix of the same-form different-code table to obtain the watermark code.

[0083] In this step, the execution subject determines that the first watermark length of the initial watermark code is less than the watermark insertion length, and needs to convert the initial watermark code corresponding to the identification information according to the encoding radix of the same-form different-code table, and convert the initial watermark code of the identification information into the same encoding result as the encoding radix of the same-form different-code table, that is, the watermark code corresponding to the identification information.

[0084] In this implementation, by judging the watermark length and performing a radix conversion, when subsequent encoding replacement is performed based on the watermark code, the replacement can be directly performed according to the same-form different-code table, thereby improving the efficiency of watermark embedding.

[0085] Reference Figure 4 , Figure 4 A flowchart of one embodiment of determining the watermark to be encrypted corresponding to the watermark code is shown, that is, step 230, determining the watermark to be encrypted corresponding to the watermark code based on the watermark insertion length and the watermark code, which can include the following steps:

[0086] Step 410, in response to determining that the second watermark length of the watermark code is less than the watermark insertion length, performing a calculation on the watermark code based on an error correction code algorithm to generate an error correction code corresponding to the watermark code.

[0087] In this step, the execution subject obtains the watermark code corresponding to the identification information, and further performs data length statistics on the watermark code to obtain a second watermark length of the watermark code. Specifically, the execution subject can count the data amount of the watermark code, determine the data amount included in the watermark code, and take the data amount as the second watermark length of the watermark code.

[0088] The execution subject can compare the second watermark length of the watermark code with the watermark insertion length, determine whether the second watermark length is less than the watermark insertion length, and if the second watermark length is less than the watermark insertion length, the execution subject can calculate the watermark code by using an error correction code algorithm to generate an error correction code corresponding to the watermark code. The error correction code algorithm can use CRC error correction code. CRC is a channel coding technology for generating a short fixed bit check code according to network data packets or computer files. It is mainly used to detect or correct errors that may occur after data transmission or storage. It uses the principle of division and remainder for error detection. Here, a 4-bit CRC code is used to reduce the impact on the watermark embedding capacity.

[0089] After the execution subject obtains the error correction code, the error correction code can be converted into the same result as the encoding system of the isomorphism code table according to the encoding system of the isomorphism code table.

[0090] If the second watermark length is not less than the watermark insertion length, the execution subject does not perform the subsequent watermark embedding method, proving that the watermark insertion length of the to-be-processed field is too short to perform watermark embedding.

[0091] Step 420: generating a spliced watermark corresponding to the watermark code based on the watermark code and the error correction code.

[0092] In this step, the execution subject obtains the watermark code and the error correction code after the conversion, and can splice the error correction code after the conversion behind the watermark code to generate a spliced watermark corresponding to the watermark code.

[0093] Step 430: in response to determining that the third watermark length of the spliced watermark is less than the watermark insertion length, performing length processing on the spliced watermark based on the watermark insertion length to obtain a to-be-encrypted watermark corresponding to the watermark code.

[0094] In this step, the execution subject obtains the spliced watermark corresponding to the watermark code, and further performs data length statistics on the spliced watermark to obtain a third watermark length of the spliced watermark. Specifically, the execution subject can count the data amount of the spliced watermark, determine the data amount included in the spliced watermark, and take the data amount as the third watermark length of the spliced watermark.

[0095] The execution subject can compare the third watermark length of the spliced watermark with the watermark insertion length, determine whether the third watermark length of the spliced watermark is less than the watermark insertion length, and if the third watermark length of the spliced watermark is less than the watermark insertion length, the execution subject can perform length processing on the spliced watermark based on the watermark insertion length, perform a length padding operation on the spliced watermark, and perform a zero padding operation in front of the spliced watermark to obtain the to-be-encrypted watermark corresponding to the watermark code, and the character length of the to-be-encrypted watermark is the same as the watermark insertion length.

[0096] For example, the spliced watermark is 43033231, and the to-be-processed field is 0123456789. The watermark insertion length of the to-be-processed field is 10 bits, the encoding length of the spliced watermark is determined to be 8 bits through calculation, the execution subject performs a zero padding operation on the spliced watermark, two zeros need to be padded in front of the spliced watermark to become 0043033231, and the to-be-encrypted watermark corresponding to the watermark code is 0043033231.

[0097] In the implementation, the watermark code is spliced with the error correction code, so that the to-be-encrypted watermark is more robust and easy to identify the accuracy of the to-be-encrypted watermark, and the accuracy of the to-be-encrypted watermark and the convenience of subsequent verification of the to-be-encrypted watermark are improved.

[0098] As an optional implementation, the watermark embedding method can further include the following steps: in response to obtaining the target field after watermark encoding, storing the identification information and the text identification corresponding to the to-be-processed text.

[0099] Specifically, after the execution subject obtains the target field after watermark encoding, the execution subject can send the to-be-processed text containing the target field to a terminal device, so that the terminal device displays the to-be-processed text containing the target field to the user corresponding to the identification information through a screen. At the same time, the execution subject can encrypt the identification information and the text identification of the to-be-processed text, and store the encrypted identification information and the to-be-processed text, which can be stored in a log corresponding to the to-be-processed text.

[0100] In the implementation, after the target field is obtained, the identification information and the text identification corresponding to the to-be-processed text are stored for subsequent extraction of the watermark for verification.

[0101] Reference Figure 5 , a flowchart of one embodiment of a watermark extraction method is shown, which includes the following steps:

[0102] Step 510, decoding the target field in the target text based on the homograph different code table to obtain the encrypted watermark corresponding to the target field.

[0103] In this step, the execution subject (for exampleFigure 1 The server 101, 102, 103 in the system 100 can obtain the target text including the target field, which can be a field that has completed watermark embedding, and can represent some sensitive information related to the user, which can be information preset by the operator according to the type of the target text. Therefore, different types of target texts can correspond to different target fields, for example, the target text can be order data, etc., and the target field can include the user's mobile phone number, email, order number, product information, delivery address, etc.

[0104] After the above execution subject obtains the target text with watermark, it can extract the target field that has completed watermark embedding from the target text by a text analysis algorithm, such as a mobile phone number, an order number, etc., and then obtain the character bits for watermark addition from the target field. The character bits for watermark addition can be numbers and English characters in the mobile phone number and order number, and the watermark is extracted only in these characters, excluding symbols and other characters.

[0105] After the above execution subject obtains the character bits for watermark addition from the target field, it can decode the target field in the target text using the homograph different code table to determine the decoding result corresponding to each character in the target field, and take the decoding result as the encrypted watermark corresponding to the target field.

[0106] As an example, the target field is: 0123456789, and the original field can be determined to be: 0123456789. The above execution subject can decode by bit using the homograph different code table, i.e., the first bit '0' can be determined to be the original character '0', and when the original character '0' is determined to be '0' in the homograph different code table, the first bit in the corresponding encrypted watermark is '1'; then the above execution subject determines the second bit '1', which can be determined to be the original character '1', and when the original character '1' is determined to be '1' in the homograph different code table, the second bit in the encrypted watermark is '3'. The above execution subject decodes the target field by bit in the above manner to obtain the encrypted watermark as 1303304032.

[0107] As an optional implementation, the step 510 of decoding the target field in the target text based on the homograph different code table to obtain the encrypted watermark corresponding to the target field can be implemented based on the following steps: obtaining a target image including the target text, and determining a target region of the target field in the target image; detecting the target region based on a text detection algorithm to obtain first position information of the target field; determining second position information of each target character in the target field based on the text recognition algorithm and the first position information; performing character segmentation on the target field based on the second position information of each target character to obtain each target character in the target field; performing text recognition and decoding on each target character based on the homograph different code table to obtain a decoding result corresponding to each target character; and obtaining the encrypted watermark corresponding to the target field based on the decoding result corresponding to each target character.

[0108] Specifically, the execution subject can obtain a target image including the target text, and obtain a target region of the target field in the target image by manual annotation or by image detection. Then, the execution subject can detect the target region based on a text detection algorithm to obtain first position information of the target field, for example, using a deep learning algorithm such as a craft or yolo series algorithm to detect the target region to obtain the first position information of the target field. Then, the execution subject can recognize each target character in the target field based on a text recognition algorithm and the first position information of the target field to determine second position information of each target character in the target field, for example, using a convolutional neural network or other text recognition algorithm to recognize each target character in the target field, and determining the second position information of each target character in the target field, i.e., the (x, y) coordinates of each target character, based on the recognized text content.

[0109] The execution subject can perform single-character segmentation on each target character based on the second position information of each target character using connected component analysis in the target field to obtain each target character in the target field. The execution subject can determine whether each target character is a character position to which a watermark is added based on the judgment on each target character, and the character position to which the watermark is added can be a number, an English character, or the like in a mobile phone number or an order number. The watermark is extracted only in these characters, and does not include symbols or other characters.

[0110] After the execution subject determines the target characters belonging to the character position to which the watermark is added, the execution subject can perform text recognition and decoding on each target character based on the homograph different code table to determine a decoding result corresponding to each target character, and combine the decoding result corresponding to each target character to obtain the encrypted watermark corresponding to the target field.

[0111] The execution subject can obtain each target character in the target field from the target image including the target text in any manner supported by the related technologies, and the present disclosure does not make specific limitation thereto.

[0112] In the present implementation, by obtaining each target character in the target field from the target image and recognizing and decoding each target character, the accuracy of image processing can be improved, thereby improving the accuracy of watermark extraction.

[0113] Step 520, decrypt the encrypted watermark based on the key to obtain the encrypted watermark corresponding to the to-be-encrypted watermark.

[0114] In this step, the execution subject can obtain the key corresponding to the target text, and decrypt the encrypted watermark based on the key to obtain the encrypted watermark corresponding to the to-be-encrypted watermark.

[0115] The execution subject can decrypt the encrypted watermark based on the key in any manner supported by the related technologies, and the present disclosure does not make specific limitation thereto.

[0116] Step 530, in response to determining that the to-be-encrypted watermark is complete, determining the watermark code corresponding to the to-be-encrypted watermark based on the watermark insertion length of the target field.

[0117] In this step, after the execution subject obtains the to-be-encrypted watermark corresponding to the encrypted watermark, the to-be-encrypted watermark can be judged to determine whether the to-be-encrypted watermark is complete, i.e., whether the to-be-encrypted watermark has missing parts.

[0118] If the execution subject determines that the to-be-encrypted watermark is complete through the judgment, the watermark code corresponding to the to-be-encrypted watermark is determined based on the watermark insertion length of the target field and the to-be-encrypted watermark, i.e., the execution subject can analyze the to-be-encrypted watermark to determine whether the to-be-encrypted watermark includes '0' in front, if it does, it is determined that the to-be-encrypted watermark is the watermark obtained by the zero padding operation, then the '0' in front is removed to obtain the watermark code corresponding to the to-be-encrypted watermark. If not, it is determined that the to-be-encrypted watermark is the watermark code.

[0119] Step 540, determine the watermark code as the target watermark code corresponding to the target field.

[0120] In this step, after the execution subject obtains the watermark code corresponding to the to-be-encrypted watermark, the obtained watermark code can be determined as the target watermark code corresponding to the target field.

[0121] The watermark extraction method provided by the embodiment of the present disclosure can first decode the target field in the target text based on the same-form different-code table to obtain an encrypted watermark corresponding to the target field, then decrypt the encrypted watermark based on a key to obtain a to-be-encrypted watermark corresponding to the encrypted watermark, and then determine a watermark code corresponding to the to-be-encrypted watermark based on a watermark insertion length of the target field in response to determining that the to-be-encrypted watermark is complete, and finally determine the watermark code as a target watermark code corresponding to the target field. The target field in the target text can be subjected to watermark extraction, and the information security can be protected and the information leakage can be prevented by tracing and verifying through the watermark service without obtaining a text leakage system.

[0122] Reference Figure 6 , Figure 6 A flowchart of another embodiment of the watermark extraction method is shown, which can include the following steps:

[0123] Step 610: Decoding a target field in a target text based on a same-form different-code table to obtain an encrypted watermark corresponding to the target field.

[0124] Step 610 of the embodiment can be performed in a similar manner to step 510 in the embodiment shown in Figure 5 , and details are not repeated here.

[0125] Step 620: Decrypting the encrypted watermark based on a key to obtain a to-be-encrypted watermark corresponding to the encrypted watermark.

[0126] Step 620 of the embodiment can be performed in a similar manner to step 520 in the embodiment shown in Figure 5 , and details are not repeated here.

[0127] Step 630: In response to determining that the to-be-encrypted watermark is complete, verifying whether the to-be-encrypted watermark is correct through an error correction code.

[0128] In this step, after the execution subject obtains the to-be-encrypted watermark corresponding to the encrypted watermark, the to-be-encrypted watermark can be judged to determine whether the to-be-encrypted watermark is complete, i.e., whether the to-be-encrypted watermark has a missing part.

[0129] The execution subject determines that the to-be-encrypted watermark is complete, and then verifies the correctness of the to-be-encrypted watermark through the error correction code added therein.

[0130] The execution subject can verify whether the to-be-encrypted watermark is correct through the error correction code in any manner supported by any related technology, which is not limited in the present disclosure.

[0131] Step 640, in response to determining that the to-be-encrypted watermark is correct, determining the watermark encoding corresponding to the to-be-encrypted watermark based on the watermark insertion length of the target field.

[0132] In this step, the execution subject determines that the to-be-encrypted watermark is correct through verification, and then determines the watermark encoding corresponding to the to-be-encrypted watermark according to the watermark insertion length of the target field and the to-be-encrypted watermark. That is, the execution subject can analyze the to-be-encrypted watermark to determine whether the to-be-encrypted watermark includes '0' in front. If it does, it is determined that the to-be-encrypted watermark is a watermark obtained by zero padding operation, and the '0' in front is removed to obtain the watermark encoding corresponding to the to-be-encrypted watermark. If not, it is determined that the to-be-encrypted watermark is the watermark encoding.

[0133] In this implementation, the to-be-encrypted watermark is verified by the error correction code, which can improve the accuracy of the to-be-encrypted watermark and thus improve the accuracy of the watermark encoding.

[0134] Step 650, in response to determining that the to-be-encrypted watermark is incomplete, determining the suspected encoding in the to-be-encrypted watermark.

[0135] In this step, the execution subject determines that the to-be-encrypted watermark is incomplete by judging the to-be-encrypted watermark, and can determine the suspected encoding in the to-be-encrypted watermark. The suspected encoding can represent the encoding bits that cannot be determined in the to-be-encrypted watermark.

[0136] Step 660, based on the isomorphism code table, the suspected encoding is selected by iteration to obtain a plurality of suspected watermark encodings corresponding to the suspected encoding.

[0137] In this step, the execution subject can select the suspected encoding by iteration based on the isomorphism code table, that is, the suspected encoding bits are selected by iteration for each selectable encoding form in the isomorphism code table, thereby forming a plurality of suspected watermark encodings.

[0138] Step 670, respectively verifying a plurality of suspected watermark encodings by error correction code to obtain a suspected watermark encoding that passes verification.

[0139] In this step, the execution subject verifies the correctness of each suspected watermark encoding by adding the error correction code in it.

[0140] The execution subject can verify the plurality of suspected watermark encodings by error correction code in any way supported by any related technology, which is not limited in the present disclosure.

[0141] Step 680, determining the watermark encoding and the suspected watermark encoding that passes verification as the target watermark encoding corresponding to the target field.

[0142] In this step, the execution subject checks the suspected watermark code and determines the watermark code corresponding to the target field as the target watermark code if the suspected watermark code is correct.

[0143] In this embodiment, the suspected watermark code is checked by the error correction code, which ensures the accuracy of the content and improves the accuracy of the target watermark code.

[0144] Reference Figure 7 , Figure 7 A flowchart illustrating another embodiment of the watermark extraction method can include the following steps:

[0145] Step 710, decoding the target field in the target text based on the homograph different code table to obtain an encrypted watermark corresponding to the target field.

[0146] Step 710 of this embodiment can be performed in a similar manner as step 510 in the embodiment shown in Figure 5 , which will not be described here.

[0147] Step 720, decrypting the encrypted watermark based on the key to obtain an encrypted watermark corresponding to the encrypted watermark.

[0148] Step 720 of this embodiment can be performed in a similar manner as step 520 in the embodiment shown in Figure 5 , which will not be described here.

[0149] Step 730, in response to determining that the encrypted watermark is complete, determining a watermark code corresponding to the encrypted watermark based on the watermark insertion length of the target field.

[0150] Step 730 of this embodiment can be performed in a similar manner as step 530 in the embodiment shown in Figure 5 , which will not be described here.

[0151] Step 740, determining the watermark code as the target watermark code corresponding to the target field.

[0152] Step 740 of this embodiment can be performed in a similar manner as step 540 in the embodiment shown in Figure 5 , which will not be described here.

[0153] Step 750, in response to determining the target watermark code corresponding to the target field, decoding the target watermark code based on the encoding system of the homograph different code table and the numerical encoding algorithm to obtain target identification information corresponding to the target watermark code.

[0154] In this step, after the execution subject determines the target watermark code corresponding to the target field, the execution subject can determine the base corresponding to the digital encoding algorithm, and convert the target watermark code into the base corresponding to the digital encoding algorithm based on the encoding base of the isomorphism code table, to obtain the watermark code that can be obtained by using the data encoding algorithm.

[0155] Then the execution subject can decode the target watermark code after the conversion by using the digital encoding algorithm to obtain the target identification information corresponding to the target watermark code.

[0156] Step 760, determining whether the target identification information exists in the plurality of identification information associated with the text identification of the target text.

[0157] In this step, the execution subject can obtain the text identification corresponding to the target text, and read the plurality of identification information associated with the text identification from the local storage according to the text identification. Then the execution subject can match the target identification information in the plurality of identification information, and determine whether the target identification information exists in the plurality of identification information associated with the text identification.

[0158] Step 770, in response to determining that the target identification information exists, generating prompt information including the target identification information.

[0159] In this step, the execution subject determines that the target identification information exists by matching, and then generates prompt information including the target identification information. The prompt information also includes information prompting that the watermark extraction is successful. If it is determined that the target identification information does not exist, the prompt information of verification failure and watermark extraction failure is returned.

[0160] In this embodiment, by matching the target identification information with the plurality of identification information stored locally, the traceability verification of content leakage is completed, and the security of the text is improved.

[0161] Further reference Figure 8 , as an implementation of the method shown in the above figures, the present disclosure provides an embodiment of a watermark embedding device. The device embodiment corresponds to the method embodiment shown in FIG. 2.

[0162] As shown in Figure 8 , the watermark embedding device 800 of the present embodiment can include an acquisition module 810, an encoding module 820, a determination module 830, an encryption module 840 and a generation module 850.

[0163] The acquisition module 810 is configured to acquire a to-be-processed field in a to-be-processed text and a watermark insertion length of the to-be-processed field.

[0164] The encoding module 820 is configured to encode the identification information into the watermark code based on the encoding system of the homograph code table and the digital encoding algorithm.

[0165] The determining module 830 is configured to determine the to-be-encrypted watermark corresponding to the watermark code based on the watermark insertion length and the watermark code.

[0166] The encryption module 840 is configured to encrypt the to-be-encrypted watermark based on the key to obtain the encrypted watermark.

[0167] The generating module 850 is configured to encode the encrypted watermark into the to-be-processed field based on the homograph code table to generate the target field after watermark encoding.

[0168] In some optional implementations of the embodiment, the encoding module is further configured to: encode the identification information into the initial watermark code based on the digital encoding algorithm; obtain a first watermark length of the initial watermark code, and determine whether the first watermark length is less than the watermark insertion length; and in response to determining that the first watermark length is less than the watermark insertion length, perform system conversion on the initial watermark code based on the encoding system of the homograph code table to obtain the watermark code.

[0169] In some optional implementations of the embodiment, the determining module is further configured to: in response to determining that a second watermark length of the watermark code is less than the watermark insertion length, perform calculation on the watermark code based on the error correction code algorithm to generate an error correction code corresponding to the watermark code; generate a spliced watermark corresponding to the watermark code based on the watermark code and the error correction code; and in response to determining that a third watermark length of the spliced watermark is less than the watermark insertion length, perform length processing on the spliced watermark based on the watermark insertion length to obtain the to-be-encrypted watermark corresponding to the watermark code.

[0170] In some optional implementations of the embodiment, the generating module is further configured to: encode the encrypted watermark into the to-be-processed field based on the homograph code table to generate a display field of the target field; determine a Unicode code of the target field based on the homograph code table; and generate the target field after watermark encoding based on the display field and the Unicode code of the target field.

[0171] In some optional implementations of the embodiment, the apparatus further includes a storage module configured to: in response to obtaining the target field after watermark encoding, store a text identifier corresponding to the identification information and the to-be-processed text.

[0172] The watermark embedding device provided by the above embodiments of the present disclosure first acquires a to-be-processed field in a to-be-processed text and a watermark insertion length of the to-be-processed field, then encodes identification information into watermark code based on a coding system of a homograph code table and a numerical coding algorithm, determines a to-be-encrypted watermark corresponding to the watermark code based on the watermark insertion length and the watermark code, encrypts the to-be-encrypted watermark based on a key to obtain an encrypted watermark, and finally encodes the encrypted watermark into the to-be-processed field based on the homograph code table to generate a target field after watermark encoding. The to-be-processed field in the to-be-processed text can be automatically extracted. On the basis of a general web page watermark, the homograph code table is used to control characters to embed the watermark. Only the underlying coding and display form of the to-be-processed field are changed, and the text format and expression content are not changed at all, and the display of the to-be-processed field is not affected at all. The watermark embedding has no trace and is not easy to be detected and discovered, and has good concealment. The security of the to-be-processed text and the target field in the to-be-processed text is improved. Moreover, the text format change, paragraph adjustment, and partial modification do not affect the correct extraction of the watermark, and the watermark has good robustness.

[0173] Those skilled in the art can understand that the above device also includes some other well-known structures, such as a processor, a memory, and the like. In order not to unnecessarily obscure the embodiments of the present disclosure, these well-known structures are not shown in the Figure 8 .

[0174] Further referring to Figure 9 , as an implementation of the method shown in the above figures, the present disclosure provides an embodiment of a watermark extraction device. The device embodiment corresponds to the method embodiment shown in Figure 5 .

[0175] As shown in Figure 9 , the watermark extraction device 900 of the present embodiment can include a decoding module 910, a decryption module 920, and a determination module 930.

[0176] The decoding module 910 is configured to decode a target field in a target text based on a homograph code table to obtain an encrypted watermark corresponding to the target field.

[0177] The decryption module 920 is configured to decrypt the encrypted watermark based on a key to obtain a to-be-encrypted watermark corresponding to the encrypted watermark.

[0178] The determination module 930 is configured to determine a watermark code corresponding to the to-be-encrypted watermark based on a watermark insertion length of the target field in response to determining that the to-be-encrypted watermark is complete, and determine the watermark code as a target watermark code corresponding to the target field.

[0179] In some optional implementations of the present embodiment, the determining module is further configured to: in response to determining that the to-be-encrypted watermark is complete, check whether the to-be-encrypted watermark is correct through the error correction code; and in response to determining that the to-be-encrypted watermark is correct, determine the watermark code corresponding to the to-be-encrypted watermark based on the watermark insertion length of the target field.

[0180] In some optional implementations of the present embodiment, the determining module is further configured to: in response to determining that the to-be-encrypted watermark is not complete, determine a suspected code in the to-be-encrypted watermark; perform traversal selection on the suspected code based on the homograph heterogeneous code table to obtain a plurality of suspected watermark codes corresponding to the suspected code; respectively check the plurality of suspected watermark codes through the error correction code to obtain a suspected watermark code that passes the check; and determine the watermark code and the suspected watermark code that passes the check as the target watermark code corresponding to the target field.

[0181] In some optional implementations of the present embodiment, the decoding module is further configured to: obtain a target image including a target text, and determine a target region of a target field in the target image; detect the target region based on a text detection algorithm to obtain first position information of the target field; determine second position information of each target character in the target field based on a character recognition algorithm and the first position information; perform character segmentation on the target field based on the second position information of each target character to obtain each target character in the target field; respectively perform character recognition and decoding on each target character based on the homograph heterogeneous code table to obtain a decoding result corresponding to each target character; and obtain an encrypted watermark corresponding to the target field based on the decoding result corresponding to each target character.

[0182] In some optional implementations of the present embodiment, the apparatus further includes a generating module configured to: in response to determining the target watermark code corresponding to the target field, decode the target watermark code based on the encoding system of the homograph heterogeneous code table and a number encoding algorithm to obtain target identification information corresponding to the target watermark code; determine whether the target identification information exists in a plurality of identification information associated with the text identification of the target text; and in response to determining that the target identification information exists, generate prompt information including the target identification information.

[0183] The watermark extraction device provided by the above embodiments of the present disclosure can first decode a target field in a target text based on the same-form different-code table to obtain an encrypted watermark corresponding to the target field, then decrypt the encrypted watermark based on a key to obtain a to-be-encrypted watermark corresponding to the encrypted watermark, then determine watermark encoding corresponding to the to-be-encrypted watermark based on a watermark insertion length of the target field in response to determining that the to-be-encrypted watermark is complete, and finally determine the watermark encoding as target watermark encoding corresponding to the target field, so that the target field in the target text can be subjected to watermark extraction, the target text can be subjected to traceability verification through a watermark service without obtaining a text leakage system, the problem that a leakage person cannot be traced is overcome, and the effect of protecting information security and preventing information leakage can be achieved.

[0184] Those skilled in the art can understand that the above device further includes some other well-known structures, such as a processor, a memory, and the like, and in order not to unnecessarily obscure the embodiments of the present disclosure, these well-known structures are not shown in the Figure 9 .

[0185] Reference will be made to Figure 10 , which shows a structural schematic diagram of an electronic device 1000 suitable for implementing the embodiments of the present disclosure. The terminal device in the embodiments of the present disclosure can include, but is not limited to, a mobile terminal such as a smart screen, a notebook computer, a PAD (tablet computer), a PMP (portable multimedia player), a vehicle-mounted terminal (such as a vehicle-mounted navigation terminal), and the like, and a fixed terminal such as a digital TV, a desktop computer, and the like. Figure 10 The terminal device shown is only an example and should not bring any limitation to the functions and use range of the embodiments of the present disclosure.

[0186] As shown in Figure 10 , the electronic device 1000 can include a processing device (such as a central processor, a graphics processor, and the like) 1001, which can perform various appropriate actions and processes according to programs stored in a read-only memory (ROM) 1002 or programs loaded from a storage device 1008 into a random access memory (RAM) 1003. In the RAM 1003, various programs and data required for the operation of the electronic device 1000 are also stored. The processing device 1001, the ROM 1002, and the RAM 1003 are connected to each other through a bus 1004. An input / output (I / O) interface 1005 is also connected to the bus 1004.

[0187] In general, the following devices can be connected to the I / O interface 1005: input devices 1006 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, and the like; output devices 1007 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, and the like; storage devices 1008 including, for example, a tape, a hard disk, and the like; and communication devices 1009. The communication devices 1009 can allow the electronic device 1000 to communicate wirelessly or through a wire with other devices to exchange data. Although Figure 10 The electronic device 1000 is shown with various devices, but it is understood that not all of the shown devices are required to be implemented or present. More or fewer devices can alternatively be implemented or present. Figure 10 Each block shown in the flowchart of FIG. 10 can represent a device, or multiple devices, as necessary.

[0188] In particular, according to embodiments of the present disclosure, the processes described above with reference to the flowcharts can be implemented as a computer software program. For example, embodiments of the present disclosure include a computer program product comprising a computer program carried on a computer readable medium, the computer program containing program code for executing the methods illustrated by the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network by the communication device 1009, or installed from the storage device 1008, or installed from the ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the methods of embodiments of the present disclosure are executed. It should be noted that the computer readable medium of embodiments of the present disclosure can be a computer readable signal medium or a computer readable storage medium or any combination of the two. The computer readable storage medium may, for example, but not limited to, be an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or apparatus, or any combination of the above. More specific examples of the computer readable storage medium can include, but are not limited to, an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In embodiments of the present disclosure, the computer readable storage medium can be any tangible medium that contains or stores a program that can be used by or in connection with an instruction execution system, apparatus or device. In embodiments of the present disclosure, the computer readable signal medium can include a data signal carried in a baseband or as part of a carrier wave, in which the computer readable program code is carried. Such a propagated data signal can take many forms, including but not limited to, an electromagnetic signal, an optical signal or any suitable combination of the above. The computer readable signal medium can also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate or transport a program for use by or in connection with an instruction execution system, apparatus or device. The program code contained on the computer readable medium can be transmitted by any suitable medium, including but not limited to, wire, cable, RF (radio frequency), etc., or any suitable combination of the above.

[0189] Computer program code for carrying out operations of embodiments of the present disclosure can be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C++ or the like, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code can execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computer (for example, through the Internet using an Internet Service Provider).

[0190] The computer program instructions can also be loaded onto a computer or other programmable information processing apparatus to cause a series of operations to be performed on the computer or other programmable information processing apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable information processing apparatus implement the functions / acts specified in the flowchart and / or block diagram block or blocks.

[0191] The units described in the embodiments of the present application can be implemented by software, or by hardware. The units described can also be implemented by a processor, for example, can be described as: a processor includes an obtaining module, an encoding module, a determining module, an encryption module and a generating module, or a processor includes a decoding module, a decryption module and a determining module, wherein the names of these modules do not constitute a limitation on the modules themselves in some cases.

[0192] As another aspect, the present application also provides a computer readable medium, which can be included in the electronic device or exist independently without being assembled into the electronic device. The computer readable medium carries one or more programs, which, when executed by the electronic device, cause the electronic device to: acquire a to-be-processed field in a to-be-processed text and a watermark insertion length of the to-be-processed field; encode identification information into a watermark code based on an encoding system of the homograph table and a numerical encoding algorithm; determine a to-be-encrypted watermark corresponding to the watermark code based on the watermark insertion length and the watermark code; encrypt the to-be-encrypted watermark based on a key to obtain an encrypted watermark; and encode the encrypted watermark into the to-be-processed field based on the homograph table to generate a target field after watermark encoding. Alternatively, the computer readable medium causes the electronic device to: decode a target field in a target text based on the homograph table to obtain an encrypted watermark corresponding to the target field; decrypt the encrypted watermark based on the key to obtain a to-be-encrypted watermark corresponding to the encrypted watermark; determine a watermark code corresponding to the to-be-encrypted watermark based on the watermark insertion length of the target field in response to determining that the to-be-encrypted watermark is complete; and determine the watermark code as a target watermark code corresponding to the target field.

[0193] The above description is merely the preferred embodiments of the present application and the explanation of the principles of the applied technology. It should be understood by those skilled in the art that the inventive scope of the embodiments of the present application is not limited to the technical solutions formed by the specific combinations of the above technical features, and should also cover other technical solutions formed by any combinations of the above technical features or equivalent features without departing from the inventive concept. For example, the above features can be replaced with the technical features disclosed in the embodiments of the present application (but not limited to) having similar functions to form technical solutions.

Claims

1. A watermark embedding method, the method comprising: Obtain the field to be processed in the text to be processed and the watermark insertion length of the field to be processed; The watermark code is encoded based on the encoding base and digital encoding algorithm of the homograph table; Based on the watermark insertion length and the watermark encoding, the watermark to be encrypted corresponding to the watermark encoding is determined, and the character length of the watermark to be encrypted is the same as the watermark insertion length. The watermark to be encrypted is encrypted using the key to obtain an encrypted watermark. Based on the homograph-heterogeneous character set (HQVAR), the encrypted watermark is encoded into the field to be processed to generate a target field with watermark encoding, including: encoding the encrypted watermark into the field to be processed based on the HQVAR, generating a display field of the target field; determining the Unicode encoding of the target field based on the HQVAR; and generating the target field with watermark encoding based on the Unicode encoding of the display field and the target field.

2. The method according to claim 1, wherein, The encoding base and digital encoding algorithm based on homographs and different code tables encodes the identification information into watermark codes, including: The identification information is encoded into an initial watermark code based on a digital encoding algorithm; Obtain the first watermark length of the initial watermark code, and determine whether the first watermark length is less than the watermark insertion length; In response to determining that the length of the first watermark is less than the watermark insertion length, the initial watermark code is converted based on the encoding base of the homograph table to obtain the watermark code.

3. The method according to claim 1 or 2, wherein, The step of determining the watermark to be encrypted corresponding to the watermark code based on the watermark insertion length and the watermark code includes: In response to determining that the second watermark length of the watermark code is less than the watermark insertion length, the watermark code is calculated based on the error correction code algorithm to generate the error correction code corresponding to the watermark code; Based on the watermark code and the error correction code, a spliced ​​watermark corresponding to the watermark code is generated; In response to determining that the length of the third watermark of the spliced ​​watermark is less than the watermark insertion length, the spliced ​​watermark is length-processed based on the watermark insertion length to obtain the watermark to be encrypted corresponding to the watermark code.

4. The method according to claim 1 or 2, further comprising: In response to obtaining the target field after watermark encoding, the identification information and the text identifier corresponding to the text to be processed are stored.

5. A watermark extraction method, the method comprising: Decoding a target field in target text using a homography table to obtain an encrypted watermark corresponding to the target field includes: acquiring a target image containing the target text and determining the target region of the target field in the target image; detecting the target region using a text detection algorithm to obtain first position information of the target field; determining second position information of each target character in the target field based on a character recognition algorithm and the first position information; segmenting the target field into characters based on the second position information of each target character to obtain each target character in the target field; performing character recognition and decoding on each target character using a homography table to obtain a decoding result corresponding to each target character; and obtaining the encrypted watermark corresponding to the target field based on the decoding result corresponding to each target character. The encrypted watermark is decrypted based on the key to obtain the watermark to be encrypted corresponding to the encrypted watermark. In response to determining that the watermark to be encrypted is complete, the watermark code corresponding to the watermark to be encrypted is determined based on the watermark insertion length of the target field, wherein the character length of the watermark to be encrypted is the same as the watermark insertion length; The watermark code is determined to be the target watermark code corresponding to the target field; The target watermark code is decoded based on the encoding base and digital encoding algorithm of the homograph table to obtain the target identification information corresponding to the target watermark code.

6. The method according to claim 5, wherein, The step of determining the watermark encoding corresponding to the watermark to be encrypted based on the watermark insertion length of the target field, in response to determining the integrity of the watermark to be encrypted, includes: In response to determining that the watermark to be encrypted is complete, the correctness of the watermark to be encrypted is verified by using an error correction code. In response to determining that the watermark to be encrypted is correct, the watermark code corresponding to the watermark to be encrypted is determined based on the watermark insertion length of the target field.

7. The method according to claim 6, further comprising: In response to determining that the watermark to be encrypted is incomplete, a suspected code in the watermark to be encrypted is identified; Based on the homograph table, the suspected codes are traversed and selected to obtain multiple suspected watermark codes corresponding to the suspected codes; The multiple suspected watermark codes are verified using the error correction code to obtain the correctly verified suspected watermark codes. as well as The step of determining the watermark code as the target watermark code corresponding to the target field includes: The watermark code and the verified suspected watermark code are determined as the target watermark code corresponding to the target field.

8. The method according to any one of claims 5-7, further comprising: Determine whether the target identifier information exists among multiple identifier information associated with the text identifier of the target text; In response to determining the existence of the target identification information, a prompt message including the target identification information is generated.

9. A watermark embedding device, the device comprising: The acquisition module is configured to acquire the field to be processed in the text to be processed and the watermark insertion length of the field to be processed. The encoding module is configured to encode the identification information into watermark codes based on the encoding base and digital encoding algorithm of the homograph table; The determining module is configured to determine the watermark to be encrypted corresponding to the watermark code based on the watermark insertion length and the watermark code, wherein the character length of the watermark to be encrypted is the same as the watermark insertion length; The encryption module is configured to encrypt the watermark to be encrypted based on a key, thereby obtaining an encrypted watermark. The generation module is configured to encode the encrypted watermark into the field to be processed based on the homograph table, thereby generating the target field after watermark encoding.

10. A watermark extraction device, the device comprising: The decoding module is configured to decode a target field in the target text based on a homography table to obtain an encrypted watermark corresponding to the target field. The module includes: acquiring a target image containing the target text and determining the target region of the target field in the target image; detecting the target region based on a text detection algorithm to obtain first position information of the target field; determining second position information of each target character in the target field based on a character recognition algorithm and the first position information; performing character segmentation on the target field based on the second position information of each target character to obtain each target character in the target field; performing character recognition and decoding on each target character based on the homography table to obtain a decoding result corresponding to each target character; and obtaining the encrypted watermark corresponding to the target field based on the decoding result corresponding to each target character. The decryption module is configured to decrypt the encrypted watermark based on a key to obtain the watermark to be encrypted corresponding to the encrypted watermark; The determination module is configured to, in response to determining that the watermark to be encrypted is complete, determine the watermark encoding corresponding to the watermark to be encrypted based on the watermark insertion length of the target field, wherein the character length of the watermark to be encrypted is the same as the watermark insertion length; and determine the watermark encoding as the target watermark encoding corresponding to the target field. The generation module is configured to: in response to determining the target watermark code corresponding to the target field, decode the target watermark code based on the encoding base and digital encoding algorithm of the homograph table to obtain the target identification information corresponding to the target watermark code.

11. An electronic device, comprising: One or more processors; Storage device for storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any one of claims 1-8.

12. A computer-readable medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1-8.

Citation Information

Patent Citations

  • Watermark information embedding method and device, and watermark information decoding method

    CN105095699A