OCR (Optical Character Recognition) key information algorithm-based official document exchange control method and system
By applying OCR identification algorithm and barcode technology in the official document exchange system, the problems of inefficiency and difficulty in extracting key information are solved, and efficient and intelligent exchange and distribution of official documents are achieved, meeting the needs of domestic production and independent control.
Patent Information
- Application Number
- CN202411939039.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-26
- Publication Date
- 2025-05-23
AI Technical Summary
The existing official document exchange system relies on traditional paper documents and manual operations, which leads to inefficiency, error-prone, and inability to effectively extract key information from official documents, making it difficult to meet the needs of modern and efficient office work.
The official document exchange control method based on the OCR identification key information algorithm is adopted, and the official document image data is obtained through the OCR scanning device, image preprocessing and text recognition are performed, key information such as the issuing unit, the issuing number and the issuing date are extracted, and a uniquely identified barcode is generated to realize the automatic sorting and delivery of official documents.
It improves the accuracy and efficiency of official document identification, realizes the automation and intelligent exchange and distribution of official documents, reduces the dependence on foreign technologies, and meets the requirements of domestic production and independent control.
Smart Images

Figure CN120031060A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of office automation technology, and in particular to a document exchange control method and system based on an OCR key information recognition algorithm. Background Art
[0002] Official document exchange is an essential part of the daily office work of government agencies, enterprises, institutions and various organizations, involving the drafting, transmission, distribution and archiving of official documents. At present, most official document exchange systems still rely on the traditional paper document circulation and manual distribution and management, which is inefficient and prone to errors. Especially in scenarios with large amounts of official documents and frequent circulation, manual operation is not only time-consuming and labor-intensive, but may also lead to problems such as loss and misdelivery of official documents, making it difficult to meet the needs of modern efficient office work. At the same time, with the emphasis on information security and autonomous and controllable technologies, the demand for localization of official document exchange systems is increasing, and higher requirements are placed on technical solutions with independent research and development capabilities and in compliance with domestic office standards.
[0003] In the existing technology, some systems have introduced optical character recognition (OCR) technology to realize automatic recognition of image data, but most of these systems rely on foreign OCR algorithms or core components, and there is a problem that technology is subject to human control. In addition, the recognition effect of traditional OCR technology is easily affected by noise, tilted text, irregular handwriting, etc., and the recognition accuracy is low. It is impossible to effectively extract key information in official documents, such as the issuing unit, document number and date of issuance. The automation and intelligence level of the system is low, and it is difficult to meet the actual needs of efficient, fair and standardized document circulation. At the same time, there are shortcomings in security and domestic substitution.
[0004] In addition, most official document delivery and sorting technologies rely on traditional barcode scanning and simple sorting equipment. These devices are difficult to effectively coordinate with the information extraction system during the identification and execution process, resulting in the system being unable to automatically match the target receiving unit based on the identified key information. The delivery operation still requires manual intervention, which is inefficient and prone to errors. Especially in situations where high requirements are placed on information security, a quiet office environment, and an autonomous and controllable system, the existing technology has obvious deficiencies in sorting accuracy, degree of automation, and domestic adaptation. There is an urgent need for an efficient, intelligent official document exchange control system with domestic capabilities to solve the above problems.
[0005] In view of the deficiencies of the prior art, the present invention provides a document exchange control method and system based on an OCR key information recognition algorithm. Summary of the invention
[0006] In view of the deficiencies in the prior art, the present invention provides a document exchange control method and system based on an OCR key information recognition algorithm, which solves the problem that the recognition effect of traditional OCR technology is easily disturbed by noise, tilted text, irregular handwritten fonts, etc., has a low recognition accuracy, and cannot effectively extract key information from documents.
[0007] To achieve the above objectives, the present invention is implemented through the following technical solutions: a document exchange control method based on an OCR key information recognition algorithm comprises the following steps: Obtain handwritten information on paper documents, scan the paper documents through an OCR scanning device to obtain image data; Perform image preprocessing on the acquired image data, including binarization, denoising and text tilt correction; Use OCR recognition algorithm to recognize image data and obtain text data of official documents; Extract key information from the recognized text data, including the issuing unit, issuing number and issuing date; Generate a unique identification barcode based on the extracted key information; The generated barcode is attached to the official document, and the official document with the barcode is outputted through a printing device; By scanning the barcode of official documents through the intelligent delivery device, automatic sorting of documents and delivery to the target unit can be achieved.
[0008] Furthermore, the handwritten information of the paper document is obtained, and the paper document is scanned by an OCR scanning device to obtain the corresponding image data; the obtained image data is preprocessed, including binarizing the image to distinguish between text and background, removing image noise by median filtering or Gaussian filtering, detecting the tilt angle of the text in the image by Hough transform or other methods and correcting it to ensure that the image quality meets the recognition requirements; the preprocessed image data is input into the OCR recognition module, and an OCR recognition algorithm based on a combination of a convolutional neural network (CNN) and a recurrent neural network (RNN) is used to obtain the text data corresponding to the image and map the character probability distribution to the most likely character sequence by a connection temporal classification (CTC) algorithm; and natural language processing (NLP) analysis is performed on the recognized text data. , through the method of keyword extraction and template matching, the key information of the official document is extracted from the text, including the issuing unit, document number and document date, etc.; based on the extracted key information, the key information is combined and encoded using a barcode generation algorithm (such as Code128 or QR code) to generate a unique identification barcode; the generated barcode is integrated with the content of the official document, attached to a prominent position of the official document, and the official document with the barcode is output through a printing device; the printed official document is placed in an intelligent delivery device, and the barcode scanning module of the delivery device reads the official document barcode and decodes to extract key information, and automatically matches the corresponding target receiving unit or storage location according to the decoding result, and controls the delivery system to automatically sort the official document and accurately deliver it to the target location, thereby realizing efficient and intelligent exchange and distribution of official documents in a quiet office environment.
[0009] Preferably, the OCR recognition algorithm uses a combined model of a convolutional neural network (CNN) and a recurrent neural network (RNN) to perform text recognition.
[0010] Furthermore, the OCR recognition algorithm uses a combined model of convolutional neural network (CNN) and recurrent neural network (RNN) for text recognition, wherein the convolutional neural network (CNN) is first used to extract features from the input preprocessed image, and the image is convolved step by step through multiple convolutional layers to extract the spatial structural features of the character image, and the dimension of the feature map is reduced through the pooling layer, thereby retaining key information while reducing the amount of calculation, and outputting a multi-dimensional feature map for describing the local features of the image; then, the generated feature map is expanded column by column in the horizontal direction to form a one-dimensional feature sequence, and is input into the recurrent neural network (RNN). N) to perform sequence modeling, process character sequences through bidirectional long short-term memory networks (Bi-LSTM) or gated recurrent units (GRU), capture the temporal information and contextual relationships between characters, and solve the spatial dependency problem of characters; then, classify the features of each time step through the output layer to generate the probability distribution of each character category, and finally process the output character probability distribution in combination with the connection temporal classification (CTC) decoding algorithm to remove blank symbols and repeated characters and obtain the most likely character sequence, thereby ensuring the accuracy and completeness of the text recognition results, thereby achieving high-precision recognition of handwritten or printed characters in complex scenarios; Input image I → Feature extraction A convolutional neural network (CNN) is used to extract features from the input image I.
[0011] Feature extraction formula: F=σ(W*I+b) Among them, F: extracted feature map; W: convolution kernel (weight matrix); I: input image data; b: bias term; *: represents convolution operation; σ: activation function (such as ReLU, σ(x) = max(0,x)).
[0012] Feature graph sequence modeling Use recurrent neural network RNN, such as LSTM, to model the extracted feature maps and capture the temporal dependencies between characters.
[0013] Hidden state h t The update formula is: h t =o t ·tanh(f t ·C t-1 +i t tanh(W C ·[h t-1 ,x t ]+b C )) Among them, h t : The hidden state at the current moment; o t : Output gate, controls the proportion of the current output; ft : Forget gate, determines memory unit C t-1 The retention ratio; i t : Input gate, which determines the proportion of current input information; W C : weight matrix; b C : bias term; x t : input features at time step t; tanh: hyperbolic tangent activation function.
[0014] CTC Decoding Connectionist Temporal Classification (CTC) is used to transform the character probability distribution output at time step t into the final character sequence; the goal of CTC decoding is to find the character sequence Y with the maximum probability: Among them, Y: the final output character sequence; The set of all possible alignment paths; Z: the character sequence in the path, including repeated characters and spaces; T: the total number of time steps; P(z t |X): Character probability distribution output at time step t.
[0015] Preferably, the image preprocessing step includes: Use median filtering to denoise the image; The tilt angle of text is detected and corrected through Hough transform.
[0016] Furthermore, the acquired image data is denoised, and the noise in the image is filtered out using the median filtering method, wherein the median filtering sorts the pixels in the image and their neighborhood pixels, selects the median as the grayscale value of the current pixel, and effectively removes the salt and pepper noise and small interference in the image, while maintaining the integrity of the text edge, ensuring the smoothness and clarity of the image; then, in order to solve the problem of possible text tilt in the image, the Hough transform is used to detect the image tilt, and the main direction line of the character arrangement in the image is found by detecting the line segments in the binarized image, and the tilt angle is calculated. The image is corrected in combination with the rotation transformation, so that the arrangement direction of the text is aligned with the horizontal direction, ensuring the correct extraction and recognition of the characters in the subsequent OCR recognition process, and finally outputting the denoised and flattened image data to provide high-quality input data for the OCR recognition algorithm.
[0017] Preferably, the key information extraction step includes: Perform natural language processing (NLP) on text data recognized by OCR; Match key information such as issuing unit, issuing number and issuing date based on preset templates.
[0018] Furthermore, the text data recognized by OCR is subjected to natural language processing (NLP), specifically, the recognized text data is segmented, the text is divided into several words or phrase units, and meaningless words such as common prepositions and conjunctions are removed by stop word filtering, so as to extract words with practical meaning in the text; then, the key feature words in the text are weighted by combining word frequency statistics and TF-IDF (term frequency-inverse document frequency) algorithm, and high-weight words related to the article are screened out to ensure that key information can be correctly marked; then, based on the preset The template matching rules are used to perform semantic analysis on the text data after word segmentation and feature extraction, and the extracted text content is matched with the preset field template. For example, the feature words related to the unit name are matched to the "issuing unit" field, the text that conforms to the document number format is matched to the "issuing number" field, and the text in the date format is matched to the "issuing date" field, so as to accurately extract the key information of the issuing unit, document number and document date, ensure the correct classification and analysis of the key content in the text data, and provide accurate data support for the subsequent barcode generation and document processing; The TF-IDF algorithm is used to measure the importance of a word in a document collection. Its core formula is: TF-IDF(t,d)=TF(t,d)·IDF(t,D) Where t is a word; d is a single document; D is a document collection (including all documents); TF(t,d) is the frequency of word t in document d; IDF(t,D) is the inverse document frequency of word t.
[0019] Preferably, the barcode adopts Code 128 encoding format, and the issuing unit, issuing number and issuing date are combined to generate a unique identification barcode.
[0020] Furthermore, the barcode adopts the Code128 encoding format, and the issuing unit, the issuing number and the issuing date are combined to generate a unique identification barcode, which specifically includes the following steps: first, based on the extracted key information, namely the issuing unit, the issuing number and the issuing date, these information are combined into strings according to preset rules, for example, "issuing unit" is used as a prefix, followed by "issuing number", and then "issuing date" to form a complete unique identification string; then, the string is formatted to ensure that it complies with the Code128 encoding rules, such as limiting the characters in the string to the encodable ASCII character set range, and by adding a start character and The complete barcode data is constructed by using the formatted string and the end character; then, the Code128 encoding algorithm is used to convert the formatted string into barcode image data. Code128 encoding generates the black and white stripe pattern of the barcode by mapping each character of the string to the corresponding encoding mode and arranging them in sequence, and at the same time calculates and adds a checksum to ensure the integrity and correctness of the barcode; the barcode finally generated has compactness and high data capacity, and can accurately represent the combination of issuing unit, issuing number and issuing date, ensuring that key information can be quickly obtained by scanning the barcode during the subsequent delivery and distribution process, thereby realizing the unique identification and efficient management of the document; Check character calculation formula The check character is an important part of Code128 encoding, which is used to ensure the correctness and integrity of the barcode. Its calculation formula is: Among them, Value 0 : The encoding value of the start character depends on the selected Code128 encoding set (A, B or C); Value i : The encoding value of the ith data character (the Code128 character set defines the encoding value corresponding to each character); n: the number of data characters; mod103: modulus operation, the result is the encoding value of the check character, ranging from 0 to 102.
[0021] Preferably, the intelligent delivery device includes a barcode scanning device, a decoding module, a matching module and an automatic sorting device, the barcode scanning device is used to scan the barcode on the document and obtain the barcode image data, the decoding module is used to parse the barcode data and extract the unique identifier, the matching module is used to match the target receiving unit or storage location according to the unique identifier, the automatic sorting device includes a conveying device and a sorting execution device, the conveying device is used to transfer the document to the sorting location, and the sorting execution device delivers the document to the target receiving unit or the designated storage location based on the sorting instruction generated by the matching module.
[0022] Furthermore, the official document with the barcode is placed in the identification area of the intelligent delivery device, and the built-in barcode scanning module of the delivery device scans the barcode on the official document, obtains the barcode data and transmits it to the decoding module; secondly, the decoding module parses the scanned barcode data, and extracts the key information related to the official document through the barcode encoding rules, including the issuing unit, the issuing number and the receiving unit; then, the control module determines the target receiving unit or storage location of the official document according to the key information in the decoding result and the pre-set target position matching rules, and generates a sorting instruction; then, the execution module of the delivery device receives the sorting instruction, starts the internal automatic sorting mechanism, and transmits the official document to the corresponding delivery channel or storage unit, for example, through a conveyor belt, a sorting robot arm, etc. to achieve accurate transmission and classification of the official document; finally, the official document is automatically sorted to the target location or transmitted to the designated receiving unit, thereby realizing automatic sorting and target delivery of the official document based on the barcode data, reducing manual intervention, improving sorting efficiency and accuracy, and ensuring the intelligent, standardized and efficient operation of the official document exchange process.
[0023] Preferably, the barcode decoding step comprises: Read barcodes on official documents; Parse the unique identifier in the barcode and match it to the corresponding receiving unit or storage location.
[0024] Furthermore, the barcode on the official document is scanned by a barcode scanning device to obtain barcode image data and convert it into digital barcode information; then, the obtained barcode information is transmitted to the decoding module, and the decoding module uses a barcode parsing algorithm (such as a QR code decoding algorithm) to identify and parse the barcode to extract the unique identifier contained therein; wherein the unique identifier is key information data combined by preset rules, including fields such as the issuing unit, the issuing number and the issuing date; then, the decoding module transmits the extracted unique identifier to the matching module, and the matching module searches for the receiving unit or storage location corresponding to the unique identifier by querying a pre-established database or path mapping table; after the matching is completed, the system generates a matching result instruction to indicate the sorting target or delivery location required for the official document; finally, the matching result instruction is transmitted to the control module, and the control module directs the automatic sorting device or the transmission device to perform subsequent operations according to the information of the receiving unit or the storage location, thereby realizing the accurate classification and target delivery of the official document, ensuring that the entire decoding process is completed efficiently and accurately, and providing data support and control basis for the subsequent official document circulation; The core formula can be expressed as: Among them, D decoded : The final decoded data; b i: The i-th binary value in the QR code network, which can be 0 or 1; 2 i : weight, indicating the position weight of the binary bit in the data (starting from the lowest bit); n: the total number of data bits; RS Decode : Reed-Solomon error correction function, used to detect and correct errors in data and restore the original data.
[0025] A document exchange control system based on an OCR key information recognition algorithm, comprising: An information acquisition module, used to obtain image data of paper documents through an OCR scanning device; The information recognition module is used to perform OCR recognition on the image data and obtain text data; Key information extraction module, used to extract key information such as issuing unit, issuing number and issuing date from text data; A barcode generation module, used to generate a unique identification barcode based on the extracted key information; A document printing module is used to attach the generated barcode to the official document and output the printed official document; The intelligent delivery module is used to scan the barcodes of official documents and automatically sort and deliver them to the target units.
[0026] Preferably, the information recognition module uses a combined model of a convolutional neural network and a recursive neural network to perform OCR text recognition.
[0027] Preferably, the intelligent delivery module includes a barcode scanning device and an automatic sorting device, and the automatic sorting device delivers the document to a corresponding receiving unit based on the barcode decoding result.
[0028] Furthermore, the information acquisition module is used to obtain image data of paper documents through an OCR scanning device, which specifically includes placing the paper document on a scanning platform, the scanning device scanning the document line by line and generating high-resolution image data, and preprocessing the acquired image at the same time, such as binarization, denoising and tilt correction, to ensure that the image quality meets the recognition requirements; the information recognition module is used to perform OCR recognition on the image data, and the information recognition module preferentially uses a combined model of a convolutional neural network (CNN) and a recurrent neural network (RNN) for OCR text recognition, firstly using a convolutional neural network to extract the spatial features of the image, generating a feature map through multi-layer convolution and pooling operations, and then The feature map is then converted into a one-dimensional feature sequence and input into a recurrent neural network. The temporal relationship of the character sequence is captured through a bidirectional long short-term memory network (Bi-LSTM). Finally, the output character probability distribution is decoded into editable text data through a connectionist temporal classification (CTC) algorithm; the key information extraction module is used to extract key information such as the issuing unit, issuing number and issuing date from the recognized text data, specifically including natural language processing (NLP) analysis of the text data, combining keyword matching, regular expression parsing and template matching rules, segmenting, classifying and semantically identifying the text content, extracting and annotating key information; the barcode generation module is used to extract key information based on the extracted The key information of the document is used to generate a unique barcode, which specifically includes combining the key information such as the issuing unit, the issuing number and the issuing date into character strings according to preset rules, encoding the combined data using the Code128 encoding algorithm, converting the character information into the black and white stripe pattern of the barcode, and calculating the check code to ensure the integrity and accuracy of the barcode; the document printing module is used to attach the generated barcode to the official document and output the printed official document, which specifically includes integrating the barcode with the official document content, and outputting the official document with the barcode into a paper document through the printing device, ensuring that the official document content and the barcode information are presented completely and clearly; the intelligent delivery module is used to Scan the barcode of the official document and automatically sort and deliver it to the target unit. The intelligent delivery module includes a barcode scanning device and an automatic sorting device. Specifically, the barcode of the official document is scanned by the barcode scanning device, and the barcode data is obtained and decoded. The unique identifier is extracted therefrom, and the matching receiving unit or storage location is performed, and then the sorting instruction is transmitted to the automatic sorting device. The automatic sorting device controls the conveying device or the sorting robot based on the sorting instruction to sort the official document and transmit it to the corresponding target receiving unit or storage area, thereby realizing the intelligent and automatic sorting and delivery of the official document, reducing manual intervention, improving the efficiency and accuracy of the official document exchange, and ensuring that the system can operate efficiently in a quiet office environment.
[0029] The present invention provides a document exchange control method and system based on an OCR key information recognition algorithm. It has the following beneficial effects: 1. The present invention uses an OCR scanning device and a combined model based on a convolutional neural network (CNN) and a recurrent neural network (RNN) to perform text recognition, achieving the technical effect of high-precision collection and automatic recognition of paper document image data. Compared with the technical solutions in the prior art that rely on manual entry or simple image scanning, which result in low recognition accuracy, complex operation, and low efficiency, the present invention automatically extracts character features and recognizes character sequences through a deep learning model, effectively solving the problems of inaccurate recognition of handwritten or printed information in official documents and slow processing speed.
[0030] 2. The present invention uses natural language processing (NLP) technology to analyze OCR recognition results, combines keyword matching and template matching algorithms, accurately extracts key information of official documents, such as the issuing unit, document number and date of issuance, and uses the Code128 encoding algorithm to generate a unique identification barcode, achieving the technical effect of automatically extracting key information and generating a unique identification barcode. Compared with the technical solution in the prior art that cannot automatically analyze key information and requires manual confirmation and manual generation of identification, the present invention solves the problems of incomplete information extraction, inefficient identification generation and easy errors caused by relying on manual operation.
[0031] 3. The present invention adopts an intelligent delivery module, including a barcode scanning device and an automatic sorting device, which automatically matches the target receiving unit or storage location by scanning, parsing and decoding the barcode attached to the official document, and controls the sorting device for intelligent delivery, thereby achieving the technical effect of accurate automatic sorting and efficient delivery. Compared with the technical solution in the prior art that official documents rely on manual delivery, low sorting efficiency and easy errors, the present invention solves the problems of low efficiency, high error rate and difficulty in tracking in the manual sorting process. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] Figure 1 is a flow chart of the method of the present invention; Figure 2 It is a system framework diagram of the present invention. DETAILED DESCRIPTION
[0033] The following will be combined with the drawings in the specification of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0034] Please see attached Figure 1 - Attachment Figure 2 The embodiment of the present invention provides a document exchange control method and system based on an OCR key information recognition algorithm, comprising the following steps: Obtain handwritten information on paper documents, scan the paper documents through an OCR scanning device to obtain image data; Perform image preprocessing on the acquired image data, including binarization, denoising and text tilt correction; Use OCR recognition algorithm to recognize image data and obtain text data of official documents; Extract key information from the recognized text data, including the issuing unit, issuing number and issuing date; Generate a unique identification barcode based on the extracted key information; The generated barcode is attached to the official document, and the official document with the barcode is outputted through a printing device; By scanning the barcode of official documents through the intelligent delivery device, automatic sorting of documents and delivery to the target unit can be achieved.
[0035] Official document exchange is an indispensable and important part of modern office work, especially in scenarios such as government agencies and financial institutions that have high requirements for document security, standardization and efficiency. The drafting, transmission, distribution and archiving of official documents need to achieve high accuracy and process management. The traditional official document exchange method mainly relies on manual operation of paper documents, including manual distribution and circulation. Although this method is simple and easy, with the continuous increase in the amount of official documents and the improvement of office efficiency requirements, its inefficiency and error-prone disadvantages are becoming increasingly prominent. In addition, the existing official document exchange technical solutions rely on imported equipment or foreign core algorithms at the infrastructure level, and it is difficult to fully meet the localization needs in terms of information security and independent control. Especially in the field of national information security, it is particularly important to develop an official document exchange system based on domestic independent research and development. The present invention not only improves efficiency but also fully responds to the requirements for localization and independent control of the system by realizing automation and intelligence of the entire process from information collection, key information identification to sorting and delivery.
[0036] The present invention adopts OCR recognition technology combined with advanced deep learning algorithms, with a combined model of convolutional neural network (CNN) and recurrent neural network (RNN) as the core, to solve the problems of traditional OCR technology being sensitive to noise and having low recognition accuracy. After the OCR recognition module obtains the image data of paper documents through a scanning device, it first pre-processes the image, including binarization, denoising, and tilt correction to ensure the quality of the input image data; then, the CNN-based feature extraction network converts the local features of the image into high-dimensional feature representations, and then captures the contextual dependencies between character sequences through RNN, and uses the connection timing to extract the local features of the image. The classification (CTC) algorithm decodes the character sequence and finally obtains the complete text content. The present invention also combines natural language processing (NLP) technology to accurately extract key attributes such as the issuing unit, document number and document date from the recognized text data, greatly improving the recognition accuracy and efficiency. Compared with the traditional solution that relies on manual entry or simple scanning equipment, the OCR module of the present invention realizes fast and efficient text recognition, solves the shortcomings of low recognition rate and inability to automatically extract key information of official documents in traditional technology, and at the same time, by adopting domestic deep learning algorithms, it reduces dependence on foreign technology and improves the security and autonomous controllability of the system.
[0037] In the subsequent stage of official document information processing, the present invention integrates the extracted key information through a barcode generation module and generates a unique identification barcode. Specifically, the barcode generation module uses information such as the issuing unit, document number and issuing date to form a data string through preset encoding rules, and uses the Code128 encoding algorithm to convert the data into a barcode image. The barcode generation process also includes a verification mechanism to ensure the integrity and accuracy of the encoding result. After the generated barcode is attached to the official document file, it is output as a paper document with a unique identification barcode through the printing module. The barcode can be used as a unique identifier of the official document for rapid tracking and locating of document circulation information, and provides efficient technical support for sorting and delivery in the intelligent delivery link. Compared with the prior art that relies on manual marking or simple encoding, the present invention solves the problems of non-unique document identification and easy errors and difficulties in checking during the sorting process through intelligent barcode generation technology, further improving the automation level of official document processing.
[0038] The intelligent delivery module is an important part of the present invention, which is used for automatically sorting and delivering official documents with barcodes attached. The intelligent delivery module includes a barcode scanning device and an automatic sorting device, wherein the scanning device can quickly read the official document barcode and extract key information, such as the receiving unit or storage location, through a built-in decoding algorithm; after decoding, the system generates a sorting instruction according to the matching rule and transmits it to the automatic sorting device. The sorting device combines a mechanical structure (such as a conveyor belt or a sorting robot arm) and a path planning algorithm to transfer the official document to the corresponding target storage location or receiving unit. Through this process, the present invention realizes full automation of official document sorting and delivery. Compared with the traditional method that relies on manual sorting, the intelligent delivery module solves the problems of low sorting efficiency, high error rate and difficulty in tracking. Especially when facing the needs of large-scale official document processing, its intelligence and efficiency advantages are more obvious. In addition, the intelligent delivery module of the present invention is adapted to the domestic hardware platform, which can further meet the multiple requirements of the office environment for quietness, efficiency and safety.
[0039] In summary, the present invention forms a complete document exchange control system by organically combining modules such as OCR recognition technology, natural language processing technology, barcode generation and intelligent delivery, which significantly improves the automation and intelligence level of document processing, and solves the problems of low efficiency, poor accuracy and strong dependence on foreign technology in manual operation in the prior art. At the same time, the present invention effectively ensures the autonomy and controllability of the system by adopting domestic technical solutions, and provides an efficient, safe and standardized document exchange solution for high-requirement scenarios such as government agencies and financial institutions, which has broad application prospects.
[0040] In the technical solution of the present invention, step S1 is the basic link to realize the automation and intelligence of official document exchange. Its main goal is to scan paper documents through an OCR scanning device to obtain high-quality image data, and provide a reliable data basis for subsequent OCR recognition, key information extraction, and barcode generation. It should be noted that the content of paper documents may include handwritten text, printed text, or a mixed format of the two. To ensure the accuracy of subsequent processing, step S1 places high requirements on the acquisition quality of image data and optimizes the scanned image through a variety of preprocessing technologies. In some embodiments, step S1 can also be extended to apply to multi-page continuous scanning scenarios or batch processing of complex files to meet the needs of different application scenarios.
[0041] In this embodiment, the specific technical implementation of step S1 is as follows: First, the official document is manually placed on the scanning platform of the OCR scanning device by the user. The scanning device can be a flatbed scanner, an automatic document feeder scanner or a device with similar functions. It should be noted that in order to adapt to official documents of different sizes and formats, the scanning device should support multiple resolution modes (such as 300dpi, 600dpi) and the switching of color, grayscale or black and white scanning modes to meet the balance between the retention of official document content details and the need for file compression.
[0042] Specifically, after the scanning device is started, the optical sensor captures the original image data of the document by scanning line by line, and generates a high-resolution digital image I (x, y), where x and y are the two-dimensional pixel coordinates of the image, and I (x, y) represents the pixel value of the coordinate point. In some embodiments, the scanning device can also be equipped with automatic focus and exposure adjustment functions to ensure the clarity and contrast of the image, and can accurately collect data even under low light or reflective document surface conditions. In order to improve the accuracy of subsequent OCR recognition, the image data needs to undergo a series of preprocessing operations after collection, including binarization, denoising, tilt correction and edge cropping. The specific implementation of these preprocessing technologies is as follows: In the image binarization operation, the original grayscale image is converted into a binary image I bin (x,y), the formula is as follows: Wherein, T is a set threshold, x and y are two-dimensional pixel coordinates of the image, and I(x, y) represents the pixel value of the coordinate point. In some embodiments, a local thresholding method may also be used according to the complexity of the document content.
[0043] As an option, the denoising operation uses a median filtering technique to remove random noise from the image. The filtering process is implemented by the following formula: Wherein, k is the window size. In some embodiments, Gaussian filtering or bilateral filtering can be selected as an alternative according to the noise type. The formula is described as follows: I denoised (x,y)=Median{I bin (x+i,y+j)},i,j∈[-k,k] Among them, I denoised (x, y): pixel value of coordinate point (x, y) in the denoised image; I bin (x+i,y+j); the pixel points in the input image with (x,y) as the center and the window size of (2k+1)×(2k+1), Median{·}; means to calculate the median of the pixel values in the specified window and take the median of all pixels in the area; i,j∈[-k,k]: defines the range of the filter window, k is the radius of the window. For example, when k=1, the window size is 3×3.
[0044] Optimize the preservation effect of text edges. Specifically, in order to eliminate the image tilt problem that may occur during the scanning process, the Hough transform technology is used to detect and correct the text tilt angle. The Hough transform calculates the tilt angle θ by detecting the direction information of the line segment in the image. The formula is: ρ=x·cosθ+y·sinθ Wherein, ρ is the straight line distance in the polar coordinate system, θ is the straight line angle, and the detected tilt angle is used to perform reverse rotation correction on the image. In some embodiments, edge detection technology can also be combined to optimize the accuracy of straight line detection.
[0045] It should be noted that after the preprocessing is completed, the image edge cropping operation will remove the redundant blank areas according to the actual boundaries of the image content, thereby reducing the computational burden of subsequent processing and improving the overall efficiency of the system.
[0046] Exemplarily, in some embodiments, to meet the needs of continuous batch processing, the scanning device can use an automatic document feeder (ADF) to support continuous scanning and preprocessing of multi-page documents. After each page is scanned, the system automatically stores the image data in sequence to the cache area, and binds it to the corresponding physical file through a unique identifier to ensure the reliability of the file circulation process.
[0047] It is understandable that image data acquisition and preprocessing are the basis for subsequent OCR recognition, key information extraction and barcode generation, and their quality directly affects the execution effect of subsequent steps. In step S1, the present invention significantly improves the efficiency and accuracy of document image data acquisition by combining technical means such as high-resolution scanning, dynamic preprocessing and automated batch operation, providing important support for the intelligence and automation of the document exchange system.
[0048] In the technical solution of the present invention, step S2 is based on the acquired official document image data, and the text information in the image is converted into editable text data through the OCR recognition algorithm, laying the foundation for subsequent key information extraction and barcode generation. It should be noted that the text in the official document image may be printed fonts, handwritten fonts or a combination of the two. The text quality is affected by many factors such as image noise, tilt, font complexity, etc. Therefore, the present invention significantly improves the recognition ability of text in complex scenes by adopting deep learning technology combined with OCR recognition algorithm, and optimizes the recognized text results to ensure the accuracy and completeness of recognition.
[0049] In this embodiment, the OCR recognition module is specifically implemented by the following technologies: First, the image data I(x, y) preprocessed in step S1 is input into the OCR recognition module, where I(x, y) represents the pixel matrix of the image, and x and y are the pixel coordinates in the horizontal and vertical directions, respectively. In the OCR recognition module, a convolutional neural network (CNN) is first used to extract features from the image. Specifically, CNN extracts local features in the image through multi-layer convolution operations. The mathematical expression of the convolution process is: Among them, F l (i, j) is the output feature map of the lth layer; W l (m,n) is the weight of the convolution kernel; I l-1 (i+m,j+n) is the input image or the feature map of the previous layer; b l is the bias value; σ is the activation function (such as ReLU); M and N are the sizes of the convolution kernels respectively.
[0050] As an option, after feature extraction, the feature map is reduced in dimension using a pooling layer. The pooling operation compresses the feature map by taking the maximum or average value in a local area. The formula is expressed as follows; Among them, P l (i, j): the value of the coordinate (i, j) in the feature map after the lth layer pooling; F l (2i+m,2j+n): pixel value in the window corresponding to layer l in the input feature map, with (2i,2j) as the starting coordinate of the window; m∈[0,M-1]: pixel offset of the pooling window in the vertical direction, where M is the window height; n∈[0,N-1]: pixel offset of the pooling window in the horizontal direction, where N is the window width; 2i and 2j: starting coordinates of the pooling window, with a step size of 2. The sliding pooling operation not only reduces the computational complexity, but also retains key semantic features. In some embodiments, maximum pooling or average pooling can be selected as a dimensionality reduction method as needed.
[0051] Specifically, after the convolution feature extraction is completed, the generated feature map is flattened into a feature sequence and input into a recurrent neural network (RNN) for sequence modeling to capture the temporal dependencies between characters. For example, the RNN uses a bidirectional long short-term memory network Bi-LSTM, which can simultaneously consider the context information of the character sequence. The calculation formula is as follows: h t =o t tanh(C t ) Among them, h t is the hidden state at time step t; o tis the output gate, which controls the output ratio of the current time step; C t is the state of the memory unit, and its update formula is: C t =f t ·C t-1 +i t tanh(W C ·[h t-1 ,x t ]+b C ) Among them, C t : The memory cell state at the current time step t; f t : The output of the forget gate, used to determine the previous time step C t-1 The degree of memory retention; t : The output of the input gate, used to control the importance of the input information at the current time step; tanh(·): Hyperbolic tangent activation function, providing nonlinear transformation; W C : Weight matrix, acting on the hidden state h of the previous time step t-1 and the current input x t ; b C : Bias term.
[0052] The calculation formula of the forget gate and input gate is: Forget Gate t : f t =σ(W f ·[h t-1 ,x t ]+b f ) Input Gate i t : i t =σ(W i ·[h t-1 ,x t ]+b i ) Where, σ: Sigmoid activation function, defined as January 19, 2000 The output range of Sigmoid is (0,1), which is used to control the switching degree of the gate unit.
[0053] W f W i : are the weight matrices corresponding to the forget gate and the input gate respectively; b f ,b i : are the bias items corresponding to the forget gate and the input gate respectively; h t-1 : The hidden state of the previous time step t-1; x t: The input feature vector at the current time step t.
[0054] In one possible implementation, the hidden state matrix output by the recurrent neural network is used to calculate the character probability distribution at each time step, and the connectionist temporal classification (CTC) algorithm is used for decoding. The core of the CTC algorithm is to align the character sequence with the time step, and its goal is to find the most likely character sequence Y, as shown in the following formula: Where, Y: the optimal character sequence to be output (target sequence); Y ′ : All possible character sequence candidate sets; X: input feature sequence, usually from a convolutional network or other feature extraction module; P(Y ′ |X): Under the condition of input feature X, the target character sequence Y ′ The probability of; Z: all possible paths containing blank characters and repeated characters; The target character sequence Y ′ Maps back to the set of all paths containing whitespace and repeated characters; P(z t |X): character z in path Z at time step t t The probability distribution of; T: total number of time steps. It should be noted that the CTC decoding algorithm can automatically handle the blank and repetition problems between characters, so there is no need to segment the input image into characters. In some embodiments, in order to improve the decoding efficiency, the decoding result can be optimized in combination with the language model.
[0055] It should be noted that the CTC decoding algorithm can automatically handle the blank and repetition problems between characters, so there is no need to perform character segmentation on the input image. In some embodiments, in order to improve the decoding efficiency, the decoding result can be optimized in combination with a language model.
[0056] As an option, the recognition results can be further optimized by a natural language processing (NLP) module, for example, by performing rule checking and error correction on special symbols or character patterns in the recognized text to ensure the integrity and standardization of the text data.
[0057] It is understandable that the OCR recognition module is an important component of the document exchange control system of the present invention, and its recognition accuracy directly affects the quality of subsequent key information extraction and barcode generation. The present invention significantly improves the recognition effect of handwritten and printed texts in complex document scenes by combining the feature extraction capability of convolutional neural networks and the temporal modeling capability of recursive neural networks, providing a solid technical foundation for realizing intelligent document exchange. At the same time, the preprocessing and decoding optimization technology introduced in the module design further improves the robustness and adaptability of the system, ensuring that it can operate stably in different application scenarios.
[0058] Step S3 is a key step in the technical solution of the present invention to further parse the text data obtained by OCR recognition to extract key information such as the issuing unit, document number and date of issuance. This step combines natural language processing (NLP) technology to perform structured analysis and template matching on the recognized text data to ensure the accuracy and completeness of the extraction of key information. It should be noted that the solution of the present invention adopts a series of data cleaning, feature extraction and rule verification methods in view of the diverse and irregular formats of official document content, which can effectively parse various complex texts, avoid the problem of missing or erroneous information extraction, and provide high-quality data support for subsequent barcode generation.
[0059] In this embodiment, the specific implementation of step S3 is as follows: First, the text data output by the OCR recognition module is input into the key information extraction module, whose primary task is to clean and format the original text. It should be noted that the OCR recognition results may contain noise characters or non-target content, so the present invention adopts a character cleaning method based on regular expressions to filter and clean irrelevant characters in the text (such as extra spaces, line breaks, special symbols, etc.). Specifically, the character cleaning process is implemented by the following rules: Use regular expression matching rules to remove meaningless character combinations (such as consecutive special symbols "###" or meaningless line break "n").
[0060] Merge adjacent space characters to ensure the standardization and consistency of text layout.
[0061] In some embodiments, text cleaning also includes automatically correcting possible misrecognized characters, such as correcting common OCR misrecognition problems of "0" and "O" through context analysis.
[0062] After the text is cleaned, the key information extraction module will parse the text according to the preset template and feature rules to extract the fields of the document such as the issuing unit, document number and date of issue. As an option, the design of the feature rules is based on natural language processing (NLP) technology and optimized in combination with the structured characteristics of the document. Specifically, the present invention uses a word segmentation algorithm to process the text data to extract the semantic unit of each word, and classifies the fields through keyword matching and template rules.
[0063] The word segmentation formula is as follows: w i =Split(T,delimiter) Where T is the input text data, delimiter is the word separator (such as space, punctuation, etc.), w iRepresents the segmented word sequence.
[0064] Specifically, the extraction of the issuing unit is implemented based on keyword matching rules. For example, the content of the issuing unit field is determined by matching context information containing keywords such as "issuing unit" or "unit name" in the text. In some embodiments, the candidate texts can also be weighted in combination with word frequency statistics and TF-IDF algorithm to improve the accuracy of extraction.
[0065] The TF-IDF calculation formula is as follows: Among them, TF-IDF(t,d): represents the importance score of word t in document d; f t,d : The number of times word t appears in document d, i.e., term frequency (TF); ∑ k∈d f k,d : The sum of the number of occurrences of all words in document d, used to normalize the word frequency; |D|: The total number of documents in the document set D; |{d∈D:t∈d}|: The number of documents containing the word t; log: Logarithmic function (usually natural logarithm ln), used to smooth the impact of sparse documents; 1+|{d∈D:t∈d}|: The purpose of adding 1 to the denominator is to avoid the situation where the denominator is zero and ensure the stability of the formula.
[0066] For extracting the document number, the present invention uses regular expressions for format matching. For example, the document number usually has a fixed format (such as ″ XXXXX-YYYY ″ ), extracted using the following regular expression: Pattern = [A-Za-z0-9]+-[0-9]+ Among them, [A-Za-z0-9]+: matches letters (uppercase AZ, lowercase az) and numbers 0-9, and the length is one or more characters; -: matches hyphens ("-"); [0-9]+: matches numbers 0-9, and the length is one or more characters; Pattern: regular expression pattern, used to find document number strings with a specific format. This expression can accurately match number fields in formats similar to "ABCD-2024" or "1234-5678" to avoid accidentally extracting other non-target data.
[0067] It should be noted that the parsing rules and algorithms of the key information extraction module can be dynamically adjusted according to the specific format and content of the official document to adapt to different application scenarios. In some embodiments, the module also supports a semantic analysis model based on machine learning, which automatically annotates field content by training classifiers to improve the intelligence of the extraction.
[0068] It is understandable that key information extraction is an important step in achieving unique identification and standardized management of official documents, and its results directly affect the accuracy of subsequent barcode generation and intelligent delivery. The present invention significantly improves the adaptability to complex text scenarios by combining regular expressions, natural language processing technology and template matching methods, and can efficiently and accurately extract key fields such as issuing units, document numbers and document dates. At the same time, the module has high flexibility and can be expanded and optimized according to the needs of different scenarios, providing technical support for the intelligent operation of the official document exchange control system.
[0069] The system of this embodiment is executed based on the above method embodiment, and its principles and technical effects are similar, so they will not be repeated here.
[0070] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A document exchange control method based on an OCR key information recognition algorithm, characterized in that: The following steps are involved: Obtain handwritten information on paper documents, scan the paper documents through an OCR scanning device to obtain image data; Perform image preprocessing on the acquired image data, including binarization, denoising and text tilt correction; Use OCR recognition algorithm to recognize image data and obtain text data of official documents; Extract key information from the recognized text data, including the issuing unit, issuing number and issuing date; Generate a unique identification barcode based on the extracted key information; The generated barcode is attached to the official document, and the official document with the barcode is outputted through a printing device; By scanning the barcode of official documents through the intelligent delivery device, automatic sorting of documents and delivery to the target unit can be achieved.
2. The document exchange control method based on OCR key information recognition algorithm according to claim 1 is characterized in that: The OCR recognition algorithm uses a combined model of a convolutional neural network (CNN) and a recurrent neural network (RNN) to perform text recognition.
3. The document exchange control method based on OCR key information recognition algorithm according to claim 1 is characterized in that: The image preprocessing step comprises: Use median filtering to denoise the image; The tilt angle of text is detected and corrected through Hough transform.
4. The document exchange control method based on OCR key information recognition algorithm according to claim 1 is characterized in that: The key information extraction step comprises: Perform natural language processing (NLP) on text data recognized by OCR; Match key information such as issuing unit, issuing number and issuing date based on preset templates.
5. The document exchange control method based on OCR key information recognition algorithm according to claim 1 is characterized in that: The barcode adopts Code 128 encoding format, and combines the issuing unit, issuing number and issuing date to generate a unique identification barcode.
6. The document exchange control method based on OCR key information recognition algorithm according to claim 1 is characterized in that: The intelligent delivery device includes a barcode scanning device, a decoding module, a matching module and an automatic sorting device. The barcode scanning device is used to scan the barcode on the document and obtain the barcode image data. The decoding module is used to parse the barcode data and extract the unique identifier. The matching module is used to match the target receiving unit or storage location according to the unique identifier. The automatic sorting device includes a conveying device and a sorting execution device. The conveying device is used to transfer the document to the sorting location. The sorting execution device delivers the document to the target receiving unit or the designated storage location based on the sorting instruction generated by the matching module.
7. The document exchange control method based on OCR key information recognition algorithm according to claim 1 is characterized in that: The barcode decoding step comprises: Read barcodes on official documents; Parse the unique identifier in the barcode and match it to the corresponding receiving unit or storage location.
8. A document exchange control system based on an OCR key information recognition algorithm, applied to a system of a document exchange control method based on an OCR key information recognition algorithm according to any one of claims 1 to 7, characterized in that: include: An information acquisition module, used to obtain image data of paper documents through an OCR scanning device; The information recognition module is used to perform OCR recognition on the image data and obtain text data; Key information extraction module, used to extract key information such as issuing unit, issuing number and issuing date from text data; A barcode generation module, used to generate a unique identification barcode based on the extracted key information; A document printing module is used to attach the generated barcode to the official document and output the printed official document; The intelligent delivery module is used to scan the barcodes of official documents and automatically sort and deliver them to the target units.
9. The document exchange control system based on OCR key information recognition algorithm according to claim 8 is characterized in that: The information recognition module uses a combination model of convolutional neural network and recursive neural network to perform OCR text recognition.
10. The document exchange control system based on OCR key information recognition algorithm according to claim 8, characterized in that: The intelligent delivery module includes a barcode scanning device and an automatic sorting device, and the automatic sorting device delivers the official document to the corresponding receiving unit based on the barcode decoding result.
Citation Information
Patent Citations
Image character sequence recognition system based on recurrent neural network
CN105654135A
An OCR method based on depth learning
CN109376658A
Electronic official document recognition and reproduction method and system based on domestic CPU
CN112949471A
Automatic file sorting system
CN113522760A
Electronic official document identification method based on domestic CPU and operating system
CN114140808A
Cited By
Intelligent paperless conference management method and system based on digital twinning technology
CN120499337A
Data acquisition and transmission method and system of ultrasonic detector using AI
CN120801539A
Visual modeling-based official document information extraction method and system
CN120853208A
