1. Field of the Invention
The present invention relates to an information processing apparatus that saves a file, a system, and a control method.
2. Description of the Related Art
Currently, there is a technique for storing data or taking an error exit without storing data after receiving the data.
In Japanese Patent Laid-Open No. 2000-112799, a technique has been disclosed in which, after data is received, a directory is created and the received data is stored if no directory exists, or the data is not stored and an error exit is taken if a directory exists.
In addition, as a mode of performing various processes using a server computer, there are techniques such as a cloud computing system and Software as a Service (SaaS).
In the above-mentioned cloud computing system, a problem might arise in terms of treating a file.
For example, assume a system that is used in a single server or a cloud computing system and that receives a file and file information relating to the file. The assumed system can be used, for example, in a use case in which a file is received from a client and a notification of successful saving is transmitted to the client. In this system, if it is determined on the basis of the file information that the file has not been saved, the file is saved and information indicating that the file has been saved is transmitted. On the other hand, in the assumed system, in order to, for example, prevent a file from being overwritten, an error notification is transmitted if it is determined on the basis of the file information that the file has been saved.
Here, for example, an error notification is undesirably transmitted unintentionally in the assumed system in the following case. That is, if connection to a component that has transmitted a file becomes no longer available after the file and file information are received, information indicating that the file has been saved cannot be transmitted after the file is saved. Thereafter, since the component that has transmitted the file cannot obtain the information indicating that the file has been saved, the component transmits the same file and file information again as a retry. As a result, the assumed system receives the same file and file information again. In this case, since the assumed system has already saved the file and the file information that have been received again, the assumed system transmits an error notification. As a result, for example, the component that has transmitted the file cannot recognize that the file has been successfully saved, and accordingly cannot proceed to subsequent processes.
On the other hand, in Japanese Patent Laid-Open No. 2000-112799, neither reception of a file and file information relating to the file nor transmission of information indicating that the file has been saved is disclosed. Furthermore, in Japanese Patent Laid-Open No. 2000-112799, since an error exit is taken if there is a directory, the same problem as that in the case of the assumed system might arise.
According to the present invention, even if, for example, connection to a component that has transmitted a file becomes no longer available and a file is received again as described above, information indicating that the file has been saved can be transmitted.
Aspects of the present invention include an information processing apparatus having a reception unit configured to receive a file and file information that includes an identifier and that is relating to the file, a first determination unit configured to determine, based on the file information, whether the file has been saved, a saving unit configured to save, if the first determination unit determines based on the file information that the file has not been saved, the file and the file information including the identifier while associating the file and the file information including the identifier with each other, a second determination unit configured to determine, if the first determination unit determines based on the file information that the file has been saved, whether the identifier saved by the saving unit and an identifier newly received by the reception unit are the same, and a transmission unit configured to transmit, if the second determination unit determines that the identifier saved by the saving unit and the identifier newly received by the reception unit are the same, information indicating that the file received by the reception unit has been saved.
Further features of the present invention will become apparent from the following description of exemplary embodiments with reference to the attached drawings.
In cloud computing, requests from a lot of clients can be simultaneously processed by executing data conversion and data processing in a distributed manner using a lot of computing resources. Furthermore, in order to utilize the characteristics of the cloud computing, a method for processing a large number of jobs in a scalable manner by realizing a series of processes in a server using strictly specified coupling of tasks and processing the tasks in parallel with one another will be examined hereinafter.
The tasks herein refer to processing content configuring jobs or software processes for realizing the processing content.
At this time, in a job processing mechanism, it is possible that a temporary file to be processed in a first task and a temporary file generated as a result of processing in each task create replications thereof in a plurality of file servers in order to secure usability.
Assume a job management service server that controls a job configured by one or more tasks, information and order of execution regarding the job, and the like. In each task, a plurality of instances can be generated. In each instance, a job is asynchronously obtained from the job management service server, and, for example, image processing such as removal of black spots, a process for storing data in a shared folder, or the like is performed. Binary data used in each task is managed by file management service servers. In each task, data to be processed is obtained from the file management service servers as necessary, and a result of processing is saved. An application for inputting a job to the job management service server will be referred to as a service application herein.
A service application inputs a job to the job management service server while inputting data to be processed to the file management service servers. The data input to the file management service servers at the same time as the input of a job will be referred to as initial data herein. In addition, data is information included in a file.
Overwriting of the initial data is prohibited so that the data can be obtained and the data is not overwritten and deleted by mistake after the saving. As a result, it becomes possible to prevent the initial data from being overwritten and lost by mistake. Since the initial data is not lost by mistake, the usability of a system can be improved by resuming processing on the basis of the initial data even if a failure or the like occurs in the server insofar as the initial data can be obtained. In addition, the usability further improves by saving the initial data in the plurality of file servers.
Information regarding a file including the initial data saved in a file server is separately managed by a database. If a process for saving a file is performed on a file saving application program interface (API) for which overwriting is prohibited, an exception (error) is generated from the server since the file already exists. Upon the generation of the exception, the application determines whether or not an instruction issued thereby has been appropriately executed. That is, it is desirable that an exception is appropriately generated because the exception affects subsequent processes performed by the application. Cases in which an exception is to be generated will be examined using the following two cases. In the first case, an exception is generated when a process that is not assumed by the system has been performed.
First, a case will be described in which an exception is generated when a third party has attempted to save a file that is exactly the same as a file already saved by a client.
This case will be described in detail with reference to a sequence illustrated in
It is to be noted that the functions of the file management service servers 803 described in the following description may be realized by a single server or a single virtual server, or may be realized by a plurality of servers or a plurality of virtual servers.
In addition, file information (details will be described later) saved to the web application unit 1501 is managed by a database (DB) unit 1530, and the file is stored in a data storage region unit 1541.
When making a data saving request in S1011, the application server 901 transmits binary data regarding a file to be saved and file information to the web application unit 1501. Upon receiving the data saving request, the web application unit 1501 inquires of the DB unit 1530 in S912 whether or not the same entry already exists.
It is to be noted that file information managed by a database (here, the DB unit 1530) that manages files will be referred to as entries herein.
Next, in S913, the DB unit 1530 returns a response indicating no entry (a process when there is an entry is omitted here). Next, the web application unit 1501 writes the file to the data storage region unit 1541 in S914. The web application unit 1501 then adds an entry to the DB unit 1530 in S916, and obtains a response in S917. In S1018, the web application unit 1501 returns a successful saving response to the application server 901.
Thereafter, the third-party application server 1001 makes a data saving request S1020 to the web application unit 1501 using the same file and file information as those in S1011. Upon receiving the data saving request, the web application unit 1501 inquires of the DB unit 1530 in S1022 whether or not the same entry already exists. At this time, since the entry has been written to the DB in S916, the DB unit 1530 returns a response S1023 indicating that there is an entry. Therefore, the web application unit 1501 determines that the data saving request S1020 is an overwriting request for a file for which an entry already exists, and generates an exception in S1031.
As in this case, if overwriting of a file that has been transmitted by the application server 901 and that has already been saved is to be prohibited, an exception is generated for a data saving request from the third-party application server 1001 in order to prevent the file from being overwritten. As a result, it becomes possible to prevent the file from being unintentionally overwritten.
The second case is a case in which communication between a client and a server is timed out while the server is saving a file, and then the client performs a retry process because no response has been returned to the client although the server has continued processing and successfully saved the file. In this case, an exception is not to be generated, but the same processing as in the first case is performed, thereby undesirably generating an exception.
This case will be described in detail with reference to a sequence illustrated in
It is to be noted that the same processing as that in the steps that have already been described is given the same reference numerals as those given to the steps that have been already been described, and accordingly description thereof is omitted.
When making an initial data saving request in S911, the application server 901 transmits binary data regarding a file to be saved and file information to the web application unit 1501. After the processing in S912 to S917, connection between the application server 901 and the web application unit 1501 is timed out in the example illustrated in
Upon receiving the retry of the data saving request, the web application unit 1501 inquires of the DB unit 1530 in S921 whether or not the same entry already exists. At this time, since the entry has been written to the DB in S916, the DB unit 1530 returns a response S922 indicating that there is the entry. As a result, the web application unit 1501 determines the data saving request S920 as an overwriting request for a file for which an entry already exists, and generates an exception in S923 to stop the process.
If an exception is generated in such a case, however, the application server 901 undesirably receives an exception each time the application server 901 retries saving of data. Therefore, the application server 901 can never recognize that the file has been successfully saved.
In embodiments that will be described hereinafter, an exception is generated at an appropriate timing by generating the exception in a first case and returning a response indicating successful completion in a second case. As a result, a desirable response is returned to the client in response to a saving request.
In
The functions of each of the servers that will be described hereinafter may be realized by a single server or a single virtual server, or may be realized by a plurality of servers or a plurality of virtual servers. Alternatively, a plurality of servers may be executed on a single server as virtual servers.
Each of the client terminals 106 is, for example, a desktop personal computer, a laptop personal computer, a mobile personal computer, a personal digital assistant (PDA), or the like, but may be a mobile phone including an environment for executing programs. Each of the client terminals 106 includes an environment for executing programs of a web browser (an Internet browser or a WWW browser; a browser for using the World Wide Web) or the like.
In
In addition, a software configuration illustrated in
In
The CPU 404 is a unit that executes certain programs and specifies various types of control performed by the image forming apparatus 107. The direct storage section 405 is a working memory used by the CPU 404 to execute a program, and the program to be executed by the CPU 404 is loaded into the direct storage section 405. The direct storage section 405 is realized by a RAM. The indirect storage section 406 stores various programs including application programs and platform programs. Various programs stored in the indirect storage section 406 are moved to the direct storage section 405 before the CPU 404 executes these programs. The indirect storage section 406 is realized by a solid-state drive (SSD) or an HDD. In addition, the CPU 404 may be a multiprocessor.
Here, a platform realized by a platform program will be described in detail. By realizing a platform, a new original application developed by a user can be executed on the image forming apparatus 107, and an operation screen of the image forming apparatus 107 can be customized.
A method for realizing a platform will be described. The CPU 404 moves a platform program stored in the indirect storage section 406 to the direct storage section 405. After the movement, the CPU 404 can execute the platform program (for example, Java (registered trademark)). In this embodiment of the present invention, execution of a platform program by the CPU 404 will be referred to as activation of a platform. It is to be noted that the platform operates on firmware of the image forming apparatus 107. A platform program provides an environment for executing an application program described in an object-oriented manner.
A method for executing an application program on the platform will be described in detail. In this embodiment of the present invention, scanning software for transmitting a scanned image to a cloud service is operating on the platform. The scanning software receives a list of scan tickets from the scan service server 101 connected through a network using, for example, a communication protocol such as a Hypertext Transfer Protocol (HTTP). In each scan ticket, information such as settings for scanning and subsequent processing flows is recorded. A software unit realized by executing scanning software will be referred to as a scanning software unit. A user can complete scanning by selecting a scan ticket from the list of scan tickets displayed on the scanning software unit and causing the scanning software unit to read a document. The scanning software unit transmits information regarding the scan ticket selected by the user and scanned image data to the scan service server 101. Thus, by executing an application program on the platform, control of the image forming apparatus 107 can be realized.
A method for executing an application program will be described. An activated platform moves an application program stored in the indirect storage section 406 to the direct storage section 405. When the movement has been completed, the platform can execute the application program. The platform executes the application program. Thus, a function of the platform provided by executing an application program will be referred to as a platform application in this embodiment of the present invention. Furthermore, the platform can execute part of processing illustrated in the flowcharts disclosed in this embodiment of the present invention.
Returning to the description with reference to FIG. 4, the user interface 407 is a unit necessary to receive a processing request from the user. For example, the user interface 407 receives, through a touch panel, a keyboard, a mouse, or the like, a signal according to an instruction input by the user. The external interface 408 is capable of receiving data from external apparatuses and transmitting data to the external apparatuses. For example, the external devices include external storage devices such as external HDDs and external USB memories and separate apparatuses such as separate host computers and image forming apparatuses connected through networks. The image forming apparatuses 107 can communicate with the client terminals 106 and the scan service server 101 through the networks 110 and 111.
Next, the service servers including the scan service server 101 and the task service servers 103 and 104 that provide the cloud services will be described.
The scan service server 101 will be described with reference to
The web application unit 501 provides an application program that provides the scanning function. A ticket creation section 511 realizes a series of functions for enabling the users to create scan tickets. In each scan ticket, settings when the image forming apparatus 107 scans a document, the definitions of subsequent processing flows, parameters for tasks performed in each processing flow, and the like are recorded.
An external I/F 514 communicates with the scanning software unit operating on the image forming apparatus 107. The scanning software unit accesses the functions of a ticket list section 512 and the functions of a scanning reception section 513 through the external I/F 514.
The file saving library unit 502 is a library used for saving data in the flow service servers 102. Details will be described later.
The scanning reception section 513 receives a transmitted scan ticket and image data, and then transmits the image data to a file saving section 521.
A procedure performed until a scan job is input will be described with reference to
In
In
In a scanning process S707 illustrated in
In data saving S714, the image data is input to the flow service servers 102. In the data saving S714, the file saving section 521 inputs file information including a session identifier (ID) issued by the a session ID issuing unit 522 to the flow service servers 102 along with the image data.
The session ID is an identifier issued for each session, and a different identifier is used for connection each time data saving is performed in S714.
The file information will be described later. As a result, the file management service servers 803 of the flow service servers 102 receive the file (the image data in this embodiment) and the file information relating to the file. If communication between the file saving section 521 and the flow service servers 102 fails in the data saving S714 due to a timeout or the like, a retry process is performed using the same session ID as the previous one for the file information. However, a session ID different from that in the initial connection may be used for connection in the retry process, instead.
The retry process is performed three times in this embodiment. In addition, although omitted in
The system configuration of the scan service server 101 and the procedure performed until a scan job is input have been described.
Again, the software configuration of the task service servers 103 and 104 according to this embodiment of the present invention will be described with reference to
Each component will be described hereinafter along with a procedure illustrated in a sequence diagram of the scanning process in
Task obtaining units 611 of the task service servers 103 and 104 regularly make inquiries to the flow service servers 102 in S717 and S729, respectively, and obtain tasks that can be processed by the task service servers 103 and 104. Data obtaining units 612 of the task service servers 103 and 104 obtains image and text data to be processed from the flow service servers 102 in S719 and S731, respectively, on the basis of job information obtained by the task obtaining units 611. Task processing units 615 of the task service servers 103 and 104 perform various processes on the obtained image data in S725 and S737, respectively. A data saving unit 613 saves data processed in S725 in the flow service servers 102 in S727.
The task processing unit 615 of the task service server 104 transmits data regarding a result of the processing in S737 to the cloud service servers 108 in S738.
Task status transmission units 614 of the task service servers 103 and 104 transmit results of the series of task processes to the flow service servers 102 in S728 and S739, respectively.
Thus, the series of processes of the scan job are completed.
Next, the flow service servers 102 will be described in detail. The flow service servers 102 are main service servers in the present invention, and are service servers that perform route management, job management, and temporary file management.
The flow service servers 102 include a route management service server 801, a job management service server 802, and the file management service servers 803. Services are provided by executing various processes on these service servers and combined to provide a flow service for the users.
The route management service server 801 manages information regarding a route connecting tasks. The job management service server 802 manages processing of a job on the basis of the information regarding a route. The file management service servers 803 save and manage data at the time of input of a job and data regarding a result of processing in each task.
Next, the job management service server 802 and the file management service servers 803 included in the flow service servers 102 will be described in detail.
The software configuration of the job management service server 802 will be described with reference to
An external I/F unit 1201 communicates with the task service servers 103 and 104 and the scan service server 101. Each function of the job management service server 802 is accessed through the external I/F unit 1201. A job information management DB unit 1202 manages the status of each created job and an ID of data used in each job. Upon receiving the job input request S716 illustrated in
Next, the file management service servers 803 will be described with reference to
It is to be noted that the file management service server A 1401 to the file management service server X 1403 may be executed as virtual servers on a single server computer or a plurality of server computers. When the file management service server A 1401 to the file management service server X 1403 are executed as virtual servers on a single server computer, the network 1410 is realized by a system bus on the server computer.
Next, the file management service server A 1401 to the file management service server X 1403 that provide a temporary file management function will be described with reference to
The file management service server management DB section 1531 manages information regarding each of the file management service server A 1401 to the file management service server X 1403, in which files are stored.
The path management DB section 1532 manages information regarding temporary files saved in the data storage region unit 1541 of each of the file management service server A 1401 to the file management service server X 1403, the temporary files being managed by the file management service servers 803, as entries.
A temporary file refers to initial data saved from the scan service server 101 and a file generated as a result of processing performed by the task service servers 103 and 104.
A file ID 1610 is information for uniquely identifying an entry in each of the file management service server A 1401 to the file management service server X 1403.
A file group ID 1611 is information for grouping each entry using a related job. Therefore, entries generated in the same job have the same file group ID 1611. The value of a task ID 1612 is either a task ID for identifying a task relating to a temporary file corresponding to each entry or “init”, which indicates initial data. A No. 1613 indicates a file number of a temporary file generated in each task. An arbitrary number is provided as the No. 1613 by the scan service server 101 in this embodiment.
A path 1614 indicates a full path of a storage of a temporary file corresponding to each entry and is used when the web application unit 1501 accesses an entity through the backend unit 1502. A host name 1615 indicates a host name of a file management service server that stores a temporary file corresponding to each entry. A date of creation 1616 indicates a time at which a temporary file has been stored in the data storage region unit 1541. An expiration time 1617 indicates an expiration time of a temporary file, and a temporary file corresponding to an entry whose expiration time 1617 has come is deleted. A tenant ID 1618 indicates a tenant ID of a tenant to which a user who has saved a temporary file belongs. A session ID 1619 indicates a session ID used when a file has been saved. For example, a session ID issued by the scan service server 101 in the data saving S714 is stored.
Next, the functions of the web application unit 1501 will be described.
An overwriting prohibiting file saving section 1511 realizes a function of multiplexing and saving a file in the data storage region unit 1541 of each of the file management service server A 1401 to the file management service server X 1403 while prohibiting overwriting in accordance with a request from the scan service server 101. The request from the scan service server 101 includes information relating to a file to be saved, such as the task ID 1612, the No. 1613, the expiration time 1617, the tenant ID 1618, the session ID 1619, and the like, which are managed as an entry of the path management DB section 1532. In addition, if an exception such as a communication error is generated when the scan service server 101 is making a request to the overwriting prohibiting file saving section 1511, the scan service server 101 can perform the retry process.
As described with reference to the processing in S714 illustrated in
A subsequent process will be described with reference to a flowchart of
If an entry having the same file information exists in S1702, the overwriting determination processing section 1522 obtains the same entry from the path management DB section 1532 in S1705. The overwriting determination processing section 1522 checks in S1707 whether or not the session ID included in the file information in the request and the session ID 1619 included in the entry obtained in S1705 match. If the session IDs match in S1707, it is determined that the file included in the request has already been saved, and the overwriting prohibiting file saving section 1511 returns a notification of successful saving to the scan service server 101 in S1706. If the session IDs do not match in S1707, the overwriting prohibiting file saving section 1511 determines the request as an overwriting request, and generates an exception in S1708. The scan service server 101 then obtains information indicating the generation of the exception.
Sequences in which, as a result of the process illustrated in
First, the scan service server 101 makes a data saving request S1801 to the overwriting prohibiting file saving section 1511. Upon receiving the data saving request S1801, the overwriting prohibiting file saving section 1511 performs an overwriting determination process S1802 on the overwriting determination processing section 1522. In S1803, the overwriting determination processing section 1522 checks whether or not the same entry as file information included in the data saving request S1801 already exists in the path management DB section 1532, and returns a result of the determination in S1805.
Cases 1841 and 1842 indicate processing procedures that can be performed in accordance with the result in S1805 when the data saving request S1801 is an initial data saving request.
The case 1841 indicates a processing procedure at a time when the result of the determination in S1805 indicates no entry. The case 1841 corresponds to a case in which the data saving request S1801 is not an overwriting request. Therefore, the overwriting prohibiting file saving section 1511 writes a file to the data storage region unit 1541 in file writing S1806, and writes an entry to the path management DB section 1532 in a DB writing process S1808. Thereafter, the overwriting prohibiting file saving section 1511 returns a response of a notification of successful saving S1810 to the scan service server 101.
The case 1842 indicates a processing procedure at a time when the result of the determination in S1805 indicates that there is an entry but the session IDs do not match. The case 1842 corresponds to a case in which the data saving request S1801 is an overwriting request. Therefore, in S1811, the overwriting prohibiting file saving section 1511 generates an exception indicating that the file already exists. The case 1842 is the same as a case in which the data saving request S1020 has been made in
It is to be noted that in the case of an initial request, there can be no case in which there is an entry and session IDs match. That is, for example, the third-party application server 1001 or the like cannot obtain the session ID of an already existing entry. Therefore, the third-party application server 1001 or the like cannot specify the session ID of an already existing entry as a session ID of file information, and accordingly the session IDs do not match.
Cases 1843 to 1845 indicate processing procedures that can be performed in accordance with the result in S1805 when the data saving request S1801 is a data saving request after the initial request.
The case 1843 indicates a processing procedure at a time when the result of the determination in S1805 indicates no entry. This case corresponds to a case in which an entry has not been successfully created at the initial request and accordingly a retry is performed. In this case, the overwriting prohibiting file saving section 1511 writes a file to the data storage region unit 1541 in file writing S1821. Next, the overwriting prohibiting file saving section 1511 writes an entry to the path management DB section 1532 in a DB writing process S1823, and then returns a response of a notification of successful saving S1825 to the scan service server 101.
The case 1844 indicates a processing procedure at a time when the result of the determination in S1805 indicates that there is an entry and the session IDs match. The case 1844 corresponds to a case in which the file to be saved has already been saved by a past saving request. Therefore, unlike the case 1843, the overwriting prohibiting file saving section 1511 returns a response indicating a notification of successful saving S1826 to the scan service server 101 without performing the process for saving a file. The problem that an exception is undesirably generated by the data saving request S920 has been described with reference to
The case 1845 indicates a processing procedure at a time when the result of the determination in S1805 indicates that there is an entry and the session IDs do not match. The case 1845 corresponds to a case in which the data saving request S1801 is an overwriting request. Therefore, in S1831, the overwriting prohibiting file saving section 1511 generates an exception indicating that the file already exists. The scan service server 101 then obtains information indicating the generation of the exception. The case 1845 corresponds to a case in which, for example, the third-party application server 1001 makes a data saving request again even after the case 1842.
As in the case 1841 to 1845, notification of successful saving and generation of an exception can be performed in a desirable manner by following the process illustrated in
Referring back to
Upon receiving the request from the task service server 103 or 104, the overwriting permitting file saving section 1513 transfers the request to the file saving processing section 1521. The file saving processing section 1521 writes a file to or updates a file in the data storage region unit 1541 and adds an entry to or updates an entry in the path management DB section 1532, and finally returns a notification of successful saving to the task service server 103 or 104 that has made the call.
The file obtaining processing section 1523 receives a file obtaining request from the task service server 103 or 104 through the file obtaining section 1512. Upon receiving the file obtaining request, the file obtaining processing section 1523 searches the path management DB section 1532 for an entry corresponding to file information included in the request. If there is an entry corresponding to the request in the path management DB section 1532, the file obtaining processing section 1523 obtains a corresponding temporary file from the data storage region unit 1541, and returns the temporary file to the task service server 103 or 104 that has made the call through the file obtaining section 1512.
An advantageous effect produced by the first embodiment is that a desirable response can be returned to the client regardless of whether a request to the overwriting prohibiting file saving section 1511 is an initial saving request or a retry saving request.
Assume a case in which, in the first embodiment, the file saving processing section 1521 continues the process for saving a file in the data storage region unit 1541 even after an initial request from the file saving section 521 of the scan service server 101 to the overwriting prohibiting file saving section 1511 is timed out.
Since the initial request has been timed out, the file saving section 521 makes a retry request to the overwriting prohibiting file saving section 1511 again while including, in file information, the same session ID as that of the initial request. At this time, since the file saving processing section 1521 is still writing the file corresponding to the initial request to the data storage region unit 1541, the file that is being written is write-locked. Therefore, writing of a file corresponding to the retry request from the file saving processing section 1521 to the data storage region unit 1541 fails since the file is already write-locked. As a result, the retry request fails, which is problematic.
The procedure of a process for saving a temporary file from the file saving processing section 1521 to the data storage region unit 1541 in this embodiment, that is, the procedure of the processing indicated by S1703 illustrated in
An advantageous effect produced by this embodiment is that, by adding the postfix to the end of a file name, failure of a retry request due to a write-locked file can be avoided.
It is to be noted that although the postfix is added to the end of a file name in this embodiment, a character string may be added to any part of a file name insofar as the resultant file name becomes unique to a request.
If the same entry as file information included in a request already exists when the file information is added to the path management DB section 1532 in the second embodiment, the entry is overwritten. By overwriting the entry in this manner, a temporary file corresponding to the entry before the overwriting undesirably remains in the data storage region unit 1541 as an unnecessary file without being referred to from the entry, thereby consuming the capacity of the data storage region unit 1541.
Therefore, in this embodiment, a temporary file corresponding to an entry before overwriting is deleted from the data storage region unit 1541 before an entry from the path management DB section 1532 is used for overwriting. A processing procedure for adding an entry from the file saving processing section 1521 to the path management DB section 1532 according to this embodiment will be described with reference to
In S1901, the file saving processing section 1521 checks whether or not the same entry as file information included in a request already exists in the path management DB section 1532. If the same entry does not exist in S1901, the file saving processing section 1521 newly adds an entry to the path management DB section 1532. If the same entry exists in S1901, the file saving processing section 1521 obtains the existing entry in S1910, and substitutes the existing entry for an old entry. Next, the file saving processing section 1521 overwrites the existing entry in the path management DB section 1532 with a new entry, and deletes a file associated with the old entry from the data storage region unit 1541.
In the third embodiment, a file that is not referred to from an entry can be deleted, thereby saving the capacity of the data storage region unit 1541.
In the first to third embodiments, a case has been assumed in which the scan service server 101 saves initial data in the file management service servers 803. In this embodiment, a case will be assumed in which a task saves initial data in the file management service servers 803. As an example in which a task saves initial data, a case is possible in which the scan service server 101 saves scan data using an external service and, when the image processing described in the first to third embodiment has become necessary, inputs only a job to the job management service server 802. In the job input here, a route is specified that sequentially executes a task that obtains the scan data from the external service and saves the scan data in the file management service servers 803 and a task to be executed by the task service server 103 or 104. In this embodiment, the task that obtains the scan data from the external service and that saves the scan data in the file management service servers 803 will be referred to as a file saving task service server 2140.
In the first to third embodiments, the data saving S714 is performed by the scan service server 101. At this time, for example, it is possible that the scan service server 101 performs both the initial request and the retry process in the same process. If the scan service server 101 performs both the initial request and the retry process in the same process, a session ID of file information at the initial request is stored in processing in the process and then used as a session ID of file information in the retry process. Therefore, the same session ID 1619 can be used in the initial saving request and the retry request. As a result, the retry request to the overwriting prohibiting file saving section 1511 and an overwriting request can be distinguished from each other in S1707, and the type of response can be switched.
On the other hand, if each task fails to save a file, each task is retried on the basis of an upper limit value of the number of retries, which is set for each task. If processing fails, each task notifies the job management service server 802 of the failure, and returns control to the job management service server 802 for the time being. Therefore, processing might be performed using different processes between first execution of the task (initial request) and second execution of the task (retry). As a result, different session IDs of file information might be used between the retry file request and the initial request, or a session ID might not be used. Accordingly, since the retry request to the overwriting prohibiting file saving section 1511 and an overwriting request cannot be distinguished from each other, a correct response cannot be returned to the client.
Therefore, in the fourth embodiment, the job management service server 802 manages jobs and session IDs while associating the jobs and the session IDs with each other.
A procedure for saving initial data from the file saving task service server 2140 to the file management service servers 803 will be described with reference to a flowchart of
The file saving task service server 2140 determines whether or not a session ID 2001 of the obtained job is null. If the session ID 2001 is null, it means that the session ID 2001 has not been issued. If the session ID 2001 is null in S2110, the file saving task service server 2140 issues a session ID in S2111, and requests the job management service server 802 to update the session ID 2001 in S2112. Upon receiving the request to update the session ID 2001, the job management service server 802 updates the session ID 2001 in the job information management DB unit 1202 in S2113.
Next, in S2120, the file saving task service server 2140 makes an overwriting prohibiting file saving request to the overwriting prohibiting file saving section 1511 of one of the file management service server A 1401 to the file management service server X 1403. As the session ID 1619 included in the request in S2120, a character string issued in S2111 is used if the session ID 2001 is null in S2110, or a character string of the session ID 2001 is used if the session ID 2001 is not null. Thus, by managing information relating to the session ID 2001 using the job information management DB unit 1202, the same session ID can be used in each process performed by the file saving task service server 2140.
In an overwriting prohibiting file saving process S2121, the same processing as that illustrated in
After completion of S2121, the file saving task service server 2140 determines in S2130 whether or not the saving process has been successfully completed. If the saving process has been successfully completed in S2130, the file saving task service server 2140 notifies the job management service server 802 of the completion of the task in S2122. The job management service server 802 updates a current task ID 1304, which indicates a current task ID of the job information management DB unit 1202, to a next task in a task completion process S2123.
If the saving process has failed in S2130, the file saving task service server 2140 notifies the job management service server 802 of the failure of the task in S2131. The job management service server 802 increments a current number of task retries 1311, which indicates the number of retries of the task, in a task failure process S2132.
A procedure for saving initial data from a file saving task service A server 2201 and a file saving task service B server 2202 to the file management service servers 803 will be specifically described with reference to a sequence illustrated in
First, the file saving task service A server 2201 makes a task obtaining request S2211 to the job management service server 802, and the job management service server 802 returns a task to be processed by the file saving task service A server 2201 in S2212. The file saving task service A server 2201 performs a task process S2213, and saves a file generated as a result of the task process S2213 in the file management service servers 803 as initial data.
Since the task process S2213 is an initial task process, the session ID 2001, which is an element of job information included in the response S2212 from the job management service server 802, is null. Therefore, the file saving task service A server 2201 issues a session ID in S2214, and makes a session ID registration request S2215 to the job management service server 802. The job management service server 802 returns S2216 by registering the session ID issued in S2214 to the session ID 2001 of the job information management DB unit 1202.
After completing the registration of the session ID to the job information management DB unit 1202, the file saving task service A server 2201 makes an initial data saving request S2221 to the overwriting prohibiting file saving section 1511. Upon receiving the initial data saving request S2221, the overwriting prohibiting file saving section 1511 performs, in S2222 to S2229, the same process for saving a file as that in S1802 to S1809, and tries to return a response of a notification of successful saving S2230 to the file saving task service A server 2201. If connection between the file saving task service A server 2201 and the file management service servers 803 is timed out because it has taken a long time to complete the process for saving a file, however, the response of the notification of successful saving S2230 cannot be returned.
Therefore, this time, the file saving task service B server 2202 makes a task obtaining request S2231 to the job management service server 802, and the job management service server 802 returns a task to be processed by the file saving task service B server 2202 in S2232. The file saving task service B server 2202 performs a task process S2233, and saves a file generated as a result of the task process S2233 in the file management service servers 803 as initial data.
Since the task process S2233 is a retry task process, the session ID issued by the file saving task service A server 2201 in S2214 is set as the session ID 2001 included in the response S2212 from the job management service server 802. Therefore, the file saving task service B server 2202 makes an initial data saving request S2234 to the overwriting prohibiting file saving section 1511 using this session ID.
Upon receiving the initial data saving request S2234, the overwriting prohibiting file saving section 1511 performs, in S2235 to S2238, the same overwriting determination process as that when the result of the determination in S1802 to S1805 illustrated in
It is to be noted that although the initial task process S2213 and the retry task process S2233 are performed by different file saving task service servers in this embodiment, the same file saving task service server may perform these processes, instead. When there are a plurality of file saving task service servers, a file saving task service server can continue processing even if another file saving task service server stops, which improves usability.
According to the fourth embodiment, even when a task makes an initial data saving request to the overwriting prohibiting file saving section 1511, a correct response can always be obtained from one of the file management service server A 1401 to the file management service server X 1403.
It is to be noted that the file saving task service server 2140, the job management service server 802, and the file management service servers 803 described in this embodiment may be executed as virtual servers on a single server.
In addition, the present invention is realized by executing the following process.
That is, the present invention is realized by executing a process in which software (program) that realizes the functions of each of the above embodiments is supplied to a system or an apparatus through a network or one of various storage media and a computer (or a CPU, a multiprocessor unit (MPU), or the like) of the system or the apparatus reads and executes the program.
According to the present invention, even if, for example, connection to a component that has transmitted a file becomes no longer available and a file is received again as described with reference to the above-described problem, information indicating that the file has already been saved can be transmitted.
Embodiments of the present invention can also be realized by a computer of a system or apparatus that reads out and executes computer executable instructions recorded on a storage medium (e.g., non-transitory computer-readable storage medium) to perform the functions of one or more of the above-described embodiment(s) of the present invention, and by a method performed by the computer of the system or apparatus by, for example, reading out and executing the computer executable instructions from the storage medium to perform the functions of one or more of the above-described embodiment(s). The computer may comprise one or more of a central processing unit (CPU), micro processing unit (MPU), or other circuitry, and may include a network of separate computers or separate computer processors. The computer executable instructions may be provided to the computer, for example, from a network or the storage medium. The storage medium may include, for example, one or more of a hard disk, a random-access memory (RAM), a read only memory (ROM), a storage of distributed computing systems, an optical disk (such as a compact disc (CD), digital versatile disc (DVD), or Blu-ray Disc (BD)™), a flash memory device, a memory card, and the like.
While the present invention has been described with reference to exemplary embodiments, it is to be understood that the invention is not limited to the disclosed exemplary embodiments. The scope of the following claims is to be accorded the broadest interpretation so as to encompass all such modifications and equivalent structures and functions.
This application claims the benefit of Japanese Patent Application No. 2013-122460 filed Jun. 11, 2013, which is hereby incorporated by reference herein in its entirety.
Number | Date | Country | Kind |
---|---|---|---|
2013-122460 | Jun 2013 | JP | national |