WO2011120380A1 - 具有usb接口的打印机及其驱动安装方法与系统 - Google Patents

具有usb接口的打印机及其驱动安装方法与系统 Download PDF

Info

Publication number
WO2011120380A1
WO2011120380A1 PCT/CN2011/071813 CN2011071813W WO2011120380A1 WO 2011120380 A1 WO2011120380 A1 WO 2011120380A1 CN 2011071813 W CN2011071813 W CN 2011071813W WO 2011120380 A1 WO2011120380 A1 WO 2011120380A1
Authority
WO
WIPO (PCT)
Prior art keywords
printer
computer
driver
usb
storage device
Prior art date
Application number
PCT/CN2011/071813
Other languages
English (en)
French (fr)
Inventor
雷文·艾德里安斯·雅可巴斯·安东尼亚·玛瑞亚·凡
王春涛
郭宗胜
刑燕斌
Original Assignee
山东新北洋信息技术股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 山东新北洋信息技术股份有限公司 filed Critical 山东新北洋信息技术股份有限公司
Priority to EP11761954.4A priority Critical patent/EP2551775A4/en
Priority to US13/638,601 priority patent/US20130038888A1/en
Publication of WO2011120380A1 publication Critical patent/WO2011120380A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/12Digital output to print unit, e.g. line printer, chain printer
    • G06F3/1201Dedicated interfaces to print systems
    • G06F3/1202Dedicated interfaces to print systems specifically adapted to achieve a particular effect
    • G06F3/1203Improving or facilitating administration, e.g. print management
    • G06F3/1204Improving or facilitating administration, e.g. print management resulting in reduced user or operator actions, e.g. presetting, automatic actions, using hardware token storing data
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/12Digital output to print unit, e.g. line printer, chain printer
    • G06F3/1201Dedicated interfaces to print systems
    • G06F3/1223Dedicated interfaces to print systems specifically adapted to use a particular technique
    • G06F3/1224Client or server resources management
    • G06F3/1225Software update, e.g. print driver, modules, plug-ins, fonts
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/12Digital output to print unit, e.g. line printer, chain printer
    • G06F3/1201Dedicated interfaces to print systems
    • G06F3/1278Dedicated interfaces to print systems specifically adapted to adopt a particular infrastructure
    • G06F3/1284Local printer device

Definitions

  • the present invention relates to the field of printing, and in particular to a printer having a USB interface and a method and system for driving the same.
  • BACKGROUND OF THE INVENTION In recent years, printing devices using a Universal Serial Bus (USB) and a personal computer (for convenience of description, hereinafter referred to as a computer or a PC) have gradually become mainstream, especially in the retail and catering industries. Widely used POS printers, when communicating with a PC, if you only use the general functions of the printer, such as data printing, simple status monitoring, etc., you do not need to install a special printer driver, just use the printing device provided by the operating system.
  • USB Universal Serial Bus
  • PC personal computer
  • the driver can be used; if you want to use all the functions of the printer, such as the current application of the POS printer provides a lot of functions, such as real-time status query, automatic status return, etc., you need to install the dedicated USB device driver provided by the printer manufacturer.
  • the currently used printer driver installation method is: Use the CD-ROM carrying the driver to install through the CD-ROM drive of the computer. Using a CD-ROM to carry the printer driver is not only bulky, but also increases the cost of the printer's accessories.
  • USB-HUB USB hub
  • USB-HUB USB hub
  • the USB device is recognized as two devices: a USB memory and a printing device, a USB memory, and
  • the printing device is two independent devices; the driver of the printing device is stored in the USB memory, and the USB driver of the printing device is installed by accessing the driver in the USB storage device, and then the printing device is used after the device is installed.
  • the solution can prevent the user from carrying the optical disc and realize that the device itself stores its USB driver, a USB hub and a USB memory independent of the printing device are added in the printing device, which not only increases the cost of the printing device, but also the printing device cannot be USB.
  • the storage area of the storage device is managed, causing waste of the free storage area of the USB memory.
  • an effective solution has not been proposed yet.
  • SUMMARY OF THE INVENTION The present invention has been made in view of the problem that the driver for installing a USB device is not convenient. Therefore, it is a primary object of the present invention to provide a printer having a USB interface and a method and system for driving the same to solve the above problems.
  • a printer having a USB interface is provided.
  • a printer having a USB interface includes: a USB interface and a printing mechanism, further comprising: a controller; a first memory connected to the controller and storing a driver of the printer; wherein the first memory further stores the device flag , wherein the type of the device flag includes a storage device flag and a printing device flag.
  • the above printer further comprises: an input mechanism connected to the controller, configured to receive a signal input by the user to cause the controller to modify the type of the device identifier of the first memory.
  • the input mechanism can be a manual input mechanism, such as a button mechanism, or an external mechanism such as a dedicated application input mechanism.
  • the type of the default device flag of the first memory is a storage device flag.
  • the above printer is connected to the computer via a USB interface, wherein after the computer installs the driver, the printer modifies the type of the device flag to be a printing device flag.
  • the first memory is disposed inside or outside the printer, and is disposed outside the printer, and is connected to the printer through an external interface of the printer. Further, the first memory further stores a product information file of the printer, or the printer further includes: a second memory connected to the printer through an external interface of the printer, storing a product information file of the printer and/or driver.
  • a driving installation method of a printer having a USB interface includes: when the printer is connected to a computer, the printer is recognized as a storage device or a printing device, wherein a device flag is stored in the printer, wherein the type of the device flag includes storage Equipment logo and printing equipment logo; In the case where the printer is recognized as a storage device, the computer installs the driver stored in the printer. Further, the device type of the printer is modified by a signal input by the user, wherein the device type includes a storage device or a printing device. Further, when the printer is connected to the computer for the first time, the device type of the printer is a storage device.
  • the method further includes: the computer 4 tampering with the device type of the printer is a printing device.
  • the method further includes: when the printer is recognized as a storage device, the computer determines whether to install the driver in the printer; if the determination result is yes, the computer is installed The driver modifies the device type of the printer to a printing device; in the case of a negative determination, the computer does not modify the device type of the printer, and the printer establishes communication with the computer to perform a predetermined operation.
  • the above method further comprises: the printer receiving a control signal input by the user; the printer changing the device type by the control signal.
  • a drive mounting system of a printer having a USB interface is provided.
  • a drive installation system for a printer having a USB interface according to the present invention: a computer; a printer connected to a computer via a USB interface, wherein the computer recognizes the printer as a storage device or a printing device, and in the case of recognizing the printer as a storage device, installing the printer The driver stored in .
  • the invention adopts a printer having a USB interface with the following structure: a controller; a first memory connected to the controller and storing a driver of the printer; wherein the first memory further stores a device identifier, wherein the device flag The type includes the storage device flag and the printing device flag.
  • the printer Since the first memory stores two device type flags, when the printer is connected to the computer, the printer is recognized as a storage device or a printing device, wherein the printer is recognized When the device is stored, the computer can install the driver stored in the printer. Therefore, the present invention solves the problem that the driver for installing the USB device is not convenient, thereby achieving the effect of conveniently installing the driver of the USB device.
  • FIG. 1 is a block diagram showing an internal configuration of a printer embodiment according to an embodiment of the present invention
  • FIG. 2 is a schematic diagram of a FLASH memory storage area allocation in a printer according to an embodiment of the present invention
  • FIG. 4 is a flow chart showing a method of driving installation of a printer having a USB interface according to an embodiment of the present invention
  • FIG. 5 is a first embodiment of communication between a computer and a printer according to an embodiment of the present invention
  • Figure 6 is a flow chart of a second embodiment of a computer-to-printer communication according to an embodiment of the present invention
  • Figure 7 is a flow chart of a communication process between a computer and a printer according to an embodiment of the present invention
  • FIG. 9 is a schematic diagram of an external memory storage area allocation of a printer according to an embodiment of the present invention.
  • a printer having a USB interface includes a USB interface 18 and a printing mechanism 12, and further includes: a controller 13; a first memory (for example, a FLASH memory) 15 connected to the controller 13 , a driver storing the printer; wherein, the first save The memory 15 also stores a device flag, wherein the type of the device flag includes a storage device flag and a printing device flag.
  • a first memory for example, a FLASH memory
  • one of the storage device flag and the printing device flag is identified as an enabled state, wherein when the storage device flag is identified as being enabled, the printer is identified as a storage device, at which time the computer can be in the storage device
  • the stored driver is installed, and in the case where the printing device flag is identified as the enabled state, the printer is identified as the printing device state, and at this time, the printer can be caused to perform a printing operation or the like.
  • convenient installation of the printer driver can be achieved.
  • the printer 50 communicates with the computer 40 via a USB communication cable 30 to collectively form the printing system 1.
  • the printer includes a controller 13, an input mechanism (including a button mechanism or a touch screen mechanism, etc., exemplified by a button mechanism), a printing mechanism 12, a RAM memory 14, a FLASH memory 15, and a USB controller 17.
  • the input mechanism 11 is configured to perform various operations, tests, and the like on the printer, such as modifying a device identifier (or device identification) of the printer, printing a print test sample, and the like;
  • the printing mechanism 12 includes: a print head, a print head drive circuit, a medium transfer mechanism, etc., the print head control circuit controls the print head to print on the medium, and the medium transfer mechanism performs the medium transfer;
  • the RAM memory 14 temporarily stores the print data sent by the computer and the status data of the printer.
  • FLASH memory 15 not only stores the printer's control program and font, code page (code page) and other information, but also stores the printer's USB driver, the printer's device logo, and the printer's own product information file and other files; USB controller Control communication between the printer and the computer, including establishment of USB communication, device configuration of the printer, transmission of various data, etc.; the controller 13 controls other parts of the printer to jointly complete USB communication establishment and data transmission of the printer, Data printing, media transfer Wait. 2 is a schematic diagram of the storage area allocation of the printer FLASH memory.
  • the FLASH memory 15 stores the USB driver 151 and the device flag 152 of the printer, wherein the USB driver is the printer device driver of the printer,
  • the USB driver is the printer device driver of the printer
  • the computer can read and install the USB driver
  • the device flag of the printer indicates the device type of the printer when the printer establishes USB communication with the computer. That is, the printer establishes communication between the storage device or the printing device and the computer.
  • the default device type of the printer is a storage device, and only after the printer's USB driver is installed on the computer, the device type is tampered with by the computer, and the 4 bar device type is changed from the storage device to the printer device, thereby printing for the first time.
  • the printing device communicates with the computer (that is, the printer is recognized as a printing device by the computer) to perform a printing operation; in addition, the device type modification of the printer can be performed by a button mechanism (ie, the activation state of the device flag in the printer is modified) This makes it easy for the user to modify the device type of the printer directly.
  • the above input mechanism can also be a dedicated application input mechanism.
  • the dedicated application input mechanism can modify the device type of the printer through a dedicated application installed on the computer.
  • the application when the printer is a printing device, the application sends a control command to the printer to modify the printer device flag through the computer; when the printer is a storage device The application modifies the device type of the printer by modifying the contents of the device flag file in the storage device through the computer.
  • the dedicated application is stored in the FLASH memory 15.
  • 3 is another schematic diagram of FLASH memory storage area allocation in a printer in accordance with an embodiment of the present invention.
  • the FLASH memory may also store a related information file 153 of the product, such as a printer manual 1531, a printer programming manual 1532, a printer maintenance manual 1533, and the like.
  • Step S402 When the printer is connected to the computer, the printer is identified as a storage device or a printing device, wherein the device identifier is stored in the printer, wherein the type of the device identifier Including a storage device flag and a printing device flag, the printer is identified as a storage device when the storage device flag is identified as enabled, and the printer is identified as a printing device when the printing device flag is identified as enabled; wherein, the printer is In the case of being recognized as a printing device, the computer can communicate with the printing device to perform a printing operation, and in the case where the printer is recognized as a storage device, the computer can read the data stored in the storage device and can access the data in the storage device Manage.
  • Step S404 in a case where the printer is recognized as a storage device, the computer installs the driver stored in the printer.
  • the type of the device recognized by the computer can be switched between the storage device and the printing device, so that the driver of the USB device can be conveniently installed without the user carrying the optical disk for installation, and the storage of the printer can also be performed.
  • the data in the device is managed.
  • Figure 5 is a flow diagram of a first embodiment of a computer in communication with a printer in accordance with an embodiment of the present invention. The installation process of the USB driver will be described below with reference to FIG. 5.
  • Step S11 the printer reads the device flag. After the printer is turned on, determine the device type of the printer before establishing USB communication with the computer.
  • the device type of the printer is distinguished by the device flag 152 in the FLASH memory 15, and it is assumed that the device flag 152 is "0", indicating that the printer device type is a storage device; When the device flag 152 is "1", it indicates that the printer device type is a printing device.
  • the printer establishes USB communication with the computer, it can only select one device type, either a printing device or a storage device. Step S13, judging the device type of the printer. After the printer reads the device flag 152, when the read information is “0”, it indicates that the printer device type is a storage device; when the read information is “1”, it indicates that the printer device type is a printing device.
  • Step S15 the printer establishes USB communication between the storage device and the computer.
  • a USB communication is established between a computer and a printer, by responding to the computer by the printer
  • the bDeviceClass field in the device descriptor returned by the GET DESCRIPTOR (device) request determines that the USB printer is a storage device, and the contents of the bDeviceClass field are determined by the device flag 152 of the printer.
  • the computer determines that the printer is a storage class device, it can directly access the files in the FLASH memory of the printer by using the storage class USB driver provided in the computer, without installing a special USB storage class device driver on the computer.
  • Step S17 Install the USB driver on the computer and modify the device flag of the printer. If the USB driver is automatically installed, the USB driver installation interface will automatically pop up on the computer display, and the automatic installation will be performed according to the prompt of the installation interface.
  • the installation program will automatically modify the device type of the printer, without manually modifying the device. Equipment sign. If you do not want to install the USB driver on your computer, or if the computer operating system does not allow automatic installation of the USB driver, you can install the driver by reading the USB driver 151 stored in the FLASH memory 15 of the printer. The device flag 152 stored in the FLASH memory 15 is modified after the program is installed. Only after the printer device logo has been modified will the printer confirm that the USB driver has been installed on the computer.
  • step S19 the printer establishes USB communication with the computer as a printing device.
  • the printer confirms that the printer is a printing device by detecting the device logo, then do the following:
  • the printer immediately resets the USB interface, that is, by changing the D+ signal of the USB interface 18 from the pull-up state to the high-impedance state.
  • the computer detects the change of the D+ signal, it confirms that the printer identified as the storage device has been disconnected from the computer.
  • the printer waits for a certain period of time; 3) The printer sets the D+ signal, and changes the D+ signal of the USB interface from the high-impedance state to the pull-up state.
  • the bDeviceClass field determines that the USB printer is a printing device, the content of the bDeviceClass field is determined by the device flag 152 of the printer, and the device flag 152 of the printer has been changed from the storage device to the printing device after the USB driver is installed on the computer.
  • the computer After the computer establishes USB communication with the printer, it can perform printing-related operations, such as sending print data, querying the status of the printer, and so on.
  • printing-related operations such as sending print data, querying the status of the printer, and so on.
  • the printer When the printer is turned on, its device is marked as a printing device, and when the printer is connected to the computer through the USB interface 18, the above operation is directly performed 3), and USB communication with the computer is established.
  • step S21 the computer communicates with the printer, and the printer performs a print job.
  • the printer After the printer establishes USB communication with the computer as the printing device, the computer can call the installed USB driver to send data to the printer. The printer receives the print data and performs the print job.
  • 6 is a flow chart of a second embodiment of a computer and printer communication in accordance with an embodiment of the present invention.
  • the FLASH memory in the printer stores other software such as the product information 153 of the printer in addition to the USB driver and the printer device flag.
  • the product information 153 of the printer includes: a printer manual 1531, a printer programming manual 1532, a printer maintenance manual 1533, a printer LOGO information 1534, and the like.
  • the number of stored files is determined by the size of the storage capacity of the FLASH memory of the printer. As long as the storage capacity of the FLASH memory is relatively large, more files can be stored. In this case, the communication process between the computer and the printer is as shown in Fig.
  • Step S 161 the computer reads the file in the FLASH memory of the printer.
  • the computer reads all accessible files including the USB driver in the FLASH memory of the printer, such as consulting the product information of the printer. Storing various files through the FLASH memory not only saves the disc of the printer driver, but also saves the disc of the printer storing the product information file.
  • an automatic running program is set in the FLASH memory.
  • step S162 it is determined whether the driver installation is performed. After the printer establishes USB communication with the computer as a storage device, it is determined whether the USB driver installation is performed on the computer. If the driver installation is performed, the process proceeds to step S17; if the driver installation is not performed, the process is performed by step 4 S 163. Step 4 gathers S 163 to perform the selected operation. If the computer does not install the USB driver, the printer's device flag is not modified. The printer is always connected to the computer as a storage device. The computer can read or tamper with the files in the FLASH memory to perform the selected operation. When the printer is next time When the communication USB is established with the computer, the printer is still recognized as a storage device.
  • Figure ⁇ is a flow chart of a process for communication between a computer and a printer in accordance with an embodiment of the present invention.
  • the program flow of the communication process between the computer and the printer will be described with reference to FIG.
  • the program flow of the communication process between the computer and the printer is interactive.
  • the arrow ' ⁇ in the figure indicates the direction of data exchange between the computer and the printer.
  • the operation of the computer 40 is described. When the printer is a storage device, step S51 to step S59 are performed; when the printer is a printing device, steps S61 to S65 are performed.
  • Step S51 performing Plug and Play (PnP) communication of the USB interface on the computer.
  • PnP Plug and Play
  • Step S53 identifying the printer as a storage device.
  • the printer returns a plurality of descriptors, such as a device descriptor, a configuration descriptor, an interface descriptor, etc., in response to the request of the computer, wherein the USB printer is determined by the bDeviceClass field in the device descriptor.
  • the device type is a storage device.
  • USB driver When the computer is installed with a USB driver, first read the USB driver. If it is an automatic installation, the USB driver is read by the installer running on the computer; if it is manually installed, the operator needs to read the USB driver into the FLASH memory 15 in the printer. Step S57, installing a USB driver. After the computer reads the USB driver, it installs the USB driver. The USB driver can be installed either automatically or manually. Step S59, sending the modified device flag to the printer. The device type of the printer is modified after the computer is installed. If the driver is installed automatically, the device flag of the printer is automatically modified by the automatic installer; if it is manually installed, the device flag of the printer needs to be manually modified. The device flag tampering information sent by the computer to the printer is as indicated by printer flag 102.
  • Step S61 performing Plug and Play (PnP) communication of the USB interface on the computer.
  • the printer initiates PnP communication after detecting that the device flag has been tampered with.
  • the computer determines the insertion and removal of the USB device through a change in the D+ signal of the USB interface. When the computer detects that the USB interface D+ signal changes from the pull-up state to the high-impedance state, it considers that the device with the USB interface has been removed; when the computer detects that the USB interface D+ signal changes from the high-impedance state to the pull-up state, it is considered The USB interface has a new device plug-in, and the computer initiates the USB communication setup process.
  • the device type of the printer is determined to be a printing device by the bDeviceClass field in the device descriptor returned by the printer.
  • Step S63 identifying the printer as a printing device.
  • the computer and the printer establish USB communication, a plurality of descriptors are returned in response to the request of the computer, and the device type of the USB printer is determined to be the printing device by the bDeviceClass field in the returned device descriptor.
  • Step S65 sending print data. After the computer and the printer establish a USB pass, the print data 104 can be sent to the printer for data printing by the printer.
  • the related operations from step S71 to step S87 are performed on the printer 50, and the details are as follows: Step S71, the printer reads the device flag.
  • the device type of the printer is distinguished by the device flag 152 in the FLASH memory 15, assuming that the device flag 152 is "0", indicating that the printer device type is a storage device; when the device flag 152 is "1", the printer device type is a printing device.
  • the default device type is the storage device.
  • the computer can be accessed as a storage device.
  • the USB driver 152 stored in the FLASH memory 15 in the printer is used for driver installation. Step S73, determining the device type of the printer.
  • Step S75 performing plug-and-play (PnP) communication of the USB interface on the printer, and the printer changes from the high-resistance state to the pull-up state by changing the state of the D+ signal of the USB interface, indicating that the printer is connected to the USB interface of the computer.
  • PnP plug-and-play
  • the computer When the computer detects that the USB interface D+ signal state changes from the high-impedance state to the pull-up state, it indicates that a USB device is connected to the computer and starts to establish communication with the USB device, that is, PnP communication. During the communication establishment process, the computer acquires the configuration data 100 of the printer, and determines the device type of the USB printer as the storage device from the bDeviceClass field in the device descriptor of the printer. Step S77, the USB driver is transmitted. When the printer is built as a storage device with the computer
  • the computer can access the USB driver 151 in the printer FLASH memory, and the printer 4 bus USB driver 101 is transmitted to the computer via the USB cable 30.
  • the printer determines whether the printer flag change information is received. If the printer receives the device flag change information 102 sent by the computer, step S81 is performed; otherwise, the printer waits for the device flag change information.
  • the printer modifies the device flag. After receiving the device flag modification information sent by the computer, the printer modifies the device flag of the printer and changes from the storage device to the printing device. The printer's device logo will not be lost after it is turned off. After the printer device logo is modified, it is necessary to automatically establish USB communication with the computer.
  • Step 4 gathers S83 to perform Plug and Play (PnP) communication again between the computer and the printer.
  • the printer side has changed the USB interface signal D+ state (from the pull-up state to the high-impedance state), prompting the computer to be removed from the USB interface as a storage device connected to the computer.
  • the printer changes the D+ state of the USB interface signal (from the high-impedance state to the pull-up state), indicating to the computer that a new USB device is inserted.
  • the computer detects that a new device is plugged in, it initiates the process of establishing USB communication.
  • the computer requests the configuration data of the printer. 103.
  • Step S85 the printer receives the print data. After the printer establishes USB communication with the computer as the printing device type, it receives the print data 104 sent by the computer like a normal printer. In step S87, the printer performs data printing. After receiving the print data, the printer prints the print data on the medium through the printer's printing mechanism.
  • the computer 40 determines the device type of the printer in the process of establishing USB communication with the printer 50, and the device type of the printer is controlled by the device flag in the FLASH memory 15 in the printer.
  • the default device flag for the printer is the storage device, so that when the printer is first connected to the computer, the computer can perform USB driver installation, consult the user manual, and consult the printer configuration by accessing the FLASH memory 15 in the printer as the storage device.
  • the printer's USB driver is installed on the computer, the computer modifies the printer's device logo.
  • the printer detects that the device flag has been modified, it automatically disconnects the USB connection with the computer, and waits for a certain period of time before re-establishing USB communication with the computer.
  • the printer When the printer is connected to the computer again, the printer communicates with the computer as a printing device and can perform print tasks directly.
  • the printer and the driver installation method provided by the present invention can perform the operations of installing the printer driver, consulting the user manual, and consulting the printer configuration without additional setting of the optical disc, which is convenient, simple and more user-friendly.
  • the printer can also set a second storage device (external storage device, or second storage) to store printer drivers and/or product information files to increase storage capacity and improve device usability.
  • a second storage device external storage device, or second storage
  • FIGS. 8 and 9 is a block diagram showing the internal composition of the printer when it has an external memory, and the other parts of the printer of Fig. 8 and Fig. 1 are the same except for the following description. As shown in FIG.
  • the printer 50 further includes an external memory 16, which may be a storage device such as a memory card.
  • the printer may further include an external interface 19 such as a card reader.
  • the external memory acts as an extension of the printer's FLASH storage, and the computer can access it and read its stored files.
  • the first memory 15 may also be disposed inside or outside the printer.
  • an external interface of the printer may be the external interface 19 described above, or may be another external interface separately set
  • the driver can be installed without the need to use an optical drive, and the computer can manage or edit the data in the memory.
  • the first memory 15 and the external memory 16 described above may be set at the same time, or only one may be provided.
  • the external memory may store only the driver or the product information file.
  • the external memory can store more information than the printer device flag. As shown in FIG. 9, the external memory 16 can store not only the USB driver 161 but also the product information file 162 due to the large storage capacity.
  • printer manual 1621 printer programming manual 1622
  • printer maintenance manual 1623 printer LOGO 1624
  • printer applications can also store other files, such as printer applications.
  • steps shown in the flowchart of the accompanying drawings may be performed in a computer system such as a set of computer executable instructions, and, although the logical order is shown in the flowchart, in some cases, The steps shown or described may be performed in an order different than that herein. From the above description, it can be seen that the present invention can realize a driver for conveniently installing a USB device; and can realize management of a storage area in the USB device; and easily switch the type of the printing device.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Accessory Devices And Overall Control Thereof (AREA)

Description

具有 USB接口的打印枳 A其驱动安装方法与系统 技术领域 本发明涉及打印领域, 具体地, 涉及一种具有 USB接口的打印机及其驱 动安装方法与系统。 背景技术 近年来, 使用通用串行总线 (Universal Serial Bus, 简称为 USB ) 与个 人计算机(便于描述, 以下简称计算机或 PC )进行连接的打印设备逐渐成为 主流, 特别是在零售业、 餐饮业得到广泛应用的 POS打印机, 在与 PC进行 通信时, 如果仅使用打印机的一般功能, 如数据打印, 简单的状态监控等, 则不需要安装专门的打印机驱动程序, 只要使用操作系统提供的打印类设备 驱动程序即可; 如果要使用打印机的全部功能, 如当前应用的 POS打印机提 供很多的功能, 比如实时状态查询、 自动状态返回等则需要安装打印机厂家 提供的专用 USB设备驱动程序。 当前常用的打印机驱动程序安装方法是: 使 用携带驱动程序的光盘通过计算机的光驱进行安装。 使用光盘携带打印机驱 动程序, 不仅体积大不便于携带, 同时还增加了打印机的附件成本。 相关技术中提出了一种方法, 在 USB设备中增加 USB-HUB ( USB集线 器), 在 USB设备连接到打印机上时, 该 USB设备被识别为 2个设备: USB 存储器和打印设备, USB存储器和打印设备是 2个独立存在的设备; 在 USB 存储器中存储打印设备的驱动程序,通过访问 USB存储设备中的驱动程序进 行打印设备的 USB驱动安装, 在设备安装后, 再使用打印设备。 虽然该方案 能够避免用户携带光盘、 实现设备本身存储其 USB驱动程序,但在打印设备 内增加了 USB集线器和独立于打印设备的 USB存储器, 不仅增加了打印设 备的成本,且打印设备不能对 USB存储设备的存储区域进行管理,造成 USB 存储器空闲存储区的浪费。 针对相关技术中安装 USB设备的驱动程序不够方便的问题,目前尚未提 出有效的解决方案。 发明内容 针对安装 USB设备的驱动程序不够方便的问题而提出本发明, 为此, 本 发明的主要目的在于提供一种具有 USB接口的打印机及其驱动安装方法与 系统, 以解决上述问题。 为了实现上述目的,根据本发明的一个方面, 提供了一种具有 USB接口 的打印机。 根据本发明的具有 USB接口的打印机包括: USB接口以及打印机构, 还包括: 控制器; 第一存储器, 与控制器相连接, 存储有打印机的驱动程序; 其中, 第一存储器还存储有设备标志, 其中, 设备标志的类型包括存储设备 标志和打印设备标志。 进一步地, 上述打印机还包括: 输入机构, 与控制器相连接, 用于接收 用户输入的信号以使控制器修改第一存储器的设备标志的类型。 该输入机构 可以为手动输入机构, 如按键机构, 还可以为专用应用程序输入机构等外部 机构。 进一步地, 上述第一存储器的默认设备标志的类型为存储设备标志。 进一步地, 上述打印机经由 USB接口连接至计算机, 其中, 在计算机安 装驱动程序之后, 打印机修改设备标志的类型为打印设备标志。 进一步地, 上述第一存储器设置于所述打印机的内部或者外部, 在设置 于所述打印机的外部的情况下,通过打印机的外部接口与所述打印机相连接。 进一步地,上述第一存储器还存储有所述打印机的产品信息文件,或者, 所述打印机还包括: 第二存储器, 通过打印机的外部接口与打印机相连接, 存储有打印机的产品信息文件和 /或驱动程序。 为了实现上述目的,根据本发明的另一方面, 提供了一种具有 USB接口 的打印机的驱动安装方法。 根据本发明的具有 USB接口的打印机的驱动安装方法包括:在打印机连 接到计算机上时, 打印机被识别为存储设备或打印设备, 其中, 打印机内存 储有设备标志, 其中, 设备标志的类型包括存储设备标志和打印设备标志; 在打印机被识别为存储设备的情况下, 计算机对打印机中存储的驱动程序进 行安装。 进一步地, 通过用户输入的信号对打印机的设备类型进行修改, 其中, 设备类型包括存储设备或打印设备。 进一步地, 在打印机第一次与所述计算机连接时, 打印机的设备类型为 存储设备, 在计算机安装驱动程序之后, 上述方法还包括: 计算机 4爹改打印 机的设备类型为打印设备。 进一步地, 在打印机连接到计算机上时, 上述方法还包括: 在所述打印 机被识别为存储设备的情况下, 计算机判断是否安装打印机中的驱动程序; 在判断结果为是的情况下, 计算机安装驱动程序并将打印机的设备类型修改 为打印设备; 在判断结果为否的情况下, 计算机不修改打印机的设备类型, 且打印机与计算机建立通信以执行预定的操作。 进一步地, 上述方法还包括: 打印机接收用户输入的控制信号; 打印机 通过控制信号来更改设备类型。 为了实现上述目的,根据本发明的另一方面, 提供了一种具有 USB接口 的打印机的驱动安装系统。 根据本发明的具有 USB接口的打印机的驱动安装系统:计算机;打印机, 通过 USB接口与计算机相连接, 其中, 计算机识别打印机为存储设备或打印 设备, 在识别打印机为存储设备的情况下, 安装打印机中存储的驱动程序。 本发明通过釆用具有以下结构的具有 USB接口的打印机: 控制器; 第一 存储器, 与控制器相连接, 存储有打印机的驱动程序; 其中, 第一存储器还 存储有设备标志,其中,设备标志的类型包括存储设备标志和打印设备标志, 由于第一存储器内存储有两种设备类型标志, 因而, 在打印机连接到计算机 上时, 打印机被识别为存储设备或打印设备, 其中, 在打印机被识别为存储 设备时, 计算机可以对打印机中存储的驱动程序进行安装, 因而, 本发明解 决了安装 USB设备的驱动程序不够方便的问题,进而达到了方便地安装 USB 设备的驱动程序的效果。 附图说明 此处所说明的附图用来提供对本发明的进一步理解, 构成本申请的一部 分, 本发明的示意性实施例及其说明用于解释本发明, 并不构成对本发明的 不当限定。 在附图中: 图 1是根据本发明实施例的打印机实施例一的内部组成框图; 图 2是根据本发明实施例的打印机中 FLASH存储器存储区分配示意图; 图 3是根据本发明实施例的打印机中 FLASH存储器存储区分配另一示 意图; 图 4是根据本发明实施例的具有 USB接口的打印机的驱动安装方法的流 程图; 图 5是根据本发明实施例的计算机与打印机通信的第一实施例的流程 图; 图 6是根据本发明实施例的计算机与打印机通信的第二实施例流程图; 图 7是根据本发明实施例的计算机与打印机之间通信过程的程序流程 图; 图 8是根据本发明实施例的打印机实施例二内部组成框图; 以及 图 9是根据本发明实施例的打印机外部存储器存储区分配示意图。 具体实施方式 需要说明的是, 在不冲突的情况下, 本申请中的实施例及实施例中的特 征可以相互组合。 下面将参考附图并结合实施例来详细说明本发明。 图 1是根据本发明实施例的打印机实施例一的内部组成框图。 如图 1所示, 根据本发明实施例的具有 USB接口的打印机包括 USB接 口 18以及打印机构 12 , 还包括: 控制器 13; 第一存储器(例如, FLASH存 储器) 15 , 与控制器 13相连接, 存储有打印机的驱动程序; 其中, 第一存 储器 15还存储有设备标志, 其中, 设备标志的类型包括存储设备标志和打 印设备标志。 在该实施例中, 存储设备标志和打印设备标志之一被标识为启用状态, 其中, 在存储设备标志被标识为启用状态时, 打印机被识别为存储设备, 此 时, 计算机可以对存储设备中存储的驱动程序进行安装, 在打印设备标志被 标识为启用状态的情况下, 该打印机被标识为打印设备状态, 此时, 可以使 打印机执行打印操作等。 通过该实施例, 能够实现打印机驱动程序的方便安 装。 如图所示, 打印机 50通过 USB通信电缆 30与计算机 40进行通信, 共 同组成打印系统 1。 如图所示, 打印机包括控制器 13 , 输入机构 (包括按键 机构或触摸屏机构等, 以下以按键机构为例) 11 , 打印机构 12 , RAM存储 器 14 , FLASH存储器 15 , 和 USB控制器 17。 其中, 输入机构 11用于对打 印机进行各种配置、 测试等操作, 如修改打印机的设备标志 (或者称作设备 标识)、 打印头测试样张打印等; 打印机构 12包括: 图中未示出的打印头、 打印头驱动电路、 介质传送机构等, 通过打印头控制电路控制打印头在介质 上打印, 通过介质传送机构进行介质传送; RAM存储器 14暂存由计算机发 送的打印数据、 打印机的状态数据等; FLASH存储器 15不仅存储打印机的 控制程序及字库、 代码页 (code page ) 等信息, 还存储打印机的 USB驱动 程序、 打印机的设备标志, 及打印机自身的产品信息文件等其它文件; USB 控制器控制打印机与计算机之间的通信, 包括 USB通信的建立、打印机的设 备配置、 各种数据的传输等; 控制器 13对打印机的其他部分进行控制, 共 同完成打印机的 USB通信的建立及数据传输、 数据打印、 介质传送等。 图 2为打印机 FLASH存储器的存储区分配示意图, 如图所示, FLASH 存储器 15中存储 USB驱动程序 151及打印机的设备标志 152 , 其中, USB 驱动程序是该打印机的打印设备驱动程序, 在打印机作为存储设备与计算机 连接 (也即, 打印机被计算机识别为存储设备) 时, 计算机可以读取并安装 USB驱动程序; 打印机的设备标志表示打印机在和计算机之间建立 USB通 信时, 打印机的设备类型, 即打印机是作为存储设备或者是打印设备与计算 机之间建立通信。 优选地, 打印机默认的设备类型为存储设备, 只有打印机 的 USB驱动程序在计算机上安装后, 由计算机进行设备类型的爹改, 4巴设备 类型从存储设备更改为打印机设备, 从而在初次使用打印设备的时候, 可以 方便地进行驱动程序的安装并且在安装驱动程序之后可以使得打印机作为打 印设备与计算机进行通信 (也即, 打印机被计算机识别为打印设备) 以执行 打印操作; 另外, 也可以通过按键机构进行打印机的设备类型修改 (即, 对 打印机中设备标志的启用状态进行修改),从而可以方便用户直接对打印机的 设备类型进行修改。 上述的输入机构还可以为专用应用程序输入机构。 利用专用应用程序输 入机构可以通过在计算机安装的专用应用程序修改打印机的设备类型,比如, 当打印机为打印设备时, 应用程序通过计算机向打印机发送控制指令修改打 印机设备标志; 当打印机为存储设备时, 应用程序通过计算机修改存储设备 中设备标志文件内容修改打印机的设备类型。 优选地, 专用应用程序存储在 FLASH存储器 15中。 图 3是根据本发明实施例的打印机中 FLASH存储器存储区分配另一示 意图。 如图 3所示, FLASH存储器中除了存储有 USB驱动程序 151及打印机 的设备标志 152外, 还可以存储有产品的相关信息文件 153 , 如打印机说明 书 1531、 打印机编程手册 1532、 打印机维护手册 1533以及打印机的 LOGO 1534等。 图 4是根据本发明实施例的具有 USB接口的打印机的驱动安装方法的流 程图。 如图 4所示, 该方法包括以下步 4聚: 步骤 S402, 在打印机连接到计算机上时, 打印机被识别为存储设备或打 印设备, 其中, 打印机内存储有设备标志, 其中, 设备标志的类型包括存储 设备标志和打印设备标志, 在存储设备标志被标识为启用状态时, 打印机被 识别为存储设备, 在打印设备标志被标识为启用状态时, 打印机被标识为打 印设备; 其中, 在打印机被识别为打印设备的情况下, 计算机能够与打印设 备进行通信以执行打印操作, 在打印机被识别为存储设备的情况下, 计算机 能够读取该存储设备中存储的数据并且能够对存储设备中的数据进行管理。 步骤 S404, 在打印机被识别为存储设备的情况下, 计算机对打印机中存 储的驱动程序进行安装。 通过上述实施例, 可以使得打印机被计算机识别的设备类型在存储设备 和打印设备之间进行切换,从而能够方便地安装 USB设备的驱动程序, 无需 用户携带光盘进行安装,并且还可以对打印机的存储设备中的数据进行管理。 图 5是根据本发明实施例的计算机与打印机通信的第一实施例的流程 图。 下面通过图 5对 USB驱动程序的安装过程进行说明。 步骤 S 11 , 打印机读取设备标志。 打印机开机后, 在和计算机之间建立 USB通信之前,要首先确定打印机 的设备类型。 打印机的设备类型共 2类, 分别是打印设备和存储设备, 打印 机的设备类型是通过 FLASH存储器 15中的设备标志 152区分的, 假设设备 标志 152为" 0"时表示打印机设备类型为存储设备; 设备标志 152为" 1"时表 示打印机设备类型为打印设备。 打印机每次和计算机之间建立 USB通信时, 只能选择一种设备类型, 或者是打印设备, 或者是存储设备。 步骤 S 13 , 对打印机的设备类型进行判断。 打印机读取设备标志 152后, 当读取到信息为" 0"时, 表示打印机设备类 型为存储设备; 当读取到信息为" 1"时, 表示打印机设备类型为打印设备。 如 果打印机是打印设备, 则转到步骤 S 19继续处理; 如果不是打印设备, 而是 存储设备时, 则转到步骤 S 15进行处理。 步骤 S 15 , 打印机作为存储设备与计算机之间建立 USB通信。 在计算机和打印机之间建立 USB通信时, 通过由打印机响应计算机的
GET DESCRIPTOR ( device )请求而返回的设备描述符中的 bDeviceClass字 段确定该 USB打印机为存储设备, bDeviceClass字段的内容由打印机的设备 标志 152决定。 当计算机确定该打印机为存储类设备时, 直接使用计算机中 提供的存储类 USB驱动程序就可以访问打印机中 FLASH存储器中的文件, 而不需要在计算机上安装专门的 USB存储类设备驱动程序。 步骤 S 17, 在计算机上安装 USB驱动程序并修改打印机的设备标志。 如果 USB驱动程序自动安装, 则计算机显示器上会自动弹出 USB驱动 程序安装界面, 根据安装界面的提示进行自动安装, 安装结束后, 安装程序 会自动对打印机的设备类型进行修改, 不需要人工修改该设备标志。 如果不想在计算机上进行 USB驱动程序的安装,或者计算机操作系统不 允许 USB驱动程序的自动安装, 则可以通过读取打印机 FLASH存储器 15 中存储的 USB驱动程序 151而进行驱动程序安装, 在 USB驱动程序安装后 要修改 FLASH存储器 15中存储的设备标志 152。 只有对打印机设备标志修 改后, 打印机才确认 USB驱动程序已经在计算机上安装。 如果 USB驱动程 序在计算机安装结束而没有修改打印机的设备类型, 可以进行人工修改, 如 通过按键机构 11对打印机的配置菜单进行选择或按键输入对设备类型进行 修改, 打印机如果有显示机构, 如 LCD显示器等 (图 1中未示出), 则可以 通过显示机构显示菜单; 打印机也可以通过 配置菜单打印在介质上来进行 配置。 步骤 S 19, 打印机作为打印设备与计算机建立 USB通信。 当打印机通过检测设备标志确认打印机为打印设备后,则进行以下操作:
1 )打印机立即复位 USB接口, 即通过给 USB接口 18的 D+信号从上拉状态 改为高阻状态, 当计算机检测到 D+信号的变化后, 确认被识别为存储装置 的打印机已经断开与计算机的连接; 2 ) 打印机等待一定时间; 3 ) 打印机设 置 D+信号, 把 USB接口的 D+信号从高阻状态改为上拉状态, 当计算机检 测到 D+信号从高阻状态变为上拉状态后, 认为有新的 USB设备连接到 USB 接口, 然后, 计算机启动与打印机之间的 USB通信建立过程, 在通信建立过 程中, 通过由打印机响应计算机的 GET_DESCRIPTOR ( device )请求而返回 的设备描述符中的 bDeviceClass字段确定该 USB打印机为打印设备, bDeviceClass字段的内容由打印机的设备标志 152决定, 而打印机的设备标 志 152在计算机上安装了 USB驱动程序后已从存储设备改为打印设备。计算 机与打印机建立 USB通信后, 就可以进行与打印相关的操作, 如发送打印数 据、 查询打印机的状态等。 当打印机开机后, 其设备标志为打印设备, 则在打印机通过 USB接口 18与计算机连接时, 直接进行上述操作 3 ), 建立与计算机之间的 USB通信。 步骤 S21 , 计算机与打印机通信, 打印机执行打印任务。 打印机作为打印设备与计算机建立 USB通信后计算机就可以调用安装 的 USB驱动程序向打印机发送数据, 打印机接收打印数据, 执行打印任务。 图 6是根据本发明实施例的计算机与打印机通信的第二实施例流程图。 图 3是打印机中 FLASH存储器存储区分配另一示意图。下面结合图 3和图 6, 说明本发明计算机与打印机通信的另一种实施方案。 如图 3所示, 打印机中 的 FLASH存储器除了存储 USB驱动程序和打印机设备标志之外, 还存储 打印机的产品信息 153等其它文件。 其中, 打印机的产品信息 153包括: 打 印机说明书 1531 ,打印机编程手册 1532 ,打印机维护手册 1533 ,打印机 LOGO 信息 1534等。 存储文件的多少由打印机 FLASH存储器的存储容量的大小决 定, 只要 FLASH存储器的存储容量比较大, 就可以存储更多的文件。 在这 种情况下,计算机与打印机通信过程如图 6所示, 除了增加步骤 S 161、 S 162、 S 163外, 图 6和图 5的安装过程相同。 步骤 S 161 , 计算机读取打印机 FLASH存储器中的文件。 计算机通过读取打印机 FLASH存储器中包括 USB驱动程序在内的所有 可访问文件, 如查阅打印机的产品信息等。 通过 FLASH存储器存储各种文 件不仅可以节省打印机驱动程序的光盘, 还可以节省打印机存储产品信息文 件的光盘。 优选的实施方式是, 在 FLASH存储器中设置自动运行程序, 当 打印机作为存储设备与计算机之间建立 USB通信后, 在计算机自动运行界 面, 界面显示安装驱动程序、 查阅用户手册、 查阅打印机配置等选项, 供操 作者选择。 步骤 S 162, 判断是否进行驱动程序安装。 当打印机作为存储设备与计算机建立 USB通信后,要确定是否在计算机 上进行 USB驱动程序安装。 如果进行驱动程序安装, 则转到步骤 S 17进行 处理; 如果不进行驱动程序安装, 则由步 4聚 S 163进行处理。 步 4聚 S 163 , 执行选定操作。 如果计算机不进行 USB驱动程序安装, 则打印机的设备标志不被修改, 打印机作为存储设备一直和计算机连接, 计算机可以读取或者 4爹改 FLASH 存储器中的文件,执行选定操作;当打印机下一次和计算机建立通信 USB时, 打印机仍被识别为存储设备。 图 Ί是根据本发明实施例的计算机与打印机之间通信过程的程序流程 图。 下面通过图 7对计算机与打印机之间进行通信过程的程序流程进行说 明。 如图 7所示, 计算机与打印机之间通信过程的程序流程是交互进行的, 图中的箭头'〈^ ^,表示计算机和打印机之间交互数据的方向, 首先描述计 算机 40的操作。 当打印机为存储设备时, 执行步骤 S51至步骤 S59; 当打印机为打印设 备时, 执行步骤 S61至 S65。 由于计算机不能决定从 USB接口接入的打印机 是存储设备和打印设备, 因此计算机也不能直接决定是从 S51开始执行相关 操作还是从 S61开始, 只能根据 PnP通信时, 接入打印机的设备类型来进行 选择。 步骤 S 51 , 在计算机上执行 USB接口的即插即用 (简称 PnP ) 通信。 当打印机通过 USB接口 18与计算机连接时, 把接口的 D+信号从高阻 状态变为上拉状态, 当计算机检测到 USB接口的 D+信号从高阻状态变为上 拉状态, 表示有 USB设备连接到计算机; 然后, 计算机与打印机之间建立 USB通信, 发送包括 GET DESCRIPTOR ( device ) 请求在内的多个请求, 通过打印机返回的设备描述符中的 bDeviceClass字段确定该 USB打印机的设 备类型。 步骤 S53 , 识别打印机为存储设备。 计算机和打印机建立 USB通信时, 打印机为响应计算机的请求而返回通过多个描述符, 如设备描述符、 配置描 述符、 接口描述符等, 其中, 通过设备描述符中的 bDeviceClass字段确定该 USB打印机的设备类型为存储设备。 步骤 S55 , 读取 USB驱动程序。 当计算机安装 USB驱动程序时, 要首 先读取 USB驱动程序。 如果是自动安装, 则由计算机上运行的安装程序来读 取 USB驱动程序; 如果是手动安装, 操作者则需要到打印机中 FLASH存储 器 15读取 USB驱动程序。 步骤 S57, 安装 USB驱动程序。 计算机在读取 USB驱动程序后, 进行 USB驱动程序的安装。 USB驱动程序的安装, 可以自动安装, 也可以手动安 装。 步骤 S59, 向打印机发送修改后的设备标志。 计算机安装完驱动程序安 装后要修改打印机的设备类型。 如果驱动程序是自动安装的, 则由自动安装 程序自动对打印机的设备标志进行修改; 如果是手动安装的, 则需要人工修 改打印机的设备标志。 计算机向打印机发送的设备标志爹改信息如打印机标 志 102所示。 步骤 S61 , 在计算机上执行 USB接口的即插即用 ( PnP ) 通信。 打印机在检测到设备标志爹改后, 发起 PnP通信。 计算机通过 USB接 口 D+信号的变化确定 USB设备的插入和移走。 当计算机检测到 USB接口 D+信号从上拉状态变为高阻状态时, 认为与该 USB接口的设备已经移走; 当计算机检测到 USB接口 D+信号从高阻状态变为上拉状态时, 认为该 USB 接口有新的设备插入, 计算机发起 USB通信的建立过程。 通过打印机返回的 设备描述符中的 bDeviceClass字段确定该打印机的设备类型为打印设备。 步骤 S63 , 识别打印机为打印设备。 计算机和打印机建立 USB通信时,为响应计算机的请求而返回多个描述 符,通过返回的设备描述符中的 bDeviceClass字段确定该 USB打印机的设备 类型为打印设备。 步骤 S65 , 发送打印数据。 计算机与打印机建立 USB通行后, 就可以向 打印机发送打印数据 104 , 由打印机进行数据打印。 同时, 在打印机 50上进行从步骤 S71到步骤 S87的相关操作, 具体描 述如下: 步骤 S71 , 打印机读设备标志。 在打印机与计算机建立 USB通信之前, 要首先确定打印机的设备类型。 打印机的设备类型是通过 FLASH存储器 15中的设备标志 152区分的, 假设 设备标志 152为" 0"时表示打印机设备类型为存储设备; 设备标志 152为" 1" 时表示打印机设备类型为打印设备。 打印机出厂时默认的设备类型为存储设 备, 便于打印机首次与计算机连接时, 计算机可以通过访问作为存储设备的 打印机中的 FLASH存储器 15上存储的 USB驱动程序 152来进行驱动程序 安装。 步骤 S73 , 判断打印机的设备类型。 打印机读取设备标志 152后, 当读取到信息为" 0"时, 表示打印机设备类 型为存储设备; 当读取到信息为" 1"时, 表示打印机设备类型为打印设备。 如 果打印机的设备类型为存储设备, 则由步骤 S73进行下一步处理; 如果打印 机的设备类型为打印设备, 则转到步骤 S83进行处理。 步骤 S75 , 在打印机上执行 USB接口的即插即用 (PnP ) 通信, 打印机 通过改变 USB接口 D+信号的状态从高阻状态变为上拉状态, 表示打印机已 经连接到计算机的 USB接口。当计算机检测到 USB接口 D+信号状态从高阻 状态变为上拉状态时, 表示有 USB设备连接到计算机, 开始与 USB设备建 立通信,即 PnP通信。在通信建立过程中,计算机获取打印机的配置数据 100, 从打印机的设备描述符中的 bDeviceClass字段确定该 USB打印机的设备类型 为存储设备。 步骤 S77, 传送 USB驱动程序。 当打印机作为存储设备与计算机建立
USB通信后, 计算机就可以访问打印机 FLASH存储器中的 USB驱动程序 151 , 打印机 4巴 USB驱动程序 101通过 USB电缆 30传送给计算机。 步骤 S79, 打印机确定是否接收到打印机标志更改信息。 如果打印机接 收到计算机发送的设备标志更改信息 102 , 则执行步骤 S81 ; 否则, 打印机 一直等待设备标志更改信息。 步骤 S81 , 打印机修改设备标志。 打印机在接收到计算机发送的设备标 志修改信息后, 修改打印机的设备标志, 从存储设备变为打印设备。 打印机 的设备标志在关机后不会丢失。 打印机设备标志修改后, 要自动与计算机重 新建立 USB通信。 步 4聚 S83 , 在计算机和打印机之间再次执行即插即用( PnP )通信。 首先, 打印机端通过改变 USB接口信号 D+状态(从上拉状态变为高阻状态),提示 计算机作为存储设备与计算机连接的打印机已经从 USB接口移走。在等待一 定时间后,打印机再改变 USB接口信号 D+状态(从高阻状态变为上拉状态), 向计算机表示有新的 USB设备插入。 计算机在检测到有新设备插入时, 启动 USB通信的建立过程。 在通信建立过程中, 计算机请求打印机的配置数据 103 , 通过配置信息中的设备描述符中的 bDeviceClass字段确定该打印机为 打印设备。 打印机和计算机建立通信后就可以接收打印数据并进行打印。 步骤 S85 , 打印机接收打印数据。 打印机作为打印设备类型与计算机建 立 USB通信后, 和普通打印机一样接收计算机发送的打印数据 104。 步骤 S87, 打印机进行数据打印。 打印机在接收到打印数据后, 通过打 印机的打印机构把打印数据打印在介质上。 如上所述,计算机 40是在和打印机 50建立 USB通信的过程确定打印机 的设备类型, 而打印机的设备类型是由打印机中 FLASH存储器 15中的设备 标志来控制。 打印机出厂的默认设备标志为存储设备, 这样, 当打印机首次 与计算机连接时, 计算机可以通过访问作为存储设备的打印机中的 FLASH 存储器 15进行 USB驱动程序安装、 查阅用户手册、查阅打印机配置等操作。 当在计算机上安装打印机的 USB驱动程序后,计算机就对打印机的设备标志 进行修改。 而当打印机检测到设备标志修改后, 自动断开与计算机的 USB连 接, 等待一定时间后再与计算机重新建立 USB通信。 当打印机再次与该计算 机连接时, 打印机作为打印设备与计算机通讯, 可以直接执行打印任务。 因 此, 本发明提供的打印机及驱动程序安装方法, 不需要额外设置光盘, 就可 以进行打印机驱动程序安装、 查阅用户手册、 查阅打印机配置等操作, 方便 简单, 更具有人性化。 打印机还可以设置第二存储设备(外部存储设备, 或者第二存储器) 存 储打印机驱动程序和 /或产品信息文件, 以扩大存储容量, 提高设备易用性。 下面以图 8、 图 9共同说明打印机携带外部存储器时的设备组成及外部存储 器存储区域分配。 图 8是打印机具有外部存储器时的内部组成框图, 除了以下描述之外, 图 8和图 1的打印机组成的其他部分相同。 如图 8所示, 打印机 50还包括外部存储器 16 , 外部存储器可以是存储 卡等存储设备, 当打印机的外部存储器为存储卡等, 打印机还可以包括外部 接口 19 , 例如读卡器。 在打印机作为打印设备与计算机建立 USB通信后, 外部存储器作为打印机 FLASH存储的扩展部分, 计算机能够对其进行访问, 读取其存储的文件。 其中, 第一存储器 15也可以设置于所述打印机的内部或者外部, 如果 设置于打印机的外部, 可以通过打印机的外部接口 (可以为上述的外部接口 19 , 也可以为单独设置的其他外部接口) 与打印机相连接, 无论在设置于打 印机的内部或者外部, 在安装驱动程序时都可以使得计算机无需使用光驱, 而且便于计算机对存储器内的数据进行管理或编辑。 上述的第一存储器 15和外部存储器 16可以同时设置, 也可以仅设置一 个, 在同时设置的情况下, 外部存储器可以仅仅存储驱动程序或者产品信息 文件。 外部存储器作为打印机 FLASH存储器的扩展部分, 可以存储除打印机 设备标志之外更多的信息, 如图 9所示, 外部存储器 16因存储容量大, 不 仅可以存储 USB驱动程序 161 , 产品信息文件 162 , 如打印机说明书 1621 , 打印机编程手册 1622 , 打印机维护手册 1623 , 打印机 LOGO 1624等, 还可 以存储其它文件, 如打印机的应用程序等。 需要说明的是, 在附图的流程图示出的步骤可以在诸如一组计算机可执 行指令的计算机系统中执行, 并且, 虽然在流程图中示出了逻辑顺序, 但是 在某些情况下, 可以以不同于此处的顺序执行所示出或描述的步骤。 从以上的描述中, 可以看出, 本发明能够实现方便地安装 USB设备的驱 动程序; 并能够实现对 USB设备内存储区域进行管理; 以及简便地切换打印 设备的类型。 以上所述仅为本发明的优选实施例而已, 并不用于限制本发明, 对于本 领域的技术人员来说, 本发明可以有各种更改和变化。 凡在本发明的^"神和 原则之内, 所作的任何修改、 等同替换、 改进等, 均应包含在本发明的保护 范围之内。

Claims

权 利 要 求 书
1. 一种具有 USB接口的打印机,包括 USB接口( 18)以及打印机构( 12), 其特征在于, 还包括:
控制器 ( 13); 以及
第一存储器 ( 15 ), 与所述控制器( 13 )相连接, 存储有所述打印 机的驱动程序; 其中, 所述第一存储器 ( 15) 还存储有设备标志, 其中, 所述设 备标志的类型包括存储设备标志和打印设备标志。
2. 根据权利要求 1所述的打印机, 其特征在于, 还包括: 输入机构( 11 ), 与所述控制器 ( 13) 相连接, 用于接收用户输入的信号以使所述控制 器 ( 13 ) 修改所述第一存储器 ( 15 ) 的设备标志的类型。
3. 根据权利要求 1所述的打印机, 其特征在于, 所述第一存储器 ( 15) 的默认设备标志的类型为存储设备标志。
4. 根据权利要求 3所述的打印机,其特征在于,所述打印机经由所述 USB 接口 ( 18) 连接至计算机(40), 其中, 在所述计算机(40)安装所述 驱动程序之后修改所述设备标志的类型为打印设备标志。
5. 根据权利要求 1至 4中任一项所述的打印机, 其特征在于, 所述第一 存储器 ( 15)设置于所述打印机的内部或者外部, 在设置于所述打印 机的外部的情况下,通过所述打印机的外部接口与所述打印机相连接。
6. 根据权利要求 1至 4中任一项所述的打印机, 其特征在于, 所述第一 存储器 ( 15) 还存储有所述打印机的产品信息文件, 或者, 所述打印 机还包括: 第二存储器( 16), 通过所述打印机的外部接口与所述打印 机相连接, 存储有所述打印机的产品信息文件和 /或所述驱动程序。
7. —种具有 USB接口的打印机的驱动安装方法, 其特征在于, 包括: 在打印机连接到计算机上时, 所述打印机被识别为存储设备或打 印设备, 其中, 所述打印机内存储有设备标志, 其中, 所述设备标志 的类型包括存储设备标志和打印设备标志; 以及 在所述打印机被识别为存储设备的情况下, 所述计算机对所述打 印机中存储的驱动程序进行安装。
8. 根据权利要求 7所述的方法, 其特征在于, 通过用户输入的信号对所 述打印机的设备类型进行修改。
9. 根据权利要求 7所述的方法, 其特征在于, 在所述打印机第一次与所 述计算机连接时, 所述打印机的设备类型为存储设备, 在所述计算机 安装所述驱动程序之后, 所述方法还包括: 所述计算机 4爹改所述打印 机的设备类型为打印设备。
10. 根据权利要求 7所述的方法, 其特征在于, 在打印机连接到计算机上 时, 所述方法还包括:
在所述打印机被识别为存储设备的情况下, 所述计算机判断是否 安装所述打印机中的驱动程序;
在判断结果为是的情况下, 所述计算机安装所述驱动程序并将所 述打印机的设备类型修改为打印设备; 以及
在判断结果为否的情况下, 所述计算机不 4爹改所述打印机的设备 类型, 且所述打印机与所述计算机建立通信以执行预定的操作。
11. 根据权利要求 7至 10中任一项所述的方法, 其特征在于, 所述方法还 包括:
所述打印机接收用户输入的控制信号; 以及
所述打印机通过所述控制信号来更改设备类型。
12. 一种具有 USB接口的打印机的驱动安装系统, 其特征在于, 包括: 计算机; 以及
打印机, 通过 USB接口与所述计算机相连接,
其中, 所述计算机识别所述打印机为存储设备或打印设备, 在识 别所述打印机为存储设备的情况下, 安装所述打印机中存储的驱动程 序。
PCT/CN2011/071813 2010-04-01 2011-03-15 具有usb接口的打印机及其驱动安装方法与系统 WO2011120380A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP11761954.4A EP2551775A4 (en) 2010-04-01 2011-03-15 PRINTER HAVING A UNIVERSAL SERIAL BUS INTERFACE, METHOD AND SYSTEM FOR INSTALLING A PRINTER DRIVER
US13/638,601 US20130038888A1 (en) 2010-04-01 2011-03-15 Printer With USB Interface and Driver Installing Method and System Thereof

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201010137547.8A CN102214148B (zh) 2010-04-01 2010-04-01 具有usb接口的打印机及其驱动安装方法与系统
CN201010137547.8 2010-04-01

Publications (1)

Publication Number Publication Date
WO2011120380A1 true WO2011120380A1 (zh) 2011-10-06

Family

ID=44711355

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2011/071813 WO2011120380A1 (zh) 2010-04-01 2011-03-15 具有usb接口的打印机及其驱动安装方法与系统

Country Status (4)

Country Link
US (1) US20130038888A1 (zh)
EP (1) EP2551775A4 (zh)
CN (1) CN102214148B (zh)
WO (1) WO2011120380A1 (zh)

Families Citing this family (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102591689B (zh) * 2011-12-30 2016-08-03 深圳市理邦精密仪器股份有限公司 一种usb打印机驱动加载方法及系统
JP6161314B2 (ja) * 2013-02-18 2017-07-12 キヤノン株式会社 画像形成装置、制御方法およびコンピュータプログラム
JP6167711B2 (ja) * 2013-07-12 2017-07-26 ブラザー工業株式会社 印刷処理プログラム
CN103434280A (zh) * 2013-08-19 2013-12-11 倪俊 一种具有新型存储方法的3d打印机
CN105095118B (zh) * 2014-05-19 2019-08-30 小米科技有限责任公司 设备的使用方法及装置
CN107111807B8 (zh) * 2014-10-03 2022-10-11 艾利丹尼森零售信息服务公司 可定制的食品新鲜度打印机启动向导
CN107643999A (zh) * 2017-09-14 2018-01-30 航天信息股份有限公司 一种内置读写模块的通讯方法
CN109101250A (zh) * 2018-08-31 2018-12-28 深圳丰速科技有限公司 打印机驱动安装方法、装置、计算机设备及存储介质
CN109445723B (zh) * 2018-10-11 2022-07-22 珠海奔图电子有限公司 驱动安装方法与图像形成装置
CN110162278B (zh) * 2019-05-16 2023-02-10 口碑(上海)信息技术有限公司 Pos机内置打印机的添加方法及装置
CN111949227A (zh) * 2020-06-29 2020-11-17 厦门汉印电子技术有限公司 一种打印机的驱动配置方法、装置、打印机及存储介质
CN112698795A (zh) * 2020-12-25 2021-04-23 德佟电子科技(江苏)有限公司 一种usb打印设备中使用hid设备实现打印免驱动的方法

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1588312A (zh) * 2004-08-31 2005-03-02 北京智凯办公自动化设备有限公司 打印机程序及参数设置的远程更新方法及系统
US20080239378A1 (en) * 2007-03-28 2008-10-02 Brother Kogyo Kabushiki Kaisha Multifunction Peripheral Having A Plurality Of Functions
CN101362401A (zh) * 2007-08-09 2009-02-11 珠海天威技术开发有限公司 墨盒芯片及可变信息的读写方法
CN101387991A (zh) * 2007-09-12 2009-03-18 李千龙 实现usb设备自携带驱动程序的方法
CN101570088A (zh) * 2008-04-30 2009-11-04 兄弟工业株式会社 打印机、终端和打印系统

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6754725B1 (en) * 2001-05-07 2004-06-22 Cypress Semiconductor Corp. USB peripheral containing its own device driver
AU2002355800A1 (en) * 2001-07-31 2003-02-17 Silicom Ltd. Device-related software installation
JP2003271340A (ja) * 2002-03-15 2003-09-26 Seiko Epson Corp 印刷システム、プリンタ及びインクカートリッジ
EP1784702A4 (en) * 2004-08-12 2008-07-02 Trek 2000 Int Ltd METHOD AND SYSTEM FOR AUTOMATICALLY INSTALLING A PILOT OF FUNCTIONAL UNIT ON A HOST COMPUTER

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1588312A (zh) * 2004-08-31 2005-03-02 北京智凯办公自动化设备有限公司 打印机程序及参数设置的远程更新方法及系统
US20080239378A1 (en) * 2007-03-28 2008-10-02 Brother Kogyo Kabushiki Kaisha Multifunction Peripheral Having A Plurality Of Functions
CN101362401A (zh) * 2007-08-09 2009-02-11 珠海天威技术开发有限公司 墨盒芯片及可变信息的读写方法
CN101387991A (zh) * 2007-09-12 2009-03-18 李千龙 实现usb设备自携带驱动程序的方法
CN101570088A (zh) * 2008-04-30 2009-11-04 兄弟工业株式会社 打印机、终端和打印系统

Also Published As

Publication number Publication date
CN102214148B (zh) 2014-04-02
CN102214148A (zh) 2011-10-12
EP2551775A4 (en) 2013-09-04
EP2551775A1 (en) 2013-01-30
US20130038888A1 (en) 2013-02-14

Similar Documents

Publication Publication Date Title
WO2011120380A1 (zh) 具有usb接口的打印机及其驱动安装方法与系统
US7068386B2 (en) Image processing system, image data processing method, and storage medium
US8451484B2 (en) Information processing apparatus, printing apparatus, electronic device, and computer program therefor based on existence of printer configuration file
US8037225B2 (en) Communication system with host and device role switching features
US20080162955A1 (en) Usb host, usb device, and methods of controlling the host and the device
JPWO2005001701A1 (ja) スレイブ装置、通信設定方法
US20040148451A1 (en) USB controlling apparatus for data transfer between computers and method for the same
WO2005086002A1 (fr) Procede s'appliquant a un dispositif de traitement de donnees echangeant des donnees avec un ordinateur
JP2001256170A (ja) 周辺装置及びプリンタ
EP4220376B1 (en) Method, device, and apparatus for processing driver on terminal device side
JP2004078359A (ja) ネットワーク装置、及びデバイスの共有方法
JP3914949B2 (ja) Usbストレージデバイス、その制御装置及びその制御装置に実行させるためのプログラム
JP5039331B2 (ja) 情報処理装置、削除方法及びプログラム
WO2013189388A2 (zh) 一种接入usb网卡的方法、usb网卡及pc
JP2008152404A (ja) 電子機器、電子機器の制御方法、および電子機器の制御プログラム
WO2014108086A1 (zh) 打印系统及其打印方法和打印机
JP3699717B2 (ja) Usbストレージデバイス及びその制御装置
JP2014120057A (ja) 情報処理装置、およびプログラム
JP5596376B2 (ja) 周辺装置
KR100758219B1 (ko) 유에스비 장치의 동작을 통제하는 방법
JP2004171536A5 (zh)
JP2006293638A (ja) 情報処理装置及び周辺装置
US6871924B2 (en) Multi-mode direct print adapter
JP4551643B2 (ja) Usbプリンタ及びusbスキャナ
JP2006113968A (ja) プリンタドライバ供給ユニット

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 11761954

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

WWE Wipo information: entry into national phase

Ref document number: 13638601

Country of ref document: US

Ref document number: 2011761954

Country of ref document: EP