Image processing apparatus and control method of the same

An apparatus, method, and program accesses a USB memory in accordance with a request from a PC on a network using a USB host interface, a USB device interface, a network interface, a network manager which inputs, via the network interface, a file access command which requests access to a memory card connected to the USB host interface, a memory manager which inputs the file access command generated inside an apparatus, a file access controller which performs exclusive access control between the file access commands input by the network and memory managers, a SCSI analyzer which converts the file access command selected by the file access controller into a SCSI command, and a memory card access controller which performs exclusive access control between the SCSI command generated by the conversion, and a SCSI command input via the USB device interface and requests access to the memory card.

TECHNICAL FIELD

The present invention relates to an image processing apparatus which has a USB host interface, USB device interface, and LAN interface, and performs various processes on an input image.

BACKGROUND ART

An MFP (Multi Function Peripheral) having a plurality of image processing functions, such as a printer and scanner, is conventionally known. One type of MFP can connect to a PC or an external memory by using USB, and can perform reading and writing to the memory (to be referred to as a USB memory hereinafter) connected by USB from an operation unit of the MFP or from the PC (USB-PC) connected by USB. This makes it possible to, e.g., store an image read by a scanner into the USB memory, store data received from the USB-PC into the USB memory, print an image stored in the USB memory by the MFP, and read out data from the USB memory and transfer the readout data to the PC. An MFP having a network I/F is also known, and this MFP can be operated as a network printer and a network scanner (Japanese Patent Laid-Open No. 2003-114769).

In the conventional MFP, however, the USB-PC alone can access the USB memory, and no PC on the network can access the USB memory.

DISCLOSURE OF INVENTION

The present invention has been made to solve the above problem of the prior art, and provides an image processing apparatus capable of easily and appropriately accessing a USB memory in accordance with a request from a PC on a network, and a control method of the same.

According to a first aspect of the present invention, an image processing apparatus, which has a USB (Universal Serial Bus) host interface, a USB device interface, and a network interface, and performs various processes for input image data, includes: first input means for inputting, via the network interface, a first file access command which requests access to a storage medium connected to the USB host interface; second input means for inputting a second file access command generated inside the image processing apparatus; file access control means for performing exclusive access control between the first file access command input by the first input means, and the second file access command input by the second input means; command conversion means for converting either the first file access command or the second file access command selected by the exclusive access control by the file access control means into a SCSI (Small Computer System Interface) command; and storage medium access control means for performing exclusive access control between the SCSI command generated by the conversion by the command conversion means, and a SCSI command which is input via the USB device interface and for requesting access to the storage medium.

According to a second aspect of the present invention, a control method of an image processing apparatus is provided. The apparatus comprises: a USB host interface; a USB device interface; a network interface; first input means for inputting, via the network interface, a first file access command which requests access to a storage medium connected to the USB host interface; and second input means for inputting a second file access command generated inside the image processing apparatus. The method comprises: a file access control step of performing exclusive access control between the first file access command input by the first input means, and the second file access command input by the second input means; a command conversion step of converting either the first file access command or the second file access command selected by the exclusive access control in the file access control step into a SCSI command; and a storage medium access control step of performing exclusive access control between the SCSI command generated by the conversion in the command conversion step, and a SCSI command which is input via the USB device interface and of requesting s access to the storage medium.

According to a third aspect of the present invention, a control program of an image processing apparatus is provided. The apparatus comprises: a USB host interface; a USB device interface; a network interface; first input means for inputting, via the network interface, a first file access command which requests access to a storage medium connected to the USB host interface; and second input means for inputting a second file access command generated inside the image processing apparatus. The control program causes a computer to execute: a file access control step of performing exclusive access control between the first file access command input by the first input means, and the second file access command input by the second input means; a command conversion step of converting either the first file access command or the second file access command selected by the exclusive access control in the file access control step into a SCSI command; and a storage medium access control step of performing exclusive access control between the SCSI command generated by the conversion in the command conversion step, and a SCSI command which is input via the USB device interface and of requesting access to the storage medium.

Other features and advantages of the present invention will be apparent form the following description taken in conjunction with the accompanying drawings, in which like reference characters designate the same or similar parts throughout the figures thereof.

BEST MODE FOR CARRYING OUT THE INVENTION

FIG. 1is a block diagram showing the arrangement of an MFP as an embodiment of an image processing apparatus according to the present invention.

Referring toFIG. 1, an MFP100has a CPU101, a ROM102, a RAM103, a scanner104, a printer105, an operation display106, a network I/F controller107, a network I/F108, a USB device I/F controller109, a USB device I/F110, a USB host I/F controller111, a USB host I/F112, and a memory card reader/writer113.

The CPU101is a system controller, and controls the whole of the MFP100. The ROM102stores a control program of the CPU101.

The RAM103is, e.g., an SRAM or DRAM, and stores program control variables and the like. The RAM103also stores set values registered by the user of the MFP100, management data and the like of the MFP100, and various work buffers.

The scanner104is made up of a CS image sensor, a document feeding mechanism, and the like, and optically reads an original, and converts the read original into electrical image data.

The printer105is a device which prints a received image or file data on a printing sheet.

The operation display106includes, e.g., a keyboard, a touch panel, an LCD, and an LED, allows the user of the apparatus to perform various operations, and performs display and notification to the user of the apparatus.

The network I/F controller107and the USB device I/F controller110perform interface control for external PCs connected via the network I/F108and USB device I/F109, respectively, and accept a file access request and a memory card access request from PCs via these interfaces.

The USB host I/F controller111performs interface control for the memory card reader/writer113connected via the USB host I/F112. A memory card is inserted into the memory card reader/writer113.

FIG. 2is a block diagram showing the software configuration of the MFP.

A network manager202manages a network I/F controller201, and transfers a file access request from the network to a file access controller204. Also, a memory manager203manages the internal memory of the apparatus, and transfers a file access request from inside the apparatus to the file access controller204. Examples of file access from inside the apparatus to the memory card inserted into the memory card reader/writer113are a process for storing an image read by the scanner104in the memory card, a process for printing a file stored in the memory card at the printer105, a process for storing data and images received from other apparatuses in the memory card, and a process for transmitting a file (data and images) stored in the memory card to other apparatuses. In this case, any communication method used for communications with other apparatuses can be employed. Examples of the communication methods are Internet FAX, e-mail (e-mail text and attached file are stored in the memory card), FTP (File Transfer Protocol), communication using a FAX communication unit (not shown), and HTTP (HyperText Transfer Protocol).

The file access controller204converts, by referring to a file system205, the file access request from the network manger202or memory manager203into a SCSI command representing a memory card access request, and sends the SCSI command to a SCSI analyzer206.

A USB device I/F controller207sends a memory card access request (SCSI command) from a USB-PC connected to the USB device I/F to the SCSI analyzer206.

The SCSI analyzer206controls the memory card access request (SCSI command), and realizes access to a memory card by transmitting the SCSI command to the memory card reader/writer113via a USB host I/F208. In this case, a memory card access controller209determines whether access to the memory card is possible, in order to perform exclusive access control for the memory card.

FIG. 3is a view showing tables managed by the memory card access controller.

Reference numeral301denotes an access state table indicating how each accessing instrument is accessing a memory card in the MFP. In this embodiment, the network, the memory (inside the MFP), and the USB are defined as accessing instruments. IDLE indicates a state in which no access is being performed; READ, a state in which READ access is being performed; and WRITE, a state in which WRITE access is being performed.

Reference numerals302and303denote tables each indicating an access file list of each file accessing instrument (the network or the memory (inside the MFP)). These tables store file pointers of all files currently being accessed, and information concerning access types (READ and WRITE).

FIG. 4is a flowchart showing processing performed by the file access controller204when a file open request is received.

When receiving a file open request from the network manager202or memory manager203, the file access controller204determines in step S400whether the file is already open. If the file is already open, the flow terminates by error. If the file is not open, the flow advances to step S401. If it is determined in step S400that the file is already open, the flow ends with error. Even if both the network manager202and memory manager203send file open requests for the same file by changing the type of file access to WRITE, the file can be opened by only the file open request which has been accepted first. The file cannot be opened by the file open request which has been accepted second. This makes it possible to prevent double opening of each file. Each file in the memory card connected to the memory card reader/writer113undergoes exclusive control such that the file cannot be simultaneously opened by the network manager202and memory manager203even if their file open requests have WRITE type of file access.

In step S401, the requested file is opened by referring to the file system205. If it is determined in step S402that file open is successful, the flow advances to step S403, and a file pointer and a type of file access are added to the network access file list302if the file open request is received from the network manager202, or a file pointer and a type of file access are added to the memory access file list303if the file open request is received from the memory manager203.

The access file list302or303is searched in step S404, and, if it is determined in step S405that either accessing instrument has a WRITE-type access file, the state of the accessing instrument is changed to WRITE in the memory card access state table301in step S406, and the flow advances to step S408. If it is determined in step S405that there is no WRITE type, the state of the accessing instrument is changed to READ in the memory card access state table301in step S407, and the flow advances to step S408. If it is determined in step S402that file open has failed, the flow advances to step S408. In step S408, the result of processing for the file open request is returned.

Note that in step S400, the flow terminates by error if the file is already open. Even when the file is already open, however, the flow may also advance to step S403instead of terminating by error if no WRITE type is found when the access file list302or303is searched and if the newly input access request is READ.

FIG. 5is a flowchart showing processing performed by the file access controller204when a file close request is received.

When receiving a file close request, the file is closed via the file system205in step S501. If it is determined in step S502that file close is successful, the flow advances to step S503to delete a file pointer and a type of file access from the access file list302or303. Then, the access file list302or303is searched in step S504, and, if it is determined in step S505that no access file exists, the flow advances to step S506to change all the state columns in the memory card access state table301to IDLE. If it is determined in step S505that an access file exists, the flow advances to step S507to determine whether a WRITE-type access file exists in the access file table302or303. If YES in step S507, the state of the corresponding accessing instrument is changed to WRITE in the memory card access state table301in step S508, and the flow advances to step S510. If it is determined in step S507that no WRITE-type access file exists, the state of the corresponding accessing instrument is changed to READ in the memory card access state table301in step S509, and the flow advances to step S510. If it is determined in step S502that file close has failed, the flow advances to step S510. In step S510, the result of processing for the file close request is returned.

FIGS. 6A to 6Care flowcharts showing processing performed by the USB device I/F controller207when a memory card access request is received.FIG. 6Ashows processing when a memory READ request is received,FIG. 6Bshows processing when a memory WRITE request is received, andFIG. 6Cshows processing when a timer has expired.

When a memory READ request is received, in step S601, the memory card access state of the accessing instrument USB in the memory card access state table301is changed to READ. In step S602, the timer is restarted (stopped and started if the timer is in operation, and started if the timer is not in operation), and, in step S603, the memory READ request is transferred to the SCSI analyzer206.

When a memory WRITE request is received, in step S611, the memory card access state of the accessing instrument USB in the memory card access state table301is changed to WRITE. In step S612, the timer is restarted, and, in step S613, the memory WRITE request is transferred to the SCSI analyzer206.

When the timer has expired, in step S621, the memory card access state of the accessing instrument USB in the memory card access state table301is changed to IDLE. While the timer is in operation, therefore, the memory card access state is set to READ and WRITE.

FIGS. 7 and 8are flowcharts showing a memory card access confirmation process performed by the memory card access controller209.FIG. 7shows processing when a SCSI WRITE request is received, andFIG. 8shows processing when a SCSI READ request is received.

As described above, the file access controller204performs exclusive control for memory WRITE requests from the network manager202and memory manager203. A memory WRITE request from an external PC connected to the USB device I/F controller207cannot be managed by the file access controller204. The memory WRITE request via the USB device I/F controller207and the memory WRITE request via the file access controller204must undergo exclusive control. The memory card access controller209performs exclusive control for the memory WRITE requests via the USB device I/F controller207and file access controller204. More specifically, control inFIG. 7is performed as will be described below.

When a SCSI WRITE request is received, in step S701ofFIG. 7, the memory card access state table301is searched for the memory card access states to determine whether “an accessing instrument in the WRITE state is only a USB accessing instrument, and all the other accessing instruments are in the IDLE state”. Alternatively, it is determined in step S701whether “an accessing instrument in the WRITE state is a network or memory, and the USB is in the IDLE state”.

The expression “an accessing instrument in the WRITE state is only a USB accessing instrument, and all the other accessing instruments are in the IDLE state” indicates that the SCSI analyzer206generates a SCSI WRITE request when a memory WRITE request is received from an external PC via the USB device I/F controller207. The expression “an accessing instrument in the WRITE state is a network or memory, and the USB is in the IDLE state” indicates that the SCSI analyzer206generates a SCSI WRITE request when a memory WRITE request is received from the network manager202or memory manager203via the file access manager204. As a supplementary explanation, the network manager202receives a memory WRITE request from a PC on the network via the network I/F controller201to send the memory WRITE request to the SCSI analyzer206via the file access controller204. If YES in step S701, the flow advances to step S702to perform WRITE access to the memory card by a SCSI WRITE command via the USB host I/F controller208. The completion of the processing in step S702is waited for in step S703, and the processing result is saved in step S704. If NO in step S701, the processing result is set to error in step S705. In step S706, the result of processing for the SCSI WRITE request is returned.

When a SCSI READ request is received, in step S801ofFIG. 8, READ access to the memory card is performed by a SCSI READ command via the USB host I/F controller208. The completion of the processing in step S801is waited for in step S802, and the processing result is saved in step S803. In step S804, the result of processing for the SCSI READ request is returned.

As described above, WRITE access to the memory card is performed when “there is only one accessing instrument in the WRITE state, and all the other accessing instruments are in the IDLE state”, so exclusive access control can be performed for memory card access requests from a plurality of accessing instruments. That is, file access requests from a plurality of accessing instruments, such as a file access request transmitted across the network and a file access request for saving an image file to be processed inside the apparatus, can be processed in turn.

As has been described above, this embodiment includes the file access controller204for controlling access to a file, and the memory card access controller209for controlling access to a memory card, and thereby can realize file access and memory card access from a plurality of requesting instruments such as a network, the apparatus main body, and a USB (MassStorageClass).

Other Embodiments

Though the embodiment of the present invention has been detailed above, the invention may be applied to a system constituted by a plurality of devices, or an apparatus comprising a single device.

Further, the invention can be implemented by supplying a software program, which implements the functions of the foregoing embodiments, directly or remotely to a system or apparatus, reading the supplied program code with a computer of the system or apparatus, and then executing the program code. Accordingly, since the functions of the present invention are implemented by computer, the program code installed in the computer is also included within a technical scope of the present invention.

In this case, so long as the system or apparatus has the functions of the program, the program may be executed in any form, such as an object code, a program executed by an interpreter, or scrip data supplied to an operating system.

Examples of storage media that can be used for supplying the program are a floppy disk, a hard disk, an optical disk, a magneto-optical disk, an MO, a CD-ROM, a CD-R, a CD-RW, a magnetic tape, a non-volatile type memory card, a ROM, and a DVD (DVD-ROM and DVD-R).

As for the method of supplying the program, a client computer can be connected to a home page on the Internet using a browser of the client computer, and the computer program of the present invention or an automatically-installable compressed file of the program can be downloaded from the home page to a recording medium such as a hard disk. Further, the program of the present invention can be supplied by dividing the program code constituting the program into a plurality of files and downloading the files from different home pages. In other words, a WWW (World Wide Web) server that downloads, to multiple users, the program files that implement the functions of the present invention by computer is also covered by the claims of the present invention.

Besides the cases where the aforementioned functions according to the embodiments are implemented by executing the read program by computer, an operating system or the like running on the computer may perform all or a part of the actual processing according to the instructions of the program, so that the functions of the foregoing embodiments can be implemented by this processing.

CLAIM OF PRIORITY

This application claims priority from Japanese Patent Application No. 2004-202004 filed on Jul. 8, 2004, the entire contents of which are hereby incorporated by reference herein.