CN109656733B - Method and equipment for intelligently scheduling multiple OCR recognition engines - Google Patents

Method and equipment for intelligently scheduling multiple OCR recognition engines Download PDF

Info

Publication number
CN109656733B
CN109656733B CN201811615258.7A CN201811615258A CN109656733B CN 109656733 B CN109656733 B CN 109656733B CN 201811615258 A CN201811615258 A CN 201811615258A CN 109656733 B CN109656733 B CN 109656733B
Authority
CN
China
Prior art keywords
ocr
queue
file
ocr recognition
recognition engine
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
CN201811615258.7A
Other languages
Chinese (zh)
Other versions
CN109656733A (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.)
Xiamen Shangji Network Technology Co ltd
Original Assignee
Xiamen Shangji Network Technology 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 Xiamen Shangji Network Technology Co ltd filed Critical Xiamen Shangji Network Technology Co ltd
Priority to CN201811615258.7A priority Critical patent/CN109656733B/en
Publication of CN109656733A publication Critical patent/CN109656733A/en
Application granted granted Critical
Publication of CN109656733B publication Critical patent/CN109656733B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues

Abstract

The invention relates to a method for intelligently scheduling multiple OCR engines, which comprises the following steps: calling an OCR application interface to upload a file to be recognized, and specifying the type of the file to be recognized; determining the consumption types of OCR recognition engines for processing the file according to the type of the file to be recognized, wherein each OCR engine of the consumption type creates an OCR queue corresponding to the OCR engine, and the number of the OCR recognition engines of each consumption type is at least one; when a file to be recognized requests to enter an OCR queue of a corresponding OCR recognition engine, firstly executing overtime detection for judging whether the consumption type OCR recognition engine is overtime or not, if not, entering the corresponding OCR queue, if so, the file to be recognized cannot be queued and the user is informed. The invention has the advantages that: the advantages of the OCR recognition engines of various consumption types are fully utilized to achieve high-performance and high-accuracy recognition, and the OCR recognition engines are dispatched in order to prevent queue congestion, system errors and engine paralysis.

Description

Method and equipment for intelligently scheduling multiple OCR recognition engines
Technical Field
The invention relates to a method and equipment for intelligently scheduling multiple OCR recognition engines, belonging to the field of OCR recognition.
Background
There are many OCR recognition engines on the market at present, but the consumption types of each OCR recognition engine are different, that is, the points of attention of the various OCR recognition engines are different, some engines pay attention to recognizing full text, some engines pay attention to recognizing fragments, some engines pay attention to recognition accuracy, and some engines pay attention to recognition performance. When a batch of bill documents need to be processed simultaneously and contain both full text and fragments, how to make each type of bill enter a matched OCR recognition engine reasonably and orderly and prevent the recognition task from being crowded and the program from being wrong is a technical problem to be solved urgently.
Chinese invention patent publication No. CN106326741A, "malicious program detection method and apparatus based on multi-engine system", discloses: the multi-engine system comprises a plurality of engines, wherein each engine corresponds to a respective adept processing type, and the method comprises the following steps: analyzing the type of the program to be tested; determining a first engine adept to process the program to be tested according to the type of the program to be tested and the adept processing types corresponding to the plurality of engines; and detecting the program to be detected through the first engine, and taking a detection result of the first engine as a detection result of the multi-engine system on the program to be detected. The disclosed technical scheme only provides a first engine which is adept to process the program to be tested according to the type of the program to be tested and adept processing types corresponding to a plurality of engines, but does not provide how to process multi-type recognition texts in batches in order by the plurality of engines and ensure that the types of the recognition texts are matched with the types which are adept to be processed by an OCR recognition engine.
Disclosure of Invention
In order to solve the technical problems, the invention provides a method for intelligently scheduling multiple OCR engines, which classifies different types of files to be recognized into different OCR queues according to user requirements, then consumes related queue tasks according to the characteristics of each OCR recognition engine, fully utilizes the advantages of each OCR recognition engine, and simultaneously performs overtime judgment before the files to be recognized are queued to prevent the queues from being jammed, thereby achieving the recognition effect with high performance and high accuracy.
The first technical scheme of the invention is as follows:
a method of intelligently scheduling multiple OCR engines comprising the steps of: calling an OCR application interface to upload a file to be recognized, and specifying the type of the file to be recognized; determining the consumption types of OCR recognition engines for processing the file according to the type of the file to be recognized, wherein each OCR engine of the consumption type creates an OCR queue corresponding to the OCR engine, and the number of the OCR recognition engines of each consumption type is at least one; when a file to be recognized requests to enter an OCR queue of a corresponding OCR recognition engine, firstly executing overtime detection for judging whether the consumption type OCR recognition engine is overtime or not, if not, entering the corresponding OCR queue, if so, the file to be recognized cannot be queued and the user is informed.
More preferably, the timeout detection is: and comparing the estimated time consumption of the file to be recognized corresponding to any consumption type of OCR recognition engine with the preset task timeout time to obtain whether the OCR queue is overtime.
More preferably, the timeout detection is: the average time consumption of any consumption type of OCR recognition engine (the number of files to be recognized in the list of the OCR queues plus the minimum task number of the consumption type of OCR recognition engines) is obtained, the estimated time consumption of the consumption type of OCR recognition engines is obtained, and the estimated time consumption is compared with the preset task timeout time, so that whether the OCR queues are overtime is determined; and each OCR recognition engine correspondingly creates a task list, and the minimum task number value is in the task list corresponding to each OCR recognition engine of the same consumption type, and the task list with the minimum task number.
Preferably, the average time-consuming way of determining the OCR recognition engines of each consumption type is as follows: presetting an initial value by an OCR recognition engine of each consumption type; the method comprises the steps of periodically sampling recognition time consumption values of all OCR recognition engines in an A time period, then taking the recognition time consumption values of all OCR recognition engines in a B time period and the total number of recognition tasks, averaging to obtain the task time consumption values of all OCR recognition engines, taking the minimum task time consumption value as the minimum time consumption value of the OCR recognition engines of the consumption types in the OCR recognition engines of the same consumption types, finally comparing the minimum time consumption value with the preset initial value, taking the preset initial value as the average time consumption of the OCR recognition engines if the minimum time consumption value is larger than the preset initial value, and taking the minimum time consumption as the average time consumption of the OCR recognition engines if the minimum time consumption value is smaller than the preset initial value, wherein the A time period is smaller than the B time period.
Preferably, the method for intelligently scheduling multiple OCR engines further comprises creating an OCR queue consumer that continuously detects the OCR queue and continuously creates queue members into tasks, and then distributes to corresponding OCR recognition engines: acquiring numerical values of each OCR recognition engine, wherein each numerical value is a preset value; reading a list of OCR queues corresponding to the OCR recognition engines of the consumption types and version numbers of the list of the OCR queues, and determining the number of queue members which can be used for creating tasks in each OCR queue: if the number of the files to be identified in the OCR queue is larger than the value, the number of queue members which can be used for creating the task is equal to the value, otherwise, the number of queue members which can be used for creating the task is equal to the number of the files to be identified in the OCR queue; judging whether the load of an OCR recognition engine exceeds a preset maximum bearing range of the OCR recognition engine, wherein the load of the OCR recognition engine comprises the number of tasks in a task list of the OCR recognition engine and the number of queue members which can be used for creating the tasks, if so, the queue members are not created as the tasks, if not, checking whether the list version number of the OCR queue read by verification is consistent with the version number of the list of the current OCR queue, if so, updating the state of the queue members used for creating the tasks and the version number of the list of the current OCR queue, and if not, abandoning the created tasks; and acquiring the queue members in the updated state, and inserting the queue members into a task list of the OCR recognition engine in the form of tasks.
Preferably, the OCR recognition engines of each consumption type periodically perform said time-out detection to timely find out congestion problems.
Preferably, the method for intelligently scheduling multiple OCR engines further comprises a priority setting step for intelligently scheduling the files to be recognized, which is one or any combination of the following setting modes: 1) setting task priority: setting the priority of the file to be identified through a management interface, or setting the priority of a user, wherein when the user submits the file to be identified, the priority of the file to be identified is automatically marked according to the priority of the user; 2) configuring OCR queue priority corresponding to OCR recognition engines of various consumption types through a management system; 3) setting priority according to the task aging time, and preferentially identifying the earlier aging time in the same OCR queue; 4) setting priority according to the identification type: in the same OCR queue, determining the priority according to the type of the file to be identified; 5) setting priority according to the enqueue time: the earlier the enqueue time is, the higher the priority is, and the recognition is carried out in the same OCR queue according to a first-in first-out principle; when a plurality of setting modes are combined, the priority of each mode is set.
Preferably, the consumption types of the OCR recognition engine include emergency, fragment, full text, general purpose, specifically: an emergency OCR recognition engine, a fragmented OCR recognition engine, a full text OCR recognition engine and a generic OCR recognition engine; correspondingly creating an OCR queue by each consumption type OCR recognition engine, wherein the OCR queue comprises an emergency queue, a fragment queue, a full text queue and a general queue, and setting the priority of each OCR queue from high to low as: an emergency queue, a fragment queue, a full text queue and a general queue; calling an OCR application interface, and specifying the type of a file to be recognized and the consumption type of an OCR recognition engine for processing the file to be recognized; determining the best matching OCR recognition engine to process the type of file: judging whether the priority of the file to be recognized is urgent or not, if so, executing overtime detection by an emergency OCR recognition engine, if not, entering the file to be recognized into an emergency queue, and if so, failing to enqueue and notifying a user; if not, executing the next judgment; judging that the file to be recognized is a fragment file, if so, executing the overtime detection by a fragment OCR recognition engine, if not, entering the fragment queue by the fragment OCR recognition engine, and if so, not queuing and informing a user; if not, executing the next judgment; judging that the file to be recognized is a full-text file, if so, executing overtime detection by a full-text OCR recognition engine, if not, entering the full-text queue by the file to be recognized, and if overtime, failing to enqueue and notifying a user; if not, executing the next judgment; and the general OCR recognition engine executes overtime detection, if the overtime detection does not exist, the file to be recognized enters a general queue, and if the overtime detection does not exist, the file cannot be queued and the user is notified.
The invention also provides equipment for intelligently scheduling the multiple OCR engines.
The second technical scheme of the invention is as follows:
an apparatus for intelligently scheduling multiple OCR engines comprising a memory and a processor, said memory storing instructions adapted to be loaded by the processor and to perform the steps of: calling an OCR application interface to upload a file to be recognized, and specifying the type of the file to be recognized; determining the consumption types of OCR recognition engines for processing the file according to the type of the file to be recognized, wherein each OCR engine of the consumption type creates an OCR queue corresponding to the OCR engine, and the number of the OCR recognition engines of each consumption type is at least one; when a file to be recognized requests to enter an OCR queue of a corresponding OCR recognition engine, firstly executing overtime detection for judging whether the consumption type OCR recognition engine is overtime or not, if not, entering the corresponding OCR queue, if so, the file to be recognized cannot be queued and the user is informed.
More preferably, the timeout detection is: and comparing the estimated time consumption of the file to be recognized corresponding to any consumption type of OCR recognition engine with the preset task timeout time to obtain whether the OCR queue is overtime.
More preferably, the timeout is detected as: the average time consumption of any consumption type of OCR recognition engine (the number of files to be recognized in the list of the OCR queues plus the minimum task number of the consumption type of OCR recognition engines) is obtained, the estimated time consumption of the consumption type of OCR recognition engines is obtained, and the estimated time consumption is compared with the preset task timeout time, so that whether the OCR queues are overtime is determined; and each OCR recognition engine correspondingly creates a task list, and the minimum task number value is in the task list corresponding to each OCR recognition engine of the same consumption type, and the task list with the minimum task number.
Preferably, the average time-consuming way of determining the OCR recognition engines of each consumption type is as follows: presetting an initial value by an OCR recognition engine of each consumption type; the method comprises the steps of periodically sampling recognition time consumption values of all OCR recognition engines in an A time period, taking the recognition time consumption values of all OCR recognition engines in a B time period and the total number of recognition tasks, averaging to obtain the task time consumption values of all OCR recognition engines, taking the minimum task time consumption value as the minimum time consumption value of the OCR recognition engines of the consumption types in the OCR recognition engines of the same consumption types, finally comparing the minimum time consumption value with the preset initial value, taking the preset initial value as the average time consumption of the OCR recognition engines if the minimum time consumption value is larger than the preset initial value, and taking the minimum time consumption as the average time consumption of the OCR recognition engines if the minimum time consumption value is smaller than the preset initial value, wherein the A time period is smaller than the B time period.
Preferably, the instructions are loaded by the processor and then the following steps are executed: creating an OCR queue consumer that continually detects the OCR queue and continually creates queue members into tasks that are then distributed to corresponding OCR recognition engines: acquiring numerical values of each OCR recognition engine, wherein each numerical value is a preset value; reading a list of OCR queues corresponding to the OCR recognition engines of the consumption types and version numbers of the list of the OCR queues, and determining the number of queue members which can be used for creating tasks in each OCR queue: if the number of the files to be identified in the OCR queue is larger than the value, the number of queue members which can be used for creating the task is equal to the value, otherwise, the number of queue members which can be used for creating the task is equal to the number of the files to be identified in the OCR queue; judging whether the load of an OCR recognition engine exceeds a preset maximum bearing range of the OCR recognition engine, wherein the load of the OCR recognition engine comprises the number of tasks in a task list of the OCR recognition engine and the number of queue members which can be used for creating the tasks, if so, the queue members are not created as the tasks, if not, checking whether the list version number of the OCR queue read by verification is consistent with the version number of the list of the current OCR queue, if so, updating the state of the queue members used for creating the tasks and the version number of the list of the current OCR queue, and if not, abandoning the created tasks; and acquiring the queue members in the updated state, and inserting the queue members into a task list of the OCR recognition engine in the form of tasks.
Preferably, the OCR recognition engines of each consumption type periodically perform said time-out detection to timely find out congestion problems.
Preferably, the instructions are loaded by the processor and then execute a priority setting step for intelligently scheduling the file to be identified, wherein the priority setting step is one or any combination of the following setting modes: 1) setting task priority: setting the priority of the file to be identified through a management interface, or setting the priority of a user, wherein when the user submits the file to be identified, the priority of the file to be identified is automatically marked according to the priority of the user; 2) configuring OCR queue priority corresponding to OCR recognition engines of various consumption types through a management system; 3) setting priority according to the task aging time, and preferentially identifying the earlier aging time in the same OCR queue; 4) setting priority according to the identification type: in the same OCR queue, determining the priority according to the type of the file to be identified; 5) setting priority according to the enqueue time: the earlier the enqueue time is, the higher the priority is, and the recognition is carried out in the same OCR queue according to a first-in first-out principle; when the above multiple modes are combined, the priority of each mode is set at the same time.
Preferably, the consumption types of the OCR recognition engine include emergency, fragment, full text, general purpose, specifically: an emergency OCR recognition engine, a fragmented OCR recognition engine, a full text OCR recognition engine and a generic OCR recognition engine; correspondingly creating an OCR queue by each consumption type OCR recognition engine, wherein the OCR queue comprises an emergency queue, a fragment queue, a full text queue and a general queue, and setting the priority of each OCR queue from high to low as: an emergency queue, a fragment queue, a full text queue and a general queue; the processor performs the steps of: calling an OCR application interface, and specifying the type of a file to be recognized and the consumption type of an OCR recognition engine for processing the file to be recognized; determining the most matched OCR recognition engine for processing the type of file, specifically: judging whether the priority of the file to be recognized is urgent or not, if so, executing overtime detection by an emergency OCR recognition engine, if not, entering the file to be recognized into an emergency queue, and if so, failing to enqueue and notifying a user; if not, executing the next judgment; judging that the file to be recognized is a fragment file, if so, executing the overtime detection by a fragment OCR recognition engine, if not, entering the fragment queue by the fragment OCR recognition engine, and if so, not queuing and informing a user; if not, executing the next judgment; judging that the file to be recognized is a full-text file, if so, executing overtime detection by a full-text OCR recognition engine, if not, entering the full-text queue by the file to be recognized, and if overtime, failing to enqueue and notifying a user; if not, executing the next judgment; and the general OCR recognition engine executes overtime detection, if the overtime detection does not exist, the file to be recognized enters a general queue, and if the overtime detection does not exist, the file cannot be queued and the user is notified.
The invention has the following beneficial effects:
1. according to the method and the equipment for intelligently scheduling the multiple OCR engines, whether the OCR recognition engines matched with the files to be recognized are overtime or not is determined, the advantages of the OCR recognition engines of various consumption types are fully utilized to achieve high-performance and high-accuracy recognition, the OCR recognition engines can be scheduled in order, and system errors, engine paralysis and the like caused by queue congestion are prevented;
2. according to the method and the equipment for intelligently scheduling the multiple OCR engines, overtime detection can accurately reflect the time consumption condition of the current OCR recognition engine, and guarantee is provided for the steady operation of a system;
3. the invention relates to a method and equipment for intelligently scheduling multiple OCR engines, which can prevent the OCR engines from being paralyzed due to the excessive load by detecting and controlling the load of the OCR engines through an OCR queue consuming terminal, and simultaneously check the list version number of an OCR queue and update the queue member state and the list version number of the OCR queue, thereby effectively avoiding the repeated creation of tasks in the multiple OCR engines of the same consumption type by queue members.
4. The invention discloses a method and equipment for intelligently scheduling multiple OCR engines, wherein the OCR recognition engines of various consumption types periodically execute overtime detection, so that the normal operation of each OCR recognition engine is ensured, and congestion problems are timely discovered and processed.
5. The invention discloses a method and equipment for intelligently scheduling multiple OCR engines, and also provides multiple priority setting modes to realize intelligent scheduling of tasks;
6. the method and the equipment for intelligently scheduling the multiple OCR engines can simultaneously and intelligently schedule an emergency OCR recognition engine, a fragment OCR recognition engine, a full-text OCR recognition engine and a general OCR recognition engine, and orderly schedule by combining queue priorities, so that high-performance and high-accuracy OCR recognition is realized.
Drawings
FIG. 1 is a block diagram of the present invention;
FIG. 2 is a schematic flow chart of the present invention;
FIG. 3 is a schematic diagram of the average elapsed time flow of the present invention;
FIG. 4 is a flow chart of the OCR queue consuming side of the present invention;
FIG. 5 is a flow diagram of the present invention employing four consuming type OCR recognition engines.
Detailed Description
The invention is described in detail below with reference to the figures and the specific embodiments.
Example one
Referring to fig. 1 and 2, a method for intelligently scheduling multiple OCR engines includes the following steps: calling an OCR application interface to upload a file to be recognized, and specifying the type of the file to be recognized; determining the consumption types of OCR recognition engines for processing the file according to the type of the file to be recognized, wherein each OCR engine of the consumption type creates an OCR queue corresponding to the OCR engine, and the number of the OCR recognition engines of each consumption type is at least one; when a file to be recognized requests to enter an OCR queue of a corresponding OCR recognition engine, firstly executing overtime detection for judging whether the consumption type OCR recognition engine is overtime or not, if not, entering the corresponding OCR queue, if so, the file to be recognized cannot be queued and the user is informed. By determining the matched OCR recognition engines and judging whether the OCR recognition engines are overtime before enqueuing, the advantages of the OCR recognition engines of various consumption types are fully utilized to achieve high-performance and high-accuracy recognition, the OCR recognition engines can be dispatched in order, and system errors, engine paralysis and the like caused by queue congestion are prevented.
The timeout detection is: and comparing the estimated time consumption of the file to be recognized corresponding to any consumption type of OCR recognition engine with the preset task timeout time to obtain whether the OCR queue is overtime. Specifically, the average time consumption of any consumption type of OCR recognition engine (the number of documents to be recognized in the list of the OCR queues + the minimum task number of the consumption type of OCR recognition engine) is obtained to obtain the estimated time consumption of the consumption type of OCR recognition engine, and the estimated time consumption is compared with the preset task timeout time, so as to obtain whether the OCR queues have timed out. And each OCR recognition engine correspondingly creates a task list, and the minimum task number value is in the task list corresponding to each OCR recognition engine of the same consumption type, and the task list with the minimum task number.
Referring to fig. 3, there are various methods for determining the average time consumption of the OCR recognition engines, the first method is to preset an initial value for each consumption type of the OCR recognition engine; periodically sampling the recognition time consumption value of each OCR recognition engine in the A time period, for example, sampling the recognition time consumption value of each OCR recognition engine in nearly 6 hours every one minute, then taking the recognition time consumption value of each OCR recognition engine in the B time period and the total number of recognition tasks, averaging to obtain the task time consumption value of each OCR recognition engine, taking the minimum task time consumption value as the minimum time consumption value of the OCR recognition engine of the consumption type in the OCR recognition engines of the same consumption type, for example, taking the time consumption values of 3 fragment OCR recognition engines in 24 hour periods as 10 seconds, 8 seconds and 15 seconds respectively, and the number of completed tasks is 100, therefore, the task time consumption values of the 3 fragment OCR recognition engines are 0.1 second, 0.08 second and 0.15 second, taking 0.08 second as the minimum time consumption of the fragment OCR recognition engines, finally, comparing the minimum time consumption value with the preset initial value, if the minimum time consumption value is greater than the preset initial value, and taking a preset initial value as the average consumed time of the OCR recognition engine, and if the average consumed time is smaller than the preset initial value, taking the minimum consumed time as the average consumed time of the OCR recognition engine, wherein the A time period is smaller than the B time period, or B ═ KA, and K is a positive integer. For the average time consumption value, the time period taken by the average time consumption value is larger, and the accuracy of the obtained time consumption value is higher, however, the identification time consumption value in a large period of multiple sampling is slow in data processing speed, occupies larger cache resources, and affects the performance of the processor. And the second method comprises the following steps: the method is relatively simple and easy to implement, and the accuracy of the average consumed time determined by the method is not high, and the method is easily influenced by burst multitasking, so that the average consumed time in the time period is too large and inaccurate.
The first average time consumption determination method can accurately reflect the time consumption situation of the current OCR recognition engine, and provides guarantee for the stable operation of the system.
Referring to fig. 4, the embodiment further creates an OCR queue consuming end, which continuously detects the OCR queue and continuously creates queue members into tasks, and then distributes the tasks to corresponding OCR recognition engines, specifically: acquiring numerical values of each OCR recognition engine, wherein each numerical value is a preset value; reading the list of the corresponding OCR queues and the version numbers of the list of the OCR queues, and determining the number of queue members which can be used for creating tasks in each OCR queue: if the number of the files to be identified in the OCR queue is larger than the value, the number of queue members which can be used for creating the task is equal to the value, otherwise, the number of queue members which can be used for creating the task is equal to the number of the files to be identified in the OCR queue; judging whether the load of an OCR recognition engine exceeds a preset maximum bearing range of the OCR recognition engine, wherein the load of the OCR recognition engine comprises the number of tasks in a task list of the OCR recognition engine and the number of queue members available for creating the tasks, if so, no longer creating the queue members as the tasks, if not, checking whether the list version number of the OCR queue read by verification is consistent with the list version number of the current OCR queue, if so, updating the state of the queue members used for creating the tasks and the version number of the list of the current OCR queue, for example, updating the state of the queue members as follows: after dequeuing, changing the version of the list of the OCR queue from V1.0 to V1.1, and if the version of the list of the OCR queue is not consistent with the version of the OCR queue, abandoning the creation of a task; and acquiring the queue members in the updated state, and inserting the queue members into a task list of the OCR recognition engine in the form of tasks.
For example, 2 fragment OCR recognition engines are adopted to recognize fragment files, the access value of each fragment recognition engine is 3, a list and a version number of a fragment OCR queue are read, the number of files to be recognized in the list of the OCR queue is 2, and the version number is V1.0, so that the number of queue members which can be used for creating tasks in the fragment OCR queue is determined to be 2; then, setting the maximum bearing range of the fragmented OCR recognition engines to be 3-5, the number of tasks in the task list of the first fragmented OCR recognition engine to be 3, and the number of tasks in the task list of the second fragmented OCR recognition engine to be 5, then, the load of the first fragmented OCR recognition engine is the number of tasks in the task list 3 plus the number of queue members available for creating tasks 2, and the load is within the maximum bearing range, therefore, when updating, it is checked whether the version of the list of the current OCR queue is V1.0, if so, two files to be recognized in the list of the OCR queue are marked as "dequeued", and the version number of the list of the OCR queue is updated to be V1.1. And finally, respectively creating two files to be recognized which are marked as dequeued into tasks, and inserting the tasks into a task list of the first fragment OCR recognition engine. The number of tasks in the task list of the second fragmented OCR recognition engine has reached the maximum tolerance range and therefore no new tasks are created into the task list.
The load of the OCR recognition engine is detected and controlled by the OCR queue consuming end, the OCR recognition engine is prevented from being paralyzed due to the overload, meanwhile, the list version number of the OCR queue is verified, then the queue member state is updated, and the list version number of the OCR queue is updated, so that the repeated creation of tasks in a plurality of OCR recognition engines of the same consumption type by queue members can be effectively avoided.
In order to timely find that the OCR recognition engines have timeout problems in the recognition process, in the embodiment, the OCR recognition engines of each consumption type periodically perform the timeout detection, so as to ensure the normal operation of each OCR recognition engine and timely find and process congestion problems.
The embodiment also provides a method for intelligently scheduling a file to be identified, which is one or any combination of the following modes: 1) setting task priority: setting the priority of the file to be identified through a management interface or setting the priority of a user, and automatically setting the priority of the file to be identified according to the priority of the user when the user submits the file to be identified; 2) configuring OCR queue priority corresponding to OCR recognition engines of various consumption types through a management system; 3) judging the priority according to the task aging time, and preferentially identifying the earlier the aging time is under the same condition; 4) setting priority according to the identification type: in the same OCR queue, the priority is determined according to the recognition type, for example, for an OCR recognition engine with a general consumption type, the corresponding OCR queue may include both full text recognition and fragment recognition, so that the file priority recognition of the fragment type can be set, because the fragment file recognition speed is high and the full text recognition takes a long time; 5) the enqueue time is as follows: the earlier the enqueue time, the higher the priority, i.e. under the same condition, the recognition is carried out according to the first-in first-out principle.
Referring to fig. 5, taking the system including the emergency OCR recognition engine, the fragmented OCR recognition engine, the full-text OCR recognition engine and the general OCR recognition engine as an example, each OCR recognition engine of the consumption type correspondingly creates an OCR queue, specifically: the method comprises the following steps of setting the priority of queue task distribution from high to low as: an emergency queue, a fragment queue, a full text queue and a general queue;
step 1, a client calls an OCR application interface, uploads a file to be recognized, and specifies the type of the file to be recognized and the consumption type of an OCR recognition engine for processing the file to be recognized; meanwhile, whether the cache file is used or not can be set; the cache file is the recognition result of the last recognition of the file to be recognized; step 2, after receiving, the server judges whether to use the cache file, if so, extracts the last identification result from the cache and returns the identification result to the client, and if not, or the cache file does not exist, the server executes step 3; step 3, determining the best matched OCR recognition engine for processing the type of file:
judging whether the priority of the file to be recognized is urgent or not, if so, executing overtime detection by an emergency OCR recognition engine, if not, entering the file to be recognized into an emergency queue, and if so, failing to enqueue and notifying a user; if not, executing the next judgment;
judging that the file to be recognized is a fragment file, if so, executing the overtime detection by a fragment OCR recognition engine, if not, entering the fragment queue by the fragment OCR recognition engine, and if so, not queuing and informing a user; if not, executing the next judgment;
judging that the file to be recognized is a full-text file, if so, executing overtime detection by a full-text OCR recognition engine, if not, entering the full-text queue by the file to be recognized, and if overtime, failing to enqueue and notifying a user; if not, executing the next judgment;
and the general OCR recognition engine executes overtime detection, if the overtime detection does not exist, the file to be recognized enters a general queue, and if the overtime detection does not exist, the file cannot be queued and the user is notified.
The four OCR recognition engines are matched by setting the queue priority and combining the consumption types of the files to be recognized, and can orderly schedule the files to be recognized, so that high-performance and high-accuracy OCR recognition is realized.
Example two
Referring to fig. 1 and 2, an apparatus for intelligently scheduling multiple OCR engines includes a memory and a processor, the memory storing instructions adapted to be loaded by the processor and to perform the steps of: calling an OCR application interface to upload a file to be recognized, and specifying the type of the file to be recognized; determining the consumption types of OCR recognition engines for processing the file according to the type of the file to be recognized, wherein each OCR engine of the consumption type creates an OCR queue corresponding to the OCR engine, and the number of the OCR recognition engines of each consumption type is at least one; when a file to be recognized requests to enter an OCR queue of a corresponding OCR recognition engine, firstly executing overtime detection for judging whether the consumption type OCR recognition engine is overtime or not, if not, entering the corresponding OCR queue, if so, the file to be recognized cannot be queued and the user is informed. By determining the matched OCR recognition engines and judging whether the OCR recognition engines are overtime before enqueuing, the advantages of the OCR recognition engines of various consumption types are fully utilized to achieve high-performance and high-accuracy recognition, the OCR recognition engines can be dispatched in order, and system errors, engine paralysis and the like caused by queue congestion are prevented.
The timeout detection is: and comparing the estimated time consumption of the file to be recognized corresponding to any consumption type of OCR recognition engine with the preset task timeout time to obtain whether the OCR queue is overtime. Specifically, the method comprises the following steps: and (4) obtaining the estimated time consumption of the consumption type OCR recognition engine (the number of the documents to be recognized in the list of the OCR queue + the minimum task number of the consumption type OCR recognition engine), and comparing the estimated time consumption with the preset task timeout time to obtain whether the OCR queue is overtime. And each OCR recognition engine correspondingly creates a task list, and the minimum task number value is in the task list corresponding to each OCR recognition engine of the same consumption type, and the task list with the minimum task number.
Referring to fig. 3, there are various methods for determining the average time consumption of the OCR recognition engines, the first method is to preset an initial value for each consumption type of the OCR recognition engine; periodically sampling the recognition time consumption value of each OCR recognition engine in the A time period, for example, sampling the recognition time consumption value of each OCR recognition engine in nearly 6 hours every one minute, then taking the recognition time consumption value of each OCR recognition engine in the B time period and the total number of recognition tasks, averaging to obtain the task time consumption value of each OCR recognition engine, taking the minimum task time consumption value as the minimum time consumption value of the OCR recognition engine of the consumption type in the OCR recognition engines of the same consumption type, for example, taking the time consumption values of 3 fragment OCR recognition engines in 24 hour periods as 10 seconds, 8 seconds and 15 seconds respectively, and the number of completed tasks is 100, therefore, the task time consumption values of the 3 fragment OCR recognition engines are 0.1 second, 0.08 second and 0.15 second, taking 0.08 second as the minimum time consumption of the fragment OCR recognition engines, finally, comparing the minimum time consumption value with the preset initial value, if the minimum time consumption value is greater than the preset initial value, and taking a preset initial value as the average consumed time of the OCR recognition engine, and if the average consumed time is smaller than the preset initial value, taking the minimum consumed time as the average consumed time of the OCR recognition engine, wherein the A time period is smaller than the B time period, or B ═ KA, and K is a positive integer. For the average time consumption value, the time period taken by the average time consumption value is larger, and the accuracy of the obtained time consumption value is higher, however, the identification time consumption value in a large period of multiple sampling is slow in data processing speed, occupies larger cache resources, and affects the performance of the processor. And the second method comprises the following steps: the method is relatively simple and easy to implement, and the accuracy of the average consumed time determined by the method is not high, and the method is easily influenced by burst multitasking, so that the average consumed time in the time period is too large and inaccurate.
The first average time consumption determination method can accurately reflect the time consumption situation of the current OCR recognition engine, and provides guarantee for the stable operation of the system.
Referring to fig. 4, in the embodiment, the following steps are further executed after the instruction is loaded by the processor: creating an OCR queue consuming end, continuously detecting the OCR queue and continuously creating queue members into tasks, and then distributing the tasks to corresponding OCR recognition engines, specifically: acquiring numerical values of each OCR recognition engine, wherein each numerical value is a preset value; taking the list of the corresponding OCR queues and the version number of the list of the OCR queues, and determining the number of queue members which can be used for creating tasks in each OCR queue: if the number of the files to be identified in the OCR queue is larger than the value, the number of queue members which can be used for creating the task is equal to the value, otherwise, the number of queue members which can be used for creating the task is equal to the number of the files to be identified in the OCR queue; judging whether the load of an OCR recognition engine exceeds a preset maximum bearing range of the OCR recognition engine, wherein the load of the OCR recognition engine comprises the number of tasks in a task list of the OCR recognition engine and the number of queue members available for creating the tasks, if so, no longer creating the queue members as the tasks, if not, checking whether the list version number of the OCR queue read by verification is consistent with the list version number of the current OCR queue, if so, updating the state of the queue members used for creating the tasks and the version number of the list of the current OCR queue, for example, updating the state of the queue members as follows: after dequeuing, changing the version of the list of the OCR queue from V1.0 to V1.1, and if the version of the list of the OCR queue is not consistent with the version of the OCR queue, abandoning the creation of a task; and acquiring the queue members in the updated state, and inserting the queue members into a task list of the OCR recognition engine in the form of tasks.
For example, 2 fragment OCR recognition engines are adopted to recognize fragment files, the access value of each fragment recognition engine is 3, a list and a version number of a fragment OCR queue are read, the number of files to be recognized in the list of the OCR queue is 2, and the version number is V1.0, so that the number of queue members which can be used for creating tasks in the fragment OCR queue is determined to be 2; then, setting the maximum bearing range of the fragmented OCR recognition engines to be 3-5, the number of tasks in the task list of the first fragmented OCR recognition engine to be 3, and the number of tasks in the task list of the second fragmented OCR recognition engine to be 5, then, the load of the first fragmented OCR recognition engine is the number of tasks in the task list 3 plus the number of queue members available for creating tasks 2, and the load is within the maximum bearing range, therefore, when updating, it is checked whether the version of the list of the current OCR queue is V1.0, if so, two files to be recognized in the list of the OCR queue are marked as "dequeued", and the version number of the list of the OCR queue is updated to be V1.1. And finally, respectively creating two files to be recognized which are marked as dequeued into tasks, and inserting the tasks into a task list of the first fragment OCR recognition engine. The number of tasks in the task list of the second fragmented OCR recognition engine has reached the maximum tolerance range and therefore no new tasks are created into the task list.
The load of the OCR recognition engine is detected and controlled by the OCR queue consuming end, the OCR recognition engine is prevented from being paralyzed due to the overload, meanwhile, the list version number of the OCR queue is verified, then the queue member state is updated, and the list version number of the OCR queue is updated, so that the repeated creation of tasks in a plurality of OCR recognition engines of the same consumption type by queue members can be effectively avoided.
In order to timely find that the OCR recognition engines have timeout problems in the recognition process, in the embodiment, the OCR recognition engines of each consumption type periodically perform the timeout detection, so as to ensure the normal operation of each OCR recognition engine and timely find and process congestion problems.
In this embodiment, the instruction is loaded by the processor and then performs a priority setting step for intelligently scheduling the file to be identified, which is one or a combination of any of the following modes: 1) setting task priority: setting the priority of the file to be identified through a management interface or setting the priority of a user, and automatically setting the priority of the file to be identified according to the priority of the user when the user submits the file to be identified; 2) configuring OCR queue priority corresponding to OCR recognition engines of various consumption types through a management system; 3) judging the priority according to the task aging time, and preferentially identifying the earlier the aging time is under the same condition; 4) setting priority according to the identification type: in the same OCR queue, the priority is determined according to the recognition type, for example, for an OCR recognition engine with a general consumption type, the corresponding OCR queue may include both full text recognition and fragment recognition, so that the file priority recognition of the fragment type can be set, because the fragment file recognition speed is high and the full text recognition takes a long time; 5) the enqueue time is as follows: the earlier the enqueue time, the higher the priority, i.e. under the same condition, the recognition is carried out according to the first-in first-out principle.
Referring to fig. 5, taking the system including the emergency OCR recognition engine, the fragmented OCR recognition engine, the full-text OCR recognition engine and the general OCR recognition engine as an example, each OCR recognition engine of the consumption type correspondingly creates an OCR queue, specifically: the method comprises the following steps of setting the priority of queue task distribution from high to low as: an emergency queue, a fragment queue, a full text queue and a general queue;
step 1, a client calls an OCR application interface, uploads a file to be recognized, and specifies the type of the file to be recognized and the consumption type of an OCR recognition engine for processing the file to be recognized; meanwhile, whether the cache file is used or not can be set; the cache file is the recognition result of the last recognition of the file to be recognized;
step 2, after receiving, the server judges whether to use the cache file, if so, extracts the last identification result from the cache and returns the identification result to the client, and if not, or the cache file does not exist, the server executes step 3;
step 3, determining the best matched OCR recognition engine for processing the type of file:
judging whether the priority of the file to be recognized is urgent or not, if so, executing overtime detection by an emergency OCR recognition engine, if not, entering the file to be recognized into an emergency queue, and if so, failing to enqueue and notifying a user; if not, executing the next judgment;
judging that the file to be recognized is a fragment file, if so, executing the overtime detection by a fragment OCR recognition engine, if not, entering the fragment queue by the fragment OCR recognition engine, and if so, not queuing and informing a user; if not, executing the next judgment;
judging that the file to be recognized is a full-text file, if so, executing overtime detection by a full-text OCR recognition engine, if not, entering the full-text queue by the file to be recognized, and if overtime, failing to enqueue and notifying a user; if not, executing the next judgment;
and the general OCR recognition engine executes overtime detection, if the overtime detection does not exist, the file to be recognized enters a general queue, and if the overtime detection does not exist, the file cannot be queued and the user is notified.
The above description is only an embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes performed by the present specification and drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (10)

1. A method for intelligently scheduling multiple OCR engines comprising the steps of: calling an OCR application interface to upload a file to be recognized, and specifying the type of the file to be recognized; determining the consumption types of OCR recognition engines for processing the file according to the type of the file to be recognized, wherein each OCR engine of the consumption type creates an OCR queue corresponding to the OCR engine, and the number of the OCR recognition engines of each consumption type is at least one; when a file to be recognized requests to enter an OCR queue of a corresponding OCR recognition engine, firstly executing overtime detection for judging whether the consumption type OCR recognition engine is overtime or not: comparing the estimated time consumption of the file to be recognized corresponding to any consumption type of OCR recognition engine with the preset task timeout time; if not, the file to be identified enters a corresponding OCR queue, if the file is overtime, the file cannot be queued and the user is notified;
the method for determining the estimated time consumption comprises the following steps: average time consumption of any consumption type of OCR recognition engine (number of documents to be recognized in the list of OCR queues + minimum number of tasks of the consumption type of OCR recognition engine); the average time-consuming mode is determined as follows: presetting an initial value by an OCR recognition engine of each consumption type; periodically sampling recognition time consumption values of all OCR recognition engines in an A time period, then taking the recognition time consumption values of all OCR recognition engines in a B time period and the total number of recognition tasks, averaging to obtain the task time consumption values of all OCR recognition engines, taking the minimum task time consumption value as the minimum time consumption value of the OCR recognition engines of the consumption types in the OCR recognition engines of the same consumption types, finally, comparing the minimum time consumption with the preset initial value, if the minimum time consumption value is larger than the preset initial value, taking the preset initial value as the average time consumption of the OCR recognition engines, and if the minimum time consumption value is smaller than the preset initial value, taking the minimum time consumption value as the average time consumption of the OCR recognition engines, wherein the A time period is smaller than the B time period; and each OCR recognition engine correspondingly creates a task list, and the minimum task number value is in the task list corresponding to each OCR recognition engine of the same consumption type, and the task list with the minimum task number.
2. A method for intelligently scheduling multiple OCR engines according to claim 1 and characterized by: an OCR queue consumer is also created which continually detects the OCR queue and continually creates queue members into tasks which are then distributed to corresponding OCR recognition engines:
acquiring numerical values of each OCR recognition engine, wherein each numerical value is a preset value;
reading a list of OCR queues corresponding to the OCR recognition engines of the consumption types and version numbers of the list of the OCR queues, and determining the number of queue members which can be used for creating tasks in each OCR queue: if the number of the files to be identified in the OCR queue is larger than the value, the number of queue members which can be used for creating the task is equal to the value, otherwise, the number of queue members which can be used for creating the task is equal to the number of the files to be identified in the OCR queue;
judging whether the load of an OCR recognition engine exceeds a preset maximum bearing range of the OCR recognition engine, wherein the load of the OCR recognition engine comprises the number of tasks in a task list of the OCR recognition engine and the number of queue members which can be used for creating the tasks, if so, the queue members are not created as the tasks, if not, checking whether the list version number of the OCR queue read by verification is consistent with the version number of the list of the current OCR queue, if so, updating the state of the queue members used for creating the tasks and the version number of the list of the current OCR queue, and if not, abandoning the created tasks;
and acquiring the queue members in the updated state, and inserting the queue members into a task list of the OCR recognition engine in the form of tasks.
3. A method for intelligently scheduling multiple OCR engines according to claim 1 and characterized by: the OCR recognition engines of each consumption type periodically perform the timeout detection to find out congestion problems in time.
4. A method for intelligently scheduling multiple OCR engines according to claim 1 and characterized by: the method also comprises a priority setting step for intelligently scheduling the files to be identified, wherein the priority setting step is one or any combination of the following setting modes: 1) setting task priority: setting the priority of the file to be identified through a management interface, or setting the priority of a user, wherein when the user submits the file to be identified, the priority of the file to be identified is automatically marked according to the priority of the user; 2) configuring OCR queue priority corresponding to OCR recognition engines of various consumption types through a management system; 3) setting priority according to the task aging time, and preferentially identifying the earlier aging time in the same OCR queue; 4) setting priority according to the identification type: in the same OCR queue, determining the priority according to the type of the file to be identified; 5) setting priority according to the enqueue time: the earlier the enqueue time is, the higher the priority is, and the recognition is carried out in the same OCR queue according to a first-in first-out principle; when a plurality of setting modes are combined, the priority of each mode is set.
5. A method for intelligently scheduling multiple OCR engines according to claim 1 and characterized by: the consumption types of the OCR recognition engine comprise emergency, fragment, full text and general use, and specifically comprise the following steps: an emergency OCR recognition engine, a fragmented OCR recognition engine, a full text OCR recognition engine and a generic OCR recognition engine; correspondingly creating an OCR queue by each consumption type OCR recognition engine, wherein the OCR queue comprises an emergency queue, a fragment queue, a full text queue and a general queue, and setting the priority of each OCR queue from high to low as: an emergency queue, a fragment queue, a full text queue and a general queue;
calling an OCR application interface, and specifying the type of a file to be recognized and the consumption type of an OCR recognition engine for processing the file to be recognized;
determining the best matching OCR recognition engine to process the type of file:
judging whether the priority of the file to be recognized is urgent or not, if so, executing overtime detection by an emergency OCR recognition engine, if not, entering the file to be recognized into an emergency queue, and if so, failing to enqueue and notifying a user; if not, executing the next judgment;
judging that the file to be recognized is a fragment file, if so, executing the overtime detection by a fragment OCR recognition engine, if not, entering the fragment queue by the fragment OCR recognition engine, and if so, not queuing and informing a user; if not, executing the next judgment;
judging that the file to be recognized is a full-text file, if so, executing overtime detection by a full-text OCR recognition engine, if not, entering the full-text queue by the file to be recognized, and if overtime, failing to enqueue and notifying a user; if not, executing the next judgment;
and the general OCR recognition engine executes overtime detection, if the overtime detection does not exist, the file to be recognized enters a general queue, and if the overtime detection does not exist, the file cannot be queued and the user is notified.
6. An apparatus for intelligently scheduling multiple OCR engines comprising a memory and a processor, said memory storing instructions adapted to be loaded by the processor and to perform the steps of:
calling an OCR application interface to upload a file to be recognized, and specifying the type of the file to be recognized; determining the consumption types of OCR recognition engines for processing the file according to the type of the file to be recognized, wherein each OCR engine of the consumption type creates an OCR queue corresponding to the OCR engine, and the number of the OCR recognition engines of each consumption type is at least one; when a file to be recognized requests to enter an OCR queue of a corresponding OCR recognition engine, firstly executing overtime detection for judging whether the consumption type OCR recognition engine is overtime or not, if not, entering the corresponding OCR queue, if so, not entering the queue and informing a user;
the method for determining the estimated time consumption comprises the following steps: average time consumption of any consumption type of OCR recognition engine (number of documents to be recognized in the list of OCR queues + minimum number of tasks of the consumption type of OCR recognition engine); the average time-consuming mode is determined as follows: presetting an initial value by an OCR recognition engine of each consumption type; periodically sampling recognition time consumption values of all OCR recognition engines in an A time period, then taking the recognition time consumption values of all OCR recognition engines in a B time period and the total number of recognition tasks, averaging to obtain the task time consumption values of all OCR recognition engines, taking the minimum task time consumption value as the minimum time consumption value of the OCR recognition engines of the consumption types in the OCR recognition engines of the same consumption types, finally, comparing the minimum time consumption with the preset initial value, if the minimum time consumption value is larger than the preset initial value, taking the preset initial value as the average time consumption of the OCR recognition engines, and if the minimum time consumption value is smaller than the preset initial value, taking the minimum time consumption value as the average time consumption of the OCR recognition engines, wherein the A time period is smaller than the B time period; and each OCR recognition engine correspondingly creates a task list, and the minimum task number value is in the task list corresponding to each OCR recognition engine of the same consumption type, and the task list with the minimum task number.
7. An apparatus for intelligently scheduling multiple OCR engines according to claim 6,
the instructions are loaded by the processor and then the following steps are executed: creating an OCR queue consumer that continually detects the OCR queue and continually creates queue members into tasks that are then distributed to corresponding OCR recognition engines:
acquiring numerical values of each OCR recognition engine, wherein each numerical value is a preset value;
reading a list of OCR queues corresponding to the OCR recognition engines of the consumption types and version numbers of the list of the OCR queues, and determining the number of queue members which can be used for creating tasks in each OCR queue: if the number of the files to be identified in the OCR queue is larger than the value, the number of queue members which can be used for creating the task is equal to the value, otherwise, the number of queue members which can be used for creating the task is equal to the number of the files to be identified in the OCR queue;
judging whether the load of an OCR recognition engine exceeds a preset maximum bearing range of the OCR recognition engine, wherein the load of the OCR recognition engine comprises the number of tasks in a task list of the OCR recognition engine and the number of queue members which can be used for creating the tasks, if so, the queue members are not created as the tasks, if not, checking whether the list version number of the OCR queue read by verification is consistent with the version number of the list of the current OCR queue, if so, updating the state of the queue members used for creating the tasks and the version number of the list of the current OCR queue, and if not, abandoning the created tasks;
and acquiring the queue members in the updated state, and inserting the queue members into a task list of the OCR recognition engine in the form of tasks.
8. An apparatus for intelligently scheduling multiple OCR engines according to claim 6 and wherein: the OCR recognition engines of each consumption type periodically perform the timeout detection to find out congestion problems in time.
9. An apparatus for intelligently scheduling multiple OCR engines according to claim 6 and wherein: the instruction is loaded by the processor and then executes a priority setting step for intelligently scheduling the file to be identified, wherein the priority setting step is one or any combination of the following setting modes: 1) setting task priority: setting the priority of the file to be identified through a management interface, or setting the priority of a user, wherein when the user submits the file to be identified, the priority of the file to be identified is automatically marked according to the priority of the user; 2) configuring OCR queue priority corresponding to OCR recognition engines of various consumption types through a management system; 3) setting priority according to the task aging time, and preferentially identifying the earlier aging time in the same OCR queue; 4) setting priority according to the identification type: in the same OCR queue, determining the priority according to the type of the file to be identified; 5) setting priority according to the enqueue time: the earlier the enqueue time is, the higher the priority is, and the recognition is carried out in the same OCR queue according to a first-in first-out principle; when the above multiple modes are combined, the priority of each mode is set at the same time.
10. An apparatus for intelligently scheduling multiple OCR engines according to claim 6 and wherein: the consumption types of the OCR recognition engine comprise emergency, fragment, full text and general use, and specifically comprise the following steps: an emergency OCR recognition engine, a fragmented OCR recognition engine, a full text OCR recognition engine and a generic OCR recognition engine; correspondingly creating an OCR queue by each consumption type OCR recognition engine, wherein the OCR queue comprises an emergency queue, a fragment queue, a full text queue and a general queue, and setting the priority of each OCR queue from high to low as: an emergency queue, a fragment queue, a full text queue and a general queue; the processor performs the steps of:
calling an OCR application interface, and specifying the type of a file to be recognized and the consumption type of an OCR recognition engine for processing the file to be recognized;
determining the most matched OCR recognition engine for processing the type of file, specifically:
judging whether the priority of the file to be recognized is urgent or not, if so, executing overtime detection by an emergency OCR recognition engine, if not, entering the file to be recognized into an emergency queue, and if so, failing to enqueue and notifying a user; if not, executing the next judgment;
judging that the file to be recognized is a fragment file, if so, executing the overtime detection by a fragment OCR recognition engine, if not, entering the fragment queue by the fragment OCR recognition engine, and if so, not queuing and informing a user; if not, executing the next judgment;
judging that the file to be recognized is a full-text file, if so, executing overtime detection by a full-text OCR recognition engine, if not, entering the full-text queue by the file to be recognized, and if overtime, failing to enqueue and notifying a user; if not, executing the next judgment;
and the general OCR recognition engine executes overtime detection, if the overtime detection does not exist, the file to be recognized enters a general queue, and if the overtime detection does not exist, the file cannot be queued and the user is notified.
CN201811615258.7A 2018-12-27 2018-12-27 Method and equipment for intelligently scheduling multiple OCR recognition engines Active CN109656733B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811615258.7A CN109656733B (en) 2018-12-27 2018-12-27 Method and equipment for intelligently scheduling multiple OCR recognition engines

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811615258.7A CN109656733B (en) 2018-12-27 2018-12-27 Method and equipment for intelligently scheduling multiple OCR recognition engines

Publications (2)

Publication Number Publication Date
CN109656733A CN109656733A (en) 2019-04-19
CN109656733B true CN109656733B (en) 2021-03-12

Family

ID=66117273

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811615258.7A Active CN109656733B (en) 2018-12-27 2018-12-27 Method and equipment for intelligently scheduling multiple OCR recognition engines

Country Status (1)

Country Link
CN (1) CN109656733B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110689019B (en) * 2019-09-27 2022-05-24 中国银行股份有限公司 OCR recognition model determining method and device
CN112820390A (en) * 2019-11-15 2021-05-18 深圳迈瑞生物医疗电子股份有限公司 Priority setting method, priority testing method and sample analysis system
CN113239921A (en) * 2021-05-10 2021-08-10 上海交大慧谷通用技术有限公司 Task grading and distributing method and system for OCR (optical character recognition) service
CN116189210A (en) * 2023-04-23 2023-05-30 福昕鲲鹏(北京)信息科技有限公司 Image OCR (optical character recognition) method, electronic equipment and storage medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103150213B (en) * 2011-12-06 2016-06-22 北大方正集团有限公司 Balancing method of loads and device
CN102780773B (en) * 2012-07-16 2015-01-07 西安电子科技大学 Method for keeping cache consistency in network using content as center
CN106097088A (en) * 2016-06-07 2016-11-09 中国建设银行股份有限公司 The processing method of accounting data and system
CN106569891B (en) * 2016-11-09 2021-01-29 苏州浪潮智能科技有限公司 Method and device for scheduling and executing tasks in storage system

Also Published As

Publication number Publication date
CN109656733A (en) 2019-04-19

Similar Documents

Publication Publication Date Title
CN109656733B (en) Method and equipment for intelligently scheduling multiple OCR recognition engines
CN106557369B (en) Multithreading management method and system
CN107784481B (en) Task timeliness early warning method and device
CA1281427C (en) Data processor performance advisor
CN105955807B (en) Task processing system and method
CN106528318B (en) Thread dead loop detection method and device
CN111061556A (en) Optimization method and device for executing priority task, computer equipment and medium
CN110909006A (en) Data synchronization method and device, computer equipment and storage medium
CN112395067A (en) Task scheduling method, system, device and medium
CN109117280B (en) Electronic device, method for limiting inter-process communication thereof and storage medium
EP3932025A1 (en) Computing resource scheduling method, scheduler, internet of things system, and computer readable medium
CN111240864A (en) Asynchronous task processing method, device, equipment and computer readable storage medium
CN109800085B (en) Resource configuration detection method and device, storage medium and electronic equipment
CN113391911A (en) Big data resource dynamic scheduling method, device and equipment
WO2019029721A1 (en) Task scheduling method, apparatus and device, and storage medium
CN113342497A (en) Task scheduling method and device, terminal equipment and computer storage medium
CN112579271A (en) Real-time task scheduling method, module, terminal and storage medium for non-real-time operating system
CN116842090A (en) Accounting system, method, equipment and storage medium
CN110912949B (en) Method and device for submitting sites
CN112181645A (en) Resource scheduling method, device, equipment and storage medium
CN116501475A (en) Thread scheduling method, system and medium
Bayati Managing energy consumption and quality of service in data centers
CN112988417A (en) Message processing method and device, electronic equipment and computer readable medium
CN109871403B (en) Industrial big data analysis method based on industrial supply chain
CN110781452B (en) Statistical task processing method and device, computer equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant