Method and device for checking books based on OCR (Optical Character Recognition) technology, electronic equipment and computer program product
By using OCR technology in the library combined with multi-stage matching algorithm and error correction calibration mechanism, the problem of inaccurate matching of bibliography names in the library collection book inventory is solved, and efficient and accurate library management is achieved.
Patent Information
- Application Number
- CN202510283436.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-11
- Publication Date
- 2025-07-22
AI Technical Summary
The existing OCR technology has the problem of inaccurate matching of bibliographic names in the library collection book inventory, especially when facing complex book catalogs and identification accuracy limitations, resulting in inefficiency and insufficient accuracy.
By receiving book images collected by the image acquisition module, using OCR technology to extract text information, combining collection attribute information to build search engine query conditions, matching book text information from the database, and using a multi-stage matching algorithm and error correction calibration mechanism to ensure the accuracy of bibliography under matching threshold conditions.
It improves the accuracy and efficiency of book inventory, reduces labor costs, and can quickly and accurately match bibliography names in large-scale collections, correct identification errors and optimize the order of bookshelf placement.
Smart Images

Figure CN120356229A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of computer technology, and in particular, relates to a method, device, electronic device and computer program product for inventorying books based on OCR technology. Background Art
[0002] With the rapid progress of information automation and artificial intelligence technology, as a key storage and management platform for digital information resources, the efficiency and accuracy of daily management tasks of libraries have become a key research direction of the library industry. In the past, book inventory work mainly relied on manual operation or the use of physical tags such as barcodes / RFID for identification and verification. This method faces problems such as low efficiency, insufficient accuracy and high labor costs. In recent years, visual inventory technology based on optical character recognition (OCR) has emerged. This technology can capture and identify text information such as book titles, authors, publishers, etc. on the spine or cover of books, and then match the bibliographic information with high similarity based on the recognition results, thereby significantly improving the efficiency of inventory work.
[0003] However, in actual applications, libraries still face many challenges when using OCR technology to conduct inventory of their collections. On the one hand, the complexity and diversity of book catalogs increase the difficulty of recognition; on the other hand, the recognition accuracy limitations of OCR technology itself lead to unsatisfactory matching accuracy of bibliographic names. Summary of the invention
[0004] The embodiments of the present application provide a method, device, electronic device and computer program product for taking inventory of books based on OCR technology, which can solve the technical problem of inaccurate bibliographic name matching in the process of taking inventory of library books using OCR technology.
[0005] In a first aspect, an embodiment of the present application provides a method for inventorying books based on OCR technology, the method comprising:
[0006] In the case of executing the task of the current i-th batch of books to be counted, receiving the book images of the current i-th batch of books to be counted acquired by the image acquisition module;
[0007] Recognize the book image by using OCR technology to extract text information on the book sections of n books in the books to be counted from the book image; wherein i and n are both positive integers;
[0008] Determine the collection attribute information corresponding to the current i-th batch of book inventory tasks;
[0009] Obtain the to-be-matched book text information corresponding to the collection attribute information from the database, where the to-be-matched book text information includes multiple actual bibliographic names;
[0010] Match the text information on the book parts of the n books with each actual bibliographic name in the to-be-matched book text information to obtain the bibliographic names of the books that meet the matching threshold condition among the currently i-th batch of books to be inventoried.
[0011] Exemplarily, the collection attribute information at least includes venue information, collection location information, and call number range;
[0012] The steps of obtaining the to-be-matched book text information corresponding to the collection attribute information from the database, matching the text information on the book parts of the n books with each actual bibliographic name in the to-be-matched book text information to obtain the bibliographic names of the books that meet the matching threshold condition among the currently i-th batch of books to be inventoried include:
[0013] Construct a search engine query condition based on at least one of the venue information, the collection location information, and the call number range;
[0014] Search for the to-be-matched book text information corresponding to the search engine query condition from the database;
[0015] Determine the j-th book among the n books in the book image, and match the text information on the book part of the j-th book with each actual bibliographic name in the to-be-matched book text information; where j belongs to n and j is a positive integer;
[0016] When it is determined that there is an actual bibliographic name in the to-be-matched book text information that meets the matching threshold condition with the text information on the book part of the j-th book, obtain the actual bibliographic name of the j-th book and the call number of the j-th book in the call number range.
[0017] Exemplarily, the search engine query conditions include a first search engine query condition, a second search engine query condition, and a third search engine query condition; the first search engine query condition is constructed based on the venue information, the collection location information, and the call number range; the second search engine query condition is constructed based on the venue information and the collection location information; the third search engine query condition is constructed based on the venue information;
[0018] The method further includes:
[0019] In the case of processing the current i-th batch of book inventory tasks according to the query conditions of the first search engine, if there is no actual book title name in the book text information to be matched that meets the matching threshold condition with the text information on the book part of the j-th book, then execute processing the current i-th batch of book inventory tasks according to the query conditions of the second search engine;
[0020] In the case of processing the current i-th batch of book inventory tasks according to the query conditions of the second search engine, if there is no actual book title name in the book text information to be matched that meets the matching threshold condition with the text information on the book part of the j-th book, then execute processing the current i-th batch of book inventory tasks according to the query conditions of the third search engine.
[0021] Exemplarily, the method further includes:
[0022] Identify the maximum book serial number and the minimum book serial number from the book images related to the books to be inventoried in the current i-th batch;
[0023] Determine the current first and last book call number intervals according to the maximum book serial number and the minimum book serial number;
[0024] Correspondingly, in the case of determining that there is an actual book title name in the book text information to be matched that meets the matching threshold condition with the text information on the book part of the j-th book, after the steps of obtaining the actual book title name of the j-th book and the book serial number of the j-th book in the call number interval, it further includes:
[0025] Take the book serial number of the j-th book in the call number interval as a precondition for the (j + 1)-th book. When the book serial number of the j-th book is within the current first and last book call number interval, determine whether the book serial number of the (j + 1)-th book is within the current first and last book call number interval;
[0026] In the case where the book serial number of the (j + 1)-th book is not within the current first and last book call number interval, match the text information on the book part of the (j + 1)-th book with the book text information to be matched. In the case of determining that there is an actual book title name in the book text information to be matched that meets the matching threshold condition with the text information on the book part of the (j + 1)-th book, obtain the actual book title name of the (j + 1)-th book and the book serial number of the (j + 1)-th book in the call number interval;
[0027] Take the book serial number of the (j + 1)-th book in the call number interval as the new maximum book serial number, and determine a new first and last book call number interval according to the new maximum book serial number and the minimum book serial number.
[0028] Exemplarily, after the step of using OCR technology to recognize the book image to extract the text information on the book parts of n books in the to-be-inventoried books from the book image, the method further includes:
[0029] Display the text information on the book parts of n books in the to-be-inventoried books;
[0030] Respond to the adjustment information of the user to the text information to calibrate the text information.
[0031] Exemplarily, the method further includes:
[0032] After the step of matching the text information on the book parts of the n books with each actual book title in the to-be-matched book text information, if there is a situation where no match is found, then match the text information on the book parts of the book with the collection book title data in the database respectively. If the match fails, then perform calibration or error correction processing on the text information on the book parts of the book.
[0033] Exemplarily, after the step of matching the text information on the book part of the j-th book with each actual book title in the to-be-matched book text information, the method further includes:
[0034] In the case where the text information on the book part of the j-th book does not meet the matching threshold condition with the current actual book title in the to-be-matched book text information, traverse the books adjacent to the j-th book in the book image forward or backward until the j±x-th book whose similarity with the current actual book title meets the matching threshold condition is found; where x is a positive integer, -x represents the number of forward traversals, and +x represents the number of backward traversals.
[0035] In a second aspect, an embodiment of the present application provides a device for inventorying books based on OCR technology, including:
[0036] An optical character recognition module, configured to receive the book image of the current i-th batch of to-be-inventoried books collected by the image acquisition module when performing the task of the current i-th batch of to-be-inventoried books; use OCR technology to recognize the book image to extract the text information on the book parts of n books in the to-be-inventoried books; where both i and n are positive integers;
[0037] A query condition acquisition module, configured to determine the collection attribute information corresponding to the current i-th batch of book inventory tasks;
[0038] The book inventory module is used to obtain the to-be-matched book text information corresponding to the collection attribute information from the database. The to-be-matched book text information includes multiple actual book titles; match the text information on the book spines of the n books with each actual book title in the to-be-matched book text information to obtain the book titles of the books that meet the matching threshold condition among the to-be-inventoried books in the current i-th batch.
[0039] In a third aspect, an embodiment of the present application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the method for inventorying books based on the OCR technology as described in the first aspect are implemented.
[0040] In a fourth aspect, an embodiment of the present application provides a computer program product. When the computer program product runs on an electronic device, the computer program is executed by the processor to implement the steps of the method for inventorying books based on the OCR technology as described in the first aspect. It can be understood that the beneficial effects of the above second aspect to the fourth aspect can refer to the relevant descriptions in the first aspect, and will not be repeated here.
[0041] The beneficial effects of the embodiment of the present application compared with the prior art are as follows: when performing the task of the to-be-inventoried books in the current i-th batch, receive the book images of the to-be-inventoried books in the current i-th batch collected by the image acquisition module; use the OCR technology to identify the book images to extract the text information on the book spines of the n books in the to-be-inventoried books; determine the collection attribute information corresponding to the book inventory task of the current i-th batch; obtain the to-be-matched book text information corresponding to the collection attribute information from the database; match the text information on the book spines of the n books with each actual book title in the to-be-matched book text information to obtain the book titles of the books that meet the matching threshold condition among the to-be-inventoried books in the current i-th batch. Thus, the technical problem of inaccurate book title matching in the process of inventorying library books using the OCR technology is solved. Description of the Drawings
[0042] To more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required for use in the embodiments or the description of the prior art. Obviously, the following drawings are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0043] Figure 1 It is a schematic structural diagram of the electronic device provided by the embodiment of the present application;
[0044] Figure 2 It is a schematic flow diagram of a method for inventorying books based on OCR technology provided by an embodiment of the present application;
[0045] Figure 3 It is a schematic structural diagram of a device for inventorying books based on OCR technology provided by an embodiment of the present application. Detailed implementation manners
[0046] In the following description, specific details such as specific system structures and technologies are proposed for the purpose of illustration rather than limitation, so as to thoroughly understand the embodiments of the present application. However, those skilled in the art should clearly understand that the present application can also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to avoid unnecessary details from interfering with the description of the present application.
[0047] It should be understood that when used in the specification and claims of the present application, the term "comprising" indicates the presence of the described features, wholes, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components, and / or their combinations.
[0048] It should also be understood that the term "and / or" as used in the specification and claims of the present application refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0049] As used in the specification and claims of the present application, the term "if" can be interpreted as "when", "once", "in response to determining", or "in response to detecting" according to the context. Similarly, the phrase "if determined" or "if [the described condition or event] is detected" can be interpreted as meaning "once determined", "in response to determining", "once [the described condition or event] is detected", or "in response to detecting [the described condition or event]" according to the context.
[0050] In addition, in the description of the specification and claims of the present application, the terms "first", "second", "third", etc. are only used for distinguishing descriptions and cannot be understood as indicating or implying relative importance.
[0051] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of this application. Thus, statements such as "in one embodiment", "in some embodiments", "in other some embodiments", "in still other embodiments", etc. that appear in different places in this specification do not necessarily all refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized. The terms "comprising", "including", "having" and their variants all mean "including but not limited to", unless otherwise specifically emphasized.
[0052] It can be understood that with the rapid development of information automation technology and artificial intelligence technology, as an important storage and management platform for digital information resources, the efficiency and accuracy of the daily management tasks of libraries have become an important research direction in the library industry. Traditional book inventory relies on manual labor or physical tags such as barcodes / RFIDs for identification and verification, which has problems such as low efficiency, poor accuracy, and high labor costs. The visual inventory technology based on Optical Character Recognition (OCR) can identify and extract text information such as the title, author, and publisher on the book spine or cover of a book, and calculate and match the bibliographic information with a relatively high similarity based on the recognition results, thereby improving the efficiency of the inventory operation.
[0053] However, the prior art has the following disadvantages:
[0054] OCR recognition accuracy problem: OCR technology is sensitive to light, and there may be problems such as misspelled words, missing words, or misjudgment of complex fonts in the recognition results.
[0055] Lack of complex book title calculation and matching: Due to the error of the OCR recognition results, it is a huge challenge to accurately match the bibliographic information in the database.
[0056] Calculation and matching efficiency problem: The library collection is huge, and traditional calculation and matching algorithms are inefficient in processing large amounts of data.
[0057] In view of the above technical problems, the embodiments of this application propose a method, device, electronic device, and computer program for inventorying books based on OCR technology. The technical solutions of this application will be elaborated below through specific embodiments.
[0058] In a first aspect, the method for inventorying books based on OCR technology provided by the embodiments of the present application can be applied to an electronic device, which includes but is not limited to terminal devices such as mobile phones, tablet computers, wearable devices, augmented reality (AR) / virtual reality (VR) devices, laptop computers, ultra-mobile personal computers (UMPCs), netbooks, personal digital assistants (PDAs), etc. The embodiments of the present application do not impose any restrictions on the specific type of the electronic device.
[0059] For example, the electronic device may be a station (STAION, ST) in a WLAN, a cellular phone, a cordless phone, a Session Initiation Protocol (SIP) phone, a Wireless Local Loop (WLL) station, a Personal Digital Assistant (PDA) device, a handheld device with wireless communication functions, a computing device or other processing devices connected to a wireless modem, a computer, a laptop computer, a handheld communication device, a handheld computing device, a satellite wireless device, a wireless modem card, a customer premise equipment (CPE), and / or other devices for communicating on a wireless system, as well as next-generation communication systems, such as a mobile terminal in a 5G network or a mobile terminal in a future evolved Public Land Mobile Network (PLMN) network.
[0060] By way of example and not limitation, when the electronic device is a wearable device, the wearable device may also be a general term for devices developed by applying wearable technology to the intelligent design of daily wear, such as glasses, gloves, watches, clothing, and shoes. A wearable device is a portable device that is either worn directly on the body or integrated into the user's clothes or accessories. A wearable device is not just a hardware device, but also realizes powerful functions through software support, data interaction, and cloud interaction. Broadly speaking, wearable intelligent devices include those with complete functions and large sizes that can achieve complete or partial functions without relying on a smart phone, such as smart watches or smart glasses, as well as those that only focus on a certain type of application function and need to cooperate with other devices such as smart phones, such as various smart bracelets and smart jewelry for physical sign monitoring.
[0061] Figure 1 It is a schematic structural diagram of the electronic device 1 provided by an embodiment of the present application. AsFigure 1 As shown, the electronic device 1 of this embodiment includes: at least one processor 10 ( Figure 1 only one is shown in the figure), a memory 11, an image acquisition module 13, and a computer program 12 stored in the memory 11 and executable on the at least one processor 10. When the processor 10 executes the computer program 12, it implements the steps in the method embodiment of inventorying books based on OCR technology in this application.
[0062] The electronic device 1 may be a computing device such as a desktop computer, a notebook, a palm computer, and a smart phone. The electronic device 1 may include, but is not limited to, a processor 10 and a memory 11. Those skilled in the art can understand that Figure 1 merely examples of the electronic device 1, which do not constitute a limitation on the electronic device 1, and may include more or fewer components than shown in the figure, or combine some components, or different components. For example, it may also include input / output devices, network access devices, etc.
[0063] The image acquisition module 13 may be a high-definition camera. During the process of relevant staff using the electronic device 1 to perform the book inventory task, the image acquisition module 13 can be used to take pictures of each batch of books to be inventoried on the bookshelves in the library, so as to acquire book images related to each batch of books to be inventoried.
[0064] The so-called processor 10 may be a central processing unit (CPU), and the processor 10 may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0065] As Figure 1 shown, Figure 1The electronic device shown is also provided with a memory 11, which in some embodiments may be an internal storage unit of the computer device, such as the hard disk or memory of the computer device. In some other embodiments, the memory 11 may also be an external storage device of the computer device, such as the Dynamic Random Access Memory (DRAM), Solid State Drive (SSD for short), and Hard Disk Drive (HDD) equipped on the computer device. Further, the memory 11 may also include both the internal storage unit and the external storage device of the computer device. The memory 11 is used to store the operating system, application programs, BootLoader, data, and other programs, etc. The memory 11 of the computer device stores a computer program 12, and the processor 10 is configured to run the computer program 12. The computer program 12 may also include programs related to OCR technology. By running the programs related to OCR technology, optical character recognition technology is used to extract the text information on the book parts of each book image from the book images related to each batch of books to be inventoried.
[0066] In a second aspect, Figure 2 The schematic flowchart of the method for inventorying books based on OCR technology provided by the present application is shown. By way of example and not limitation, this method can be applied to the above-mentioned electronic device 1. Accordingly, the electronic device 1 will execute the following related steps of the method for inventorying books based on OCR technology:
[0067] Step S101: When executing the task of the current i-th batch of books to be inventoried, receive the book images of the current i-th batch of books to be inventoried collected by the image acquisition module.
[0068] In this embodiment, a smart phone is used as the electronic device 1. In a specific application, during the process of the relevant staff in the library performing the task of inventorying books, the electronic device 1 can be held to inventory the books on the bookshelves in each collection area of the library. The image acquisition module 13 of the electronic device 1 can be used to take pictures of each batch of books to be inventoried on the bookshelves in the library to collect the book images related to each batch of books to be inventoried.
[0069] Step S102: Use OCR technology to identify the book images to extract the text information on the book parts of n books in the books to be inventoried from the book images.
[0070] It is understandable that, in the case of obtaining the book image collected by the image acquisition module 13, this embodiment will use OCR technology to identify and extract the text information on the book part of the book image. The text information on the book part may include text information such as the book title, author, and publisher on the spine (or the front cover) of the book.
[0071] Step S20: Determine the collection attribute information corresponding to the current i-th batch of book inventory tasks. The collection attribute information at least includes venue information, collection location information, and call number range information.
[0072] It is understandable that during the process of the electronic device 1 running the computer program 12 to conduct an inventory of the current i-th batch of book inventory tasks, the electronic device 1 will determine the collection attribute information corresponding to the current i-th batch of book inventory tasks:
[0073] One implementation method is: The collection attribute information corresponding to the current i-th batch of book inventory tasks can be obtained by the electronic device 1 collecting the shelf text information attached to the bookshelf through the image acquisition module 13. For example, the shelf text on the bookshelf includes venue information, collection location information, and call number range information.
[0074] Another implementation method is: The collection attribute information corresponding to the current i-th batch of book inventory tasks can be the collection attribute information manually input by the staff when performing the current i-th batch of book inventory tasks. For example, the staff can input the venue information, collection location information, and call number range information into the electronic device 1 through a human-computer interaction method.
[0075] Step S30: Obtain the to-be-matched book text information corresponding to the collection attribute information from the database, and match the text information on the book parts of the n books with the actual book titles in the to-be-matched book text information to obtain the book titles of the books that meet the matching threshold condition among the to-be-inventoried books in the current i-th batch.
[0076] The embodiment of the present application can solve the technical problem of inaccurate book title matching during the process of using OCR technology to conduct an inventory of the collection of books, and complete an accurate matching result under the condition of ensuring the matching efficiency.
[0077] It is understandable that the computer program 12 stored in the electronic device 1 of the present application can be implemented based on a pre-constructed basic search engine analysis library;
[0078] During the specific process of constructing the basic search engine analysis library, it includes:
[0079] 1. Index Design: Index design is a core part of optimizing query performance and data storage. When designing a computer program 12, it is necessary to consider the size of the data volume and the selection of the data model. The index design content of this embodiment includes three types, namely the collection bibliographic data index, the text calibration data index, and the misspelling correction data index. When the electronic device 1 is officially running the computer program 12, it will detect whether the corresponding index exists. If not, it will automatically create and maintain the index according to the designed index. The index content of this embodiment includes:
[0080] Collection bibliographic data index: Define the data model according to the attributes of the library collection bibliographies, then map the relevant data types of the fields of the data model, and finally convert it into a standard index template.
[0081] Text calibration data index: By defining the core business fields, including the identification location, the identified content, the matching content, the calibration content, and the calibration type, etc., map the relevant data types, and customize the standard index template.
[0082] Misspelling correction data index: By defining the core business fields, including the identification location, the identified content, the misspelled word content, the corrected content, and the correction rules, etc., map the relevant data types, and customize the standard index template.
[0083] 2. Tokenizer Design: A tokenizer (Analyzer) is a component used to analyze text data and split it into terms. A reasonable tokenizer design can significantly improve the accuracy and performance of queries. In this application embodiment, the IKAnalyzer open-source Chinese tokenizer plugin is selected for design, which supports multiple tokenization modes and realizes custom tokenization pauses for complex bibliographic names.
[0084] 3. Data Import: Data import is to import the collection bibliographic information in the database into the above-mentioned collection bibliographic data index. There are two ways of data import in this application embodiment. The first is the regular synchronous incremental method, and the second is the incremental method during the business interface synchronization process. Each import method supports large-scale batch data import and has high import timeliness.
[0085] 4. Query Analysis and Performance Optimization: First, determine the character size based on the OCR recognition content, and then construct respective query condition algorithms for character content of different sizes. For example, an algorithm rule for one character (prioritize exact match, followed by fuzzy match, and finally wildcard match, with at least one of the three matches); an algorithm rule for two characters (in addition to including the one-character algorithm rule, add word segmentation match, with at least one of the four matches); an algorithm rule for more than three characters (prioritize exact match, followed by paragraph match, followed by fuzzy match, followed by word segmentation match, and finally similarity match, with at least one of the five matches), etc. And each calculation and matching process restricts key algorithm conditions such as query fields, the number of query results, and the minimum matching rate to ensure retrieval performance and efficiency.
[0086] In the specific implementation, after using the OCR technology to extract the text information on the covers of n books to be inventoried from the book images in step S102, the text information will be preprocessed to filter out special illegal characters and reduce the interference of illegal characters on subsequent calculation and matching.
[0087] During the execution of step S30, the embodiment of the present application will find the text information of the books to be matched corresponding to the library collection attribute information from the database according to the determined library collection attribute information corresponding to the i-th batch of book inventory tasks. The text information of the books to be matched contains multiple actual book titles.
[0088] For example, the venue information in the library collection attribute information is the East District Library, the collection location information is on the third floor, and the book category in the call number range information is "Journey to the West" (i.e., books related to the theme of "Journey to the West").
[0089] Then execute the step of querying the database in step S30. The actual call number range information of the book serial numbers (i.e., the text information of the books to be matched) found from the database according to the library collection attribute information corresponding to the i-th batch of book inventory tasks includes: I247.5 / 1001 - I247.5 / 1010 (10 books); that is, assuming that the book category in the call number area processed in the current batch is related to "Journey to the West", for example, the book title corresponding to I247.5 / 1001 is "Journey to the West", the book title corresponding to I247.5 / 1002 is "The Return of the Monkey King"… the book title corresponding to I247.5 / 1010 is "Wu Chengen and Journey to the West". That is, in the above example, the text information of the books to be matched successively includes the actual book titles of 10 books with call numbers from I247.5 / 1001 to I247.5 / 1010.
[0090] For each of the n books corresponding to the book images of the books to be inventoried, the processor will traverse each book in turn. For example, when traversing the j-th book, the text information on the book part of the j-th book is matched with each actual book title name in the text information of the book to be matched. When it is determined that there is an actual book title name in the text information of the book to be matched that meets the matching threshold condition with the text information on the book part of the j-th book, the actual book title name corresponding to the j-th book and the book serial number of the j-th book in the call number range are obtained, and the book serial number of the j-th book in the call number range is used as the precondition for the (j + 1)-th book.
[0091] Specifically, the matching threshold condition may be: comparing the text information on the book part of the j-th book with each actual book title name in the text information of the book to be matched, obtaining the actual book title name X that is closest to the similarity of the text information on the book part of the j-th book. If the similarity between the actual book title name X and the text information on the book part of the j-th book reaches the system parameter threshold, it can be determined that the two match successfully. Finally, the processor confirms that the actual book title name of the j-th book is X and finds the book serial number of the j-th book in the current call number range from the database.
[0092] In other embodiments, the Jaccard algorithm can also be used. That is, the text information on the book parts of the n books in the book images related to the books to be inventoried in the current i-th batch is used as the first set, and the text information of the books to be matched in the database is used as the second set. The Jaccard algorithm is used to measure the similarity between the text information on each book part in the first set and each actual book title name in the second set, and the item with the highest similarity is used as the actual book title name corresponding to the j-th book.
[0093] In specific implementation, this embodiment can be divided into three stages to match the text information on the book parts of the n books with each actual book title name in the text information of the books to be matched, including:
[0094] (1) Pass the venue information, collection location information, call number range, text information (the text information on the book parts of the n books) and filter condition values into the first-stage calculation and matching model, then construct the first search engine query condition, set the query parameters, complete the retrieval query and return the relevant list content, and calculate the item with the highest similarity value in the relevant list as the first-stage matching result through the Jaccard similarity algorithm.
[0095] (2) If the matching result of the first-stage calculation is empty or the similarity value does not meet the system threshold condition, then the second-stage calculation matching algorithm model is processed. The venue information, collection location information, text information (the text information on the book parts of the n books), and the filtering condition value are passed into the second-stage calculation matching model to construct the search engine query conditions, set the query parameters, complete the retrieval query, and return the content of the relevance list. The item with the highest similarity value in the relevance list is calculated through the Jaccard similarity algorithm as the second-stage matching result.
[0096] (3) If the matching results of both the first stage and the second stage are empty or the similarity values do not meet the matching threshold condition, then the third-stage calculation matching algorithm model is processed. The library information, text information (the text information on the book parts of the n books), and the filtering condition value are passed into the third-stage calculation matching model. Similarly, after constructing the search engine query conditions, setting the query parameters, completing the retrieval query, and returning the content of the relevance list, the item with the highest similarity value in the relevance list is calculated through the Jaccard similarity algorithm as the third-stage matching result.
[0097] Through the model calculation and processing of the above three stages, the actual bibliographic name with a relatively high similarity is obtained, realizing fast and efficient calculation and matching: that is, by designing the search engine library and using the inverted index, fuzzy query, and intelligent matching mechanism, the best-matched book title list can be quickly found in the large-scale bibliographic database.
[0098] Then, the call number of the j-th book in the call number range of the bibliographic name is extracted, and its call number is used as the precondition filtered in each stage of the calculation and matching model of the text information of the next (j + 1)-th OCR recognition, ensuring that the bibliographies with the same call number can only be calculated and matched once at the same position during one inventory, and during the processing, the maximum call number and the minimum call number will be recognized from the book images related to the currently i-th batch of books to be inventoried; that is, the minimum call number is used as the leading call number of the first book, and the maximum call number is used as the ending call number of the last book to define the current leading and ending call number range.
[0099] Specifically, the call number of the j-th book in the call number range is used as the precondition for the (j + 1)-th book. When the call number of the j-th book is within the current leading and ending call number range, it is determined whether the call number of the (j + 1)-th book is within the current leading and ending call number range.
[0100] In the case that the book number of the (j + 1)-th book is not within the current first and last call number range, use the class number of the call number range, the OCR text information (the text information on the book parts of n books in the books to be inventoried), and the filtering condition value as the new input conditions of the matching model to match the text information on the book part of the (j + 1)-th book with the text information of the books to be matched;
[0101] When it is determined that there is an actual bibliographic name in the text information of the books to be matched that meets the matching threshold condition with the text information on the book part of the (j + 1)-th book, obtain the actual bibliographic name corresponding to the (j + 1)-th book and the book number of the (j + 1)-th book in the call number range;
[0102] Take the book number of the (j + 1)-th book in the call number range as the new maximum book number, and determine a new pending call number range according to the new maximum book number and the minimum book number.
[0103] It can be understood that during the process of executing the task of the books to be inventoried in the current i-th batch, when it is correct to inventory the i-th book among them, it cannot be guaranteed that the books placed on the bookshelf at the next book number position of the i-th book are necessarily arranged in the correct order. For example, the correct arrangement is I247.5 / 1001, I247.5 / 1002, I247.5 / 1003, I247.5 / 1004, I247.5 / 1005, but the actual arrangement may be: I247.5 / 1001, I247.5 / 1005, I247.5 / 1002, I247.5 / 1003, I247.5 / 1004. Assume that the current first and last call number range is {1001, 1004}, and it is known that the book number of the j-th book is I247.5 / 1001. Then, the actual arrangement of the unknown (j + 1)-th book is that its book number position is occupied by I247.5 / 1005, and the correct arrangement of the (j + 1)-th book should be the book with the book number I247.5 / 1002. Here, the misplacement of the electronic device will be recorded to remind the staff to arrange it in the correct order, but they all belong to the same book class I247.5 (for example, the theme of the book class corresponding to I247.5 is "Journey to the West"). The electronic device will update the current first and last call number range from {1001, 1004} to {1001, 1005}. For each book in the book images related to the books to be inventoried in the current i-th batch, repeat the above method to solve the problem of poor recognition accuracy caused by incorrect actual bookshelf arrangement during the process of the OCR technology judging books, and improve the accuracy of the matching result.
[0104] This embodiment can achieve a good matching effect in the scenario of arranging bibliographic call numbers in sequence, reducing the interference of matching anomalies. Moreover, by adopting the algorithm technology of OCR visual inventory calculation and matching based on the design model of extracting the first and last call number intervals, it can effectively eliminate abnormal matching results and greatly improve the matching accuracy rate.
[0105] In addition, in some other embodiments, the electronic device 1 will display the text information on the book parts of n books among the books to be inventoried extracted in the above step S102.
[0106] Since the OCR technology is sensitive to light, there will be some errors or mistakes in the recognized text information, such as misidentifying characters, missing characters, or misjudging complex fonts, which greatly affects the recognition accuracy rate. In this regard, during the process of the relevant staff holding the electronic device 1 to take pictures of each batch of books to be inventoried on the bookshelves in the library, the electronic device will display the text information on the book parts of each book obtained by the OCR technology; the relevant personnel can visually check the text information for typos caused by the inherent defects of the OCR technology at any time, for example, due to light reasons, misidentifying "Journey to the West" as "Record of the Journey to the West" or "Saiyuuki". By means of manual maintenance, calibration, and error correction, the correctness of the text information on the book parts in the book images can be ensured before the next processing link in the first time, so as to provide guarantee for the subsequent book inventory task. This solution requires additional manual operations, but can reduce the development cost and hardware cost.
[0107] In some other embodiments, after performing the step of "matching the text information on the book parts of the n books with the actual bibliographic names in the text information of the books to be matched" in step S30, if there is no match (for example, the matching result is incorrect or the matching result is empty), then the text information on the book parts of the book will be respectively matched with the library collection bibliographic data in the database. If the match fails, calibration or error correction processing will be performed on the text information on the book parts of the book.
[0108] In addition, in some other embodiments, when it is determined that there is an actual bibliographic name in the text information of the books to be matched that meets the matching threshold condition with the text information on the book part of the jth book, the system will also determine whether calibration or error correction is required. If so, the system will process according to the predefined calibration and error correction rules to ensure the accuracy of the final matching result.
[0109] In a specific implementation, the text calibration in this embodiment can be as follows: by constructing an index dictionary library for text calibration, the system can compare the text content recognized by OCR with the content in the calibration library to find the closest correct text. In a specific application, when there are typos, missing words, or format errors in the text recognized by OCR, the system will correct them according to the rules in the calibration library to ensure the accuracy of the text.
[0110] The method for correcting misspelled words in this embodiment can be: by constructing an index dictionary library for misspelled word correction, the system can search for the correct text in the correction library based on the incorrect text recognized by OCR and perform replacement or correction. The specific application scenario can be when there are spelling mistakes, character errors, or recognition errors in the text recognized by OCR, and the system will correct them according to the rules in the error correction library to ensure the correctness of the text.
[0111] The embodiments of this application can improve the precise management and utilization of bibliographic information: through efficient book title matching, it can help libraries manage and retrieve bibliographic information more precisely, avoiding redundant data and incorrect matching.
[0112] The embodiments of this application have strong fault tolerance and flexible fuzzy matching: during the OCR recognition process, if there are small errors or fuzziness, the algorithm can not only perform fault-tolerant matching, but also handle recognition errors, incomplete characters, or similar book titles, and can make reasonable corrections and supplements through matching similarity or calibration and error correction.
[0113] Through the method of automatic error correction and calibration, it can ensure the correctness of the text information in the book part of the book image in the first time before the next processing link, providing guarantee for the subsequent book inventory task.
[0114] In addition, in some embodiments, the embodiments of this application also design a dynamic forward and backward similarity inference design and calculation matching scheme:
[0115] Specifically, the design rule is: in the same batch of recognition and matching tasks, for the results obtained through the above calculation and matching, there may be a low similarity value of the matching book title names, not meeting the matching threshold conditions. At this time, according to the recognition position relationship, starting from the current recognition position j, first traverse forward to find the book title name that meets the system-set threshold conditions, and then traverse backward to find the book title name that meets the system-set threshold conditions. After finding the corresponding book title name (if traversing forward, the recognition position of the corresponding book title name is j - x; if traversing backward, the recognition position of the corresponding book title name is j + x), calculate the correlation value through the Jaccard similarity algorithm, and obtain the book title name with the largest correlation value. Finally, perform calculation and matching on the book title names that meet the conditions to infer a more reliable book title name.
[0116] Specifically, after the step of matching the text information on the book part of the j-th book with each actual book title name in the book text information to be matched, the method further includes:
[0117] In the case where the text information on the book part of the j-th book does not meet the matching threshold condition with the current actual book title name in the book text information to be matched, traverse forward or backward the books adjacent to the j-th book in the book image (in this embodiment, it can be set to traverse forward 3 times and backward 3 times by default) until the j±x-th book whose similarity with the current actual book title name meets the matching threshold condition is found. Thus, when solving the problem that does not meet the matching threshold condition in the book copy, the accuracy of the matching result calculated for the book copy can be greatly improved. The matching accuracy of the book copy in this embodiment is greatly improved, and it can accurately match the book title name in the case of large OCR recognition errors.
[0118] Corresponding to the method for inventorying books based on OCR technology described in the above embodiments, Figure 3 The structural block diagram of the device for inventorying books based on OCR technology provided by the embodiments of the present application is shown. For the sake of convenience of description, only the parts related to the embodiments of the present application are shown.
[0119] Refer to Figure 3 , the device includes:
[0120] An optical character recognition module 10, configured to receive the book image of the current i-th batch of books to be inventoried collected by the image acquisition module when performing the task of the current i-th batch of books to be inventoried; use OCR technology to recognize the book image to extract the text information on the book parts of n books in the books to be inventoried; where i and n are both positive integers;
[0121] A query condition acquisition module 20, configured to determine the library collection attribute information corresponding to the current i-th batch of book inventory tasks;
[0122] A book inventory module 30, configured to obtain the book text information to be matched corresponding to the library collection attribute information from the database, where the book text information to be matched includes multiple actual book title names; match the text information on the book parts of the n books with each actual book title name in the book text information to be matched to obtain the book title names of the books that meet the matching threshold condition in the current i-th batch of books to be inventoried.
[0123] It should be noted that for the information interaction, execution process, etc. between the above devices / units, since they are based on the same concept as the method embodiments of the present application, their specific functions and the technical effects brought are specifically described in the method embodiment part, and will not be elaborated here.
[0124] Those skilled in the art can clearly understand that, for the convenience and conciseness of description, only the above division of each functional unit and module is used as an example. In actual applications, the above functions can be allocated to different functional units and modules according to needs, that is, the internal structure of the device is divided into different functional units or modules to complete all or part of the functions described above. Each functional unit and module in the embodiment can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit. In addition, the specific names of each functional unit and module are only for the convenience of mutual distinction and do not limit the protection scope of this application. The specific working processes of the units and modules in the above system can refer to the corresponding processes in the foregoing method embodiments and will not be elaborated here.
[0125] The embodiment of the present application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned method embodiments for inventorying books based on OCR technology can be implemented.
[0126] The embodiment of the present application provides a computer program product. When the computer program product runs on a mobile terminal, the mobile terminal can implement the steps in the above-mentioned method embodiments for inventorying books based on OCR technology.
[0127] If the above integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, to implement all or part of the processes in the above method embodiments of the present application, a computer program can be used to instruct relevant hardware to complete. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in the form of source code, object code, executable file or some intermediate form, etc. The computer-readable medium can at least include: any entity or device that can carry the computer program code to the photographing device / electronic device, recording medium, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electrical carrier signal, telecommunication signal, and software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disc, etc. In some jurisdictions, according to legislation and patent practice, the computer-readable medium cannot be an electrical carrier signal and a telecommunication signal.
[0128] In the above embodiments, the descriptions of the respective embodiments have their own emphases. For parts not described in detail or recorded in a certain embodiment, reference may be made to the relevant descriptions of other embodiments.
[0129] Those of ordinary skill in the art will realize that the units and algorithm steps of the examples described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are executed in hardware or software depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of this application.
[0130] In the embodiments provided in this application, it should be understood that the disclosed apparatus / network device and method can be implemented in other ways. For example, the apparatus / network device embodiments described above are merely illustrative. For example, the division of the modules or units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections to each other can be through some interfaces. The indirect couplings or communication connections of the devices or units can be electrical, mechanical or other forms.
[0131] The units described as separate components may or may not be physically separated. The components shown as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0132] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements for some of the technical features. And these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included in the protection scope of this application.
Claims
1. A method for inventorying books based on OCR technology, characterized in that, The method includes: When executing the task of the books to be inventoried in the current i-th batch, receiving the book images of the books to be inventoried in the current i-th batch collected by the image acquisition module; Using OCR technology to identify the book images, so as to extract the text information on the book parts of n books in the books to be inventoried from the book images; where both i and n are positive integers; Determining the library collection attribute information corresponding to the book inventory task of the current i-th batch; Obtaining the to-be-matched book text information corresponding to the library collection attribute information from the database, where the to-be-matched book text information includes multiple actual bibliographic names; matching the text information on the book parts of the n books with each actual bibliographic name in the to-be-matched book text information to obtain the bibliographic names of the books that meet the matching threshold condition in the books to be inventoried in the current i-th batch.
2. The method according to claim 1, characterized in that The library collection attribute information at least includes venue information, collection location information, and call number range; The obtaining the to-be-matched book text information corresponding to the library collection attribute information from the database, and matching the text information on the book parts of the n books with each actual bibliographic name in the to-be-matched book text information to obtain the bibliographic names of the books that meet the matching threshold condition in the books to be inventoried in the current i-th batch includes: Constructing a search engine query condition based on at least one of the venue information, the collection location information, and the call number range; Searching in the database for the to-be-matched book text information corresponding to the search engine query condition; Determining the j-th book among the n books in the book image, and matching the text information on the book part of the j-th book with each actual bibliographic name in the to-be-matched book text information; where j belongs to n and j is a positive integer; When it is determined that there is an actual bibliographic name in the to-be-matched book text information that meets the matching threshold condition with the text information on the book part of the j-th book, obtaining the actual bibliographic name of the j-th book and the call number of the j-th book in the call number range.
3. The method according to claim 2, wherein The search engine query condition includes a first search engine query condition, a second search engine query condition, and a third search engine query condition; the first search engine query condition is constructed based on the venue information, the collection location information, and the call number range; the second search engine query condition is constructed based on the venue information and the collection location information; The third search engine query condition is constructed based on the venue information; The method further includes: When processing the book inventory task of the current i-th batch according to the first search engine query condition, if there is no actual bibliographic name in the to-be-matched book text information that meets the matching threshold condition with the text information on the book part of the j-th book, then execute processing the book inventory task of the current i-th batch according to the second search engine query condition; In the case of processing the current i-th batch of book inventory tasks according to the query conditions of the second search engine, if there is no actual bibliographic name in the to-be-matched book text information that satisfies the matching threshold condition with the text information on the book spine of the j-th book, then execute processing the current i-th batch of book inventory tasks according to the query conditions of the third search engine.
4. The method according to claim 2, wherein The method further includes: Identifying the maximum call number and the minimum call number from the book images related to the books to be inventoried in the current i-th batch; Determining the current first and last call number intervals according to the maximum call number and the minimum call number; After the step of, in the case of determining that there is an actual bibliographic name in the to-be-matched book text information that satisfies the matching threshold condition with the text information on the book spine of the j-th book, obtaining the actual bibliographic name of the j-th book and the call number of the j-th book in the call number interval, the method further includes: Taking the call number of the j-th book in the call number interval as a precondition for the (j + 1)-th book, and when the call number of the j-th book is within the current first and last call number intervals, determining whether the call number of the (j + 1)-th book is within the current first and last call number intervals; In the case that the call number of the (j + 1)-th book is not within the current first and last call number intervals, matching the text information on the book spine of the (j + 1)-th book with the to-be-matched book text information, and in the case of determining that there is an actual bibliographic name in the to-be-matched book text information that satisfies the matching threshold condition with the text information on the book spine of the (j + 1)-th book, obtaining the actual bibliographic name of the (j + 1)-th book and the call number of the (j + 1)-th book in the call number interval; Taking the call number of the (j + 1)-th book in the call number interval as the new maximum call number, and determining a new first and last call number interval according to the new maximum call number and the minimum call number.
5. The method according to any one of claims 1-4, characterized in that After the step of using OCR technology to recognize the book images to extract the text information on the book spines of n books in the books to be inventoried, the method further includes: Displaying the text information on the book spines of n books in the books to be inventoried; Responding to the adjustment information of the user for the text information to calibrate the text information.
6. The method according to any one of claims 2-4, characterized in that, The method further includes: After the step of matching the text information on the book spines of the n books with each actual bibliographic name in the to-be-matched book text information, if there is a situation where a match cannot be made, then match the text information on the book spines of the books with the library collection bibliographic data in the database respectively. If the match fails, perform calibration or error correction processing on the text information on the book spines of the books.
7. The method according to any one of claims 2 to 4, characterized in that, After the step of matching the text information on the book spine of the j-th book with each actual bibliographic name in the to-be-matched book text information, the method further includes: In the case where the text information on the book part of the j-th book does not meet the matching threshold condition with the current actual book title name in the book text information to be matched, traverse the books adjacent to the j-th book in the book image forward or backward until the j±x-th book with a similarity to the current actual book title name that meets the matching threshold condition is found; where x is a positive integer, -x represents the number of forward traversals, and +x represents the number of backward traversals.
8. An apparatus for inventorying books based on OCR technology, characterized in that, Including: An optical character recognition module, configured to receive the book image of the current i-th batch of books to be inventoried collected by the image acquisition module when performing the task of the current i-th batch of books to be inventoried; Use OCR technology to recognize the book image to extract the text information on the book parts of n books in the books to be inventoried; where both i and n are positive integers; A query condition acquisition module, configured to determine the library collection attribute information corresponding to the current i-th batch of book inventory tasks; A book inventory module, configured to obtain the book text information to be matched corresponding to the library collection attribute information from the database, where the book text information to be matched includes multiple actual book title names; match the text information on the book parts of the n books with each actual book title name in the book text information to be matched to obtain the book title names of the books that meet the matching threshold condition in the current i-th batch of books to be inventoried.
9. An electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method for inventorying books based on OCR technology according to any one of claims 1 to 7.
10. A computer program product storing a computer program, characterized in that, When the computer program product runs on an electronic device, the computer program is executed by a processor to implement the method for inventorying books based on OCR technology according to any one of claims 1 to 7.