Information processing system, peripheral device, and information processing method
The system simplifies web application implementation by converting unstructured peripheral device data to structured formats, reducing processing complexity and time lag in data acquisition.
Patent Information
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- STAR MICRONICS CO LTD
- Filing Date
- 2024-12-25
- Publication Date
- 2026-07-07
AI Technical Summary
Web applications handling binary data from peripheral devices face increased implementation effort due to the need for bitwise arithmetic processing and protocol-specific data handling, especially when adding new peripheral devices, as conventional systems rely on printer-specific commands and peripheral device vendor-specific protocols.
An information processing system where a first peripheral device converts unstructured data from a second peripheral device into structured data like JSON or XML, allowing a host device's web application to receive and process the data without handling unstructured binary data or implementing protocol-specific processing.
Simplifies the implementation of web applications by eliminating the need for bitwise arithmetic and protocol-specific data processing, enabling near-real-time data acquisition and reducing time lag in data transmission.
Smart Images

Figure 2026113333000001_ABST
Abstract
Description
[Technical Field]
[0001] The present invention relates to an information processing system, peripheral devices, and information processing method, and is particularly suitable for use in a network configuration system in which a first peripheral device is connected to a host device, and a second peripheral device is connected to the first peripheral device. [Background technology]
[0002] Conventionally, in a network configuration where a printer is connected to a host device and peripheral devices are connected to the printer, a system is known in which the host device is configured to control the peripheral devices via the printer. In this type of system, the printer is controlled by printer vendor-specific printer commands sent from the host device. Peripheral devices connected to the printer are controlled by peripheral device commands based on peripheral device vendor-specific protocols sent from the host device via the printer. Both printer commands and peripheral device commands are often defined as byte-based binary data.
[0003] However, JavaScript, which is commonly used in web applications implemented on host devices, is optimized for processing text data and the DOM (Document Object Model). On the other hand, data that web applications acquire from printers is binary data where each bit has meaning. Therefore, there was a problem in that the implementation effort for web applications that handle binary data increased, as it was necessary to incorporate bitwise arithmetic processing into the web application in order to interpret the content of the acquired data.
[0004] Furthermore, the protocols for controlling peripheral devices differ depending on the type and vendor of the peripheral device. Therefore, when implementing a web application that handles data from peripheral devices on a host device, it is necessary to implement data processing in accordance with the protocol of the peripheral device. This is one of the factors that increases the implementation effort of the web application. In particular, when adding and handling a new type of peripheral device, it is necessary to understand the protocol of that peripheral device and modify the web application from scratch, which poses a problem in terms of the amount of modification required for the web application.
[0005] Regarding conventional technology for controlling peripheral devices via a printer from a host device's web application, a method disclosed in Patent Document 1 is known. In the device control system described in Patent Document 1, the printer has an internal script for controlling peripheral devices, and based on a control request sent from the web application, the script generates commands for the peripheral devices and sends them to the peripheral devices. Since the script is modifiable, users can add their own processing. [Prior art documents] [Patent Documents]
[0006] [Patent Document 1] Patent No. 6277961 [Overview of the project] [Problems that the invention aims to solve]
[0007] The present invention was made to solve the above-mentioned problems, and aims to simplify the implementation of a web application in a system in which a first peripheral device is connected to a host device, a second peripheral device is connected to the first peripheral device, and data acquired by the second peripheral device is acquired by a web application on the host device via the first peripheral device. [Means for solving the problem]
[0008] To solve the above-mentioned problems, the present invention provides an information processing system comprising a host device that runs a web application, a first peripheral device connected to the host device, and a second peripheral device connected to the first peripheral device. In this system, the first peripheral device receives peripheral device acquisition data, including values acquired by the second peripheral device, in the form of unstructured data from the second peripheral device, analyzes the received unstructured data to generate structured data including the acquired values, and transmits the generated structured data to the host device. [Effects of the Invention]
[0009] According to the present invention configured as described above, the host device's web application obtains values acquired by the second peripheral device in the form of structured data via the first peripheral device. Therefore, the web application does not need to handle unstructured data such as binary data, and does not need to implement bit-level arithmetic processing in the web application to interpret the contents of the data acquired by the peripheral device. Furthermore, it is not necessary to implement data processing in the web application that handles unstructured data according to the peripheral device's protocol. As a result, the implementation of the web application can be simplified. [Brief explanation of the drawing]
[0010] [Figure 1] This figure shows an example of the overall configuration of the information processing system according to the first embodiment. [Figure 2] This figure shows an example of a printer's hardware configuration. [Figure 3] This figure shows an example of a hardware configuration for scaling. [Figure 4] This figure shows an example of the hardware configuration of the BCR. [Figure 5] This figure shows an example of the hardware configuration of a host device. [Figure 6] This is a block diagram showing an example of the functional configuration of a printer according to the first embodiment. [Figure 7] This figure shows an example of the JSON data format. [Figure 8] This is a sequence diagram showing an example of data acquisition processing in an information processing system according to the first embodiment. [Figure 9] This figure shows an example of JSON data (related to BCR data) generated in the first embodiment. [Figure 10] This figure shows an example of JSON data (related to scale data) generated in the first embodiment. [Figure 11] This figure shows other examples of JSON data formats. [Figure 12] This block diagram shows an example of the functional configuration of a printer according to the second embodiment. [Figure 13] This is a sequence diagram showing an example of data acquisition processing in an information processing system according to the second embodiment. [Figure 14] This figure shows an example of the JSON data (related to scale data and BCR data) generated in the second embodiment. [Figure 15] This is a block diagram showing an example of the functional configuration of a printer according to the third embodiment. [Figure 16] This is a sequence diagram showing an example of data acquisition processing in an information processing system according to the third embodiment. [Figure 17] This figure shows an example of JSON data generated in the third embodiment (indicating that there are no retrieved values). [Figure 18] This figure shows an example of the overall configuration of an information processing system according to the fourth embodiment. [Figure 19] This is a block diagram showing an example of the functional configuration of a printer according to the fourth embodiment. [Figure 20] This figure shows an example of the format of the completion notification JSON data used in the fourth embodiment. [Figure 21] This figure shows an example of the configuration of peripheral device JSON data used in the fourth embodiment. [Figure 22A] This is a sequence diagram showing an example of data acquisition processing in an information processing system according to the fourth embodiment. [Figure 22B] This is a sequence diagram showing an example of data acquisition processing in an information processing system according to the fourth embodiment. [Figure 23] This figure shows an example of the peripheral device JSON data (first one) generated in the fourth embodiment. [Figure 24] This figure shows an example of the peripheral device JSON data (second one) generated in the fourth embodiment. [Figure 25] This figure shows an example of the peripheral device JSON data (third one) generated in the fourth embodiment. [Figure 26] This figure shows an example of the first completion notification JSON data generated in the fourth embodiment. [Figure 27] This figure shows an example of the peripheral device JSON data (fourth one) generated in the fourth embodiment. [Figure 28] This figure shows an example of the second completion notification JSON data generated in the fourth embodiment. [Modes for carrying out the invention]
[0011] (First embodiment) Hereinafter, a first embodiment of the present invention will be described with reference to the drawings. Figure 1 is a diagram showing an example of the overall configuration of an information processing system according to the first embodiment. As shown in Figure 1, the information processing system according to the first embodiment includes a host device 3, a first peripheral device 1 connected to the host device 3 by USB, and a second peripheral device 2 connected to the first peripheral device 1 by USB. -1 ,2 -2 (In the following description, unless otherwise specified, it will be referred to as the second peripheral device 2) and is configured to include the following. Here, two second peripheral devices 2 -1 ,2 -2 The example shown involves connecting the first peripheral device 1 to the second peripheral device 2, but the number is not limited to this. The second peripheral device 2 connected to the first peripheral device 1 may be one or three or more.
[0012] In the information processing system of this embodiment, the host device 3 acquires the acquired value at the second peripheral device 2 via the first peripheral device 1. In this embodiment, the peripheral device acquisition data including the acquired value at the second peripheral device 2 is transmitted from the second peripheral device 2 to the first peripheral device 1 in the form of unstructured data such as binary data. The first peripheral device 1 converts the received unstructured data into the form of structured data such as JSON (JavaScript Object Notation) or XML (Extensible Markup Language), and transmits the structured data to the host device 3. In the first embodiment described below, JSON format data (hereinafter referred to as JSON data) is used as the structured data.
[0013] The first peripheral device 1 and the second peripheral device 2 are devices that can be used by connecting to a general-purpose computer with a USB cable, and input devices, output devices, auxiliary storage devices, measuring devices, network devices, etc. can be used. Below, as an example, a printer as an output device is used as the first peripheral device 1, and the first second peripheral device 2 -1 uses a scale (weighing scale) as a measuring device, and the second second peripheral device 2 -2 uses a barcode reader (BCR) as an input device. In the following description, the first peripheral device 1 is denoted as printer 1, and the first second peripheral device 2 -1 is denoted as scale 2 -1 and the second second peripheral device 2 -2 is denoted as BCR2 -2 . Also, in the following description, when there is no need to particularly distinguish, scale 2 -1 and BCR2 -2 are collectively denoted as peripheral device 2 -1 ,2 -2 .
[0014] Printer 1 has a communication interface 1a for transmitting and receiving data to and from the host device 3, and a communication interface 1b for transmitting and receiving data to and from the peripheral device 2 -1 ,2 -2 , and a communication interface between printer 1 and the peripheral device 2 -1 ,2-2 It comprises a control unit 1c that controls data communication and printing processes between the device and the printer, a printing unit 1d that performs printing, and a built-in USB hub 1e. Scale 2 -1 and BCR2 -2 The internal structure is not shown in the diagram. Scale 2 -1 and BCR2 -2 It is connected to the communication interface 1b via the built-in USB hub 1e.
[0015] The host device 3 is comprised of a general-purpose computer such as a personal computer, tablet, or smartphone. Alternatively, the host device 3 may be comprised of a dedicated computer such as a POS terminal. The host device 3 has a USB device driver 3b installed on it. The host device 3 also runs a web application 3a. Furthermore, the host device 3 is equipped with a communication interface 3c for sending and receiving data to and from the printer 1.
[0016] The web application 3a can send print commands and print data to the printer 1 via the USB device driver 3b and the communication interface 3c, thereby causing the printer 1 to perform printing based on the print data. Furthermore, the web application 3a can also receive various status data acquired by the printer 1 via the USB device driver 3b and the communication interface 3c, as well as data from the scale 2 connected to the printer 1. -1 Data measured with (hereinafter referred to as scale data) and BCR2 -2 It is possible to obtain the acquired values contained in the data read by the device (hereinafter referred to as BCR data). Scale data and BCR data correspond to peripheral device acquired data.
[0017] The web application 3a sends and receives data to and from the printer 1, for example, using the Web USB API or the Web Serial API. Even when the host device 3 and the printer 1 are physically connected by a USB cable, the web application 3a can perform serial communication with the printer 1 via the Web Serial API, provided that the printer 1 and the host device 3 support virtual serial ports as communication interfaces 1a and 3c. In the first embodiment described below, the host device 3 performs serial communication with the printer 1 using the Web Serial API for processing data acquired from peripheral devices. Communication between the host device 3 and the printer 1 can also be established using Bluetooth® if virtual serial technology is used.
[0018] Figure 2 shows an example of the hardware configuration of printer 1. As shown in Figure 2, printer 1 has a hardware configuration that includes a CPU 101, ROM 102, RAM 103, non-volatile memory 104, communication unit 105, and printing unit 106.
[0019] The CPU 101 controls the operation of the printer 1 using the RAM 103 as work memory, according to a program stored in the ROM 102 or non-volatile memory 104. The control unit 1c in Figure 1 is composed of the CPU 101, ROM 102, RAM 103, and non-volatile memory 104. The CPU 101 controls the execution of printing based on print data transmitted from the host device 3, for example. The CPU 101 also acquires status data of the printer 1 and peripheral devices 2 -1 ,2 -2 This process executes the acquisition of peripheral device data.
[0020] Furthermore, the CPU 101 also performs processing related to the generation of JSON data and the transmission of JSON data to the host device 3. In other words, under the control of the CPU 101, the printer 1 transmits the data acquired from the peripheral device to the peripheral device 2 in the form of unstructured data (binary data). -1 ,2 -2It receives data from and analyzes the received unstructured data to peripheral device 2 -1 ,2 -2 The system generates structured data (JSON data) containing the acquired values and sends the generated structured data to the host device 3.
[0021] The communication unit 105 has a function corresponding to the communication interface 1a in Figure 1 and communicates data with the host device 3 via a USB cable. For example, the communication unit 105 receives print data along with a print command from the host device 3 and sends status data indicating the print result to the host device 3. The communication unit 105 also sends status data to the host device 3 indicating that a change has occurred in the state of the printer 1. The communication unit 105 also communicates with peripheral device 2 -1 ,2 -2 The peripheral device data received from the printer is sent to the host device 3. All data sent to the host device 3 can be structured data in JSON format, converted from unstructured binary data. However, it is not mandatory for all data sent from printer 1 to host device 3 to be in JSON format. For example, when sending status data indicating the print result to host device 3, it may be sent in binary data format.
[0022] Furthermore, the communication unit 105 has a function corresponding to the communication interface 1b in Figure 1, and peripheral device 2 -1 ,2 -2 Data communication is performed between them via a USB cable. For example, the communication unit 105 has a scale of 2 -1 It receives scale data from BCR2. The communication unit 105 also receives BCR2 -2 BCR data is received from here. Here, the communication unit 105 is scale 2 -1 USB communication is performed via bulk transfer with an interval time set to less than or equal to a predetermined time, and scale 2 -1 The scale data should be measured within a predetermined timeframe no later than the time when the object's weight is measured. -1 It receives from. Instead of bulk transfer, isochronous transfer may be performed. Also, the communication unit 105 is BCR2 -2USB communication is performed between BCR2 and BCR2 via interrupt transfer with an interval time set to less than a predetermined time. -2 The BCR data must be sent to BCR2 within a specified timeframe from the moment the barcode is scanned. -2 Received from. These data transfers are performed with printer 1 as the USB host and peripheral device 2 as the peripheral device. -1 ,2 -2 Run it as a USB device.
[0023] By setting the interval time to a very short time of a few milliseconds, printer 1 can perform Scale 2 -1 The time when the weight of the object was measured and BCR2 -2 It is possible to acquire scale data and BCR data in real time with almost no time lag from the moment the barcode is read. Also, as mentioned above, printer 1 communicates serially with host device 3, so printer 1 can read scale 2 -1 BCR2 -2 Upon acquiring scale data and BCR data, it is possible to proactively send JSON data generated based on the acquired scale data and BCR data to the host device 3.
[0024] The printing unit 106 corresponds to the printing unit 1d in Figure 1, and receives a print execution instruction from the CPU 101 and performs printing processing based on the print data.
[0025] Figure 3 shows scale 2 -1 This figure shows an example of the hardware configuration. As shown in Figure 3, scale 2 -1 The hardware configuration includes a CPU 211, ROM 212, RAM 213, non-volatile memory 214, communication unit 215, and measurement unit 216.
[0026] The CPU 211, according to the program stored in the ROM 212 or non-volatile memory 214, uses the RAM 213 as work memory and scales 2 -1It controls the operation of the measurement unit 216. The measurement unit 216 receives an instruction from the CPU 211 to perform weight measurement and executes the weight measurement process.
[0027] The communication unit 215 communicates data with the printer 1 via a USB cable. For example, the communication unit 215 transmits scale data acquired during the weight measurement process to the printer 1. Here, as described above, the communication unit 215 performs USB communication with the printer 1's communication unit 105 using bulk transfer with a sufficiently short polling interval. This makes it possible for the communication unit 215 to transmit scale data to the printer 1 in near real-time as soon as the weight is measured.
[0028] Figure 4 shows BCR2 -2 This figure shows an example of the hardware configuration. As shown in Figure 4, BCR2 -2 The hardware configuration includes a CPU 221, ROM 222, RAM 223, non-volatile memory 224, communication unit 225, and reading unit 226.
[0029] The CPU 221 uses the RAM 223 as work memory and BCR2 according to the program stored in the ROM 222 or non-volatile memory 224. -2 It controls the operation of the reading unit 226. The reading unit 226 receives an instruction from the CPU 221 to execute barcode reading and performs the barcode reading process.
[0030] The communication unit 225 communicates data with the printer 1 via a USB cable. For example, the communication unit 225 transmits the BCR data acquired during the barcode reading process to the printer 1. Here, as described above, the communication unit 225 performs USB communication with the printer 1's communication unit 105 using interrupt transfer with a sufficiently short polling interval. This makes it possible for the communication unit 225 to transmit the BCR data to the printer 1 in near real-time as soon as the barcode is read.
[0031] Figure 5 shows an example of the hardware configuration of the host device 3. As shown in Figure 5, the host device 3 includes a CPU 301, ROM 302, RAM 303, non-volatile memory 304, hard disk 305, communication unit 306, operation unit 307, and display unit 308 as its hardware configuration.
[0032] The CPU 301 controls the operation of the host device 3 using the RAM 303 as work memory, according to the programs stored in the ROM 302, non-volatile memory 304, or hard disk 305. The hard disk 305 stores various programs and data.
[0033] The communication unit 306 has a function corresponding to the communication interface 3c in Figure 1 and communicates data with the printer 1 via a USB cable. For example, the communication unit 306 sends print data to the printer 1 along with a print command and receives status data indicating the print result from the printer 1. The communication unit 306 also receives status data acquired by the printer 1 and data from peripheral devices 2 -1 ,2 -2 The peripheral device acquisition data transmitted from the printer 1 is received from the printer 1. As described above, all data received by the communication unit 306 from the printer 1 can be structured data in JSON format converted from unstructured data in binary format.
[0034] Here, the communication unit 306 performs serial communication with the printer 1 using the Web Serial API launched by the web application 3a, as described above, for the process of receiving peripheral device data from the printer 1. On the other hand, data communication related to the printing process performed between the host device 3 and the printer 1, and the process by which the web application 3a obtains status data from the printer 1, may be performed using either the Web Serial API or the Web USB API.
[0035] The operation unit 307 is for the user to perform various operations, including operations related to generating print data and issuing print commands, and operations related to acquiring status data, BCR data, and scale data from printer 1, and is composed of a keyboard and mouse or a touch panel. The display unit 308 displays data such as images and text generated by the web application 3a, status data acquired from printer 1, and peripheral device 2 -1 ,2 -2 This device is used to display data related to acquired values, and is composed of, for example, an LCD display, an OLED display, etc.
[0036] Figure 6 is a block diagram showing an example of the functional configuration of printer 1. Here, the functional configuration related to printing is omitted, and only the functional configuration related to acquiring peripheral device data, which is the subject of this embodiment, is shown. As shown in Figure 6, printer 1 according to the first embodiment has a communication control unit 11, a serial communication unit 12, and a USB communication unit 13 as its functional configuration. The communication control unit 11 has a more specific functional configuration, which includes a structured data generation unit 11a and a structured data transmission unit 11b.
[0037] The above-mentioned functional blocks 11 to 13 perform the processes described below through the cooperation of hardware and software. For example, the processing of the communication control unit 11 is performed by the operation of a program stored in ROM 102 or non-volatile memory 104, controlled by a processor configured by a microcomputer equipped with a CPU 101, ROM 102, RAM 103, etc., as shown in Figure 2. In addition, the processing of the serial communication unit 12 and the USB communication unit 13 is performed by the operation of the communication unit 105 (communication interfaces 1a, 1b in Figure 1) according to the control of the communication control unit 11.
[0038] The USB communication unit 13 controls peripheral devices 2 according to the control of the communication control unit 11. -1 ,2 -2USB communication is performed between the two using bulk transfer or interrupt transfer with an interval time set to less than or equal to a predetermined time. As described above, the USB communication unit 13 is scale 2 -1 Bulk transfer is performed between and BCR2 -2 Interrupt transfer is performed between (hereinafter the same). The USB communication unit 13, as a USB host, repeatedly sends IN tokens to peripheral devices 2 at short intervals. -1 ,2 -2 Send to: Scale 2 -1 When it receives an IN token, if scale data exists at that time, it responds with scale data; otherwise, it responds that there is no data. -2 When an IN token is received, if BCR data exists at that time, it responds with BCR data; otherwise, it responds that there is no data. Peripheral device 2 -1 ,2 -2 The scale data and BCR data that are sent to printer 1 are unstructured data in binary format, formed according to the peripheral device vendor's proprietary protocol.
[0039] The communication control unit 11 controls the peripheral device 2 -1 ,2 -2 Triggered by a reception event of peripheral device acquisition data transmitted from peripheral device 2, -1 ,2 -2 Based on the peripheral device acquisition data received from the USB communication unit 13, the communication control unit 11 controls the transmission of JSON data generated from the peripheral device 2 to the web application 3a of the host device 3. In other words, the communication control unit 11 controls the USB communication unit 13, which is performing bulk transfer or interrupt transfer, to send data to the peripheral device 2 -1 ,2 -2 When it detects that scale data or BCR data has been received from the peripheral device, it generates JSON data based on the data acquired from the peripheral device and controls the serial communication unit 12 to send the JSON data to the web application 3a of the host device 3. The communication control unit 11 also sends data to the peripheral device 2 indicating that there is no scale data or BCR data. -1 ,2 -2 If data is received from [source], do not send that data to web application 3a.
[0040] When the communication control unit 11 transmits peripheral device acquired data to the host device 3, the structured data generation unit 11a generates data for the peripheral device 2 -1 ,2 -2 The peripheral device acquisition data received in binary data format is analyzed, and JSON data containing the acquired values is generated. The acquired values are the barcode readings in the case of BCR data, and the weight and units in the case of scale data. In addition to the weight and units, the acquired values for scale data include the scale 2 value when weight measurement processing is performed. -1 The structured data transmission unit 11b controls the serial communication unit 12 to transmit the JSON data generated by the structured data generation unit 11a to the host device 3.
[0041] Figure 7 shows an example of the format of JSON data generated by the structured data generation unit 11a. As shown in Figure 7, the JSON data of this embodiment contains information about the printer 1 (model information, destination information, peripheral device 2 connected to the printer 1). -1 ,2 -2 (List information) and scale 2 -1 Information regarding (Peripheral device ID, USB vendor ID, USB product ID, USB serial number, peripheral device type, weight key value (weight value, unit, stability status. null if none exist)) and BCR2 -2 This includes information about the peripheral device (peripheral device ID, USB vendor ID, USB product ID, USB serial number, type of peripheral device, and read key value (barcode reading value; null if not present)). In this way, two peripheral devices 2 connected to printer 1. -1 ,2 -2 The information related to this is handled together in a single JSON data file.
[0042] The serial communication unit 12 communicates with the host device 3 via a virtual serial port. The serial communication unit 12 communicates with peripheral devices 2 according to the control of the communication control unit 11. -1 ,2 -2Based on the peripheral device acquisition data obtained from the device, the structured data generation unit 11a generates JSON data, which is then sent to the web application 3a of the host device 3 via the virtual serial port.
[0043] Figure 8 shows an information processing system according to the first embodiment, where the web application 3a of the host device 3 is connected to peripheral device 2 -1 ,2 -2 This is a sequence diagram showing an example of the processing procedure for acquiring data from peripheral devices.
[0044] First, the user initiates a series of processes, for example, by pressing the connect button on the web application 3a (step S1). Upon receiving this instruction, the web application 3a searches for serial devices already connected to the host device 3 and displays the results as list information on the display unit 308 screen (step S2). This list information also includes information about printer 1, which supports the virtual serial port.
[0045] Here, the user selects one of the serial devices from the list, thereby granting the web application 3a access permission to the selected serial device (step S3). In this case, the user selects printer 1. As a result, the web application 3a obtains printer 1 as a serial port object that can communicate with it.
[0046] Next, for example, when the user presses the acquisition button for the peripheral device acquisition data on the web app 3a, etc., an instruction to acquire the peripheral device acquisition data is given (step S4). In response to this instruction, the web app 3a opens a virtual serial port by executing the open method of the SerialPort interface of the Web Serial API (step S5). As a result, the web app 3a becomes communicable with the printer 1 that supports the virtual serial port. Next, the web app 3a enters a standby state for receiving data from the printer 1 by executing the read method of the Reader instance reader (hereinafter referred to as the reader.read method) acquired from the SerialPort interface of the Web Serial API (step S6).
[0047] In parallel with the processing by the web app 3a as described above, USB communication by bulk transfer or interrupt transfer is constantly performed between the printer 1 and the peripheral device 2 -1 ,2 -2 The printer 1 repeatedly transmits an IN token to the peripheral device 2 -1 ,2 -2 at short interval time intervals as a USB host. As described above, when the scale -1 receives an IN token, it responds with scale data if there is scale data at that time, and responds that there is no data if there is no scale data. Also, the BCR2 -2 responds with BCR data if there is BCR data at that time when it receives an IN token, and responds that there is no data if there is no BCR data.<##
[0048] Here, at the timing after the web app 3a executes the reader.read method in step S6, when the barcode reading process is executed in the BCR2 -2 (step S7), the BCR2 -2 receives an IN token sent from the printer 1 immediately after that (step S8) and responds with BCR data to the printer 1 (step S9).
[0049] At this time, printer 1 generates JSON data containing the read key value, triggered by the BCR data reception event (step S10), and sends the generated JSON data to web application 3a (step S11). Since web application 3a is in a data waiting state at this stage, it is able to receive the JSON data. Figure 9 shows an example of the JSON data sent at this time. The JSON data shown in Figure 9 is BCR2 -2 The information includes the barcode reading key value, while scale 2 -1 Regarding the information, the weight key values (weight value, unit, stability state) are all null.
[0050] The web application 3a, upon receiving JSON data from printer 1, parses the JSON data to obtain the barcode reading key value (step S12) and provides the reading key value to the user (step S13). The reading key value is provided to the user, for example, by displaying the reading key value on the display unit 308. Since JSON data is human-readable text-based data, the parsing process can be simplified compared to the parsing of binary data.
[0051] After the key value is provided, the web application 3a enters a waiting state for data reception from printer 1 by executing the reader.read method again (step S14). Then, scale 2 -1 If the weight measurement process is performed in step S15, scale 2 -1 Immediately after receiving the IN token sent from printer 1 (step S16), it responds to printer 1 with scale data (step S17).
[0052] At this time, printer 1 generates JSON data containing weight key values, triggered by the scale data reception event (step S18), and sends the generated JSON data to web application 3a (step S19). Figure 10 shows an example of the JSON data sent at this time. The JSON data shown in Figure 10 is scale 2-1 The information includes weight key values (weight value, unit, stability state), while BCR2 -2 Regarding the information, the barcode reading key value is set to null.
[0053] The web application 3a, having received JSON data from printer 1, parses the JSON data to obtain the weight key value (step S20) and provides the weight key value to the user (step S21). The weight key value is provided to the user, for example, by displaying the weight key value on the display unit 308. After providing the weight key value, the web application 3a enters a waiting state for receiving data from printer 1 by executing the reader.read method again (step S22).
[0054] As explained in detail above, in the first embodiment, a first peripheral device 1 (a printer 1 as an example) is connected to the host device 3 running the web application 3a via USB, and a second peripheral device 2 (a scale 2 as an example) is connected to the first peripheral device 1. -1 and BCR2 -2 In an information processing system in which a second peripheral device 2 is connected via USB and the host device 3 acquires values (weight key value and read key value) from the second peripheral device 2 via the first peripheral device 1, the first peripheral device 1 receives peripheral device acquisition data, including the values acquired by the second peripheral device 2, from the second peripheral device 2 in the form of unstructured data (binary data), analyzes the received unstructured data to generate structured data (JSON data) including the acquired values, and transmits the generated structured data to the host device 3.
[0055] According to this first embodiment, the web application 3a of the host device 3 acquires values from the second peripheral device 2 via the first peripheral device 1 in the form of structured data. Therefore, the web application 3a does not need to handle unstructured data such as binary data, and there is no need to implement bitwise arithmetic processing in the web application 3a to interpret the contents of the data acquired by the peripheral device. Furthermore, there is no need to implement data processing in the web application 3a that handles unstructured data in accordance with the protocol of the second peripheral device 2. As a result, the implementation of the web application 3a can be simplified.
[0056] Furthermore, in the first embodiment, serial communication is performed between the web application 3a of the host device 3 and the first peripheral device 1 via a virtual serial port. When the first peripheral device 1 receives peripheral device acquisition data from the second peripheral device 2, the first peripheral device 1 transmits the peripheral device acquisition data received from the second peripheral device 2 to the web application 3a of the host device 3 via the virtual serial port in JSON data format.
[0057] According to the first embodiment configured in this way, as soon as the first peripheral device 1 receives peripheral device acquisition data from the second peripheral device 2, the first peripheral device 1 can proactively send JSON data to the web application 3a via the virtual serial port. The first peripheral device 1 does not need to wait for polling from the web application 3a, and can send JSON data to the web application 3a in near real-time as soon as it receives peripheral device acquisition data from the second peripheral device 2. Therefore, there is no time lag between receiving peripheral device acquisition data from the second peripheral device 2 and sending JSON data to the web application 3a. This reduces the time it takes for the host device 3 to acquire the values from the second peripheral device 2.
[0058] Furthermore, in the first embodiment, the second peripheral device 2 performs USB communication with the first peripheral device 1 using bulk transfer or interrupt transfer with an interval time set to less than or equal to a predetermined time, and transmits the peripheral device acquired data to the first peripheral device 1 within a predetermined time at the latest from the time the peripheral device acquired the data. As a result, there is almost no time lag between the time the second peripheral device 2 acquires the peripheral device acquired data and the time it transmits it to the first peripheral device 1. This makes it possible to shorten the time it takes from when the second peripheral device 2 acquires the peripheral device acquired data until the host device 3 acquires the acquired value.
[0059] It is not mandatory for the host device 3 and the printer 1 to communicate serially via a virtual serial port. For example, in applications where real-time performance is not strongly required for the host device 3 to acquire values from the second peripheral device 2, polling may be performed by periodically sending data acquisition request commands from the host device 3 to the printer 1 and acquiring JSON data as response data. This is also the case in the second to fourth embodiments described below.
[0060] Furthermore, in the first embodiment described above, as shown in Figure 7, two peripheral devices 2 are connected to the printer 1. -1 ,2 -2 The example format shown combines information related to the data into a single JSON file, but it is not limited to this format. For example, as shown in Figure 11, the JSON data for when scale data is included (Figure 11(a)) and the JSON data for when BCR data is included (Figure 11(b)) may be configured separately. In this case, the retrieved values included in the JSON data will never be null.
[0061] (Second embodiment) Next, a second embodiment of the present invention will be described with reference to the drawings. The overall configuration of the information processing system according to the second embodiment is the same as in Figure 1. First peripheral device 1 (printer 1), second peripheral device 2 (scale 2 -1and BCR2 -2 The hardware configuration of the ) and host device 3 is the same as in Figures 2 to 5. In the second embodiment, the functional configuration of the printer 1 differs from that of the first embodiment.
[0062] Figure 12 is a block diagram showing an example of the functional configuration of printer 1 according to the second embodiment. In Figure 12, components with the same reference numerals as those shown in Figure 6 have the same function, so redundant explanations are omitted here. As shown in Figure 12, printer 1 according to the second embodiment has a structured data generation unit 11a2 instead of structured data generation unit 11a in its functional configuration.
[0063] The structured data generation unit 11a2, upon receiving multiple peripheral device acquisition data from the second peripheral device 2 within a first interval time (e.g., 100 milliseconds), aggregates the multiple acquisition values contained in the multiple peripheral device acquisition data to generate a single structured data (JSON data). That is, instead of immediately generating JSON data and sending it to the printer 1 each time peripheral device acquisition data is acquired, the structured data generation unit 11a2 temporarily stores the peripheral device acquisition data acquired from the second peripheral device 2 in a storage unit (RAM 103 or non-volatile memory 104), waits for the first interval time to be reached after the initial acquisition of peripheral device acquisition data, and then aggregates the acquisition values contained in one or more peripheral device acquisition data stored in the storage unit to generate JSON data.
[0064] Figure 13 shows an information processing system according to the second embodiment, where the web application 3a of the host device 3 is connected to peripheral device 2 -1 ,2 -2 This is a sequence diagram showing an example of the processing procedure for acquiring data from peripheral devices. In Figure 13, the processes with the same step numbers as those shown in Figure 8 have the same content, so redundant explanations are omitted here.
[0065] Printer 1 first uses BCR2 -2When BCR data is received (step S9), the structured data generation unit 11a2 stores the BCR data in the storage unit and starts counting the first interval time (step S31). Alternatively, the read key value obtained by analyzing the BCR data may be stored in the storage unit. At this stage, the processes in steps S10 to S14 shown in Figure 8 are not executed.
[0066] Next, printer 1 scales 2 -1 When scale data is received from (step S17), the structured data generation unit 11a2 stores the scale data in the storage unit and continues counting the first interval time (step S32). At this stage, the processes shown in steps S18 to S22 in Figure 8 are not executed.
[0067] Subsequently, when the structured data generation unit 11a2 detects that the first interval time has been reached since the printer 1 first received the BCR data in step S9, it resets the count value and uses the scale data and BCR data stored in the storage unit at that time to aggregate the weight key value and the read key value to generate a single JSON data (step S33). Then, the structured data transmission unit 11b transmits the JSON data generated by the structured data generation unit 11a2 to the web application 3a (step S34). Figure 14 shows an example of the JSON data transmitted at this time. The JSON data shown in Figure 14 is scale 2 -1 The information includes weight key values, as well as BCR2 -2 The information includes the barcode reading key value.
[0068] The web application 3a, having received JSON data from printer 1, parses the JSON data to obtain weight key values and read key values (step S35), and provides the obtained weight key values and read key values to the user (step S36). The weight key values and read key values are provided to the user, for example, by displaying them on the screen of the display unit 308. After providing the weight key values and read key values, the web application 3a enters a waiting state for receiving data from printer 1 by executing the reader.read method again (step S37).
[0069] According to the second embodiment configured as described above, the number of times JSON data is sent from the printer 1 to the web application 3a can be reduced compared to the first embodiment. This makes it possible to reduce the amount of data transmitted and the amount of processing required by the web application 3a.
[0070] In the second embodiment, the structured data generation unit 11a2 may perform the following processing. That is, the structured data generation unit 11a2 processes peripheral device 2 -1 ,2 -2 The first interval time count begins when data acquired from the peripheral device is received, and then the peripheral device 2 -1 ,2 -2 Each time data acquired from a peripheral device is received within the first interval, the count value for the first interval is reset and the count is restarted, and this operation is repeated. Then, the structured data generation unit 11a2 generates data from the peripheral device 2 -1 ,2 -2 During repeated operations from the first interval until no more peripheral device data is received, multiple acquired values contained in multiple peripheral device data are aggregated to generate a single JSON data.
[0071] For example, in the sequence diagram shown in Figure 13, in step S9, printer 1 is BCR2 -2 Within the first interval from when BCR data is received, scale 2 -1When scale data is received from the peripheral device 2 (step S17), the structured data generation unit 11a2 resets the count value for the first interval time and restarts counting. Subsequently, the structured data generation unit 11a2 generates the data from the peripheral device 2 -1 ,2 -2 If the system detects that the elapsed time since the count resumed has reached the first interval without receiving any peripheral device data, it uses the scale data and BCR data stored in the memory unit at that point to aggregate the weight key value and read key value to generate a single JSON data.
[0072] Furthermore, after the printer 1 receives the scale data in step S17, the peripheral device 2 will restart the count within the first interval time from that point. -1 ,2 -2 When data is received from a peripheral device, the structured data generation unit 11a2 resets the count value of the first interval time and restarts counting. Then, within the first interval time in which the counting was restarted, the structured data generation unit 11a2 receives data from the peripheral device 2 -1 ,2 -2 If it detects that no peripheral device data has been received, the three acquired values from the three peripheral device data acquired during the previous repeated operations are aggregated to generate a single JSON data.
[0073] (Third embodiment) Next, a third embodiment of the present invention will be described with reference to the drawings. The overall configuration of the information processing system according to the third embodiment is the same as in Figure 1. First peripheral device 1 (printer 1), second peripheral device 2 (scale 2 -1 and BCR2 -2 The hardware configuration of the ) and host device 3 is the same as in Figures 2 to 5. In the third embodiment, the functional configuration of the printer 1 differs from that of the first embodiment.
[0074] Figure 15 is a block diagram showing an example of the functional configuration of printer 1 according to the third embodiment. In Figure 15, components with the same reference numerals as those shown in Figure 6 have the same function, so redundant explanations are omitted here. As shown in Figure 15, printer 1 according to the third embodiment has a structured data generation unit 11a3 instead of structured data generation unit 11a as part of its functional configuration.
[0075] If the structured data generation unit 11a3 does not receive any peripheral device acquisition data from the second peripheral device 2 within the second interval time (e.g., 10 seconds), it generates structured data (JSON data) that does not contain acquisition values. JSON data that does not contain acquisition values is data in which all acquisition values are null. The processing when peripheral device acquisition data is received within the second interval time is the same as in the first embodiment.
[0076] Figure 16 shows an information processing system according to the third embodiment, where the web application 3a of the host device 3 is connected to peripheral device 2 -1 ,2 -2 This is a sequence diagram showing an example of the processing procedure when obtaining JSON data that does not include the values obtained in Figure 16. In Figure 16, the processes with the same step numbers as those shown in Figure 8 have the same content, so redundant explanations are omitted here.
[0077] The structured data generation unit 11a3 starts counting the second interval time, for example, from the moment the printer 1 is turned on. When the elapsed time reaches the second interval time, it resets the count value and starts counting the second interval time again. The structured data generation unit 11a repeats this counting operation.
[0078] For example, in step S6, before the web application 3a executes the reader.read method, scale 2 -1 The weight measurement process is also done using BCR2 -2When the system detects that the second interval time has been reached without the barcode reading process being performed and without the reception of BCR data or scale data, the structured data generation unit 11a3 generates JSON data that does not include the acquired values (step S41).
[0079] Then, the structured data transmission unit 11b sends the JSON data generated by the structured data generation unit 11a3 to the web application 3a (step S42). Figure 17 shows an example of the JSON data sent at this time. The JSON data shown in Figure 17 is scale 2 -1 Regarding the information, the weight key value is set to null, and BCR2 -2 The barcode reading key value is set to null in relation to this information. However, at this stage, web application 3a is not yet in a data waiting state, so it cannot receive JSON data.
[0080] On the other hand, if, after the web application 3a executes the reader.read method in step S6, the second interval time is detected again without any reception of BCR data or scale data, the structured data generation unit 11a3 generates JSON data again that does not include the acquired values (step S43).
[0081] Then, the structured data transmission unit 11b sends the JSON data generated by the structured data generation unit 11a3 to the web application 3a (step S44). The JSON data sent at this time is the same as that shown in Figure 17. At this stage, the web application 3a is in a data waiting state and is therefore capable of receiving the JSON data.
[0082] When web application 3a receives JSON data from printer 1, it parses the JSON data and confirms that both the weight key value and the read key value are null, then it detects peripheral device 2 connected to printer 1. -1 ,2 -2 Based on the list information, scale 2 -1 and BCR2-2 Verify that it is connected to printer 1 (step S45). Then, web app 3a will run scale 2 -1 and BCR2 -2 The system notifies the user that it is successfully connected to printer 1 (step S46). This notification is made, for example, by displaying a message on the screen of the display unit 308. After this notification, the web application 3a enters a waiting state for data reception from printer 1 by executing the reader.read method again (step S47).
[0083] According to this third embodiment, if the acquisition of peripheral device data is not performed by the second peripheral device 2 for a long period of time (for example, 10 seconds), the web application 3a can check whether communication with the second peripheral device 2 is possible. In other words, the web application 3a can check the communication status with the second peripheral device 2 based on the results of the actual communication between it and the printer 1.
[0084] Although this example describes an application of the third embodiment to the first embodiment, it is also possible to apply the third embodiment to the second embodiment.
[0085] (Fourth embodiment) Next, a fourth embodiment of the present invention will be described with reference to the drawings. Figure 18 is a diagram showing an example of the overall configuration of an information processing system according to the fourth embodiment. As shown in Figure 18, in the fourth embodiment, two host devices 3 -1 ,3 -2 It is connected to printer 1. First host device 3 -1 Scale 2 -1 or BCR2 -2 The second host device 3 acquires data from either of the peripheral devices. -2 Scale 2 -1 or BCR2 -2 The data acquired from the other peripheral device is obtained from either the first host device 3. -1 Scale 2 -1Scale data is obtained from the second host device 3 -2 BCR2 -2 This explanation assumes that BCR data is obtained from [source].
[0086] First peripheral device 1 (printer 1), second peripheral device 2 (scale 2) -1 and BCR2 -2 ) and host device 3 -1 ,3 -2 The hardware configuration is the same as in Figures 2 to 5. In the fourth embodiment, the functional configuration of printer 1 differs from that of the first embodiment.
[0087] Figure 19 is a block diagram showing an example of the functional configuration of printer 1 according to the fourth embodiment. In Figure 14, components with the same reference numerals as those shown in Figure 6 have the same functions, so redundant explanations are omitted here. As shown in Figure 19, printer 1 according to the fourth embodiment has a functional configuration that includes a structured data generation unit 11a4 instead of a structured data generation unit 11a, and further includes a structured data management unit 11c.
[0088] In the first to third embodiments described above, when the web application 3a receives JSON data from the printer 1, the web application 3a immediately processes the JSON data and sends it to the peripheral device 2 -1 ,2 -2 The values obtained were acquired and provided to the user. In contrast, in the fourth embodiment, the host device 3 -1 ,3 -2 Host device 3 determines when to process the JSON data obtained from printer 1 and retrieve the acquired values. -1 ,3 -2 Web application 3a defined by -1 ,3a -2 This will allow users to decide arbitrarily when to retrieve the values in the web application 3a. -1 ,3a -2 It can be determined by the instructions given to them.
[0089] The structured data management unit 11c of printer 1 is connected to peripheral device 2 -1 ,2 -2 Peripheral device acquisition data received from host device 3 -1 ,3 -2 web app 3a -1 ,3a -2 The data is stored in the storage unit (RAM 103 or non-volatile memory 104) until a processing completion notification is received from the web application 3a. -1 ,3a -2 When a processing completion notification is received from the peripheral device 2, the peripheral device data identified by the processing completion notification is deleted from the storage unit. Here, the structured data management unit 11c identifies the peripheral device 2 that is the source of the peripheral device data. -1 ,2 -2 The peripheral device acquisition data is stored in the storage unit, associated with identifiable information (e.g., peripheral device ID). Alternatively, the acquired values obtained by analyzing the peripheral device acquisition data may also be stored.
[0090] Host device 3 -1 ,3 -2 The completion notification from the host device 3 to printer 1 is executed using the write method of the Writer instance writer obtained from the SerialPort interface of the Web Serial API (hereinafter referred to as writer.write method). This completion notification can also be done using data in JSON format. In the following description, the JSON data used for the completion notification will be referred to as "completion notification JSON data", and printer 1 will be referred to as host device 3. -1 ,3 -2 To distinguish between the two, the JSON data used when sending peripheral device acquisition data is referred to as "peripheral device JSON data".
[0091] Figure 20 shows host device 3 -1 ,3 -2 This figure shows an example of the format of the completion notification JSON data sent from to printer 1. As shown in Figure 20, the completion notification JSON data contains information about printer 1 (model information, destination information, peripheral device 2 connected to printer 1). -1 ,2 -2(List information) and the source peripheral device 2 from which the processed peripheral device acquired data was obtained. -1 ,2 -2 Information regarding peripheral device ID and peripheral device acquisition data is stored on host device 3. -1 ,3 -2 Includes flag information indicating that it was obtained.
[0092] The structured data generation unit 11a4 is connected to the peripheral device 2 -1 ,2 -2 Each time peripheral device acquisition data is received, the acquired values contained in the peripheral device acquisition data stored in the memory unit at that time and the newly received peripheral device acquisition data are aggregated to generate a single structured data (peripheral device JSON data).
[0093] The format of the peripheral device JSON data used in the fourth embodiment is basically the same as that shown in Figure 7, and includes information about printer 1 and scale 2 -1 Information regarding BCR2 -2 This includes information about two peripheral devices 2 connected to printer 1. -1 ,2 -2 Information regarding this is handled collectively in a single peripheral device JSON data. Furthermore, in the fourth embodiment, peripheral device 2 -1 ,2 -2 In addition to the acquired values contained in the peripheral device acquisition data received from the device, the acquired values contained in the peripheral device acquisition data stored in the memory unit at that time are also combined and handled as a single peripheral device JSON data.
[0094] Figure 21 shows an example of the configuration of peripheral device JSON data used in the fourth embodiment. In Figure 21, printer 1 is scale 2 -1 We receive scale data twice from BCR2 -2 BCR data is received twice from host device 3. -1 ,3 -2 This shows an example of peripheral device JSON data configured when no process for acquiring data from those peripheral devices has been performed yet.
[0095] As shown in Figure 21, Scale 2 -1 For the scale data obtained, one or more obtained values are sequentially added to the array of weight key values. -1 The most recent weight key value obtained (marked as the second data) is recorded at the top, and the previous weight key value stored in the memory (marked as the first data) is recorded immediately after it. BCR2 -2 For BCR data obtained from the system, one or more read key value strings are sequentially appended to the end of the previous read key value string. In the example in Figure 21, the second read key value is appended to the end of the first read key value. Note that the recording method shown here is just one example and is not limited to this.
[0096] Host device 3 -1 ,3 -2 web app 3a -1 ,3a -2 As shown in Figure 21, the peripheral device JSON data is received from printer 1, and at any time, the device executes a process to obtain peripheral device acquired data (weight key value or read key value) from the peripheral device JSON data, and sends completion notification JSON data to printer 1. As shown in Figure 20, the completion notification JSON data is sent to peripheral device 2, the source from which the processed peripheral device acquired data was obtained. -1 ,2 -2 Includes a identifiable peripheral device ID. First host device 3 -1 It acquires scale data and the second host device 3 -2 Since it is intended to acquire BCR data, the first host device 3 -1 The completion notification JSON data sent from to printer 1 contains scale 2 -1 The peripheral device ID is included, and the second host device 3 -2 The completion notification JSON data sent from to printer 1 contains BCR2 -2 This includes the peripheral device ID.
[0097] Figures 22A and 22B show the host device 3 in the information processing system according to the fourth embodiment. -1 ,3-2 web app 3a -1 ,3a -2 Peripheral device 2 -1 ,2 -2 This is a sequence diagram showing an example of the processing procedure for acquiring data from peripheral devices.
[0098] In Figure 22A, the processes in steps S51 to S56 are the same as the processes in steps S1 to S6 shown in Figure 13. Here, the first host device 3 -1 In the first web application 3a -1 This shows the process to be executed. Note that in step S54, for example, the user accesses the first web application 3a -1 Press the weight measurement button above to instruct the system to acquire scale data.
[0099] The processing in the following steps S57 to S60 is the same as the processing in steps S15 to S17 and S32 shown in Figure 13. In step S60, the structured data management unit 11c performs a scale 2 -1 The scale data obtained from or the weight key values contained therein are stored in the memory unit.
[0100] The structured data generation unit 11a4 aggregates the acquired values of one or more peripheral device acquired data stored in the storage unit, including the most recent peripheral device acquired data stored in the storage unit in step S60, to generate one peripheral device JSON data (step S61). At this stage, the storage unit contains only one weight key value of the scale data stored in step S60, so the generated peripheral device JSON data will look like Figure 23. The peripheral device JSON data shown in Figure 23 contains one weight key value, while the read key value is null.
[0101] The structured data transmission unit 11b transmits the peripheral device JSON data generated by the structured data generation unit 11a4 to the first web application 3a -1 Send to (step S62). In the example in Figure 22A, the first web application 3a receives the peripheral device JSON data. -1At this stage, the peripheral device JSON data has not yet been processed to obtain the weight key value. In this case, the first web application 3a -1 For example, after receiving JSON data from printer 1 to the peripheral device, the reader.read method is executed again after a predetermined time, thereby putting the device into a waiting state for receiving data from printer 1 (step S63).
[0102] The processes in steps S64 to S69 described below are the same as the processes in steps S51 to S56 described above. However, here the second host device 3 -2 In the second web application 3a -2 This indicates the process to be performed. In this case, step S67 is, for example, when the user accesses the second web application 3a -2 Press the barcode scanning button above to instruct the system to acquire BCR data.
[0103] The processing in the following steps S70 to S73 is the same as the processing in steps S57 to S60 described above. In step S73, the structured data management unit 11c performs a scale 2 -1 The second set of scale data obtained from the first set, or the weight key values contained therein, is added to the memory unit and stored. As a result, the memory unit stores the scale data obtained from the first and second sets of scale data (weight key value 1 and weight key value 2).
[0104] The structured data generation unit 11a4 aggregates the acquired values of one or more peripheral device acquired data stored in the storage unit, including the most recent peripheral device acquired data added to the storage unit in step S73, to generate a single peripheral device JSON data (step S74). The peripheral device JSON data generated at this stage is shown in Figure 24. The peripheral device JSON data shown in Figure 24 includes two weight key values, while the read key value is null.
[0105] The structured data transmission unit 11b transmits the peripheral device JSON data generated by the structured data generation unit 11a4 to the first web application 3a -1 and the second web application 3a-2 Send to (steps S75, S76). In the example shown in Figure 22A, the first web application 3a receives the peripheral device JSON data. -1 At this stage, the peripheral device JSON data has not yet been processed to obtain the weight key value. In this case, the first web application 3a -1 For example, after receiving JSON data from printer 1 to the peripheral device, the reader.read method is executed again after a predetermined time, thereby putting the device into a waiting state for receiving data from printer 1 (step S77).
[0106] Also, the second web application 3a -2 Since no instruction has been given to acquire scale data, the received peripheral device JSON data is not processed to obtain the weight key value. In this case, the second web application 3a -2 For example, after receiving JSON data from printer 1 to the peripheral device, the reader.read method is executed again after a predetermined time, putting the system into a waiting state for receiving data from printer 1 (step S78). The process then proceeds to the steps shown in Figure 22B.
[0107] Note that before printer 1 acquires the second scale data, the second web application 3a -2 Because the processing has started, the second peripheral device JSON data is sent from printer 1 to the second web application 3a -2 It is also sent to the second web application 3a. -2 If processing has not started, the second peripheral device JSON data will also be processed by the first web application 3a -1 It is sent only to [target audience].
[0108] In Figure 22B, the processing in steps S79 to S82 is the same as the processing in steps S7 to S9 and S31 shown in Figure 13. In step S82, the structured data management unit 11c controls BCR2 -2The first BCR data obtained from the device, or the read key values contained therein, is added to the memory unit and stored. As a result, the memory unit stores the scale data and BCR data (two weight key values 1 and 2 and one read key value 1) obtained from the first to the third time.
[0109] The structured data generation unit 11a4 aggregates the acquired values of one or more peripheral device acquired data stored in the storage unit, including the most recent peripheral device acquired data added to the storage unit in step S82, to generate one peripheral device JSON data (step S83). The peripheral device JSON data generated at this stage is shown in Figure 25. The peripheral device JSON data shown in Figure 25 includes two weight key values and one read key value.
[0110] The structured data transmission unit 11b transmits the peripheral device JSON data generated by the structured data generation unit 11a4 to the first web application 3a -1 and the second web application 3a -2 Send to (steps S84, S85). Here the second web application 3a -2 The received peripheral device JSON data is not being processed. In this case, the second web application 3a -2 The system enters a waiting state for receiving data from printer 1 by executing the reader.read method again after a predetermined time has elapsed since receiving JSON data from the peripheral device (step S86).
[0111] On the other hand, in the example shown in Figure 22B, the first web application 3a receives peripheral device JSON data. -1 At this stage, the peripheral device JSON data is processed to obtain weight key values 1 and 2 (step S87). In this case, the first web application 3a -1 The acquired weight key values 1 and 2 are provided to the user (step S88), and then the reader.read method is executed again to put the system into a waiting state for data reception from printer 1 (step S89).
[0112] Also, the first web application 3a-1 The system then sends the completion notification JSON data to printer 1 (step S90). Figure 26 shows the completion notification JSON data that is sent at this time. As shown in Figure 26, this completion notification JSON data contains the scale 2, which is the source of the weight key values 1 and 2. -1 It includes a peripheral device ID indicating the completion of this process. Printer 1, upon receiving this completion notification, will use the scale 2 indicated in the completion notification JSON data. -1 Based on the peripheral device ID, the scale data (weight key values 1, 2) is deleted from the storage unit (step S91).
[0113] The processing in the following steps S92 to S95 is the same as the processing in steps S79 to S82 described above. In step S95, the structured data management unit 11c controls BCR2 -2 The second BCR data obtained from the first BCR, or the read key values contained therein, is added to the memory unit and stored. Since the scale data (weight key values 1 and 2) was deleted from the memory unit in step S91, the memory unit now stores the BCR data obtained for the third and fourth times (two read key values 1 and 2).
[0114] The structured data generation unit 11a4 aggregates the acquired values of one or more peripheral device acquired data stored in the storage unit, including the most recent peripheral device acquired data added to the storage unit in step S95, to generate a single peripheral device JSON data (step S96). The peripheral device JSON data generated at this stage is shown in Figure 27. The peripheral device JSON data shown in Figure 27 includes two read key values 1 and 2, while the weight key value is null.
[0115] The structured data transmission unit 11b transmits the peripheral device JSON data generated by the structured data generation unit 11a4 to the first web application 3a -1 and the second web application 3a -2 Send to (steps S97, S98). First web application 3a -1Since no instruction has been given to acquire BCR data, the received peripheral device JSON data is not processed to obtain read key values 1 and 2. In this case, the first web application 3a -1 For example, after receiving JSON data from printer 1 to the peripheral device, the reader.read method is executed again after a predetermined time, thereby putting the device into a waiting state for receiving data from printer 1 (step S99).
[0116] On the other hand, in the example shown in Figure 22B, the second web application 3a receives the peripheral device JSON data. -2 At this stage, the peripheral device JSON data is processed to obtain read key values 1 and 2 (step S100). In this case, the second web application 3a -2 The acquired read key values 1 and 2 are provided to the user (step S101), and then the reader.read method is executed again to put the system into a waiting state for receiving data from printer 1 (step S102).
[0117] Also, the second web application 3a -2 The completion notification JSON data is sent to printer 1 (step S103). Figure 28 shows the completion notification JSON data that is sent at this time. As shown in Figure 28, this completion notification JSON data contains the BCR2, which is the source of the read key values 1 and 2. -2 It includes a peripheral device ID indicating the BCR2 indicated in the completion notification JSON data. Printer 1, upon receiving this processing completion notification, will use the BCR2 indicated in the completion notification JSON data. -2 Based on the peripheral device ID, the BCR data (read key values 1, 2) is deleted from the storage unit (step S104).
[0118] According to the fourth embodiment configured as described above, a plurality of host devices 3 -1 ,3 -2 It is connected to printer 1, and each person can use peripheral device 2. -1 ,2 -2In different configurations, peripheral device JSON data transmitted from printer 1 can be processed at any desired time. Furthermore, the fourth embodiment can also be applied when a single host device 3 is connected to printer 1.
[0119] As illustrated in Figure 21, scale 2 -1 One or more weight key values obtained from and BCR2 -2 An example format is shown for aggregating and recording one or more read key values obtained from the peripheral device into a single peripheral device JSON data, but it is not limited to this. For example, as shown in Figure 11, scale 2 -1 Peripheral device JSON data containing only one or more weight key values obtained from BCR2 -2 The peripheral device JSON data, which contains only one or more read key values obtained from the device, may be configured separately.
[0120] In this case, peripheral device JSON data containing only weight key values is sent to the first host device 3 -1 While sending only to the second host device 3, peripheral device JSON data containing only the read key value is sent to the second host device 3. -2 It may also be configured to send only to the first host device 3. Here, for example, peripheral device JSON data containing only weight key values is sent to the first host device 3. -1 If the read key value is not stored in the storage unit at the time of transmission, the second host device 3 -2 Peripheral device JSON data may not be sent to the second host device 3. Alternatively, as in the third embodiment, peripheral device JSON data that does not include the read key value (peripheral device JSON data with a read key value of null) is sent to the second host device 3. -2 It may also be configured to send peripheral device JSON data containing only the read key value to the second host device 3. -2 The same applies if the weight key value is not stored in the memory unit at the time of transmission.
[0121] In the first to fourth embodiments described above, the second peripheral device 2 connected to the printer 1 is the scale 2 -1 and BCR2 -2While examples of its use have been described, it is not limited to these. For example, it is also possible to connect output devices such as customer displays, card readers, keyboards, etc., instead of or in addition to these.
[0122] Furthermore, while the first to fourth embodiments described above describe an example in which a printer 1 is used as the first peripheral device 1, the invention is not limited to this. For example, instead of the printer 1, output devices such as a customer display, or input devices such as a BCR, scale, card reader, or keyboard may be connected between the host device 3 and the second peripheral device 2.
[0123] Furthermore, while the first to fourth embodiments described above illustrate the use of JSON as the format for structured data, the invention is not limited to this. For example, XML may be used, as well as NDJSON (Newline Delimited JSON), YAML (YAML Ain't Markup Language), and others. In addition, it is possible to use structured data in a format consisting of text data that is easily interpretable by humans.
[0124] Furthermore, while the first to fourth embodiments described above illustrate examples of USB communication between the first peripheral device 1 and the second peripheral device 2, the system is not limited to these examples. For instance, serial communication or Bluetooth communication may also be used.
[0125] Furthermore, as an additional modification to the first to fourth embodiments described above, when a peripheral device is additionally connected to the printer 1, the printer 1 may send data (for example, data containing a boolean value with "connected" as the key value) to the host device 3 in JSON data format to notify the host device 3 that an additional connection has been made.
[0126] Furthermore, the first to fourth embodiments described above can be combined and applied as appropriate. An example of an applicable configuration is summarized below.
[0127] [Configuration 1] An information processing system in which a first peripheral device is connected to a host device that runs a web application, a second peripheral device is connected to the first peripheral device, and the host device acquires values from the second peripheral device via the first peripheral device, The first peripheral device receives the peripheral device acquisition data, including the acquired values, from the second peripheral device in the form of unstructured data, analyzes the received unstructured data to generate structured data including the acquired values, and transmits the generated structured data to the host device. An information processing system characterized by the following:
[0128] [Configuration 2] When the first peripheral device receives multiple peripheral device acquisition data from the second peripheral device within the first interval, it aggregates the multiple acquisition values contained in the multiple peripheral device acquisition data to generate a single structured data. The information processing system according to configuration 1, characterized by the features described above.
[0129] [Configuration 3] The first peripheral device starts counting a first interval time when it receives peripheral device acquisition data from the second peripheral device. Subsequently, each time it receives peripheral device acquisition data from the second peripheral device within the first interval time, it resets the count value of the first interval time and restarts counting. This operation is repeated until no peripheral device acquisition data is received from the second peripheral device within the first interval time. During this repeated operation, multiple acquisition values contained in multiple peripheral device acquisition data acquired are aggregated to generate a single structured data. The information processing system according to configuration 1, characterized by the features described above.
[0130] [Structure 4] If the first peripheral device does not receive any data acquired by the second peripheral device within the second interval, it generates structured data that does not include the acquired values. An information processing system according to any one of configurations 1 to 3, characterized by the above.
[0131] [Composition 5] The first peripheral device described above is An acquisition data management unit that stores the peripheral device acquisition data or the acquired values contained in the peripheral device acquisition data received from the second peripheral device in a storage unit until it receives a processing completion notification from the host device, and deletes the peripheral device acquisition data or the acquired values indicated in the processing completion notification from the storage unit when it receives the processing completion notification from the host device. Each time the second peripheral device receives data acquired by the peripheral device, a structured data generation unit generates the structured data using the acquired values stored in the storage unit at that time and the newly acquired values. The structured data transmission unit transmits the structured data generated by the structured data generation unit to the host device. The host device, at any time it receives the structured data from the first peripheral device, executes a process to obtain the acquired values from the structured data, and sends a processing completion notification to the first peripheral device that includes information that can identify the source of the acquired values. An information processing system according to any one of configurations 1 to 4, characterized by the above.
[0132] [Composition 6] The host device and the first peripheral device are connected via USB, and the first peripheral device and the second peripheral device are connected via USB. The first peripheral device communicates with the host device via a virtual serial port, and, triggered by a reception event of the unstructured data transmitted from the second peripheral device, generates the structured data and transmits the generated structured data to the host device. An information processing system according to any one of configurations 1 to 5, characterized by the above.
[0133] [Composition 7] A peripheral device (corresponding to the first peripheral device 1 described above) that connects to a host device that runs a web application and other peripheral devices (corresponding to the second peripheral device 2 described above) and provides the host device with values acquired by the other peripheral devices, The peripheral device receives data, including the acquired values mentioned above, in unstructured data format from the other peripheral device, analyzes the received unstructured data to generate structured data including the acquired values, and transmits the generated structured data to the host device. A peripheral device characterized by the following features.
[0134] [Structure 8] An information processing method for a system comprising a host device running a web application, a first peripheral device connected to the first peripheral device, and a second peripheral device connected to the first peripheral device, wherein the acquired values from the second peripheral device are provided to the host device via the first peripheral device, The first peripheral device includes a first step of receiving peripheral device acquisition data, including the acquired value, from the second peripheral device in the form of unstructured data, The first peripheral device described above includes a second step of analyzing the unstructured data received in the first step to generate structured data including the acquired values, The first peripheral device has a third step of transmitting the structured data generated in the second step to the host device. An information processing method characterized by the following:
[0135] Furthermore, the above embodiments are merely examples of how the present invention may be implemented, and the technical scope of the invention should not be interpreted as being limited by them. In other words, the present invention can be implemented in various ways without departing from its gist or its main features. [Explanation of Symbols]
[0136] 1. First peripheral device (printer) 2. Second peripheral device (scale, BCR) 3 Host device 3a Web app 11. Communication Control Unit 11a, 11a2~11a4 Structured data generation unit 11b Structured Data Transmission Unit 11c Structured Data Management Department 12 Serial Communication Unit 13 USB communication unit
Claims
1. An information processing system in which a first peripheral device is connected to a host device that runs a web application, a second peripheral device is connected to the first peripheral device, and the host device acquires values from the second peripheral device via the first peripheral device, The first peripheral device receives the peripheral device acquisition data, including the acquired values, from the second peripheral device in the form of unstructured data, analyzes the received unstructured data to generate structured data including the acquired values, and transmits the generated structured data to the host device. An information processing system characterized by the following:
2. When the first peripheral device receives multiple peripheral device acquisition data from the second peripheral device within the first interval, it aggregates the multiple acquisition values contained in the multiple peripheral device acquisition data to generate a single structured data. The information processing system according to feature 1.
3. The first peripheral device starts counting a first interval time when it receives peripheral device acquisition data from the second peripheral device. Subsequently, each time it receives peripheral device acquisition data from the second peripheral device within the first interval time, it resets the count value of the first interval time and restarts counting. This operation is repeated until no peripheral device acquisition data is received from the second peripheral device within the first interval time. During this repeated operation, multiple acquisition values contained in multiple peripheral device acquisition data acquired are aggregated to generate a single structured data. The information processing system according to feature 1.
4. If the first peripheral device does not receive any data acquired by the second peripheral device within the second interval, it generates structured data that does not include the acquired values. The information processing system according to feature 1.
5. The first peripheral device described above is An acquisition data management unit that stores the peripheral device acquisition data or the acquired values contained in the peripheral device acquisition data received from the second peripheral device in a storage unit until it receives a processing completion notification from the host device, and deletes the peripheral device acquisition data or the acquired values indicated in the processing completion notification from the storage unit when it receives the processing completion notification from the host device. Each time the second peripheral device receives data acquired by the peripheral device, the structured data generation unit generates the structured data using the acquired values stored in the storage unit at that time and the newly acquired values. The structured data transmission unit transmits the structured data generated by the structured data generation unit to the host device. The host device, at any time it receives the structured data from the first peripheral device, executes a process to obtain the acquired values from the structured data, and sends a processing completion notification to the first peripheral device that includes information that can identify the source of the acquired values. The information processing system according to feature 1.
6. The host device and the first peripheral device are connected via USB, and the first peripheral device and the second peripheral device are connected via USB. The first peripheral device communicates with the host device via a virtual serial port, and, triggered by a reception event of the unstructured data transmitted from the second peripheral device, generates the structured data and transmits the generated structured data to the host device. The information processing system according to any one of claims 1 to 5.
7. A peripheral device that connects to a host device and other peripheral devices that run a web application, and provides values acquired by the other peripheral devices to the host device, The peripheral device receives the acquired data, including the above-mentioned acquired values, in unstructured data format from the other peripheral device, analyzes the received unstructured data to generate structured data including the above-mentioned acquired values, and transmits the generated structured data to the host device. A peripheral device characterized by the following features.
8. An information processing method for a system comprising a host device running a web application, a first peripheral device connected to the first peripheral device, and a second peripheral device connected to the first peripheral device, wherein the acquired values from the second peripheral device are provided to the host device via the first peripheral device, The first peripheral device receives the peripheral device acquisition data, including the acquired value, from the second peripheral device in the form of unstructured data, The first peripheral device described above includes a second step of analyzing the unstructured data received in the first step to generate structured data including the acquired values, The first peripheral device has a third step of transmitting the structured data generated in the second step to the host device. An information processing method characterized by the following: