CN111078569B - Method and device for testing optical character recognition application and storage medium - Google Patents

Method and device for testing optical character recognition application and storage medium Download PDF

Info

Publication number
CN111078569B
CN111078569B CN201911327880.2A CN201911327880A CN111078569B CN 111078569 B CN111078569 B CN 111078569B CN 201911327880 A CN201911327880 A CN 201911327880A CN 111078569 B CN111078569 B CN 111078569B
Authority
CN
China
Prior art keywords
target
test
character recognition
function item
optical character
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201911327880.2A
Other languages
Chinese (zh)
Other versions
CN111078569A (en
Inventor
彭梅英
陈金龙
鲁四喜
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201911327880.2A priority Critical patent/CN111078569B/en
Publication of CN111078569A publication Critical patent/CN111078569A/en
Application granted granted Critical
Publication of CN111078569B publication Critical patent/CN111078569B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3692Test management for test results analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/60Type of objects
    • G06V20/62Text, e.g. of license plates, overlay texts or captions on TV images
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition

Abstract

The invention provides a test method, a test device, electronic equipment and a storage medium for optical character recognition application; the method comprises the following steps: sending an optical character recognition application test request containing a target test sample; when the target directory is monitored to contain the log file, the log file is obtained based on the target directory; the target directory and a storage directory of a log file are established with a mapping relation, and the log file is obtained by performing optical character recognition on a target test sample by operating an optical character recognition application; analyzing the log file to obtain an execution result of at least one target function item of the optical character recognition application in the optical character recognition process; respectively matching the execution result of at least one target function item with the corresponding target execution result to obtain a matching result, wherein the matching result is used for representing the execution accuracy of the corresponding target function item in the optical character recognition process; by the invention, the accuracy of the optical character recognition application test can be improved.

Description

Method and device for testing optical character recognition application and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and an apparatus for testing an optical character recognition application, an electronic device, and a storage medium.
Background
As the technology of artificial intelligence Optical Character Recognition (OCR) is becoming mature, OCR Recognition is more and more widely applied to people's daily life. The accuracy of OCR recognition is very important and thus needs to be tested before OCR related applications are widely released. In the related art, an overall testing mode is mostly adopted for testing OCR related applications to obtain the overall accuracy of OCR recognition. And the overall test of the OCR recognition cannot comprehensively reflect the problems possibly existing in the OCR recognition process through the test result, so that the test effect is reduced, and the accuracy is difficult to ensure.
Disclosure of Invention
The embodiment of the invention provides a method and a device for testing optical character recognition application, electronic equipment and a storage medium, which can improve the accuracy of the test of the optical character recognition application.
The technical scheme of the embodiment of the invention is realized as follows:
the embodiment of the invention provides a test method for optical character recognition application, which comprises the following steps:
sending an optical character recognition application test request containing a target test sample;
when it is monitored that the target directory contains the log file, acquiring the log file based on the target directory;
the target directory and a storage directory of the log file are established with a mapping relation, and the log file is obtained by operating the optical character recognition application and performing optical character recognition on the target test sample;
analyzing the log file to obtain an execution result of at least one target function item of the optical character recognition application in the optical character recognition process;
and respectively matching the execution result of the at least one target function item with the corresponding target execution result to obtain a matching result, wherein the matching result is used for representing the execution accuracy of the corresponding target function item in the optical character recognition process.
An embodiment of the present invention further provides a device for testing optical character recognition application, including:
the sending module is used for sending an optical character recognition application test request containing a target test sample;
the acquisition module is used for acquiring the log file based on the target directory when the log file is monitored to be contained in the target directory;
the target directory and a storage directory of the log file are established with a mapping relation, and the log file is obtained by operating the optical character recognition application and performing optical character recognition on the target test sample;
the analysis module is used for analyzing the log file to obtain an execution result of at least one target function item of the optical character recognition application in the optical character recognition process;
and the matching module is used for respectively matching the execution result of the at least one target function item with the corresponding target execution result to obtain a matching result, and the matching result is used for representing the execution accuracy of the corresponding target function item in the optical character recognition process.
In the above scheme, the apparatus further comprises:
the code insertion module is used for acquiring a test insertion code, and a cut-in point of the test insertion code corresponds to each function item of the optical character recognition application so as to output an execution result of the corresponding function item at the cut-in point;
performing code instrumentation on codes of the optical character recognition application to be tested based on the test instrumentation codes to obtain instrumented optical character recognition application codes;
compiling the inserted optical character recognition application code to obtain the optical character recognition application.
In the above scheme, the apparatus further comprises:
the task creating module is used for responding to a test task creating instruction aiming at the optical character recognition application and presenting a test sample and a selection interface of a functional item of the optical character recognition application;
determining the selected target test sample and the at least one target function item based on the selection interface;
and responding to a test task generation instruction, and creating a test task corresponding to the optical character recognition application based on the selected target test sample and the at least one target function item, wherein the test task triggers the sending of the test request of the optical character recognition application when being executed.
In the above scheme, the apparatus further comprises:
the establishing module is used for establishing a mapping relation between the target directory and a storage directory of the log file;
and the mapping relation is used for mapping the corresponding storage directory to the target directory after the log file is stored, so that the storage directory of the log file is directionally accessed by accessing the target directory.
In the foregoing solution, the matching module is further configured to, when the number of the target function items is at least two, and the number of the target test samples is at least two, respectively count matching results of the at least two target test samples corresponding to each target function item;
obtaining the standard reaching rate corresponding to each target function item based on the matching result of the at least two target test samples corresponding to each target function item;
and generating a test result corresponding to the optical character recognition application based on the standard reaching rate of each target function item, wherein the test result is used for representing the execution accuracy corresponding to the optical character recognition application.
In the above scheme, the apparatus further comprises:
the viewing module is used for presenting the test result corresponding to the optical character recognition application through a view interface, and the view interface comprises a viewing button used for viewing the matching result details corresponding to each target function item;
in response to a click operation on the view button, presenting matching result details of the corresponding target function item, the matching result details including at least one of:
and corresponding to the execution result and the target execution result of each target test sample, the matching result of the execution result and the target execution result of each target test sample, and the standard reaching rate of the target function item.
In the above scheme, the apparatus further comprises: the storage module is used for respectively storing an execution result of a target function item corresponding to each target test sample, a matching result of the execution result and the target execution result, the standard reaching rate of the target function item and the test result in a MySQL database;
wherein the target function item comprises at least one of:
the system comprises a classification function item, a rotation function item, a target area detection function item, a text box position detection function item and a character recognition function item.
In the above scheme, the matching module is further configured to generate an optical character recognition application test log in a process of generating a test result corresponding to the optical character recognition application; the test log is used for positioning a corresponding failure reason when the test result is failed to generate.
An embodiment of the present invention further provides an electronic device, including:
a memory for storing executable instructions;
and the processor is used for realizing the testing method of the optical character recognition application provided by the embodiment of the invention when the executable instructions stored in the memory are executed.
The embodiment of the invention also provides a storage medium, which stores executable instructions, and when the executable instructions are executed by a processor, the testing method for the optical character recognition application provided by the embodiment of the invention is realized.
The embodiment of the invention has the following beneficial effects:
obtaining an execution result of at least one target function item of the OCR application by analyzing a log file generated by OCR recognition of the target test sample by the OCR application, and respectively matching the execution result of the at least one target function item with a corresponding target execution result to obtain a matching result representing the execution accuracy of the target function item in the OCR recognition process; therefore, the execution accuracy corresponding to each target function item of the OCR application in the testing process can be obtained, and the accuracy of the OCR application testing is further improved.
Drawings
FIG. 1 is a block diagram of a test system for optical character recognition applications according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of an electronic device provided in an embodiment of the present invention;
FIG. 3 is a flow chart of a method for testing an optical character recognition application according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of an algorithm structure of an OCR application provided by the embodiment of the present invention;
FIG. 5 is a schematic diagram of the achievement rates of target function items of the OCR application provided by the embodiment of the invention;
FIG. 6 is a schematic illustration of a test result provided by an embodiment of the present invention;
FIG. 7 is a diagram illustrating details of a matching result provided by an embodiment of the present invention;
fig. 8 is a schematic application architecture diagram of a blockchain network according to an embodiment of the present invention;
fig. 9 is a schematic structural diagram of a block chain in the block chain network 80 according to an embodiment of the present invention;
fig. 10 is a functional architecture diagram of a blockchain network 80 according to an embodiment of the present invention;
fig. 11 is a schematic structural diagram of implementing an OCR application test based on a Web test management platform according to an embodiment of the present invention;
FIG. 12 is a flow chart illustrating a method for testing an optical character recognition application according to an embodiment of the present invention;
FIG. 13 is a schematic flow chart diagram of a method for testing a credential OCR application provided by an embodiment of the present invention;
FIG. 14 is a diagram illustrating the result of executing a target function item of a credential OCR application provided by an embodiment of the present invention;
fig. 15 is a schematic structural diagram of a testing apparatus for optical character recognition application according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail with reference to the accompanying drawings, the described embodiments should not be construed as limiting the present invention, and all other embodiments obtained by a person of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
In the following description, reference is made to "some embodiments" which describe a subset of all possible embodiments, but it is understood that "some embodiments" may be the same subset or different subsets of all possible embodiments, and may be combined with each other without conflict.
In the following description, references to the terms "first \ second \ third" are only to distinguish similar objects and do not denote a particular order, but rather the terms "first \ second \ third" are used to interchange specific orders or sequences, where appropriate, to enable embodiments of the invention described herein to be practiced in other than the order shown or described herein.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. The terminology used herein is for the purpose of describing embodiments of the invention only and is not intended to be limiting of the invention.
Before further detailed description of the embodiments of the present invention, terms and expressions mentioned in the embodiments of the present invention are explained, and the terms and expressions mentioned in the embodiments of the present invention are applied to the following explanations.
1) The signature, namely the digital signature, is a section of digital string which can be generated only by a sender of the information and cannot be forged by others, and is also a valid proof for the authenticity of the information sent by the sender of the information; digital signatures typically define two complementary operations, one for signing and the other for verification, the application of asymmetric key cryptography and digital digest technology.
2) In response to the condition or state on which the performed operation depends, one or more of the performed operations may be in real-time or may have a set delay when the dependent condition or state is satisfied; there is no restriction on the order of execution of the operations performed unless otherwise specified.
3) Transactions (transactions), equivalent to the computer term "Transaction," include operations that need to be committed to a blockchain network for execution and do not refer solely to transactions in the context of commerce, which embodiments of the present invention follow in view of the convention colloquially used in blockchain technology.
For example, a deployment (deployment) transaction is used to install a specified smart contract to a node in a blockchain network and is ready to be invoked; the Invoke (Invoke) transaction is used to append records of the transaction in the blockchain by invoking the smart contract and to perform operations on the state database of the blockchain, including update operations (including adding, deleting, and modifying key-value pairs in the state database) and query operations (i.e., querying key-value pairs in the state database).
4) A Block chain (Blockchain) is a storage structure for encrypted, chained transactions formed from blocks (blocks).
5) A Blockchain Network (Blockchain Network) incorporates new blocks into a set of nodes of a Blockchain in a consensus manner.
6) Ledger (legger) is a general term for blockchains (also called Ledger data) and state databases synchronized with blockchains. Wherein, the blockchain records the transaction in the form of a file in a file system; the state database records the transactions in the blockchain in the form of different types of Key (Key) Value pairs for supporting fast query of the transactions in the blockchain.
7) Intelligent Contracts (Smart Contracts), also known as chain codes (chaincodes) or application codes, are programs deployed in nodes of a blockchain network, and the nodes execute the intelligent Contracts called in received transactions to perform operations of updating or querying key-value data of a state database.
8) Consensus (Consensus), a process in a blockchain network, is used to agree on transactions in a block among a plurality of nodes involved, the agreed block is to be appended to the end of the blockchain, and the mechanisms for achieving Consensus include Proof of workload (PoW, Proof of Work), Proof of rights and interests (PoS, Proof of equity (DPoS), Proof of granted of shares (DPoS), Proof of Elapsed Time (PoET, Proof of Elapsed Time), and so on.
9) Optical Character Recognition (OCR) converts characters of various bills, newspapers, books, documents and other printed matters into image information by an Optical input method such as scanning, and converts the image information into a usable computer input technology by using a Character Recognition technology.
10) OCR applications, i.e. optical character recognition applications.
Based on the above explanations of terms and terms involved in the embodiments of the present invention, a testing system for optical character recognition applications provided by the embodiments of the present invention is described below, referring to fig. 1, fig. 1 is an architectural schematic diagram of a test for optical character recognition applications provided by the embodiments of the present invention, in order to support an exemplary application, a terminal 200 is connected to a Web management server 100 through a network 300, the Web management server 100 is connected to a tested OCR application server 400 through the network 300, and the network 300 may be a wide area network or a local area network, or a combination of both, and uses a wireless or wired link to implement data transmission.
The terminal 200 is used for sending an OCR application test request containing a target test sample; when the target directory is monitored to contain the log file, the log file is obtained based on the target directory; analyzing the log file to obtain an execution result of at least one target function item of the OCR application in the OCR recognition process; respectively matching the execution result of at least one target function item with the corresponding target execution result to obtain a matching result;
the Web management server 100 is used for receiving and forwarding an OCR application test request to a tested OCR application server;
the tested OCR application server 400 is used for responding to an OCR application test request containing a target test sample, running an OCR application to perform OCR recognition on the target test sample and generating a corresponding log file;
and the terminal 200 is used for presenting a matching result representing the execution accuracy of the corresponding target function item in the OCR recognition process.
In practical applications, the Web management server 100 and the OCR application server 400 under test may be a server configured separately to support various services, or may be a server cluster; the terminal 200 may be a smartphone, a tablet, a laptop, or any other type of user terminal, and may also be a wearable computing device, a Personal Digital Assistant (PDA), a desktop computer, a cellular phone, a media player, a navigation device, a game console, a television, or a combination of any two or more of these or other data processing devices.
The hardware structure of the electronic device of the test method for optical character recognition application provided by the embodiment of the present invention is described in detail below, referring to fig. 2, where fig. 2 is a schematic structural diagram of the electronic device provided by the embodiment of the present invention, and the electronic device 200 shown in fig. 2 includes: at least one processor 210, memory 250, at least one network interface 220, and a user interface 230. The various components in electronic device 200 are coupled together by a bus system 240. It is understood that the bus system 240 is used to enable communications among the components. The bus system 240 includes a power bus, a control bus, and a status signal bus in addition to a data bus. For clarity of illustration, however, the various buses are labeled as bus system 240 in fig. 2.
The Processor 210 may be an integrated circuit chip having Signal processing capabilities, such as a general purpose Processor, a Digital Signal Processor (DSP), or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, or the like, wherein the general purpose Processor may be a microprocessor or any conventional Processor, or the like.
The user interface 230 includes one or more output devices 231, including one or more speakers and/or one or more visual display screens, that enable the presentation of media content. The user interface 230 also includes one or more input devices 232, including user interface components that facilitate user input, such as a keyboard, mouse, microphone, touch screen display, camera, other input buttons and controls.
The memory 250 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid state memory, hard disk drives, optical disk drives, and the like. Memory 250 optionally includes one or more storage devices physically located remotely from processor 210.
The memory 250 includes volatile memory or nonvolatile memory, and may include both volatile and nonvolatile memory. The nonvolatile memory may be a Read Only Memory (ROM), and the volatile memory may be a Random Access Memory (RAM). The memory 250 described in embodiments of the invention is intended to comprise any suitable type of memory.
In some embodiments, memory 250 is capable of storing data, examples of which include programs, modules, and data structures, or a subset or superset thereof, to support various operations, as exemplified below.
An operating system 251 including system programs for processing various basic system services and performing hardware-related tasks, such as a framework layer, a core library layer, a driver layer, etc., for implementing various basic services and processing hardware-based tasks;
a network communication module 252 for communicating to other computing devices via one or more (wired or wireless) network interfaces 220, exemplary network interfaces 220 including: bluetooth, wireless compatibility authentication (WiFi), and Universal Serial Bus (USB), etc.;
a presentation module 253 to enable presentation of information (e.g., a user interface for operating peripherals and displaying content and information) via one or more output devices 231 (e.g., a display screen, speakers, etc.) associated with the user interface 230;
an input processing module 254 for detecting one or more user inputs or interactions from one of the one or more input devices 232 and translating the detected inputs or interactions.
In some embodiments, the testing apparatus for optical character recognition application provided by the embodiments of the present invention may be implemented in software, and fig. 2 shows the testing apparatus 255 for optical character recognition application stored in the memory 250, which may be software in the form of programs and plug-ins, and includes the following software modules: a sending module 2551, an obtaining module 2552, an analyzing module 2553 and a matching module 2554, which are logical and thus can be arbitrarily combined or further split according to the implemented functions, which will be described below.
In other embodiments, the testing Device for optical character recognition Application provided by the embodiments of the present invention may be implemented by a combination of hardware and software, and as an example, the testing Device for optical character recognition Application provided by the embodiments of the present invention may be a processor in the form of a hardware decoding processor, which is programmed to execute the testing method for optical character recognition Application provided by the embodiments of the present invention, for example, the processor in the form of a hardware decoding processor may employ one or more Application Specific Integrated Circuits (ASICs), DSPs, Programmable Logic Devices (PLDs), Complex Programmable Logic Devices (CPLDs), Field Programmable Gate Arrays (FPGAs), or other electronic components.
Based on the above description of the test system and the electronic device for optical character recognition application according to the embodiments of the present invention, the following description will discuss a test method for optical character recognition application according to the embodiments of the present invention. Referring to fig. 3, fig. 3 is a schematic flowchart of a testing method for an optical character recognition application according to an embodiment of the present invention; in some embodiments, the testing method for the optical character recognition application may be implemented by a server or a terminal alone, or implemented by the server and the terminal in a cooperative manner, and taking the server and the terminal in a cooperative manner as an example, the testing method for the optical character recognition application provided in the embodiments of the present invention includes:
step 301: the terminal sends an OCR application test request containing a target test sample.
Here, the OCR application is an optical character recognition application. In practical application, a We b test management platform is arranged on a terminal, information interaction with a background Web management server is achieved through the Web test management platform, and testers can operate the Web test management platform through the terminal to achieve testing of OCR application. Correspondingly, in the OCR application testing process, a tested O CR application server for running the OCR application is also arranged.
When a terminal executes a test task triggered by a tester, sending an OCR application test request containing a target test sample to a tested OCR application server through a background Web management server; specifically, the terminal firstly sends an OCR application test request to the Web management server, so that the Web management server sends the OCR application test request to the OCR application server to be tested.
The tested OCR application server is deployed with an OCR application, and after receiving an OCR application testing request forwarded by the Web management server, the deployed OCR application is executed to perform OCR recognition on the target testing sample so as to generate a corresponding log file.
In practical implementation, the OCR application is formed by a plurality of algorithm modules, and corresponds to a plurality of function items in the embodiment of the present invention, specifically, referring to fig. 4, fig. 4 is an algorithm structural diagram of the OCR application provided in the embodiment of the present invention, and includes a classification algorithm, a rotation algorithm, a target area detection algorithm, a text box position detection algorithm, and a character recognition algorithm. That is, in the embodiment of the present invention, the two classification function items, the rotation function item, the target area detection function item, the text box position detection function item, and the character recognition function item of the OCR application are respectively corresponding to.
Thus, in some embodiments, monitoring of the results of execution of various functional items of an OCR application may be achieved by: acquiring a test instrumentation code, wherein an entry point of the test instrumentation code corresponds to each function item of the OCR application so as to output an execution result of the corresponding function item at the entry point; performing code instrumentation on the code of the OCR application to be tested based on the test instrumentation code to obtain an instrumented OCR application code; compiling the instrumented OCR application code to obtain the OCR application.
Here, the test instrumentation code may be written in advance, so that the cut-in point of the test instrumentation code corresponds to each function item of the OCR application; and integrating the test instrumentation code and the code of the OCR application to be tested together in a code instrumentation mode to obtain the instrumented OCR application code.
In practical application, all the tangent planes of the algorithm influencing the execution result in the recognition process of the OCR application can be extracted in an Aspect-Oriented Programming (OP) mode, and various cut-in points corresponding to code instrumentation, such as two-classification algorithms, rotation algorithms and the like, where the execution result exists, are determined; and dynamically inserting the test insertion codes into the designated entry point to obtain the inserted OCR application codes.
And after the instrumented OCR application code is obtained, compiling the OCR application code to obtain the OCR application.
In some embodiments, in performing OCR application testing, a testing task for an O CR application may be created by: responding to a test task creation instruction aiming at the OCR application, and presenting a test sample and a selection interface of a functional item of the OCR application; determining a selected target test sample and at least one target function item based on a selection interface; and responding to a test task generation instruction, and creating a test task corresponding to the OCR application based on the selected target test sample and at least one target function item, wherein the test task triggers the sending of the OCR application test request when being executed.
After compiling the inserted OCR application code to obtain an OCR application, a tester can create a test task of the OCR application through a Web test management platform arranged on a terminal; specifically, a display interface of the Web test management platform includes function buttons such as a newly-built test task, and a tester can trigger a test task creation instruction of the OCR application by clicking the presented function button of the newly-built test task.
And the terminal responds to the test task creation instruction of the OCR application and presents a selection interface of each functional item of the test sample and the OCR application. Specifically, the selection interface may present a sample identifier corresponding to the test sample, or may directly present the test sample; meanwhile, the selection interface also presents selection icons corresponding to the test samples and the function items so that testers can select the required test samples and the required test function items, such as icons of '□, O' and the like; the tester can select the target test sample and at least one target function item by clicking the selection icon.
And when the terminal detects that the tester executes corresponding selection operation on the selection interface, the terminal responds to the selection instruction aiming at the test sample and the function item to determine the selected target test sample and at least one target function item. Here, the target test sample is an object to be recognized by the OCR application during testing; the target function items are function items to be tested in the OCR application, the number of the target function items may be multiple or one, and the target function items may be specifically set according to the needs of testers, which is not limited in the embodiment of the present invention.
And after the terminal determines the selected target test sample and the target function item, responding to a generation instruction of the test task, and creating the test task corresponding to the OCR application based on the selected target test sample and the target function item.
After the test task of the OCR application is successfully established, the Web test management platform can present the established test task through a display interface; the tester can select the test task to be executed through the display interface of the Web test management platform. When the terminal detects that a tester selects operation aiming at a test task, a determination button for executing the test task is presented in response to a triggered test task selection instruction; and when a test task execution instruction triggered by the determined button is received, running the test task of the OCR application, and at the moment, sending an OCR application test request to the tested OCR application server by the terminal through the background Web management server, wherein the OCR application test request comprises a target test sample for OCR recognition.
After receiving the OCR application test request, the tested OCR application server performs OCR recognition on the contained target test sample by running the OCR application after code instrumentation processing, and generates a corresponding log file in the OCR recognition process so as to record the execution condition and the execution result of the OCR application in the test environment.
In some embodiments, a plurality of test tasks may be created simultaneously, and in this case, for marking different test tasks, a unique corresponding task identifier may be generated for each test task, so that a subsequent execution result or a test result is stored correspondingly, thereby facilitating query.
Step 302: and when the target directory is monitored to contain the log file, acquiring the log file based on the target directory.
In some embodiments, the target directory is mapped with a storage directory of the log file; the mapping relation is used for mapping the corresponding storage directory to the target directory after the log file is stored, so that the storage directory of the log file can be directionally accessed by accessing the target directory.
In the process that the tested OCR application server runs an OCR application and performs OCR recognition on a target test sample, a corresponding log file is generated and stored in a preset storage directory.
And a Web test management platform is arranged on the terminal side of the Web management server, and the Web test management platform monitors whether the target directory contains the log file or not through the Web management server. And when the target directory is monitored to contain the log file, acquiring the log file from the target directory.
In practical application, a mapping relation is established between the target directory and the storage directory of the log file. The mapping relation is used for mapping the log file from the storage directory to the target directory after the log file is stored by the tested OCR application server, so that the Web test management platform can directionally access the storage directory of the log file by accessing the target directory.
In actual implementation, a network file system NFS and a remote procedure call RPC are deployed on a tested OCR application server and a Web management server, and file sharing functions of the tested OCR application server and the Web management server are realized through corresponding configuration, so that the establishment of a mapping relation between a target directory and a storage directory of a log file is realized.
Step 303: and analyzing the log file to obtain an execution result of at least one target function item of the OCR application in the OCR recognition process.
The tested OCR application is obtained by performing instrumentation and compilation on the test instrumentation code and the code of the OCR application, and in the instrumentation process, the cut-in point of the test instrumentation code corresponds to each function item of the OCR application, so that the obtained log file is analyzed, and the execution result of at least one target function item can be obtained. And after the log file is obtained, analyzing the log file to obtain an execution result of at least one target function item of the OCR application in the OCR recognition process.
Here, the Web test management platform deployed on the terminal side may complete analysis of the log file by cooperating with the Web management server in the background, for example, by calling a log analysis unit of the Web management server.
In some embodiments, after the execution result of the target function item of the OCR application is obtained, the execution result may be stored in the storage directory corresponding to the task identifier of the test task at this time; meanwhile, the storage format of the execution result of the target function item can be kept consistent with that of the target execution result, so that the subsequent matching of the result is facilitated.
Step 304: and matching the execution result of the target function item with the corresponding target execution result to obtain a matching result.
And after the execution result of at least one target function item is obtained, analyzing the execution accuracy of the target function item. And respectively matching the obtained execution results of the target function items with the corresponding target execution results to obtain a matching result representing the execution accuracy of the corresponding target function items in the OCR recognition process.
In actual implementation, the Web test management platform deployed at the terminal side may cooperate with the We b management server at the background to complete generation of the matching result, for example, by calling a hierarchical index calculation and analysis unit of the Web management server, where the hierarchical index calculation and analysis unit is used to match the execution result with the target execution result to generate a corresponding matching result.
In practical application, the target execution result is the real content corresponding to the target test sample, and each target test sample can be labeled in a manner of manual labeling, machine labeling, and the like to obtain the target execution result corresponding to each target test sample, for example, for the target test sample, the corresponding text content, the position of a text area, and the like can be labeled to serve as the target execution result corresponding to the target test sample. When the execution result of the target function item is matched with the target execution result, the matching content and the matching mode can be set according to the requirement. Exemplarily, if the target function item is a text box position detection function item, the text box position may be set as the matching content, and the matching degree of the text box position corresponding to the execution result and the target execution result is calculated; if the target function item is a character recognition function item, the character content can be set as matching content, the character content of the execution result is compared with the character content of the target execution result, and the difference degree of the two is determined.
In some embodiments, when the number of the target function items is at least two and the number of the target test samples is at least two, respectively counting matching results of the at least two target test samples corresponding to each target function item; obtaining the standard reaching rate corresponding to each target function item based on the matching result of at least two target test samples corresponding to each target function item; and generating a test result corresponding to the OCR application based on the standard reaching rate of each target function item, wherein the test result is used for representing the execution accuracy corresponding to the OCR application.
When the terminal sends an OCR application test request, the terminal may send a plurality of target test samples, and specifically, one OCR application test request may carry one target test sample, and a plurality of test requests may be sent in sequence; it is also possible to carry multiple target test samples simultaneously in one OCR application test request.
And after receiving the target test samples, the tested OCR application server runs an OCR application to perform OCR recognition on the target test samples and generate corresponding log files. Meanwhile, a plurality of target function items may be provided.
Analyzing and obtaining the execution result of each target function item based on the generated log file; and respectively matching the execution result of each target function item with the corresponding target execution result to obtain the matching result of each target supply item corresponding to a plurality of target test samples.
And calculating the standard reaching rate corresponding to each target function item according to the matching result of the target function item corresponding to the target test samples. In practical application, the standard reaching rate may be the number of target test samples corresponding to the successful output execution result of each target function item, which is a proportion of the total number of the target test samples; the number of the corresponding target test samples, the proportion of the target test samples in the total number of the target test samples and the like can also be obtained, wherein the matching degree of the execution result and the target execution result reaches a preset matching degree threshold value. The standard related to the calculation of the achievement ratio can be set according to needs, and is not limited in the embodiment of the invention.
Exemplarily, referring to fig. 5, fig. 5 is a schematic diagram of the achievement ratio of each target function item of the OCR application provided by the embodiment of the present invention. Here, the achievement rates corresponding to the two classification function items, the rotation function item, and the target area detection function item are all 100%, and the achievement rate corresponding to the character recognition function item is 96.57%.
And generating a test result corresponding to the OCR application test based on the standard reaching rate of each target function item, wherein the test result is used for representing the execution accuracy corresponding to the OCR application.
In some embodiments, for each target test sample, the execution result, the matching result between the execution result and the target execution result, and the standard reaching rate and the test result of the target function item corresponding to the target test sample are respectively stored in the MySQL database.
In practical application, the execution result, the matching result, the standard reaching rate, the test result and the like obtained in the OCR recognition process of each target test sample can be stored in a database for use in subsequent analysis or test report generation. In practical application, the database can be a MySQL database, and the MySQL database can be used for facilitating quick query and call in subsequent use.
In some embodiments, the test results of the OCR application described above may be presented as follows: presenting a test result corresponding to the OCR application through a view interface, wherein the view interface comprises a viewing button for viewing the matching result details corresponding to each target function item; and presenting the matching result details of the corresponding target function item in response to the clicking operation of the view button.
After the test result is obtained, the terminal can present the test result corresponding to the OCR application on a view interface through the set Web test management platform. Meanwhile, the view interface also comprises a view button for viewing the matching result details of each functional item, and a tester can trigger a matching result detail viewing instruction by clicking the view button; and the terminal responds to the clicking operation aiming at the viewing button and presents the matching result of the selected target function item.
Here, the matching result details include at least one of: and corresponding to the execution result and the target execution result of each target test sample, the matching result of the execution result and the target execution result of each target test sample, and the standard reaching rate of the target function item.
In practical applications, the view button presented in the view interface may correspond to each target function item, that is, each target function item corresponds to one view button, and in response to a click operation on the view button, only the details of the matching result of the target function item corresponding to the view button are presented; of course, the above-mentioned view button may also be of a corresponding OCR application, i.e., in response to a click operation for the view button, the matching result details of each target function item of the O CR application are presented.
Illustratively, referring to fig. 6, fig. 6 is a schematic illustration showing a test result provided by the embodiment of the present invention, where the view buttons presented by the view interface all correspond to the OCR application, that is, correspond to the execution result of each target function item obtained by the test task for the OC R application each time. Each test task corresponds to a task identifier, execution time, task state and the like, and is provided with a view button, such as a 'layered result' shown in fig. 6, and the terminal responds to the click operation of the view button for the 'layered result' and presents details of a matching result obtained in the test process. Referring to fig. 7, fig. 7 is a schematic diagram illustrating details of a matching result provided in an embodiment of the present invention, where the details of the matching result include an execution result, a target execution result, a matching result, and a standard reaching rate of target function items corresponding to each target test sample. As shown in fig. 7, the first layer is a binary function item, and the lower side correspondingly displays the execution result and the target execution result of the binary function item; the third layer is a target area detection function item, the lower side correspondingly displays an execution result and a target execution result output by the target area detection function item, and simultaneously displays a matching result of the target function item, wherein the matching result can be the matching degree of an area frame corresponding to the target area detection.
In some implementations, in generating test results for a corresponding OCR application, an OCR application test log is generated; the OCR application test log is used for positioning a corresponding failure reason when the test result is failed to generate.
In practical application, data generated in the steps from creation of a test task to execution of the test task, checking details of matching results and the like can be recorded, an OCR application test log is generated in the test process, and the OCR application test log specifically comprises execution time and execution steps of the test task and execution units corresponding to the execution steps.
By applying the embodiment of the invention, the execution result of at least one target function item of the OCR application is obtained by analyzing the log file generated by OCR recognition of the target test sample by the OCR application, and the execution result of at least one target function item is respectively matched with the corresponding target execution result, so that the matching result representing the execution accuracy of the target function item in the OCR recognition process is obtained; therefore, the execution accuracy corresponding to each target function item of the OCR application in the testing process can be obtained, and the accuracy of the OCR application testing is further improved.
In some embodiments, after the Web test management platform matches the execution result of the target function item with the corresponding target execution result to obtain the matching result of each target function item of the OCR application, the Web test management platform may further store the matching result in the blockchain network in combination with a blockchain technique, so that when the test result of the corresponding OCR application is generated, the matching result of each target function item of the OCR application can be directly obtained from the blockchain network.
Here, the Web test management platform generates a transaction for storing a matching result after matching the execution result of the target function item with the corresponding target execution result to obtain the matching result of each target function item applied by the OCR, and sends the generated transaction to a node of the blockchain network, so that the node recognizes the transaction and stores the matching result to the blockchain network; therefore, when a test result corresponding to the OCR application is generated, the matching result of each target function item of the OCR application is obtained from the block chain network, the standard reaching rate of each target function item is further determined, and the test result corresponding to the OCR application is generated.
Next, a block chain network according to an embodiment of the present invention will be described. Fig. 8 is a schematic application architecture diagram of a blockchain network according to an embodiment of the present invention, which includes a service agent 50, an authentication center 70, and a blockchain network 80 (exemplarily illustrating a consensus node 81-1 to a consensus node 81-3), which are described below.
The type of blockchain network 80 is flexible and may be, for example, any of a public chain, a private chain, or a federation chain. Taking the public link as an example, electronic devices of any business entity, such as user terminals and servers, can access the blockchain network 80 without authorization; taking a federation chain as an example, an electronic device (e.g., a terminal/server) under the jurisdiction of a service entity after obtaining authorization may access the blockchain network 80, and at this time, become a client node in the blockchain network 80.
In some embodiments, the client node may act as a mere watcher of the blockchain network 80, i.e., provides functionality to support the business entity to initiate transactions (e.g., for uplink storage of data or querying of data on the chain), and may be implemented by default or selectively (e.g., depending on the specific business requirements of the business entity) with respect to the functions of the consensus node 81 of the blockchain network 80, such as a ranking function, a consensus service, and an accounting function, etc. Therefore, the data and the service processing logic of the service subject can be migrated to the block chain network 80 to the maximum extent, and the credibility and traceability of the data and service processing process are realized through the block chain network 80.
Consensus nodes in blockchain network 80 receive transactions submitted by client nodes (e.g., client nodes 51 belonging to business entity 50) from different business entities (e.g., business entity 50), execute the transactions to update the ledger or query the ledger, and various intermediate or final results of executing the transactions may be returned to the business entity's client nodes for display.
An exemplary application of the blockchain is described below by taking an example that a service agent accesses a blockchain network to achieve acquisition of a matching result.
Referring to fig. 8, the test of the optical character recognition application involves the service entity 50 registering with the certificate authority 70 to obtain a digital certificate including the public key of the service entity and a digital signature signed by the certificate authority 70 on the public key and identity information of the service entity, for attaching to the transaction together with the digital signature of the service entity for the transaction, and sending to the blockchain network, for the blockchain network to take the digital certificate and signature from the transaction, verify the authenticity of the message (i.e., whether it has been tampered with) and the identity information of the service entity sending the message, and verify the identity of the blockchain network, for example, whether it has the right to initiate the transaction. Clients running on electronic devices (e.g., terminals or servers) hosted by the business entity may request access from the blockchain network 80 to become client nodes.
The client node 51 of the service agent 50 is configured to generate a transaction for acquiring the matching result stored in the blockchain when generating the test result of the corresponding OCR application, specify an intelligent contract to be called for implementing the acquiring operation of the matching result and parameters passed to the intelligent contract in the transaction, and broadcast the transaction to the consensus node in the blockchain network 80, wherein the transaction also carries the digital certificate of the client node 51, the signed digital signature (for example, obtained by encrypting the digest of the transaction using a private key in the digital certificate of the client node 51).
When the consensus node in the blockchain network 80 receives the transaction, the digital certificate and the digital signature carried by the transaction are verified, after the verification is successful, whether the service agent 50 has the transaction right or not is determined according to the identity of the service agent 50 carried in the transaction, and the transaction failure is caused by any verification judgment of the digital signature and the right verification. After successful verification, the node's own digital signature (e.g., encrypted using the private key of the consensus node 81-1) is signed and broadcast on the blockchain network 80.
After the consensus node in the blockchain network 80 receives the transaction successfully verified, the transaction is filled into a new block and broadcast. When a new block is broadcasted by a consensus node in the block chain network 80, a consensus process is performed on the new block, if the consensus is successful, the new block is added to the tail of the block chain stored in the new block, the state database is updated according to the transaction result, and the transaction in the new block is executed: and for the submitted transaction for acquiring the second card data signature, inquiring a key value pair corresponding to the second card data signature from the state database, and returning a transaction result.
As an example of a block chain, referring to fig. 9, fig. 9 is a schematic structural diagram of a block chain in a block chain network 80 according to an embodiment of the present invention, where a header of each block may include hash values of all transactions in the block and also include hash values of all transactions in a previous block, a record of a newly generated transaction is filled in the block and is added to a tail of the block chain after being identified by nodes in the block chain network, so as to form a chain growth, and a chain structure based on hash values between blocks ensures tamper resistance and forgery prevention of transactions in the block.
An exemplary functional architecture of a block chain network provided in the embodiment of the present invention is described below, and referring to fig. 10, fig. 10 is a schematic functional architecture diagram of a block chain network 80 provided in the embodiment of the present invention, which includes an application layer 1, a consensus layer 2, a network layer 3, a data layer 4, and a resource layer 5, which are described below respectively.
The resource layer 5 encapsulates the computational, memory and communication resources that implement each node 81 in the blockchain network 80.
The data layer 4 encapsulates various data structures that implement the ledger, including blockchains implemented as files in a file system, key-value type state databases, and presence certificates (e.g., hash trees of transactions in blocks).
The network layer 3 encapsulates the functions of a Point-to-Point (P2P) network protocol, a data propagation mechanism and a data verification mechanism, an access authentication mechanism and service body identity management.
Wherein, the P2P network protocol implements communication between nodes 81 in the blockchain network 80, the data propagation mechanism ensures propagation of transactions in the blockchain network 80, and the data verification mechanism is used for implementing reliability of data transmission between the nodes 81 based on cryptography methods (such as digital certificates, digital signatures, public/private key pairs); the access authentication mechanism is used for authenticating the identity of the service subject added into the block chain network 80 according to the actual service scene, and endowing the service subject with the authority of accessing the block chain network 80 when the authentication is passed; the business entity identity management is used to store the identity of the business entity that is allowed to access blockchain network 80, as well as the permissions (e.g., the types of transactions that can be initiated).
Consensus layer 2 encapsulates the functions of a mechanism for nodes 81 in the blockchain network 80 to agree on a block (i.e., a consensus mechanism), transaction management, and ledger management. The consensus mechanism comprises consensus algorithms such as POS, POW and DPOS, and the pluggable consensus algorithm is supported.
The transaction management is used for verifying the digital signature carried in the transaction received by the node 81, verifying the identity information of the service body, and determining whether the service body has the authority to perform the transaction (reading the relevant information from the identity management of the service body) according to the identity information; for the service entities authorized to access the blockchain network 80, the service entities have digital certificates issued by the certificate authority, and the service entities sign the submitted transactions by using the private keys in the digital certificates of the service entities, so as to declare the legal identities of the service entities.
The ledger administration is used to maintain blockchains and state databases. For the block with the consensus, adding the block to the tail of the block chain; executing the transaction in the acquired consensus block, updating the key-value pairs in the state database when the transaction comprises an update operation, querying the key-value pairs in the state database when the transaction comprises a query operation and returning a query result to the client node of the business entity. Supporting query operations for multiple dimensions of a state database, comprising: querying the chunk based on the chunk sequence number (e.g., hash value of the transaction); inquiring the block according to the block hash value; inquiring a block according to the transaction serial number; inquiring the transaction according to the transaction serial number; inquiring account data of a business main body according to an account (serial number) of the business main body; and inquiring the block chain in the channel according to the channel name.
The application layer 1 encapsulates various services that can be implemented by the blockchain network, including tracing, crediting, and verifying transactions.
An exemplary application of the embodiments of the present invention in a practical application scenario will be described below. Referring to fig. 11, fig. 11 is a schematic structural diagram of implementing an OCR application test based on a Web test management platform according to an embodiment of the present invention. The system comprises a Web management server, and the visualization of an OCR application test can be realized through a Web test management platform arranged on a front terminal; the system also comprises a tested OCR application server which is deployed with the OCR application processed by the code instrumentation.
Specifically, the Web management server includes a data layer, an application layer, and a presentation layer. The data layer is used for storing a test sample, execution results of each target function item (such as execution results of the two classification function items), target execution results (such as correct recognition results of the character recognition function items), generated test log files and the like; the application layer is used for creating an OCR application test task, sending a test request, analyzing a log file, generating a matching result and the like; the display layer is used for displaying a test result, a test task creation interface and the like, and can be displayed through a Web test management platform arranged at a front end terminal of a Web management server.
The OCR application server to be tested is deployed with an OCR application subjected to code instrumentation processing, wherein the code instrumentation processing can be performed on the code of the OCR application based on a pre-written test instrumentation program, and the OCR application is obtained by compiling; when receiving an OCR application test request, the tested OCR application server runs an OCR application, performs OCR recognition on a target test sample, generates a log file, and enables a Web management server to acquire the log file in a server file directory mapping mode.
In the embodiment of the present invention, the OCR application is formed by a plurality of algorithm modules, and corresponds to a plurality of function items in the embodiment of the present invention, specifically, as shown in fig. 4, the OCR application includes a two-classification algorithm, a rotation algorithm, a target area detection algorithm, a text box position detection algorithm, and a character recognition algorithm; the method comprises the steps of respectively corresponding to a binary classification function item, a rotation function item, a target area detection function item, a text box position detection function item and a character recognition function item of the OCR application.
Next, by taking an example that the Web test management platform implements an OCR application test, a method for testing an optical character recognition application provided by the embodiment of the present invention is continuously described with reference to fig. 11. Referring to fig. 12, fig. 12 is a schematic flowchart of a method for testing an optical character recognition application according to an embodiment of the present invention, where the method for testing an optical character recognition application according to an embodiment of the present invention includes:
step 1201: and the Web test management platform responds to a test task creating instruction of the OCR application and presents a test sample and a selection interface of the functional items of the OCR application through a view interface.
Here, the Web test management platform may be constructed based on a Web application framework with a Django open source;
before the test task is created, the Web test management platform stores a large number of test samples and corresponding target execution results through a MySQL database of a Web management server data layer as shown in fig. 11. Specifically, the file storage formats and file names of the test sample and the target execution result need to be consistent one to one, and for example, the test sample and the target execution result can be stored in JSON, XML, and other formats. For example, the target execution result of the test sample may be stored as follows:
Filename:“D:\effect_test\yidai\LINheng\LINheng0.jpg”;
direction:“0”;
valid:“0”;
wherein D, \\ effect _ test \ yidai \ LINheng0.jpg is a storage path and a file name of the test sample, and the direction represents a target execution result of the rotation function item; valid represents the target execution result of the two-class function item. Other test samples and corresponding target execution results are also stored in a unified manner.
Step 1202: and determining the selected target test sample and the target function item.
Step 1203: based on the target test sample and the target function item, a test task of the OCR application is created.
Here, the Web test management platform may create a test task of the OCR application by calling a task flow management unit of the Web management server application layer as shown in fig. 11; meanwhile, the test task can be inquired, modified and the like;
and when the test tasks are created, task identifiers corresponding to the test tasks can be generated, so that different test tasks are identified under the condition of a large number of test tasks.
Step 1204: and responding to the test task running instruction, and sending an OCR application test request.
Here, the OCR application test request carries the selected target test sample; specifically, sending of the OCR application test request may be realized by calling a package sending management unit of the Web management server application layer.
Step 1205: and the tested OCR application server runs the OCR application and performs the O CR recognition on the target test sample to obtain the execution result of the target function item.
Step 1206: and generating a log file containing the execution result of each target function item and storing the log file in a storage directory.
Step 1207: and the Web test management platform acquires the log file from the target directory.
Here, the target directory and the storage directory of the log file are mapped, and the Web test management platform may obtain the log file from the target directory by calling a log management unit of a data layer of the Web management server.
Step 1208: and analyzing the log file to obtain the execution result of the target function item.
Here, the Web test management platform may analyze the log file stored by the log management unit by calling the log analysis unit of the Web management server application layer. Specifically, the log file may be analyzed according to a rule of code instrumentation to obtain an execution result corresponding to each target function item;
meanwhile, the execution result obtained by analysis can be stored in a storage directory of the task identifier corresponding to the test task; specifically, the storage formats of the execution result and the target execution result may be set to be the same, so as to facilitate subsequent matching calculation of the execution result.
Step 1209: and matching the execution result of the target function item with the corresponding target execution result.
Here, the Web test management platform may obtain the execution accuracy of the corresponding target function item in the OCR recognition process by calling a hierarchical index calculation unit of the Web management server application layer to compare the execution result with the corresponding target execution result.
Step 1210: and counting the matching results of the target function items corresponding to the target test samples to obtain the standard reaching rate of the target function items.
Here, the hierarchical index calculation unit implementation of the Web management server application layer may also be invoked. The standard reaching rate of each target function item may be the number of the corresponding target test samples of the recognition result obtained for the recognition of the target test sample in each target function item, and the proportion of the number of the corresponding target test samples to the total number of the target test samples.
Step 1211: and generating a test result based on the matching result and the standard reaching rate of the target function item.
Here, the Web test management platform may store the test result in an M ySQL database of the Web management server data layer.
Step 1212: and presenting the test result through the view interface.
Step 1213: and presenting the matching result details of the target function item in response to the clicking operation of the view button.
Here, the matching result details include: and corresponding to the execution result and the target execution result of each target test sample, the matching result of the execution result and the target execution result of each target test sample, and the standard reaching rate of the target function item.
Step 1214: and generating a test log file in the OCR application test process.
The Web test management platform can integrate data generated from steps of newly building a test task, executing the test task, checking details of a matching result and the like in the OCR application test process by calling a log management unit of a Web management server data layer to generate a test log file so as to quickly locate the cause when a problem occurs in the test process.
Next, taking an OCR application as a certificate OCR application as an example, the testing method of the optical character recognition application provided in the embodiment of the present invention is continuously described, referring to fig. 13, where fig. 13 is a schematic flow chart of the testing method of the certificate OCR application provided in the embodiment of the present invention, and includes:
step 1301: and the Web test management platform responds to a test task creating instruction of the certificate OCR application and presents a certificate test sample and a selection interface of the functional items of the certificate OCR application through a view interface.
Here, the credential test sample includes images of a variety of credentials, which can be stored in a JPG format, such as identity credentials, driving credentials, and the like.
Step 1302: and determining the selected target certificate test sample and the target function item, and creating a test task of the certificate OC R application.
Here, the target credential test sample and the target function item may each be at least two.
Step 1303: and responding to the test task running instruction, and sending a certificate OCR application test request.
Here, the OCR application test request carries the selected target credential test sample.
Step 1304: and the tested OCR application server runs the certificate OCR application, performs OCR recognition on the target certificate test sample, generates a log file and stores the log file.
Step 1305: and the Web test management platform acquires and analyzes the log file to obtain an execution result.
Here, the execution result includes the execution result of each of the selected target function items, such as a text box position detection function item, a character recognition function item, and the like.
Specifically, referring to fig. 14, fig. 14 is a schematic diagram illustrating an execution result of a target function item of the certificate OCR application according to the embodiment of the present invention. Here, the target document test sample is an identity document, and the execution result of the text recognition function item output may be a name: ruxx, sex: male, year and month of birth: xxxx year xx month, etc. The execution result of the text box position detection function item output may be a portion as shown by a dotted line box in fig. 14.
Step 1306: and matching the execution result of the target function item with the corresponding target execution result.
Here, the certificate OCR application matches the recognition result (execution result of the target function item) of each certificate test sample with the true content (target execution result) marked on the certificate test sample to obtain a matching result.
Step 1307: and counting the matching results of the target function items corresponding to the target certificate test samples to obtain the standard reaching rate of the target function items.
Step 1308: and generating a test result of the certificate OCR application based on the matching result and the standard reaching rate of the target function item.
Step 1309: and presenting the test result through the view interface.
Step 1310: and presenting the matching result details of the target function item in response to the clicking operation of the view button.
Continuing with the description of the testing apparatus 255 for optical character recognition applications provided in the embodiments of the present invention, in some embodiments, the testing apparatus for optical character recognition applications may be implemented as a software module. Referring to fig. 15, fig. 15 is a schematic structural diagram of a testing apparatus 255 for optical character recognition application according to an embodiment of the present invention, where the testing apparatus 255 for optical character recognition application according to an embodiment of the present invention includes:
a sending module 2551, configured to send an OCR application test request including a target test sample;
an obtaining module 2552, configured to, when it is monitored that a target directory includes a log file, obtain the log file based on the target directory; the target directory and a storage directory of the log file are established with a mapping relation, and the log file is obtained by running the OCR application and performing optical character recognition on the target test sample;
an analysis module 2553, configured to analyze the log file, so as to obtain an execution result of at least one target function item of the OCR application in the OCR recognition process;
a matching module 2554, configured to match the execution result of the at least one target function item with the corresponding target execution result, respectively, to obtain a matching result, where the matching result is used to characterize the execution accuracy of the corresponding target function item in the OCR recognition process.
In some embodiments, the apparatus further comprises:
the code instrumentation module is used for acquiring a test instrumentation code, and an entry point of the test instrumentation code corresponds to each function item of the OCR application so as to output an execution result of the corresponding function item at the entry point;
performing code instrumentation on the code of the OCR application to be tested based on the test instrumentation code to obtain an instrumented OCR application code;
compiling the instrumented OCR application code to obtain the OCR application.
In some embodiments, the apparatus further comprises:
the task creating module is used for responding to a test task creating instruction aiming at the OCR application and presenting a test sample and a selection interface of a functional item of the OCR application;
determining the selected target test sample and the at least one target function item based on the selection interface;
and responding to a test task generation instruction, and creating a test task corresponding to the OCR application based on the selected target test sample and the at least one target function item, wherein the test task triggers sending of the OCR application test request during execution.
In some embodiments, the apparatus further comprises:
the establishing module is used for establishing a mapping relation between the target directory and a storage directory of the log file;
and the mapping relation is used for mapping the corresponding storage directory to the target directory after the log file is stored, so that the storage directory of the log file is directionally accessed by accessing the target directory.
In some embodiments, the matching module is further configured to, when the number of the target function items is at least two and the number of the target test samples is at least two, respectively count matching results of the at least two target test samples corresponding to each of the target function items;
obtaining the standard reaching rate corresponding to each target function item based on the matching result of the at least two target test samples corresponding to each target function item;
and generating a test result corresponding to the OCR application based on the standard reaching rate of each target function item, wherein the test result is used for representing the execution accuracy corresponding to the OCR application.
In some embodiments, the apparatus further comprises:
the viewing module is used for presenting the testing result corresponding to the OCR application through a view interface, and the view interface comprises a viewing button used for viewing the matching result details corresponding to each target function item;
in response to a click operation on the view button, presenting matching result details of the corresponding target function item, the matching result details including at least one of:
and corresponding to the execution result and the target execution result of each target test sample, the matching result of the execution result and the target execution result of each target test sample, and the standard reaching rate of the target function item.
In some embodiments, the apparatus further comprises: the storage module is used for respectively storing an execution result of a target function item corresponding to each target test sample, a matching result of the execution result and a target execution result, a standard reaching rate of the target function item and the test result in a MyS QL database;
wherein the target function item comprises at least one of:
the system comprises a classification function item, a rotation function item, a target area detection function item, a text box position detection function item and a character recognition function item.
In some embodiments, the matching module 2554 is further configured to generate an OCR application test log in the process of generating a test result corresponding to the OCR application; and the OCR application test log is used for positioning a corresponding failure reason when the test result is failed to generate.
An embodiment of the present invention further provides an electronic device, where the electronic device includes:
a memory for storing executable instructions;
and the processor is used for realizing the testing method of the optical character recognition application provided by the embodiment of the invention when the executable instructions stored in the memory are executed.
The embodiment of the invention also provides a storage medium, which stores executable instructions, and when the executable instructions are executed by a processor, the testing method for the optical character recognition application provided by the embodiment of the invention is realized.
In some embodiments, the storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EE PROM, flash, magnetic surface memory, optical disk, or CD-ROM; or may be various devices including one or any combination of the above memories.
In some embodiments, executable instructions may be written in any form of programming language (including compiled or interpreted languages), in the form of programs, software modules, scripts or code, and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine, or other unit suitable for use in a computing environment.
By way of example, executable instructions may correspond, but do not necessarily have to correspond, to files in a file system, and may be stored in a portion of a file that holds other programs or data, such as in one or more scripts in a hypertext Markup Language (H TML) document, in a single file dedicated to the program in question, or in multiple coordinated files (e.g., files that store one or more modules, sub-programs, or portions of code).
By way of example, executable instructions may be deployed to be executed on one computing device or on multiple computing devices at one site or distributed across multiple sites and interconnected by a communication network.
The above description is only an example of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, and improvement made within the spirit and scope of the present invention are included in the protection scope of the present invention.

Claims (11)

1. A method for testing an optical character recognition application, the method comprising:
sending an optical character recognition application test request containing a target test sample;
responding to the test request, running the optical character recognition application subjected to code instrumentation processing, and performing optical character recognition on the target test sample to obtain a log file corresponding to the target test sample;
the code instrumentation processing is used for integrating a test instrumentation code with a code of the optical character recognition application to be tested; the test plug-in code is a code corresponding to each function item of the optical character recognition application at the cut-in point and is used for outputting an execution result of the corresponding function item at the cut-in point;
the function items comprise at least one of a two-classification function item corresponding to a two-classification algorithm, a rotation function item corresponding to a rotation algorithm, a target area detection function item corresponding to a target area detection algorithm, a text box position detection function item corresponding to a text box position detection algorithm and a character recognition function item corresponding to a character recognition algorithm;
storing the log file to a preset storage directory, and
mapping the log file from the storage directory to a target directory; the target directory and the storage directory are established with a mapping relation;
when the target directory is monitored to contain the log file, the log file is obtained based on the target directory;
analyzing the log file to obtain an execution result of at least one target function item of the optical character recognition application in the optical character recognition process;
and respectively matching the execution result of the at least one target function item with the corresponding target execution result to obtain a matching result, wherein the matching result is used for representing the execution accuracy of the corresponding target function item in the optical character recognition process.
2. The method of claim 1, wherein prior to sending the optical character recognition application test request containing the target test sample, the method further comprises:
acquiring a test instrumentation code;
performing code instrumentation on codes of the optical character recognition application to be tested based on the test instrumentation codes to obtain instrumented optical character recognition application codes;
compiling the inserted optical character recognition application code to obtain the optical character recognition application.
3. The method of claim 1, wherein prior to sending the optical character recognition application test request containing the target test sample, the method further comprises:
responding to a test task creation instruction aiming at the optical character recognition application, and presenting a test sample and a selection interface of a functional item of the optical character recognition application;
determining the selected target test sample and the at least one target function item based on the selection interface;
and responding to a test task generation instruction, and creating a test task corresponding to the optical character recognition application based on the selected target test sample and the at least one target function item, wherein the test task triggers the sending of the test request of the optical character recognition application when being executed.
4. The method of claim 1, wherein prior to the retrieving the log file based on the target directory, the method further comprises:
establishing a mapping relation between the target directory and a storage directory of the log file;
and the mapping relation is used for directionally accessing the storage directory of the log file by accessing the target directory.
5. The method of claim 1, wherein the method further comprises:
when the number of the target function items is at least two and the number of the target test samples is at least two, respectively counting the matching results of the at least two target test samples corresponding to each target function item;
obtaining the standard reaching rate corresponding to each target function item based on the matching result of the at least two target test samples corresponding to each target function item;
and generating a test result corresponding to the optical character recognition application based on the standard reaching rate of each target function item, wherein the test result is used for representing the execution accuracy corresponding to the optical character recognition application.
6. The method of claim 5, wherein the method further comprises:
presenting a test result corresponding to the optical character recognition application through a view interface, wherein the view interface comprises a viewing button for viewing the matching result details corresponding to each target function item;
in response to a click operation on the view button, presenting matching result details of the corresponding target function item, the matching result details including at least one of:
and corresponding to the execution result and the target execution result of each target test sample, the matching result of the execution result and the target execution result of each target test sample, and the standard reaching rate of the target function item.
7. The method of claim 1 or 5, wherein the method further comprises:
aiming at each target test sample, respectively storing an execution result of a target function item corresponding to the target test sample, a matching result of the execution result and a target execution result, and a standard reaching rate and a test result of the target function item in a MySQL database;
wherein the target function item comprises at least one of:
the system comprises a classification function item, a rotation function item, a target area detection function item, a text box position detection function item and a character recognition function item.
8. The method of claim 5, wherein the method further comprises:
generating an optical character recognition application test log in the process of generating a test result corresponding to the optical character recognition application; and the optical character recognition application test log is used for positioning a corresponding failure reason when the test result is failed to generate.
9. A test apparatus for optical character recognition applications, the apparatus comprising:
the sending module is used for sending an optical character recognition application test request containing a target test sample;
the acquisition module is used for responding to the test request, running the optical character recognition application subjected to code instrumentation processing, and carrying out optical character recognition on the target test sample to obtain a log file corresponding to the target test sample; the code instrumentation processing is used for integrating a test instrumentation code with a code of the optical character recognition application to be tested; the test plug-in code is a code corresponding to each function item of the optical character recognition application at the cut-in point and is used for outputting an execution result of the corresponding function item at the cut-in point; the function items comprise at least one of a two-classification function item corresponding to a two-classification algorithm, a rotation function item corresponding to a rotation algorithm, a target area detection function item corresponding to a target area detection algorithm, a text box position detection function item corresponding to a text box position detection algorithm and a character recognition function item corresponding to a character recognition algorithm; storing the log file to a preset storage directory, and mapping the log file from the storage directory to a target directory; the target directory and the storage directory are established with a mapping relation; when the target directory is monitored to contain the log file, the log file is obtained based on the target directory;
the analysis module is used for analyzing the log file to obtain an execution result of at least one target function item of the optical character recognition application in the optical character recognition process;
and the matching module is used for respectively matching the execution result of the at least one target function item with the corresponding target execution result to obtain a matching result, and the matching result is used for representing the execution accuracy of the corresponding target function item in the optical character recognition process.
10. A storage medium storing executable instructions which, when executed by a processor, implement a method of testing an optical character recognition application according to any one of claims 1 to 8.
11. An electronic device, characterized in that the electronic device comprises:
a memory for storing executable instructions;
a processor for implementing a method of testing an optical character recognition application according to any one of claims 1 to 8 when executing executable instructions stored in the memory.
CN201911327880.2A 2019-12-20 2019-12-20 Method and device for testing optical character recognition application and storage medium Active CN111078569B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911327880.2A CN111078569B (en) 2019-12-20 2019-12-20 Method and device for testing optical character recognition application and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911327880.2A CN111078569B (en) 2019-12-20 2019-12-20 Method and device for testing optical character recognition application and storage medium

Publications (2)

Publication Number Publication Date
CN111078569A CN111078569A (en) 2020-04-28
CN111078569B true CN111078569B (en) 2022-01-18

Family

ID=70316599

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911327880.2A Active CN111078569B (en) 2019-12-20 2019-12-20 Method and device for testing optical character recognition application and storage medium

Country Status (1)

Country Link
CN (1) CN111078569B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111640053B (en) * 2020-06-02 2023-04-18 长江师范学院 Homomorphic encryption algorithm based reversible information hiding method with high embedding amount

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109840212A (en) * 2019-02-19 2019-06-04 百度在线网络技术(北京)有限公司 Function test method, device, equipment and the readable storage medium storing program for executing of application program
CN110245576A (en) * 2019-05-21 2019-09-17 深圳壹账通智能科技有限公司 Detection method, device, equipment and the storage medium of OCR recognition accuracy
CN110458184A (en) * 2019-06-26 2019-11-15 平安科技(深圳)有限公司 Optical character identification householder method, device, computer equipment and storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109840212A (en) * 2019-02-19 2019-06-04 百度在线网络技术(北京)有限公司 Function test method, device, equipment and the readable storage medium storing program for executing of application program
CN110245576A (en) * 2019-05-21 2019-09-17 深圳壹账通智能科技有限公司 Detection method, device, equipment and the storage medium of OCR recognition accuracy
CN110458184A (en) * 2019-06-26 2019-11-15 平安科技(深圳)有限公司 Optical character identification householder method, device, computer equipment and storage medium

Also Published As

Publication number Publication date
CN111078569A (en) 2020-04-28

Similar Documents

Publication Publication Date Title
CN111416704B (en) Data processing method, device and system based on block chain
AU2020261982B2 (en) Extracting data from a blockchain network
US11063744B2 (en) Document flow tracking using blockchain
US11853457B2 (en) Selectively verifying personal data
CN111177252B (en) Service data processing method and device
US11163906B2 (en) Adaptive redaction and data releasability systems using dynamic parameters and user defined rule sets
US20230334041A1 (en) Systems and methods for writing updates to and/or reading previously stored updates of assets implemented as smart contracts on a decentralized database
CN112506747B (en) Business process monitoring method and device, electronic equipment and storage medium
US20180054438A1 (en) Proxy service for uploading data from a source to a destination
US11316669B2 (en) Audit result data storage method and device, audit result data query method and device, and audit item storage method and device
CN110556171B (en) Medical data management method and device, node of block chain network and storage medium
CN110597908A (en) Credit investigation recording method, device and storage medium based on block chain
CN111638908A (en) Interface document generation method and device, electronic equipment and medium
WO2022095518A1 (en) Automatic interface test method and apparatus, and computer device and storage medium
CN112070608A (en) Information processing method, information processing apparatus, information processing medium, and electronic device
WO2022142536A1 (en) Grayscale publishing method, system and apparatus, and device and storage medium
CN111078569B (en) Method and device for testing optical character recognition application and storage medium
CN110555482A (en) Vulgar picture identification method and device based on artificial intelligence and electronic equipment
CN112966304A (en) Method and device for preventing process document from being tampered, computer equipment and medium
CN112308238A (en) Analytical model training method and device, electronic equipment and storage medium
CN112100534A (en) Information processing method, device, medium and electronic equipment in page sharing
US20220222367A1 (en) Data aggregation for analysis and secure storage
CN117499163B (en) WebRTC-based server remote maintenance method, system and equipment
US20230421570A1 (en) Accessing data on a blockchain with proof of data verification
CN113515438A (en) Test account management method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40022204

Country of ref document: HK

SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant