CN112613003A - Text processing method and device - Google Patents

Text processing method and device Download PDF

Info

Publication number
CN112613003A
CN112613003A CN202011597029.4A CN202011597029A CN112613003A CN 112613003 A CN112613003 A CN 112613003A CN 202011597029 A CN202011597029 A CN 202011597029A CN 112613003 A CN112613003 A CN 112613003A
Authority
CN
China
Prior art keywords
text
seal
page
verified
counterfeiting
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.)
Granted
Application number
CN202011597029.4A
Other languages
Chinese (zh)
Other versions
CN112613003B (en
Inventor
郑国杰
邓伟仲
张延堂
梁淼
葛江浩
赵思远
吴鹏程
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Agricultural Bank of China
Original Assignee
Agricultural Bank of China
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 Agricultural Bank of China filed Critical Agricultural Bank of China
Priority to CN202011597029.4A priority Critical patent/CN112613003B/en
Publication of CN112613003A publication Critical patent/CN112613003A/en
Application granted granted Critical
Publication of CN112613003B publication Critical patent/CN112613003B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/10Protecting distributed programs or content, e.g. vending or licensing of copyrighted material ; Digital rights management [DRM]
    • G06F21/16Program or content traceability, e.g. by watermarking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/34Browsing; Visualisation therefor
    • G06F16/345Summarisation for human users
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Technology Law (AREA)
  • Multimedia (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Editing Of Facsimile Originals (AREA)

Abstract

The invention provides a text processing method and a text processing device, wherein the method comprises the following steps: when the instruction type of the received processing instruction is an anti-counterfeiting type, acquiring a to-be-used printing text, a first electronic seal and anti-counterfeiting data; transcoding anti-counterfeiting abstract information acquired from anti-counterfeiting data to obtain an abstract coding sequence; determining a first printing width of each text page based on the abstract coding sequence, the to-be-used printing text and the first electronic seal; cutting the first electronic seal based on each first seal width to obtain a first perforation seal; and carrying out pixel random disturbance treatment on the first perforation seal to obtain a second perforation seal, and stamping the second perforation seal on the to-be-used printing text to obtain an anti-counterfeiting text and generate text abstract information corresponding to the anti-counterfeiting text. The anti-counterfeiting abstract information is embedded into the electronic seal, and the perforation seal is subjected to pixel random disturbance treatment, so that the perforation seal is prevented from being forged, and the probability of replacing and stealing the content of the file is reduced.

Description

Text processing method and device
Technical Field
The invention relates to the technical field of electronic seals, in particular to a text processing method and device.
Background
In life, in order to ensure the undeniability of paper documents, a physical seal is commonly stamped on a plurality of pages of the paper documents, each page is only stamped with one part of the physical seal, and the plurality of pages are combined to obtain a complete physical seal, so that a certain page or certain pages of the paper documents are ensured not to be replaced, and the seal stamped on the paper documents is called as a joint seal.
With the development of interconnection technology and application in life, more and more paper documents are electronized, and electronic seals are generally used for stamping on electronic documents in order to ensure the authenticity, integrity, confidentiality and non-repudiation of the electronic documents. The conventional way of stamping a perforation seal on an electronic document is to perform an average cutting on the electronic seal to obtain the perforation seal, and to stamp the obtained perforation seal on the electronic document. The traditional mode is easy to forge the seal on the perforation, so that the content of the electronic document is easy to replace, steal or forge, and the security of the electronic document is reduced.
Disclosure of Invention
In view of this, the present invention provides a method and an apparatus for processing a text, in which information is embedded in an electronic seal to obtain a corresponding perforation seal, and the perforation seal is applied to the text to complete anti-counterfeit processing of the text, thereby preventing the text from being tampered or replaced.
In order to achieve the purpose, the invention provides the following technical scheme:
a text processing method comprises the following steps:
when a processing instruction sent by a user is received, determining the instruction type of the processing instruction;
if the instruction type of the processing instruction is an anti-counterfeiting type, acquiring a to-be-used printing text, a first electronic seal and anti-counterfeiting data;
acquiring anti-counterfeiting abstract information of the anti-counterfeiting data, and transcoding the anti-counterfeiting abstract information to obtain an abstract coding sequence, wherein the abstract coding sequence comprises a plurality of sequence numbers, and the number of the sequence numbers in the abstract coding sequence is not less than the page number of the text to be printed;
determining a first printing width of each text page of the to-be-printed text based on the abstract coding sequence, the to-be-printed text and the first electronic seal;
cutting the first electronic seal based on the first printing width of each text page to obtain a first perforation seal corresponding to the to-be-printed text;
and carrying out pixel random disturbance treatment on the first perforation seal to obtain a second perforation seal, and stamping the second perforation seal on the to-be-used printed text to obtain an anti-counterfeiting text, and generating text abstract information corresponding to the anti-counterfeiting text to finish the anti-counterfeiting treatment on the to-be-used printed text.
Optionally, the above method, where the obtaining of the anti-fake digest information of the anti-fake data and the transcoding processing of the anti-fake digest information are performed to obtain a digest encoding sequence, includes:
acquiring the capacity information of the first electronic seal;
calling a preset abstract extraction algorithm to perform abstract extraction processing on the anti-counterfeiting data based on the capacity information to obtain anti-counterfeiting abstract information corresponding to the anti-counterfeiting data;
and calling a preset code converter to carry out transcoding processing on the anti-counterfeiting abstract information to obtain an abstract coding sequence.
Optionally, the determining, based on the digest encoding sequence, the to-be-printed text, and the first electronic seal, a first printing width of each text page of the to-be-printed text includes:
determining a first average seal width of each text page of the to-be-printed text based on the text page number of the to-be-printed text and the seal width of the first electronic seal;
dividing the summary coding sequence based on the text page number of the text to be printed to obtain a plurality of sequence groups; the number of the sequence groups is equal to the number of text pages of the text to be printed, and each sequence group comprises at least one sequence number;
according to a preset allocation rule, allocating each sequence group to a text page corresponding to the sequence group;
and calculating to obtain a first printing width of the text page based on the first average stamp width and the sequence group of the text page for each text page of the text to be printed.
Optionally, the method for calculating the first stamp width of the text page based on the first average stamp width and the sequence group of the text page includes:
for each sequence number in the sequence group, transcoding the sequence number to obtain a transcoding numerical value, and subtracting a preset first threshold value from the transcoding numerical value to obtain a first calculated value corresponding to the sequence number;
and summing the first calculation values and the first average seal width of the text page to obtain second calculation values, and taking the second calculation values as the first seal width of the text page.
The above method, optionally, further includes:
if the instruction type of the processing instruction is a verification type, acquiring a text to be verified and a second electronic seal;
extracting verification abstract information of the text to be verified, and verifying the text to be verified based on the verification abstract information;
when the text to be verified passes verification, acquiring a printing image of each page to be verified of the text to be verified;
denoising each printed image to obtain a processed image corresponding to each printed image;
for each processed image, calling a preset recognition algorithm to perform recognition processing on the processed image to obtain a second printing width of the page to be verified corresponding to the processed image;
determining a second average seal width of each page to be verified of the text to be verified based on the page number of the text to be verified and the seal width of the second electronic seal;
for each page to be verified, subtracting the second average seal width from the second seal width of the page to be verified to obtain a third calculated value, and adding the third calculated value to a preset second threshold value to obtain a verification value of the page to be verified;
and obtaining a verification sequence of the text to be verified based on the verification value of each page to be verified of the text to be verified, coding the verification sequence to obtain verification information of the text to be verified, and completing verification processing of the text to be verified.
A device for processing text, comprising:
the device comprises a first determining unit, a second determining unit and a processing unit, wherein the first determining unit is used for determining the instruction type of a processing instruction when the processing instruction sent by a user is received;
the first obtaining unit is used for obtaining a to-be-used printing text, a first electronic seal and anti-counterfeiting data if the instruction type of the processing instruction is an anti-counterfeiting type;
the transcoding unit is used for acquiring anti-counterfeiting abstract information of the anti-counterfeiting data and transcoding the anti-counterfeiting abstract information to obtain an abstract coding sequence, wherein the abstract coding sequence comprises a plurality of sequence numbers, and the number of the sequence numbers in the abstract coding sequence is not less than the page number of the text to be printed;
the second determining unit is used for determining the first printing width of each text page of the to-be-printed text based on the abstract coding sequence, the to-be-printed text and the first electronic seal;
the cutting unit is used for cutting the first electronic seal based on the first printing width of each text page to obtain a first perforation seal corresponding to the to-be-printed text;
and the generation unit is used for carrying out pixel random disturbance treatment on the first perforation seal to obtain a second perforation seal, and adding the second perforation seal to the text to be printed to obtain an anti-counterfeiting text, and generating text abstract information corresponding to the anti-counterfeiting text to finish anti-counterfeiting treatment on the text to be printed.
The above apparatus, optionally, the transcoding unit includes:
the acquisition subunit is used for acquiring the capacity information of the first electronic seal;
the first calling subunit is used for calling a preset abstract extraction algorithm to perform abstract extraction processing on the anti-counterfeiting data based on the capacity information to obtain anti-counterfeiting abstract information corresponding to the anti-counterfeiting data;
and the second calling subunit is used for calling a preset code converter to carry out transcoding processing on the anti-counterfeiting abstract information to obtain an abstract coding sequence.
The above apparatus, optionally, the second determining unit includes:
the determining subunit is used for determining a first average seal width of each text page of the to-be-printed text based on the text page number of the to-be-printed text and the seal width of the first electronic seal;
the dividing subunit is used for dividing the abstract coding sequence based on the text page number of the text to be printed to obtain a plurality of sequence groups; the number of the sequence groups is equal to the number of text pages of the text to be printed, and each sequence group comprises at least one sequence number;
the distribution subunit is used for distributing each sequence group to the text page corresponding to the sequence group according to a preset distribution rule;
and the calculating subunit is used for calculating to obtain a first printing width of each text page of the to-be-printed text based on the first average stamp width and the sequence group of the text page.
The above apparatus, optionally, the calculating subunit includes:
the transcoding module is used for transcoding each sequence number in the sequence group to obtain a transcoding numerical value, and subtracting a preset first threshold value from the transcoding numerical value to obtain a first calculated value corresponding to the sequence number;
and the summation module is used for carrying out summation operation on each first calculation value and the first average seal width of the text page to obtain a second calculation value, and taking the second calculation value as the first seal width of the text page.
The above apparatus, optionally, further includes:
the second obtaining unit is used for obtaining a text to be verified and a second electronic seal if the instruction type of the processing instruction is a verification type;
the extraction unit is used for extracting the verification abstract information of the text to be verified and verifying the text to be verified based on the verification abstract information;
the third acquisition unit is used for acquiring a printing image of each page to be verified of the text to be verified when the text to be verified passes verification;
the processing unit is used for carrying out denoising processing on each printed image to obtain a processed image corresponding to each printed image;
the identification unit is used for calling a preset identification algorithm to identify each processed image to obtain a second printing width of the page to be verified corresponding to the processed image;
a third determining unit, configured to determine a second average seal width of each page to be verified of the text to be verified based on the page number of the text to be verified and the seal width of the second electronic seal;
the calculation unit is used for subtracting the second average seal width from the second seal width of each page to be verified to obtain a third calculation value, and adding the third calculation value to a preset second threshold value to obtain a verification value of each page to be verified;
and the coding unit is used for obtaining a verification sequence of the text to be verified based on the verification value of each page to be verified of the text to be verified, coding the verification sequence to obtain verification information of the text to be verified, and completing verification processing of the text to be verified.
Compared with the prior art, the invention has the following advantages:
the invention provides a text processing method and a text processing device, wherein the method comprises the following steps: when a processing instruction sent by a user is received, determining the instruction type of the processing instruction; if the instruction type of the processing instruction is an anti-counterfeiting type, acquiring a to-be-used printing text, a first electronic seal and anti-counterfeiting data; acquiring anti-counterfeiting abstract information of the anti-counterfeiting data, and transcoding the anti-counterfeiting abstract information to obtain an abstract coding sequence, wherein the abstract coding sequence comprises a plurality of sequence numbers, and the number of the sequence numbers in the abstract coding sequence is not less than the page number of the text to be printed; determining a first printing width of each text page of the to-be-printed text based on the abstract coding sequence, the to-be-printed text and the first electronic seal; cutting the first electronic seal based on the first printing width of each text page to obtain a first perforation seal corresponding to the to-be-printed text; and carrying out pixel random disturbance treatment on the first perforation seal to obtain a second perforation seal, and stamping the second perforation seal on the to-be-used printed text to obtain an anti-counterfeiting text, and generating text abstract information corresponding to the anti-counterfeiting text to finish the anti-counterfeiting treatment on the to-be-used printed text. By applying the invention, the anti-counterfeiting abstract information can be embedded into the first electronic seal to obtain the perforation seal, and the obtained perforation seal is unique by carrying out pixel random disturbance treatment on the perforation seal, so that the probability of collision of the perforation seal is reduced, the perforation seal is prevented from being forged, and the probability of replacing and stealing the content of the file is further reduced.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a flowchart of a text processing method according to an embodiment of the present invention;
fig. 2 is a flowchart of another method of a text processing method according to an embodiment of the present invention;
fig. 3 is a flowchart of another method of a text processing method according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a text processing apparatus according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of an electronic device 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 only a part of the embodiments of the present invention, and not all of the embodiments. 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.
In this application, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The invention is operational with numerous general purpose or special purpose computing device environments or configurations. For example: personal computers, server computers, hand-held or portable devices, tablet-type devices, multi-processor apparatus, distributed computing environments that include any of the above devices or equipment, and the like.
The embodiment of the present invention provides a text processing method, which can be applied to a plurality of system platforms, an execution subject of the method can be a computer terminal or a processor of various mobile devices, and a flow chart of the method is shown in fig. 1, and specifically includes:
s101, when a processing instruction sent by a user is received, determining the instruction type of the processing instruction.
In the method provided by the embodiment of the invention, when a user needs to process a text, a processing instruction is sent to the processor, wherein the processing instruction comprises a type identifier, and the instruction type of the processing instruction can be determined according to the type identifier.
Further, the text of the present invention may be an electronic document or a file with multiple pages, such as a PDF document, a WORD document, etc.
S102, if the instruction type of the processing instruction is the anti-counterfeiting type, acquiring a to-be-used printing text, a first electronic seal and anti-counterfeiting data.
In the method provided by the embodiment of the invention, when the instruction type of the processing instruction sent by the user is the anti-counterfeiting type, the user needs to perform anti-counterfeiting processing on the text to obtain the text to be printed, the first electronic seal and anti-counterfeiting data; the method for acquiring the to-be-used seal text, the first electronic seal and the anti-counterfeiting data comprises a plurality of methods, preferably, the to-be-used seal text, the first electronic seal and the anti-counterfeiting data can be uploaded to a processor through a user, and the accuracy of the acquired to-be-used seal text, the acquired first electronic seal and the acquired anti-counterfeiting data can be ensured; the other mode can be that a user encapsulates a text identifier, a seal identifier and anti-counterfeiting data in a processing instruction, the processing instruction is analyzed to obtain the text identifier, the seal identifier and the anti-counterfeiting data, a to-be-used printing text is determined according to the text identifier, a first electronic seal is determined according to the seal identifier, and the first electronic seal can be an electronic image.
The anti-counterfeiting data can be sensitive data, and can specifically include user use information, such as user ID, identification number, IP address and the like.
Preferably, the number of pages of the acquired to-be-used text is not more than the maximum number of pages covered by the first electronic seal.
S103, acquiring anti-counterfeiting abstract information of the anti-counterfeiting data, and transcoding the anti-counterfeiting abstract information to obtain an abstract coding sequence.
In the method provided by the embodiment of the invention, an encryption and coding processing engine can be used for acquiring anti-counterfeiting summary information of anti-counterfeiting data, and the anti-counterfeiting summary information is subjected to transcoding processing to obtain a summary coding sequence, and the specific process is as follows:
acquiring the capacity information of the first electronic seal; calling a preset abstract extraction algorithm to perform abstract extraction processing on the anti-counterfeiting data based on the capacity information to obtain anti-counterfeiting abstract information corresponding to the anti-counterfeiting data; and calling a preset code converter to carry out transcoding processing on the anti-counterfeiting abstract information to obtain an abstract coding sequence. The summary coding sequence comprises a plurality of sequence numbers, and the number of the sequence numbers in the summary coding sequence is not less than the page number of the to-be-used printed text.
In the method provided by the embodiment of the invention, the capacity information of the first electronic seal is acquired, wherein the capacity information of the first electronic seal specifically comprises the information of the maximum acceptable byte length of data of the first electronic seal when the data is embedded into the first electronic seal.
Based on the capacity information, a preset digest extraction algorithm is used for performing digest extraction processing on the anti-counterfeiting data, wherein the digest extraction algorithm can be specifically an MD5 encryption algorithm, and when the MD5 encryption algorithm is used for performing digest extraction processing on the anti-counterfeiting data, the MD5 encryption algorithm can be used for performing encryption processing on the anti-counterfeiting data, so that the obtained anti-counterfeiting digest information can be encryption information. When the MD5 encryption algorithm is used for encrypting the anti-counterfeiting data, the obtained encryption information is fixed-length information, and the byte length of the encryption information is equal to the maximum acceptable byte length of the first electronic seal; furthermore, when the MD5 encryption algorithm is used for encrypting the anti-counterfeiting data, anti-collision processing can be performed, so that the obtained encryption information is information subjected to anti-collision calculation, and the probability of collision of the encryption information is reduced.
The preset code converter adopts a Unicode coding mode, so that the code converter can process various types of symbol information, the anti-counterfeiting data comprises but is not limited to Chinese, English, numbers, symbols and the like, and the anti-counterfeiting abstract information can consist of English, numbers and symbols; the code converter converts the anti-counterfeiting abstract information into a hexadecimal character string, and the hexadecimal character string is used as an abstract coding sequence.
S104, determining a first printing width of each text page of the to-be-printed text based on the abstract coding sequence, the to-be-printed text and the first electronic seal.
In the method provided by the embodiment of the invention, the abstract coding sequence and the first electronic seal are processed based on the text page number of the text to be printed, so that the first printing width of each text page of the text to be printed is obtained. Wherein the first printing width of each text page to be printed in the text is different.
And S105, cutting the first electronic seal based on the first printing width of each text page to obtain a first perforation seal corresponding to the to-be-printed text.
According to the method provided by the embodiment of the invention, the first electronic seal can be cut by using a digital watermarking processing engine according to the first printing width of each text page so as to obtain a seal strip corresponding to the first printing width of each text page, and thus a first perforation seal corresponding to the first electronic seal can be obtained; it should be noted that each stamp strip may constitute a first electronic stamp; therefore, the anti-counterfeiting abstract information can be embedded into the first electronic seal, and therefore the first electronic seal can be prevented from being forged.
S106, pixel random disturbance processing is carried out on the first perforation seal to obtain a second perforation seal, the second perforation seal is covered on the to-be-used printing text to obtain an anti-counterfeiting text, text abstract information corresponding to the anti-counterfeiting text is generated, and anti-counterfeiting processing of the to-be-used printing text is completed.
In the method provided by the embodiment of the invention, in order to improve the anti-counterfeiting degree of the first perforation seal, pixel disturbance processing is carried out on the first perforation seal to obtain the second perforation seal, so that the second perforation seal is difficult to copy, the second perforation seal is stamped on a to-be-used printing text to obtain the anti-counterfeiting text, the authenticity, the completeness and the confidentiality of the anti-counterfeiting text are further ensured, and the safety of the anti-counterfeiting text is improved.
In order to further improve the security of the anti-counterfeiting text and prevent the anti-counterfeiting text from being falsely used, the abstract generation algorithm is used for processing the anti-counterfeiting text to obtain text abstract information of the anti-counterfeiting text, wherein the text abstract information can be used for verifying the anti-counterfeiting text, and the security of the anti-counterfeiting text is improved.
In the method provided by the embodiment of the invention, two ways of pixel random disturbance processing are adopted for the first joint seal, namely visual random disturbance and non-visual random disturbance. The visual disturbance is the characteristic of randomly changing the local color, brightness, contrast and the like of the picture, and the characteristic can be observed by human eyes. Common visual disturbances are such as: random disturbance of contrast: in the HSV color space of the image, the saturation S and the V luminance components are randomly changed, the hue H is kept unchanged, the S and V components of each pixel are exponentially operated (the exponential factor is between 0.25 and 4), and the illumination change is changed. The visual disturbance supports online and offline integrated verification, an original document is compared with a tampered document, and if the colors of the seal on the perforation and the like are inconsistent, the document can be judged to be tampered. Non-visual disturbance is the value of a random fine tuning pixel, the change is invisible visually, such as noise disturbance, each pixel RGB of an image is disturbed randomly, and common noise modes are salt and pepper noise and Gaussian noise; non-visual perturbations are mainly used for online verification.
In the method provided by the embodiment of the invention, when a processing instruction sent by a user is received, the instruction type of the processing instruction is determined; if the instruction type of the processing instruction is an anti-counterfeiting type, acquiring a to-be-used printing text, a first electronic seal and anti-counterfeiting data; acquiring anti-counterfeiting abstract information of the anti-counterfeiting data, and transcoding the anti-counterfeiting abstract information to obtain an abstract coding sequence, wherein the abstract coding sequence comprises a plurality of sequence numbers, and the number of the sequence numbers in the abstract coding sequence is not less than the page number of the text to be printed; determining a first printing width of each text page of the to-be-printed text based on the abstract coding sequence, the to-be-printed text and the first electronic seal; cutting the first electronic seal based on the first printing width of each text page to obtain a first perforation seal corresponding to the to-be-printed text; and carrying out pixel random disturbance treatment on the first perforation seal to obtain a second perforation seal, and stamping the second perforation seal on the to-be-used printed text to obtain an anti-counterfeiting text, and generating text abstract information corresponding to the anti-counterfeiting text to finish the anti-counterfeiting treatment on the to-be-used printed text. By applying the invention, the anti-counterfeiting abstract information can be embedded into the first electronic seal to obtain the perforation seal, and the obtained perforation seal is unique by carrying out pixel random disturbance treatment on the perforation seal, so that the probability of collision of the perforation seal is reduced, the perforation seal is prevented from being forged, and the probability of replacing and stealing the content of the file is further reduced.
Referring to fig. 2, a flowchart of a method for determining a first print width of each text page of a to-be-printed text according to an embodiment of the present invention is specifically described as follows:
s201, determining a first average seal width of each text page of the to-be-printed text based on the text page number of the to-be-printed text and the seal width of the first electronic seal.
In the method provided by the embodiment of the invention, the number of pages of a text to be printed and the width of a seal of a first electronic seal are determined; and dividing the seal width of the first electronic seal by the text page number of the to-be-printed text to obtain an operation value, wherein the operation value is the first average seal width of each text page of the to-be-printed text.
S202, dividing the summary coding sequence based on the text page number of the text to be printed to obtain a plurality of sequence groups.
In the method provided by the embodiment of the invention, the abstract coding sequence is divided to obtain a plurality of sequence groups, wherein the number of the sequence groups is equal to the number of text pages of the to-be-used printed text, and each sequence group comprises at least one sequence number. For further explanation, assuming that the number of pages of a text to be printed is 8 pages, and the digest coding sequence is "8493 abed", the digest coding sequence is divided into 8 sequence groups, wherein each sequence group includes one sequence number, and the obtained sequence groups are respectively: further, the sequence sets obtained by "8", "4", "9", "3", "a", "b", "e", "d" have an arrangement order related to the arrangement of the sequence numbers in the code sequence.
Further, if the number of sequences in the digest encoding sequence is more than the number of text pages of the to-be-printed text, a sequence group containing a plurality of sequence numbers exists in the generated sequence group.
S203, according to a preset distribution rule, distributing each sequence group to the text page corresponding to the sequence group.
In the method provided in the embodiment of the present invention, the assumption of S204 is continued, and when the sequence groups are assigned to the text pages corresponding to the sequence groups, the corresponding relationship may be determined according to the arrangement order of the sequence groups and the page order of the text pages, specifically, a first sequence group is assigned to a first text page in the text to be printed, a second sequence group is assigned to a second text page in the text to be printed, and a third sequence group is assigned to a third text page, which is not described herein again.
S204, calculating to obtain a first printing width of each text page of the to-be-printed text based on the first average stamp width and the sequence group of the text page.
In the method provided by the embodiment of the invention, the first seal width of the text page is calculated according to the first average seal width and the sequence group of the text page, wherein the sum of the first seal widths of all the text pages is equal to the seal width of the first electronic seal.
In the embodiment provided by the present invention, for each text page, the process of calculating the first printing width of the text page is specifically as follows:
for each sequence number in the sequence group, transcoding the sequence number to obtain a transcoding numerical value, and subtracting a preset first threshold value from the transcoding numerical value to obtain a first calculated value corresponding to the sequence number;
and summing the first calculation values and the first average seal width of the text page to obtain second calculation values, and taking the second calculation values as the first seal width of the text page.
In the method provided by the embodiment of the invention, the sequence numbers in the sequence group are hexadecimal numbers, so that for calculation, when the first printing width of the text page is calculated, the sequence numbers are transcoded for each sequence number in the sequence group to obtain a transcoded numerical value, at the moment, the sequence numbers are converted into decimal numbers from the hexadecimal numbers, and a preset first threshold value is subtracted from the decimal transcoded numerical value to obtain a first calculated value corresponding to the sequence numbers; further, the first calculation value may be a positive number, a negative number, or zero, where when the first calculation value is a negative number, the printing width of the text page needs to be reduced, and when the first calculation value is a positive number, the printing width of the text page needs to be increased; when the first calculation value is zero, the printing width of the text page does not need to be adjusted. The first threshold value may be set according to actual requirements, for example, the first threshold value is set to 8. And summing the obtained first calculated values and the first average seal width of the text page to obtain second calculated values, and taking the second calculated values as the first seal width of the text page.
In the method provided by the embodiment of the invention, the first printing width of the text page is determined based on the sequence number in the sequence group of the text page, and the sequence number is associated with the anti-counterfeiting abstract information, so that the anti-counterfeiting abstract information is embedded into the first electronic seal, the anti-counterfeiting force of the first electronic seal is improved, and the first electronic seal is more reliable.
In the method provided by the embodiment of the present invention, to specifically explain the anti-counterfeit processing of the text in the present invention, a scene example is used for explanation:
assuming that the to-be-printed document is a document in 20 pages PDF format, the seal width of the first electronic seal is 600px, and the anti-counterfeiting data is' amount: 5 ";
for the anti-counterfeiting data' amount: 5', obtaining anti-fake abstract information, and performing transcoding processing on the anti-fake abstract information to obtain an abstract coding sequence, wherein the abstract coding sequence is a hexadecimal string: "91 d1989dff1affe 50035";
dividing the seal width of the first electronic seal by the page number of the text to be printed to obtain a first average seal width of each text page;
the method comprises the following steps of dividing a summary coding sequence into 20 sequence groups, and allocating each text page to one sequence group, wherein the specific allocation mode is as follows: the first sequence group is distributed to a first text page, the second sequence group is distributed to a second text page, the third sequence group is distributed to a third text page, and the rest is repeated;
for each text page, calculating a first printing width of the text page, which may specifically be: for each sequence number in the sequence group of the text page, converting the sequence number from hexadecimal to decimal to obtain a transcoding value, and subtracting a first threshold value from the transcoding value to obtain a first calculation value corresponding to the sequence number; summing each first calculation value and the first printing width to obtain a second calculation value, and taking the second calculation value as the first printing width of the text page;
and cutting the first electronic seal based on the first printing width of each text page to obtain a first perforation seal, performing pixel random disturbance processing on the first perforation seal to obtain a second perforation seal, and stamping the second perforation seal onto the text to be printed to obtain an anti-counterfeiting text, and generating text abstract information corresponding to the anti-counterfeiting text to finish the anti-counterfeiting processing of the text to be printed.
By applying the method provided by the invention, the perforation seal stamped on the to-be-used printing text is subjected to pixel random disturbance treatment, so that the seal can be prevented from being tampered and forged; by embedding the anti-counterfeiting abstract information into the electronic seal and carrying out pixel random disturbance on the electronic seal, the dual-factor cross anti-counterfeiting is realized, and the anti-counterfeiting and anti-tampering capabilities are further improved. The invention skillfully embeds information into the electronic seal, makes full use of the capacity of the electronic seal, and has high concealment performance. Meanwhile, various types of symbols can be processed uniformly by adopting Unicode-based coding processing; the code is represented by hexadecimal, so that the information storage capacity of the electronic seal is greatly improved.
In the method provided in the embodiment of the present invention, if the instruction type of the processing instruction is a verification type, the text needs to be verified, and a verification process is shown in fig. 3, which is specifically described as follows:
s401, if the instruction type of the processing instruction is a verification type, acquiring a text to be verified and a second electronic seal.
In the method provided by the embodiment of the invention, if the instruction type of the processing instruction is the verification type, the text to be verified and the second electronic seal are obtained; the manner of obtaining the text to be verified and the second electronic seal may refer to S102 in fig. 1 to describe obtaining the text to be printed and the first electronic seal, which is not described herein again; the method for stamping the perforation seal comprises the steps of printing a to-be-verified document on a printing medium, wherein the to-be-verified document is a document which is already stamped with the perforation seal, and the mode for stamping the perforation seal is the mode for stamping the perforation seal provided by the invention.
S402, extracting the verification abstract information of the text to be verified, and verifying the text to be verified based on the verification abstract information.
In the method provided by the embodiment of the invention, a preset abstract extraction algorithm is used for extracting the verification abstract information of the text to be verified, when the text to be verified is verified based on the verification abstract information, the verification abstract information is compared with the preset verification abstract information of the text to be verified, and when the verification abstract information is compared with the preset verification abstract information in a consistent manner, the verification of the text to be verified is passed; when the comparison between the verification abstract information and the preset verification abstract information is inconsistent, the verification of the text to be verified is not passed, verification failure information of the text to be verified is generated, and the verification failure information is fed back to the user so as to remind the user that the text to be verified has risks. What needs to be described is that the preset verification information of the text to be verified is the text abstract information generated after the perforation seal is added on the text to be verified.
S403, when the text to be verified passes verification, obtaining a printing image of each page to be verified of the text to be verified.
In the method provided by the embodiment of the invention, for each page to be verified in the text to be verified, the printing image of each page to be verified is obtained.
S404, denoising each printed image to obtain a processed image corresponding to each printed image.
In the method provided by the embodiment of the invention, the image processing engine is used for removing salt and pepper noise of each printed image to obtain a processed image. And further, calling an image processing engine to perform image processing, firstly removing image noise, using a plurality of filters in a combined manner to restore a real image as much as possible, adjusting and correcting the image if the image is inclined, performing gray level processing, and performing expansion corrosion projection lamp operation on the grayed image, thereby obtaining a processed image.
S405, for each processed image, calling a preset recognition algorithm to recognize the processed image, and obtaining a second printing width of the page to be verified corresponding to the processed image.
In the method provided by the embodiment of the invention, the processed image is identified by using the current monitoring algorithm so as to obtain the second seal width of the seal on the perforation on the page to be verified corresponding to the processed image.
Preferably, the edge detection algorithm is used for identifying the edge of the seal on the processed image, the target detection algorithm is used for identifying the seal on the.
S406, determining a second average seal width of each page to be verified of the text to be verified based on the page number of the text to be verified and the seal width of the second electronic seal.
In the method provided by the embodiment of the invention, the seal width of the second electronic seal is divided by the page number of the text to be verified to obtain a calculated value, and the calculated value is used as the second average seal width of each page to be verified.
S407, for each page to be verified, subtracting the second average seal width from the second seal width of the page to be verified to obtain a third calculated value, and adding the third calculated value to a preset second threshold value to obtain a verification value of the page to be verified.
In the method provided by the embodiment of the present invention, the third calculation value may be a positive number, a negative number or zero; adding the third calculated value to a preset second threshold value to obtain a verification value to be verified; wherein, the third calculated value and the second threshold value are both decimal numbers.
In the method provided by the embodiment of the present invention, when determining the verification value of each page to be verified, the method can further be expressed as:
width is the second stamp width; meanWidth: a second average stamp width; threshold: a threshold value; digit: a verification value;
if(width-meanWidth>=0){
digit=threshold+(width-meanWidth)
}else if(width-meanWidth<0){
digit=threshold-(meanWidth-width)
}
s408, obtaining a verification sequence of the text to be verified based on the verification value of each page to be verified of the text to be verified, coding the verification sequence to obtain verification information of the text to be verified, and completing verification processing of the text to be verified.
In the method provided by the embodiment of the invention, the verification values of each page to be verified are sequenced based on the page position of each page to be verified in the page to be verified, so as to obtain the verification sequence of the page to be verified; specifically, the first verification value in the verification sequence is a first page to be verified in the pages to be verified, the second verification value in the verification sequence is a second page to be verified in the pages to be verified, and the third verification value in the verification sequence is a third page to be verified in the pages to be verified, and so on, which is not described herein again.
Each verification value in the verification sequence is converted into a hexadecimal numerical value, so that a conversion sequence is obtained, the conversion sequence is subjected to inverse coding conversion, and corresponding verification information is obtained.
In the method provided by the invention, in the process of verifying the text to be verified, each page to be verified is processed, the seal stamped on the page is restored as much as possible, and the text to be verified is verified by extracting the data embedded in the seal on the perforation, so that whether the text to be verified is tampered or replaced can be further confirmed; by adopting hexadecimal coding, the capacity of the hidden information of the watermark is greatly improved; meanwhile, watermark information is extracted by combining image processing technologies such as image correction, image enhancement, edge detection and the like; a double-factor cross verification mode is adopted, and a pixel random disturbance and MD5 encryption verification mode is adopted while the watermark is embedded, so that the aims of anti-counterfeiting, anti-repudiation and information leakage prevention are fulfilled.
Corresponding to the method described in fig. 1, an embodiment of the present invention further provides a text processing apparatus, which is used for implementing the method in fig. 1 specifically, and the text processing apparatus provided in the embodiment of the present invention may be applied to a computer terminal or various mobile devices, and a schematic structural diagram of the text processing apparatus is shown in fig. 4, and specifically includes:
a first determining unit 501, configured to determine, when a processing instruction sent by a user is received, an instruction type of the processing instruction;
a first obtaining unit 502, configured to obtain a to-be-used print text, a first electronic seal, and anti-counterfeit data if the instruction type of the processing instruction is an anti-counterfeit type;
the transcoding unit 503 is configured to acquire anti-fake abstract information of the anti-fake data, and transcode the anti-fake abstract information to obtain an abstract coding sequence, where the abstract coding sequence includes a plurality of sequence numbers, and the number of the sequence numbers in the abstract coding sequence is not less than the number of pages of the to-be-used printed text;
a second determining unit 504, configured to determine a first printing width of each text page of the to-be-printed text based on the abstract coding sequence, the to-be-printed text, and the first electronic seal;
a cutting unit 505, configured to cut the first electronic seal based on a first printing width of each text page, so as to obtain a first perforation seal corresponding to the to-be-printed text;
the generating unit 506 is configured to perform pixel random disturbance processing on the first perforation seal to obtain a second perforation seal, and apply the second perforation seal to the to-be-used printed text to obtain an anti-counterfeit text, and generate text summary information corresponding to the anti-counterfeit text to complete anti-counterfeit processing on the to-be-used printed text.
In the device provided by the embodiment of the invention, when a processing instruction sent by a user is received, the instruction type of the processing instruction is determined; if the instruction type of the processing instruction is an anti-counterfeiting type, acquiring a to-be-used printing text, a first electronic seal and anti-counterfeiting data; acquiring anti-counterfeiting abstract information of the anti-counterfeiting data, and transcoding the anti-counterfeiting abstract information to obtain an abstract coding sequence, wherein the abstract coding sequence comprises a plurality of sequence numbers, and the number of the sequence numbers in the abstract coding sequence is not less than the page number of the text to be printed; determining a first printing width of each text page of the to-be-printed text based on the abstract coding sequence, the to-be-printed text and the first electronic seal; cutting the first electronic seal based on the first printing width of each text page to obtain a first perforation seal corresponding to the to-be-printed text; and carrying out pixel random disturbance treatment on the first perforation seal to obtain a second perforation seal, and stamping the second perforation seal on the to-be-used printed text to obtain an anti-counterfeiting text, and generating text abstract information corresponding to the anti-counterfeiting text to finish the anti-counterfeiting treatment on the to-be-used printed text. By applying the invention, the anti-counterfeiting abstract information can be embedded into the first electronic seal to obtain the perforation seal, and the obtained perforation seal is unique by carrying out pixel random disturbance treatment on the perforation seal, so that the probability of collision of the perforation seal is reduced, the perforation seal is prevented from being forged, and the probability of replacing and stealing the content of the file is further reduced.
In the apparatus provided in the embodiment of the present invention, the transcoding unit 503 may be configured to:
the acquisition subunit is used for acquiring the capacity information of the first electronic seal;
the first calling subunit is used for calling a preset abstract extraction algorithm to perform abstract extraction processing on the anti-counterfeiting data based on the capacity information to obtain anti-counterfeiting abstract information corresponding to the anti-counterfeiting data;
and the second calling subunit is used for calling a preset code converter to carry out transcoding processing on the anti-counterfeiting abstract information to obtain an abstract coding sequence.
In the apparatus provided in the embodiment of the present invention, the second determining unit 504 may be configured to:
the determining subunit is used for determining a first average seal width of each text page of the to-be-printed text based on the text page number of the to-be-printed text and the seal width of the first electronic seal;
the dividing subunit is used for dividing the abstract coding sequence based on the text page number of the text to be printed to obtain a plurality of sequence groups; the number of the sequence groups is equal to the number of text pages of the text to be printed, and each sequence group comprises at least one sequence number;
the distribution subunit is used for distributing each sequence group to the text page corresponding to the sequence group according to a preset distribution rule;
and the calculating subunit is used for calculating to obtain a first printing width of each text page of the to-be-printed text based on the first average stamp width and the sequence group of the text page.
In the apparatus provided in the embodiment of the present invention, the calculating subunit may be configured to:
the transcoding module is used for transcoding each sequence number in the sequence group to obtain a transcoding numerical value, and subtracting a preset first threshold value from the transcoding numerical value to obtain a first calculated value corresponding to the sequence number;
and the summation module is used for carrying out summation operation on each first calculation value and the first average seal width of the text page to obtain a second calculation value, and taking the second calculation value as the first seal width of the text page.
In the apparatus provided in the embodiment of the present invention, the apparatus may be further configured to:
the second obtaining unit is used for obtaining a text to be verified and a second electronic seal if the instruction type of the processing instruction is a verification type;
the extraction unit is used for extracting the verification abstract information of the text to be verified and verifying the text to be verified based on the verification abstract information;
the third acquisition unit is used for acquiring a printing image of each page to be verified of the text to be verified when the text to be verified passes verification;
the processing unit is used for carrying out denoising processing on each printed image to obtain a processed image corresponding to each printed image;
the identification unit is used for calling a preset identification algorithm to identify each processed image to obtain a second printing width of the page to be verified corresponding to the processed image;
a third determining unit, configured to determine a second average seal width of each page to be verified of the text to be verified based on the page number of the text to be verified and the seal width of the second electronic seal;
the calculation unit is used for subtracting the second average seal width from the second seal width of each page to be verified to obtain a third calculation value, and adding the third calculation value to a preset second threshold value to obtain a verification value of each page to be verified;
and the coding unit is used for obtaining a verification sequence of the text to be verified based on the verification value of each page to be verified of the text to be verified, coding the verification sequence to obtain verification information of the text to be verified, and completing verification processing of the text to be verified.
The embodiment of the invention also provides a storage medium, which comprises a stored instruction, wherein when the instruction runs, the device where the storage medium is located is controlled to execute the text processing method.
An electronic device is provided in an embodiment of the present invention, and the structural diagram of the electronic device is shown in fig. 5, which specifically includes a memory 601 and one or more instructions 602, where the one or more instructions 602 are stored in the memory 601 and configured to be executed by one or more processors 603 to perform the following operations on the one or more instructions 602:
when a processing instruction sent by a user is received, determining the instruction type of the processing instruction;
if the instruction type of the processing instruction is an anti-counterfeiting type, acquiring a to-be-used printing text, a first electronic seal and anti-counterfeiting data;
acquiring anti-counterfeiting abstract information of the anti-counterfeiting data, and transcoding the anti-counterfeiting abstract information to obtain an abstract coding sequence, wherein the abstract coding sequence comprises a plurality of sequence numbers, and the number of the sequence numbers in the abstract coding sequence is not less than the page number of the text to be printed;
determining a first printing width of each text page of the to-be-printed text based on the abstract coding sequence, the to-be-printed text and the first electronic seal;
cutting the first electronic seal based on the first printing width of each text page to obtain a first perforation seal corresponding to the to-be-printed text;
and carrying out pixel random disturbance treatment on the first perforation seal to obtain a second perforation seal, and stamping the second perforation seal on the to-be-used printed text to obtain an anti-counterfeiting text, and generating text abstract information corresponding to the anti-counterfeiting text to finish the anti-counterfeiting treatment on the to-be-used printed text.
The specific implementation procedures and derivatives thereof of the above embodiments are within the scope of the present invention.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, the system or system embodiments are substantially similar to the method embodiments and therefore are described in a relatively simple manner, and reference may be made to some of the descriptions of the method embodiments for related points. The above-described system and system embodiments are only illustrative, wherein the units described as separate parts may or may not be physically separate, and the parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A method for processing text, comprising:
when a processing instruction sent by a user is received, determining the instruction type of the processing instruction;
if the instruction type of the processing instruction is an anti-counterfeiting type, acquiring a to-be-used printing text, a first electronic seal and anti-counterfeiting data;
acquiring anti-counterfeiting abstract information of the anti-counterfeiting data, and transcoding the anti-counterfeiting abstract information to obtain an abstract coding sequence, wherein the abstract coding sequence comprises a plurality of sequence numbers, and the number of the sequence numbers in the abstract coding sequence is not less than the page number of the text to be printed;
determining a first printing width of each text page of the to-be-printed text based on the abstract coding sequence, the to-be-printed text and the first electronic seal;
cutting the first electronic seal based on the first printing width of each text page to obtain a first perforation seal corresponding to the to-be-printed text;
and carrying out pixel random disturbance treatment on the first perforation seal to obtain a second perforation seal, and stamping the second perforation seal on the to-be-used printed text to obtain an anti-counterfeiting text, and generating text abstract information corresponding to the anti-counterfeiting text to finish the anti-counterfeiting treatment on the to-be-used printed text.
2. The method according to claim 1, wherein the obtaining of the anti-counterfeiting summary information of the anti-counterfeiting data and the transcoding of the anti-counterfeiting summary information to obtain a summary coding sequence comprises:
acquiring the capacity information of the first electronic seal;
calling a preset abstract extraction algorithm to perform abstract extraction processing on the anti-counterfeiting data based on the capacity information to obtain anti-counterfeiting abstract information corresponding to the anti-counterfeiting data;
and calling a preset code converter to carry out transcoding processing on the anti-counterfeiting abstract information to obtain an abstract coding sequence.
3. The method according to claim 1, wherein said determining a first print width for each text page of said text to be printed based on said summary encoding sequence, said text to be printed and said first electronic seal comprises:
determining a first average seal width of each text page of the to-be-printed text based on the text page number of the to-be-printed text and the seal width of the first electronic seal;
dividing the summary coding sequence based on the text page number of the text to be printed to obtain a plurality of sequence groups; the number of the sequence groups is equal to the number of text pages of the text to be printed, and each sequence group comprises at least one sequence number;
according to a preset allocation rule, allocating each sequence group to a text page corresponding to the sequence group;
and calculating to obtain a first printing width of the text page based on the first average stamp width and the sequence group of the text page for each text page of the text to be printed.
4. The method of claim 3, wherein calculating a first stamp width for the text page based on the first average stamp width for the text page and the set of sequences comprises:
for each sequence number in the sequence group, transcoding the sequence number to obtain a transcoding numerical value, and subtracting a preset first threshold value from the transcoding numerical value to obtain a first calculated value corresponding to the sequence number;
and summing the first calculation values and the first average seal width of the text page to obtain second calculation values, and taking the second calculation values as the first seal width of the text page.
5. The method of claim 1, further comprising:
if the instruction type of the processing instruction is a verification type, acquiring a text to be verified and a second electronic seal;
extracting verification abstract information of the text to be verified, and verifying the text to be verified based on the verification abstract information;
when the text to be verified passes verification, acquiring a printing image of each page to be verified of the text to be verified;
denoising each printed image to obtain a processed image corresponding to each printed image;
for each processed image, calling a preset recognition algorithm to perform recognition processing on the processed image to obtain a second printing width of the page to be verified corresponding to the processed image;
determining a second average seal width of each page to be verified of the text to be verified based on the page number of the text to be verified and the seal width of the second electronic seal;
for each page to be verified, subtracting the second average seal width from the second seal width of the page to be verified to obtain a third calculated value, and adding the third calculated value to a preset second threshold value to obtain a verification value of the page to be verified;
and obtaining a verification sequence of the text to be verified based on the verification value of each page to be verified of the text to be verified, coding the verification sequence to obtain verification information of the text to be verified, and completing verification processing of the text to be verified.
6. A text processing apparatus, comprising:
the device comprises a first determining unit, a second determining unit and a processing unit, wherein the first determining unit is used for determining the instruction type of a processing instruction when the processing instruction sent by a user is received;
the first obtaining unit is used for obtaining a to-be-used printing text, a first electronic seal and anti-counterfeiting data if the instruction type of the processing instruction is an anti-counterfeiting type;
the transcoding unit is used for acquiring anti-counterfeiting abstract information of the anti-counterfeiting data and transcoding the anti-counterfeiting abstract information to obtain an abstract coding sequence, wherein the abstract coding sequence comprises a plurality of sequence numbers, and the number of the sequence numbers in the abstract coding sequence is not less than the page number of the text to be printed;
the second determining unit is used for determining the first printing width of each text page of the to-be-printed text based on the abstract coding sequence, the to-be-printed text and the first electronic seal;
the cutting unit is used for cutting the first electronic seal based on the first printing width of each text page to obtain a first perforation seal corresponding to the to-be-printed text;
and the generation unit is used for carrying out pixel random disturbance treatment on the first perforation seal to obtain a second perforation seal, and adding the second perforation seal to the text to be printed to obtain an anti-counterfeiting text, and generating text abstract information corresponding to the anti-counterfeiting text to finish anti-counterfeiting treatment on the text to be printed.
7. The apparatus of claim 6, wherein the transcoding unit comprises:
the acquisition subunit is used for acquiring the capacity information of the first electronic seal;
the first calling subunit is used for calling a preset abstract extraction algorithm to perform abstract extraction processing on the anti-counterfeiting data based on the capacity information to obtain anti-counterfeiting abstract information corresponding to the anti-counterfeiting data;
and the second calling subunit is used for calling a preset code converter to carry out transcoding processing on the anti-counterfeiting abstract information to obtain an abstract coding sequence.
8. The apparatus of claim 6, wherein the second determining unit comprises:
the determining subunit is used for determining a first average seal width of each text page of the to-be-printed text based on the text page number of the to-be-printed text and the seal width of the first electronic seal;
the dividing subunit is used for dividing the abstract coding sequence based on the text page number of the text to be printed to obtain a plurality of sequence groups; the number of the sequence groups is equal to the number of text pages of the text to be printed, and each sequence group comprises at least one sequence number;
the distribution subunit is used for distributing each sequence group to the text page corresponding to the sequence group according to a preset distribution rule;
and the calculating subunit is used for calculating to obtain a first printing width of each text page of the to-be-printed text based on the first average stamp width and the sequence group of the text page.
9. The apparatus of claim 8, wherein the computing subunit comprises:
the transcoding module is used for transcoding each sequence number in the sequence group to obtain a transcoding numerical value, and subtracting a preset first threshold value from the transcoding numerical value to obtain a first calculated value corresponding to the sequence number;
and the summation module is used for carrying out summation operation on each first calculation value and the first average seal width of the text page to obtain a second calculation value, and taking the second calculation value as the first seal width of the text page.
10. The apparatus of claim 6, further comprising:
the second obtaining unit is used for obtaining a text to be verified and a second electronic seal if the instruction type of the processing instruction is a verification type;
the extraction unit is used for extracting the verification abstract information of the text to be verified and verifying the text to be verified based on the verification abstract information;
the third acquisition unit is used for acquiring a printing image of each page to be verified of the text to be verified when the text to be verified passes verification;
the processing unit is used for carrying out denoising processing on each printed image to obtain a processed image corresponding to each printed image;
the identification unit is used for calling a preset identification algorithm to identify each processed image to obtain a second printing width of the page to be verified corresponding to the processed image;
a third determining unit, configured to determine a second average seal width of each page to be verified of the text to be verified based on the page number of the text to be verified and the seal width of the second electronic seal;
the calculation unit is used for subtracting the second average seal width from the second seal width of each page to be verified to obtain a third calculation value, and adding the third calculation value to a preset second threshold value to obtain a verification value of each page to be verified;
and the coding unit is used for obtaining a verification sequence of the text to be verified based on the verification value of each page to be verified of the text to be verified, coding the verification sequence to obtain verification information of the text to be verified, and completing verification processing of the text to be verified.
CN202011597029.4A 2020-12-28 2020-12-28 Text processing method and device Active CN112613003B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011597029.4A CN112613003B (en) 2020-12-28 2020-12-28 Text processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011597029.4A CN112613003B (en) 2020-12-28 2020-12-28 Text processing method and device

Publications (2)

Publication Number Publication Date
CN112613003A true CN112613003A (en) 2021-04-06
CN112613003B CN112613003B (en) 2023-12-08

Family

ID=75248931

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011597029.4A Active CN112613003B (en) 2020-12-28 2020-12-28 Text processing method and device

Country Status (1)

Country Link
CN (1) CN112613003B (en)

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2002039411A1 (en) * 2000-11-10 2002-05-16 Alphalogix Co., Ltd. Apparatus and method for encrypting/decrypting information on a pixel-by-pixel basis and encryption/decryption system using the same
WO2005064524A1 (en) * 2003-12-30 2005-07-14 Ruizhen Liu Digital seal system
CN1710610A (en) * 2005-07-04 2005-12-21 杭州天谷信息科技有限公司 Digital watermark anti fake method in anti-digital-to-analog conversion process
JP2006352294A (en) * 2005-06-14 2006-12-28 Fuji Xerox Co Ltd Image processor, authentication device, image process method, authentication method and their programs
US20080177799A1 (en) * 2008-03-22 2008-07-24 Wilson Kelce S Document integrity verification
US9855785B1 (en) * 2016-04-04 2018-01-02 Uipco, Llc Digitally encoded seal for document verification
CN108257199A (en) * 2018-01-19 2018-07-06 中铁七局集团第三工程有限公司 A kind of method and system that seal on the perforation is capped for electronic document
CN109753826A (en) * 2019-01-25 2019-05-14 杭州天谷信息科技有限公司 The endorsement method and system of dynamic electric stamp
CN110119504A (en) * 2019-05-10 2019-08-13 杭州天谷信息科技有限公司 A kind of electronic document junction of the edges of two sheets of paper is affixed one's seal method
CN110222478A (en) * 2019-04-19 2019-09-10 深圳法大大网络科技有限公司 A kind of method and mobile terminal for protecting document
WO2020082577A1 (en) * 2018-10-26 2020-04-30 平安科技(深圳)有限公司 Seal anti-counterfeiting verification method, device, and computer readable storage medium
CN111340462A (en) * 2020-04-23 2020-06-26 包永祥 Seal anti-counterfeiting system and method

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2002039411A1 (en) * 2000-11-10 2002-05-16 Alphalogix Co., Ltd. Apparatus and method for encrypting/decrypting information on a pixel-by-pixel basis and encryption/decryption system using the same
WO2005064524A1 (en) * 2003-12-30 2005-07-14 Ruizhen Liu Digital seal system
JP2006352294A (en) * 2005-06-14 2006-12-28 Fuji Xerox Co Ltd Image processor, authentication device, image process method, authentication method and their programs
CN1710610A (en) * 2005-07-04 2005-12-21 杭州天谷信息科技有限公司 Digital watermark anti fake method in anti-digital-to-analog conversion process
US20080177799A1 (en) * 2008-03-22 2008-07-24 Wilson Kelce S Document integrity verification
US9855785B1 (en) * 2016-04-04 2018-01-02 Uipco, Llc Digitally encoded seal for document verification
CN108257199A (en) * 2018-01-19 2018-07-06 中铁七局集团第三工程有限公司 A kind of method and system that seal on the perforation is capped for electronic document
WO2020082577A1 (en) * 2018-10-26 2020-04-30 平安科技(深圳)有限公司 Seal anti-counterfeiting verification method, device, and computer readable storage medium
CN109753826A (en) * 2019-01-25 2019-05-14 杭州天谷信息科技有限公司 The endorsement method and system of dynamic electric stamp
CN110222478A (en) * 2019-04-19 2019-09-10 深圳法大大网络科技有限公司 A kind of method and mobile terminal for protecting document
CN110119504A (en) * 2019-05-10 2019-08-13 杭州天谷信息科技有限公司 A kind of electronic document junction of the edges of two sheets of paper is affixed one's seal method
CN111340462A (en) * 2020-04-23 2020-06-26 包永祥 Seal anti-counterfeiting system and method

Also Published As

Publication number Publication date
CN112613003B (en) 2023-12-08

Similar Documents

Publication Publication Date Title
US8345316B2 (en) Layered security in digital watermarking
US7100050B1 (en) Secured signal modification and verification with privacy control
EP1953752B1 (en) Embedding and detecting hidden information
CN111784556B (en) Method, device, terminal and storage medium for adding digital watermark in image
WO2018076409A1 (en) Method for realizing two dimensional code copy prevention and realization system thereof
US20030070075A1 (en) Secure hybrid robust watermarking resistant against tampering and copy-attack
US8014557B2 (en) Watermarking electronic text documents
US20040001606A1 (en) Watermark fonts
US20060075241A1 (en) Character and vector graphics watermark for structured electronic documents security
US20210165860A1 (en) Watermark embedding and extracting method for protecting documents
Tan et al. Print-Scan Resilient Text Image Watermarking Based on Stroke Direction Modulation for Chinese Document Authentication.
Hamid et al. Robust image hashing scheme using Laplacian pyramids
Qi et al. Robust authentication for paper-based text documents based on text watermarking technology
CN112085643A (en) Image desensitization processing method, verification method, device, equipment and medium
Chennamma et al. A comprehensive survey on image authentication for tamper detection with localization
CN112613003B (en) Text processing method and device
CN114078071A (en) Image tracing method, device and medium
Keskinarkaus et al. Image watermarking with a directed periodic pattern to embed multibit messages resilient to print-scan and compound attacks
JP4827807B2 (en) Method for detection of small security marks
CN113393363B (en) Watermark embedding and extracting method, storage medium and electronic device
US9361516B2 (en) Forensic verification utilizing halftone boundaries
CN114330621A (en) Two-dimensional code anti-counterfeiting method and device based on identification information and storage medium
CN109840574B (en) Two-dimensional code information hiding method and device, electronic equipment and storage medium
Nayak et al. Detecting data leakage from hard copy documents
Safonov et al. Embedding digital hidden data into hardcopy

Legal Events

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