CN115018687A - Watermark encoding method, watermark decoding method and related equipment - Google Patents

Watermark encoding method, watermark decoding method and related equipment Download PDF

Info

Publication number
CN115018687A
CN115018687A CN202210601084.9A CN202210601084A CN115018687A CN 115018687 A CN115018687 A CN 115018687A CN 202210601084 A CN202210601084 A CN 202210601084A CN 115018687 A CN115018687 A CN 115018687A
Authority
CN
China
Prior art keywords
picture
preset
watermark
digital
rule
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210601084.9A
Other languages
Chinese (zh)
Inventor
丁磊磊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN202210601084.9A priority Critical patent/CN115018687A/en
Publication of CN115018687A publication Critical patent/CN115018687A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing
    • G06T1/0021Image watermarking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/12Use of codes for handling textual entities
    • G06F40/126Character encoding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2201/00General purpose image data processing
    • G06T2201/005Image watermarking

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • General Engineering & Computer Science (AREA)
  • Editing Of Facsimile Originals (AREA)

Abstract

The invention discloses a watermark encoding method, which is applied to the field of information security. The watermark encoding method provided by the invention comprises the following steps: acquiring target text content to be coded, and splitting the target text content into text strings to be coded according to a preset first splitting rule; converting the text string to be coded into a digital code corresponding to a preset digit according to a preset coding and decoding rule corresponding to the text string to be coded, and acquiring a target digital code according to the digital code; acquiring a template picture for generating a watermark, a transformation rule corresponding to the template picture and the longest digit number corresponding to the transformation rule and used for representing the digital code, wherein the sum of the longest digit number of the template picture is greater than the preset digit number; modifying the corresponding template picture to enable the template picture to represent the target number at the corresponding position in the target number code, and obtaining a picture to be combined; and combining the pictures to be combined according to a preset picture combination rule to obtain the watermark pictures.

Description

Watermark encoding method, watermark decoding method and related equipment
Technical Field
The present invention relates to the field of information security, and in particular, to a watermark encoding method, a watermark decoding method, and related devices.
Background
In the field of information security, it is a difficult problem to prevent information leakage of office computers, especially for the event of leakage of information in a screen photographing mode. In the prior art, a watermark is added on a screen, attribute information such as an account number, time, a machine name and the like of a user is added in the watermark, or a blind watermark technology with light color and dense color or a dot matrix watermark technology is used, namely corresponding information is generated into a dot matrix, and a two-dimensional code is realized like braille.
The inventor finds that in the prior art scheme, the obvious watermark not only affects the user experience, but also can be disposed by means of blurring or shading after being photographed, and the blind watermark technology has a low success rate of watermark restoration (namely watermark decoding) due to light color, and the defects of the dot matrix technology also have the defects, namely the prior art scheme has the problems of low success rate of watermark restoration and poor user experience.
Disclosure of Invention
The embodiment of the invention provides a watermark encoding method, a watermark decoding method and related equipment, and aims to solve the problems of low watermark reduction success rate and poor user experience in the prior art.
A watermark encoding method comprising:
acquiring target text content to be coded, and splitting the target text content into at least one text string to be coded according to a preset first splitting rule;
converting the text string to be coded into digital codes corresponding to preset digits and a carry system according to a preset coding and decoding rule corresponding to the text string to be coded, and acquiring a target digital code according to at least one digital code;
acquiring at least one template picture for generating a watermark, a transformation rule corresponding to the template picture and a longest digit corresponding to the transformation rule and used for representing the digital code, wherein the sum of the longest digits of the template picture is greater than the preset digit;
modifying the corresponding template picture according to the transformation rule to enable the template picture to represent the target number at the corresponding position in the target number code, and obtaining a picture to be combined;
and combining the pictures to be combined according to a preset picture combination rule to obtain the watermark pictures.
A watermark decoding method, comprising:
converting each component image in the watermark picture to be decoded, which is obtained according to the watermark coding method, according to a corresponding conversion rule to obtain a digital code corresponding to each component image;
sequencing all the digital codes according to a preset picture combination rule to obtain digital codes to be decoded;
splitting the digital code to be decoded into different digital code segments according to a preset second splitting rule;
and decoding each digital coding segment into corresponding text content according to different preset coding and decoding rules corresponding to each digital coding segment.
A watermark encoding apparatus comprising:
the text content splitting module is used for acquiring target text content to be coded and splitting the target text content into at least one text string to be coded according to a preset first splitting rule;
the target digital coding module is used for converting the text string to be coded into digital codes corresponding to preset digits and a carry system according to a preset coding and decoding rule corresponding to the text string to be coded and acquiring the target digital codes according to at least one digital code;
a template picture module, configured to obtain at least one template picture for generating a watermark, a transformation rule corresponding to the template picture, and a longest bit corresponding to the transformation rule and used for representing the digital code, where a sum of the longest bit of the template picture is greater than the preset bit;
the picture modification module is used for modifying the corresponding template picture according to the transformation rule so that the template picture represents the target number at the corresponding position in the target number code to obtain a picture to be combined;
and the picture combination module is used for combining the pictures to be combined according to a preset picture combination rule to obtain the watermark pictures.
A watermark decoding apparatus comprising:
the image conversion module is used for converting each component image in the watermark picture to be decoded, which is obtained according to the watermark coding device, according to the corresponding conversion rule to obtain the digital code corresponding to each component image;
the digital coding module to be decoded is used for sequencing all the digital codes according to a preset picture combination rule to obtain the digital codes to be decoded;
the digital code splitting module is used for splitting the digital code to be decoded into different digital code segments according to a preset second splitting rule;
and the digital coding and decoding module is used for decoding each digital coding segment into corresponding text content according to different preset coding and decoding rules corresponding to each digital coding segment.
A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, the processor implementing the steps of the above-mentioned watermark encoding method and/or watermark decoding method when executing the computer program.
A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the above-mentioned watermark encoding method and/or watermark decoding method.
According to the watermark encoding method, the watermark decoding device, the computer equipment and the storage medium, the target text content is divided into the text strings to be encoded, then the text strings to be encoded are converted into the corresponding digital codes, and then the digital codes are converted into the watermark pictures for pairing by using the template pictures. The method has the advantages that the template picture representing the specific significance can be set to be used for generating the watermark picture, so that the user experience of a watermark viewer is greatly improved, and the restoration rate of the watermark picture can be improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments of the present invention will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to these drawings without inventive labor.
Fig. 1 is a schematic diagram of an application environment of a watermark encoding method and a watermark decoding method according to an embodiment of the present invention;
fig. 2 is a flowchart of a watermark encoding method according to an embodiment of the invention;
fig. 3 is a schematic structural diagram of a watermark encoding apparatus according to an embodiment of the present invention;
FIG. 4 is a flowchart of a watermark decoding method according to an embodiment of the invention;
fig. 5 is a schematic structural diagram of a watermark decoding apparatus according to an embodiment of the present invention;
FIG. 6 is a schematic diagram of a computer device in accordance with an embodiment of the present invention;
FIG. 7 is a schematic diagram of another computer device in an embodiment of the invention;
FIG. 8 is a diagram illustrating the structure of a Chinese character pronunciation table according to an embodiment of the present invention;
FIG. 9 is a diagram illustrating a template picture according to an embodiment of the present invention;
fig. 10 is a schematic diagram illustrating transformation rules of a template picture according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The watermark encoding method and the watermark decoding method provided by the application can be applied to the application environment as shown in fig. 1, wherein the computer device can communicate with the server through the network. The computer device may be, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers, and portable wearable devices. The server may be implemented as a stand-alone server or as a server cluster consisting of a plurality of servers.
In an embodiment, as shown in fig. 2, a watermark encoding method is provided, which is described by taking the method as an example applied to the server in fig. 1, and includes the following steps S101 to S105.
S101, target text content to be coded is obtained, and the target text content is split into at least one text string to be coded according to a preset first splitting rule.
Specifically, in the field of information security, in order to prevent information of an office computer from being compromised by means of photographing or screen capturing, personal attribute information of a user of the office computer is generally used for encoding to generate a watermark picture, the watermark picture is displayed on a screen of the office computer in a reasonable manner, and better use experience is maintained while information leakage is prevented. The target text content is formulated according to the personal attribute information, which includes but is not limited to: name, gender, department, level, computer machine name, numerical code, etc. After the personal attribute information is determined, it is necessary to make an organization rule for organizing the personal attribute information, and the first splitting rule is established according to the organization rule. For example, according to an organization rule, the first of the target text content is a name, the second is a numerical code, and the third is a department abbreviation, so that the first splitting rule is bound to obtain three kinds of information of the name, the numerical code and the department abbreviation when processing the target text content, and the target text content is text content which cannot be coded under the condition that the splitting cannot be performed or the splitting fails according to the first splitting rule.
S102, converting the text string to be coded into digital codes corresponding to preset digits and a carry according to a preset coding and decoding rule corresponding to the text string to be coded, and acquiring a target digital code according to at least one digital code.
Specifically, firstly, a text type of each text string to be encoded is obtained, and a corresponding encoding and decoding rule is obtained according to the text type. Wherein the text type includes all symbols that can be recognized by a computer system, such as chinese characters, numerals, characters, etc. Further, the text type may also be a type customized using symbols recognizable by the computer system, such as using the letter YF to represent the developer and using the letter YY to represent the operator. If the text type is a Chinese character type, the position serial number of the pronunciation of each Chinese character in the text string to be coded is inquired in a preset Chinese character pronunciation table, and the position serial number is converted into a numerical code with a corresponding digit number and a binary system, for example, the Chinese character pronunciation table can be an ordered set as shown in fig. 7, and the sequence of the pronunciation of each Chinese character in the Chinese character pronunciation table is the position serial number of the pronunciation of each Chinese character. And if the text type is a numeric type, converting the text string to be coded into a numeric code corresponding to a digit number and a scale. And if the text type is a classification type, acquiring a classification serial number corresponding to the text string to be coded from a preset classification table, and converting the classification serial number into a corresponding digit and a numerical code of a system. The above-mentioned Chinese character type, number type and classification type respectively correspond to two basic types and a user-defined type of text type processing mode, and the processing modes corresponding to other more types are similar to these processing modes and are not repeated herein. And finally, combining all the digital codes according to a preset combination sequence to obtain the target digital code.
S103, obtaining at least one template picture for generating the watermark, a transformation rule corresponding to the template picture and the longest digit corresponding to the transformation rule and used for representing the digital code, wherein the sum of the longest digits of the template picture is larger than the preset digit.
Specifically, firstly, a template picture is randomly acquired from a template picture library, and the template picture is put into a picture set to be modified. Then, the sum of the longest digit of all template pictures in the picture set to be modified, which represents digital coding, is calculated. And finally, repeating the steps until the sum is greater than or equal to the preset digit. The sum of the longest digit representing the digital code of all the template pictures in the picture set to be modified is greater than or equal to the preset digit, so that the digital code of the preset digit can be completely represented by combining all the template pictures in the picture set to be modified.
S104, modifying the corresponding template picture according to the transformation rule to enable the template picture to represent the target number at the corresponding position in the target number coding, and obtaining the picture to be combined.
Specifically, firstly, a template picture to be modified is randomly taken out from the picture set to be modified, and a corresponding transformation rule of the template picture to be modified is obtained from the template picture library. And then, acquiring target numbers of corresponding positions in the digital codes, which are required to be represented by the template picture, and modifying the template picture according to the transformation rules and the target numbers to obtain a picture to be combined. And finally, repeating the steps until all the template pictures to be modified in the picture set to be modified are modified to obtain at least one picture to be combined. For example, the template picture shown in fig. 8 and the transformation rule of the template picture shown in fig. 9, it can be known that the longest bit number of the digital code represented by the template picture shown in fig. 8 is 16 bits according to the transformation rule shown in fig. 9. It should be noted that fig. 8 and 9 in this embodiment only briefly show the transformation rules of "chinese" characters, in a more specific implementation process of the embodiment, more complex transformation rules may be designed according to actual requirements or other situations, and the template picture used for transformation is not limited to chinese characters, but also may be other various image elements, and the transformation rules for the template picture are not limited to the opening processing shown in fig. 9.
And S105, combining the pictures to be combined according to a preset picture combination rule to obtain the watermark pictures.
It should be noted that the pictures to be combined need to set a reasonable picture combination rule according to a certain combination logic. For example, four pictures to be combined of the characters of "know", "produce", and "right" are generated, and the combined pictures are watermark pictures in the order of "intellectual property" instead of watermark pictures in other orders after being combined according to the picture combination rule. In an optional embodiment, the image combination rule sets an image sequence number for each template image, and after the images to be combined are generated according to the modification of the template images, the images to be combined are combined according to the sequence number of each image to be combined, so as to obtain a reasonable watermark image.
In the watermark encoding method provided by this embodiment, the target text content is split into the text string to be encoded, the text string to be encoded is then converted into the corresponding digital code, and the digital code is converted into the watermark picture for pairing by using the template picture. The method has the advantages that the exquisite template picture representing the specific significance can be set for generating the watermark picture, so that the user experience of a watermark viewer is greatly improved, and the restoration rate of the watermark picture can be improved.
Fig. 4 is a flowchart illustrating a method for decoding a watermark picture obtained by the above watermark encoding method according to an embodiment of the present invention, and a method for decoding a watermark picture obtained by the above watermark encoding method according to another embodiment of the present invention is provided, as shown in fig. 4, the method includes the following steps S201 to S204:
s201, converting each component image in the watermark picture to be decoded, which is obtained according to the watermark coding method, according to a corresponding conversion rule to obtain a digital code corresponding to each component image.
Specifically, firstly, splitting a watermark picture to be decoded to obtain at least one component image, searching a template picture corresponding to the component image in a preset template picture library, and obtaining a transformation rule corresponding to the template picture. And then, obtaining the digital codes corresponding to the composition images according to the transformation rules. And finally, repeating the steps until the digital codes of all the component images are obtained. It should be noted that the digital code scale should be consistent with the digital code scale in the foregoing watermark encoding method, so as to ensure the accuracy of the decoded content.
S202, sequencing all the digital codes according to a preset picture combination rule to obtain the digital codes to be decoded.
The preset picture combination rule can correctly indicate the sequence of the digital codes, and if the digital codes obtained by each image are not sequenced according to the correct sequence, the text content obtained after decoding is not consistent with the target text content before watermark coding. The technical description about the picture combination rule has been exemplified and explained in the foregoing watermark encoding method, and is not repeated herein.
S203, splitting the digital code to be decoded into different digital code segments according to a preset second splitting rule.
The second splitting rule is set according to a preset encoding rule in the watermark encoding method, numbers at different continuous positions of the numbers to be decoded are combined to represent different personal attribute information, and the explanation of the personal attribute information is explained in the watermark encoding method, and is not described herein again. For example, the number to be decoded of "000111001101" is split according to the preset second splitting rule, so as to obtain three number code segments of "000111", "0011" and "01", where the "000111" number code segment represents a name, the "0011" number code segment represents a number sequence number, and the "01" number code segment represents a department sequence number. The foregoing splitting method of the number to be decoded is merely exemplary, and in an actual implementation process, different systems, bit numbers, splitting methods, and the like may be changed according to requirements or actual scenes.
S204, decoding each digital coding section into corresponding text content according to different preset coding and decoding rules corresponding to each digital coding section.
For the description of the encoding and decoding rule, the description of the watermark encoding method is described in detail, and is not described herein again. It should be noted that, after each digital coding segment is obtained and decoded to generate a corresponding text content, the information represented by the text content can restore the content of the personal attribute information, but if information completely consistent with the target text content is to be obtained, a proper combination order needs to be reversely derived according to the first splitting rule, so that the target text content can be combined according to the combination order.
In an embodiment, a watermark encoding apparatus 100 is provided, where the watermark encoding apparatus 100 corresponds to the watermark encoding method in the foregoing embodiment one to one, as shown in fig. 3, the watermark encoding apparatus 100 includes a text content splitting module 11, a target digital encoding module 12, a template picture module 13, a picture modifying module 14, and a picture combining module 15. The functional modules are explained in detail as follows:
the text content splitting module 11 is configured to obtain target text content to be encoded, and split the target text content into at least one text string to be encoded according to a preset first splitting rule;
the target digital coding module 12 is configured to convert the text string to be coded into digital codes corresponding to preset digits and a scale according to a preset coding and decoding rule corresponding to the text string to be coded, and obtain a target digital code according to at least one of the digital codes;
a template picture module 13, configured to obtain at least one template picture for generating a watermark, a transformation rule corresponding to the template picture, and a longest bit corresponding to the transformation rule and used for representing the digital code, where a sum of the longest bit of the template picture is greater than the preset bit;
the picture modifying module 14 is configured to modify the corresponding template picture according to the transformation rule, so that the template picture represents a target number at a corresponding position in the target number code, and a picture to be combined is obtained;
and the picture combination module 15 is configured to combine the pictures to be combined according to a preset picture combination rule to obtain a watermark picture.
Further, the target digital encoding module 12 further includes:
the text type submodule is used for acquiring the text type of each text string to be coded and acquiring a corresponding coding and decoding rule according to the text type;
the Chinese character type submodule is used for inquiring the position serial number of the pronunciation of each Chinese character in the text string to be coded in a preset Chinese character pronunciation table if the text type is the Chinese character type, and converting the position serial number into a numerical code corresponding to the digit number and the system;
the digital type submodule is used for converting the text string to be coded into digital codes corresponding to digits and a carry system if the text type is a digital type;
the classification type submodule is used for acquiring a classification serial number corresponding to the text string to be coded from a preset classification table if the text type is a classification type, and converting the classification serial number into a digital code of a corresponding digit and a binary system;
and the digital code combination submodule is used for combining all the digital codes according to a preset combination sequence to obtain the target digital code.
Further, the template picture module 13 further includes:
the to-be-modified picture submodule is used for randomly acquiring a template picture from a template picture library and putting the template picture into a to-be-modified picture set;
the sum value operator module is used for calculating the sum of the longest digit of all template pictures in the picture set to be modified, which represents the digital code;
a first cycle submodule for repeating the above steps until the sum is greater than or equal to the predetermined number of bits.
Further, the picture modification module 14 further includes:
the template picture acquisition submodule is used for randomly taking out a template picture to be modified from the picture set to be modified;
the rule obtaining sub-module is used for obtaining the corresponding transformation rule of the template picture to be modified from the template picture library;
the target number sub-module is used for acquiring the target number of the corresponding position in the digital code to be expressed by the template picture;
the picture modification sub-module is used for modifying the template picture according to the transformation rule and the target number to obtain a picture to be combined;
and the second circulation sub-module is used for repeating the steps until all the template pictures to be modified in the picture set to be modified are modified to obtain at least one picture to be combined.
For the specific definition of the watermark encoding apparatus, reference may be made to the above definition of the watermark encoding method, which is not described herein again. The modules in the watermark encoding device can be wholly or partially implemented by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as shown in fig. 6. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The database of the computer device is used for storing data involved in the watermark encoding method. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a watermark encoding method.
In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as shown in fig. 6. The computer device includes a processor, a memory, a network interface, a display screen, and an input device connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The network interface of the computer device is used for communicating with an external server through a network connection. The computer program is executed by a processor to implement a watermark encoding method.
In one embodiment, there is provided a computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the watermark encoding method in the above embodiments when executing the computer program, such as the steps S101 to S105 shown in fig. 2 and other extensions of the method and related steps. Alternatively, the processor, when executing the computer program, implements the functions of the modules/units of the watermark encoding apparatus in the above-described embodiment, such as the functions of the modules 11 to 15 shown in fig. 3. To avoid repetition, further description is omitted here.
In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, which when executed by a processor implements the steps of the watermark encoding method in the above embodiments, such as the steps S101 to S105 shown in fig. 2 and extensions of other extensions and related steps of the method. Alternatively, the computer program, when executed by the processor, implements the functions of the modules/units of the watermark encoding apparatus in the above-described embodiments, such as the functions of the modules 11 to 15 shown in fig. 3. To avoid repetition, further description is omitted here.
Fig. 5 is a schematic structural diagram of a watermark decoding apparatus 200 according to an embodiment of the present invention, and as shown in fig. 5, the watermark decoding apparatus 200 for decoding a watermark picture generated by the watermark encoding apparatus 100 includes an image conversion module 21, a to-be-decoded digital encoding module 22, a digital encoding/decoding module 23, and a digital encoding/decoding module 24. The functional modules are explained in detail as follows:
the image conversion module 21 is configured to convert each component image in the watermark picture to be decoded, which is obtained according to the watermark encoding apparatus, according to a corresponding conversion rule, so as to obtain a digital code corresponding to each component image;
the digital coding module 22 to be decoded is used for sequencing all the digital codes according to a preset picture combination rule to obtain digital codes to be decoded;
the digital code splitting module 23 is configured to split the digital code to be decoded into different digital code segments according to a preset second splitting rule;
and the digital coding and decoding module 24 is used for decoding each digital coding segment into corresponding text content according to different preset coding and decoding rules corresponding to each digital coding segment.
Further, the image conversion module 21 further includes:
the picture splitting submodule is used for splitting the watermark picture to be decoded to obtain at least one component image;
the rule obtaining sub-module is used for searching template pictures corresponding to the composition images in a preset template picture library and obtaining transformation rules corresponding to the template pictures;
the coding composition submodule is used for obtaining a digital code corresponding to the composition image according to the transformation rule;
and the third circulation sub-module is used for repeating the steps until the digital codes of all the composition images are obtained.
Wherein the meaning of "first" and "second" in the above modules/units is only to distinguish different modules/units, and is not used to define which module/unit has higher priority or other defining meaning. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or modules is not necessarily limited to those steps or modules explicitly listed, but may include other steps or modules not explicitly listed or inherent to such process, method, article, or apparatus, and such that a division of modules presented in this application is merely a logical division and may be implemented in a practical application in a further manner.
For the specific definition of the watermark encoding apparatus, reference may be made to the above definition of the watermark encoding method, which is not described herein again. The modules in the watermark encoding device can be wholly or partially implemented by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as shown in fig. 6. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The database of the computer device is used for storing data involved in the watermark encoding method. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a watermark encoding method.
In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as shown in fig. 7. The computer device comprises a processor, a memory, a network interface, a display screen and an input device which are connected through a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The network interface of the computer device is used for communicating with an external server through a network connection. The computer program is executed by a processor to implement a watermark encoding method.
In one embodiment, there is provided a computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the watermark encoding method in the above embodiments when executing the computer program, such as the steps 201 to 204 shown in fig. 4 and other extensions of the method and related steps. Alternatively, the processor, when executing the computer program, implements the functions of the modules/units of the watermark encoding apparatus in the above-described embodiments, such as the functions of the modules 21 to 24 shown in fig. 5. To avoid repetition, further description is omitted here.
The Processor may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component, etc. The general purpose processor may be a microprocessor or the processor may be any conventional processor or the like which is the control center for the computer device and which connects the various parts of the overall computer device using various interfaces and lines.
The memory may be used to store the computer programs and/or modules, and the processor may implement various functions of the computer device by running or executing the computer programs and/or modules stored in the memory and invoking data stored in the memory. The memory may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, video data, etc.) created according to the use of the cellular phone, etc.
The memory may be integrated in the processor or may be provided separately from the processor.
In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, which when executed by a processor implements the steps of the watermark encoding method in the above embodiments, such as the steps S201 to S204 shown in fig. 4 and extensions of other extensions and related steps of the method. Alternatively, the computer program, when executed by the processor, implements the functions of the modules/units of the watermark encoding apparatus in the above-described embodiments, such as the functions of the modules 21 to 24 shown in fig. 5. To avoid repetition, further description is omitted here.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present invention, and are intended to be included within the scope of the present invention.

Claims (10)

1. A watermark encoding method, comprising:
acquiring target text content to be coded, and splitting the target text content into at least one text string to be coded according to a preset first splitting rule;
converting the text string to be coded into digital codes corresponding to preset digits and a carry system according to a preset coding and decoding rule corresponding to the text string to be coded, and acquiring a target digital code according to at least one digital code;
acquiring at least one template picture for generating a watermark, a transformation rule corresponding to the template picture and a longest digit corresponding to the transformation rule and used for representing the digital code, wherein the sum of the longest digits of the template picture is greater than the preset digit;
modifying the corresponding template picture according to the transformation rule to enable the template picture to represent the target number at the corresponding position in the target number code, and obtaining a picture to be combined;
and combining the pictures to be combined according to a preset picture combination rule to obtain the watermark picture.
2. The method of claim 1, wherein the converting the text string to be encoded into digital codes corresponding to preset digits and a scale according to a preset encoding and decoding rule corresponding to the text string to be encoded, and the obtaining a target digital code according to at least one of the digital codes comprises:
acquiring the text type of each text string to be coded, and acquiring a corresponding coding and decoding rule according to the text type;
if the text type is a Chinese character type, inquiring the position serial number of the pronunciation of each Chinese character in the text string to be coded in a preset Chinese character pronunciation table, and converting the position serial number into a digital code of a corresponding digit and a system;
if the text type is a digital type, converting the text string to be coded into a digital code corresponding to a digit and a scale;
if the text type is a classification type, acquiring a classification serial number corresponding to the text string to be coded from a preset classification table, and converting the classification serial number into a corresponding digit and a numerical code of a system;
and combining all the digital codes according to a preset combination sequence to obtain the target digital code.
3. The watermark encoding method according to claim 1, wherein the obtaining at least one template picture for generating a watermark, and a transformation rule corresponding to the template picture and a longest bit corresponding to the transformation rule for representing the digital encoding, and a sum of the longest bit of the template picture being greater than the preset number of bits includes:
randomly acquiring a template picture from a template picture library, and putting the template picture into a picture set to be modified;
calculating the sum of the longest digit of all template pictures representing digital codes in the picture set to be modified;
and repeating the steps until the sum is greater than or equal to the preset digit.
4. The watermark encoding method according to claim 3, wherein the modifying the corresponding template picture according to the transformation rule so that the template picture represents a target number at a corresponding position in the target number encoding, and obtaining a picture to be combined comprises:
randomly taking out a template picture to be modified from the picture set to be modified;
acquiring a corresponding transformation rule of the template picture to be modified from the template picture library;
acquiring a target number of a corresponding position in the digital code to be represented by the template picture;
modifying the template picture according to the transformation rule and the target number to obtain a picture to be combined;
and repeating the steps until all the template pictures to be modified in the picture set to be modified are modified to obtain at least one picture to be combined.
5. A watermark decoding method, comprising:
converting each component image in the watermark picture to be decoded obtained according to any one of claims 1 to 4 according to a corresponding conversion rule to obtain a digital code corresponding to each component image;
sequencing all the digital codes according to a preset picture combination rule to obtain digital codes to be decoded;
splitting the digital code to be decoded into different digital code segments according to a preset second splitting rule;
and decoding each digital coding segment into corresponding text content according to different preset coding and decoding rules corresponding to each digital coding segment.
6. The stamp decoding method according to claim 5, wherein the converting each component image in the watermark picture to be decoded obtained according to any one of claims 1 to 4 according to the corresponding transformation rule to obtain the digital code corresponding to each component image comprises:
splitting a watermark picture to be decoded to obtain at least one component image;
searching a template picture corresponding to the composition image in a preset template picture library, and acquiring a transformation rule corresponding to the template picture;
obtaining digital codes corresponding to the composition images according to the transformation rules;
and repeating the steps until the digital codes of all the component images are obtained.
7. A watermark encoding apparatus, comprising:
the text content splitting module is used for acquiring target text content to be coded and splitting the target text content into at least one text string to be coded according to a preset first splitting rule;
the target digital coding module is used for converting the text string to be coded into digital codes corresponding to preset digits and a carry system according to a preset coding and decoding rule corresponding to the text string to be coded and acquiring the target digital codes according to at least one digital code;
the template picture module is used for acquiring at least one template picture for generating a watermark, a transformation rule corresponding to the template picture and the longest digit corresponding to the transformation rule and used for representing the digital code, and the sum of the longest digits of the template picture is greater than the preset digit;
the picture modification module is used for modifying the corresponding template picture according to the transformation rule so that the template picture represents the target number at the corresponding position in the target number code to obtain a picture to be combined;
and the picture combination module is used for combining the pictures to be combined according to a preset picture combination rule to obtain the watermark pictures.
8. A watermark decoding apparatus, comprising:
an image conversion module, configured to convert each component image in the watermark picture to be decoded, obtained according to claim 7, according to a corresponding transformation rule, so as to obtain a digital code corresponding to each component image;
the digital coding module to be decoded is used for sequencing all the digital codes according to a preset picture combination rule to obtain the digital codes to be decoded;
the digital code splitting module is used for splitting the digital code to be decoded into different digital code segments according to a preset second splitting rule;
and the digital coding and decoding module is used for decoding each digital coding segment into corresponding text content according to different preset coding and decoding rules corresponding to each digital coding segment.
9. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the steps of the method according to any one of claims 1 to 4 and/or 5 to 6 when executing the computer program.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to one of claims 1 to 4, and/or 5 to 6.
CN202210601084.9A 2022-05-30 2022-05-30 Watermark encoding method, watermark decoding method and related equipment Pending CN115018687A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210601084.9A CN115018687A (en) 2022-05-30 2022-05-30 Watermark encoding method, watermark decoding method and related equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210601084.9A CN115018687A (en) 2022-05-30 2022-05-30 Watermark encoding method, watermark decoding method and related equipment

Publications (1)

Publication Number Publication Date
CN115018687A true CN115018687A (en) 2022-09-06

Family

ID=83071247

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210601084.9A Pending CN115018687A (en) 2022-05-30 2022-05-30 Watermark encoding method, watermark decoding method and related equipment

Country Status (1)

Country Link
CN (1) CN115018687A (en)

Similar Documents

Publication Publication Date Title
CN107025480B (en) Image generation method and apparatus thereof
CN111191414A (en) Page watermark generation method, identification method, device, equipment and storage medium
CN110245469B (en) Webpage watermark generation method, watermark analysis method, device and storage medium
US10853917B2 (en) Color image authentication method based on palette compression technique
CN111539502B (en) Anti-counterfeiting two-dimensional code generation method and device, server and storage medium
CN111159329A (en) Sensitive word detection method and device, terminal equipment and computer-readable storage medium
CN114818000B (en) Privacy protection set confusion intersection method, system and related equipment
CN111784812A (en) Rendering method, rendering device, storage medium and electronic equipment
EP3367254A1 (en) Method and apparatus for generating random character string
CN111222611B (en) Color-based stacked three-dimensional code encoding method, encoding device, decoding method, decoding device and storage medium
CN110597814A (en) Structured data serialization and deserialization method and device
KR101220254B1 (en) Searchable color encoded file composing method and searchable color encoded file system
CN114840861A (en) Data processing method, device, equipment and storage medium
CN112668300B (en) Formula editing method, device, computer equipment and storage medium
CN111966352A (en) Form generation method and device, storage medium and electronic equipment
CN115018687A (en) Watermark encoding method, watermark decoding method and related equipment
US20180113849A1 (en) System and method for cheque image data masking
CN112256547A (en) Data recording method and device
CN110730277B (en) Information coding and method and device for acquiring coded information
CN116127419A (en) Data processing method, data identification method, font file generation method and device
CN111400670B (en) Watermark adding method, device, equipment and storage medium
CN115550030A (en) Data encryption method and device, storage medium and electronic equipment
CN113094624B (en) Page generation method and device and electronic equipment
CN115203600A (en) Method, device, equipment and medium for generating short link
CN111737745A (en) Data encryption method and device, computer equipment and storage medium

Legal Events

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