A file inspection method, device, equipment and medium
Patent Information
- Application Number
- CN202311003591.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-10
- Publication Date
- 2026-06-02
- Estimated Expiration
- 2043-08-10
Smart Images

Figure CN117037192B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, and in particular to a document auditing method, apparatus, equipment, and medium. Background Technology
[0002] Electricity marketing refers to the process by which power companies, in a changing market environment, aim to meet people's electricity consumption needs by providing electricity products and related services through a series of market-related business activities.
[0003] The existing auditing methods mainly rely on manually reviewing the contents of work order documents, which is time-consuming and results in poor auditing efficiency. Summary of the Invention
[0004] This invention provides a document auditing method, apparatus, equipment, and medium to improve the efficiency of document auditing.
[0005] In a first aspect, the present invention provides a document auditing method, comprising:
[0006] Obtain digital images of the documents to be inspected;
[0007] Digital images are identified to obtain document information of the documents to be inspected;
[0008] Based on the audit keywords in the audit rules, search for user input information corresponding to the audit keywords in the document information, and record the audit keywords and the corresponding user input information as the record information;
[0009] Anomaly detection is performed on the recorded information in accordance with the audit rules;
[0010] If at least one record is found to be abnormal, the document to be audited is determined to be abnormal.
[0011] Secondly, the present invention also provides a document auditing device, comprising:
[0012] The digital image acquisition module is used to acquire digital images of the documents to be inspected.
[0013] The document information acquisition module is used to recognize digital images and obtain the document information of the document to be inspected.
[0014] The record information determination module is used to find the user input information corresponding to the audit keywords in the document information according to the audit rules, and to record the audit keywords and the corresponding user input information as the record information.
[0015] The anomaly detection module is used to detect anomalies in the recorded information according to the audit rules;
[0016] The abnormal result determination module is used to determine that the document to be audited is abnormal if at least one record is abnormal.
[0017] Thirdly, embodiments of the present invention also provide an electronic device, comprising:
[0018] At least one processor; and
[0019] A memory that is communicatively connected to at least one processor; wherein
[0020] The memory stores instructions that can be executed by at least one processor, which enables the at least one processor to perform the document auditing method provided in any embodiment of the present invention.
[0021] Fourthly, embodiments of the present invention also provide a computer-readable storage medium storing computer instructions, which are used to cause a processor to execute and implement the file auditing method of any embodiment of the present invention.
[0022] This invention provides an embodiment that acquires a digital image of a document to be audited; identifies the digital image to obtain document information; searches for user input information corresponding to the audit keywords in the document information based on the audit rules, and records the audit keywords and corresponding user input information as record information; performs anomaly detection on the record information according to the audit rules; and determines that the document to be audited is abnormal if at least one record information is found to be abnormal. This technical solution, by acquiring record information from the image of the document to be audited based on the audit keywords in the audit rules, and performing anomaly detection on the record information according to the audit rules to determine whether the document to be audited is abnormal, achieves automated document auditing and improves the efficiency of document auditing.
[0023] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description
[0024] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0025] Figure 1 This is a flowchart of a document auditing method provided in Embodiment 1 of the present invention;
[0026] Figure 2This is a flowchart of a document auditing method provided according to Embodiment 2 of the present invention;
[0027] Figure 3 This is a schematic diagram of the structure of a document inspection device according to Embodiment 3 of the present invention;
[0028] Figure 4 This is a schematic diagram of the structure of an electronic device that implements the document auditing method of this invention. Detailed Implementation
[0029] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0030] It should be noted that the terms "first" and "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0031] In the technical solutions of the embodiments of the present invention, the acquisition, storage and application of the documents to be inspected, etc., all comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0032] Example 1
[0033] Figure 1 This is a flowchart of a document auditing method provided in Embodiment 1 of the present invention. This embodiment is applicable to the auditing of documents. The method can be executed by a document auditing device, which can be implemented in hardware and / or software and specifically configured in an electronic device, such as a server.
[0034] See Figure 1 The document auditing methods shown include:
[0035] S101. Obtain a digital image of the document to be inspected.
[0036] In this embodiment, the document to be inspected can be an electricity service order document, including but not limited to an electricity service application form, an electricity acceptance receipt, and an electricity notification.
[0037] In one optional embodiment, the paper document to be inspected is scanned using a digital scanning device to obtain a digital image of the document to be inspected; in another optional embodiment, the document to be inspected can be photographed using a digital camera to obtain a digital image of the document to be inspected; in yet another optional embodiment, a simulated image of the document to be inspected can be photographed and converted into a digital image.
[0038] S102. Recognize the digital image to obtain the document information of the document to be inspected.
[0039] In this embodiment, the document information can be the content of the document to be audited. For example, the document to be audited is an electricity service application form, and the document information can be the content of the electricity service application form, such as the form name, electricity user information, and service content.
[0040] Specifically, a certain algorithm is used to identify digital images and obtain the file information of the documents to be inspected.
[0041] In one optional embodiment, before recognizing the digital image to obtain the file information of the document to be inspected, the method further includes: verifying whether the format of the digital image of the document to be inspected is a two-color format; if the format of the digital image is not a two-color format, then converting the format of the digital image to obtain a two-color format digital image.
[0042] Two-color format can refer to a color format that includes only two colors in an image.
[0043] Specifically, the pixel values of each pixel in the digital image of the document to be audited are obtained; the pixel values of each pixel in the digital image of the document to be audited are counted to obtain the number of each pixel value and the number of types of pixel values; if there are only two different pixel values in the digital image of the document to be audited, then the digital image of the document to be audited is in two-color format and the digital image of the document to be audited passes the verification; if there are at least three different pixel values in the digital image of the document to be audited, then the pixel values other than the most numerous pixel value are converted into the first candidate pixel value to obtain the digital image in two-color format; furthermore, after converting the pixel values other than the most numerous pixel value into the first candidate pixel value, the most numerous pixel value can also be converted into the second candidate pixel value to obtain the digital image in two-color format, wherein the first candidate pixel value and the second candidate pixel value are different.
[0044] In an optional embodiment, if the digital image of the document to be inspected contains only one pixel value, that is, all pixels in the document to be inspected have the same pixel value, then the document to be inspected is determined to be abnormal.
[0045] It is understandable that by adopting the above technical solution, the digital image of the document to be inspected that is not in two-color format is converted into two-color format, so as to improve the color difference between the document background and the document information in the digital image of the document to be inspected, thereby improving the accuracy of the document information identified from the digital image.
[0046] S103. Based on the audit keywords in the audit rules, find the user input information corresponding to the audit keywords in the document information, and record the audit keywords and the corresponding user input information as record information.
[0047] In this embodiment, the audit rules can be rules for detecting anomalies in the documents to be audited. Audit rules include audit keywords and normal conditions for recorded information. It should be noted that the audit keywords and normal conditions for recorded information can be set independently by technical personnel based on actual needs or practical experience. Audit keywords can be words in the document information detected by the audit rules, including but not limited to business category, power supply voltage, and electricity usage characteristics. The audit keywords differ for each audit rule. User input information can be information entered by the user in the document to be audited, such as information filled in by the user or information selected by the user in the document to be audited.
[0048] Specifically, for each audit rule, the user input information corresponding to the audit keyword of that audit rule is retrieved from the document information, and the audit keyword and the corresponding user input information are used as the record information of that audit rule. For example, if the audit keyword of the audit rule is "business category", then the user input information corresponding to the business category is retrieved from the document information; if the retrieved input information corresponding to the business category is "capacity expansion", then the business category and capacity expansion are used as the record information of that audit rule.
[0049] S104. Perform anomaly detection on the recorded information according to the audit rules.
[0050] Specifically, the system checks whether the recorded information meets the normal conditions in the corresponding audit rules; if the recorded information meets the normal conditions in the corresponding audit rules, the recorded information is determined to be normal; if the recorded information does not meet the normal conditions in the corresponding audit rules, the recorded information is determined to be abnormal.
[0051] For example, the audit keyword for audit rule A is business category, and the normal condition is that the user input information in the record information contains only one business category; if the user input information in the record information of audit rule A contains only one business category, then the record information is determined to be normal; otherwise, the record information is determined to be abnormal.
[0052] For example, the audit keyword for audit rule B is the electricity address, and the normal condition is that the number of characters in the user input information in the record information is greater than the preset number of characters; if the number of characters in the user input information in the record information of audit rule B is greater than the preset number of characters, then the record information is determined to be normal; otherwise, the record information is determined to be abnormal.
[0053] For example, the audit keyword for audit rule C is the application date, and the normal condition is whether the date in the user input information corresponding to the record information is later than the business commencement date; if the date in the user input information corresponding to the record information of audit rule C is later than the business commencement date, then the record information is determined to be normal; otherwise, the record information is abnormal.
[0054] For example, the audit keywords for audit rule D are existing capacity, increased capacity, and total capacity. A normal condition is that the sum of the user input information corresponding to the existing capacity and the user input information corresponding to the increased capacity in the recorded information equals the user input information corresponding to the total capacity. If the sum of the user input information corresponding to the existing capacity and the user input information corresponding to the increased capacity in the recorded information of audit rule D equals the user input information corresponding to the total capacity, then the recorded information is determined to be normal; otherwise, the recorded information is abnormal.
[0055] S105. If at least one record is abnormal, the document to be audited is determined to be abnormal.
[0056] In one optional embodiment, after obtaining the detection results of all recorded information, it can be verified whether there is at least one recorded information that is abnormal; if there is at least one recorded information that is abnormal, then the document to be audited is determined to be abnormal.
[0057] In another optional embodiment, when the detection result of each record information is obtained, it can be detected whether the detection result of the record information is abnormal; if the detection result of the record information is abnormal, then the document to be audited is determined to be abnormal.
[0058] This invention provides an embodiment that acquires a digital image of a document to be audited; identifies the digital image to obtain document information; searches for user input information corresponding to the audit keywords in the document information based on the audit rules, and records the audit keywords and corresponding user input information as record information; performs anomaly detection on the record information according to the audit rules; and determines that the document to be audited is abnormal if at least one record information is found to be abnormal. This technical solution, by acquiring record information from the image of the document to be audited based on the audit keywords in the audit rules, and performing anomaly detection on the record information according to the audit rules to determine whether the document to be audited is abnormal, achieves automated document auditing and improves the efficiency of document auditing.
[0059] Example 2
[0060] Figure 2 This is a flowchart of a document auditing method provided in Embodiment 2 of the present invention. Based on the technical solution of the above embodiments, the present invention optimizes and improves the document information determination operation.
[0061] Furthermore, the process of "identifying digital images to obtain file information of the document to be audited" is further refined into "character recognition of the digital image of the document to be audited to obtain candidate characters in the digital image and the recognition result of each candidate character; if the recognition result of each candidate character is normal, then each candidate character is used as file information; if the recognition result of a candidate character is abnormal, then the candidate character with the abnormal recognition result is used as an abnormal character, and character recognition is performed on the character area where the abnormal character is located to obtain the target character; the target character and the candidate characters with normal recognition results are used as file information of the document to be audited," in order to improve the process of determining file information.
[0062] It should be noted that for any parts not described in detail in the embodiments of the present invention, please refer to the description in the foregoing embodiments.
[0063] See Figure 2 The document auditing methods shown include:
[0064] S201. Obtain a digital image of the document to be inspected.
[0065] S202. Perform character recognition on the digital image of the document to be audited to obtain candidate characters in the digital image and the recognition results of each candidate character.
[0066] In this embodiment, the candidate characters can be characters obtained by character recognition of the digital image of the document to be audited. The recognition results can include normal and abnormal.
[0067] Specifically, a character recognition algorithm is used to perform character recognition on the digital image of the document to be inspected. The recognized characters are used as candidate characters for the digital image of the document to be inspected, and the recognition results of each character are used as the recognition results of the corresponding candidate characters.
[0068] S203. If the recognition results of each candidate character are all normal, then each candidate character shall be used as file information.
[0069] S204. If the recognition result of the candidate character is abnormal, then the candidate character with the abnormal recognition result is taken as the abnormal character, and character recognition is performed on the character area where the abnormal character is located to obtain the target character.
[0070] In this embodiment, the abnormal character is the candidate character whose identification result is abnormal. The character region containing the abnormal character can be the region of the abnormal character in the digital image of the document to be inspected. The target character can be the target character obtained by performing character recognition on the character region containing the abnormal character, that is, the standard character corresponding to the abnormal character. Specifically, a certain algorithm is used to perform character recognition on the character region containing the abnormal character to obtain the target character.
[0071] Optionally, character recognition is performed on the character region where the abnormal character is located to obtain the target character, including: obtaining the character region of the abnormal character in the digital image of the document to be inspected; converting the character region according to the pixel value of each pixel in the character region to obtain a character region matrix; and performing character recognition on the character region matrix to obtain the target character.
[0072] The character region matrix can be a matrix representing the shape characteristics of abnormal characters within a character region. Specifically, the center point of the abnormal character is obtained; a rectangular area of a preset size centered on the center point of the abnormal character is taken as the region where the abnormal character is located; a certain algorithm is used to transform the character region based on the pixel values of each pixel in the character region to obtain the character region matrix; a certain algorithm is then used to perform character recognition on the character region matrix to obtain the target character.
[0073] It is understandable that by adopting the above technical solution, the character region containing the abnormal character is converted into a character region matrix, and character recognition is performed on the character region matrix, which reduces the computational complexity of character recognition, improves the efficiency of character recognition, and thus improves the efficiency of obtaining the target character.
[0074] Optionally, character recognition is performed on the character region matrix to obtain the target character, including: determining the matrix difference between the character region matrix and the standard region matrix based on the element values in the character region matrix and the element values in the standard region matrix, and using the matrix difference as the character difference between the abnormal character and the standard character corresponding to the standard region matrix; determining the target character of the abnormal character from the standard characters based on the character difference between the abnormal character and the standard character corresponding to the standard region matrix.
[0075] The standard region matrix can be a matrix representing the shape characteristics of standard characters within a character region. One standard character can correspond to at least two standard region matrices; that is, two different standard region matrices can correspond to the same standard character. The number of rows in the standard region matrix is the same as the number of rows in the character region matrix; the number of columns in the standard region matrix is the same as the number of columns in the character region matrix.
[0076] Specifically, for each standard region matrix, the character region matrix is subtracted from the standard region matrix to obtain an auxiliary matrix. The sum of squares of the values of each element in the auxiliary matrix is then taken as the square root to obtain the matrix difference between the character region matrix and the standard region matrix. This matrix difference is used as the character difference between the abnormal character and the corresponding standard character in the standard region matrix. Using a certain algorithm, the target character of the abnormal character is determined from the standard characters based on the character difference between the abnormal character and the corresponding standard characters in each standard region matrix.
[0077] Understandably, by adopting the above technical solution, the matrix difference between the character region matrix and the standard region matrix is identified as an anomaly. Based on the character difference between the anomaly character and the corresponding standard character in the standard region matrix, the target character of the anomaly character is determined from the standard characters based on the character difference, thereby improving the accuracy of the target character.
[0078] Optionally, based on the character differences between the abnormal character and the standard characters corresponding to the standard region matrix, the target character of the abnormal character is determined from the standard characters, including: filtering the standard region matrix according to the preset character differences to obtain an auxiliary region matrix; counting the number of auxiliary characters corresponding to each auxiliary region matrix; and determining the target character of the abnormal character from the auxiliary characters based on the number of each auxiliary character.
[0079] The preset character differences can be set independently by technical personnel based on actual needs or practical experience. The auxiliary region matrix can be a standard region matrix obtained by filtering the standard region matrix. The auxiliary characters can be the standard characters corresponding to the auxiliary region matrix.
[0080] Specifically, standard region matrices with character differences greater than or equal to preset character differences are filtered out from the standard region matrix to obtain auxiliary region matrices; the number of each auxiliary character is determined based on the auxiliary characters corresponding to each auxiliary region matrix; and the auxiliary character with the largest number is identified as the target character of the abnormal character.
[0081] It is understandable that by adopting the above technical solution, the standard region matrix is filtered to obtain an auxiliary region matrix; the number of auxiliary characters corresponding to each auxiliary region matrix is counted; and the target character of the abnormal character is determined from the auxiliary characters based on the number of each auxiliary character, thereby reducing the complexity of determining the target character and improving the efficiency of determining the target character.
[0082] Optionally, the character region is transformed based on the pixel values of each pixel in the character region to obtain a character region matrix, including: comparing the pixel values of each pixel in the character region with a first pixel value; updating the pixel values of pixels with different comparison results to a second pixel value; the first pixel value and the second pixel value are different; and forming a character region matrix based on the updated pixel values of the character region.
[0083] The first pixel value can be the pixel value corresponding to the background color of the document to be inspected in the digital image of the document to be inspected, that is, the pixel value with the largest number in the digital image of the document to be inspected.
[0084] Specifically, the first pixel value in the character region is mapped to a first element value, and the second pixel value in the character region is mapped to a second element value, resulting in a character region matrix. The first element value and the second element value are different. Correspondingly, the element values in the standard region matrix also only include the first element value and the second element value. The first element value is used to indicate that the pixel corresponding to the element is located in the character, and the second element value is used to indicate that the pixel corresponding to the element is located in the image background that is not a character.
[0085] It is understandable that by adopting the above technical solution, the pixel values of pixels with different comparison results are updated to the second pixel value. Based on the updated pixel values of the character region, a character region matrix is formed so that the character region matrix contains only two element values, thereby reducing the complexity of character recognition on the character region matrix and improving the efficiency of obtaining the target character.
[0086] S205. Use the target character and the candidate characters whose recognition results are normal as the file information of the document to be audited.
[0087] S206. Based on the audit keywords in the audit rules, find the user input information corresponding to the audit keywords in the document information, and record the audit keywords and the corresponding user input information as record information.
[0088] S207. Perform anomaly detection on the recorded information in accordance with the audit rules.
[0089] S208. If at least one record is abnormal, the document to be audited is determined to be abnormal.
[0090] The technical solution of this invention involves character recognition of a digital image of a document to be audited, obtaining candidate characters in the digital image and the recognition result of each candidate character. If the recognition result of each candidate character is normal, then each candidate character is used as document information. If the recognition result of a candidate character is abnormal, then the candidate character with the abnormal recognition result is used as an abnormal character, and character recognition is performed on the character area where the abnormal character is located to obtain the target character. The target character and the candidate characters with normal recognition results are used as document information of the document to be audited. This technical solution improves the accuracy of document information in the document to be audited, thereby improving the accuracy of anomaly detection of recorded information in the document.
[0091] Example 3
[0092] Figure 3 This is a schematic diagram of a document auditing device provided in Embodiment 3 of the present invention. This embodiment of the present invention is applicable to situations involving document auditing. The device can execute document auditing methods and can be implemented in hardware and / or software. The device can be configured in an electronic device, such as a server.
[0093] See Figure 3 The document inspection device shown includes a digital image acquisition module 301, a document information acquisition module 302, a record information determination module 303, an anomaly detection module 304, and an anomaly result determination module, wherein...
[0094] Digital image acquisition module 301 is used to acquire digital images of documents to be inspected;
[0095] The document information acquisition module 302 is used to recognize digital images and obtain the document information of the document to be inspected.
[0096] The record information determination module 303 is used to search for user input information corresponding to the audit keywords in the document information according to the audit rules, and to use the audit keywords and the corresponding user input information as record information;
[0097] Anomaly detection module 304 is used to perform anomaly detection on recorded information according to audit rules;
[0098] The abnormal result determination module 305 is used to determine that the document to be inspected is abnormal if at least one record is abnormal.
[0099] This invention employs a digital image acquisition module to acquire a digital image of the document to be audited; a document information acquisition module to recognize the digital image and obtain the document information; a record information determination module to search for user input information corresponding to audit keywords in the document information based on audit rules, and to record the audit keywords and corresponding user input information as record information; an anomaly detection module to perform anomaly detection on the record information according to audit rules; and an anomaly result determination module to determine that the document to be audited is abnormal if at least one record information is abnormal. This technical solution, by acquiring record information from the image of the document to be audited based on audit keywords in audit rules, and performing anomaly detection on the record information according to audit rules to determine whether the document to be audited is abnormal, achieves automated document auditing and improves the efficiency of document auditing.
[0100] Optionally, the file information acquisition module 302 includes:
[0101] The recognition result determination unit is used to perform character recognition on the digital image of the document to be inspected, obtain the candidate characters in the digital image, and the recognition result of each candidate character;
[0102] The first information determination unit is used to treat each candidate character as file information if the recognition result of each candidate character is normal.
[0103] The target character determination unit is used to identify the candidate character whose recognition result is abnormal if there is a candidate character whose recognition result is abnormal, and to perform character recognition on the character area where the abnormal character is located to obtain the target character.
[0104] The document information determination unit is used to identify the target character and the candidate characters whose recognition results are normal as the document information of the document to be inspected.
[0105] Optionally, the target character determination unit includes:
[0106] The region determination subunit is used to obtain the character region of the abnormal character in the digital image of the document to be inspected;
[0107] The matrix determines the sub-unit, which is used to transform the character region based on the pixel values of each pixel in the character region to obtain the character region matrix;
[0108] The character determination subunit is used to perform character recognition on the character region matrix to obtain the target character.
[0109] Optional, the character determines the subunit, specifically used for:
[0110] Based on the element values in the character region matrix and the element values in the standard region matrix, the matrix difference between the character region matrix and the standard region matrix is determined, and the matrix difference is used as the character difference between the abnormal character and the standard character corresponding to the standard region matrix.
[0111] Based on the character differences between the abnormal character and the standard characters corresponding to the standard region matrix, the target character of the abnormal character is determined from the standard characters.
[0112] Optional, the character determines the subunit, specifically used for:
[0113] Based on preset character differences, the standard region matrix is filtered to obtain an auxiliary region matrix;
[0114] Count the number of auxiliary characters corresponding to each auxiliary region matrix;
[0115] Based on the number of each auxiliary character, determine the target character of the abnormal character from the auxiliary characters.
[0116] Optionally, the matrix determines the sub-units, specifically used for:
[0117] Compare the pixel value of each pixel in the character region with the value of the first pixel;
[0118] Update the pixel values of pixels that differ from the comparison results to the second pixel value; the first pixel value and the second pixel value are different.
[0119] A character region matrix is formed based on the updated pixel points of the character region.
[0120] Optionally, the device may also include:
[0121] The format verification module is used to verify whether the digital image of the document to be inspected is in two-color format;
[0122] The format conversion module is used to convert the format of a digital image to a two-color format if the digital image is not in two-color format.
[0123] The document auditing device provided in the embodiments of the present invention can execute the document auditing method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of executing the document auditing method.
[0124] Example 4
[0125] Figure 4A schematic diagram of an electronic device 400 that can be used to implement embodiments of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (such as helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.
[0126] like Figure 4 As shown, the electronic device 400 includes at least one processor 401 and a memory, such as a read-only memory (ROM) 402 or a random access memory (RAM) 403, communicatively connected to the at least one processor 401. The memory stores computer programs executable by the at least one processor. The processor 401 can perform various appropriate actions and processes based on the computer program stored in the ROM 402 or loaded into the RAM 403 from storage unit 408. The RAM 403 may also store various programs and data required for the operation of the electronic device 400. The processor 401, ROM 402, and RAM 403 are interconnected via a bus 404. An input / output (I / O) interface 405 is also connected to the bus 404.
[0127] Multiple components in electronic device 400 are connected to I / O interface 405, including: input unit 406, such as keyboard, mouse, etc.; output unit 407, such as various types of displays, speakers, etc.; storage unit 408, such as disk, optical disk, etc.; and communication unit 409, such as network card, modem, wireless transceiver, etc. Communication unit 409 allows electronic device 400 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0128] Processor 401 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 401 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 401 performs the various methods and processes described above, such as document auditing methods.
[0129] In some embodiments, the document auditing method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 408. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 400 via ROM 402 and / or communication unit 409. When the computer program is loaded into RAM 403 and executed by processor 401, one or more steps of the document auditing method described above may be performed. Alternatively, in other embodiments, processor 401 may be configured to perform the document auditing method by any other suitable means (e.g., by means of firmware).
[0130] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations may include: implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0131] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0132] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0133] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0134] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or middleware components (e.g., application servers), or frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.
[0135] A computing system can include clients and servers. Clients and servers are generally geographically separated and typically interact via communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system. It addresses the shortcomings of traditional physical hosts and VPS (Virtual Private Server) services, such as high management difficulty and weak business scalability.
[0136] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.
[0137] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A document auditing method, characterized in that, The method includes: Obtain digital images of the documents to be inspected; The digital image is identified to obtain the file information of the document to be inspected; According to the audit keywords in the audit rules, search for user input information corresponding to the audit keywords in the document information, and record the audit keywords and the corresponding user input information as record information; Anomaly detection is performed on the recorded information according to the aforementioned audit rules; If at least one record is found to be abnormal, the document to be inspected is determined to be abnormal. The step of recognizing the digital image to obtain the file information of the document to be inspected includes: Character recognition is performed on the digital image of the document to be inspected to obtain candidate characters in the digital image and the recognition results of each candidate character; If the recognition results of each of the candidate characters are all normal, then each of the candidate characters will be used as the file information; If the recognition result of a candidate character is abnormal, then the candidate character with the abnormal recognition result is taken as the abnormal character, and character recognition is performed on the character area where the abnormal character is located to obtain the target character; The target character and the candidate characters whose recognition results are normal are used as the file information of the document to be inspected; The step of performing character recognition on the character region containing the abnormal character to obtain the target character includes: Obtain the character region of the abnormal character in the digital image of the document to be inspected; Based on the pixel values of each pixel in the character region, the character region is transformed to obtain a character region matrix; Character recognition is performed on the character region matrix to obtain the target character; The step of performing character recognition on the character region matrix to obtain the target character includes: Based on the element values in the character region matrix and the element values in the standard region matrix, the matrix difference between the character region matrix and the standard region matrix is determined, and the matrix difference is used as the character difference between the abnormal character and the standard character corresponding to the standard region matrix. Based on the character differences between the abnormal character and the standard characters corresponding to the standard region matrix, the target character of the abnormal character is determined from the standard characters; The step of transforming the character region based on the pixel values of each pixel in the character region to obtain a character region matrix includes: Compare the pixel value of each pixel in the character region with the first pixel value; Update the pixel values of pixels that differ from the comparison results to the second pixel value; the first pixel value and the second pixel value are different. A character region matrix is formed based on the updated pixel points of the character region.
2. The method according to claim 1, characterized in that, The step of determining the target character of the abnormal character from the standard characters based on the character difference between the abnormal character and the standard characters corresponding to the standard region matrix includes: Based on preset character differences, the standard region matrix is filtered to obtain an auxiliary region matrix; Count the number of auxiliary characters corresponding to each of the auxiliary region matrices; Based on the number of each auxiliary character, the target character of the abnormal character is determined from the auxiliary characters.
3. The method according to claim 1, characterized in that, Before recognizing the digital image to obtain the file information of the document to be inspected, the process further includes: Verify whether the digital image of the document to be inspected is in two-color format; If the digital image is not in two-color format, then the digital image is converted to obtain a two-color format digital image.
4. A document auditing device, characterized in that, The device includes: The digital image acquisition module is used to acquire digital images of the documents to be inspected. The document information acquisition module is used to identify the digital image and obtain the document information of the document to be inspected; The record information determination module is used to search for user input information corresponding to the audit keywords in the document information according to the audit rules, and to use the audit keywords and the corresponding user input information as record information; Anomaly detection module is used to perform anomaly detection on the recorded information according to the audit rules; An anomaly determination module is used to determine that the document to be inspected is abnormal if at least one record is abnormal. The file information acquisition module includes: The recognition result determination unit is used to perform character recognition on the digital image of the document to be inspected, and obtain candidate characters in the digital image, as well as the recognition result of each candidate character; The first information determining unit is used to determine each of the candidate characters as the file information if the recognition results of each candidate character are normal. The target character determination unit is used to, if the recognition result of a candidate character is abnormal, take the candidate character with the abnormal recognition result as an abnormal character, and perform character recognition on the character area where the abnormal character is located to obtain the target character; The file information determination unit is used to use the target character and the candidate character whose recognition result is normal as the file information of the file to be inspected. The target character determination unit includes: The region determination subunit is used to obtain the character region of the abnormal character in the digital image of the document to be inspected; The matrix determination subunit is used to transform the character region based on the pixel values of each pixel in the character region to obtain a character region matrix; The character determination subunit is used to perform character recognition on the character region matrix to obtain the target character; The character determination subunit is specifically used for: Based on the element values in the character region matrix and the element values in the standard region matrix, the matrix difference between the character region matrix and the standard region matrix is determined, and the matrix difference is used as the character difference between the abnormal character and the standard character corresponding to the standard region matrix. Based on the character differences between the abnormal character and the standard characters corresponding to the standard region matrix, the target character of the abnormal character is determined from the standard characters; Specifically, the matrix that determines the sub-unit is used for: Compare the pixel value of each pixel in the character region with the first pixel value; Update the pixel values of pixels that differ from the comparison results to the second pixel value; the first pixel value and the second pixel value are different. A character region matrix is formed based on the updated pixel points of the character region.
5. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the document auditing method according to any one of claims 1-3.
6. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that, when executed by a processor, implement the document auditing method of any one of claims 1-3.
Citation Information
Patent Citations
Document inspection method and system, electronic equipment and storage medium
CN113569863A