Image management device, image management device control method, and computer program
The image management device optimizes retries by assessing failure causes in image analysis requests, reducing failures and ensuring reliable processing in microservices architecture applications.
Patent Information
- Application Number
- JP2023142031
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2023-09-01
- Publication Date
- 2025-11-11
- Estimated Expiration
- 2043-09-01
AI Technical Summary
In microservices architecture-based applications, service calls can fail due to various reasons, leading to incomplete functionality and user inconvenience, with existing retry mechanisms being ineffective for certain failure types.
An image management device that includes a transmission unit for sending image analysis requests, a receiving unit for synchronized responses, and a determination unit to assess failure causes, allowing controlled retries based on result codes to minimize analysis failures.
Reduces analysis request failures by determining failure causes and optimizing retries in image management systems, ensuring reliable image processing.
Smart Images

Figure 0007767367000001 
Figure 0007767367000002 
Figure 0007767367000003
Abstract
Description
[Technical Field]
[0001] The present invention relates to an image management device that manages images transferred from a photographing device, an image analysis device that analyzes images, a judgment and control method for determining subsequent processing based on the results of analysis processing, and a computer program. [Background technology]
[0002] One software system development methodology is called "microservices architecture," in which application functions are divided into small "services" and each service works together to run the system. Each service operates in an independent process and is connected via remote communication using lightweight mechanisms such as RESTful API. For example, if a failure occurs in a specific service, the impact can be limited locally, which has the advantage of improving the fault tolerance of the entire application.
[0003] In recent years, applications that adopt this microservice architecture have become increasingly popular. For example, even in image management services that manage images, there are applications that are configured as separate services for image analysis and transferring images to external storage or social networking sites. [Prior art documents] [Patent documents]
[0004] [Patent Document 1] Japanese Patent Publication No. 2022-109916 Summary of the Invention [Problem to be solved by the invention]
[0005] In applications built on the microservices architecture described above, one service communicates with another service via a RESTful API or similar to make a call. Calls between services can fail for a variety of reasons, including incorrect configuration on the requesting side, network errors, or a failure in the called service. If a service call fails, the application's functionality cannot be provided, causing inconvenience to users. For this reason, it is important to prevent call failures between services as much as possible.
[0006] Patent Document 1 discloses a technology that increases the likelihood of obtaining a printed document while reducing the burden on users in a printing system that has multiple processing paths between a printer and an information processing device. If processing on the first processing path fails, the system switches to the second processing path and retries printing, thereby reducing the number of print failures.
[0007] However, in Patent Document 1, a retry process is executed when a process fails, regardless of the nature of the failure. Depending on the cause of the failure, there may be cases where the process fails again even if a retry process is executed.
[0008] The present invention has been made to solve the above-mentioned problems, and has as its object to reduce failures in retrying analysis requests in an image management device that communicates with an image analysis device. [Means for solving the problem]
[0009] In order to solve the above-mentioned problems, the present invention provides an image management device for managing images, the image management device including a transmission unit for transmitting an image analysis request to an image analysis device for analyzing the images, and a transmission unit for transmitting an image analysis request to the image analysis device. a first response synchronized with the image analysis request; and a second response not synchronized with the image analysis request and indicating the result of the image analysis by the image analysis device. receiving means for receiving the Each of the first response and the second response and a subsequent processing determination means for determining subsequent processing related to the analysis of the image based on the result code determination means. [Effects of the Invention]
[0010] According to the present invention, it is possible to reduce failures in retrying analysis requests in an image management device that communicates with an image analysis device. [Brief explanation of the drawings]
[0011] [Figure 1] Overall configuration diagram [Figure 2] A diagram showing the hardware configuration of an image management device. [Figure 3] FIG. 1 shows the functional configuration of an image management device. [Figure 4] An example of a result code and information associated with the result code [Figure 5] A diagram showing the processing flow from image transfer to saving analysis results [Figure 6] An example of information stored in the analysis image management unit [Figure 7] An example of response information from an image analysis device [Figure 8] An example of information stored in the job management unit DETAILED DESCRIPTION OF THE INVENTION
[0012] Hereinafter, the present embodiment will be described in detail with reference to the accompanying drawings. Note that the configurations shown in the following embodiments are merely examples, and the present invention is not limited to the illustrated configurations.
[0013] In this embodiment, an example is described in which an image management device that manages images uploaded from a photographing device communicates with an image analysis device that performs image analysis processing, and determines subsequent processing based on a result code received along with the analysis processing results.
[0014] <Overall structure> The overall configuration of this embodiment will be described with reference to FIG.
[0015] As shown in the figure, the overall configuration includes an imaging device 101, an image management device 102, and an image analysis device 103. Furthermore, each component is connected via a network 104.
[0016] The image capturing device 101 is an information processing device such as a camera, a mobile phone, a smartphone, or a tablet.
[0017] The image management device 102 manages the images transferred from the photographing device 101 .
[0018] The image analysis device 103 accepts the image analysis process and executes the image analysis when a processing request for image analysis is made for an image managed by the image management device 102. After the image analysis process is completed, the image analysis device 103 returns the analysis result to the image management device 102.
[0019] The above is the overall configuration of this embodiment.
[0020] <Hardware configuration> The hardware configuration of the image management device 102 in this embodiment will be described with reference to FIG.
[0021] As shown in the figure, the computer includes at least a CPU 201 , a RAM 202 , a ROM 203 , a network interface 204 , an external storage device 205 , a display device 206 , and an input device 207 .
[0022] The CPU 201 controls the operation of each unit constituting the image management device 102 and is the main body that executes various processes that are performed by the image management device 102, which will be described later.
[0023] The RAM 202 is a memory that temporarily stores data and control information, and serves as a work area used by the CPU 201 when executing various processes.
[0024] The ROM 203 stores fixed operation setting values, operation programs, etc. of the image management device 102.
[0025] The network interface 204 provides a function for connecting to and communicating with a network, and allows the image management device 102 to send and receive data to and from external devices.
[0026] The external storage device 205 is a device that stores data and has an interface that accepts I / O commands for reading and writing data. The external storage device 205 may be a hard disk drive (HDD), a solid state drive (SSD), an optical disk drive, a semiconductor storage device, or other storage device. The external storage device 205 stores computer programs and data for causing the CPU 201 to execute each process, which will be described later as being performed by the image management device.
[0027] The display device 206 is, for example, an LCD (Liquid Crystal Display) or the like, and displays information required by the user.
[0028] The input device 207 is, for example, a keyboard, a mouse, a touch panel, etc., and receives necessary input from the user.
[0029] <Functional configuration> The configuration of the image management device 102 in this embodiment will be described with reference to FIG.
[0030] The image management device 102 in this embodiment has an image management unit 301, a transmitting unit 302, a receiving unit 303, a result code determination unit 304, a subsequent processing determination unit 305, a retry control unit 306, an analysis image information management unit 307, a job management unit 308, and an analysis result management unit 309.
[0031] The image management unit 301 stores images. Images transferred from the image capturing device 101 are managed by this image management unit.
[0032] The transmission unit 302 transmits to the image analysis device 103 a processing request to analyze the images managed by the image management unit.
[0033] The receiving unit 303 receives the processing results of the image analysis from the image analysis device 102 .
[0034] The result code determination unit 304 determines whether the process has ended normally or abnormally by referring to the result code included in the processing result received by the receiving unit, and if the process has ended abnormally, it further determines the cause category.
[0035] The subsequent process determination unit 305 determines the subsequent process based on the determination result by the result code determination unit.
[0036] The retry control unit 306 determines whether to retry depending on the cause classification in the subsequent process determination unit. This retry control unit also determines whether the upper limit of retries set in the system has been reached.
[0037] The analysis image information management unit 307 manages information about the image to be analyzed when an image analysis request is made to the image analysis device 103 .
[0038] The job management unit 308 manages the relationship between the image to be analyzed and the analysis process when an image analysis request is made to the image analysis device 103. In this embodiment, the analysis process for one image is called a "job," and a job ID that uniquely identifies the job is assigned each time an analysis process is executed.
[0039] The analysis result management unit 309 manages the analysis results received from the image analysis device 103 .
[0040] Next, the result code and information associated with the result code in this embodiment will be described with reference to Fig. 4. The result code is an identification code such as A01-002, and is associated with the cause of failure or the classification of the cause of failure.
[0041] 401 is a result code included in the analysis result received from the image analysis device 103.
[0042] 402 indicates the result of the image analysis process, and takes the value of either "normal end" or "abnormal end."
[0043] 403 indicates the cause of the processing failure and indicates the details of the cause of the failure. If the processing result is "successful completion", there is no value.
[0044] 404 indicates a cause category for classifying each failure cause, and takes one of the following values: "Sender-related," "Receiver-related," or "Communication path-related."
[0045] The sender-related failure cause category indicates a failure caused by the sender, and examples of failure causes include missing required parameters, incorrect (invalid) request headers, invalid parameters, and requests not made using the specified method.
[0046] The failure cause category "Communication path cause" indicates a failure caused by the communication path, and the cause of the failure includes a timeout error.
[0047] The receiver-side cause of failure category indicates a failure caused by the receiver, and causes of failure include failure to download the image, the image being in an unsupported format, the image being corrupted, a server error, etc.
[0048] <Processing flow> In this embodiment, a series of processing steps will be described, from when an image is transferred from the photographing device 101 to the image management device 102, to when the image analysis device 103 executes analysis processing, and the image management device 102 stores the analysis results.
[0049] 5 is a flowchart showing a series of steps from when an image is transferred from the photographing device 101 to the image management device 102, to when the image analysis device 103 executes analysis processing, and the image management device 102 stores the analysis results. Each step will be explained below with an S added to the beginning of the reference numeral.
[0050] S501 is a process for transferring an image captured by the imaging device 101 to the image management device 102. This process causes the image to be stored in the image management unit 301. When the image is stored in the image management device 102, an image ID that uniquely identifies the image is assigned. The image analysis process begins when the image is stored. First, a process is performed to write information about the image to be analyzed to the analysis image information management unit 307 (S502). An example of the information stored in the analysis image information management unit 307 at this time is shown in FIG. 6.
[0051] It has an image ID 601 of the analysis image, a user ID 602 that is the identifier of the user who owns the image, an image storage location 603 that indicates the storage location of the image, and an image analysis start time 604 that is the time when image analysis starts. The image storage location 603 is a path on cloud storage or a path to a storage area in the image management device 102, etc. The time when the data was written to the analysis image information management unit 307 is written as the image analysis start time 604.
[0052] Next, in S503, a signed URL for the image to be analyzed is issued. In this embodiment, the signed URL for the image is sent to the image analyzing device as a request parameter for the image analysis request, and the image is downloaded by the image analyzing device accessing the URL. The method for transferring the image is not limited to the above, and may involve directly sending the image data or placing the image in a storage area accessible by the image analyzing device.
[0053] S504 is a process for requesting the image analyzing device 103 to perform analysis processing. The request parameters include the signed URL issued in S503 and a notification destination (endpoint) for receiving the analysis results. In this embodiment, when an analysis processing request is made to the image analyzing device 103, the image analyzing device 103 returns two types of responses: a synchronous response and an asynchronous response that returns the analysis results after the analysis processing is completed. Each response includes a job ID and a result code. Figure 7 shows an example of response information from the image analyzing device 103. (a) to (d) are examples of a synchronous response and an asynchronous response indicating "successful completion" and "abnormal completion," respectively.
[0054] When a synchronization response is received from the image analysis device 103 (S505), the result code included in the response is determined (S506). In S507 and S508, the result code in FIG. 4 is referenced to determine whether the image analysis process was successful (normal completion) or failed (abnormal completion). If it was a failure, the subsequent processing is determined based on the failure cause classification 404. If the failure cause classification is due to the sending side, the process proceeds to S509; if different, the process proceeds to S508 (S507). If the failure cause classification is due to the receiving side or the communication path, the process proceeds to S510; if different, the process proceeds to S513 (S508).
[0055] In this embodiment, S509 and S510 execute processing to temporarily copy images stored in the image management device 102 to another area within the image management device 102. This is because, when investigating images for which image analysis processing has failed, it is possible that images to be investigated no longer exist due to user deletion of images stored in the image management device 102, user withdrawal, etc. In order to make it possible to investigate images for which analysis has failed even in such cases, processing to temporarily copy images to another area is executed if an error occurs in the image analysis processing. In this case, the processing contents of S509 and S510 may be different; for example, S509 may execute processing to notify the administrator of the image management device 102 that an error has occurred.
[0056] After the processing of S510, a retry process is performed. In this embodiment, the upper limit of the number of retries for the analysis process for each image is set to three, and if the analysis process fails after three retries, the analysis process is deemed to have "failed." In S511, the number of retries is increased by one, and it is determined whether the number of retries has exceeded the upper limit of three (S512). If it is determined in S512 that the upper limit has not been exceeded, an image analysis request is again sent to the image analysis device 103 in S504.
[0057] S513 is a process performed when the result code of the synchronization response indicates "success," and writes information related to the image and job to the job management unit 308. An example of the information stored in the job management unit 308 at this time is shown in FIG.
[0058] It has a processing count 803 that indicates the number of times analysis processing has been performed for a combination of job ID 801 and image ID 802. The initial value of the processing count 803 is "1", and the processing count increases with each retry, and when the retry count reaches the upper limit of three, the processing count becomes "4".
[0059] After requesting the analysis process in S504, the image analysis device 103 accesses the received signed URL, downloads the image, and starts the analysis process. When the analysis process is complete, the analysis result is sent as an asynchronous response to the destination where the result was received. In S514, the image management device 102 receives the asynchronous response from the image analysis device 103. The job ID included in the received asynchronous response is read from the job management unit 308, and image information and the number of retries are obtained (S515). The result code included in the asynchronous response is also determined (S516). As in S507 and S508, in S517 and S518, the result code in FIG. 4 is referenced to determine whether the image analysis process was successful (normal completion) or failed (abnormal completion).
[0060] If the result code in the asynchronous response is also "normal completion" and the analysis process is "successful," in step S519 the analysis result is stored in the analysis result management unit 307. The received analysis result includes information such as that shown in FIG. 7(c).
[0061] In this embodiment, the number of retries per image is controlled in a series of analysis processes (S504 to S518). For example, assume that analysis process for image ID=002 is started. When the result code of the synchronous response in S508 is determined to be "Yes" and a retry is performed, the number of retries becomes "1" (S511). If the result code of the synchronous response is determined to be "success" after S504 to S508, the process proceeds to S513, where the number of processing times is "2" and is written to the job management unit 308 (job ID=J003 in FIG. 8). Thereafter, when the result code of the asynchronous response in S518 is determined to be "Yes" and a retry is performed again, the number of retries becomes "2" (S511). If the result code of the synchronous response is determined to be "success" again, the number of processing times is "3" and is written to the job management unit 308 (job ID=J004 in FIG. 8). Similarly, if the result code of the asynchronous response in S518 is again determined to be "Yes" and another retry is performed, the number of retries becomes "3" (S511). If the result code of the synchronous response is repeatedly determined to be "success", the number of processing attempts is written as "4" in S513 to the job management unit 308 (job ID=J005 in FIG. 8). Finally, if the result code of the asynchronous response in S518 is again determined to be "Yes", the number of retries becomes "4" (S511), the determination in S512 becomes "Yes", and the analysis process is determined to be a "failure".
[0062] The above is the flow of a series of processes from the transfer of images from the photographing device 101 to the image management device 102, to the execution of analysis processing by the image analysis device 103, and the storage of the analysis results by the image management device 102.
[0063] In this embodiment, an example has been shown in which one analysis process is requested from the image analysis device 103, but a configuration in which multiple calls are made in multiple stages may also be used. In this case, a result code for the processing result is issued in the same way for each of the first analysis process (e.g., object analysis process) and the second analysis process (e.g., face recognition process), and the subsequent processing is determined.
[0064] In this way, the image management device 102 and image analysis device 103 of this embodiment determine the cause of failure and decide the subsequent processing based on the result code received along with the image analysis results. This makes it possible to reduce failures in the analysis processing without unnecessary retries when analyzing images.
[0065] (Other embodiments) The present invention can also be realized by executing the following process: software (programs) that realize the functions of the above-described embodiments are supplied to a system or device via a network or various storage media, and the computer (or CPU, MPU, etc.) of the system or device reads and executes the programs. [Explanation of symbols]
[0066] 101 Imaging equipment 102 Image management device 103 Image analysis equipment 201 CPU 202 RAM 203 ROM 204 Network Interface 205 External storage device 206 Display device 207 Input Device 301 Image Management Department 302 Transmission Unit 303 Receiving Unit 304 Result Code Judgment Section 305 Subsequent Processing Decision Unit 306 Retry control unit 307 Analysis Image Information Management Department 308 Job Management Department 309 Analysis results management department
Claims
1. An image management device that manages images, a transmitting means for transmitting an image analysis request to an image analyzing device that analyzes the image; a receiving means for receiving from the image analysis device a first response synchronized with the image analysis request and a second response not synchronized with the image analysis request and indicating the result of the image analysis by the image analysis device; a result code determination means for determining a processing result from a result code included in each of the first response and the second response; a subsequent processing determination means for determining subsequent processing related to the analysis of the image based on the result code determination means; An image management device comprising:
2. The image management device described in claim 1, characterized in that when the result code determination means determines that the image analysis has failed, it classifies the image analysis failure from the result code into one of a failure caused by the sender of the image analysis request, a failure caused by the communication path, or a failure caused by the receiver of the image analysis request.
3. 3. The image management device according to claim 2, wherein the subsequent process determining means includes a retry control means for determining whether or not to retry the image analysis request.
4. The image management device described in claim 3, characterized in that the retry control means retries the image analysis request if the image analysis failure is classified as a failure caused by the communication path or a failure caused by the receiving side of the image analysis request.
5. 4. The image management device according to claim 3, wherein the retry control means does not retry the image analysis request if the image analysis failure is classified as a failure caused by the sender of the image analysis request.
6. 4. The image management device according to claim 3, wherein when the retry control means determines not to retry the image analysis request, the subsequent process determination means determines that the subsequent process is to notify an administrator.
7. The image management device described in claim 2, characterized in that the failure caused by the sender of the image analysis request is at least one of the following: missing required parameters, invalid request header, invalid parameter type, not valid parameters, or not a request using a specified method.
8. 3. The image management device according to claim 2, wherein the failure caused by the communication path is a timeout error.
9. The image management device described in claim 2, characterized in that the failure caused by the receiver of the image analysis request is at least one of the following: failure to download the image, failure to upload the results, the image being in an unsupported format, the image being corrupted, and a server error.
10. 2. The image management device according to claim 1, wherein the result code is an identification code of A01-002, and is configured to be associated with a cause of failure or a category of cause of failure.
11. 2. The image management device according to claim 1, wherein the subsequent processing determination means determines, when the result code determination means determines that the image has failed, that the subsequent processing is to copy the image to an area for investigating the failure.
12. The image management device described in Claim 4, characterized in that the retry of the image analysis request is performed until the total number of retries of the image analysis request based on the result code included in the first response and the number of retries of the image analysis request based on the result code included in the second response reaches a predetermined upper limit value.
13. A control method for an image management device that manages images, comprising: a sending step of sending an image analysis request to an image analysis device that analyzes the image; a receiving step of receiving from the image analysis device a first response synchronized with the image analysis request and a second response not synchronized with the image analysis request and indicating a result of the analysis of the image by the image analysis device; a result code determination step of determining a processing result from a result code included in each of the first response and the second response; a subsequent processing determination step of determining subsequent processing related to analysis of the image based on the result of the determination in the result code determination step; 10. A method for controlling an image management device, comprising:
14. The computer is an image management device that manages images, a transmitting means for transmitting an image analysis request to an image analyzing device that analyzes the image; a receiving means for receiving from the image analysis device a first response synchronized with the image analysis request and a second response not synchronized with the image analysis request and indicating the result of the image analysis by the image analysis device; a result code determination means for determining a processing result from a result code included in each of the first response and the second response; After determining the subsequent processing related to the analysis of the image based on the result code determination means A subsequent processing determination means; A computer program for causing an image management device to function as the image management device, comprising:
Citation Information
Patent Citations
Data processing apparatus, data processing program, and data processing system
JP2008293282A
Document analysis system, document analyzer, document analysis method, and program
JP2016144001A
Program and printing system
JP2022109916A