Document anti-counterfeiting and offline detection method

By encoding the text on each page of the file and generating anti-counterfeiting images, embedded in the file, the problem that traditional anti-counterfeiting methods are difficult to prevent tampering with each page of the file is solved, and precise anti-counterfeiting and verification of the content of each page of the file is achieved.

CN120124019APending Publication Date: 2025-06-10BEIJING SHENZHOU LOONGSON ANCHUANG INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510051989.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-13
Publication Date
2025-06-10

AI Technical Summary

Technical Problem

In the process of digitizing and electronicizing files, traditional anti-counterfeiting methods are difficult to effectively prevent tampering with the content of each page of the file.

Method used

By encoding the text on each page of the file and generating the corresponding anti-counterfeiting image, embedding it into the file, ensuring the integrity and authenticity of the content of each page.

Benefits of technology

It realizes accurate anti-counterfeiting of the content of each page of the file, prevents the content of local pages from being modified, and ensures that the content of electronic and paper documents can be effectively verified.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120124019A_ABST
    Figure CN120124019A_ABST
Patent Text Reader

Abstract

The invention provides a document anti-counterfeiting and offline detection method and device, equipment and a storage medium, and the method comprises the steps: obtaining a first document, and carrying out the coding of the first document based on a coding tool, and obtaining the coding information of the first document; respectively generating at least one document anti-counterfeiting image corresponding to each page of the first document based on the first document coding information; and embedding the at least one document anti-counterfeiting image into the first document and storing the at least one document anti-counterfeiting image to obtain an anti-counterfeiting document.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of document anti-counterfeiting, and in particular, to a method, apparatus, device, and storage medium for document anti-counterfeiting and offline detection. Background Art

[0002] In the process of digitalizing and electronicizing documents, the problems of document tampering and forgery are becoming more and more prominent. Traditional anti-counterfeiting means usually encrypt and verify the hash value of the entire document, while ignoring the anti-counterfeiting of the content of each page of the document. In order to improve the accuracy of anti-counterfeiting, a method of encoding the text of each page of the document and embedding anti-counterfeiting images is proposed to ensure the integrity and authenticity of the document at the level of each page. Summary of the Invention

[0003] The present disclosure provides a method, apparatus, device, and storage medium for document anti-counterfeiting and offline detection to at least solve the above technical problems existing in the prior art.

[0004] According to a first aspect of the present disclosure, there is provided a method for document anti-counterfeiting and offline detection, including:

[0005] Obtain a first document, encode the first document based on an encoding tool to obtain first document encoding information;

[0006] Generate at least one document anti-counterfeiting image corresponding to each page of the first document based on the first document encoding information;

[0007] Embed the at least one document anti-counterfeiting image into the first document and save it to obtain an anti-counterfeiting document.

[0008] In an implementable embodiment, the method further includes:

[0009] Scan the anti-counterfeiting document based on an image recognition tool to obtain the at least one document anti-counterfeiting image corresponding to each page;

[0010] Extract the first document encoding information of each page based on the at least one document anti-counterfeiting image;

[0011] Verify whether the document has been tampered with based on the first document encoding information.

[0012] In an implementable embodiment, the verifying whether the document has been tampered with based on the first document encoding information includes:

[0013] Decode the first document encoding information of each page by using a decoding tool to obtain the anti-counterfeiting information corresponding to the anti-counterfeiting image of each page;

[0014] Extract the text content of each page in the anti-counterfeiting document respectively based on the document parsing tool to obtain the document information of each page, and match the document information of each page with the anti-counterfeiting information of the corresponding page. If they match, the content of the current page of the anti-counterfeiting document has not been tampered with.

[0015] Alternatively, encode the content of each page in the anti-counterfeiting document respectively based on the encoding tool to obtain the anti-counterfeiting code of each page, and match the anti-counterfeiting code of each page with the first document coding information of the corresponding page. If they match, the content of the current page of the anti-counterfeiting document has not been tampered with.

[0016] In an implementable manner, the embedding of the at least one document anti-counterfeiting image into the first document and saving it includes:

[0017] Obtain the layout information of each page in the first document, and select the blank positions in the layout information;

[0018] Based on the anti-counterfeiting content in the document anti-counterfeiting image, embed the at least one document anti-counterfeiting image into the blank positions in the corresponding pages, so that the anti-counterfeiting content in the document anti-counterfeiting image corresponds to the text content in the embedded pages.

[0019] In an implementable manner, the encoding of the first document based on the encoding tool to obtain the first document coding information includes:

[0020] Decompose the content of the first document page by page to obtain at least one page of document;

[0021] Extract the text content of each page in the at least one page of document pages respectively based on the document parsing tool, and encode the text content page by page using the encoding tool to obtain the first document coding information corresponding to each page of the first document.

[0022] According to the second aspect of the present disclosure, there is provided a document anti-counterfeiting and offline detection device, and the device includes:

[0023] A document coding unit, configured to obtain a first document, and encode the first document based on an encoding tool to obtain first document coding information;

[0024] An anti-counterfeiting image generation unit, configured to generate at least one document anti-counterfeiting image corresponding to each page of the first document respectively based on the first document coding information;

[0025] A document generation unit, configured to embed the at least one document anti-counterfeiting image into the first document and save it to obtain an anti-counterfeiting document.

[0026] In an implementable manner, the device further includes:

[0027] An image recognition unit, configured to scan the anti-counterfeiting document based on an image recognition tool to obtain at least one document anti-counterfeiting image corresponding to each page; and extract the first document coding information of each page respectively based on the at least one document anti-counterfeiting image;

[0028] An anti-counterfeiting verification unit, configured to verify whether the document has been tampered with based on the first document coding information;

[0029] The document generation unit is further configured to obtain the layout information of each page in the first document, and select blank positions in the layout information; and embed the at least one document anti-counterfeiting image into the blank positions in the corresponding page based on the anti-counterfeiting content in the document anti-counterfeiting image, so that the anti-counterfeiting content in the document anti-counterfeiting image corresponds to the text content in the embedded page;

[0030] The document coding unit is further configured to disassemble the content of the first document page by page to obtain at least one page of document; extract the text content of each page in the at least one page of document page respectively based on a document parsing tool, and encode the text content page by page using the coding tool to obtain the first document coding information corresponding to each page of the first document.

[0031] In an implementable embodiment, the anti-counterfeiting verification unit further includes:

[0032] A decoding unit, configured to decode the first document coding information of each page using a decoding tool to obtain the anti-counterfeiting information corresponding to the anti-counterfeiting image of each page;

[0033] A text matching unit, configured to extract the text content of each page in the anti-counterfeiting document respectively based on the document parsing tool to obtain the document information of each page, and match the document information of each page with the anti-counterfeiting information of the corresponding page. If they match, the content of the current page of the anti-counterfeiting document has not been tampered with;

[0034] A coding matching unit, configured to encode the content of each page in the anti-counterfeiting document respectively based on the coding tool to obtain the anti-counterfeiting coding of each page, and match the anti-counterfeiting coding of each page with the first document coding information of the corresponding page. If they match, the content of the current page of the anti-counterfeiting document has not been tampered with.

[0035] According to a third aspect of the present disclosure, there is provided an electronic device, including:

[0036] At least one processor; and

[0037] A memory communicatively connected to the at least one processor; wherein,

[0038] The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the method described in the present disclosure.

[0039] According to a fourth aspect of the present disclosure, there is provided a non-transitory computer-readable storage medium storing computer instructions for causing a computer to execute the method described in the present disclosure.

[0040] A method, apparatus, device and storage medium for anti-counterfeiting and offline detection of documents according to the present disclosure generate corresponding anti-counterfeiting images by encoding the content of each page of an anti-counterfeiting document, match the anti-counterfeiting images with the content in the current page to verify whether the document has been tampered with, prevent partial page content from being modified, and combine OCR technology and image processing technology to ensure that the content of both electronic and paper documents can be effectively verified. By combining OCR technology and image processing technology, the effective verification of the content of both electronic and paper documents is ensured, and the covert transmission of anti-counterfeiting information is realized without affecting the normal display and circulation of the document.

[0041] It should be understood that the content described in this part is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it used to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] By referring to the drawings and reading the following detailed description, the above and other objects, features and advantages of the exemplary embodiments of the present disclosure will become easily understood. In the drawings, several embodiments of the present disclosure are shown in an exemplary and non-limiting manner, wherein:

[0043] In the drawings, the same or corresponding reference numerals represent the same or corresponding parts.

[0044] Figure 1 Shows the implementation process schematic diagram of a method for anti-counterfeiting and offline detection of documents according to an embodiment of the present disclosure Figure 1 ;

[0045] Figure 2 Shows the schematic diagram of the implementation process of a method for anti-counterfeiting and offline detection of documents according to an embodiment of the present disclosure;

[0046] Figure 3 Shows the schematic diagram of the verification process in the implementation process of a method for anti-counterfeiting and offline detection of documents according to an embodiment of the present disclosure;

[0047] Figure 4 Shows the schematic diagram of an apparatus for anti-counterfeiting and offline detection of documents according to an embodiment of the present disclosure;

[0048] Figure 5The figure shows a schematic structural diagram of an electronic device according to an embodiment of the present disclosure. Detailed implementation manners

[0049] To make the objectives, features, and advantages of the present disclosure more obvious and understandable, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only a part of the embodiments of the present disclosure, rather than all the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by those skilled in the art without creative efforts shall fall within the protection scope of the present disclosure.

[0050] Figure 1 The figure shows a schematic implementation process of a document anti-counterfeiting and offline detection method according to an embodiment of the present disclosure. Figure 1 , as Figure 1 shown, the implementation process of a document anti-counterfeiting and offline detection method according to an embodiment of the present disclosure includes the following steps:

[0051] Step 101: Obtain a first document, and encode the first document based on an encoding tool to obtain first document encoding information.

[0052] In an embodiment of the present disclosure, the first document is an anti-counterfeiting document. The first document includes at least one page of text content. The content of the first document is disassembled by page to obtain at least one page of document. The text content of each page in the at least one page of document pages is extracted respectively based on a document parsing tool, and the text content is encoded by page using the encoding tool to obtain the first document encoding information corresponding to each page of the first document.

[0053] Step 102: Generate at least one document anti-counterfeiting image corresponding to each page of the first document based on the first document encoding information.

[0054] In an embodiment of the present disclosure, the first document encoding information may be: GB18030, or UTF8, or UNICODE encoding. The document anti-counterfeiting image may be a two-dimensional code, a bar code, or other image forms capable of storing information. After the text is encoded, a binary stream is obtained, and the encoding information of each page is respectively embedded into at least one document anti-counterfeiting image corresponding to each page.

[0055] Step 103: Embed the at least one document anti-counterfeiting image into the first document and save it to obtain an anti-counterfeiting document.

[0056] In an embodiment of the present disclosure, the layout information of each page in the first document is obtained, and blank positions in the layout information are selected; based on the anti-counterfeiting content in the document anti-counterfeiting image, the at least one document anti-counterfeiting image is embedded into the blank positions in the corresponding pages, so that the anti-counterfeiting content in the document anti-counterfeiting image corresponds to the text content in the embedded pages. After embedding, each page of the first document contains one anti-counterfeiting image, and the encoded content in each anti-counterfeiting image corresponds to the text content in the current page respectively.

[0057] In an embodiment of the present disclosure, after the establishment of the anti-counterfeiting document, the anti-counterfeiting document can be scanned based on an image recognition tool, such as a mobile phone, a scanner, etc., to obtain the at least one document anti-counterfeiting image corresponding to each page; the first document encoding information of each page is extracted based on the at least one document anti-counterfeiting image; whether the document has been tampered with is verified based on the first document encoding information. Among them, the decoding tool is used to decode the first document encoding information of each page to obtain the anti-counterfeiting information corresponding to the anti-counterfeiting image of each page; the text content of each page in the anti-counterfeiting document is extracted respectively based on the document parsing tool to obtain the document information of each page, and the document information of each page is matched with the anti-counterfeiting information of the corresponding page. If they match, the content of the current page of the anti-counterfeiting document has not been tampered with; or, the content of each page in the anti-counterfeiting document is encoded respectively based on the encoding tool to obtain the anti-counterfeiting code of each page, and the anti-counterfeiting code of each page is matched with the first document encoding information of the corresponding page. If they match, the content of the current page of the anti-counterfeiting document has not been tampered with.

[0058] Figure 2 Shows the schematic diagram of the encoding process in the implementation process of a document anti-counterfeiting and offline detection method according to an embodiment of the present disclosure Figure 2 , such as Figure 2 As shown, the encoding process in the implementation process of a document anti-counterfeiting and offline detection method according to an embodiment of the present disclosure includes the following steps:

[0059] Step 201, upload the anti-counterfeiting file.

[0060] In an embodiment of the present disclosure, the anti-counterfeiting file that needs to perform anti-counterfeiting operations is obtained from the local or the cloud, and the anti-counterfeiting file contains at least one page of document content.

[0061] Step 202, extract the text in the anti-counterfeiting file.

[0062] In an embodiment of the present disclosure, the text of each page of the file is extracted, and the text content of the page can be extracted through a document parsing tool or OCR technology.

[0063] Step 203, encode the extracted text.

[0064] In the embodiments of the present disclosure, the extracted text can be encoded in, but not limited to, GB18030, UTF8, or UNICODE.

[0065] Step 204: Generate an anti-counterfeiting image and embed the text encoding information of each page.

[0066] In the embodiments of the present disclosure, the text encoding information is embedded into the anti-counterfeiting image. The anti-counterfeiting image can be a two-dimensional code, a bar code, or other image forms capable of storing information.

[0067] Step 205: Embed the generated anti-counterfeiting image into the corresponding position of each page.

[0068] In the embodiments of the present disclosure, when embedding the generated anti-counterfeiting image into the corresponding position of each page, areas such as the header, footer, or other areas that do not affect normal reading can be selected, and the file of each page with the embedded anti-counterfeiting image is saved as the final anti-counterfeiting document.

[0069] Figure 3 The figure shows a schematic diagram of the verification process in the implementation process of a document anti-counterfeiting and offline detection method according to an embodiment of the present disclosure. As Figure 3 shown, the verification process in the implementation process of a document anti-counterfeiting and offline detection method according to an embodiment of the present disclosure includes the following steps:

[0070] Step 301: Scan the anti-counterfeiting image of each page.

[0071] In the embodiments of the present disclosure, a scanning device or an image recognition tool, such as a mobile phone, a scanner, etc., is used to scan each page of the document to extract the embedded anti-counterfeiting image.

[0072] Step 302: Extract anti-counterfeiting information.

[0073] In the embodiments of the present disclosure, the embedded text encoding information is extracted from the anti-counterfeiting image of each page, and the actual text content of each page of the document is extracted through OCR (Optical Character Recognition) technology.

[0074] Step 303: Compare and verify.

[0075] In the embodiments of the present disclosure, the text content extracted by OCR is encoded and compared with the encoded information extracted from the anti-counterfeiting image. If the comparison is consistent, it indicates that the content of this page has not been tampered with; otherwise, it is determined that this page has been tampered with. Or, the encoded information collected from the anti-counterfeiting image is decoded, and the decoded text content is compared with the actual text content of each page of the document. If the comparison is consistent, it indicates that the content of this page has not been tampered with.

[0076] Figure 4 The figure shows a schematic diagram of a document anti-counterfeiting and offline detection device according to an embodiment of the present disclosure. As Figure 4As shown in the figure, an apparatus for document anti-counterfeiting and offline detection according to an embodiment of the present disclosure includes:

[0077] A document encoding unit 401, configured to obtain a first document, and encode the first document based on an encoding tool to obtain first document encoding information.

[0078] The document encoding unit 401 is further configured to disassemble the content of the first document page by page to obtain at least one page of the document; respectively extract the text content of each page in the at least one page of the document page based on a document parsing tool, and encode the text content page by page using the encoding tool to obtain the first document encoding information corresponding to each page of the first document.

[0079] An anti-counterfeiting image generation unit 402, configured to generate at least one document anti-counterfeiting image corresponding to each page of the first document based on the first document encoding information.

[0080] A document generation unit 403, configured to embed the at least one document anti-counterfeiting image into the first document and save it to obtain an anti-counterfeiting document.

[0081] The document generation unit 403 is further configured to obtain the layout information of each page in the first document, and select the blank positions in the layout information; based on the anti-counterfeiting content in the document anti-counterfeiting image, embed the at least one document anti-counterfeiting image into the blank positions in the corresponding page, so that the anti-counterfeiting content in the document anti-counterfeiting image corresponds to the text content in the embedded page.

[0082] An image recognition unit 404, configured to scan the anti-counterfeiting document based on an image recognition tool to obtain the at least one document anti-counterfeiting image corresponding to each page; respectively extract the first document encoding information of each page based on the at least one document anti-counterfeiting image.

[0083] An anti-counterfeiting verification unit 405, configured to verify whether the document has been tampered with based on the first document encoding information.

[0084] A decoding unit 406, configured to decode the first document encoding information of each page using a decoding tool to obtain the anti-counterfeiting information corresponding to the anti-counterfeiting image of each page.

[0085] A text matching unit 407, configured to respectively extract the text content of each page in the anti-counterfeiting document based on the document parsing tool to obtain the document information of each page, and match the document information of each page with the anti-counterfeiting information of the corresponding page. If the match is successful, the content of the current page of the anti-counterfeiting document has not been tampered with.

[0086] An encoding matching unit 408 is configured to encode the content of each page in the anti-counterfeiting document based on the encoding tool to obtain an anti-counterfeiting code for each page, and match the anti-counterfeiting code for each page with the first document encoding information of the corresponding page. If the match is successful, it indicates that the content of the current page of the anti-counterfeiting document has not been tampered with.

[0087] In an exemplary embodiment, the document encoding unit 401, the anti-counterfeiting image generation unit 402, the document generation unit 403, the image recognition unit 404, the anti-counterfeiting verification unit 405, the decoding unit 406, the text matching unit 407, the encoding matching unit 408, etc. can be implemented by one or more central processing units (CPUs, Central Processing Unit), graphics processing units (GPUs, Graphics Processing Unit), application specific integrated circuits (ASICs, Application Specific Integrated Circuit), DSPs, programmable logic devices (PLDs, Programmable Logic Device), complex programmable logic devices (CPLDs, Complex Programmable Logic Device), field programmable gate arrays (FPGAs, Field-Programmable Gate Array), general purpose processors, controllers, microcontroller units (MCUs, MicroController Unit), microprocessors (Microprocessor), or other electronic components.

[0088] Regarding the device in the above embodiments, the specific manners in which each module and unit perform operations have been described in detail in the embodiments related to the method, and will not be elaborated here.

[0089] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device and a readable storage medium.

[0090] Figure 5 FIG. shows a schematic block diagram of an exemplary electronic device 800 that can be used to implement the embodiments of the present disclosure. The electronic device is intended to represent various forms of digital computers, such as, laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as, personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or claimed herein.

[0091] AsFigure 5 As shown, device 800 includes a computing unit 801, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 802 or a computer program loaded from a storage unit 808 into a random access memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the device 800 can also be stored. The computing unit 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.

[0092] Multiple components in the device 800 are connected to the I / O interface 805, including: an input unit 806, such as a keyboard, a mouse, etc.; an output unit 807, such as various types of displays, speakers, etc.; a storage unit 808, such as a magnetic disk, an optical disc, etc.; and a communication unit 809, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 809 allows the device 800 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.

[0093] The computing unit 801 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 801 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The computing unit 801 executes the various methods and processes described above, such as a document anti-counterfeiting and offline detection method. For example, in some embodiments, a document anti-counterfeiting and offline detection method can be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as the storage unit 808. In some embodiments, part or all of the computer program can be loaded and / or installed onto the device 800 via the ROM 802 and / or the communication unit 809. When the computer program is loaded into the RAM 803 and executed by the computing unit 801, one or more steps of the document anti-counterfeiting and offline detection method described above can be executed. Alternatively, in other embodiments, the computing unit 801 can be configured to execute a document anti-counterfeiting and offline detection method in any other appropriate manner (e.g., by means of firmware).

[0094] The various embodiments of the systems and techniques described above in this document can be implemented in digital electronic circuitry, integrated circuit systems, field programmable gate arrays (FPGA), application specific integrated circuits (ASIC), application specific standard products (ASSP), systems on a chip (SOC), complex programmable logic devices (CPLD), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special-purpose or general-purpose programmable processor that receives data and instructions from a storage system, at least one input device, and at least one output device, and transmits the data and instructions to the storage system, the at least one input device, and the at least one output device.

[0095] The program code for implementing the methods of the present disclosure can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when the program codes are executed by the processor or controller, the functions / operations specified in the flowchart and / or block diagram are implemented. The program code can be executed entirely on the machine, partially on the machine, as a stand-alone software package partially on the machine and partially on a remote machine, or entirely on a remote machine or server.

[0096] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in connection with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0097] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or a trackball) through which the user can provide input to the computer. Other kinds of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and the input received from the user can be in any form (including acoustic input, speech input, or tactile input).

[0098] The systems and techniques described herein can be implemented in a computing system including backend components (e.g., as a data server), or a computing system including middleware components (e.g., an application server), or a computing system including frontend components (e.g., a user computer having a graphical user interface or a web browser through which the user can interact with an implementation of the systems and techniques described herein), or a computing system including any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected to each other by digital data communication in any form or medium (e.g., a communication network). Examples of communication networks include: local area network (LAN), wide area network (WAN), and the Internet.

[0099] A computer system can include a client and a server. The client and the server are generally far from each other and usually interact through a communication network. The client - server relationship is created by computer programs running on the respective computers and having a client - server relationship with each other. The server can be a cloud server, or a server of a distributed system, or a server incorporating a blockchain.

[0100] It should be understood that the various forms of processes shown above can be reordered, added to, or steps deleted. For example, the steps recited in this disclosure can be executed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved. This is not limited herein.

[0101] In addition, the terms "first" and "second" are used for descriptive purposes only and cannot be construed as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, features defined with "first" and "second" can explicitly or implicitly include at least one of the features. In the description of this disclosure, "a plurality" means two or more unless otherwise specifically defined.

[0102] As described above, this is only a specific implementation of the present disclosure. However, the protection scope of the present disclosure is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present disclosure can easily think of changes or substitutions, which should be covered within the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure shall be subject to the protection scope of the claims.

Claims

1. A document anti-counterfeiting and offline detection method, characterized in that: The method comprises: Acquire a first document, and encode the first document based on an encoding tool to obtain first document encoding information; generating at least one document anti-counterfeiting image corresponding to each page of the first document based on the first document encoding information; The at least one document anti-counterfeiting image is embedded in the first document and saved to obtain an anti-counterfeiting document.

2. The method according to claim 1, characterized in that The method further comprises: Scanning the anti-counterfeiting document based on an image recognition tool to obtain the at least one document anti-counterfeiting image corresponding to each page; Extracting the first document encoding information of each page respectively based on the at least one document anti-counterfeiting image; Verify whether the document has been tampered with based on the first document encoding information.

3. The method according to claim 2, characterized in that The verifying whether the document has been tampered with based on the first document encoding information includes: Decoding the first document encoding information of each page using a decoding tool to obtain anti-counterfeiting information corresponding to the anti-counterfeiting image of each page; Based on the document parsing tool, the text content of each page of the anti-counterfeiting document is extracted to obtain the document information of each page, and the document information of each page is matched with the anti-counterfeiting information of the corresponding page. If they match, the content of the current page of the anti-counterfeiting document has not been tampered with; Or, based on the encoding tool, encode the content of each page in the anti-counterfeiting document respectively to obtain the anti-counterfeiting code of each page, and match the anti-counterfeiting code of each page with the first document encoding information of the corresponding page. If they match, the content of the current page of the anti-counterfeiting document has not been tampered with.

4. The method according to claim 1, characterized in that: The step of embedding the at least one document anti-counterfeiting image into the first document and saving the image comprises: Obtaining layout information of each page in the first document, and selecting a blank position in the layout information; Based on the anti-counterfeiting content in the document anti-counterfeiting image, the at least one document anti-counterfeiting image is embedded in the blank position in the corresponding page, so that the anti-counterfeiting content in the document anti-counterfeiting image corresponds to the text content embedded in the page.

5. The method according to claim 1, characterized in that The step of encoding the first document based on the encoding tool to obtain first document encoding information includes: Decomposing the content of the first document by page to obtain at least one page of document; The text content of each page of the at least one document page is extracted based on the document parsing tool, and the text content is encoded by page using the encoding tool to obtain the first document encoding information corresponding to each page of the first document.

6. A document anti-counterfeiting and offline detection device, characterized in that: The device comprises: A document encoding unit, configured to obtain a first document, encode the first document based on an encoding tool, and obtain first document encoding information; an anti-counterfeiting image generating unit, configured to generate at least one document anti-counterfeiting image corresponding to each page of the first document based on the first document encoding information; The document generating unit is used to embed the at least one document anti-counterfeiting image into the first document and save it to obtain an anti-counterfeiting document.

7. The device according to claim 6, characterized in that The device also includes: An image recognition unit, configured to scan the anti-counterfeiting document based on an image recognition tool to obtain the at least one document anti-counterfeiting image corresponding to each page; and extract the first document encoding information of each page based on the at least one document anti-counterfeiting image; an anti-counterfeiting verification unit, configured to verify whether the document has been tampered with based on the first document encoding information; The document generation unit is further configured to obtain layout information of each page in the first document, select a blank position in the layout information, and embed the at least one document anti-counterfeiting image into the blank position in the corresponding page based on the anti-counterfeiting content in the document anti-counterfeiting image, so that the anti-counterfeiting content in the document anti-counterfeiting image corresponds to the text content embedded in the page; The document encoding unit is also used to decompose the content of the first document by page to obtain at least one page of the document; based on the document parsing tool, the text content of each page of the at least one page of the document is extracted respectively, and the encoding tool is used to encode the text content by page to obtain the first document encoding information corresponding to each page of the first document.

8. The device according to claim 7, characterized in that The anti-counterfeiting verification unit also includes: A decoding unit, configured to decode the first document encoding information of each page using a decoding tool to obtain anti-counterfeiting information corresponding to the anti-counterfeiting image of each page; A text matching unit, used for extracting the text content of each page of the anti-counterfeiting document based on the document parsing tool, obtaining the document information of each page, and matching the document information of each page with the anti-counterfeiting information of the corresponding page. If they match, the content of the current page of the anti-counterfeiting document has not been tampered with; The coding matching unit is used to encode the content of each page in the anti-counterfeiting document based on the coding tool to obtain the anti-counterfeiting code of each page, and match the anti-counterfeiting code of each page with the first document coding information of the corresponding page. If they match, the content of the current page of the anti-counterfeiting document has not been tampered with.

9. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 5.

10. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: The computer instructions are used to make a computer execute the method according to any one of claims 1-5.