Image recognition system, method, electronic device, and computer storage medium
Patent Information
- Application Number
- CN202211654201.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-22
- Publication Date
- 2026-09-25
- Estimated Expiration
- 2042-12-22
AI Technical Summary
[0004]但是,当需要对系统中某一个功能进行升级时,需要将整个项目停机然后进行升级,从而导致用户使用不便,用户使用体验差
[0016]根据本申请实施例提供的图像识别系统,通过分布式的思想将系统划分为文件存储模块、图像识别模块和数据处理模块,数据处理模块将文件存储模块存储的待识别图像传输至图像识别模块,并将识别后的识别结果发送回文件存储模块,从而可以完成图像识别过程,且由于系统中的不同功能处于不同模块中,因此单一模块执行操作的成功与失败不会影响整个系统的运转,当需要进行功能升级拓展时,仅需要对该功能所处的模块进行升级即可,无需将整个系统停机升级,满足了用户的图像识别需求,提高了用户的使用体验。
Smart Images

Figure CN115984676B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing technology, and in particular to an image recognition system, method, electronic device, and computer storage medium. Background Technology
[0002] Image recognition is a technology that uses computers to process, analyze, and understand images in order to identify targets and objects of various patterns according to recognition needs. It is a practical application of deep learning algorithms.
[0003] Currently, the image recognition system uses a third-party recognition engine, and all functions in the entire system are integrated into a single WAR file as a web project.
[0004] However, when it is necessary to upgrade a certain function in the system, the entire project needs to be shut down before the upgrade can be performed, which causes inconvenience to users and results in a poor user experience. Summary of the Invention
[0005] In view of the above, embodiments of this application provide an image recognition system, method, electronic device, and computer storage medium to at least partially solve the above problems.
[0006] According to a first aspect of the embodiments of this application, an image recognition system is provided, the system comprising: a file storage module, an image recognition module, and a data processing module; the file storage module is connected to the data processing module, and the data processing module is connected to the image recognition module; the file storage module is used to store an image to be recognized and an image recognition result sent by the data processing module; the data processing module is used to send the image to be recognized from the file storage module to the file input path of the image recognition module, obtain the image recognition result from the file output path of the image recognition module, and send the image recognition result to the file storage module; the image recognition module is used to perform image recognition on the image to be recognized in the file input path, obtain the image recognition result, and store the image recognition result in the output path.
[0007] In one possible implementation, the data processing module is used to query the image recognition status of the image to be recognized in the file storage module, and output the unrecognized image to be recognized to the file input path of the image recognition module.
[0008] In one possible implementation, the system further includes: a file acquisition module; the file acquisition module is connected to the file storage module; the file acquisition module is used to acquire the image to be identified and store the image to be identified in the file storage module.
[0009] In one possible implementation, the file storage module is used to associate the image to be identified and the image recognition result and establish an index, wherein the index includes the types of object images included in the image to be identified as indicated by the image recognition result.
[0010] According to a second aspect of the embodiments of this application, an image recognition method is provided. The method is applied to a data processing module and includes: acquiring an image to be recognized from a file storage module; sending the image to be recognized to a file input path of an image recognition module so that the image recognition module performs image recognition on the image to be recognized; acquiring an image recognition result from a file output path of the image recognition module; and storing the image recognition result and the image to be recognized in the file storage module.
[0011] According to a third aspect of the embodiments of this application, an image recognition method is provided. The method is applied to an image recognition module and includes: acquiring an image to be recognized from a file input path; performing image recognition on the image to be recognized to obtain an image recognition result, wherein the image recognition result is used to indicate the type of object image included in the image to be recognized; and sending the image recognition result to a file output path.
[0012] In one possible implementation, the step of performing image recognition on the image to be recognized and obtaining an image recognition result includes: obtaining image recognition rules, wherein the image recognition rules are used to indicate the recognition requirements for the format of the image to be recognized; and performing image recognition on the image to be recognized corresponding to the image format according to the image recognition rules to obtain an image recognition result.
[0013] According to a fourth aspect of the present application, an electronic device is provided, comprising: a processor, a memory, a communication interface, and a communication bus, wherein the processor, the memory, and the communication interface communicate with each other via the communication bus; the memory is used to store at least one executable instruction, wherein the executable instruction causes the processor to perform an operation corresponding to the method described in the second or third aspect.
[0014] According to a fifth aspect of the embodiments of this application, a computer storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the method described in the second or third aspect.
[0015] According to a sixth aspect of the embodiments of this application, a computer program product is provided, including computer instructions that instruct a computing device to perform the method as described in the second or third aspect.
[0016] The image recognition system provided in this application's embodiments divides the system into a file storage module, an image recognition module, and a data processing module using a distributed approach. The data processing module transmits the image to be recognized stored in the file storage module to the image recognition module and sends the recognized result back to the file storage module, thereby completing the image recognition process. Since different functions in the system reside in different modules, the success or failure of an operation performed by a single module will not affect the operation of the entire system. When functional upgrades and expansions are required, only the module containing that function needs to be upgraded, without requiring the entire system to be shut down for upgrades. This meets the user's image recognition needs and improves the user experience. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings.
[0018] Figure 1 This is a schematic diagram of an image recognition system provided in an embodiment of this application;
[0019] Figure 2 This is a schematic diagram of another image recognition system provided in an embodiment of this application;
[0020] Figure 3 This is a flowchart of an image recognition method provided in an embodiment of this application;
[0021] Figure 4 This is a flowchart of another image recognition method provided in the embodiments of this application;
[0022] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0023] To enable those skilled in the art to better understand the technical solutions in the embodiments of this application, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art should fall within the protection scope of the embodiments of this application.
[0024] The terminology used in this application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. The singular forms “a,” “the,” and “the” used in this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any or all possible combinations of one or more of the associated listed items.
[0025] It should be understood that although the terms first, second, third, etc., may be used in this application to describe various information, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, without departing from the scope of this application, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to determination."
[0026] Figure 1 This is a schematic diagram of an image recognition system provided in an embodiment of this application, such as... Figure 1 As shown, the image recognition system 100 includes a file storage module 101, a data processing module 102, and an image recognition module 103. The file storage module 101 is connected to the data processing module 102, and the data processing module 102 is connected to the image recognition module 103. The file storage module 101 can store the image to be recognized and the image recognition results sent by the data processing module 102. The data processing module 102 can send the image to be recognized from the file storage module 101 to the file input path of the image recognition module 103, and obtain the image recognition results from the file output path of the image recognition module 103, and send the image recognition results back to the file storage module 101. The image recognition module 103 can perform image recognition on the image to be recognized in the file input path, obtain the image recognition results, and store the image recognition results in the output path.
[0027] The storage unit of the file storage module 101 is a Document. The file storage module 101 associates with the database through the unique ID of the Document storage unit, so that it can communicate with the database through the ID and realize the functions of reading and storing data.
[0028] The data processing module 102 reads the image to be recognized stored in the file storage module 101 and transmits the file stream of the image to be recognized to the file input path of the image recognition module 103 via the Secret File Transfer Protocol (SFTP). After the image recognition module 103 performs image recognition, the data processing module 102 can transmit the image recognition result in the file output path of the image recognition module 103 to the file storage module 101 via SFTP.
[0029] The image recognition module 103 is an image recognition service integrated into the system, including but not limited to: Datacap intelligent recognition service. Taking the Datacap intelligent recognition service as an example, the Datacap intelligent recognition service can be deployed on a Windows or Linux server and run as a standalone service. The image recognition module 103 can pre-set the input and output paths of files, for example, using C:\ocr_in as the input path and C:\ocr_out as the output path. After obtaining the image to be recognized from the input path, the image recognition module 103 performs image recognition on the image to be recognized, obtains the image recognition result, and outputs the image recognition result to the output path. The image recognition result can be in PDF or TXT format, etc. The format of the recognition result file is only given as an example in this application, and this application does not limit the specific format of the image recognition result.
[0030] In this embodiment, the image recognition system 100 uses a distributed approach to divide the system into a file storage module 101, an image recognition module 103, and a data processing module 102. The data processing module 102 transmits the image to be recognized stored in the file storage module 101 to the image recognition module 103 and sends the recognized result back to the file storage module 101, thereby completing the image recognition process. Since different functions in the system are located in different modules, the success or failure of a single module's operation will not affect the operation of the entire system. When functional upgrades and expansions are required, only the module containing that function needs to be upgraded, without having to shut down the entire system for upgrades. This meets the user's image recognition needs and improves the user experience.
[0031] In one possible implementation, the data processing module 102 can query the image recognition status of the image to be recognized in the file storage module 101 and output the unrecognized image to the file input path of the image recognition module 103.
[0032] The data processing module 102 periodically polls the images to be recognized stored in the file storage module 101, checks the image recognition status of each image to be recognized, and outputs the images to be recognized that have not been recognized to the input path of the image recognition module 103. The data processing module 102 can be a server that executes batch processing jobs, and the specific server used in this application is not limited.
[0033] In this embodiment, the data processing module 102 checks the recognition status of each image to be recognized and sends the images to be recognized that have not been recognized to the image recognition module 103 for image recognition, thereby realizing the image recognition function. Since the recognition status of the images to be recognized is checked before sending them, the repeated recognition of the images to be recognized is avoided, which improves the efficiency of image recognition and indirectly improves the user experience.
[0034] Figure 2 This is a schematic diagram of another image recognition system provided in an embodiment of this application, such as... Figure 2 As shown, the image recognition system 100 includes a file storage module 101, a data processing module 102, and an image recognition module 103, as well as a file acquisition module 201 connected to the file storage module 101. The file acquisition module 201 can acquire the image to be recognized and store it in the file storage module 101.
[0035] The file acquisition module 201 is a user-facing module that provides users with access to the system. The file acquisition module 201 can acquire images to be recognized from multiple sources, such as user-uploaded images, images scanned by the user using a scanner, images in recognition documents, and application images. Finally, the images to be recognized are saved to the file storage module 101.
[0036] In this embodiment of the application, the image recognition system also includes a file acquisition module 201, which can acquire the image to be recognized from the user, thereby realizing the image recognition function, fulfilling the user's diverse image recognition needs, and improving the user experience.
[0037] In one possible implementation, the file storage module 101 can associate the image to be recognized with the corresponding image recognition result and establish an index, wherein the index includes the types of object images included in the image to be recognized as indicated by the image recognition result.
[0038] After receiving the image recognition results sent by the data processing module 102, the file storage module 101 associates the image recognition results with the corresponding images to be recognized and creates an index for all images to be recognized and image recognition results. This index includes all images to be recognized and image recognition results of the same type. For example, an animal index is created for all images to be recognized that have been recognized as animals, and a human index is created for all images to be recognized that have been recognized as humans. This index can be hierarchical, for example, a first-level index for animals, a second-level index for wild animals, a third-level index for monkeys, and so on. It should be noted that the above examples are only for illustrating the index and do not limit the process or results of index creation.
[0039] It should be understood that image recognition results may vary depending on the user's needs. For example, if the user's need is to identify the types of objects included in an image, the recognition result will be the types of objects. If the user's need is to identify characters in an image, the recognition result will circle all characters, and so on.
[0040] In this embodiment, the file storage module 101 can associate the image to be recognized with the image recognition result and establish an index. It can manage the image to be recognized and the recognition result together. Since establishing an index makes it convenient for users to query the image to be recognized and the image recognition result, it facilitates user retrieval and improves user efficiency, thereby enhancing the user experience.
[0041] Figure 3 This is a flowchart of an image recognition method provided in an embodiment of this application. The method is applied to the data processing module 102 in the image recognition system 100 described above. Unless otherwise stated, the file storage module in the following method embodiments may be the file storage module 101 in the aforementioned embodiments, and the image recognition module may be the image recognition module 103 in the aforementioned embodiments. Figure 3 As shown, the image recognition method includes the following steps 301 to 304:
[0042] Step 301: Obtain the image to be recognized from the file storage module.
[0043] Periodically poll the file storage module for images that have not yet undergone image recognition.
[0044] Step 302: Send the image to be recognized to the file input path of the image recognition module so that the image recognition module can perform image recognition on the image to be recognized.
[0045] Send the image to be recognized that has not yet undergone image recognition to the file input path of the image recognition module. For example, transfer the file to the file input path C:\ocr_in via the SFTP transfer protocol.
[0046] Step 303: Obtain the image recognition results from the file output path of the image recognition module.
[0047] Read image recognition results from the file output path of the image recognition module, for example: read image recognition results from the file output path C:\ocr_out.
[0048] Step 304: Store the image recognition results and the image to be recognized to the file storage module.
[0049] The image recognition results in the file output path are transferred to the file storage module via the SFTP transfer protocol, so that the file storage module can associate the image to be recognized and the image recognition results and build an index.
[0050] In this embodiment, the data processing module sends the image to be recognized from the file storage module to the image recognition module, and sends the image recognition result output by the image recognition module to the file storage module, thereby realizing the transfer of files during the image recognition process, ensuring the normal operation of the image recognition process, and improving the user experience.
[0051] Figure 4 This is a flowchart of another image recognition method provided in an embodiment of this application. This method is applied to the image recognition module 103 in the image recognition system 100 described above. Unless otherwise stated, the file storage module in the following method embodiments may be the file storage module 101 in the aforementioned embodiments, and the data processing module may be the data processing module 102 in the aforementioned embodiments. Figure 4 As shown, the image recognition method includes the following steps 401 to 403:
[0052] Step 401: Obtain the image to be recognized from the file input path.
[0053] Read the image to be recognized from the file input path.
[0054] Step 402: Perform image recognition on the image to be recognized to obtain the image recognition result, wherein the image recognition result is used to indicate the types of object images included in the image to be recognized.
[0055] Image recognition is performed on the image to be recognized to obtain the image recognition result. The image recognition result is the type of object image included in the image, such as the type of animal in the photo, the type of tree in the photo, etc. This application does not limit this.
[0056] Step 403: Send the image recognition results to the file output path.
[0057] The image recognition results are output to a file output path, so that the data processing module can read the image recognition results from the file output path.
[0058] In this embodiment, the image recognition module reads the image to be recognized from the file input path, performs image recognition on the image, and outputs the recognition result to the file output path, thereby completing the image recognition process, meeting the user's image recognition needs, and improving the user experience.
[0059] In one possible implementation, when performing image recognition on the image to be recognized and obtaining the image recognition result, image recognition rules can be obtained. These image recognition rules are used to indicate the recognition requirements of the image format to be recognized. Then, according to the image recognition rules, image recognition is performed on the image to be recognized corresponding to the image format to obtain the image recognition result.
[0060] Recognition rules can be set for the image recognition module according to recognition requirements. These rules can instruct the image recognition module to only recognize images of a specified file format, and not to recognize images of other formats. For example, only recognize images with file extensions of jpg, png, and tiff.
[0061] In this embodiment, the image recognition module obtains the image recognition rules set by the user and performs image recognition on the specified image to be recognized according to the image recognition rules. This can meet the user's needs, avoid unnecessary image recognition work, improve the efficiency of image recognition, and thus improve the user experience.
[0062] Reference Figure 5 This document illustrates a schematic diagram of an electronic device according to an embodiment of this application. The specific embodiments of this application do not limit the specific implementation of the electronic device.
[0063] like Figure 5 As shown, the electronic device may include: a processor 502, a communications interface 504, a memory 506, and a communications bus 508.
[0064] in:
[0065] The processor 502, communication interface 504, and memory 506 communicate with each other via communication bus 508.
[0066] Communication interface 504 is used to communicate with other electronic devices or servers.
[0067] The processor 502 is used to execute program 510, specifically to perform the relevant steps in the above-described image recognition method embodiments.
[0068] Specifically, program 510 may include program code that includes computer operation instructions.
[0069] The processor 502 may be a central processing unit (CPU), a graphics processing unit (GPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of this application. The one or more processors included in the smart device may be processors of the same type, such as one or more CPUs; one or more GPUs; or they may be processors of different types, such as one or more CPUs, one or more GPUs, and one or more ASICs.
[0070] Memory 506 is used to store program 510. Memory 506 may include high-speed RAM memory, and may also include non-volatile memory, such as at least one disk storage device.
[0071] Specifically, program 510 can be used to cause processor 502 to execute the image recognition method in any of the foregoing embodiments.
[0072] The specific implementation of each step in program 510 can be found in the corresponding steps and units described in any of the foregoing image recognition method embodiments, and will not be repeated here. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the devices and modules described above can be referred to the corresponding process descriptions in the foregoing method embodiments, and will not be repeated here.
[0073] In this embodiment, the image recognition system is divided into a file storage module, an image recognition module, and a data processing module using a distributed approach. The data processing module transmits the image to be recognized stored in the file storage module to the image recognition module and sends the recognition result back to the file storage module, thus completing the image recognition. Since different functions in the system are located in different modules, the success or failure of a single module will not affect the user's operating experience. When a function upgrade is required, only the module containing that function needs to be upgraded, without having to shut down the entire system for the upgrade. Furthermore, the distributed deployment approach maximizes the utilization of the resources of each server, improving the user experience.
[0074] This application also provides a computer program product, including computer instructions that instruct a computing device to perform an operation corresponding to any of the methods in the above-described multiple method embodiments.
[0075] It should be noted that, depending on the implementation needs, the various components / steps described in the embodiments of this application can be broken down into more components / steps, or two or more components / steps or parts of the operation of components / steps can be combined into new components / steps to achieve the purpose of the embodiments of this application.
[0076] The methods described in the embodiments of this application can be implemented in hardware, firmware, or as software or computer code that can be stored in a recording medium (such as a CD-ROM, RAM, floppy disk, hard disk, or magneto-optical disk), or as computer code downloaded over a network that is originally stored in a remote recording medium or a non-transitory machine-readable medium and will be stored in a local recording medium. Thus, the methods described herein can be processed by software stored on a recording medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware (such as an ASIC or FPGA). It is understood that the computer, processor, microprocessor controller, or programmable hardware includes storage components (e.g., RAM, ROM, flash memory, etc.) capable of storing or receiving software or computer code that, when accessed and executed by the computer, processor, or hardware, implements the image recognition methods described herein. Furthermore, when a general-purpose computer accesses code used to implement the image recognition methods shown herein, the execution of the code transforms the general-purpose computer into a dedicated computer for executing the image recognition methods shown herein.
[0077] Those skilled in the art will recognize that the units and method steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the embodiments of this application.
[0078] The above embodiments are only used to illustrate the embodiments of this application, and are not intended to limit the embodiments of this application. Those skilled in the art can make various changes and modifications without departing from the spirit and scope of the embodiments of this application. Therefore, all equivalent technical solutions also fall within the scope of the embodiments of this application, and the patent protection scope of the embodiments of this application should be defined by the claims.
Claims
1. An image recognition system, characterized in that, include: File storage module, image recognition module, and data processing module; The file storage module is connected to the data processing module, and the data processing module is connected to the image recognition module; The file storage module is used to store the image to be recognized and the image recognition result sent by the data processing module; The data processing module is used to send the image to be recognized from the file storage module to the file input path of the image recognition module, and to obtain the image recognition result from the file output path of the image recognition module, and send the image recognition result to the file storage module; The image recognition module is used to run as a separate service, and the input and output paths of the file are preset. It performs image recognition on the image to be recognized in the input path of the file, obtains the image recognition result, and stores the image recognition result in the output path. Specifically, the data processing module is used to transfer the file stream of the image to be recognized to the file input path of the image recognition module via the Secure Transfer Protocol (SFTP). The data processing module is also used to query the image recognition status of the image to be recognized in the file storage module, and output the unrecognized image to be recognized to the file input path of the image recognition module.
2. The system according to claim 1, characterized in that, The system also includes: a file acquisition module; The file acquisition module is connected to the file storage module; The file acquisition module is used to acquire the image to be identified and store the image to be identified in the file storage module.
3. The system according to any one of claims 1-2, characterized in that, The file storage module is used to associate the image to be identified and the image recognition result and establish an index, wherein the index includes the types of object images included in the image to be identified as indicated by the image recognition result.
4. An image recognition method, applied to the data processing module of the image recognition system according to any one of claims 1 to 3, characterized in that, include: Obtain the image to be recognized from the file storage module; The file stream of the image to be recognized is transmitted to the file input path of the image recognition module via Secure Transfer Protocol (SFTP), so that the image recognition module can perform image recognition on the image to be recognized read from the file input path when running in a standalone service mode; Obtain the image recognition results from the file output path of the image recognition module; The image recognition result and the image to be recognized are stored in the file storage module.
5. An image recognition method, applied to the image recognition module of the image recognition system according to any one of claims 1 to 3, characterized in that, The image recognition module runs as a separate service, and the input and output paths of the files are pre-set, including: Obtain the image to be recognized from the preset file input path; The image to be identified is subjected to image recognition to obtain an image recognition result, wherein the image recognition result is used to indicate the types of object images included in the image to be identified; Send the image recognition results to the file output path.
6. The method according to claim 5, characterized in that, The step of performing image recognition on the image to be recognized to obtain the image recognition result includes: Obtain image recognition rules, wherein the image recognition rules are used to indicate the recognition requirements for the format of the image to be recognized; According to the image recognition rules, image recognition is performed on the image to be recognized corresponding to the image format to obtain the image recognition result.
7. An electronic device, comprising: The processor, memory, communication interface, and communication bus are provided, wherein the processor, memory, and communication interface communicate with each other via the communication bus. The memory is used to store at least one executable instruction that causes the processor to perform the image recognition method as described in claim 4 or the image recognition method as described in any one of claims 5-6.
8. A computer storage medium having a computer program stored thereon, which, when executed by a processor, implements the image recognition method as described in claim 4 or the image recognition method as described in any one of claims 5-6.
9. A computer program product comprising computer instructions that instruct a computing device to perform the image recognition method as claimed in claim 4 or the image recognition method as claimed in any one of claims 5-6.
Citation Information
Patent Citations
Picture transmission method and device, equipment and storage medium
CN113592003A