WO2015188703A1 - 网络打印控制方法和***及打印机和网络服务器 - Google Patents

网络打印控制方法和***及打印机和网络服务器 Download PDF

Info

Publication number
WO2015188703A1
WO2015188703A1 PCT/CN2015/080329 CN2015080329W WO2015188703A1 WO 2015188703 A1 WO2015188703 A1 WO 2015188703A1 CN 2015080329 W CN2015080329 W CN 2015080329W WO 2015188703 A1 WO2015188703 A1 WO 2015188703A1
Authority
WO
WIPO (PCT)
Prior art keywords
printer
printed
data
print
item
Prior art date
Application number
PCT/CN2015/080329
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 山东新北洋信息技术股份有限公司
Publication of WO2015188703A1 publication Critical patent/WO2015188703A1/zh

Links

Images

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

Definitions

  • the present invention relates to the field of network printing, and in particular to a network printing control method and system, and a printer and a network server.
  • the network ordering system includes a client terminal 1', a ordering website server 2', and a merchant handheld terminal 3'.
  • the Internet performs data transmission, wherein the client terminal 1' is a terminal device such as a PC, a mobile phone, or a PAD, and the ordering website server 2' is a server provided by a server or a merchant provided by a third-party ordering website, and the merchant handheld terminal 3' is a A merchant-customized handheld terminal that can receive voice information sent by the ordering website server 2'.
  • the consumer logs in to the ordering website through the client terminal 1', uses the ordering application software to place an order for the online order, and after receiving the order from the consumer, the ordering website server 2' sends an audio message to the merchant handheld terminal 3', the merchant After receiving the voice information, the holder of the handheld terminal 3' clicks the confirmation button of the merchant handheld terminal 3' to take the order, records the order information of the consumer, and transmits the order information to the kitchen staff and the take-out staff, working in the kitchen. Staff and take-away staff prepare meals and deliver meals based on order information.
  • the network ordering system Since for the merchant, the holder of the merchant handheld terminal 3' is often the service personnel at the front desk, after the front desk service personnel receives the order, it is troublesome to transfer the order information to the kitchen staff and the take-away staff, and when the order information is more At the time of the big, the front desk staff is easy to record incompletely. Therefore, the network ordering system has the problems of low work efficiency, easy occurrence of wrong orders or lost orders.
  • the network ordering system includes a client terminal 1', a ordering website server 2', a merchant PC 4', and a plurality of printers 5.
  • the client terminal 1', the ordering website server 2', and the merchant PC 4' transmit data via the Internet
  • the merchant PC 4' and the plurality of printers connected thereto transmit data through the local area network
  • the printers 5' are respectively arranged in different departments of the merchant, for example, a printer 5' is arranged in the kitchen and the front desk.
  • the ordering website server 2' sends the order to the merchant PC 4' after receiving the order from the consumer, and after receiving the order, the merchant PC 4' controls the printer 5' of the corresponding department to make an order. Printing, kitchen staff and take-away staff receive printed orders and prepare meals and deliver meals based on order information. Since the network ordering system requires the merchant to configure at least one PC, the network ordering system increases the operating cost of the merchant.
  • the main object of the present invention is to provide a network printing control method and system, and a printer and a network server to solve the problem of high equipment cost in a network printing system.
  • a network print control method includes: the printer sends the request data to the network server, wherein the request data includes a network service identifier, and the network service identifier is an identifier of the network service body to which the printer belongs, and the printer requests the network server to query the printer by sending the request data.
  • Printing the entry the printer receives the request response data returned by the web server; the printer parses the request response data to obtain the print data of the entry to be printed; the printer prints the print data of the print entry.
  • the request response data includes a first flag, where the first flag is used to indicate whether there is an entry of the printer in the database of the network server, and after the printer receives the request response data, the network print control method further includes: the printer responds to the request data. Obtaining a first flag; the printer determining, according to the value of the first flag, whether the request response data includes print data of the item to be printed, wherein the printer determines, according to the value of the first flag, the print data of the item to be printed in the request response data. At the time, the print data of the entry to be printed is parsed from the request response data.
  • the request response data includes a second flag
  • the second flag is used to indicate whether there are other items to be printed of the printer in the database of the network server other than the item to be printed currently to be printed, after the printer receives the request response data
  • the network printing control method further includes: the printer acquiring the second flag from the request response data; the printer determining, according to the value of the second flag, whether there are other printers to be printed in the database of the network server other than the item to be printed currently to be printed And the printer continues to send the request data when the printer in the database of the network server other than the current to be printed item is determined to be in accordance with the value of the second flag, and the printer is in accordance with the second flag.
  • the value is judged to be in addition to the current to be printed When there are no other items to be printed of the printer in the database of the external network server, wait for the preset interval time, and then continue to send the request data.
  • the request data further includes print item report data, where the print item report data includes a print item serial number and a print item status flag, wherein the print item serial number is a serial number of the print item printed before the printer sends the request data this time,
  • the print entry status flag is used to indicate whether the print entry corresponding to the print entry serial number was printed successfully.
  • the request data sent by the printer further includes device report data
  • the device report data includes an identifier of the printer and a status flag of the printer
  • the printer reports the status of the printer to the network server through the device report data.
  • a network print control method includes: the network server receiving the request data sent by the printer, wherein the request data includes a network service identifier, the network service identifier is an identifier of a network service body to which the printer belongs; and the network server queries the printer according to the request data sent by the printer. An entry to be printed and request response data is generated based on the entry to be printed; the web server sends the request response data to the printer.
  • the request response data includes a first flag
  • the first flag is used to indicate whether there is an entry for the printer to be printed in the database of the network server
  • the network server queries the to-be-printed item of the printer according to the request data sent by the printer and is based on the item to be printed.
  • Generating the request response data includes: the network server queries the print item database according to the network service identifier; the network server determines whether there is an item to be printed corresponding to the network service identifier in the print item database to determine whether the print item of the printer exists in the print item database; When the network server determines that there is an entry to be printed of the printer in the print entry database, the value of the first flag is set to a first value, and when it is determined that the entry of the printer to be printed does not exist in the print entry database, the first flag is set.
  • the value of the second value is; the web server generates request response data, and the request response data includes a first flag, and when there is an entry to be printed of the printer in the print entry database, the request response data further includes the number of prints of the item to be printed .
  • the request response data includes a second flag
  • the second flag is used to indicate whether there are other items to be printed of the printer in the database of the network server other than the item to be printed currently to be printed
  • the network server according to the request data sent by the printer Querying the to-be-printed item of the printer and generating the request response data based on the to-be-printed item includes: the network server queries the print item database according to the network service identifier; the network server determines whether there is another file in the print item database in addition to the item to be printed currently to be printed The item to be printed of the printer; the network server determines that the value of the second flag is the first value when it is determined that there is another item to be printed in the print item database other than the item to be printed currently to be printed, and the judgment is performed Current pending print When the other items of the printer to be printed are not present in the print entry entry database, the value of the second flag is set to a second value; the web server generates request response data, and the request response data includes the second flag.
  • the request data further includes print item report data, where the print item report data includes a print item serial number and a print item status flag, wherein the print item serial number is a serial number of the print item printed before the printer sends the request data this time,
  • the print item status flag is used to indicate whether the print item corresponding to the print item serial number is successfully printed.
  • the network print control method further includes: the network server updating the print item according to the print item serial number and the print item status flag. database.
  • the request data further includes device report data, where the device report data includes an identifier of the printer and a status flag of the printer.
  • the network print control method further includes: the network server determining, according to the device report data, whether the printer is in a normal state. State; the network server does not perform a query of the print entry when it is determined that the printer is in an abnormal state; the network server performs a query of the print entry when it is determined that the printer is in a normal state.
  • a printer comprising: a transmitting unit, configured to send request data to a network server, wherein the request data includes a network service identifier, and the network service identifier is a printer The identifier of the network service body, the printer requests the network server to query the to-be-printed entry of the printer by sending the request data; the receiving unit is configured to receive the request response data returned by the network server; the parsing unit is configured to parse the request response data, and obtain the to-be-printed Print data of an entry; a printing unit for printing print data of a print entry.
  • a printer comprising: a communication unit for transmitting request data to a network server and receiving request response data returned by the network server, wherein the request data includes a network The service identifier, the network service identifier is an identifier of the network service body to which the printer belongs, the printer requests the network server to query the to-be-printed item of the printer by sending the request data, and the controller is configured to parse the request response data to obtain the print data of the item to be printed; Unit for printing the print data of the item to be printed.
  • the request response data includes a first flag, where the first flag is used to indicate whether there is an entry for the printer to be printed in the database of the network server, and the controller is further configured to obtain the first flag from the request response data, according to the first flag
  • the value judgment request response data includes print data of the item to be printed, and when the print data including the item to be printed is included in the request response data according to the value of the first flag, the print of the item to be printed is parsed from the request response data. data.
  • the request response data includes a second flag
  • the second flag is used to indicate whether there are other printers to be printed in the database of the network server other than the item to be printed currently to be printed
  • the controller is further used for Obtaining a second flag from the request response data, determining, according to the value of the second flag, whether a file to be printed of another printer exists in a database of the network server other than the item to be printed currently to be printed, and determining according to the value of the second flag
  • the control communication unit continues to send the request data, and the item to be printed except the current to be printed is determined according to the value of the second flag.
  • the preset interval time is waited, and then the communication unit is controlled to continue to send the request data.
  • a network server includes: a receiving unit, configured to receive request data sent by a printer, where the request data includes a network service identifier, and the network service identifier is An identifier of the network service body to which the printer belongs; a generating unit, configured to query the to-be-printed item of the printer according to the request data sent by the printer, and generate request response data based on the item to be printed; and a sending unit, configured to send the request response data to the printer.
  • a network printing system including a printer and a web server, wherein: a printer is configured to transmit request data to a web server, and receive a request response returned by the web server Data, parsing the request response data, obtaining print data of the item to be printed, and printing the print data of the item to be printed, wherein the request data includes a network service identifier, the network service identifier is an identifier of the network service body to which the printer belongs, and the printer transmits Requesting data requesting the network server to query the to-be-printed entry of the printer; the network server is configured to receive the request data sent by the printer, query the to-be-printed entry of the printer according to the request data sent by the printer, and generate request response data based on the to-be-printed item, and request the data The response data is sent to the printer.
  • the printer sends a request data including a network service identifier to the network server to request the network server to query the to-be-printed entry of the printer, and receives the request response data returned by the network server, parses the request response data, and obtains the print data of the entry to be printed. And printing the print data of the print item, the network printing system of the present invention does not need to configure the PC.
  • the invention solves the problem of high equipment cost in the network printing system, thereby achieving the effect of reducing the equipment cost in the network printing system.
  • FIG. 1 is a schematic diagram of a prior art network ordering system
  • FIG. 2 is a schematic diagram of another network ordering system of the prior art
  • FIG. 3 is a block diagram showing the structure of a network printing system according to a first embodiment of the present invention
  • FIG. 4 is a block diagram showing the structure of a network printing system according to a second embodiment of the present invention.
  • FIG. 5 is a flowchart of a network print control method according to a first embodiment of the present invention.
  • FIG. 6 is a flowchart of a network print control method according to a second embodiment of the present invention.
  • FIG. 7 is a flowchart of a network print control method according to a third embodiment of the present invention.
  • FIG. 8 is a flowchart of a network print control method according to a fourth embodiment of the present invention.
  • FIG. 9 is a flowchart of a network print control method according to a fifth embodiment of the present invention.
  • Figure 10 is a schematic illustration of a printer in accordance with an embodiment of the present invention.
  • FIG. 11 is a schematic diagram of a network server in accordance with an embodiment of the present invention.
  • the network printing system includes a client terminal 1, a web server 2, and a printer 3.
  • the client terminal 1, the web server 2, and the printer 3 all access the Internet, and the client terminal 1 and the printer 3 respectively perform data transmission with the web server 2 via the Internet.
  • the client terminal 1 can be a terminal device such as a PC, a mobile phone, or a PAD.
  • the network server 2 can be a server provided by a third-party website operator, or can be a server provided by the merchant.
  • the printer 3 can access the Internet through a network cable, or can pass the WIFI. Wait for wireless access to the Internet.
  • the network printing system includes a plurality of printers 3, each of which belongs to n merchants, and each merchant applies for use.
  • the operator of the network server 2 registers the relevant information of the merchant and assigns a unique number to the merchant (hereinafter referred to as the merchant ID), and the operator of the network server 2 stores the related information of the merchant in one-to-one correspondence with the merchant ID.
  • the merchant ID is notified to the merchant.
  • Each printer 3 has a unique device number (hereinafter referred to as a printer ID) which is assigned by the printer manufacturer when the printer 3 is shipped.
  • a printer ID unique device number
  • each of the plurality of printers 3 performs data transmission with the network server 2 via the router 4.
  • the consumer makes a network order through the network printing system
  • the consumer selects the merchant and the required food by operating the ordering application software installed in the client terminal 1, and the ordering application software generates the content including the content according to the consumer's ordering information.
  • the order information of the merchant ID and the order data is sent to the web server 2, wherein the merchant ID is used to distinguish the merchant identity, and each merchant using the network printing system has a unique merchant ID.
  • the network server 2 After receiving the order information sent by the customer through the client terminal 1, the network server 2 generates a unique order serial number corresponding to the order information, and stores the order serial number and the order information in a one-to-one correspondence with the order database of the network server 2. .
  • Table 1 illustrates an order stored in an order database of a web server according to an embodiment of the present invention.
  • a number of orders are stored in the order database of the web server 2, and each order includes an order serial number and a merchant.
  • ID, order data further, each order stored in the order database also includes the order status, the order status is used to indicate that the order is in an unprinted state, a print success status, or a print failure status, and each order is generated at the time of web server setup.
  • the order status is unprinted.
  • the embodiment of the invention further provides a network printing control method, which may be a printing control method for the network printing system of the embodiment of the invention, for controlling network printing.
  • Figure 5 is a flow chart of a network print control method in accordance with a first embodiment of the present invention.
  • network printing control is performed by the printer.
  • the network print control method of this embodiment includes:
  • Step S101 the printer sends the request data to the network server.
  • the network server stores the to-be-printed item for printing by the printer and the network service identifier of the printer
  • the network service identifier is the identifier of the network service body to which the printer belongs
  • the network server identifies the printer through the network service identifier. Distinguish to determine the items to be printed corresponding to different network service subjects or printers.
  • the print entry is an order stored in the order database of the web server, and the network service identifier of the printer belongs to the printer. Merchant's business ID.
  • the printer requests the data to be printed by sending the request data corresponding to the printer, and the request data includes the network service identifier, so that the printer can request the network server to query the to-be-printed item corresponding to the network service identifier by sending the request data, that is, requesting the network server to query
  • the item to be printed that is printed using the printer, that is, the web server is requested to query the item to be printed of the printer.
  • the request data may further include print item report data, where the print item report data includes a print item serial number and a print item status flag, wherein the print item serial number is a water flow of the print item printed before the printer sends the request data this time.
  • the print entry status flag is used to indicate whether the print entry corresponding to the print entry serial number was successfully printed.
  • the print entry serial number is the order serial number and the print entry status flag is the order status.
  • the request data sent by the printer may further include device report data
  • the device report data includes an identifier of the printer and a status flag of the printer
  • the printer reports the status of the printer to the network server by using the device report data, where the identifier of the printer may be a printer ID.
  • Step S102 the printer receives the request response data returned by the web server.
  • the web server generates order request response data according to a predetermined format based on print data of the to-be-printed item requested by the printer according to a preset protocol, and the printer receives the request response data returned by the web server.
  • the request response data may include a first flag indicating whether there is a printer to be printed in the database of the network server.
  • the network print control method further includes: the printer acquiring the first flag from the request response data; the printer determining, according to the value of the first flag, whether the request response data includes print data of the item to be printed, wherein When the printer determines the print data including the item to be printed in the request response data according to the value of the first flag, the printer parses the print data of the item to be printed from the request response data.
  • the request response data may further include a second flag for indicating the network server other than the item to be printed currently to be printed.
  • the network printing control method further comprises: the printer acquiring the second flag from the request response data; the printer determining, according to the value of the second flag, Whether there are other items to be printed of the printer in the database of the network server outside the printed entry to be printed, wherein the printer determines that the network server exists in addition to the to-be-printed item to be printed according to the value of the second flag.
  • the request data is continuously sent, and the printer determines, according to the value of the second flag, other than the item to be printed currently to be printed.
  • the preset interval time is waited for, and then the request data is continuously sent.
  • step S103 the printer parses the request response data to obtain print data of the item to be printed.
  • the printer parses the print data of the item to be printed for printing by request response data.
  • step S104 the printer prints the print data of the print item.
  • Figure 6 is a flow chart of a network print control method in accordance with a second embodiment of the present invention.
  • network print control is performed by a web server.
  • the network print control method of this embodiment includes:
  • Step S201 The network server receives the request data sent by the printer, where the request data includes a network service identifier, and the network service identifier is an identifier of the network service body to which the printer belongs.
  • the request data in this embodiment may be the request data in the embodiment shown in FIG.
  • Step S202 the network server queries the to-be-printed item of the printer according to the request data sent by the printer and generates request response data based on the item to be printed.
  • the network server queries the print item database according to the network service identifier included in the request data sent by the printer, determines whether there is an item to be printed corresponding to the network service identifier in the print item database, and determines whether the print item database exists in the print item database.
  • the printed entry to be printed that is, whether there is an entry for the printer to be printed.
  • the request response data in this embodiment may be the request response data in the embodiment shown in FIG.
  • step S203 the network server sends the request response data to the printer.
  • the web server sends the request response data to the printer so that the printer can parse the request response data, obtain the print data of the entry to be printed, and print the print data of the print entry.
  • Figure 7 is a flow chart showing a network printing control method according to a third embodiment of the present invention, which may be a preferred embodiment of the first embodiment or the second embodiment described above.
  • the network print control method of the embodiment of the present invention is described by taking a print order as an example. Accordingly, for the embodiment of the print order, the request data is the order request data, and the request response data is the order request response data.
  • the network service identifier is the merchant ID
  • the print entry serial number is the order serial number
  • the print entry status flag is the order status flag
  • the print entry is an order, and the like. It should be noted that the network print control method of the embodiment of the present invention is not limited to printing on an order, and can also be used for printing other print items.
  • the network server and the printer establish a network connection through the Internet.
  • the printer actively requests the order data from the network server every predetermined time interval, and the network server performs the order request sent by the printer.
  • the method includes the following steps:
  • Step S301 the printer sends the order request data to the network server.
  • the printer sends the order request data to the network server to request the network server to send the order data to the network server, wherein the order request data sent by the printer includes a merchant ID, and the merchant ID is a unique number assigned by the operator of the network server to the merchant to which the printer belongs, by the merchant Pre-stored in the internal memory of the printer.
  • a configuration file is stored in the internal memory of the printer, and after the printer is powered on, the configuration file is read, and the configuration file includes information such as an address of the network server, a printer ID, a merchant ID, a printer IP address, a printer MAC address, and the like.
  • the address of the web server and the merchant ID are written by the merchant into the configuration file after purchasing the printer.
  • the printer obtains the contents of the configuration file and sends the order request data to the network server according to the address of the network server.
  • Step S302 the network server queries the order database after receiving the order request data sent by the printer, and sends an order request response data to the printer according to the query result.
  • the web server includes an order database for storing information of orders placed by the consumer through the client terminal.
  • the network server parses the order request data and obtains the merchant ID, and then queries the order database according to the merchant ID to determine whether there is an unprinted order corresponding to the merchant ID in the order database, that is, the order database is determined. Is there an order in the printer that can be printed using the printer that sent the order request data.
  • the web server sets a first flag according to the query result of the order database, wherein the first flag is used to indicate whether there is an order in the order database that can be printed by the printer that sends the order request data, for example, when the order database exists, the send order request can be used.
  • the value of the first flag is set to 1; when there is no order in the order database that can be printed by the printer that sends the order request data, the value of the first flag is set to 0.
  • the network server generates the order request response data according to a predetermined format according to a predetermined format, wherein the order request response data includes a first flag, and when there is an order in the order database that can be printed by the printer that sends the order request data, the order request response
  • the data also includes order data, which is order data of an order to be printed by the printer that sends the order request data, which is queried in the order database, for example, for the online ordering service, the order data includes the food name and quantity.
  • Step S303 the printer parses the order request response data sent by the web server, and when the order request response data includes the order data, the printer prints the order data.
  • the order request response data is parsed according to a preset protocol.
  • the printer acquires a first flag in the order request response data, and determines, according to the value of the first flag, whether there is an order in the order database of the network server that can be printed by using the printer, that is, whether the order request response data includes the order data to be printed.
  • the printer acquires the order data in the order request response data, and prints the order data.
  • step S301 continues to send the next order request data to the network server.
  • the printer determines by the value of the first flag that there is no order in the order database that can be printed by the printer, that is, when the order request response data does not include the order data to be printed, the printer waits for the preset time again. Step S301 is performed.
  • the printer sends the order request data to the web server based on the merchant ID, and the web server queries the order database based on the merchant ID, and sends the order data to the printer according to the query result to cause the printer to print the order data.
  • the merchant does not need to configure the PC.
  • the network server receives the order request data sent by the printer, the network server directly sends the corresponding order data sent by the client terminal to the printer to enable the printer to print the order data.
  • the network printing system and the printing control method thereof provided by the invention are applied to the network ordering service, and can solve the problem of increasing the operating cost of the merchant existing in the prior art network ordering system.
  • FIG. 8 is a flowchart of a network print control method according to a fourth embodiment of the present invention, and the method of the embodiment may be a preferred embodiment of the print control method shown in FIG. As shown, the method includes the following steps:
  • Step S401 the printer sends the interaction request data to the network server to report the order status and the request order data to the network server.
  • the printer sends interactive request data to the web server to report the order status and request order data to the web server.
  • the interaction request data includes a merchant ID and an order report data, wherein the order report data includes an order serial number and an order status flag.
  • the order serial number is the order serial number of the order printed before the printer sends the interactive request data
  • the order status flag is used to indicate that the order serial number corresponds to the order. Whether the order data is printed successfully. For example, when the value of the order status flag is 1, it indicates that the order data corresponding to the order serial number is printed successfully. When the value of the order status flag is 0, it indicates the corresponding to the order serial number.
  • the order data printing fails; when the printer does not execute the order data printing before the printer sends the interactive request data, for example, when the printer is just powered on, or the printer last sent the interactive request data, the interactive request response data sent by the network server does not contain
  • the order serial number and order The single status flag is a preset invalid value, or the order serial number is the order serial number of the last order printed by the printer, and the order status flag is used to indicate whether the order data corresponding to the order serial number is printed successfully.
  • Step S402 the network server parses the received interaction request data and updates the order database.
  • the network server After receiving the interaction request data sent by the printer, the network server parses the interaction request data according to a preset protocol to obtain the merchant ID and the order report data. Wherein, when the order serial number and the order status flag of the order report data are preset invalid values, the network server does not need to update the order database; when the order serial number and the order status flag of the order report data are valid values, the network server is based on The order serial number in the order report data queries the corresponding order in the order database, and updates the order status of the order according to the order status flag in the order report data, and sets the order status of the order to the print success status or the print failure status.
  • Step S403 the network server queries the order database, and sends an interaction request response data to the printer according to the query result.
  • the network server queries the order database according to the merchant ID acquired in step S402, and determines whether there is an order corresponding to the merchant ID in the order database. When an order corresponding to the merchant ID exists in the order database, it is determined according to the order status of the order.
  • the order is printed using a printer that sends interactive request data. Specifically, the network server queries each order one by one from the starting address of the order database. When the order corresponding to the merchant ID is queried and the order status is unprinted or print failed, the network server stops the order database query.
  • the network server sets a first flag according to the query result, and generates an interaction request response data according to a predetermined format according to the preset protocol, where the interaction request response data includes a first flag, and when the order database exists, the data for sending the interaction request may be used.
  • the interactive request response data also includes the order serial number and order data of the order to be printed.
  • the web server sends the interactive request response data to the printer that sends the interactive request data.
  • Step S404 the printer parses the received interaction request response data, and determines whether the interaction request response data includes the order data to be printed.
  • the printer After receiving the interaction request response data sent by the network server, the printer parses the interaction request response data according to a preset protocol.
  • the printer acquires a first flag in the interaction request response data, and determines, according to the value of the first flag, whether there is an order in the order database of the network server that can be printed by using the printer, that is, the interaction Whether the request response data includes the order data to be printed, when it is determined that the interactive request response data includes the order data to be printed, step S405 is performed; when it is determined that the interactive request response data does not include the order data to be printed, the step is performed. S406.
  • Step S405 the printer prints the order data and sets the order status flag.
  • the printer determines, by the first flag, that the interactive request response data contains the order data to be printed, the printer acquires the order serial number and the order data of the order to be printed, and prints the order data, and the printer sets the order according to the printing completion status of the order data.
  • the status flag for example, when the order data is printed, the value of the printer setting order status flag is 1, indicating that the order data is printed successfully, and the printer settings are not completed when the printer is abnormal (such as out of paper) during the printing process.
  • the value of the order status flag is 0, indicating that the order data print failed.
  • the printer monitors the status of the printer during operation, and the printer determines whether the printer status is normal before printing the order data.
  • the printer sets the value of the order status flag to a value indicating that the order data has failed to be printed, for example, setting an order.
  • the value of the status flag is 0.
  • Step S406 the printer waits for a preset interval
  • step S401 that is, according to the merchant ID and the order serial number and the order status flag after performing step S404 and step S405, sending the next interaction request data to the network server to report the order status to the network server and Request order data.
  • the printer reports the order status to the web server to report the print completion status of the order, and the web server updates the order status of the corresponding order in the order database according to the order status reported by the printer.
  • the network server can resend the order data to the corresponding printer for printing when the printer fails to print the order data, thereby avoiding the occurrence of the lost order and ensuring the integrity of the order printing.
  • FIG. 9 is a flowchart of a network print control method according to a fifth embodiment of the present invention, and the method of this embodiment may be a preferred embodiment of the print control method shown in FIG. As shown, the method includes the following steps:
  • Step S501 the printer sends the interaction request data to the network server to report the status and request order data to the network server.
  • the printer sends interaction request data to the web server to report status and request order data to the web server, wherein the status of the report includes reporting device status and reporting order status.
  • the interaction request data includes a merchant ID, a device report data, and an order report data, wherein the device report data includes a printer ID, a printer status flag, and the order report data includes an order serial number and an order status flag.
  • the printer ID is the unique device number that is assigned by the printer manufacturer when the printer is shipped.
  • the printer requests registration from the web server when the printer first accesses the network printing system, the web server registers the printer and stores the information of the printer in its device database.
  • the specific registration process is: the printer reads a configuration file pre-stored in the internal memory of the printer, and obtains information such as the address of the network server, the printer ID, the merchant ID, the printer IP address, and the printer MAC address in the configuration file.
  • the printer sends the registration request data of the format to the network server according to the address of the network server, and the registration request data includes information such as a printer ID, a merchant ID, a printer IP address, a printer MAC address, and the like, and the network server receives the registration request data according to the preset.
  • the protocol parses the registration request data, and according to whether the format of the registration request data is correct and complete, whether the printer requesting registration is legal, and if the printer is legal, the network server stores the information such as the printer ID, the merchant ID, the printer IP address, and the printer MAC address. In the device database, and return the registration success information to the printer; if the printer is not legal, return the registration failure information to the printer.
  • Table 2 shows the printer information stored in the device database of the network server according to an embodiment of the present invention.
  • the device database of the network server stores information of a plurality of printers, and the information of each printer includes the printer ID. , merchant ID, printer IP address, printer MAC address, etc.
  • the web server stores the information about the printer in the device database.
  • the information of each printer stored in the device database further includes a printer status, and the printer status is used to indicate that the printer is in a normal state or an abnormal state, wherein the abnormal state includes a paper out state, an upper cover open state, a mechanical error state, and the like. .
  • the status of the printer is monitored during the running of the printer, and the printer status flag is changed according to the status change of the printer.
  • the printer sends the interactive request data to the network server, the merchant ID, printer ID, printer status flag, order serial number, and order status flag are read.
  • the interaction request data is generated according to a preset protocol.
  • the printer sends interactive request data to the web server to report the printer status, order status, and request order data to the web server.
  • Step S502 the network server parses the received interaction request data and updates the device database and the order database.
  • the network server includes a device database for storing information of a printer connected to the network printing system, and an order database for storing information of orders placed by the consumer through the client terminal.
  • the network server After receiving the interaction request data sent by the printer, the network server parses the interaction request data according to a preset protocol, and acquires the merchant ID, the device report data, and the order report data.
  • the network server first queries the device database according to the printer ID in the device report data, and after querying the information of the printer corresponding to the printer ID, updates the printer status of the printer according to the printer status flag in the device report data; and then reports the data according to the order.
  • the order serial number and order status flag update the order database.
  • Step S503 the network server determines whether the printer that sends the interaction request data is in a normal state.
  • the network server determines whether the printer that sends the interactive request data is in a normal state according to the printer status flag in the device report data. For example, when the value of the printer status flag is 1, it is determined that the printer is in a normal state; otherwise, it is determined that the printer is in an abnormal state. When it is determined that the printer transmitting the interactive request data is in the normal state, the network server performs step S504, otherwise, step S505 is performed.
  • Step S504 the network server queries the order database, and sets the first flag and the second flag.
  • the network server queries the order database based on the merchant ID to determine whether there is an order in the order database that can be printed using the printer that transmits the interactive request data. Specifically, the network server queries each order one by one based on the obtained merchant ID from the start address of the order database, and when the first order corresponding to the merchant ID is queried, and the printing status is an unprinted state or a printing failure state.
  • the network server continues to perform the order database query, when the second item is queried
  • a second flag is set to indicate that there are other orders in the order database other than the order to be printed that can be printed by the printer that sends the interactive request data.
  • the value of the second flag is set to 1.
  • the network server stops the order database query; when the network server queries all the orders stored in the order database, the order corresponding to the merchant ID is not queried, or the query is The order corresponding to the merchant ID but the order status is printed successfully.
  • the first flag is set to indicate that there is no order in the order database that can be printed by the printer that sends the interactive request data, for example, the value of the first flag is set to 0, and at this time, the value of the second flag set by the network server is The set invalid value, or set the value of the second flag to indicate that there is no other order in the order database that can be printed by the printer that sends the interactive request data, for example, setting the second flag to 0; when the network server queries the order For all orders stored in the database, only when an order corresponding to the merchant ID is queried and its print status is unprinted or print failed, a second flag is set to indicate that the current flag is present. There are no other orders in the out-of-order order database to be printed that can be printed by the printer that
  • Step S505 the network server sets the first flag and the second flag
  • the network server When it is determined that the printer transmitting the interactive request data is in an abnormal state, the network server does not need to query the order database, and directly sets the first flag to indicate that there is no order in the order database that can be printed by the printer that sends the interactive request data, for example, setting the first flag.
  • the value of the network server sets the value of the second flag to a preset invalid value, or sets the value of the second flag to indicate that there are no other orders in the order database that can be printed by the printer that sends the interactive request data, for example, Set the value of the second flag to 0.
  • Step S506 the network server sends an order request response data to the printer.
  • the network server generates the interaction request response data according to a predetermined format according to a predetermined format, wherein the interaction request response data includes a first flag and a second flag, and when there is an order in the order database that can be printed by the printer that sends the interaction request data,
  • the interaction request response data further includes an order serial number and order data of the order to be printed, wherein when the network server queries two orders in the order database that can be printed by the printer that sends the interactive request data, When there are other orders in the order outbound database that can be printed by the printer that sends the interactive request data, the order to be printed is the first order queried in the order database.
  • the web server After generating the interactive request response data, the web server sends the interactive request response data to the printer that sends the interactive request data.
  • Step S507 the printer parses the received interaction request response data, and determines, according to the first flag, whether the interaction request response data includes the order data to be printed.
  • the printer After receiving the interaction request response data sent by the network server, the printer parses the interaction request response data according to a preset protocol. The printer acquires the first flag and the second flag in the interaction request response data, and determines, according to the value of the first flag, whether the interaction request response data includes the order data to be printed, and when determining that the interaction request response data includes the order data to be printed Step S508 is performed. When it is determined that the interaction request response data does not include the order data to be printed, step S510 is performed.
  • Step S508 the printer prints the order data and sets the order status flag.
  • This step is the same as step S405.
  • Step S509 the printer determines, according to the second flag, whether there are other orders in the order database that can be printed by using the printer.
  • the printer determines, according to the value of the second flag obtained in step S507, whether there are other orders that can be printed by the printer in addition to the currently printed order, and when there are other orders in the order database that can be printed by the printer, Step S501, that is, according to the merchant ID, the printer ID, the printer status flag, and the order serial number and the order status flag after performing step S507 and step S508, immediately send the next interaction request data to the network server to report the status to the network server and The order data is requested; when it is determined that there is no other order in the order database that can be printed by the printer, step S510 is performed.
  • Step S510 the printer waits for a preset interval
  • the printer waits for the preset interval time, and proceeds to step S501 to send the next interaction request data to the network server according to the merchant ID, the printer ID, the printer status flag, and the order serial number and the order status flag after performing step S507 and step S508. Report status and request order data to the web server.
  • the network server when it is determined that the printer is in an abnormal state, the network server does not perform an inquiry of the order database.
  • the order database query is performed based on the merchant ID sent by the printer, and the network other than the order to be printed is returned to the printer. Is there any other order that can be printed by the printer in the order database of the server?
  • the printer will print the current order data and send the next interactive request immediately after printing. data.
  • the embodiment of the present invention further provides a printer, which may be a printer used in the network printing system or the network printing control method of the embodiment of the present invention, where the printer is provided with a processor, and the processor may be used to execute the printer.
  • a network printing control method of an embodiment of the invention and FIG. 10 is a schematic diagram of a printer according to an embodiment of the present invention. As shown in FIG. 10, the printer includes a transmitting unit 31, a receiving unit 32, a parsing unit 33, and a printing unit 34.
  • the sending unit 31 is configured to send request data to the network server, where the request data includes a network service identifier, where the network service identifier is an identifier of the network service body to which the printer belongs, and the printer requests the network server to query the printer to print the entry by sending the request data. .
  • the sending unit 31 can perform the related steps of the printer sending the request data in the foregoing embodiment, and the related content is not described herein again.
  • the receiving unit 32 is configured to receive request response data returned by the network server.
  • the receiving unit 32 can perform the relevant steps of the printer receiving the response request data in the foregoing embodiment, and the related content is not described herein again.
  • the parsing unit 33 is configured to parse the request response data to obtain print data of the item to be printed.
  • the parsing unit 33 can perform the related steps of the printer parsing request response data in the foregoing embodiment, and the related content is not described herein again.
  • the printing unit 34 is configured to print the print data of the item to be printed.
  • the printing unit 34 can perform the related steps of the printer performing printing in the foregoing embodiment, and the related content will not be described herein.
  • the transmitting unit 31 and the receiving unit 32 are configured to implement communication between the printer and the network server, and can be implemented by a communication unit of the printer.
  • the controller of the printer is used to perform processing functions of data, for example, analysis of data, and thus, the parsing unit 33 can be implemented by a controller of the printer.
  • the network server may be a network server used in the network printing system or the network printing control method of the embodiment of the present invention, where the network server is provided with a processor, and the processor may be used to execute the network printing control method of the embodiment of the present invention.
  • 11 is a schematic diagram of a network server in accordance with an embodiment of the present invention. As shown in FIG. 11, the network server includes a receiving unit 21, a generating unit 22, and a transmitting unit 23.
  • the receiving unit 21 is configured to receive request data sent by the printer, where the request data includes a network service identifier, and the network service identifier is an identifier of a network service body to which the printer belongs.
  • the receiving unit 21 can perform the relevant steps of the network server receiving the request data in the foregoing embodiment, and the related content is not described herein again.
  • the generating unit 22 is configured to query the to-be-printed item of the printer according to the request data sent by the printer and generate request response data based on the item to be printed.
  • the generating unit 22 may perform the related steps of the network server generating the request response data in the foregoing embodiment, and the related content is not described herein again.
  • the sending unit 23 is configured to send the request response data to the printer.
  • the sending unit 23 can perform the related steps of the network server sending the request response data in the foregoing embodiment, and details are not described herein again.
  • the printer is configured to send request data to the network server, receive request response data returned by the network server, parse the request response data, and obtain the number of prints of the item to be printed. And printing the print data of the print entry, wherein the request data includes a network service identifier, and the network service identifier is an identifier of the network service body to which the printer belongs, and the printer requests the network server to query the to-print entry of the printer by sending the request data;
  • the network server is configured to receive the request data sent by the printer, query the to-be-printed item of the printer according to the request data sent by the printer, generate request response data based on the item to be printed, and send the request response data to the printer, thereby eliminating the need to set the PC. Reduced equipment costs in network printing systems.

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)

Abstract

本发明公开了一种网络打印控制方法和***及打印机和网络服务器。该网络打印控制方法包括:打印机向网络服务器发送请求数据,其中,请求数据包括网络服务标识,网络服务标识为打印机所属的网络服务主体的标识,打印机通过发送请求数据请求网络服务器查询该打印机的待打印条目;打印机接收网络服务器返回的请求响应数据;打印机解析请求响应数据,得到待打印条目的打印数据;打印机对待打印条目的打印数据进行打印。通过本发明,能够降低网络打印***的设备成本。

Description

网络打印控制方法和***及打印机和网络服务器 技术领域
本发明涉及网络打印领域,具体而言,涉及一种网络打印控制方法和***及打印机和网络服务器。
背景技术
随着互联网和电子商务技术的发展,人们通过网络订购产品或者服务的行为越来越普遍,网络点餐业务也随之逐渐兴起。消费者足不出户,就可以通过PC机、手机、PAD等终端设备(以下简称客户终端)定购自己喜欢的食品。与传统的店内点餐模式相比,网络点餐既节省了消费者的时间,也节省了商户餐馆的服务人员的时间,因此,网络点餐业务广受消费者和商户的欢迎。
图1是现有技术的一种网络点餐***的示意图,如图所示,该网络点餐***包括客户终端1',点餐网站服务器2'以及商户手持终端3',三者之间通过互联网进行数据传输,其中,客户终端1'为PC机、手机、PAD等终端设备,点餐网站服务器2'为第三方点餐网站提供的服务器或商户提供的服务器,商户手持终端3'为一种商户定制的手持终端,该手持终端可以接收由点餐网站服务器2'发送的声讯信息。消费者通过客户终端1'登录点餐网站,利用点餐应用软件进行网络点餐下单,点餐网站服务器2'接收到消费者的订单后,向商户手持终端3'发送一条声讯信息,商户手持终端3'的持有者接收到声讯信息后点击商户手持终端3'的确认键进行接单,并记录消费者的订单信息,将该订单信息传递到厨房工作人员和外卖工作人员,厨房工作人员和外卖工作人员根据订单信息进行备餐及送餐。由于对于商户来说,商户手持终端3'的持有者往往是前台的服务人员,前台服务人员接单后,向厨房工作人员和外卖工作人员传递订单信息比较麻烦,并且当订单的信息量较大时,前台服务人员容易记录不全,因此,该网络点餐***存在工作效率低、容易出现错单或丢单的问题。
图2是现有技术的另一种网络点餐***的示意图,如图所示,该网络点餐***包括客户终端1',点餐网站服务器2'、商户PC机4'以及多台打印机5',其中,客户终端1'、点餐网站服务器2'、商户PC机4'之间通过互联网进行数据传输,商户PC机4'和与其连接的多台打印机之间通过局域网进行数据传输,多台打印机5'分别设置在商户的不同部门,比如在后厨和前台各配置一台打印机5'。商户PC机4'在营业时间与互联网连接,进行网络点餐时,消费者使用客户终端1'登录点餐网站,利用点餐应用软件 进行网络点餐下单,点餐网站服务器2'接收到消费者的订单后将该订单发送给商户PC机4',商户PC机4'接收到订单后,控制相应部门的打印机5'进行订单打印,厨房工作人员及外卖工作人员接收打印的订单并根据订单信息进行备餐及送餐。由于该网络点餐***需要商户必须配置至少一台PC机,因此,该网络点餐***增加了商户的运营成本。
针对现有技术的网络打印***中设备成本高的问题,目前尚未提出有效的解决方法。
发明内容
本发明的主要目的在于提供一种网络打印控制方法和***及打印机和网络服务器,以解决网络打印***中设备成本高的问题。
为了实现上述目的,根据本发明的一个方面,提供了一种网络打印控制方法。该网络打印控制方法包括:打印机向网络服务器发送请求数据,其中,请求数据包括网络服务标识,网络服务标识为打印机所属的网络服务主体的标识,打印机通过发送请求数据请求网络服务器查询该打印机的待打印条目;打印机接收网络服务器返回的请求响应数据;打印机解析请求响应数据,得到待打印条目的打印数据;打印机对待打印条目的打印数据进行打印。
进一步地,请求响应数据包括第一标志,第一标志用于表示网络服务器的数据库中是否存在打印机的待打印条目,打印机在接收请求响应数据之后,网络打印控制方法还包括:打印机从请求响应数据中获取第一标志;打印机根据第一标志的值判断请求响应数据中是否包含待打印条目的打印数据,其中,打印机在根据第一标志的值判断出请求响应数据中包含待打印条目的打印数据时,从请求响应数据中解析得到待打印条目的打印数据。
进一步地,请求响应数据包括第二标志,第二标志用于表示除当前要打印的待打印条目外网络服务器的数据库中是否还存在其他该打印机的待打印条目,打印机在接收请求响应数据之后,网络打印控制方法还包括:打印机从请求响应数据中获取第二标志;打印机根据第二标志的值判断除当前要打印的待打印条目外网络服务器的数据库中是否还存在其他该打印机的待打印条目,其中,打印机在根据第二标志的值判断出除当前要打印的待打印条目外网络服务器的数据库中还存在其他该打印机的待打印条目时,继续发送请求数据,打印机在根据第二标志的值判断出除当前要打印的待打 印条目外网络服务器的数据库中不存在其他该打印机的待打印条目时,先等待预设间隔时间,然后继续发送请求数据。
进一步地,请求数据还包括打印条目报告数据,打印条目报告数据包括打印条目流水号和打印条目状态标志,其中,打印条目流水号为打印机本次发送请求数据前所打印的打印条目的流水号,打印条目状态标志用于表示与打印条目流水号对应的打印条目是否打印成功。
进一步地,打印机发送的请求数据还包括设备报告数据,设备报告数据包括打印机的标识和打印机的状态标志,打印机通过设备报告数据向网络服务器报告打印机的状态。
为了实现上述目的,根据本发明的另一方面,提供了一种网络打印控制方法。该网络打印控制方法包括:网络服务器接收打印机发送的请求数据,其中,请求数据包括网络服务标识,网络服务标识为打印机所属的网络服务主体的标识;网络服务器根据打印机发送的请求数据查询该打印机的待打印条目并基于待打印条目生成请求响应数据;网络服务器将请求响应数据发送至打印机。
进一步地,请求响应数据包括第一标志,第一标志用于表示网络服务器的数据库中是否存在打印机的待打印条目,网络服务器根据打印机发送的请求数据查询该打印机的待打印条目并基于待打印条目生成请求响应数据包括:网络服务器根据网络服务标识查询打印条目数据库;网络服务器判断打印条目数据库中是否存在与网络服务标识对应的待打印条目以判断打印条目数据库中是否存在该打印机的待打印条目;网络服务器在判断出打印条目数据库中存在该打印机的待打印条目时,设置第一标志的值为第一值,在判断出打印条目数据库中不存在该打印机的待打印条目时,设置第一标志的值为第二值;网络服务器生成请求响应数据,请求响应数据包括第一标志,在打印条目数据库中存在该打印机的待打印条目时,请求响应数据还包括待打印条目的打印数据。
进一步地,请求响应数据包括第二标志,第二标志用于表示除当前要打印的待打印条目外网络服务器的数据库中是否还存在其他该打印机的待打印条目,网络服务器根据打印机发送的请求数据查询该打印机的待打印条目并基于待打印条目生成请求响应数据包括:网络服务器根据网络服务标识查询打印条目数据库;网络服务器判断除当前要打印的待打印条目外打印条目数据库中是否还存在其他该打印机的待打印条目;网络服务器在判断出除当前要打印的待打印条目外打印条目数据库中还存在其他该打印机的待打印条目时,设置第二标志的值为第一值,在判断出除当前要打印的待 打印条目外打印条目数据库中不存在其他该打印机的待打印条目时,设置第二标志的值为第二值;网络服务器生成请求响应数据,请求响应数据包括第二标志。
进一步地,请求数据还包括打印条目报告数据,打印条目报告数据包括打印条目流水号和打印条目状态标志,其中,打印条目流水号为打印机本次发送请求数据前所打印的打印条目的流水号,打印条目状态标志用于表示与打印条目流水号对应的打印条目是否打印成功,网络服务器在接收请求数据之后,网络打印控制方法还包括:网络服务器根据打印条目流水号和打印条目状态标志更新打印条目数据库。
进一步地,请求数据还包括设备报告数据,设备报告数据包括打印机的标识和打印机的状态标志,在网络服务器接收请求数据之后,网络打印控制方法还包括:网络服务器根据设备报告数据判断打印机是否处于正常状态;网络服务器在判断出打印机处于异常状态时不执行打印条目的查询;网络服务器在判断出打印机处于正常状态时执行打印条目的查询。
为了实现上述目的,根据本发明的另一方面,提供了一种打印机,该打印机包括:发送单元,用于向网络服务器发送请求数据,其中,请求数据包括网络服务标识,网络服务标识为打印机所属的网络服务主体的标识,打印机通过发送请求数据请求网络服务器查询该打印机的待打印条目;接收单元,用于接收网络服务器返回的请求响应数据;解析单元,用于解析请求响应数据,得到待打印条目的打印数据;打印单元,用于对待打印条目的打印数据进行打印。
为了实现上述目的,根据本发明的另一方面,提供了一种打印机,该打印机包括:通信单元,用于向网络服务器发送请求数据并接收网络服务器返回的请求响应数据,其中,请求数据包括网络服务标识,网络服务标识为打印机所属的网络服务主体的标识,打印机通过发送请求数据请求网络服务器查询打印机的待打印条目;控制器,用于解析请求响应数据,得到待打印条目的打印数据;打印单元,用于对待打印条目的打印数据进行打印。
进一步地,请求响应数据包括第一标志,第一标志用于表示网络服务器的数据库中是否存在打印机的待打印条目,控制器还用于从请求响应数据中获取第一标志,根据第一标志的值判断请求响应数据中是否包含待打印条目的打印数据,以及在根据第一标志的值判断出请求响应数据中包含待打印条目的打印数据时,从请求响应数据中解析得到待打印条目的打印数据。
进一步地,请求响应数据包括第二标志,第二标志用于表示除当前要打印的待打印条目外网络服务器的数据库中是否还存在其他打印机的待打印条目,控制器还用于 从请求响应数据中获取第二标志,根据第二标志的值判断除当前要打印的待打印条目外网络服务器的数据库中是否还存在其他打印机的待打印条目,以及在根据第二标志的值判断出除当前要打印的待打印条目外网络服务器的数据库中还存在其他打印机的待打印条目时,继续控制通信单元发送请求数据,在根据第二标志的值判断出除当前要打印的待打印条目外网络服务器的数据库中不存在其他打印机的待打印条目时,先等待预设间隔时间,然后再控制通信单元继续发送请求数据。
为了实现上述目的,根据本发明的另一方面,提供了一种网络服务器,该网络服务器包括:接收单元,用于接收打印机发送的请求数据,其中,请求数据包括网络服务标识,网络服务标识为打印机所属的网络服务主体的标识;生成单元,用于根据打印机发送的请求数据查询该打印机的待打印条目并基于待打印条目生成请求响应数据;发送单元,用于将请求响应数据发送至打印机。
为了实现上述目的,根据本发明的另一方面,提供了一种网络打印***,该网络打印***包括打印机和网络服务器,其中:打印机用于向网络服务器发送请求数据,接收网络服务器返回的请求响应数据,解析请求响应数据,得到待打印条目的打印数据,以及对待打印条目的打印数据进行打印,其中,请求数据包括网络服务标识,网络服务标识为打印机所属的网络服务主体的标识,打印机通过发送请求数据请求网络服务器查询该打印机的待打印条目;网络服务器用于接收打印机发送的请求数据,根据打印机发送的请求数据查询该打印机的待打印条目并基于待打印条目生成请求响应数据,以及将请求响应数据发送至打印机。
在本发明中,打印机向网络服务器发送包括网络服务标识的请求数据请求网络服务器查询该打印机的待打印条目,并接收网络服务器返回的请求响应数据,解析请求响应数据,得到待打印条目的打印数据,以及对待打印条目的打印数据进行打印,本发明的网络打印***无需再配置PC机。本发明解决了网络打印***中设备成本高的问题,进而达到了降低网络打印***中设备成本的效果。
附图说明
构成本申请的一部分的附图用来提供对本发明的进一步理解,本发明的示意性实施例及其说明用于解释本发明,并不构成对本发明的不当限定。在附图中:
图1是现有技术的一种网络点餐***的示意图;
图2是现有技术的另一种网络点餐***的示意图;
图3是根据本发明第一实施例的网络打印***的模块组成示意图;
图4是根据本发明第二实施例的网络打印***的模块组成示意图;
图5是根据本发明第一实施例的网络打印控制方法的流程图;
图6是根据本发明第二实施例的网络打印控制方法的流程图;
图7是根据本发明第三实施例的网络打印控制方法的流程图;
图8是根据本发明第四实施例的网络打印控制方法的流程图;
图9是根据本发明第五实施例的网络打印控制方法的流程图;
图10是根据本发明实施例的打印机的示意图;以及
图11是根据本发明实施例的网络服务器的示意图。
具体实施方式
需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互组合。下面将参考附图并结合实施例来详细说明本发明。
图3是根据本发明第一实施例的网络打印***的模块组成示意图,如图所示,该网络打印***包括客户终端1、网络服务器2以及打印机3。其中,客户终端1、网络服务器2和打印机3均接入互联网,客户终端1和打印机3分别通过互联网与网络服务器2进行数据传输。客户终端1可以为PC机、手机、PAD等终端设备,网络服务器2可以为第三方网站运营商提供的服务器,也可以为商户提供的服务器,打印机3可以通过网线接入互联网,也可以通过WIFI等无线方式接入互联网。
图4是根据本发明第二实施例的网络打印***的模块组成示意图,如图所示,网络打印***包括多台打印机3,该多台打印机3分别属于n家商户所有,每一家商户申请使用网络打印***时,网络服务器2的运营商登记该商户的相关信息并为该商户分配唯一编号(以下简称商户ID),网络服务器2的运营商将该商户的相关信息与其商户ID一一对应存储在网络服务器2中,并将所分配的商户ID通知该商户。每一台打印机3具有唯一的设备编号(以下简称打印机ID),打印机ID由打印机制造商在打印机3出厂时分配。优选地,当多台打印机3同时归属于同一家商户时,该多台打印机3中的每一台打印机3通过路由器4与网络服务器2进行数据传输。
下面以网络点餐业务为例,对网络打印***的订单生成过程进行说明。当消费者通过该网络打印***进行网络点餐时,消费者通过操作客户终端1安装的点餐应用软件,选定商户及所需食品,点餐应用软件根据消费者的点餐信息生成包括含有商户ID和订单数据的订单信息,并将该订单信息发送至网络服务器2,其中,商户ID用于区别商户身份,使用网络打印***的每个商户均具有唯一的商户ID。网络服务器2接收到消费者通过客户终端1发送的订单信息后,生成与该订单信息对应的唯一的订单流水号,并将订单流水号和订单信息一一对应存储到网络服务器2的订单数据库中。
表1
订单流水号 商户ID 订单数据 订单状态
201404260001 M001 xxxxxxxx 打印成功
201404260002 M 020 xxxxxxxx 打印成功
201404260003 M 006 xxxxxxxx 未打印
201404260004 M 020 xxxxxxxx 未打印
201404260005 M 016 xxxxxxxx 打印失败
201404260006 M 008 xxxxxxxx 打印成功
…… …… …… ……
表1示意出了根据本发明一实施例的网络服务器的订单数据库中存储的订单,如表1所示,网络服务器2的订单数据库中存储有若干条订单,每条订单包括订单流水号、商户ID、订单数据,进一步地,订单数据库中存储的每条订单还包括订单状态,订单状态用于指示该条订单处于未打印状态、打印成功状态或者打印失败状态,每条订单生成时网络服务器设置其订单状态为未打印状态。
本发明实施例还提供了一种网络打印控制方法,该网络打印控制方法可以是用于本发明实施例的网络打印***的打印控制方法,用于控制网络打印。
图5是根据本发明第一实施例的网络打印控制方法的流程图。在该实施例中,通过打印机进行网络打印控制。如图5所示,该实施例的网络打印控制方法包括:
步骤S101,打印机向网络服务器发送请求数据
在本发明实施例的网络打印***中,网络服务器存储有供打印机打印的待打印条目和打印机的网络服务标识,网络服务标识为打印机所属的网络服务主体的标识,网络服务器通过网络服务标识对打印机进行区分,从而确定与不同网络服务主体或打印机对应的待打印条目,比如,对于表1所示意的实施例,打印条目为网络服务器的订单数据库中存储的订单,打印机的网络服务标识为打印机所属商户的商户ID。
打印机通过发送请求数据请求与该打印机相应的待打印条目,请求数据包括网络服务标识,从而打印机可以通过发送请求数据请求网络服务器查询与网络服务标识对应的待打印条目,即,请求网络服务器查询可以使用该打印机进行打印的待打印条目,也即,请求网络服务器查询该打印机的待打印条目。
优选地,请求数据中还可以包括打印条目报告数据,打印条目报告数据包括打印条目流水号和打印条目状态标志,其中,打印条目流水号为打印机本次发送请求数据前所打印的打印条目的流水号,打印条目状态标志用于表示与打印条目流水号对应的打印条目是否打印成功,比如,对于表1所示意的实施例,打印条目流水号为订单流水号,打印条目状态标志为订单状态。
优选地,打印机发送的请求数据还可以包括设备报告数据,设备报告数据包括打印机的标识和打印机的状态标志,打印机通过设备报告数据向网络服务器报告打印机的状态,其中,打印机的标识可以为打印机ID。
步骤S102,打印机接收网络服务器返回的请求响应数据
网络服务器根据预先设定的协议,基于打印机请求的待打印条目的打印数据按照预定格式生成订单请求响应数据,打印机接收网络服务器返回的请求响应数据。
优选地,为了使打印机方便地识别出请求响应数据中是否存在待打印条目的打印数据,请求响应数据中可以包括第一标志,第一标志用于表示网络服务器的数据库中是否存在打印机的待打印条目,打印机在接收请求响应数据之后,网络打印控制方法还包括:打印机从请求响应数据中获取第一标志;打印机根据第一标志的值判断请求响应数据中是否包含待打印条目的打印数据,其中,打印机在根据第一标志的值判断出请求响应数据中包含待打印条目的打印数据时,从请求响应数据中解析得到待打印条目的打印数据。
优选地,为了使打印机更全面地了解网络服务器中存储的待打印条目的情况,请求响应数据中还可以包括第二标志,第二标志用于表示除当前要打印的待打印条目外网络服务器的数据库中是否还存在其他该打印机的待打印条目,打印机在接收请求响应数据之后,网络打印控制方法还包括:打印机从请求响应数据中获取第二标志;打印机根据第二标志的值判断除当前要打印的待打印条目外网络服务器的数据库中是否还存在其他该打印机的待打印条目,其中,打印机在根据第二标志的值判断出除当前要打印的待打印条目外网络服务器的数据库中还存在其他该打印机的待打印条目时,继续发送请求数据,打印机在根据第二标志的值判断出除当前要打印的待打印条目外 网络服务器的数据库中不存在其他该打印机的待打印条目时,先等待预设间隔时间,然后继续发送请求数据。
步骤S103,打印机解析请求响应数据,得到待打印条目的打印数据。
打印机由请求响应数据解析得到用于打印的待打印条目的打印数据。
步骤S104,打印机对待打印条目的打印数据进行打印。
图6是根据本发明第二实施例的网络打印控制方法的流程图。在该实施例中,通过网络服务器进行网络打印控制。如图6所示,该实施例的网络打印控制方法包括:
步骤S201,网络服务器接收打印机发送的请求数据,其中,请求数据包括网络服务标识,网络服务标识为打印机所属的网络服务主体的标识。
该实施例中的请求数据可以为图5所示实施例中的请求数据。
步骤S202,网络服务器根据打印机发送的请求数据查询该打印机的待打印条目并基于待打印条目生成请求响应数据。
网络服务器根据打印机发送的请求数据中所包括的网络服务标识查询打印条目数据库,判断打印条目数据库中是否存在与网络服务标识对应的待打印条目,从而判断打印条目数据库中是否存在可以使用该打印机进行打印的待打印条目,即是否存在该打印机的待打印条目。
该实施例中的请求响应数据可以为图5所示实施例中的请求响应数据。
步骤S203,网络服务器将请求响应数据发送至打印机。
网络服务器将请求响应数据发送至打印机,以使打印机可以解析请求响应数据,得到待打印条目的打印数据,并对待打印条目的打印数据进行打印。
图7是根据本发明第三实施例的网络打印控制方法的流程图,该实施例可以作为上述第一实施例或第二实施例的优选实施例。在该实施例中,以打印订单为例对本发明实施例的网络打印控制方法进行描述,相应地,对于打印订单的实施例而言,请求数据为订单请求数据,请求响应数据为订单请求响应数据,网络服务标识为商户ID,打印条目流水号为订单流水号,打印条目状态标志为订单状态标志,打印条目为订单等等。需要说明的是,本发明实施例的网络打印控制方法并不限于对订单的打印,也可以用于对其他打印条目的打印。
在本发明实施例的网络打印***中,网络服务器和打印机通过互联网建立网络连接,在该实施例中,打印机每间隔预设时间主动向网络服务器请求订单数据,网络服务器对打印机发送的订单请求进行响应,如图所示,该方法包括以下步骤:
步骤S301,打印机向网络服务器发送订单请求数据
打印机向网络服务器发送订单请求数据,以请求网络服务器向其发送订单数据,其中,打印机发送的订单请求数据包括商户ID,商户ID是网络服务器的运营商为打印机所属商户分配的唯一编号,由商户预先存储在打印机内部的存储器中。优选地,打印机内部的存储器中存储有配置文件,打印机上电后,读取该配置文件,配置文件中包含网络服务器的地址、打印机ID、商户ID、打印机IP地址、打印机MAC地址等信息,其中,网络服务器的地址、商户ID是由商户在购买打印机后写入到配置文件中的。打印机获取配置文件中的各项内容,根据网络服务器的地址向网络服务器发送订单请求数据。
步骤S302,网络服务器接收到打印机发送的订单请求数据后查询订单数据库,并根据查询结果向打印机发送订单请求响应数据
如上所述,网络服务器包括订单数据库,订单数据库用于存储消费者通过客户终端发送的订单的信息。网络服务器接收到打印机发送的订单请求数据后,解析订单请求数据并获取商户ID,然后根据该商户ID查询订单数据库,确定订单数据库中是否存在与该商户ID对应的未打印订单,即确定订单数据库中是否存在可以使用发送订单请求数据的打印机打印的订单。网络服务器根据订单数据库的查询结果设置第一标志,其中,第一标志用于表示订单数据库中是否存在可以使用发送订单请求数据的打印机打印的订单,比如,当订单数据库中存在可以使用发送订单请求数据的打印机打印的订单时,设置第一标志的值为1;当订单数据库中不存在可以使用发送订单请求数据的打印机打印的订单时,设置第一标志的值为0。
网络服务器根据预先设定的协议,按照预定格式生成订单请求响应数据,其中,订单请求响应数据包括第一标志,当订单数据库中存在可以使用发送订单请求数据的打印机打印的订单时,订单请求响应数据还包括订单数据,该订单数据为在订单数据库中查询到的要使用发送订单请求数据的打印机打印的订单的订单数据,比如,对于网络点餐业务,该订单数据包括食品名称及数量。生成订单请求响应数据后,网络服务器向发送订单请求数据的打印机发送该订单请求响应数据。
步骤S303,打印机解析网络服务器发送的订单请求响应数据,当订单请求响应数据中包含订单数据时,打印机打印订单数据
当打印机接收到网络服务器发送的订单请求响应数据时,根据预先设定的协议解析订单请求响应数据。打印机获取订单请求响应数据中的第一标志,根据第一标志的值判断网络服务器的订单数据库中是否存在可以使用该打印机打印的订单,也即,订单请求响应数据中是否包含要打印的订单数据,当判定订单请求响应数据中包含要打印的订单数据时,打印机获取订单请求响应数据中的订单数据,并打印该订单数据。
需要说明的是,打印机执行完订单数据打印后,等待预设时间后再次执行步骤S301,即继续向网络服务器发送下一条订单请求数据。当打印机通过第一标志的值判定网络服务器的订单数据库中不存在可以使用该打印机打印的订单时,也即,订单请求响应数据中不包含要打印的订单数据时,打印机等待预设时间后再次执行步骤S301。
本实施例中,打印机基于商户ID向网络服务器发送订单请求数据,网络服务器基于商户ID查询订单数据库,并根据查询结果向打印机发送订单数据以使打印机打印订单数据。通过本实施例的网络打印***及其打印控制方法,商户无需配置PC机,当网络服务器接收到打印机发送的订单请求数据时直接将客户终端发送的相应订单数据发送给打印机以使打印机打印订单数据,本发明提供的网络打印***及其打印控制方法应用到网络点餐业务,可以解决现有技术的网络点餐***中存在的增加商户运营成本的问题。
图8是根据本发明第四实施例的网络打印控制方法的流程图,该实施例的方法可以是图7所示打印控制方法的一种优选实施方式。如图所示,该方法包括以下步骤:
步骤S401,打印机向网络服务器发送交互请求数据以向网络服务器报告订单状态及请求订单数据
打印机向网络服务器发送交互请求数据,以向网络服务器报告订单状态及请求订单数据。交互请求数据包括商户ID和订单报告数据,其中,订单报告数据包括订单流水号和订单状态标志。
当打印机本次发送交互请求数据前打印机执行了订单数据打印时,订单流水号为打印机本次发送交互请求数据前所打印的订单的订单流水号,订单状态标志用于表示与该订单流水号对应的订单数据是否打印成功,比如,当订单状态标志的值为1时,表示与该订单流水号对应的订单数据打印成功,当订单状态标志的值为0时,表示与该订单流水号对应的订单数据打印失败;当打印机本次发送交互请求数据前打印机没有执行订单数据打印时,比如,打印机刚刚上电时,或打印机上次发送交互请求数据后网络服务器发送的交互请求响应数据不包含要打印的订单数据时,订单流水号和订 单状态标志为预先设定的无效值,或者订单流水号为打印机所打印的最后一条订单的订单流水号,订单状态标志用于表示与该订单流水号对应的订单数据是否打印成功。
步骤S402,网络服务器解析接收到的交互请求数据并更新订单数据库
网络服务器接收到打印机发送的交互请求数据后,根据预先设定的协议解析交互请求数据,获取商户ID及订单报告数据。其中,当订单报告数据的订单流水号和订单状态标志为预先设定的无效值时,网络服务器无需更新订单数据库;当订单报告数据的订单流水号和订单状态标志为有效值时,网络服务器根据订单报告数据中的订单流水号查询订单数据库中的相应订单,并根据订单报告数据中的订单状态标志更新该订单的订单状态,将该条订单的订单状态设置为打印成功状态或打印失败状态。
步骤S403,网络服务器查询订单数据库,并根据查询结果向打印机发送交互请求响应数据
网络服务器根据步骤S402所获取的商户ID查询订单数据库,确定订单数据库中是否存在与该商户ID对应的订单,当订单数据库中存在与该商户ID对应的订单时,根据订单的订单状态确定是否可以使用发送交互请求数据的打印机打印该订单。具体方式为,网络服务器从订单数据库的起始地址开始逐条查询各条订单,当查询到与该商户ID对应的订单且其订单状态为未打印状态或打印失败状态时,网络服务器停止订单数据库查询,确定订单数据库中存在可以使用发送交互请求数据的打印机打印的订单;当网络服务器查询完订单数据库中存储的所有订单,没有查询到与该商户ID对应的订单,或者查询到与该商户ID对应的订单但其订单状态为打印成功时,网络服务器确定订单数据中不存在可以使用发送交互请求数据的打印机打印的订单。
网络服务器根据查询结果设置第一标志,并根据预先设定的协议,按照预定格式生成交互请求响应数据,其中,交互请求响应数据包括第一标志,当订单数据库中存在可以使用发送交互请求数据的打印机打印的订单时,交互请求响应数据还包括要打印的订单的订单流水号和订单数据。生成交互请求响应数据后,网络服务器向发送交互请求数据的打印机发送该交互请求响应数据。
步骤S404,打印机解析接收到的交互请求响应数据,判断交互请求响应数据中是否包含要打印的订单数据
打印机接收到网络服务器发送的交互请求响应数据后,根据预先设定的协议解析交互请求响应数据。打印机获取交互请求响应数据中的第一标志,根据第一标志的值判断网络服务器的订单数据库中是否存在可以使用该打印机打印的订单,也即,交互 请求响应数据中是否包含要打印的订单数据,当判定交互请求响应数据中包含要打印的订单数据时,执行步骤S405;当判定交互请求响应数据中不包含有要打印的订单数据时,执行步骤S406。
步骤S405,打印机打印订单数据并设置订单状态标志
当打印机通过第一标志判定交互请求响应数据中包含要打印的订单数据时,打印机获取要打印的订单的订单流水号和订单数据,并打印订单数据,打印机根据该订单数据的打印完成情况设置订单状态标志,比如,当完成订单数据打印后,打印机设置订单状态标志的值为1,表示订单数据打印成功,当打印过程中打印机出现异常(如缺纸)导致无法完成订单数据打印时,打印机设置订单状态标志的值为0,表示订单数据打印失败。优选地,打印机运行过程中监测打印机的状态,打印机打印订单数据前判断打印机状态是否正常,当打印机状态异常时,打印机将订单状态标志的值设置为表示订单数据打印失败的值,比如,设置订单状态标志的值为0。
步骤S406,打印机等待预设间隔时间
打印机等待预设间隔时间,继续执行步骤S401,即根据商户ID及执行步骤S404和步骤S405后的订单流水号和订单状态标志,向网络服务器发送下一条交互请求数据以向网络服务器报告订单状态及请求订单数据。
本实施例中,打印机向网络服务器报告订单状态以报告订单的打印完成情况,网络服务器根据打印机报告的订单状态更新订单数据库中相应订单的订单状态。通过本实施例,网络服务器在打印机打印订单数据失败时可以将该订单数据重新发送给相应的打印机进行打印,避免了丢单现象的发生,保证了订单打印的完整性。
图9是根据本发明第五实施例的网络打印控制方法的流程图,该实施例的方法可以是图7所示打印控制方法的一种优选实施方式。如图所示,该方法包括以下步骤:
步骤S501,打印机向网络服务器发送交互请求数据以向网络服务器报告状态及请求订单数据
打印机向网络服务器发送交互请求数据以向网络服务器报告状态及请求订单数据,其中,报告状态包括报告设备状态和报告订单状态。交互请求数据包括商户ID、设备报告数据和订单报告数据,其中,设备报告数据包括打印机ID、打印机状态标志,订单报告数据包括订单流水号和订单状态标志。
打印机ID是唯一的设备编号,由打印机制造商在打印机出厂时分配。优选地,当打印机首次接入网络打印***时打印机向网络服务器请求注册,网络服务器注册该打印机并将该打印机的信息存储在其设备数据库中。具体注册过程为:打印机读取预先存储在打印机内部的存储器中的配置文件,获取配置文件中的网络服务器的地址、打印机ID、商户ID、打印机IP地址、打印机MAC地址等信息。打印机根据网络服务器的地址向网络服务器发送设定格式的注册请求数据,注册请求数据包括打印机ID、商户ID、打印机IP地址、打印机MAC地址等信息,网络服务器接收到注册请求数据后根据预先设定的协议解析该注册请求数据,并根据注册请求数据的格式是否正确及完整判断请求注册的打印机是否合法,如果打印机合法,网络服务器将打印机ID、商户ID、打印机IP地址、打印机MAC地址等信息存储在其设备数据库中,并向打印机返回注册成功的信息;如果打印机不合法,向打印机返回注册失败的信息。
表2
打印机ID 商户ID 打印机IP地址 打印机MAC地址 打印机状态
P0001 M 001 192.168.255.1 F0-4D-A2-29-B8-4D 正常
P0002 M 020 192.168.24.2 00-0B-2F-19-D3-E0 正常
P0003 M 006 192.168.45.30 F8-0D-E2-3D-5F-80 缺纸
…… …… …… …… ……
表2示出了本发明一实施例的网络服务器的设备数据库中存储的打印机信息,如该表所示,网络服务器的设备数据库中存储有若干台打印机的信息,每台打印机的信息包括打印机ID、商户ID、打印机IP地址、打印机MAC地址等内容。每台打印机首次接入网络打印***并向网络服务器请求注册时,网络服务器将该打印机的相关信息存储到设备数据库中。进一步地,设备数据库中存储的每台打印机的信息还包括打印机状态,打印机状态用于指示该打印机处于正常状态或异常状态,其中,异常状态包括缺纸状态、上盖打开状态、机械错误状态等。
打印机运行过程中监测打印机的状态,并根据打印机的状态变化更改打印机状态标志,打印机向网络服务器发送交互请求数据前,读取商户ID、打印机ID、打印机状态标志、订单流水号、订单状态标志,根据预先设定的协议生成交互请求数据。打印机向网络服务器发送交互请求数据以向网络服务器报告打印机状态、订单状态,以及向网络服务器请求订单数据。
步骤S502,网络服务器解析接收到的交互请求数据并更新设备数据库和订单数据库
如上所述,网络服务器包括设备数据库和订单数据库,其中,设备数据库用于存储接入到网络打印***的打印机的信息,订单数据库用于存储消费者通过客户终端发送的订单的信息。网络服务器接收到打印机发送的交互请求数据后,根据预先设定的协议解析交互请求数据,获取商户ID、设备报告数据和订单报告数据。
网络服务器首先根据设备报告数据中的打印机ID查询设备数据库,查询到与该打印机ID对应的打印机的信息后,根据设备报告数据中的打印机状态标志更新该打印机的打印机状态;然后根据订单报告数据中的订单流水号和订单状态标志更新订单数据库。
步骤S503,网络服务器判断发送交互请求数据的打印机是否处于正常状态
网络服务器根据设备报告数据中的打印机状态标志判断发送交互请求数据的打印机是否处于正常状态,比如,当打印机状态标志的值为1时,判定打印机处于正常状态;否则,判定打印机处于异常状态。当判定发送交互请求数据的打印机处于正常状态时,网络服务器执行步骤S504,否则,执行步骤S505。
步骤S504,网络服务器查询订单数据库,并设置第一标志和第二标志
当判定发送交互请求数据的打印机处于正常状态时,网络服务器根据商户ID查询订单数据库,确定订单数据库中是否存在可以使用发送交互请求数据的打印机打印的订单。具体方式为,网络服务器基于获取的商户ID从订单数据库的起始地址开始逐条查询各条订单,当查询到第一条与该商户ID对应的订单且其打印状态为未打印状态或打印失败状态时,设置第一标志以表明订单数据库中存在可以使用发送交互请求数据的打印机打印的订单,比如,设置第一标志的值为1;网络服务器继续进行订单数据库查询,当查询到第二条与该商户ID对应的订单且其打印状态为未打印状态或打印失败状态时,设置第二标志以表明除当前要打印的订单外订单数据库中还存在其他可以使用发送交互请求数据的打印机打印的订单,比如,设置第二标志的值为1,此时,网络服务器停止订单数据库查询;当网络服务器查询完订单数据库中存储的所有订单,没有查询到与该商户ID对应的订单,或者查询到与该商户ID对应的订单但其订单状态为打印成功状态时,设置第一标志以表明订单数据库中不存在可以使用发送交互请求数据的打印机打印的订单,比如,设置第一标志的值为0,此时,网络服务器设置第二标志的值为预先设定的无效值,或者设置第二标志的值以表明订单数据库中不存在其他可以使用发送交互请求数据的打印机打印的订单,比如,设置第二标志的值为0;当网络服务器查询完订单数据库中存储的所有订单,仅查询到一条与该商户ID对应的订单且其打印状态为未打印状态或打印失败状态时,设置第二标志以表明除当前 要打印的订单外订单数据库中不存在其他可以使用发送交互请求数据的打印机打印的订单,比如,设置第二标志的值为0。
步骤S505,网络服务器设置第一标志和第二标志
当判定发送交互请求数据的打印机处于异常状态时,网络服务器无需查询订单数据库,直接设置第一标志以表明订单数据库中不存在可以使用发送交互请求数据的打印机打印的订单,比如,设置第一标志的值为0,网络服务器设置第二标志的值为预先设定的无效值,或者设置第二标志的值以表明订单数据库中不存在其他可以使用发送交互请求数据的打印机打印的订单,比如,设置第二标志的值为0。
步骤S506,网络服务器向打印机发送订单请求响应数据
网络服务器根据预先设定的协议,按照预定格式生成交互请求响应数据,其中,交互请求响应数据包括第一标志、第二标志,当订单数据库中存在可以使用发送交互请求数据的打印机打印的订单时,交互请求响应数据还包括要打印的订单的订单流水号和订单数据,其中,当网络服务器在订单数据库中查询到两条可以使用发送交互请求数据的打印机打印的订单时,即除当前要打印的订单外订单数据库中还存在其他可以使用发送交互请求数据的打印机打印的订单时,要打印的订单为在订单数据库中查询到的第一条订单。生成交互请求响应数据后,网络服务器向发送交互请求数据的打印机发送该交互请求响应数据。
步骤S507,打印机解析接收到的交互请求响应数据,根据第一标志判断交互请求响应数据中是否包含要打印的订单数据
打印机接收到网络服务器发送的交互请求响应数据后,根据预先设定的协议解析交互请求响应数据。打印机获取交互请求响应数据中的第一标志和第二标志,根据第一标志的值判断交互请求响应数据中是否包含要打印的订单数据,当判定交互请求响应数据中包含要打印的订单数据时,执行步骤S508;当判定交互请求响应数据中不包含有要打印的订单数据时,执行步骤S510。
步骤S508,打印机打印订单数据并设置订单状态标志
该步骤同步骤S405。
步骤S509,打印机根据第二标志判断订单数据库中是否还存在其他可以使用该打印机打印的订单
打印机根据步骤S507中获取的第二标志的值判断除当前打印的订单外订单数据库中是否还存在其他可以使用该打印机打印的订单,当判定订单数据库中还存在其他可以使用该打印机打印的订单时,执行步骤S501,即根据商户ID、打印机ID、打印机状态标志及执行步骤S507和步骤S508后的订单流水号和订单状态标志,立即向网络服务器发送下一条交互请求数据以向网络服务器报告状态及请求订单数据;当判定订单数据库中不存在其他可以使用该打印机打印的订单时,执行步骤S510。
步骤S510,打印机等待预设间隔时间
打印机等待预设间隔时间,继续执行步骤S501,即根据商户ID、打印机ID、打印机状态标志及执行步骤S507和步骤S508后的订单流水号和订单状态标志,向网络服务器发送下一条交互请求数据以向网络服务器报告状态及请求订单数据。
本实施例中,当判定打印机处于异常状态时网络服务器不进行订单数据库的查询,当判定打印机处于正常状态时基于打印机发送的商户ID进行订单数据库查询并向打印机返回除当前要打印的订单外网络服务器的订单数据库中是否还存在其他可以使用该打印机打印的订单,当网络服务器的订单数据库中还存在其他可以使用该打印机打印的订单时,打印机打印完当前订单数据打印后立即发送下一条交互请求数据。通过本实施例,提高了网络打印***的工作效率。
需要说明的是,在附图的流程图示出的步骤可以在诸如一组计算机可执行指令的计算机***中执行,并且,虽然在流程图中示出了逻辑顺序,但是在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤。
本发明实施例还提供了一种打印机,该打印机可以为用于本发明实施例的网络打印***或者网络打印控制方法中的打印机,该打印机中设置有处理器,该处理器可以用于执行本发明实施例的网络打印控制方法,图10是根据本发明实施例的打印机的示意图。如图10所示,该打印机包括发送单元31,接收单元32,解析单元33和打印单元34。
发送单元31,用于向网络服务器发送请求数据,其中,请求数据包括网络服务标识,网络服务标识为打印机所属的网络服务主体的标识,打印机通过发送请求数据请求网络服务器查询该打印机的待打印条目。该发送单元31可以执行前述实施例中打印机发送请求数据的相关步骤,相关内容在此不再赘述。
接收单元32,用于接收网络服务器返回的请求响应数据。该接收单元32可以执行前述实施例中打印机接收响应请求数据的相关步骤,相关内容在此不再赘述。
解析单元33,用于解析请求响应数据,得到待打印条目的打印数据。该解析单元33可以执行前述实施例中打印机解析请求响应数据的相关步骤,相关内容在此不再赘述。
打印单元34,用于对待打印条目的打印数据进行打印。该打印单元34可以执行前述实施例中打印机执行打印的相关步骤,相关内容在此不再赘述。
在本发明实施例中,发送单元31和接收单元32用于实现打印机和网络服务器之间的通信,可以通过打印机的通信单元实现。打印机的控制器用于执行数据的处理功能,例如,数据的解析,因而,解析单元33可以通过打印机的控制器实现。
图11是根据本发明实施例的网络服务器的示意图。该网络服务器可以为用于本发明实施例的网络打印***或者网络打印控制方法中的网络服务器,该网络服务器中设置有处理器,该处理器可以用于执行本发明实施例的网络打印控制方法,图11是根据本发明实施例的网络服务器的示意图。如图11所示,该网络服务器包括接收单元21,生成单元22和发送单元23。
接收单元21,用于接收打印机发送的请求数据,其中,请求数据包括网络服务标识,网络服务标识为打印机所属的网络服务主体的标识。该接收单元21可以执行前述实施例中网络服务器接收请求数据的相关步骤,相关内容在此不再赘述。
生成单元22,用于根据打印机发送的请求数据查询该打印机的待打印条目并基于待打印条目生成请求响应数据。该生成单元22可以执行前述实施例中网络服务器生成请求响应数据的相关步骤,相关内容在此不再赘述。
发送单元23,用于将请求响应数据发送至打印机。该发送单元23可以执行前述实施例中网络服务器发送请求响应数据的相关步骤,相关内容在此不再赘述。
显然,本领域的技术人员应该明白,上述的本发明的各单元或各步骤可以用通用的计算装置来实现,它们可以集中在单个的计算装置上,或者分布在多个计算装置所组成的网络上,可选地,它们可以用计算装置可执行的程序代码来实现,从而,可以将它们存储在存储装置中由计算装置来执行,或者将它们分别制作成各个集成电路模块,或者将它们中的多个单元或步骤制作成单个集成电路模块来实现。这样,本发明不限制于任何特定的硬件和软件结合。
在本发明实施例提供的网络打印***中,打印机用于向网络服务器发送请求数据,接收网络服务器返回的请求响应数据,解析请求响应数据,得到待打印条目的打印数 据,以及对待打印条目的打印数据进行打印,其中,请求数据包括网络服务标识,网络服务标识为打印机所属的网络服务主体的标识,打印机通过发送请求数据请求网络服务器查询该打印机的待打印条目;网络服务器用于接收打印机发送的请求数据,根据打印机发送的请求数据查询该打印机的待打印条目并基于待打印条目生成请求响应数据,以及将请求响应数据发送至打印机,从而无需再设置PC机,降低了网络打印***中的设备成本。
以上所述仅为本发明的优选实施例而已,并不用于限制本发明,对于本领域的技术人员来说,本发明可以有各种更改和变化。凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。

Claims (16)

  1. 一种网络打印控制方法,其特征在于,包括:
    打印机向网络服务器发送请求数据,其中,所述请求数据包括网络服务标识,所述网络服务标识为所述打印机所属的网络服务主体的标识,所述打印机通过发送所述请求数据请求所述网络服务器查询所述打印机的待打印条目;
    所述打印机接收所述网络服务器返回的请求响应数据;
    所述打印机解析所述请求响应数据,得到所述待打印条目的打印数据;以及
    所述打印机对所述待打印条目的打印数据进行打印。
  2. 根据权利要求1所述的网络打印控制方法,其特征在于,所述请求响应数据包括第一标志,所述第一标志用于表示所述网络服务器的数据库中是否存在所述打印机的待打印条目,所述打印机在接收所述请求响应数据之后,所述网络打印控制方法还包括:
    所述打印机从所述请求响应数据中获取所述第一标志;以及
    所述打印机根据所述第一标志的值判断所述请求响应数据中是否包含所述待打印条目的打印数据,
    其中,所述打印机在根据所述第一标志的值判断出所述请求响应数据中包含所述待打印条目的打印数据时,从所述请求响应数据中解析得到所述待打印条目的打印数据。
  3. 根据权利要求1所述的网络打印控制方法,其特征在于,所述请求响应数据包括第二标志,所述第二标志用于表示除当前要打印的待打印条目外所述网络服务器的数据库中是否还存在其他所述打印机的待打印条目,所述打印机在接收所述请求响应数据之后,所述网络打印控制方法还包括:
    所述打印机从所述请求响应数据中获取所述第二标志;以及
    所述打印机根据所述第二标志的值判断除当前要打印的待打印条目外所述网络服务器的数据库中是否还存在其他所述打印机的待打印条目,
    其中,所述打印机在根据所述第二标志的值判断出除当前要打印的待打印条目外所述网络服务器的数据库中还存在其他所述打印机的待打印条目时,继 续发送所述请求数据,所述打印机在根据所述第二标志的值判断出除当前要打印的待打印条目外所述网络服务器的数据库中不存在其他所述打印机的待打印条目时,先等待预设间隔时间,然后继续发送所述请求数据。
  4. 根据权利要求1所述的网络打印控制方法,其特征在于,所述请求数据还包括打印条目报告数据,所述打印条目报告数据包括打印条目流水号和打印条目状态标志,其中,所述打印条目流水号为所述打印机本次发送所述请求数据前所打印的打印条目的流水号,所述打印条目状态标志用于表示与所述打印条目流水号对应的打印条目是否打印成功。
  5. 根据权利要求1所述的网络打印控制方法,其特征在于,所述打印机发送的所述请求数据还包括设备报告数据,所述设备报告数据包括所述打印机的标识和所述打印机的状态标志,所述打印机通过所述设备报告数据向所述网络服务器报告所述打印机的状态。
  6. 一种网络打印控制方法,其特征在于,包括:
    网络服务器接收打印机发送的请求数据,其中,所述请求数据包括网络服务标识,所述网络服务标识为所述打印机所属的网络服务主体的标识;
    所述网络服务器根据所述打印机发送的所述请求数据查询所述打印机的待打印条目并基于所述待打印条目生成请求响应数据;以及
    所述网络服务器将所述请求响应数据发送至所述打印机。
  7. 根据权利要求6所述的网络打印控制方法,其特征在于,所述请求响应数据包括第一标志,所述第一标志用于表示所述网络服务器的数据库中是否存在所述打印机的待打印条目,所述网络服务器根据所述打印机发送的所述请求数据查询所述打印机的待打印条目并基于所述待打印条目生成请求响应数据包括:
    所述网络服务器根据所述网络服务标识查询打印条目数据库;
    所述网络服务器判断所述打印条目数据库中是否存在与所述网络服务标识对应的待打印条目以判断所述打印条目数据库中是否存在所述打印机的待打印条目;
    所述网络服务器在判断出所述打印条目数据库中存在所述打印机的待打印条目时,设置所述第一标志的值为第一值,在判断出所述打印条目数据库中不存在所述打印机的待打印条目时,设置所述第一标志的值为第二值;以及
    所述网络服务器生成所述请求响应数据,所述请求响应数据包括所述第一标志,在所述打印条目数据库中存在所述打印机的待打印条目时,所述请求响应数据还包括所述待打印条目的打印数据。
  8. 根据权利要求6所述的网络打印控制方法,其特征在于,所述请求响应数据包括第二标志,所述第二标志用于表示除当前要打印的待打印条目外所述网络服务器的数据库中是否还存在其他所述打印机的待打印条目,所述网络服务器根据所述打印机发送的所述请求数据查询所述打印机的待打印条目并基于所述待打印条目生成请求响应数据包括:
    所述网络服务器根据所述网络服务标识查询打印条目数据库;
    所述网络服务器判断除当前要打印的待打印条目外所述打印条目数据库中是否还存在其他所述打印机的待打印条目;
    所述网络服务器在判断出除当前要打印的待打印条目外所述打印条目数据库中还存在其他所述打印机的待打印条目时,设置所述第二标志的值为第一值,在判断出除当前要打印的待打印条目外所述打印条目数据库中不存在其他所述打印机的待打印条目时,设置所述第二标志的值为第二值;以及
    所述网络服务器生成所述请求响应数据,所述请求响应数据包括所述第二标志。
  9. 根据权利要求6所述的网络打印控制方法,其特征在于,所述请求数据还包括打印条目报告数据,所述打印条目报告数据包括打印条目流水号和打印条目状态标志,其中,所述打印条目流水号为所述打印机本次发送所述请求数据前所打印的打印条目的流水号,所述打印条目状态标志用于表示与所述打印条目流水号对应的打印条目是否打印成功,所述网络服务器在接收所述请求数据之后,所述网络打印控制方法还包括:
    所述网络服务器根据所述打印条目流水号和所述打印条目状态标志更新打印条目数据库。
  10. 根据权利要求6所述的网络打印控制方法,其特征在于,所述请求数据还包括设备报告数据,所述设备报告数据包括所述打印机的标识和所述打印机的状态标志,在所述网络服务器接收所述请求数据之后,所述网络打印控制方法还包括:
    所述网络服务器根据所述设备报告数据判断所述打印机是否处于正常状态;
    所述网络服务器在判断出所述打印机处于异常状态时不执行打印条目的查询;以及
    所述网络服务器在判断出所述打印机处于正常状态时执行打印条目的查询。
  11. 一种打印机,其特征在于,包括:
    发送单元,用于向网络服务器发送请求数据,其中,所述请求数据包括网络服务标识,所述网络服务标识为所述打印机所属的网络服务主体的标识,所述打印机通过发送所述请求数据请求所述网络服务器查询所述打印机的待打印条目;
    接收单元,用于接收所述网络服务器返回的请求响应数据;
    解析单元,用于解析所述请求响应数据,得到所述待打印条目的打印数据;以及
    打印单元,用于对所述待打印条目的打印数据进行打印。
  12. 一种打印机,其特征在于,包括:
    通信单元,用于向网络服务器发送请求数据并接收所述网络服务器返回的请求响应数据,其中,所述请求数据包括网络服务标识,所述网络服务标识为所述打印机所属的网络服务主体的标识,所述打印机通过发送所述请求数据请求所述网络服务器查询所述打印机的待打印条目;
    控制器,用于解析所述请求响应数据,得到所述待打印条目的打印数据;以及
    打印单元,用于对所述待打印条目的打印数据进行打印。
  13. 根据权利要求12所述的打印机,其特征在于,所述请求响应数据包括第一标志,所述第一标志用于表示所述网络服务器的数据库中是否存在所述打印机的待打印条目,所述控制器还用于从所述请求响应数据中获取所述第一标志,根据所述第一标志的值判断所述请求响应数据中是否包含所述待打印条目的打印数据,以及在根据所述第一标志的值判断出所述请求响应数据中包含所述待打印条目的打印数据时,从所述请求响应数据中解析得到所述待打印条目的打印数据。
  14. 根据权利要求12所述的网络打印控制方法,其特征在于,所述请求响应数据包括第二标志,所述第二标志用于表示除当前要打印的待打印条目外所述网络服务器的数据库中是否还存在其他所述打印机的待打印条目,所述控制器还用于从所述请求响应数据中获取所述第二标志,根据所述第二标志的值判断除当前要打印的待打印条目外所述网络服务器的数据库中是否还存在其他所述打印机的待打印条目,以及在根据所述第二标志的值判断出除当前要打印的待打印条目外所述网络服务器的数据库中还存在其他所述打印机的待打印条目时,继续控制所述通信单元发送所述请求数据,在根据所述第二标志的值判断出除当前要打印的待打印条目外所述网络服务器的数据库中不存在其他所述打印机的待打印条目时,先等待预设间隔时间,然后再控制所述通信单元继续发送所述请求数据。
  15. 一种网络服务器,其特征在于,包括:
    接收单元,用于接收打印机发送的请求数据,其中,所述请求数据包括网络服务标识,所述网络服务标识为所述打印机所属的网络服务主体的标识;
    生成单元,用于根据所述打印机发送的所述请求数据查询所述打印机的待打印条目并基于所述待打印条目生成请求响应数据;以及
    发送单元,用于将所述请求响应数据发送至所述打印机。
  16. 一种网络打印***,其特征在于,包括打印机和网络服务器,其中:
    所述打印机用于向网络服务器发送请求数据,接收所述网络服务器返回的请求响应数据,解析所述请求响应数据,得到待打印条目的打印数据,以及对所述待打印条目的打印数据进行打印,其中,所述请求数据包括网络服务标识,所述网络服务标识为所述打印机所属的网络服务主体的标识,所述打印机通过发送所述请求数据请求所述网络服务器查询所述打印机的待打印条目,
    所述网络服务器用于接收打印机发送的请求数据,根据所述打印机发送的所述请求数据查询所述打印机的待打印条目并基于所述待打印条目生成请求响应数据,以及将所述请求响应数据发送至所述打印机。
PCT/CN2015/080329 2014-06-10 2015-05-29 网络打印控制方法和***及打印机和网络服务器 WO2015188703A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201410255161.5 2014-06-10
CN201410255161.5A CN105224264B (zh) 2014-06-10 2014-06-10 网络打印控制方法和***及打印机和网络服务器

Publications (1)

Publication Number Publication Date
WO2015188703A1 true WO2015188703A1 (zh) 2015-12-17

Family

ID=54832891

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/080329 WO2015188703A1 (zh) 2014-06-10 2015-05-29 网络打印控制方法和***及打印机和网络服务器

Country Status (2)

Country Link
CN (1) CN105224264B (zh)
WO (1) WO2015188703A1 (zh)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106327304A (zh) * 2016-08-26 2017-01-11 北京小度信息科技有限公司 订单处理方法、装置及***
CN107845008B (zh) * 2016-09-21 2022-03-29 北京星选科技有限公司 信息接收控制方法及装置
CN106547499B (zh) * 2016-11-04 2019-05-28 南京富士通电子信息科技股份有限公司 一种控制打印机状态返回的方法
CN107730772A (zh) * 2017-05-04 2018-02-23 西安艾润物联网技术服务有限责任公司 可实现***自助打印的打印机及中心服务端
CN108255444A (zh) * 2018-02-09 2018-07-06 上海宝尊电子商务有限公司 一种基于iOS移动设备的通用WIFI打印方法及***
CN117931106B (zh) * 2024-03-20 2024-05-24 珠海芯烨电子科技有限公司 基于边缘计算的云打印机数据处理方法以及相关装置

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101061457A (zh) * 2004-08-02 2007-10-24 精工爱普生株式会社 输出***,输出数据管理装置,网络设备,输出数据管理程序,输出程序和输出方法
CN101106631A (zh) * 2007-08-02 2008-01-16 郑巍华 自助冲印设备通过网络打印照片的方法和***
CN102375934A (zh) * 2011-09-30 2012-03-14 宋旭东 平板电脑点菜及广告联播***
CN103389886A (zh) * 2013-07-23 2013-11-13 深圳市知正科技有限公司 一种混合云架构商家自动打印订单***
CN103646477A (zh) * 2013-11-14 2014-03-19 成都博约创信科技有限责任公司 一种基于云平台的微结算***及方法

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7389414B2 (en) * 2001-11-09 2008-06-17 Brother Kogyo Kabushiki Kaisha Printing system
JP2005244656A (ja) * 2004-02-26 2005-09-08 Matsushita Electric Ind Co Ltd 複合機
JP2007257552A (ja) * 2006-03-24 2007-10-04 Ricoh Co Ltd 印刷ログ及び印刷データ保存によるセキュリティ管理システム
JP2011170818A (ja) * 2010-02-22 2011-09-01 Canon Inc 印刷システム、及び制御方法
JP2013205968A (ja) * 2012-03-27 2013-10-07 Sharp Corp サーバシステム、印刷システム、およびプリンタ

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101061457A (zh) * 2004-08-02 2007-10-24 精工爱普生株式会社 输出***,输出数据管理装置,网络设备,输出数据管理程序,输出程序和输出方法
CN101106631A (zh) * 2007-08-02 2008-01-16 郑巍华 自助冲印设备通过网络打印照片的方法和***
CN102375934A (zh) * 2011-09-30 2012-03-14 宋旭东 平板电脑点菜及广告联播***
CN103389886A (zh) * 2013-07-23 2013-11-13 深圳市知正科技有限公司 一种混合云架构商家自动打印订单***
CN103646477A (zh) * 2013-11-14 2014-03-19 成都博约创信科技有限责任公司 一种基于云平台的微结算***及方法

Also Published As

Publication number Publication date
CN105224264B (zh) 2019-06-04
CN105224264A (zh) 2016-01-06

Similar Documents

Publication Publication Date Title
WO2015188703A1 (zh) 网络打印控制方法和***及打印机和网络服务器
US9894163B2 (en) Service request management methods and apparatus
US10528301B2 (en) Print relay apparatus and print relay method
JP6521640B2 (ja) 情報処理装置及びその制御方法、並びにプログラム
WO2017000144A1 (zh) Dns的服务器、客户端及数据同步方法
JP2018156610A (ja) 情報処理システム、ヘルプ表示方法、情報処理装置、プログラム及び電子機器
JP6168079B2 (ja) 印刷システム、印刷機器検索プログラム、および記録媒体
US9069724B2 (en) Imaging forming apparatus with automatic configuration update
US20220350553A1 (en) Server system
CN110784389B (zh) 中继设备、控制方法和信息处理***
US10362454B2 (en) Cellular restaurant ticket printer system
JP2022073284A (ja) 情報処理装置
US8665464B2 (en) Information processing system, image forming apparatus, management apparatus, management method, and computer program for searching an address information of management in a case when an error notification is received
WO2020151574A1 (zh) 电子装置注册状态更新方法及***
US10275199B2 (en) Communication device, management server, communication system, and program
US20220263977A1 (en) Information processing apparatus, printing system, management method for image forming, and medium
US9843698B2 (en) Method and system for performing a print process using a map
US20140132984A1 (en) Information transmitting apparatus and method, and non-transitory computer readable medium
CN102394893B (zh) 检验终端与服务端通讯协议的方法、服务器及***
US11842093B2 (en) System and method
JP6191342B2 (ja) 管理装置および管理システム
US20240045630A1 (en) Server, printing system, information processing method, and non-transitory computer-readable storage medium
JP5569105B2 (ja) ネットワーク端末管理システム、ネットワーク端末管理方法、ネットワーク端末管理プログラム
US20240045632A1 (en) Server, printing system, information processing method, and non-transitory computer-readable storage medium
US20240045623A1 (en) Server, printing system, information processing method, and non-transitory computer-readable storage medium

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: 15805818

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 15805818

Country of ref document: EP

Kind code of ref document: A1