A file automatic stamping method, device, medium and equipment

By using image processing and machine learning technologies, the system automatically identifies document content and accurately locates the stamping position, solving the problem of cumbersome and time-consuming document stamping processes and achieving efficient and accurate electronic stamping operations.

CN122116388APending Publication Date: 2026-05-29ANRUI DIGITAL INFORMATION TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
ANRUI DIGITAL INFORMATION TECH CO LTD
Filing Date
2026-01-19
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

In existing technologies, the document stamping process is cumbersome, time-consuming, error-prone, and may result in location upload errors.

Method used

By using image processing, optical character recognition, machine learning, and computer vision technologies, the system automatically identifies document content, determines stamping requirements, and precisely locates the stamping position, thus enabling electronic stamping operations.

Benefits of technology

It improves stamping efficiency, reduces labor costs, minimizes operational errors, and provides high-quality stamping results and comprehensive document management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122116388A_ABST
    Figure CN122116388A_ABST
Patent Text Reader

Abstract

The application discloses a file automatic stamping method, device, medium and equipment. The method comprises the following steps: acquiring a file image to be processed, and preprocessing the file image to obtain a first processing result; performing optical character recognition and semantic analysis on the first processing result, extracting key text information of the file, and obtaining a second processing result; judging whether stamping is needed and determining a target area of an electronic seal based on a preset stamping rule and the second processing result, and obtaining a third processing result; and synthesizing a specified electronic seal in the target area according to the third processing result, and generating a stamped file.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of automation and image processing technology, and more specifically, to a method, apparatus, medium, and device for automatically stamping documents. Background Technology

[0002] Employees upload a large number of documents through the OA system. Finance staff need to download and print these documents, manually stamp them one by one according to the rules, scan them into PDF files, and then re-upload them to the OA system. This stamping process is very cumbersome, especially since the finance staff manually stamp, download, and convert the documents, which takes a lot of time and may result in problems such as incorrect stamps, unclear stamps, and incorrect file upload locations. Summary of the Invention

[0003] To address the shortcomings of existing technologies, this invention provides a method, apparatus, medium, and device for automatically stamping documents.

[0004] According to one aspect of the present invention, an automatic document stamping method is provided, comprising: Obtain the file image to be processed, and preprocess the file image to obtain the first processing result; The first processing result is subjected to optical character recognition and semantic analysis to extract key text information from the file, thus obtaining the second processing result; Based on the preset stamping rules and the second processing result, it is determined whether a stamp is needed and the target area of ​​the electronic seal is determined to obtain the third processing result. Based on the third processing result, a specified electronic seal is synthesized in the target area to generate a stamped document.

[0005] According to another aspect of the present invention, an automatic document stamping device is provided, comprising: The preprocessing module is used to acquire the file image to be processed and to preprocess the file image to obtain the first processing result; The analysis module is used to perform optical character recognition and semantic analysis on the first processing result, extract key text information from the file, and obtain the second processing result; The judgment module is used to determine whether a stamp is needed and to determine the target area of ​​the electronic seal based on the preset stamping rules and the second processing result, and to obtain the third processing result. The generation module is used to synthesize a specified electronic seal in the target area based on the third processing result, and generate a stamped document.

[0006] According to another aspect of the present invention, a computer-readable storage medium is provided, the storage medium storing a computer program for performing the methods described in any of the above aspects of the present invention.

[0007] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising: a processor; a memory for storing executable instructions of the processor; the processor being configured to read the executable instructions from the memory and execute the instructions to implement the method described in any of the preceding aspects of the present invention.

[0008] Therefore, the present invention provides an intelligent automatic stamping method, system and storage medium that can automatically identify document content, intelligently determine stamping requirements according to preset rules, accurately locate the stamping position and automatically complete the electronic stamping operation, thereby greatly improving stamping efficiency, reducing labor costs and reducing operational errors. Attached Figure Description

[0009] Exemplary embodiments of the present invention can be more fully understood by referring to the following figures: Figure 1 This is a flowchart illustrating an exemplary embodiment of the present invention for a method of automatically stamping documents; Figure 2 This is a schematic diagram of the structure of an automatic document stamping device provided in an exemplary embodiment of the present invention; Figure 3 This is the structure of an electronic device provided in an exemplary embodiment of the present invention. Detailed Implementation

[0010] Hereinafter, exemplary embodiments according to the present invention will be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are merely some embodiments of the present invention, and not all embodiments of the present invention. It should be understood that the present invention is not limited to the exemplary embodiments described herein.

[0011] It should be noted that, unless otherwise specifically stated, the relative arrangement, numerical expressions, and values ​​of the components and steps described in these embodiments do not limit the scope of the invention.

[0012] Those skilled in the art will understand that the terms "first," "second," etc., in the embodiments of the present invention are only used to distinguish different steps, devices, or modules, and do not represent any specific technical meaning, nor do they indicate a necessary logical order between them.

[0013] It should also be understood that in the embodiments of the present invention, "multiple" can refer to two or more, and "at least one" can refer to one, two or more.

[0014] It should also be understood that any component, data or structure mentioned in the embodiments of the present invention can generally be understood as one or more unless explicitly defined or given contrary instructions in the context.

[0015] Furthermore, the term "and / or" in this invention is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, the character " / " in this invention generally indicates that the preceding and following related objects have an "or" relationship.

[0016] It should also be understood that the description of the various embodiments in this invention emphasizes the differences between the various embodiments, and the similarities or similarities can be referred to each other. For the sake of brevity, they will not be described in detail.

[0017] At the same time, it should be understood that, for ease of description, the dimensions of the various parts shown in the accompanying drawings are not drawn according to actual scale.

[0018] The following description of at least one exemplary embodiment is merely illustrative and is in no way intended to limit the invention or its application or use.

[0019] Techniques, methods, and equipment known to those skilled in the art may not be discussed in detail, but where appropriate, they should be considered part of the specification.

[0020] It should be noted that similar labels and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be discussed further in subsequent figures.

[0021] The embodiments of this invention can be applied to electronic devices such as terminal devices, computer systems, and servers, and can operate together with a wide range of other general-purpose or special-purpose computing system environments or configurations. Well-known examples of terminal devices, computing systems, environments, and / or configurations suitable for use with electronic devices such as terminal devices, computer systems, and servers include, but are not limited to: personal computer systems, server computer systems, thin clients, thick clients, handheld or laptop devices, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputer systems, mainframe computer systems, and distributed cloud computing environments including any of the above systems, etc.

[0022] Electronic devices such as terminal devices, computer systems, and servers can be described in the general context of computer system executable instructions (such as program modules) executed by a computer system. Typically, program modules can include routines, programs, object programs, components, logic, data structures, etc., which perform specific tasks or implement specific abstract data types. Computer systems / servers can be implemented in distributed cloud computing environments, where tasks are executed by remote processing devices linked through communication networks. In distributed cloud computing environments, program modules can reside on local or remote computing system storage media, including storage devices.

[0023] Exemplary methods Figure 1 This is a flowchart illustrating an automatic document stamping method according to an exemplary embodiment of the present invention. This embodiment can be applied to electronic devices, such as… Figure 1 As shown, the automatic document stamping method 100 includes the following steps: Step 101: Obtain the file image to be processed and preprocess the file image to obtain the first processing result; Step 102: Perform optical character recognition and semantic analysis on the first processing result to extract key text information of the file and obtain the second processing result; Step 103: Based on the preset stamping rules and the second processing result, determine whether a stamp is needed and determine the target area of ​​the electronic seal to obtain the third processing result; Step 104: Based on the third processing result, synthesize the specified electronic seal in the target area to generate the stamped document.

[0024] Specifically, this invention utilizes technologies such as image processing, optical character recognition, machine learning, and computer vision to preprocess, recognize, rule-basedly determine, and stamp documents submitted by employees, achieving an intelligent and automated stamping process. Specific implementation steps: 1. Document Preprocessing: Preprocess employee-submitted documents using image processing techniques. This may include the following steps: 1) Adjust image brightness, contrast, and sharpness: Use the following formulas to adjust: new_pixel = old_pixel * contrast + brightness Where old_pixel is the original pixel value, contrast is the contrast gain, and brightness is the brightness gain.

[0025] 2) Noise reduction and background removal: Image filtering techniques, such as Gaussian filtering or median filtering, can be used to reduce noise. For background removal, background modeling or segmentation algorithms, such as the GrabCut algorithm, can be used.

[0026] 2. Optical Character Recognition (OCR): This involves performing OCR processing on pre-processed documents to convert text content in images into editable electronic files. Commonly used OCR algorithms include template matching-based methods, statistical model methods, and deep learning methods. Specific formulas involve the details of the algorithms; for example, the Conditional Random Field (CRF) model in statistical model methods is shown in the following formula: 1) Given an input sequence X = (x_1, x_2, ..., x_n) and a corresponding output sequence Y = (y_1, y_2, ..., y_n), where x_i represents the i-th input feature and y_i represents the i-th output label.

[0027] 2) The Conditional Random Field (CRF) model defines the conditional probability distribution of the output sequence Y given an input sequence X, which can be expressed by the following formula: P(Y| Where K is the size of the label set, λ_k is the model parameter, t_k(y_{i-1}, y_i, X, i) is the feature function, which describes the relationship between the input sequence, the current position, and the label of the previous position, and Z(X) is the normalization factor used to make the conditional probability distribution conform to the properties of probability.

[0028] 3. Rule Engine Design: Develop a rule engine to determine whether a document needs to be stamped, and if so, where and what type of stamp to use, based on specific conditions. The rule engine can be based on rule languages ​​or machine learning algorithms such as decision trees and logistic regression. The specific formula depends on the chosen algorithm and rule language.

[0029] 4. Machine Learning Algorithm Training: Using machine learning algorithms, such as Convolutional Neural Networks (CNNs), the model is trained to identify the locations and types of stamps required on documents. The training process can utilize gradient descent algorithms, with specific formulas including those for forward and backward propagation. For example, in a CNN, the formula for forward propagation can be expressed as: z = w * x + b a = activation(z) Where w is the weight matrix, x is the input matrix, b is the bias vector, and activation is the activation function.

[0030] 5. Stamp Position Location: Using computer vision techniques, such as edge detection and contour analysis, the document is analyzed to automatically locate the stamp position. Specific formulas involve details of image processing and computer vision algorithms, such as the gradient calculation formula in the Canny edge detection algorithm.

[0031] 6. Stamping Operation: Based on the judgment of the rule engine and the prediction results of the machine learning model, an electronic stamping operation is automatically performed at a specified location on the document. The specific formula depends on the selected electronic stamping technology, such as the formula for generating digital signatures or electronic seals.

[0032] 7. Feedback and Learning: Based on the feedback from the stamping results, the system can continuously optimize and improve the machine learning model. Specific formulas involve model update and optimization algorithms, such as the parameter update formula in the gradient descent algorithm.

[0033] Therefore, by implementing an intelligent automatic stamping system, this invention can automate the stamping process, improve efficiency and accuracy, and provide high-quality stamping results and complete document management. This significantly improves the cumbersome stamping process for financial personnel, saves time and human resources, and reduces errors and inconsistencies.

[0034] Exemplary device Figure 2 This is a schematic diagram of the structure of an automatic document stamping device provided in an exemplary embodiment of the present invention. Figure 2 As shown, the device 200 includes: The preprocessing module 210 is used to acquire the file image to be processed and preprocess the file image to obtain the first processing result; Analysis module 220 is used to perform optical character recognition and semantic analysis on the first processing result, extract key text information of the file, and obtain the second processing result; The judgment module 230 is used to determine whether a stamp is needed and to determine the target area of ​​the electronic seal based on the preset stamping rules and the second processing result, and to obtain the third processing result. The generation module 240 is used to synthesize a specified electronic seal in the target area based on the third processing result, and generate a stamped document.

[0035] Exemplary electronic devices Figure 3 This is the structure of an electronic device provided in an exemplary embodiment of the present invention. For example... Figure 3 As shown, the electronic device 30 includes one or more processors 31 and memory 32.

[0036] The processor 31 may be a central processing unit (CPU) or other form of processing unit with data processing and / or instruction execution capabilities, and may control other components in the electronic device to perform desired functions.

[0037] The memory 32 may include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include, for example, random access memory (RAM) and / or cache memory. The non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, and the processor 31 may execute the program instructions to implement the methods of the software programs of the various embodiments of the present invention described above, and / or other desired functions. In one example, the electronic device may also include an input device 33 and an output device 34, these components being interconnected via a bus system and / or other forms of connection mechanisms (not shown).

[0038] In addition, the input device 33 may also include, for example, a keyboard, a mouse, etc.

[0039] The output device 34 can output various information to the outside. The output device 34 may include, for example, a display, a speaker, a printer, and a communication network and its connected remote output devices, etc.

[0040] Of course, for the sake of simplicity, Figure 3 Only some of the components of the electronic device relevant to the present invention are shown, omitting components such as buses, input / output interfaces, etc. In addition, the electronic device may include any other suitable components depending on the specific application.

[0041] Exemplary computer program products and computer-readable storage media In addition to the methods and apparatus described above, embodiments of the present invention may also be computer program products, which include computer program instructions that, when executed by a processor, cause the processor to perform the steps in the methods according to various embodiments of the present invention described in the "Exemplary Methods" section above.

[0042] The computer program product can be written in any combination of one or more programming languages ​​to perform the operations of the embodiments of the present invention. The programming languages ​​include object-oriented programming languages ​​such as Java and C++, as well as conventional procedural programming languages ​​such as C or similar languages. The program code can be executed entirely on the user's computing device, partially on the user's computing device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server.

[0043] Furthermore, embodiments of the present invention may also be computer-readable storage media storing computer program instructions thereon, which, when executed by a processor, cause the processor to perform the steps of the methods for information mining of historical change records according to various embodiments of the present invention as described in the "Exemplary Methods" section above.

[0044] The computer-readable storage medium may be any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, system, or device, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0045] The basic principles of the present invention have been described above with reference to specific embodiments. However, it should be noted that the advantages, benefits, and effects mentioned in the present invention are merely examples and not limitations, and should not be considered as essential features of each embodiment of the present invention. Furthermore, the specific details disclosed above are for illustrative and facilitative purposes only, and are not limitations. These details do not limit the present invention to the necessity of employing the aforementioned specific details.

[0046] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For system embodiments, since they largely correspond to method embodiments, the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments.

[0047] The block diagrams of devices, systems, devices, and systems involved in this invention are merely illustrative examples and are not intended to require or imply that they must be connected, arranged, or configured in the manner shown in the block diagrams. As those skilled in the art will recognize, these devices, systems, devices, and systems can be connected, arranged, and configured in any manner. Words such as “comprising,” “including,” “having,” etc., are open-ended terms meaning “including but not limited to,” and are used interchangeably with them. The terms “or” and “and” as used herein refer to the terms “and / or,” and are used interchangeably with them unless the context clearly indicates otherwise. The term “such as” as used herein refers to the phrase “such as but not limited to,” and is used interchangeably with it.

[0048] The methods and systems of the present invention may be implemented in many ways. For example, they may be implemented by software, hardware, firmware, or any combination of software, hardware, and firmware. The above-described order of steps for the methods is for illustrative purposes only, and the steps of the methods of the present invention are not limited to the order specifically described above unless otherwise specifically stated. Furthermore, in some embodiments, the present invention may also be implemented as a program recorded on a recording medium, the program comprising machine-readable instructions for implementing the methods according to the present invention. Thus, the present invention also covers recording media storing programs for performing the methods according to the present invention.

[0049] It should also be noted that in the systems, apparatus, and methods of the present invention, the components or steps can be disassembled and / or recombined. These disassemblies and / or recombinations should be considered equivalents of the present invention. The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use the invention. Various modifications to these aspects will be readily apparent to those skilled in the art, and the general principles defined herein can be applied to other aspects without departing from the scope of the invention. Therefore, the invention is not intended to be limited to the aspects shown herein, but rather to be carried out within the widest scope consistent with the principles and novel features disclosed herein.

[0050] The above description has been given for purposes of illustration and description. Furthermore, this description is not intended to limit the embodiments of the invention to the forms disclosed herein. Although numerous exemplary aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, alterations, additions, and sub-combinations therein.

Claims

1. A method for automatically stamping documents, characterized in that, include: Obtain the file image to be processed, and preprocess the file image to obtain the first processing result; The first processing result is subjected to optical character recognition and semantic analysis to extract key text information of the file, thus obtaining the second processing result. Based on the preset stamping rules and the second processing result, it is determined whether a stamp is needed and the target area of ​​the electronic seal is determined to obtain the third processing result. Based on the third processing result, a specified electronic seal is synthesized in the target area to generate a stamped document.

2. The method according to claim 1, characterized in that, The preprocessing operations include at least one of the following: brightness and contrast adjustment, image noise reduction, and background removal.

3. The method according to claim 1, characterized in that, The semantic analysis of the first processing result uses a machine learning algorithm, and the second processing result includes file type, key field content and their location coordinates; The forward propagation formula for the machine learning algorithm is as follows: z = w * x + b a = activation(z) Where z is the linear weighted sum, w is the weight matrix, x is the input matrix, b is the bias vector, activation is the activation function, and a is the activation value.

4. The method according to claim 3, characterized in that, Based on the preset stamping rules and the second processing result, it is determined whether a stamp is needed and the target area of ​​the electronic seal is identified, resulting in a third processing result, including: The file type and key field content in the second processing result are input into the rule engine, wherein the rule engine is a decision tree model or a rule-based expert system; The rule engine outputs stamping decisions, electronic seal types, and logical locations based on preset logic. Based on the logical location and the location coordinates of the key field content, the target area of ​​the electronic seal in the document image is calculated to obtain the third processing result.

5. The method according to claim 1, characterized in that, Synthesize a specified electronic seal in the target area, including: The transparency, size, or color of the electronic seal is dynamically adjusted based on the background features of the target area.

6. The method according to claim 4, characterized in that, Also includes: Collect user correction records for stamped documents, and use the correction records to iteratively optimize the semantic analysis model and / or the rule engine.

7. An automatic document stamping device, characterized in that, include: The preprocessing module is used to acquire the file image to be processed and to preprocess the file image to obtain a first processing result; The analysis module is used to perform optical character recognition and semantic analysis on the first processing result, extract key text information of the file, and obtain the second processing result; The judgment module is used to determine whether a stamp is needed and to determine the target area of ​​the electronic seal based on the preset stamping rules and the second processing result, and to obtain the third processing result. The generation module is used to synthesize a specified electronic seal in the target area based on the third processing result, and generate a stamped document.

8. The apparatus according to claim 7, characterized in that, The preprocessing operations include at least one of the following: brightness and contrast adjustment, image noise reduction, and background removal.

9. A computer-readable storage medium, characterized in that, The storage medium stores a computer program for performing the method described in any one of claims 1-6.

10. An electronic device, characterized in that, The electronic device includes: processor; Memory used to store the processor's executable instructions; The processor is configured to read the executable instructions from the memory and execute the instructions to implement the method described in any one of claims 1-6.