1. Technical Field
The present disclosure relates to a control system including a device, a control device, and a terminal, and to a control method of the control system.
2. Related Art
A control system (POS system) that has a control device (POS terminal) and a terminal (POS controller) connected to the POS terminal, and controls these devices to execute processes including printing, is known from the literature. See, for example JP-A-H05-73769.
Devices such as a barcode scanner and card reader are normally connected to the control device (POS terminal) in this type of control system.
A browser is also commonly installed to terminals such as tablet computers and notebook computers.
When the control system includes a terminal with an installed browser, and a control device with a device connected thereto, the terminal must be able to control the device using a function of the browser.
A control system according to the disclosure includes a device; a terminal including a display unit on which content is displayed by a browser, a terminal control unit configured to process information related to the device by an application running on the browser, and a connection unit configured to communicate information related to the device; and a control device including a first communication unit configured to communicate with the device, a second communication unit configured to communicate with the terminal, and a device control unit that controls the device based on the information related to the device sent from the terminal.
In another disclosure, the device control unit instantiates a control object to control the device, and controls the device through the control object; and the terminal control unit instantiates an interface object configured to exchange the information related to the device with the control object.
A control system according to disclosure has a second device to the control device; the device control unit instantiates a second control object to control the second device; and the terminal control unit instantiates a second interface object configured to exchange the information related to the second device with the second control object.
In another disclosure, a two-way communication link is established between the terminal and the control device; and the control object and the interface object communicate through the communication link by two-way communication.
In another disclosure, after the device control unit instantiates the control object, the terminal control unit instantiates an interface object corresponding to the control object.
In another the disclosure, the device is a printing device configured to print; the device control unit instantiates a control object that controls the printing device; and the terminal control unit instantiates an interface object corresponding to the control object configured to control the printing device.
In another disclosure, the terminal control unit in the terminal sends a communication request requesting a communication connection and a device control request requesting control of the device; the second communication unit receives the communication request and the device control request sent from the terminal; and the device control unit of the control device establishes a communication connection with the terminal based on the communication request, and establishes control of the device by the terminal based on the device control request after establishing the communication connection with the terminal.
In another disclosure, the device control unit establishes a communication link enabling two-way communication with the terminal based on the communication request, and establishes a communication connection with the terminal.
In another disclosure, the terminal control unit sends a cancel device control request requesting releasing control of the device; and the device control unit releases control of the device based on the cancel device control request.
In another the disclosure, the terminal control unit sends a cancel communication request requesting releasing the communication connection with the control device; and the device control unit closes the communication connection based on the cancel communication request.
In another disclosure, the device is a printing device configured to print; and the device control unit controls the printing device based on the information related to the device.
Another disclosure is a control method of a control system, including: instantiating a control object to control a device by a control device configured to communicate with a device; instantiating an interface object configured to communicate information related to the device with the control object by a terminal that communicates with the control device; and processing the information related to the device by an application that runs on a browser.
Another disclosure is a control method of a control system, including: sending a communication connection request to establish a communication connection between a terminal configured to display a browser and a control device to which a device is connected from the terminal to the control device; establishing a communication connection with the terminal by the control device that receives the communication connection request; sending a device control request to establish control of the device by the terminal to the control device after a communication connection with the control device is established by the terminal; and establishing control of the device using the terminal by the control device.
In another disclosure, the terminal sends a cancel device control request to release control of the device to the control device; and the control device cancels control of the device by the terminal based on the cancel device control request that was sent.
In another disclosure, the terminal sends a cancel communication request requesting closing the communication connection with the control device; and the control device closes the communication connection based on the cancel communication request.
A preferred embodiment of the present disclosure is described below with reference to the accompanying figures.
The POS system 1 is a system used, for example, in a retail store in a shopping center, a department store, or convenience store, in the food service industry such as a restaurant, coffee shop, or bar, and in other types of businesses and facilities. The functions of the POS system 1 include, for example, managing product sales, product inventory, and sales trends in a store, processing sale transactions at checkout counters L in a store based on the products purchased by a customer, producing receipts based on the payment received from the customer, and providing transaction-related information to the customer.
Checkout counters L where sale transactions are processed are located in a store where the POS system 1 is used. A control device 11 and a tablet device 10 that can communicate wirelessly with the control device 11, are installed at each checkout counter L.
The tablet device 10 is a tablet computer. More particularly in this embodiment as shown in
The tablet device 10 is a terminal used by the checkout clerk responsible for transactions at the checkout counter L. As described below, the tablet device 10 provides a user interface to the checkout clerk when processing a transaction at the checkout counter L.
The control device 11 is a device that functions as a device controller. As shown in
As shown in
The control unit 20 includes a CPU, ROM, RAM, and other peripheral circuits, and controls the control device 11. The control unit 20 also has a device controller 20a, and this function block is described further below.
The printer unit 21 includes a conveyance mechanism for conveying roll paper, a print mechanism that prints text and images on the roll paper using a thermal head, and a cutting mechanism for cutting the roll paper, and can produce a receipt by cutting the roll paper at a specific position after printing a receipt-related image on the roll paper.
The storage unit 22 includes EEPROM or other nonvolatile memory, and stores data nonvolatilely so that the data can be overwritten.
The communication module 23 includes a module and communication control circuit, such as a network card conforming to a particular communication standard, for communicating wirelessly with the tablet device 10, and communicates wirelessly according to the specific communication standard with the tablet device 10 as controlled by the control unit 20.
The tablet device 10 includes a display unit 24, a terminal storage unit 25, a terminal control unit 26, a communication module 27, and an input detection unit 29. The terminal control unit 26 includes a display control unit 28.
The terminal storage unit 25 is EEPROM or other nonvolatile memory, and nonvolatilely stores data rewritably.
The display unit 24 includes a touch panel 30. The touch panel 30 includes a display panel 30a disposed on the front of the tablet device 10, and an integrally formed touch sensor 30b disposed over the display panel 30a. The display panel 30a is a display such as an LCD panel, OLED panel, or e-paper display, and is driven by the display control unit 28. The touch sensor 30b is an electrostatic or pressure sensitive sensor that is overlaid on the display panel 30a, detects touches by the user's fingers or a pen-like stylus, and outputs a signal indicating the position where the touch was detected to the input detection unit 29.
The display control unit 28 displays a screen containing text or images on the display panel 30a by driving the display panel 30a based on display data received from a browser execution unit 26a described below.
The input detection unit 29 detects touch operations on the touch panel 30 based on the signals sent by the touch sensor 30b. When a touch operation is detected, the input detection unit 29 generates coordinate data containing coordinates correlating the position that was touched to a display position on the display panel 30a, and outputs the coordinate data to the terminal control unit 26.
The communication module 27 includes a module and circuits, such as a network card conforming to a specific communication protocol, for communicating wirelessly with the control device 11 and POS server 17, and communicates wirelessly based on the specific protocol with the control device 11 and POS server 17 as controlled by the terminal control unit 26.
The terminal control unit 26 includes a CPU, ROM, RAM, and other peripheral circuits, and controls the tablet device 10. The terminal control unit 26 also includes a browser execution unit 26a that renders the function of a browser by running a browser program.
The browser execution unit 26a downloads a web page (such as an HTML file) written in a scripting language or markup language such as HTML from the POS server 17 using a function of the web browser. The downloaded web page data is stored, for example, in RAM not shown. The browser execution unit 26a reads the downloaded web page data, and generates and sends display data for displaying the web page to the display control unit 28. The display control unit 28 displays the web page on the display panel 30a based on the received display data.
When the input detection unit 29 detects a touch operation on the touch sensor 30b, the browser execution unit 26a determines the input content based on the coordinate data received from the input detection unit 29 according to the touch operation, and the display data sent to the display control unit 28. Based on the identified input content, the browser execution unit 26a executes the corresponding process using a script function, for example.
The POS server 17 includes a server-side storage unit 31 that stores a database of product-related information, a sales management database, and an inventory management database, and manages the POS system 1 using these databases.
The POS server 17 includes a server control unit 37, server storage unit 31, and communication module 38.
The server control unit 37 includes CPU, ROM, RAM, and other peripheral circuits, and controls the POS server 17. The server-side storage unit 31 includes a hard disk drive, EEPROM, or other nonvolatile memory, for example, and nonvolatilely stores data rewritably.
The communication module 38 includes a module and circuits, such as a network card conforming to a particular communication standard, for communicating wirelessly with the tablet device 10, and communicates wirelessly according to the specific communication protocol with the tablet device 10 as controlled by the server control unit 37.
The POS application 35 is installed on the POS server 17.
The browser execution unit 26a of the tablet device 10 executes various processes using functions of the POS application 35 on the POS server 17.
For example, the browser execution unit 26a asserts a request for an operation to the POS server 17, causes the POS server 17 to execute the requested process using a function of the POS application 35, gets the result of the process, and performs a process appropriate to the process result. For example, the browser execution unit 26a sends the result of reading by the barcode scanner 12 to the POS server 17, searches for the product using a function of the POS application 35, gets the result of the search, controls the control device 11 based on the result of the search, and displays product information on the display 14. The browser execution unit 26a also requests calculating the total amount of the transaction, calculates the total using a function of the POS application 35, receives the result of the calculation, and controls the control device 11 to produce a receipt on which information including the total is printed based on the calculated result.
Note that an “application that runs on a browser” is the POS application 35 or an application installed on another device that can communicate with the browser execution unit 26a. An application that runs on a browser more specifically includes an application that is installed on a device other than the tablet device 10, and has functions that can be used by the browser execution unit 26a. In this example, the application could be an application that is started, executed, and operates on the other device that can communicate, or an application that is downloaded from another device to the tablet device 10 and started, executed, and operates on the tablet device 10.
An application that runs on a browser also includes scripts embedded in a web page (HTML file) that is read by the browser execution unit 26a, as well as programs and other software with functions that can be used by the browser execution unit 26a.
Note that blocks representing programs, software objects, and functions rendered by programs, and blocks representing actual physical devices, are shown on the same level in
Note also that in this embodiment an “object” is an instance generated by object-oriented programming, and more specifically is a function block defined by data and a set of methods. However, an “object” as used herein is not limited to an instance generated in object-oriented programming, and may be a function block that can execute a process based on a corresponding function. For example, an object could be a function block of which the function is rendered by an application being read and run by a CPU or other hardware resource. In this event, the function of a single function block could be rendered by a single application, the functions of plural function blocks could be rendered by a single application, or the function of a single function block could be rendered by a plurality of applications.
As shown in
A cash drawer interface object 40 (interface object), barcode scanner interface object 41 (interface object), display interface object 42 (interface object), and printer interface object 43 (interface object) can run on the browser execution unit 26a. A central control object 44, and connection unit 45 can also operate on the browser execution unit 26a.
A second communication unit 50, relay object 51, cash drawer control object 53 (control object), barcode scanner control object (control object), display control object 55 (control object), printer control object 56 (control object), and first communication unit 71 can operate on the device controller 20a.
A process for instantiating and the functions of these objects and interfaces are described below with reference to the flow chart in
Note that below “the application AP does” something when describing the operation of the application AP means that the CPU (terminal control unit 26, browser execution unit 26a) that reads and runs the application AP uses a function of the application AP to execute the process. Likewise, “the object does” something when describing the operation of an object means that the CPU (the corresponding control unit) uses a function of the object to execute the process.
The application AP first executes the central control object instantiation process (step SA1). The central control object instantiation process is a process that generates the central control object 44. The central control object 44, as described in detail below, is an object containing methods related to controlling the POS system 1, including methods related to establishing and terminating a communication link, and methods related to instantiating and deleting control objects and interface objects.
The central control object instantiation process in step SA1 is executed by, for example, the manufacturer of the control device 11 supplying an API (application programming interface), and the application AP using a function of the API.
When a central control object 44 is instantiated by the process of step SA1, the application AP asserts an open communication link request (communication request) in step SA2.
The open communication link request (communication request) is a request to establish a logical WebSocket communication link K1 between the tablet device 10 and control device 11, and causes the devices to establish a link enabling sending and receiving data based on the WebSocket standard. The open communication link request (communication request) is asserted by the application AP executing a method embedded in the central control object 44.
Note that WebSocket is a communication protocol enabling asynchronous, two-way communication. After the server and client establish a WebSocket connection CT, sending and receiving data over the connection uses the WebSocket protocol. As a result, there is no need to open a connection each time data is transmitted.
A communication link K1 is a logical communication path for sending and receiving data according to the WebSocket protocol and procedures between a tablet device 10 and control device 11 connected by the communication link K1. Therefore, after the tablet device 10 and control device 11 handshake and open a communication link K1, the devices can send and receive data asynchronously over the communication link K1.
In response to the open communication link request in step SA2, the central control object 44 of the tablet device 10 and the relay object 51 of the control device 11 establish a communication link K1 between the connection unit 45 and the second communication unit 50 (step SA3).
Note that the connection unit 45 and second communication unit 50 are function blocks providing WebSocket interfaces for sending and receiving data using the WebSocket protocol and procedures. These function blocks are instantiated using a socket library related to the WebSocket standard.
The second communication unit 50 has a function for executing a process according to the WebSocket standard to send data received from the relay object 51 over the communication link K1 according to a WebSocket procedure. The second communication unit 50 also has a function for executing a process according to the WebSocket standard to send data received over the communication link K1 to the relay object 51. The connection unit 45 is similarly configured.
The relay object 51 is an object that operates on the device controller 20a. A method for establishing a communication link K1, and methods for executing processes described below, are embedded in the relay object 51.
When a communication link K1 is established, a communication link ID, which is information identifying the communication link K1, is added to the communication link K1 by a function of the central control object 44 or the relay object 51. The assigned communication link ID is stored in the tablet device 10 in a specific storage area of the terminal storage unit 25 in a form enabling referencing by the application AP. The communication link ID is also stored in the control device 11 in a specific storage area of the storage unit 22 in a form enabling referencing by the relay object 51.
By establishing a communication link K1, the tablet device 10 (terminal) and the control device 11 can communicate with each other.
Next, the application AP asserts a barcode scanner control object instantiation request (device control request) (step SA4). A barcode scanner control object instantiation request is a process requesting instantiation of a barcode scanner control object 54 that operates on the device controller 20a. Note that because instantiating a device control object establishes a state enabling controlling the corresponding device (establishes control of a device) as further described below, the process of step SA4 is a process of an application (or terminal) requesting control of a device.
Identification information (a “device ID” below) is assigned to each device connected to the control device 11. In the following example, “scanner” is assigned as the device ID to the barcode scanner 12.
To instantiate a barcode scanner control object 54, the application AP specifies the device ID of the barcode scanner 12 to be controlled. As will be understood below, the relay object 51 instantiates a control object corresponding to the device to be controlled using the specified device ID as a key.
Control objects are further described below. A control object is an object containing methods related to controlling a device, and controls a particular device using a function of a corresponding handler. For example, the cash drawer control object 53 contains a method for executing a process related to controlling the cash drawer 13, and the object controls the cash drawer 13 using a function of a cash drawer handler 61.
A handler is a function or subroutine that executes a process related to the corresponding device as requested. For example, when a barcode is read by the barcode scanner 12, the barcode scanner handler 60 gets the input result of reading the barcode, executes an interrupt process, and passes the read result (such as a numeric string) to the barcode scanner control object 54. The other handlers (cash drawer handler 61, display handler 62, and printer handler 63) function similarly.
The first communication unit 71 is a device interface connected to each device, sends data sent from the control object to the device, and sends data sent from the device to the control object.
As described above, control of a device by the control device 11 is established by instantiating a control object.
In response to the barcode scanner control object instantiation request from the application AP, the central control object 44 sends a barcode scanner control object instantiation request to the relay object 51 through the communication link K1 (step SA5).
In response to this request, the relay object 51 instantiates a control object (barcode scanner control object 54 in this example) corresponding to the specified device ID (the device ID “scanner” for the barcode scanner 12 in this example) using a “new” statement, for example (step SA6). In other words, the device controller 20a instantiates the control object, and the instantiated control object runs on the device controller 20a.
In step SA6, the relay object 51 manages the instantiated barcode scanner control object 54 using the communication link ID assigned in step SA3. This also applies to the instantiation of other control objects. Because the control object is linked to a particular communication link ID by the relay object 51, the relay object 51 can know which application AP manages each control object.
This is described more specifically next using as an example a configuration in which two tablets, a first tablet and a second tablet, are connected to a single control device 11. In this example, each tablet establishes a WebSocket communication link with the control device 11, and a different communication link ID is assigned to each communication link. The first tablet then instantiates a barcode scanner control object 54 in order for an application AP running on the first tablet to control the barcode scanner 12. In this instance, the relay object 51 links and manages the barcode scanner control object 54 using the communication link ID of the communication link to the first tablet.
The second tablet instantiates a cash drawer control object 53 in order for an application AP running on the second tablet to control the cash drawer 13. In this instance, the relay object 51 links and manages the cash drawer control object 53 using the communication link ID of the communication link to the second tablet.
As a result, the relay object 51 sends data sent by the barcode scanner control object 54 to the first tablet based on the result of reading by the barcode scanner 12 through the communication link with the corresponding communication link ID, that is, sends the data to the first tablet through the communication link associated with the first tablet. Likewise, when the application AP running on the second tablet controls the cash drawer 13, and there is communication through the communication link to the second tablet, the communicated data is sent to the cash drawer control object 53 corresponding to the communication link ID of the communication link.
As a result of the relay object 51 thus managing control objects using the associated communication link ID, control objects will not communicate through the wrong communication link even when a plurality of tablets are connected and a plurality of communication links are thus established.
When instantiation of the barcode scanner control object 54 is completed, the relay object 51 reports through the communication link K1 to the central control object 44 that instantiation of the object was completed (step SA7), and the central control object 44 passes the report to the application AP (step SA8).
Note that when the barcode scanner control object instantiation process executes in step SA4, a callback that receives the result of the process related to instantiating the control object is declared, and successful instantiation of the barcode scanner control object 54 is reported to the application AP by executing the callback function.
The central control object 44 then instantiates a barcode scanner interface object 41 corresponding to the barcode scanner control object 54 that was instantiated (step SA9).
Interface objects are described next.
An interface object functions as an interface causing the application AP to use the methods embedded in the control object related to the corresponding device when the application AP controls a device. More specifically, if when controlling one device the application AP sends information to the interface object corresponding to the one device, the interface object communicates with the control object corresponding to the one device, executes a method embedded in the control object, and can control the one device.
For example, to control the printer unit 21, the application AP sends information related to control of the printer unit 21 to the printer interface object 43. The printer interface object 43 communicates using the printer control object and communication link K1, and sends information related to control of the printer unit 21 received from the application AP to the printer control object 56. The printer control object 56 controls the printer unit 21 based on the received information related to control of the printer unit 21.
By instantiation of this interface object, the application AP can control the device using methods of the control object through the interface object. More specifically, establishing control of a device by the application AP through the control device 11 is accomplished by instantiating an interface object in conjunction with instantiating a control object.
Instantiation of the barcode scanner control object 54 and barcode scanner interface object 41 is thus completed as described above. Control objects and interface objects for other devices are instantiated by the same steps.
As described above, this embodiment of the disclosure instantiates a corresponding interface object when instantiation of a control object in the control device 11 is completed. Thus comprised, a control object and interface object pair is always instantiated for any single device, and a state enabling device control by the application AP is established for each device.
An interface object and control object pair is also instantiated for each device connected to the control device 11 in this embodiment. As a result, by using functions of the interface object corresponding to the one device when controlling any one device, the application AP can reliably control the one device and can exchange data with the one device.
Development (programming) of the application AP is also simplified because a program associated with an interface related to controlling a device needs only to consider the relationship to the interface object of each device. For example, routines of the application AP related to controlling the cash drawer 13 only need to consider input and output of information (data) with the cash drawer interface object 40, and development is simplified.
A process for deleting an instantiated control object and interface object, and closing the established communication link, is described next with reference to
The application AP first asserts a delete request (cancel device control request) for the barcode scanner control object 54 (step SB1). The application AP also specifies the device ID of the barcode scanner 12. The control object delete request is executed by the application AP executing a method embedded in the central control object 44.
In response to the barcode scanner control object 54 delete request from the application AP, the central control object 44 sends a barcode scanner control object 54 delete request to the relay object 51 through the communication link K1 (step SB2).
In response to the delete request, the relay object 51 deletes the control object (the barcode scanner control object 54 in this example) corresponding to the specified device ID (the device ID “scanner” of the barcode scanner 12 in this example) using a delete operator, for example (step SB3). By deleting the control object, control of the barcode scanner 12 by the control device 11 is cancelled.
A specific control object can thus be deleted in this embodiment by the application AP asserting a control object control request. By deleting the control object for a specific device, control of the specific device by an application AP running on one tablet is cancelled, thereby enabling an application AP operating on a different tablet to take control of the specific device. As a result, when a specific device is no longer used, the application AP can release that device by deleting the control object for the specific device, and occupying a device unnecessarily can be prevented.
When deleting the barcode scanner control object 54 is completed, the relay object 51 reports to the central control object 44 through the communication link K1 that deleting the object was completed (step SB4), and the central control object 44 then passes that report to the application AP (step SB5).
Note that a callback that receives the result of the process related to deleting the control object is declared in step SB1, and successful deletion of the barcode scanner control object 54 is reported to the application AP by executing the callback function.
The central control object 44 then deletes the barcode scanner interface object 41 corresponding to the barcode scanner control object 54 that was deleted (step SB6).
Next, the application AP requests terminating the communication link K1 to the control device 11 (cancel communication request) (step SB7). This request is executed by the application AP executing a method embedded in the central control object 44.
In response to the request asserted in step SB7, the central control object 44 and relay object 51 terminate the communication link K1 established between the connection unit 45 and second communication unit 50 according to the WebSocket standard (step SB8).
An instantiated control object and interface object can thus be deleted and an established communication link cancelled as described above.
An instantiated control object can thus be deleted at the desired time by a request from the application AP. More specifically, when maintaining control of a device is no longer necessary, the application AP can quickly delete the control object instantiated for that one device and release control of that one device. Control objects remaining instantiated when no longer needed, and the application AP of another tablet unnecessarily continuing to be unable to control the device, can therefore be effectively prevented.
A specific example of operation in a transaction process is described next.
Before the transaction process executes, the tablet device 10 first executes the following processes.
More specifically, the checkout clerk or the person responsible for another task starts the browser of the tablet device 10, and asserts a command to display a user interface UI (
A list area 65 displaying the names of products purchased by the customer, product prices, and product quantities is displayed in the user interface UI as shown in
Below the list area 65 is a barcode information input field 67, which is an input field where information represented by the barcode read by the barcode scanner 12 (“barcode information” below) is input and displayed. The barcode information is basically identification information assigned to a product. On the right side of the barcode information input field 67 is a virtual keypad 68. Information can be input through this virtual keypad 68 to each of the input fields in the user interface UI, and the virtual keypad 68 has keys for inputting information.
An address input field 69 where the accessed address is displayed is presented at the top of the user interface UI.
The process until the information expressed by the read barcode (“barcode information” below) is displayed in the barcode information input field 67 of the user interface UI after a barcode is read by the barcode scanner 12 is described first below.
First, to enable the application AP to acquire the result of reading a barcode, a callback name for the barcode scanner interface object 41 is first registered by the application AP (step SC1). A callback name is an identification name assigned to each event (an event such as the barcode scanner 12 reading a barcode). When data linked to the callback name is sent to the interface object, a specific callback function is executed, and the data is sent to the application AP. In this example, the callback name of “reading a barcode with the barcode scanner 12” is “ondata.”
At the checkout counter L, the checkout clerk uses the barcode scanner 12 to read the barcode from a product purchased by the customer (step SX1).
Next, the result of reading the barcode is input to the barcode scanner handler 60 (step SC2). The barcode scanner handler 60 then executes an interrupt process and sends the barcode information, which is the result of reading, to the barcode scanner control object 54 (step SC3).
Next, the barcode scanner control object 54 sends data including at least the device ID of the barcode scanner 12 (scanner in this example), the callback name (ondata in this example), and the barcode information (data) in a specific format to the relay object 51 (step SC4).
The relay object 51 generates a data ID (identification information), and adds the data ID in a predetermined format to the barcode information contained in the received data (step SC5). The data ID is identification information assigned to identify the data passed to the application AP (barcode information in this example). In this embodiment the data ID is a number, and the relay object 51 generates and assigns the data ID so that the value increases as the time that the data is sent to the central control object 44 becomes later. For example, if the data ID generated and assigned to the input barcode information and sent to the central control object 44 is 1, the data ID generated and assigned to the barcode information received next and sent to the central control object 44 is 2 (or any value other than 2 that is greater than 1). How the assigned data ID is used is described below.
Next, the relay object 51 stores the barcode information (data) of the assigned data ID to a specific storage area in the storage unit 22 (step SC6). As a result, data related to the device with the data ID sent to the application AP (information related to the device) is cumulatively stored in the storage unit 22.
Next, the relay object 51 sends data including at least the device ID of the barcode scanner 12 (scanner in this example), the callback name (ondata in this example), and the barcode information (data) with the data ID in a specific format to the central control object 44 (step SC7). The relay object 51 sends the data through the communication link K1 identified by the communication link ID assigned to the barcode scanner control object 54.
Next, the central control object 44 sends data to a specific interface object (barcode scanner interface object 41 in this example) related to the device ID contained in the received data (step SC8).
Based on the callback name (ondata in this example), the barcode scanner interface object 41 executes the specific callback function, and sends the barcode information with the data ID to the application AP (step SC9).
The application AP executes the display process based on the received barcode information, and displays the barcode information in the barcode information input field 67 (step SC10). As a result, as shown in
Next, the application AP extracts the data ID from the received barcode information with an assigned data ID, and stores the data ID to a specific storage area in the terminal storage unit 25 (step SC11). This step SC11 results in the data IDs of the data sent to the application AP being extracted from the data output from the device (barcode information in this example) and accumulated in the terminal storage unit 25. A method of using the data IDs stored in the terminal storage unit 25 is described below.
Steps in a process whereby the application AP controls the printer unit 21 to produce a receipt is described next.
First, the application AP generates an image to be printed on the receipt using an embedded function, and then based on the generated image creates an XML file (information related to a device) containing the information related to the receipt to be produced by the printer unit 21 (step SD1). Included in the XML file is the information for producing a receipt, such as the text and images to be printed on the receipt, in a specific format conforming to the XML format, and as described below, the printer control unit 80 can convert the XML file to control commands in the command language of the printer unit 21.
Next, the application AP sends data including the device ID of the printer unit 21, information specifying the functions to be executed by the printer control object 56, and the generated XML file, to the printer interface object 43 (step SD2). In this example, the function executed by the printer control object 56 is a function for executing a process that sends the XML file through the printer/display interface 81 to the printer control unit 80.
Next, the printer interface object 43 requests the printer control object 56 to send the data sent from the application AP to the central control object 44 (step SD3). The central control object 44 sends the data through the communication link K1 to the relay object 51 (step SD4), and the relay object 51 sends the data to the printer control object 56 (step SD5).
The printer control object 56 sends the XML file contained in the received data through the printer/display interface 81 to the printer control unit 80 by executing a function specified in the received data (step SD6). At this time the printer control object 56 sends the XML file to the printer control unit 80 after formatting or processing the data to enable processing by the printer control unit 80.
The printer control unit 80 is a function block rendered by a function of a printer driver, and based on the received XML file, generates control commands conforming to the command language of the printer unit 21 and outputs to the printer unit 21 through the printer handler 63 (step SD7). The printer unit 21 then operates the required mechanisms to produce a receipt based on the received control commands (step SD8).
Note that displaying data on the display 14 is accomplished by a process of steps similar to those described in
More specifically, the application AP sends display data to the display control object 55 through the display interface object 42. The display control object 55 sends the display data to the display control unit 82 through the printer/display interface 81. The display control unit 82 converts the received display data to control commands conforming to the command language of the display 14, and using a function of the display handler 62 outputs to the display 14. The display 14 then presents the display data based on the control commands.
As described above, device control by the application AP, and exchanging data between the application AP and a device, are achieved for each device by communication between an interface object and a control object corresponding to the target device.
More specifically, the tablet device 10 and control device 11 in this embodiment communicate according to the WebSocket standard. That is, any device can send data to another device without sending a data transmission request from the browser on the tablet device 10 to the control device 11 functioning as a server. In other words, two-way communication between the interface object and the corresponding control object is possible. As a result, as described using the flow chart in
Furthermore, as described above, control of a particular device can be established by instantiating a control object for that device. More specifically, instantiating a control object establishes a state enabling data communication with the corresponding control object, thereby enabling the application AP to control the corresponding device to execute a process, and enabling the corresponding device to send data to the application AP. As further described below, a control object can cause the device to execute a particular process by sending data output by the application AP to the device (or the control unit of the device), and can send a control command to the device in response to a request from the application AP to cause the device to execute a particular process.
More specifically, as described above, one function (method) of the barcode scanner control object 54 is a function (method) that, when a barcode was read by the corresponding barcode scanner 12, acquires the result of reading the barcode through an interrupt process, and sends the acquired reading result through the barcode scanner interface object 41 to the application AP. More specifically, the barcode scanner control object 54 can send the result of reading a barcode to the tablet device 10 based on the corresponding barcode scanner 12 reading the barcode. Establishing device control in this instance means establishing a state in which the result of reading by the corresponding barcode scanner 12 can be sent to the tablet device 10. These functions are enabled by instantiating a barcode scanner control object 54.
As described above, the printer control object 56 sends an XML file created by the application AP to the printer control unit 80 after formatting or converting the data to enable processing by the printer control unit 80. Based on data that is sent in a processable form, the printer control unit 80 generates and sends a control command, and produces a receipt (prints a receipt) with the printer unit 21. The printer control object 56 also acquires data output by the printer unit 21 (for example, data identifying the status (such as no paper or an error) of the printer unit 21) through the printer control unit 80. The printer control object 56 then sends the acquired data through the printer interface object 43 to the application AP. Establishing control of a device here thus means creating a state in which data can be sent from the tablet device 10 (application AP) to the corresponding printer unit 21, and a state in which the printer unit 21 can be controlled by the tablet device 10 (application AP) to execute printing and other processes. It also means establishing a state in which data can be sent at appropriate times from the corresponding printer unit 21 to the tablet device 10 (application AP). These functions can be achieved by instantiating a printer control object 56.
Control of a device can also be established by the display control object 55 similarly to the printer control object 56. More specifically, instantiating a display control object 55 establishes a state in which data can be sent from the tablet device 10 (application AP) to the corresponding display, and information can be displayed on the display 14 by the tablet device 10 (application AP). Instantiating a display control object 55 also establishes a state in which the display 14 can send data at the appropriate timing to the tablet device 10 (application AP).
Based on a request from the application AP, the cash drawer control object 53 also generates and sends to the cash drawer 13 a control command corresponding to the process to be executed, and causes the cash drawer 13 to execute a deposit process, withdrawal process, or other process. Generating and sending this control command is done by the application AP executing a specific method. In other words, the tablet device 10 (application AP) can cause the cash drawer 13 to execute a desired process by specifying a method embedded in the cash drawer control object 53 through the cash drawer interface object 40.
When counting is done by the cash drawer 13, or when a deposit or withdrawal is made with the cash drawer 13, the cash drawer control object 53 acquires the result of that process by an interrupt process, and sends the acquired process result through the cash drawer interface object 40 to the application AP.
More specifically, establishing device control in this instance means establishing a state in which data can be sent from the tablet device 10 (application AP) to the cash drawer 13, and the tablet device 10 (application AP) can control the cash drawer 13 to execute deposit and other processes. It also means establishing a state in which the corresponding cash drawer 13 can send data to the tablet device 10 (application AP) at the appropriate time. These functions are achieved by instantiating a cash drawer control object 53.
The tablet device 10 and control device 11 are connected to communicate wirelessly using a specific standard such as Ethernet (R), but communication can be unintentionally temporarily cut off (interrupted) due to radio interference or other cause. Even when not using a wireless connection, communication can be temporarily interrupted by disconnection of the communication cable, a poor connection, or other cause.
In such instances, the tablet device 10 and control device 11 execute a process based on the existence of a control object as described below.
In the process shown in the flow chart in
As shown in
When communication is interrupted (step SE1 returns YES), the application AP attempts to reconnect using a function of the central control object 44, and determines if reconnecting was successful (step SE2). Attempting to reconnect continues for a predetermined period of time.
As shown in
If communication is cut off (step SF1 returns YES), the relay object 51 starts counting the time past since communication was interrupted (step SF2). As will be understood below, the relay object 51 is configured to delete the control object corresponding to the communication link ID associated with the interrupted communication link when the time past since communication was interrupted exceeds time T1. The length of time T1 is set to be a reference value enabling determining if the interruption of communication was an intentional interruption or an unintended breakdown.
After starting to count the elapsed time, the relay object 51 watches if the elapsed time has reached the time T1 (step SF4), and continues checking if reconnection was successful until time T1 is reached (step SF3).
If the elapsed time reaches time T1 without reconnecting (step SF4 returns YES), the interruption of communication can be determined to be an intentional shutdown and not a sudden failure. The relay object 51 then deletes the control objects corresponding to the communication link ID associated with the interrupted communication connection (in this example, the control objects of the cash drawer 13, barcode scanner 12, display 14, and printer unit 21) (step SF5). As described above, deleting a control object releases the corresponding device to an application AP operating on another tablet, and enables another application AP to instantiate a new control object and control the corresponding device.
If communication between the control device 11 and a tablet device 10 (which could be the same terminal as before communication was interrupted, or a different terminal) is established again after a control object is deleted, the device controller 20a instantiates and operates a control object based on a request from the tablet device 10 according to the process described in
This embodiment thus determines that an interruption of communication was intentional and deletes the control object (releases the control object) if the elapsed time reaches time T1 without successfully re-establishing communication. As a result, the time for which another application AP cannot control a device is prevented from continuing for an unnecessarily long time.
Referring again to
Referring to
When the communication link ID is received, the relay object 51 determines if a control object corresponding to the received communication link ID already exists (step SF7). If the control object does not exist (step SF7 returns NO), the relay object 51 ends the process.
However, if a control object corresponding to the received communication link ID already exists (step SF7 returns YES), the relay object 51 cancels deleting these control objects after time T1, and keeps the control objects instantiated instead of deleting them (controls control object instantiation) (step SF8).
When a communication link is re-established within time T1 after communication is interrupted, this embodiment of the disclosure determines that the probability the interruption of communication was an unintended sudden failure is high, and maintains the control objects related to the communication link ID of the communication link K1 through which communication was interrupted. As a result, the application AP can quickly and efficiently control a device without instantiating a new control object to control the device. In addition, when one application AP controls a device, device control will not be released to another application AP (the corresponding control object will not be deleted) and device control will not be taken over by that other application AP in the event of a sudden communication failure.
After cancelling deletion of the control object (control of control object instantiation) in step SF8, the application AP and relay object 51 work together to send data again (step SE4, step SF9).
Referring to
When a data ID is received from the application AP, the relay object 51 compares the data IDs of the data with a data ID accumulated in the storage unit 22 with the data ID received from the application AP, and identifies (determines) if the data is data that was to be sent to the application AP but was not sent to the application AP due to a sudden communication failure (step SH1). More specifically, the relay object 51 generates data IDs based on the rule that the value of the data ID increases as the time when the data is sent to the application AP becomes later. Based on this, the relay object 51 knows that data having the same data ID as the data ID received from the application AP was transmitted successfully. However, data having a data ID with a value greater than the received data ID is data that has not been transmitted to the application AP due a sudden communication failure, and is identified as data that has not been transmitted to the application AP. More specifically, in step SH1 the relay object 51 identifies the data ID of data that has not been transmitted normally to the tablet device 10 by determining if the data IDs assigned to data sent to the tablet device 10 include a data ID that is not stored in the tablet device 10.
Next, the relay object 51 sends to the application AP data (device-related information) that has not been transmitted (step SH2). The application AP gets and appropriately processes the data transmitted by the relay object 51 (step SG2).
By executing this data retransmission process, all data that should be output to the application AP can be output to the application AP without data loss even when communication is momentarily interrupted.
As described above, a POS system 1 (control system) according to this embodiment of the disclosure includes a device; a tablet device 10 including a display unit 24 that displays a browser, the browser execution unit 26a of a terminal control unit 26 that processes information related to the device by an application that runs on the browser, and a connection unit 45 that receives the device-related information; and a control device 11 including a first communication unit 71 that communicates with the device, a second communication unit 50 that communicates with the tablet device 10, and a device controller 20a that controls the device based on device-related information sent from the tablet device 10.
Thus comprised, the tablet device 10 sends device-related information to the control device 11 by an application that runs on the browser, and the device controller 20a of the control device 11 controls the device based on the device-related information. In other words, the disclosure enables the tablet device 10 to control a device using a function of the browser.
The device controller 20a of the control device 11 in this embodiment instantiates a control object to control a device and controls the device through the control object, and the browser execution unit 26a of the tablet device 10 instantiates an interface object that exchanges device-related information with the control object.
Thus comprised, a control object for controlling a device is instantiated on the control device 11, and an interface object that communicates with the control object is instantiated on the tablet device 10. As a result, an application that operates under a browser on a terminal can send device-related information to the control object and control the device, and can acquire device-related information from the control object and execute a process based on the information, using a function of the interface object.
This embodiment of the disclosure also has a second device connected to the control device 11; the device controller 20a of the control device 11 instantiates a second control object for controlling the second device; and the browser execution unit 26a of the tablet device 10 instantiates a second interface object that sends information related to the second device to the second control object.
In this example, a second control object and a corresponding second interface object are instantiated for the second device connected to the control device 11. In other words, when plural devices are connected to the control device 11, a control object and corresponding interface object are instantiated for each device. An application running on the browser of the tablet device 10 can also control each device using functions of these objects.
A two-way communication link K1 is established between the tablet device 10 and the control device 11 in this embodiment, enabling duplex communication between the control object and the corresponding interface object over the communication link K1.
Because duplex communication between the control object and the corresponding interface object is possible using a two-way communication link, data can be sent to the control object from the interface object triggered by an event on the tablet device 10, and data can be sent to the interface obj ect from the control obj ect triggered by an event on the control device 11.
In this embodiment the browser execution unit 26a instantiates an interface object corresponding to a control object after the control object is instantiated by the device controller 20a.
This configuration enables instantiating a corresponding interface object after a control object has been instantiated.
In this embodiment of the disclosure the printer unit 21 is connected as a device to the control device 11, the device controller 20a of the control device 11 instantiates a control object to control the printer unit 21, and the browser execution unit 26a of the tablet device 10 instantiates a corresponding interface object.
In this configuration a control object for controlling the printer unit 21 is instantiated on the control device 11, and an interface object for communicating with the control object is instantiated on the tablet device 10. As a result, an application operating on a browser of the tablet device (terminal) can send information related to the printer unit 21 (device) to the control object and control the printer unit 21 (device) using a function of the interface object.
In this embodiment of the disclosure the browser execution unit 26a of the tablet device 10 sends a communication request requesting a communication connection and a device control request requesting control of a device; the second communication unit 50 of the control device 11 receives the communication request and the device control request sent from the tablet device 10; and the device controller 20a of the control device 11 establishes a communication connection with the tablet device 10 based on the communication request, and establishes control of the device by the tablet device 10 based on the device control request after establishing the communication connection with the tablet device 10.
Thus comprised, communication between the tablet device 10 and control device 11 is established, and device control by the tablet device 10 is then established, based on the communication request and the device control request from the tablet device 10. Once communication between the tablet device 10 and control device 11 is established, and device control by the tablet device 10 is established, the tablet device 10 can communicate with the control device 11 using a function of the browser, and can control the device through the control device 11. In other words, a device can be controlled by a terminal using a function of a browser.
In this embodiment the browser execution unit 26a of the tablet device 10 also sends a cancel device control request requesting releasing control of the device, and the device controller 20a of the control device 11 releases control of the device based on the cancel device control request.
With this configuration, control of a device can be released by the cancel device control request from the tablet device 10, and leaving the device under the control of a particular tablet device 10 (terminal) unnecessarily, can be prevented.
In this embodiment of the disclosure the browser execution unit 26a of the tablet device 10 sends a cancel communication request requesting releasing the communication connection with the control device 11, and the device controller 20a of the control device 11 releases the communication connection based on the cancel communication request.
The tablet device 10 in this configuration can release an established communication connection by sending a cancel communication request.
In this embodiment of the disclosure a printer unit 21 that prints is an example of a device, and the device controller 20a of the control device 11 controls the printer unit 21 based on data (device-related information) sent from a printer interface object 43.
In this configuration, communication is established and control of the printer (device) by a tablet device 10 (terminal) is sequentially established based on a communication request and device control request output by the tablet device 10, and the terminal (tablet device 10) can control printing by the printer unit 21 using a function of the browser.
The disclosure is described above with reference to a preferred embodiment thereof, but the disclosure is not limited thereto and can be modified and adapted in many ways without departing from the scope of the accompanying claims.
For example, the disclosure is described in the foregoing embodiment using the POS system 1 in a store with a checkout counter L as an example, but the POS system is not limited to such use, and can be used in the food industry in coffee shops and restaurants, for example. The control device 11 and POS server 17 are also separate devices above, but the function of the POS server 17 could be included in the control device 11. Yet further, the control device 11 is a thermal printer above, but any desirable recording method can be used.
The function blocks shown in
A control system according to the disclosure includes a device; a terminal including a display unit on which content is displayed by a browser, a terminal control unit configured to process information related to the device by an application running on the browser, and a connection unit configured to communicate information related to the device; and a control device including a first communication unit configured to communicate with the device, a second communication unit configured to communicate with the terminal, and a device control unit that controls the device based on the information related to the device sent from the terminal.
With this configuration the terminal sends device-related information to the control device by an application that runs on the browser, and the device control unit of the control device controls the device based on the device-related information. In other words, the disclosure enables the terminal to control a device using a function of the browser.
In another disclosure, the device control unit instantiates a control object to control the device, and controls the device through the control object; and the terminal control unit instantiates an interface object configured to exchange the information related to the device with the control object.
Thus comprised, a control object for controlling a device is instantiated on the control device, and an interface object configured to communicate with the control object is instantiated on the terminal. As a result, an application that operates under a browser on a terminal can send device-related information to the control object and control the device, and can acquire device-related information from the control object and execute a process based on the information, using a function of the interface object.
A control system according to another disclosure has a second device to the control device; the device control unit instantiates a second control object to control the second device; and the terminal control unit instantiates a second interface object configured to exchange the information related to the second device with the second control object.
In this configuration, a second control object and a corresponding second interface object are instantiated for the second device connected to the control device. In other words, when plural devices are connected to the control device, a control object and corresponding interface object are instantiated for each device. An application running on the browser of the terminal can also control each device using functions of these objects.
In another disclosure, a two-way communication link is established between the terminal and the control device; and the control object and the interface object communicate through the communication link by two-way communication.
Because duplex communication between the control object and the corresponding interface object is possible using a two-way communication link, data can be sent to the control object from the interface object triggered by an event on the terminal, and data can be sent to the interface object from the control object triggered by an event on the control device.
In another disclosure, after the device control unit instantiates the control object, the terminal control unit instantiates an interface object corresponding to the control object.
This configuration enables instantiating a corresponding interface object after a control object has been instantiated.
In another disclosure, the device is a printing device configured to print; the device control unit instantiates a control object configured to control the printing device; and the terminal control unit instantiates an interface object corresponding to the control object configured to control the printing device.
In this disclosure a control object for controlling the printing device is instantiated on the control device, and an interface object for communicating with the control object is instantiated on the terminal. As a result, an application operating on a browser of the terminal can send information related to the printing to the control object and control the printing device using a function of the interface object.
In another disclosure, the terminal control unit sends a communication request requesting a communication connection and a device control request requesting control of the device; the second communication unit receives the communication request and the device control request sent from the terminal; and the device control unit establishes a communication connection with the terminal based on the communication request, and establishes control of the device by the terminal based on the device control request after establishing the communication connection with the terminal.
With this configuration, communication between the terminal and control device is established, and device control by the terminal is then established, based on the communication request and the device control request from the terminal. Once communication between the terminal and control device is established, and device control by the terminal is established, the terminal can communicate with the control device using a function of the browser, and can control the device through the control device. In other words, a device can be controlled by a terminal using a function of a browser.
In another disclosure, the device control unit establishes a communication link enabling two-way communication with the terminal based on the communication request, and establishes a communication connection with the terminal.
This configuration the terminal and control device communicate by duplex communication over a communication link enabling duplex communication. Data can therefore be sent from the terminal to the control device triggered by an event on the terminal, and data can be sent from the control device to the terminal triggered by an event on the control device.
In another disclosure, the terminal control unit sends a cancel device control request requesting releasing control of the device; and the device control unit releases control of the device based on the cancel device control request.
This configuration enables cancelling device control by the terminal in response to a cancel device control request from the terminal, and can prevent the device from remaining under control of the terminal unnecessarily.
In another disclosure, the terminal control unit sends a cancel communication request requesting releasing the communication connection with the control device; and the device control unit closes the communication connection based on the cancel communication request.
This configuration enables closing an established communication connection by the terminal sending a cancel communication request.
In another disclosure, the device is a printing device configured to print; and the device control unit controls the printing device based on the information related to the device.
With this configuration, communication is established, and control of a printer as the device by the terminal is then established, based on the communication request and the device control request from the terminal, and the terminal can control printing by the printing device using a function of the browser.
Another disclosure is a control method of a control system, including: instantiating a control object to control a device by a control device that communicates with a device; instantiating an interface object configured to communicate information related to the device with the control object by a terminal that communicates with the control device; and processing the information related to the device by an application that runs on a browser.
With the control method according to this aspect of the disclosure, a control object for controlling a device is instantiated on the control device, and an interface object that communicates with the control object is instantiated on the terminal. As a result, an application that operates under a browser on a terminal can send device-related information to the control obj ect and control the device, and can acquire device-related information from the control object and execute a process based on the information, using a function of the interface object.
Another disclosure is a control method of a control system, including: sending a communication connection request to establish a communication connection between a terminal configured to display a browser and a control device to which a device is connected from the terminal to the control device; establishing a communication connection with the terminal by the control device that receives the communication connection request; sending a device control request to establish control of the device by the terminal to the control device after a communication connection with the control device is established by the terminal; and establishing control of the device using the terminal by the control device.
With the control method according to this aspect of the disclosure, communication between the terminal and control device is established, and device control by the terminal is then established, based on the communication request and the device control request from the terminal. Once communication between the terminal and control device is established, and device control by the terminal is established, the terminal can communicate with the control device using a function of the browser, and can control the device through the control device. In other words, a device can be controlled by a terminal using a function of a browser.
In another disclosure, the terminal sends a cancel device control request to release control of the device to the control device; and the control device cancels control of the device by the terminal based on the cancel device control request that was sent.
The control method according to this disclosure enables the terminal to cancel device control by sending a cancel device control request, and prevents the device from remaining under control of the terminal unnecessarily.
In another disclosure, the terminal sends a cancel communication request requesting closing the communication connection with the control device; and the control device closes the communication connection based on the cancel communication request.
This configuration enables closing an established communication connection by the terminal sending a cancel communication request.
Number | Date | Country | Kind |
---|---|---|---|
2013-016055 | Jan 2013 | JP | national |
2013-016057 | Jan 2013 | JP | national |