Communication device, communication system, and computer program

The communication device employs a combination of push-type and pull-type communication methods to ensure reliable data transmission, particularly when transitioning from an offline to an online state, thereby addressing the uncertainty in existing systems.

JP2025087087APending Publication Date: 2025-06-10BROTHER KOGYO KK
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
JP2023201492
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Filing Date
2023-11-29
Publication Date
2025-06-10

AI Technical Summary

Technical Problem

Existing communication systems do not ensure sufficient certainty of data transmission to mobile phones, particularly when the communication state changes, such as when the phone is temporarily offline.

Method used

A communication device is configured with a first communication unit for push-type communication, a second communication unit for pull-type communication, and a controller. When transitioning from offline to online, the controller uses the pull-type communication unit to request and receive target data from an external device until all data is confirmed received.

Benefits of technology

This configuration ensures that target data is reliably received by the communication device even when it is offline, improving the certainty of data transmission by repeatedly requesting and confirming receipt of data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2025087087000001_ABST
    Figure 2025087087000001_ABST
Patent Text Reader

Abstract

To improve reliability of transmission of target data to be transmitted from an external device to a communication device.SOLUTION: A communication device comprises: a first communication unit that receives data from an external device by means of a push type communication method; a second communication unit that receives data from the external device by means of a pull type communication method; and a controller. The controller receives target data to be processed by the communication device which is autonomously transmitted from the external device using the first communication unit when it is in an on-line state, receives target data from the external device as a response for a request signal using the second communication unit when it is switched from an off-line state to the on-line state, and repeats transmitting the request signal to the external device using the second communication unit until it is determined that there is no unreceived target data in the external device.SELECTED DRAWING: Figure 5
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This specification relates to a communication device, a communication system, and a computer program.

Background Art

[0002] Patent Document 1 discloses an instant messaging service system used for message exchange between the mobile phone of User A and the mobile phone of User B. In this system, a push-type communication and a pull-type communication are used in combination to reduce unnecessary communication.

Prior Art Documents

Patent Documents

[0003]

Patent Document 1

Summary of the Invention

Problems to be Solved by the Invention

[0004] However, in the above technology, the communication state of the mobile phone is not considered. For this reason, for example, when there is a change in the communication state such as the mobile phone being temporarily offline, the certainty of data transmission to the mobile phone may not be sufficient.

[0005] This specification discloses a technology that can improve the certainty of transmission of target data to be transmitted from an external device to a communication device.

Means for Solving the Problems

[0006] The technology disclosed in this specification can be realized as the following application examples.

[0007] [Application Example 1] A communication device includes a first communication unit that receives data spontaneously transmitted from an external device by a first communication method which is a push-type communication method, a second communication unit that transmits a request signal to the external device by a second communication method which is a pull-type communication method and receives data from the external device as a response to the request signal, and a controller. When the communication device is in an online state where it can communicate with the external device, the controller uses the first communication unit to receive target data to be processed by the communication device, which is spontaneously transmitted from the external device. When the communication device transitions from an offline state where it cannot communicate with the external device to the online state, the controller uses the second communication unit to transmit the request signal to the external device, uses the second communication unit to receive the target data from the external device as a response to the request signal, determines whether there is any target data that has not been received by the external device, and repeatedly transmits the request signal to the external device using the second communication unit until it is determined that there is no target data that has not been received by the external device.

[0008] When the communication device is in the offline state, there is a possibility that the communication device cannot receive the target data even if the external device spontaneously transmits the target data by the push-type communication method. According to the above configuration, when the communication device transitions from the offline state to the online state, it transmits a request signal by the pull-type communication method and receives the target data from the external device as a response to the request signal. As a result, the communication device can receive the target data that could not be received in the offline state. Furthermore, the communication device determines whether there is any target data that has not been received by the external device and repeatedly transmits the request signal to the external device until it is determined that there is no target data that has not been received by the external device, so that it is possible to suppress the omission of receiving the target data. Therefore, the certainty of transmitting the target data to be transmitted from the external device to the communication device can be improved.

[0009] Note that the technology disclosed in this specification can be realized in various forms, for example, in the forms of a communication device, a communication system including a communication device and an external device, a method for receiving target data, a computer program for realizing the functions of these devices, methods, and systems, a recording medium on which the computer program is recorded, and the like.

Brief Description of the Drawings

[0010]

Figure 1

Figure 2

Figure 3

Figure 4

Figure 5

Figure 6

Figure 7

Figure 8

Figure 9

Figure 10

Figure 11

Figure 12

Figure 13

Modes for Carrying Out the Invention

[0011] A. Embodiment A-1. Configuration of System 1000 FIG. 1 is a block diagram showing the configuration of system 1000. System 1000 includes a printer 100, a first server 300A, a second server 300B, and a relay server 200.

[0012] The printer 100 is a device that consumes ink as a printing material to perform printing. The printer 100 includes a CPU 110 that controls the printer 100, a volatile storage device 120 such as a DRAM, and a non-volatile storage device 130 such as a hard disk or a flash memory. The printer 100 also includes a display unit 140 such as a liquid crystal display that displays an image, an operation unit 150 such as a button or a touch panel that acquires an operation by a user, a printing mechanism 170, and a communication interface (IF) 180.

[0013] The communication IF 180 is an interface for connecting to the Internet IT, for example, a wired interface compliant with Ethernet (registered trademark) or a wireless interface compliant with the Wi-Fi standard.

[0014] The CPU 110 is an arithmetic unit (processor) that performs data processing. The volatile storage device 120 provides a buffer area for temporarily storing various intermediate data generated when the CPU 110 performs processing. The non-volatile storage device 130 stores a computer program PGp for controlling the printer 100 and an information database IB in which various types of information described later are recorded.

[0015] In this embodiment, the computer program PGp is pre-stored in the non-volatile storage device 130 and provided at the time of manufacturing the printer 100. Alternatively, the computer program PGp can be provided in a form downloaded from a server connected via the Internet IT, or in a form recorded on a storage medium such as a CD-ROM or a USB memory.

[0016] The CPU 110 executes various processes for controlling the printer 100 by executing the computer program PGp. For example, the CPU 110 realizes printing processes and service-related processes. The printing process is a process of controlling the printing mechanism 170 to cause the printing mechanism 170 to print an image. The service-related process is a process for providing a first printing service and a second printing service, which will be described later, to the user in cooperation with the first server 300A, the second server 300B, and the relay server 200.

[0017] For example, the CPU 310 functions as an MQTT processing unit MT, a main processing unit CT, and an instruction processing unit PT, which are functional units for realizing service-related processes.

[0018] The MQTT processing unit MT executes communication with the relay server 200 according to a protocol called MQTT (Message Queuing Telemetry Transport). Specifically, in communication according to MQTT, the relay server 200 functions as an MQTT broker, and the printer 100 functions as an MQTT client. In this embodiment, the MQTT processing unit MT of the printer 100 maintains a communication connection with an MQTT communication unit MP, which will be described later, of the relay server 200 and subscribes to a topic addressed to the printer 100. The connection maintained between the MQTT processing unit MT and the MQTT communication unit MP is, for example, a connection based on TCP (Transmission Control Protocol) / IP (Internet Protocol). The topic addressed to the printer 100 is, for example, a message (data to be transmitted) having a topic name including the device ID of the printer 100.

[0019] The main processing unit CT mainly executes control of the MQTT processing unit MT and the instruction processing unit PT and communication with the relay server 200 according to HTTP (Hypertext Transfer Protocol). For example, in communication according to HTTP, the relay server 200 functions as an HTTP server, and the printer 100 functions as an HTTP client.

[0020] The instruction processing unit PT executes processing based on a command received from the relay server 200 in accordance with the control of the main processing unit CT. Specifically, when the printer 100 receives a print instruction as a command, the instruction processing unit PT executes print processing based on the print instruction.

[0021] The information database IB stores the setting information of the printer 100 and the information necessary to receive the print service using the printer 100, for example, the destination information and authentication information for accessing the first server 300A. Further, as will be described later, a command list IL is stored in the information database IB.

[0022] The printing mechanism 170 executes printing in accordance with the control of the CPU 110. The printing mechanism 170 of the present embodiment is an inkjet printing mechanism that uses a plurality of types of inks (for example, four types of inks: cyan, magenta, yellow, and black) stored in the ink tank 190 as coloring materials to print an image on a recording medium. Alternatively, the printing mechanism 170 may be an electrophotographic printing mechanism that uses toner stored in a toner cartridge as a coloring material to print an image on a recording medium.

[0023] The first server 300A, the second server 300B, and the relay server 200 are, for example, computers operated by a business operator that provides a print service (for example, a business operator that manufactures and sells the printer 100), for example, a cloud server.

[0024] The first server 300A includes a CPU 310 that controls the first server 300A, a volatile storage device 320 such as a DRAM, a non-volatile storage device 330 such as a hard disk or a flash memory, and a communication interface (IF) 380. The communication IF 380 is, for example, a wired interface compliant with Ethernet (registered trademark).

[0025] The CPU 310 is an arithmetic unit (processor) that performs data processing. The volatile memory device 320 provides a buffer area for temporarily storing various intermediate data generated when the CPU 310 performs processing. The non-volatile memory device 330 stores a computer program PGsA and a first database DBa.

[0026] The computer program PGsA is provided in a form that is uploaded, for example, by an operator who operates a printing service. The CPU 310 of the first server 300A executes the computer program PGsA to execute processing related to the first printing service.

[0027] In this embodiment, the first printing service provided by the first server 300A is a remote printing service. The remote printing service is a service that causes a printer to perform printing by generating a print instruction (also called a print job) for executing printing using, for example, an image file stored in the server by the user or an image file transmitted from the user's mobile terminal (not shown) and transmitting it to the printer.

[0028] The first database DBa stores various types of information necessary for the first printing service. For example, the first database DBa includes information about users who use the first printing service (account information and payment information), and information about printers used by the users (printer device ID and model information). Details of the first database DBa are omitted.

[0029] Although not shown in the figure, the second server 300B includes a CPU 310, a volatile memory device 320, a non-volatile memory device 330, and a communication IF 380 for controlling the second server 300B, similar to the first server 300A. However, the non-volatile memory device 330 of the second server 300B stores a computer program PGsB different from the computer program PGsA and a second database DBb different from the first database DBa.

[0030] The computer program PGsB is provided in a form that can be uploaded, for example, by an operator who operates a printing service. The CPU 310 of the second server 300B executes the computer program PGsB to perform processing related to the second printing service.

[0031] In this embodiment, the second printing service provided by the second server 300B is a printing material management service. The printing material management service is a service that manages the remaining amount of printer consumables such as ink and delivers the consumables to the user according to the consumption of the printing materials. The printing material management service is a service that manages the remaining amount of printer consumables such as ink and delivers the consumables to the user according to the consumption of the printing materials.

[0032] Various types of information necessary for the second printing service are stored in the second database DBb. For example, the second database DBb includes information about users who use the second printing service (account information and payment information), and information about printers used by the users (printer device IDs and model information). The second database DBb further includes the remaining ink amount information and printing history information of each printer collected from the printers. Details of the second database DBb are omitted.

[0033] In FIG. 1, only one printer 100 is illustrated, but the first server 300A and the second server 300B provide printing services to a large number of users using a large number of printers. In the following, various processes for one printer 100 will be described, but these processes are independently executed for each of the multiple printers (hereinafter also referred to as target printers, for example, printer 100) used in the service.

[0034] Similar to servers 300A and 300B, relay server 200 includes a CPU 210 that controls relay server 200, a volatile memory device 220, a non-volatile memory device 230, and a communication IF 280. The volatile memory device 220 provides a buffer area for temporarily storing various intermediate data generated when the CPU 210 performs processing. The non-volatile memory device 230 stores a computer program PGr and a management database DBm.

[0035] The communication IF 280 is, for example, a wired interface compliant with Ethernet (registered trademark). Since the communication IF 280 is connected to the Internet IT, the relay server 200 can communicate with servers 300A and 300B via the Internet IT. Also, when the printer 100 is connected to the Internet IT, the relay server 200 can communicate with the printer 100 via the Internet IT.

[0036] The computer program PGr is provided in a form that is uploaded, for example, by an operator who operates a printing service, similar to the computer programs PGsA and PGsB. The CPU of the relay server 200 realizes the functions of the relay server 200 by executing the computer program PGr.

[0037] Specifically, the relay server 200 (CPU 210) functions as a control unit CP, an MQTT communication unit MP, and an HTTP communication unit HP by executing the computer program PGr. The control unit CP controls the MQTT communication unit MP and the HTTP communication unit HP to relay communication between the servers 300A and 300B and the printer 100.

[0038] The MQTT communication unit MP executes communication with the printer 100 according to the above-described MQTT. For example, when the control unit CP publishes a topic addressed to the printer 100 to the MQTT communication unit MP, the MQTT communication unit MP transmits the topic addressed to the printer 100 to a device (i.e., the printer 100) that subscribes to the topic.

[0039] Thus, when the printer 100 subscribes to a topic addressed to the printer 100, the MQTT communication unit MP can transmit data as a topic to the printer 100 at any timing. For this reason, it can be said that the communication method between the relay server 200 compliant with MQTT and the printer 100 is a push-type communication method.

[0040] On the other hand, when the power of the printer 100 is not turned on or the like, the printer 100 cannot subscribe to a topic addressed to the printer 100. When the printer 100 does not subscribe to a topic addressed to the printer 100, even if the control unit CP publishes a topic addressed to the printer 100 to the MQTT communication unit MP, the MQTT communication unit MP does not transmit the topic to the printer 100.

[0041] The MQTT communication unit MP does not notify the control unit CP of the transmission result of the topic whether the topic is transmitted to the printer 100 or not. For this reason, the control unit CP does not know whether the published topic (data to be transmitted) actually reaches the printer 100.

[0042] The HTTP communication unit HP executes communication with the printer 100 according to the above-described HTTP. In the present embodiment, when the main processing unit CT of the printer 100 transmits an HTTP request to the relay server 200 (HTTP communication unit HP), the HTTP communication unit HP transmits data to be transmitted to the printer 100 as a response (HTTP response) to the HTTP request.

[0043] Thus, when the HTTP communication unit HP receives a request (HTTP request) from the printer 100, it can transmit data to the printer 100 as a response (HTTP response) to the request. For this reason, it can be said that the communication method between the relay server 200 compliant with HTTP and the printer 100 is a pull-type communication method.

[0044] In communication that follows HTTP, delays are likely to occur because data cannot be sent to the printer 100 at any arbitrary timing. Also, in order to reduce delays, the printer 100 needs to continuously send HTTP requests to the relay server 200 at short intervals, which is likely to increase the burden on the printer 100 and the relay server 200. On the other hand, in communication that follows HTTP, data is sent in response to the requests of the printer 100, so data can be sent when the printer 100 is in a receivable state, and thus there is a high possibility that the data can be reliably delivered to the printer 100.

[0045] In this embodiment, as will be described in detail later, the relay server 200 selectively uses communication that follows MQTT and communication that follows the HTTP communication unit HP to relay communication between the servers 300A and 300B and the printer 100.

[0046] For example, in order to provide a remote printing service, the first server 300A sends, for example, a print instruction (also called a print job) to be sent to the printer 100 to the printer 100 via the relay server 200. Also, the first server 300A receives information indicating the execution result of the print job, etc., from the printer 100 via the relay server 200.

[0047] Also, in order to provide a printing material management service, the second server 300B sends, for example, an instruction to send the remaining amount information of the printing materials of the printer 100 and an instruction to send history information such as the printing history and failure history of the printer 100 to the printer 100 via the relay server 200. Also, the second server 300B receives information indicating the execution result of the transmission instruction, for example, the remaining amount information of the printing materials and information indicating the printing history and failure history of the printer 100, from the printer 100 via the relay server 200.

[0048] Hereinafter, the information to be sent from servers 300A and 300B to printer 100 (specifically, print instructions and transmission instructions) is also called a command. The information to be sent from printer 100 to servers 300A and 300B, that is, the information indicating the execution results of the processes executed based on commands (various instructions), specifically, print results, remaining amount information, and history information, is also called execution result information.

[0049] Figure 2 is an explanatory diagram of management database DBm. The management database DBm stores a command information table CDT that stores information regarding commands received from servers 300A and 300B, that is, information regarding commands requested for relay from servers 300A and 300B (hereinafter also called command information). The command information table CDT is prepared for each destination device, and Figure 2 shows a command information table CDT for storing command information regarding commands to be sent to printer 100.

[0050] The command information table CDT stores a plurality of command information CDa and CDb. Each command information includes information indicating a command ID, a target device ID, the reception date and time of the command, the status information of the command, and the command (instruction content).

[0051] The command ID is identification information for identifying the command. The target device ID is the device ID of the destination device of the command (for example, printer 100). The device ID is identification information for identifying the device. The reception date and time of the command is the date and time when the relay server 200 received the command from servers 300A and 300B.

[0052] In this embodiment, the status information of a command indicates one of three states: received, transmitted, and canceled. "Received" means that the command has been received from servers 300A and 300B and has not been received by the destination device, and the command has not been canceled by servers 300A and 300B. "Transmitted" means that the command has been received by the destination device. "Canceled" means that the command has been received from servers 300A and 300B, has not been received by the destination device, and the command has been canceled by servers 300A and 300B.

[0053] Since a command in the received state should be sent to the destination device, the received state can also be said to be the state indicating that the command should be sent to the destination device. Since a command in the transmitted or canceled state does not need to be sent to the destination device, the transmitted or canceled state can also be said to be the state indicating that the command does not need to be sent to the destination device.

[0054] Here, when a command is received, it means that the command has been acquired by the application that should process the command in the device that is the destination of the command. For example, when a command is received by the relay server 200, it means that the command has been acquired by the control unit CP, which is the application that should process the command in the relay server 200. When a command is received by the printer 100, it means that the command has been acquired by the main processing unit CT, which is the application that should process the command in the printer 100. For example, even if a command is received at the communication IF 180 of the printer 100 and temporarily stored in the reception buffer, if the main processing unit CT cannot acquire the command from the reception buffer for some reason (e.g., error, high load), the command has not been received by the printer 100. Also, even if the printer 100 is in an online state and a command is attempted to be sent from the relay server 200 to the printer 100, if the entire command does not reach the printer 100 due to line congestion or the like, the command has not been received by the printer 100.

[0055] A command is data indicating the instruction content and includes information necessary for a device (e.g., the printer 100) to execute processing based on the command. For example, when the command is a print instruction, the command may include, for example, information indicating that it is a print instruction, information indicating the number of printed sheets and print settings, and an image file indicating the print image.

[0056] In the command information table CDT, response information transmitted from the device that received the command is stored in association with the command information CDa, CDb. In the example of FIG. 2, two pieces of response information RDa1, RDa2 are stored in association with the command information CDa, and two pieces of response information RDb1, RDb2 are stored in association with the command information CDb.

[0057] Each response information includes information indicating the reception date and time of the response and the response content. The information indicating the reception date and time is the date and time when the relay server 200 received the response from the device. The response content includes, for example, information indicating that a command has been received when the response is a reception notification of a command. The response content includes, for example, execution result information indicating the result of executing a command when the response is a notification of the execution result of a command.

[0058] Figure 3 is an explanatory diagram of the information database IB. The information database IB stores a command list IL and a processing flag. The command list IL is a list in which the command IDs (also referred to as received command IDs) of the commands received by the printer 100 are recorded. The processing flag PF is a flag indicating whether the instruction processing unit PT is executing processing (e.g., printing processing) based on a command (e.g., a printing instruction). For example, the processing flag PF is set to ON while the instruction processing unit PT is executing processing based on a command, and is set to OFF while the instruction processing unit PT is not executing processing based on a command. The command list IL and the processing flag PF are managed by, for example, the main processing unit CT.

[0059] A-2. Operations of System 1000 The operations of the system 1000 will be described centering on the operations of the printer 100. Figure 4 is a flowchart of the processing of the MQTT processing unit MT of the printer 100. The MQTT processing unit MT operates according to the control of the main processing unit CT. Specifically, it starts operating when it acquires a connection request from the main processing unit CT.

[0060] In S300 of Figure 3, the MQTT processing unit MT acquires a connection request from the main processing unit CT. After acquiring the connection request, the MQTT processing unit MT executes MQTT connection processing in S310. Specifically, the MQTT processing unit MT performs the following processing.

[0061] First, the MQTT processing unit MT establishes a permanent connection with the MQTT communication unit MP of the relay server 200. This permanent connection is established with the MQTT processing unit MT of the printer 100 as the MQTT client and the MQTT communication unit MP of the relay server 200 as the MQTT broker. This permanent connection is maintained when the printer 100 is in an online state. Here, the online state means a state where the printer 100 is connected to the Internet IT and can communicate with the relay server 200. Note that the state where the printer 100 is not in an online state, that is, the state where the printer 100 cannot communicate with the relay server 200 is also called an offline state.

[0062] Once the permanent connection is established, the MQTT processing unit MT sends a subscribe request to the MQTT communication unit MP. The subscribe request requests to subscribe to a topic addressed to the printer 100. The subscribe request includes information indicating the name (topic name) of the topic addressed to the printer 100. When the MQTT communication unit MP of the relay server 200 receives the subscribe request, it executes subscribe registration. Subscribe registration is a process of registering a topic having the topic name included in the subscribe request as a topic to be sent to the printer 100. As a result, the printer 100 enters a state of subscribing to a command addressed to the printer 100 (in other words, a topic addressed to the printer 100) (hereinafter also referred to as a subscribed state). In the subscribed state, the relay server 200 can spontaneously send a command to the printer 100 by publishing the command as a topic.

[0063] When the MQTT connection process is completed, the MQTT processing unit MT notifies the main processing unit CT of the connection completion at S320. Thereafter, the MQTT processing unit MT enters a state of waiting for a command transmitted by MQTT from the relay server 200.

[0064] Specifically, in S330, the MQTT processing unit MT determines whether it has received a command from the relay server 200. If it has not received a command from the relay server 200 (S330: NO), the MQTT processing unit MT waits until it receives a command. If it has received a command from the relay server 200 (S330: YES), the MQTT processing unit MT stores, in S340, the command and the command ID received together with the command in a FIFO (First In First Out) queue (not shown) in the volatile memory device 120. The commands and command IDs stored in the FIFO queue are sequentially acquired and processed by the main processing unit CT as described later.

[0065] In S350, the MQTT processing unit MT sends a reception notification indicating that it has received a command to the relay server 200. This reception notification is PUBACK defined in the MQTT protocol. That is, the reception notification is sent as a response to the command in accordance with the MQTT protocol. After the MQTT processing unit MT sends the reception notification to the relay server 200, it returns to S330 and waits until it receives the next command.

[0066] FIG. 5 is a flowchart of the processing of the main processing unit CT. This processing starts when the printer 100 transitions from the offline state to the online state. For example, when the power of the printer 100 is turned on, when the printer 100 is connected to the network, or when a problem with the network to which the printer 100 is connected is resolved, the printer 100 transitions from the offline state to the online state.

[0067] When the printer 100 transitions from the offline state to the online state, in S400, the main processing unit CT sends a connection request to the MQTT processing unit MT. When the MQTT processing unit MT acquires the connection request, it executes the MQTT connection processing as described above and notifies the main processing unit CT of the connection completion (S300 to S320 in FIG. 4). In S405, the main processing unit CT acquires the connection completion notification from the MQTT processing unit MT.

[0068] When the connection completion notice is acquired, the main processing unit CT determines at S410 whether the processing flag PF (FIG. 3) is OFF. Since the processing flag PF is turned ON when the instruction processing unit PT is executing printing processing or the like, for example, it is usually OFF when the power is turned on.

[0069] If the processing flag PF is ON (S410: NO), the main processing unit CT waits until the processing flag PF is turned OFF. If the processing flag PF is OFF (S410: YES), the main processing unit CT proceeds to S415.

[0070] At S415, the main processing unit CT transmits an accumulated command request to the relay server 200. Information about the destination relay server 200 (for example, the URL or IP address of the relay server 200) is recorded in the information database IB in advance.

[0071] The accumulated command request is an HTTP request for requesting the transmission of the command when the command to be transmitted to the printer 100 is accumulated in the relay server 200. The accumulated command request includes the device ID of the printer 100 and information indicating the upper limit command number N. The upper limit command number N is the number (maximum number) of commands that the printer 100 can receive in one response (HTTP response).

[0072] When the relay server 200 receives an accumulated command request, it checks whether the command to be sent to the printer 100 is stored in the relay server 200. Specifically, the relay server 200 determines whether command information (hereinafter also referred to as received-state command information) including information indicating that the status of the command is received is stored in a command information table CDT (Figure 2) for storing command information regarding the command to be sent. When the received-state command information is stored in the command information table CDT, the control unit CP determines that the command to be sent is stored. When the received-state command information is not stored in the command information table CDT, the relay server 200 determines that the command to be sent is not stored.

[0073] When the relay server 200 determines that the command to be sent is stored, it sends a stored notification indicating that the command to be sent is stored to the printer 100 as a response to the accumulated command request. The stored notification includes one or more commands to be sent to the printer 100 and information indicating the number of accumulated commands M. The number of accumulated commands is the number of commands to be sent to the printer 100 among the commands already stored in the command information table CDT, in other words, the number of commands associated with the status information indicating received.

[0074] When it is determined that the command to be sent to the printer 100 is not stored, the relay server 200 sends a non-stored notification indicating that the command to be sent is not stored to the printer 100 as a response to the accumulated command request.

[0075] In S420, the main processing unit CT of the printer 100 receives a response to the accumulated command request from the relay server 200. As described above, the response is either an accumulation notification or a non-accumulation notification. In S425, the main processing unit CT determines whether the received response is an accumulation notification or a non-accumulation notification. If the received response is an accumulation notification (S425: YES), the main processing unit CT proceeds to S430. If the received response is a non-accumulation notification (S425: NO), the main processing unit CT proceeds to S445.

[0076] In S430, for one command included in the command notification, the main processing unit CT executes command corresponding processing. The command corresponding processing is processing that the main processing unit CT executes for each command received by the printer 100. The command corresponding processing includes, for example, passing the command to the instruction processing unit PT and instructing the instruction processing unit PT to execute processing based on the command (e.g., printing processing). The command corresponding processing includes, for example, receiving a notification (receiving notification or execution result notification) regarding processing based on the command from the instruction processing unit PT and transmitting the notification to the relay server 200 as an HTTP request. Details of the command corresponding processing will be described later with reference to the sequence diagram.

[0077] When the command corresponding processing for one command is completed, in S435, the main processing unit CT determines whether there is an unprocessed command. In other words, the main processing unit CT determines whether there is a command included in the received command notification and for which the command corresponding processing has not been performed. As described above, the received command notification may include a plurality of commands.

[0078] If there is an unprocessed command (S435: YES), the main processing unit CT returns to S430 and executes command corresponding processing for the unprocessed command. If there is no unprocessed command (S435: NO), the main processing unit CT proceeds to S440.

[0079] In S440, the main processing unit CT determines whether there is an unreceived command. As described above, the command presence notification includes information indicating the accumulated number M of commands. If the accumulated number M of commands is greater than the upper limit number N of commands, all the commands accumulated in the relay server 200 cannot be received in a single response. In this case, the printer 100 needs to receive the M commands in two or more responses. The main processing unit CT determines that there is an unreceived command when the number of received commands is less than the accumulated number M of commands. The main processing unit CT determines that there is no unreceived command when the number of received commands matches the accumulated number M of commands.

[0080] If there is an unreceived command (S440: YES), the main processing unit CT returns to S410. If there is no unreceived command (S435: NO), the main processing unit CT proceeds to S445 for processing.

[0081] At the time after S445, all the commands that the printer 100 should receive from the relay server 200 using HTTP at this time have been received and processed. For this reason, the main processing unit CT transitions to a state where it processes the commands received by the MQTT processing unit MT. Specifically, at S445, it monitors whether a command is stored in the above-described FIFO queue for MQTT. The MQTT processing unit MT waits until a command is stored in the FIFO queue (S445: NO), that is, until a new command is received by the MQTT processing unit MT.

[0082] When a command is stored in the FIFO queue (S445: YES), the main processing unit CT sequentially obtains a set of a command and a command ID from the FIFO queue at S450. At S455, command corresponding processing is executed for the command obtained from the FIFO queue. After executing the command corresponding processing for one command, the main processing unit CT returns to S445.

[0083] A-3. Operation Example of System 1000 Next, an example of the operation realized by the MQTT processing unit MT and the main processing unit CT executing the processing of FIGS. 4 and 5 described above will be described. FIGS. 6-9 are sequence diagrams showing operation examples of the system 1000 of the embodiment. FIGS. 6 and 7 show operation examples when the printer 100 is in the subscribed state when the relay server 200 receives a command. The time when the relay server 200 receives a command means the time when the first server 300A transmits a command transmission instruction to the relay server 200 and the relay server 200 receives the command transmission instruction.

[0084] For ease of understanding, first, the description will be made from the time when the printer 100 transitions from the offline state to the online state. When the printer 100 transitions from the offline state to the online state, the main processing unit CT of the printer 100 sends a connection request to the MQTT processing unit MT at S2 in FIG. 6 (S400 in FIG. 5).

[0085] When the MQTT processing unit MT of the printer 100 acquires the connection request (S300 in FIG. 4), at S4, it executes MQTT connection processing (S310 in FIG. 4). As a result, the printer 100 enters the subscribed state. At S6, the MQTT processing unit MT sends a connection completion notification to the main processing unit CT (S320 in FIG. 4). As a result, the main processing unit CT acquires the connection completion notification (S405 in FIG. 5). At S8, the main processing unit CT sends an accumulated command request to the relay server 200 (S415 in FIG. 5).

[0086] When the relay server 200 receives the accumulated command request, as described above, it checks whether a command to be sent to the printer 100 is stored in the relay server 200. In the example of FIG. 6, it is assumed that no command to be sent is stored in the relay server 200. For this reason, at S10, the relay server 200 sends a no-accumulation notification to the printer 100 as a response to the accumulated command request.

[0087] When the main processing unit CT of the printer 100 receives an accumulation notification, as described above, it transitions to a state where it processes the commands received by the MQTT processing unit MT. That is, the main processing unit CT is in a state of monitoring the above-described FIFO queue for MQTT (S445 in FIG. 5).

[0088] Thus, after the printer 100 enters the subscribe state, assume that the first server 300A transmits a command transmission instruction to the relay server 200 (S12 in FIG. 6). The command transmission instruction instructs the relay server 200 to transmit a command to the device. The command transmission instruction includes a target device ID and a command to be transmitted. The target device ID is an identifier indicating the device to which the command is to be transmitted. Communication between the first server 300A and the relay server 200 is performed according to a known communication protocol (e.g., HTTP or a dedicated protocol).

[0089] When the relay server 200 receives the command transmission instruction, at S14, the relay server 200 stores command information (FIG. 2) regarding the command included in the command transmission instruction. Specifically, the relay server 200 (control unit CP) generates a command ID to be assigned to the command included in the command transmission instruction. The relay server 200 generates information indicating the current date and time as information indicating the reception date and time of the command. The relay server 200 generates information indicating received as status information indicating the status of the current command. The relay server 200 stores command information including the command and target device ID included in the command transmission instruction and the generated respective information (command ID, reception date and time, status) in the command information table CDT (FIG. 2) of the management database DBm. In the example of FIG. 6, at this point, assume that the first command information CDa is stored in the command information table CDT of FIG. 2.

[0090] Here, the information indicating the reception date and time of the command can also be said to be the information indicating the storage date and time when the command information is stored in the command information table CDT. Also, by comparing the information indicating the reception date and time of the command, when a plurality of command information is stored in the command information table CDT, the storage order of the plurality of command information can be specified. For this purpose, the information indicating the reception date and time of the command can also be said to be the information for specifying the storage order of a plurality of command information, or the information indicating the reception order of transmission instructions for a plurality of commands.

[0091] In S16, the relay server 200 transmits a reception notice indicating that it has received a command transmission instruction to the first server 300A. The reception notice includes the command ID included in the command information stored in S14 and the status information of the command.

[0092] In S18, the relay server 200 transmits the command and the command ID to the printer 100. Specifically, for example, the control unit CP sends a publish request to the MQTT communication unit MP. The publish request requests to send specified data to a device subscribing to a specified topic. The publish request includes a topic name for specifying the topic and the data to be transmitted. In the example of FIG. 6, the topic name included in the publish request is the name of the topic addressed to the printer 100. Also, the data included in the publish request includes the command included in the data transmission instruction and the command ID of the command.

[0093] When the MQTT communication unit MP receives a publish request, it attempts to send the command and command ID included in the publish request to the device that has subscribed to the topic specified by the topic name included in the publish request. At this point, the printer 100 is in the subscribed state, and it is registered with the MQTT communication unit MP that the printer 100 has subscribed to the topic addressed to the printer 100. For this reason, in S18, the command and command ID are sent from the relay server 200 to the printer 100 by the MQTT communication unit MP.

[0094] On the printer 100 side, in S18, the MQTT processing unit MT receives the command and command ID. When the MQTT processing unit MT receives the command and command ID, in S20, the MQTT processing unit MT stores the command and command ID in the FIFO queue (S330, S340 in FIG. 4). In S22, the MQTT processing unit MT sends a reception notification indicating that the command has been received to the relay server 200 (S350 in FIG. 4).

[0095] At this point, since the main processing unit CT has transitioned to the MQTT reception mode, it monitors the FIFO queue in which the command received by the MQTT processing unit MT is stored (S445 in FIG. 5). In S24, the main processing unit CT acquires the command and command ID stored in the FIFO queue in S20 from the FIFO queue (S450 in FIG. 5).

[0096] When the main processing unit CT acquires the command and command ID from the FIFO queue, it executes the above-described command correspondence processing for the command (S455 in FIG. 5). Here, the command correspondence processing is a series of processes performed in cooperation by the main processing unit CT, the instruction processing unit PT, the MQTT processing unit MT, the relay server 200, and the first server 300A for one command. S26 in FIG. 6 to S54 in FIG. 7 are the command correspondence processing for one command. This will be specifically described below.

[0097] In S26, the main processing unit CT determines whether the acquired command ID is in the command list IL. That is, the main processing unit CT compares the acquired command ID with the command IDs already recorded in the command list IL. As a result of the comparison, it is determined whether the acquired command ID matches one of the command IDs already recorded in the command list IL. If the acquired command ID is in the command list IL (S26: YES), the main processing unit CT discards it in S28 without executing the processing (such as printing processing) based on the command. This is to prevent duplicate execution because when the command ID is in the command list IL, the processing based on the command is considered to have already been executed.

[0098] If the command ID is not in the command list IL (S26: NO), the main processing unit CT records the command ID in the command list IL in S30. In S32, the main processing unit CT sends an event notification including the acquired command to the instruction processing unit PT. When the instruction processing unit PT receives the event notification including the command, it sends a reception notification to the main processing unit CT in S34. The reception notification includes information indicating that the command has been received as information indicating the status of the command.

[0099] When the main processing unit CT receives the reception notification from the instruction processing unit PT, it sends the reception notification to the relay server 200 in S38. The reception notification includes the command ID of the command sent to the instruction processing unit PT and the device ID of the printer 100. The reception notification is sent to the relay server 200 as an HTTP request. For this reason, the reception notification is received by the HTTP communication unit HP (Figure 1) of the relay server 200.

[0100] When the relay server 200 receives the reception notification, the relay server 200 (control unit CP) can recognize at this point that the command has been received by the printer 100.

[0101] When the relay server 200 receives a reception notice, at S40, it stores the reception notice. Specifically, the control unit CP of the relay server 200 generates information indicating the current date and time as information indicating the reception date and time of the reception notice. The control unit CP generates response information including the reception notice and the information of the reception date and time of the reception notice. The control unit CP refers to the command ID included in the reception notice to identify the command to be processed. The control unit CP associates the response information with the command information of the command to be processed and stores it in the command information table CDT (Figure 2) of the management database DBm. For example, assume that the command information of the command to be processed is the command information CDa in Figure 2. In this step, in the command information table CDT, the first response information RDa1 is stored in association with the command information CDa.

[0102] At S42, the relay server 200 updates the status information of the command to be processed from received to transmitted. For example, the control unit CP of the relay server 200 changes the status information included in the command information CDa in the command information table CDT of Figure 2 from the information indicating received to the information indicating transmitted. In this way, when the control unit CP receives the first response for the command to be processed, it updates the status information of the command to be processed from received to transmitted. The control unit CP may receive a second response (for example, the execution result notice described later) for the command to be processed, but when receiving the second and subsequent responses, the status information is not updated.

[0103] At S44, the relay server 200 transmits the reception notice received at S38 to the first server 300A. As a result, the first server 300A can recognize that the command has been transmitted to the printer 100 and received by the printer 100 based on the command transmission instruction transmitted at S12.

[0104] When the instruction processing unit PT of the printer 100 transmits a reception notice in S34, in S36, it executes processing based on the command that has been received in S36 of FIG. 6. For example, when the command is a print instruction, the printer 100 executes a print process using the image file specified by the command.

[0105] In S46, the instruction processing unit PT sends an execution result notice to the main processing unit CT. The execution result notice includes information indicating the status of the command, information indicating that the processing based on the command has been completed, and information indicating the execution result. In S48, the main processing unit CT sends the received execution result notice to the relay server 200. The execution result notice includes the command ID of the executed command and the device ID of the printer 100, similar to the above-described reception notice. The execution result notice is sent to the relay server 200 as an HTTP request. For this reason, the execution result notice is received by the HTTP communication unit HP of the relay server 200.

[0106] In S50, the main processing unit CT deletes the command ID of the processed command from the command list IL.

[0107] When the relay server 200 receives the execution result notice, in S52, it stores the execution result notice. Specifically, the control unit CP of the relay server 200 generates information indicating the current date and time as information indicating the reception date and time of the execution result notice. The control unit CP generates response information including the execution result notice and information on the reception date and time of the execution result notice. The control unit CP refers to the command ID included in the execution result notice to identify the command to be processed. The control unit CP associates the response information with the command information of the command to be processed and stores it in the command information table CDT (FIG. 2) of the management database DBm. For example, assume that the command information of the command to be processed is the command information CDa in FIG. 2. In this step, in the command information table CDT, the second response information RDa2 is stored in association with the command information CDa.

[0108] In S54, the relay server 200 transmits the execution result notification received in S48 to the first server 300A. As a result, the first server 300A can recognize that the execution of the process based on the command transmitted based on the command transmission instruction transmitted in S12 has been completed. For example, the first server 300A can recognize that the printing process by the printer 100 has been executed based on the print instruction transmitted as a command.

[0109] FIG. 8 and FIG. 9 show an operation example when the printer 100 does not subscribe to a command when the relay server 200 receives a command. For example, assume that the printer 100 is in an offline state because the power of the printer 100 is turned off, and the printer 100 is not subscribed to a command. In this state, assume that in S62 of FIG. 8, the first server 300A transmits a command transmission instruction to the relay server 200. The transmission of the command transmission instruction is performed in the same manner as S12 of FIG. 6.

[0110] When the relay server 200 receives the command transmission instruction, in S64, similar to S14 of FIG. 6, the relay server 200 stores command information (FIG. 2) regarding the command included in the command transmission instruction.

[0111] In S66, similar to S16 of FIG. 6, the relay server 200 transmits a reception notification indicating that the command transmission instruction has been received to the first server 300A.

[0112] In S68, similar to S18 of FIG. 6, the relay server 200 attempts to transmit the command and the command ID to the printer 100. Specifically, the control unit CP of the relay server 200 passes a publish request to the MQTT communication unit MP of the relay server 200. When the MQTT communication unit MP receives the publish request, it attempts to transmit the command and the command ID included in the publish request to the device subscribed to the topic specified by the topic name included in the publish request.

[0113] At this point, unlike the example in FIG. 6, since the printer 100 is not in the subscribed state, the MQTT communication unit MP does not register that the printer 100 is subscribed to the topic addressed to the printer 100. For this reason, the MQTT communication unit MP does not send the command and the command ID to the printer 100. According to the MQTT specification, the MQTT communication unit MP does not notify the control unit CP that it does not send the command to the printer 100. For this reason, the control unit CP cannot recognize that the command has not been received by the printer 100.

[0114] Thereafter, for example, assume that the printer 100 transitions from the offline state to the online state due to, for example, the printer 100 being powered on. When the printer 100 transitions to the online state, the main processing unit CT of the printer 100 sends a connection request to the MQTT processing unit MT at S72, similar to S2 in FIG. 6 (S400 in FIG. 5).

[0115] When the MQTT processing unit MT of the printer 100 acquires the connection request (S300 in FIG. 4), at S74, it executes MQTT connection processing, similar to S4 in FIG. 6 (S310 in FIG. 4). As a result, the printer 100 enters the subscribed state. At S76, similar to S6 in FIG. 6, the MQTT processing unit MT sends a connection completion notification to the main processing unit CT (S320 in FIG. 4). As a result, the main processing unit CT acquires the connection completion notification (S405 in FIG. 5). At S78, similar to S8 in FIG. 6, the main processing unit CT sends an accumulated command request to the relay server 200 (S415 in FIG. 5).

[0116] When the relay server 200 receives an accumulated command request, as described above, it checks whether the command to be sent to the printer 100 is accumulated in the relay server 200. In the example of FIG. 8, at this point, the command to be sent to the printer 100 based on the command transmission instruction received at S62 has not been sent to the printer 100. For this reason, the status of the command is received but not transmitted. Therefore, the command information of the command is registered in the command information table CDT, and the command information is the command information in the received state.

[0117] For this reason, in the example of FIG. 8, at this point, the relay server 200 determines that the control unit CP has accumulated the command to be sent to the printer 100. For this reason, in S80, the relay server 200 transmits an accumulation available notification indicating that the command to be sent is accumulated to the printer 100 as a response to the accumulated command request. The accumulation available notification is transmitted as an HTTP response in the same manner as the accumulation unavailable notification.

[0118] The accumulation available notification includes the command to be sent to the printer 100 and information indicating the number of accumulated commands. In the example of FIG. 8, since one received command information is stored in the command information table CDT, the number of accumulated commands is 1. The number of accumulated commands is the number of commands to be sent to the printer 100 among the commands stored in the command information table CDT, in other words, the number of commands associated with the status information indicating received.

[0119] When the relay server 200 transmits the accumulation available notification to the printer 100, in S80, it updates the status information of the command to be processed from received to transmitted. In this way, in S80, when the accumulation available notification including the command is transmitted as an HTTP response without receiving the reception notification from the printer 100, the status information is immediately updated.

[0120] When the printer 100 receives a stored notification, in the example of FIG. 8, it will receive one command. That is, the main processing unit CT of the printer 100 can obtain the command using communication conforming to HTTP. As described above, when the main processing unit CT of the printer 100 receives a stored notification (YES in S420 and S425 of FIG. 5), it executes command corresponding processing for the command included in the stored notification (S430 of FIG. 5).

[0121] The command corresponding processing for the command obtained by communication conforming to HTTP is the processing shown in S84 of FIG. 8 to S116 of FIG. 9, and is a series of processing performed in cooperation by the main processing unit CT, the instruction processing unit PT, the relay server 200, and the first server 300A. The command corresponding processing for the command obtained by communication conforming to HTTP is substantially the same as the command corresponding processing for the command obtained by communication conforming to MQTT described above (S26 of FIG. 6 to S54 of FIG. 7). However, there are also different parts such as the control of the processing flag PF in the two command corresponding processings. This will be specifically described below.

[0122] In S84, the main processing unit CT determines whether the obtained command ID is in the command list IL. If the obtained command ID is in the command list IL (S84: YES), the main processing unit CT discards it without executing the processing based on the command in S86.

[0123] If the command ID is not in the command list IL (S84: NO), the main processing unit CT records the command ID in the command list IL in S88. In S90, the main processing unit CT sets the processing flag PF to ON. In S92, the main processing unit CT sends an event notification including the obtained command to the instruction processing unit PT. When the instruction processing unit PT receives the event notification including the command, in S94, it sends a reception notification indicating that the command has been received to the main processing unit CT.

[0124] When the main processing unit CT receives a reception notice from the instruction processing unit PT, at S98, it transmits the reception notice to the relay server 200. The reception notice includes the command ID of the command sent to the instruction processing unit PT and the device ID of the printer 100. The reception notice is transmitted to the relay server 200 as an HTTP request.

[0125] When the relay server 200 receives the reception notice, at S100, it stores the reception notice. Specifically, similar to 40 in FIG. 7, the control unit CP of the relay server 200 generates response information including the reception notice and the reception date and time information, associates the response information with the command information of the command to be processed, and stores it in the command information table CDT (FIG. 2) of the management database DBm.

[0126] In the command correspondence processing for the command obtained by the HTTP-compliant notice, at this point, it is not necessary to update the status information of the command to be processed. This is because the status information of the command has already been updated at S82 immediately after transmitting the accumulated notice including the command to the printer 100 at S80 in FIG. 8.

[0127] At S104, the relay server 200 transmits the reception notice received at S98 to the first server 300A. As a result, the first server 300A can recognize that the command has been transmitted to the printer 100 and received by the printer 100 based on the command transmission instruction transmitted at S12.

[0128] When the instruction processing unit PT of the printer 100 transmits the reception notice at S94, it executes the processing based on the commands received at S96 in FIG. 6. At S106, the instruction processing unit PT sends an execution result notice indicating the execution result of the processing based on the command to the main processing unit CT. At S108, the main processing unit CT transmits the received execution result notice to the relay server 200. The execution result notice includes the command ID of the executed command and the device ID of the printer 100, similar to the above-mentioned reception notice. The execution result notice is transmitted to the relay server 200 as an HTTP request, similar to the reception notice.

[0129] The main processing unit CT can recognize that the instruction processing unit PT has completed the processing based on the command by the execution result notification. For this purpose, in S110, the main processing unit CT sets the processing flag PF to OFF. In S112, the main processing unit CT deletes the command ID of the processed command from the command list IL.

[0130] When the relay server 200 receives the execution result notification, in S114, it stores the execution result notification. Specifically, the control unit CP of the relay server 200 generates response information including the execution result notification and the reception date and time information, associates the response information with the command information of the command to be processed, and stores it in the command information table CDT (Figure 2) of the management database DBm.

[0131] In S116, the relay server 200 transmits the execution result notification received in S108 to the first server 300A. As a result, the first server 300A can recognize the execution result of the processing based on the command transmitted based on the command transmission instruction transmitted in S62.

[0132] The operation of the system 1000 has been described above. With reference to FIG. 10, supplementary explanation will be given on the processing when the control unit CP of the relay server 200 receives a command transmission instruction (S12 in FIG. 6, S62 in FIG. 8) from the servers 300A and 300B. FIG. 10 is a flowchart of the processing at the time of receiving the command transmission instruction.

[0133] For example, as shown in S16 of FIG. 6 and S62 of FIG. 8, when the relay server 200 receives a command transmission instruction from the servers 300A and 300B, the control unit CP of the relay server 200 stores the command information in the command information table CDT in S500. The control unit CP transmits an acceptance notification to the server (for example, the first server 300A) that is the transmission source of the command transmission instruction in S510. S500 is the processing of S14 in FIG. 6 and S64 in FIG. 8, and S510 is the processing of S16 in FIG. 6 and S66 in FIG. 8.

[0134] In S520, the control unit CP executes an accumulated command confirmation process. The accumulated command confirmation process is a process for confirming whether a command to be transmitted to the printer 100 is stored in the relay server 200. Specifically, in the same manner as when an accumulated command request is received, the control unit CP of the relay server 200 determines whether command information (hereinafter also referred to as received state command information) including information indicating that the status of the command is received is stored in the command information table CDT (Figure 2). When the received state command information is stored in the command information table CDT, the control unit CP determines that the command to be transmitted is stored. When the received state command information is not stored in the command information table CDT, the relay server 200 determines that the command to be transmitted is not stored.

[0135] As shown in S530, when the control unit CP determines in the accumulated command confirmation process that no other commands to be transmitted are stored (S530: NO), at S540, the control unit CP transmits a command (also referred to as a target command) based on the received command transmission instruction to the printer 100 using the MQTT communication unit MP. S540 is the process of S18 in Figure 6 and S68 in Figure 8.

[0136] When it is determined in the accumulated command confirmation process that other commands to be transmitted are stored (S530: YES), the process of S540 is skipped. That is, when the control unit CP determines that other commands to be transmitted are stored (S530: YES), the control unit CP does not transmit the target command using the MQTT communication unit MP.

[0137] As described above, when there are no other commands to be sent to the printer 100 stored, if the printer 100 is in the subscribed state, as shown in S18 of FIG. 6, the target command is immediately sent from the MQTT communication unit MP to the printer 100. On the other hand, when there are other commands to be sent to the printer 100 stored, even if the printer 100 is in the subscribed state, the target command is not sent from the MQTT communication unit MP to the printer 100.

[0138] The reason for this will be explained. Suppose that, even though there are other commands to be sent to the printer 100 stored, the target command is immediately sent from the MQTT communication unit MP to the printer 100. In this case, while the other commands to be sent have not been sent to the printer 100, the target command is sent to the printer 100. In this case, although the reception of the transmission instruction for the other commands is earlier than that of the target command, the transmission of the other commands to the printer 100 is later than that of the target command. That is, the transmission order of the commands becomes different from the reception order of the transmission instructions for the commands. Then, if the execution order of the commands in the printer 100 has meaning, it may become impossible to cause the printer 100 to execute the desired operation. For example, when it is desired to print the next page after one page, the inconvenience that page 2 is printed earlier than page 1 may occur.

[0139] In this embodiment, in order to suppress such an inconvenience, when there are other commands to be sent stored, the target command is not sent from the MQTT communication unit MP, so the target command is stored together with the other commands. Both the stored other commands and the target command are sent to the printer 100 using the HTTP communication unit HP. As will be described later, when there are a plurality of commands stored, the HTTP communication unit HP sends the commands to the printer 100 in accordance with the reception order of the transmission instructions for the commands, so the above-described inconvenience can be suppressed.

[0140] In FIG. 6, when an accumulation command request is transmitted from the printer 100 to the relay server 200 (S8 in FIG. 6), the case where no command to be transmitted is accumulated in the relay server 200 was described. In FIGS. 8 and 9, when an accumulation command request is transmitted from the printer 100 to the relay server 200 (S78 in FIG. 8), the case where only one command to be transmitted is accumulated in the relay server 200 was described.

[0141] Here, referring to FIG. 11, the case where M commands to be transmitted are accumulated in the relay server 200 when an accumulation command request is transmitted from the printer 100 to the relay server 200 (S78A in FIG. 11) will be described. In this case, the control unit CP of the relay server 200 determines in the accumulation command confirmation process (S520 in FIG. 10) that a plurality of commands to be transmitted are accumulated. Here, let the number of accumulated commands be M. M is a number greater than N and less than 2N when the above-mentioned upper limit command number is N (N is an integer of 1 or more) (N < M < 2N). The number of commands included in one accumulation available notification is limited to N or less.

[0142] When the relay server 200 (control unit CP) receives an accumulation command request, at S80A in FIG. 11, it uses the HTTP communication unit HP to transmit an accumulation available notification to the printer 100 as a response to the accumulation command request. Specifically, the control unit CP specifies the reception order of the M commands to be transmitted, in other words, the storage order of the M command information in the command information table CDT, based on the reception date and time of the M commands to be transmitted. The control unit CP specifies N commands in order from the ones with the earlier storage order among the M commands. The control unit CP generates an accumulation available notification including the N commands. In the accumulation available notification, the N commands are arranged according to the storage order. As a result, when the accumulation available notification is transmitted from the relay server 200 to the printer 100, the N commands are sequentially transmitted to the printer 100 in order from the ones with the earlier storage order. The accumulation available notification further includes information indicating the number of accumulated commands M.

[0143] Upon receiving the stored notification, the main processing unit CT of the printer 100 acquires N commands in the order of command storage. When the main processing unit CT acquires the commands of the N commands, for each of the N commands, the above-described command corresponding process is executed (S430 and S435 in FIG. 5). As described above, the command corresponding process is the process from S84 in FIG. 8 to 116 in FIG. 9. That is, the command corresponding process from S84 in FIG. 8 to 116 in FIG. 9 is repeatedly executed N times. For each command, the command corresponding process with an earlier storage order of the command is executed first.

[0144] Since the stored notification received by the printer 100 includes information indicating the storage number M, the main processing unit CT of the printer 100 can recognize that there are (M - N) unacquired commands in the relay server 200 in addition to the N acquired commands. For this reason, after repeatedly executing the command corresponding process N times, the main processing unit CT determines at S82A that there are unreceived commands (YES at S440 in FIG. 5). For this reason, the main processing unit CT transmits a stored command request to the relay server 200 again at S84A in FIG. 11 in order to acquire the (M - N) unacquired commands.

[0145] Upon receiving the stored command request, the relay server 200 transmits the stored notification to the printer 100 as a response to the stored command request at S86A. Specifically, since the remaining (M - N) commands to be transmitted are stored in the relay server 200, the control unit CP of the relay server 200 generates a stored notification including the remaining (M - N) commands and transmits the stored notification to the printer 100 using the HTTP communication unit HP. In the stored notification, the (M - N) commands are arranged in the storage order.

[0146] Upon receiving the stored notification, the main processing unit CT of the printer 100 acquires the remaining (M - N) commands in the order of command storage. For each of the (M - N) commands, the main processing unit CT executes the above-described command-corresponding processing (S430 and S435 in FIG. 5). That is, the command-corresponding processing is repeatedly executed (M - N) times. For the command-corresponding processing of each command, the one with an earlier command storage order is executed first.

[0147] Since the stored notification received by the printer 100 includes information indicating the storage count (M - N), the main processing unit CT of the printer 100 can recognize that there are no unacquired commands in the relay server 200. For this reason, after repeatedly executing the command-corresponding processing (M - N) times, the main processing unit CT determines at S88A that there are no unreceived commands (NO at S440 in FIG. 5). As can be understood from the above description, based on the information indicating the storage count, it is possible to determine whether there are unacquired commands in the relay server 200. Therefore, it can be said that the information indicating the storage count of commands is at least information indicating the presence or absence of unreceived commands.

[0148] According to the embodiments described above, the printer 100 implements a push-type communication method through communication conforming to MQTT, and can receive data spontaneously transmitted from the relay server 200 (S300 to S350 in FIG. 4). The printer 100 implements a pull-type communication method through communication conforming to HTTP, sends an accumulated command request to the relay server 200, and can receive data from the relay server 200 as a response to the accumulated command request (S415, S420 in FIG. 5). When the printer 100 is in an online state, it uses a push-type communication method to receive commands spontaneously transmitted from the relay server 200 (S18 in FIG. 6). When the printer 100 transitions from an offline state to an online state, it uses a pull-type communication method to send an accumulated command request to the relay server 200 and receive commands from the relay server 200 (S415, S420 in FIG. 5, S78, S80 in FIG. 8, S78A, S80A in FIG. 11). The printer 100 determines whether there are unreceived commands in the relay server 200 (S435 in FIG. 5, S82A, S88A in FIG. 11), and repeatedly sends an accumulated command request to the relay server 200 using a pull-type communication method until it determines that there are no unreceived commands in the relay server 200 (S415, S440 in FIG. 5, S82A, S88A in FIG. 11).

[0149] When the printer 100 is in an offline state, there is a possibility that the printer 100 cannot receive a command even if the relay server 200 spontaneously sends a command using a push-type communication method. According to the above embodiments, when the printer 100 transitions from an offline state to an online state, it uses a pull-type communication method to send an accumulated command request and receive a command from the relay server 200. Thereby, the printer 100 can receive commands that could not be received in the offline state. Furthermore, the printer 100 determines whether there are unreceived commands in the relay server 200, and repeatedly sends an accumulated command request to the relay server 200 until it determines that there are no unreceived commands in the relay server 200, so that it is possible to suppress omission of command reception. Therefore, the certainty of transmission of commands to be sent from the relay server 200 to the printer 100 can be improved.

[0150] Also, when the printer 100 is in an online state, as described above, the printer 100 receives commands spontaneously transmitted by the relay server 200 using a push-type communication method. For this purpose, for example, in the online state, the main processing unit CT of the printer 100 can receive commands without delay without frequently sending command requests to the relay server 200.

[0151] Furthermore, according to this embodiment, when the printer 100 receives a command as a response to an accumulated command request using a pull-type communication method, the printer 100 receives information indicating the number of accumulated commands as information indicating the presence or absence of unreceived commands (S80A and S86A in FIG. 11). The printer 100 determines whether there are unreceived commands in the relay server 200 using the information indicating the number of accumulated commands (S82A and S88A in FIG. 11, S440 in FIG. 5). As a result, when receiving a command, since the information indicating the number of accumulated commands is received, it is possible to determine whether there are unreceived commands in the relay server 200 using this information.

[0152] Furthermore, according to this embodiment, when the printer 100 receives a command using a pull-type communication method (YES in S425 of FIG. 5), the printer 100 executes command corresponding processing including processing (e.g., printing processing) based on the command received using the pull-type communication method (S430 in FIG. 5). Then, after the printer 100 executes command corresponding processing including processing based on the command received using the pull-type communication method, the printer 100 executes command corresponding processing including processing based on unprocessed commands received using the push-type communication method (S455 in FIG. 5). As a result, for example, after executing processing based on a command that could not be received from the relay server 200 by the push-type communication method because it was in an offline state, it is possible to execute processing based on a command received by the push-type communication method after transitioning to the online state. Therefore, it is possible to execute processing based on commands in an appropriate order.

[0153] Further, as shown in FIG. 10, when no other commands are stored in the relay server 200 (control unit CP) (NO in S530 of FIG. 10), the relay server 200 uses the MQTT communication unit MP to transmit a command based on a new command transmission instruction to the printer 100 in a push-type communication method (S540 of FIG. 10). When other commands are stored in the relay server 200 (YES in S530 of FIG. 10), the relay server 200 does not transmit a command based on a new command transmission instruction to the printer 100 in a push-type communication method. That is, while commands are stored in the relay server 200, commands are transmitted to the printer 100 only using the pull-type communication method and not using the push-type communication method. Then, when no other commands are stored in the relay server 200 and a new command transmission instruction is received, the command is transmitted to the printer 100 using the push-type communication method. For this reason, on the printer 100 side, as described above, the processing based on the command received using the pull-type communication method is executed first, and the processing based on the command received using the push-type communication method is executed later, so that the processing based on the command can be executed in the order in which the relay server 200 receives the command transmission instruction.

[0154] Furthermore, according to the present embodiment, the printer 100 transmits a stored command request including the upper limit command number N to the relay server 200 using the pull-type communication method (S78A in FIG. 11). As a single response to the stored command request, the printer 100 receives a stored command notification including a number of commands corresponding to the upper limit command number N from the relay server 200 (S80A in FIG. 11). As a result, the printer 100 can receive a number of commands corresponding to the upper limit command number N from the relay server 200 as a single response. As a result, for example, by specifying an appropriate upper limit command number N from the viewpoints of the memory capacity and processing ability of the printer 100, an appropriate number of commands can be received in a single response. Therefore, a plurality of commands can be received efficiently.

[0155] Furthermore, according to this embodiment, when the printer 100 executes processing based on a command, the printer 100 transmits notifications regarding the command (specifically, reception notifications and execution result notifications) to the relay server 200 (S38 and S48 in FIG. 7, S98 and S108 in FIG. 9). As a result, the relay server 200 can confirm that the transmitted command has reached the printer 100 and that the processing based on the command is executed in the printer 100.

[0156] Furthermore, according to this embodiment, the printer 100 transmits notifications regarding the command (reception notifications and execution result notifications) according to a communication protocol different from MQTT (HTTP in this embodiment). As a result, for example, regarding both the command received according to MQTT and the command received by HTTP, when executing processing based on the command, notifications regarding the command can be similarly transmitted to the relay server 200.

[0157] Furthermore, according to this embodiment, the reception notification among the notifications regarding the command (S34 and S38 in FIG. 7) includes a command ID and information indicating the status of the command (information indicating that the command has been received by the printer 100). When the relay server 200 receives the reception notification, the relay server 200 updates the status of the command from received to transmitted (S42 in FIG. 7). When the status is updated from received to transmitted, it is determined that the command is not a command to be transmitted to the printer 100. Therefore, it can be said that the reception notification is used for the relay server 200 to exclude the command from the data to be transmitted to the printer 100. As a result, it is possible to prevent the relay server 200 from transmitting the command to the printer 100 repeatedly.

[0158] Furthermore, in this embodiment, when the printer 100 receives a command spontaneously transmitted from the relay server 200 by a push-type communication method (S18 in FIG. 6), the printer 100 transmits a reception notification to the relay server 200 by the push-type communication method (S22 in FIG. 6). Even when receiving the reception notification, the relay server 200 does not update the status of the command from "received" to "transmitted". Therefore, it can be said that the reception notification is not used to exclude the command from the data to be transmitted to the printer 100.

[0159] For example, by replying to the relay server 200 with a reception notice of a command via MQTT, which is a push-type communication method, the printer 100 can suppress the same command from being transmitted multiple times via MQTT. However, this reception notice is not used to exclude the command from the data to be transmitted to the printer 100. For this reason, if the printer 100 transmits an accumulated command request to the relay server 200 using a pull-type communication method (HTTP in this embodiment), the relay server 200 can receive the same command. Even if the MQTT processing unit MT of the printer 100 receives a command and replies with a reception notice, if the printer 100 restarts or the like occurs before the command is passed to the instruction processing unit PT via the main processing unit CT and executed, the command may disappear. For example, when the main processing unit CT or the instruction processing unit PT is in a high-load state for processing other commands (e.g., printing processing), even if the MQTT processing unit MT receives a command, the main processing unit CT or the instruction processing unit PT may not be able to receive the command immediately, so the risk of command disappearance may increase. For this reason, if the command is excluded from the data to be transmitted to the printer 100 just by receiving this reception notice, there is a possibility that the main processing unit CT or the instruction processing unit PT cannot receive the command, and the processing based on the command may not be executed by the printer 100. In this embodiment, the reception notice in S22 of FIG. 6 is not used for the relay server 200 to exclude the command from the data to be transmitted to the printer 100. And the reception notices in S34 and S38 of FIG. 7, which are made when the instruction processing unit PT executes the processing based on the command, are used for the relay server 200 to exclude the command from the data to be transmitted to the printer 100. As a result, the certainty of transmitting the command to be transmitted from the relay server 200 to the printer 100 can be further improved, and thus, the processing (e.g., printing processing) based on the command from the relay server 200 can be surely executed by the printer 100.

[0160] Furthermore, according to this embodiment, while the instruction processing unit PT is executing processing based on a command received using a pull-type communication method, the printer 100 sets the processing flag PF to ON (S90 in FIG. 9, S110 in FIG. 9). While the processing flag PF is ON, transmission of an accumulated command request by the pull-type communication method (S415 in FIG. 5) and command response processing for other commands (S430 in FIG. 5) are prohibited (NO in S410 in FIG. 5). The prohibition of command response processing for other commands means that processing based on other commands (for example, printing processing based on other commands) is prohibited. After processing based on one command is completed, the processing flag PF is returned to OFF (S110 in FIG. 9), whereby transmission of an accumulated command request by the pull-type communication method (S415 in FIG. 5) and command response processing for other commands (S430 in FIG. 5) are resumed (YES in S410 in FIG. 5). As a result, command processing is executed in an appropriate order, one by one.

[0161] Here, while the instruction processing unit PT is executing processing based on a command received using a push-type communication method, the processing flag PF is not set to ON and remains OFF. The processing flag PF is set to ON only when executing processing based on a command received using a pull-type communication method. The reason for this is that when the relay server 200 receives a reception notification (S34, S38 in FIG. 7) that the instruction processing unit PT transmits when executing processing based on the command, a command received using a push-type communication method is excluded from the data to be transmitted (S42 in FIG. 7). In contrast, a command received using a pull-type communication method is excluded from the data to be transmitted immediately when it is transmitted from the relay server 200 to the printer 100 (S80 in FIG. 8) (S82 in FIG. 8). Therefore, it is preferable that processing based on a command received using a pull-type communication method is executed immediately when the printer 100 receives the command. Since a command received using a pull-type communication method cannot be received again, if it disappears between the time the printer 100 receives the command and the time the processing based on the command is executed, the processing based on the command cannot be executed. For this reason, it is preferable that a command received using a pull-type communication method is executed each time it is received one by one. For this reason, while the instruction processing unit PT is executing processing based on a command received using a pull-type communication method, by setting the processing flag PF to ON, transmission of an accumulated command request and execution of command response processing for other commands are prohibited.

[0162] Also, the relay server 200 of this embodiment stores commands in the management database DBm in association with status information (S14 in FIG. 6, S64 in FIG. 8). The relay server 200 transmits commands to the printer 100 according to MQTT, which is a push-type communication method (S18 in FIG. 6). The relay server 200 transmits to the printer 100 a command associated with status information indicating reception-completed among the commands stored in the management database DBm according to HTTP, which is a pull-type communication method (S80 in FIG. 8). After the relay server 200 has transmitted a command to the printer 100 using a push-type communication method (S18 in FIG. 6) and receives a reception notification transmitted from the printer 100 (S38 in FIG. 7), the relay server 200 updates the status information of the command from information indicating reception-completed to information indicating transmission-completed (S42 in FIG. 7). Also, when the relay server 200 receives an accumulated command request transmitted from the printer 100 (S78 in FIG. 8), the relay server 200 transmits to the printer 100 a command associated with status information indicating reception-completed in response to the accumulated command request using a pull-type communication method (that is, a command not yet transmitted to the printer 100) (S80 in FIG. 8).

[0163] Therefore, when the transmission of a command by a push-type communication method fails, a reception notification from the printer 100 is not received, so a command can be transmitted to the printer 100 by the HTTP communication unit HP in response to an accumulated command request from the printer 100. Therefore, while using a push-type communication method for communication between the relay server 200 and the printer 100, the certainty of command transmission to the printer 100 can be improved.

[0164] A more detailed description will be given. In the push-type communication method, since the relay server 200 spontaneously sends a command to the printer 100, at that time, if the printer 100 is not ready to receive, the printer 100 may not be able to receive the command. Also, even if the printer 100 receives the command, if there is a problem or high load in the main processing unit CT or the instruction processing unit PT at that time, the main processing unit CT or the instruction processing unit PT may not be able to normally acquire the command. In such a case, in order to transmit the command to the printer 100, it is preferable for the relay server 200 to send the command to the printer 100 again.

[0165] In the pull-type communication method, since a command is sent to the printer 100 in response to an accumulated command request from the printer 100, the command can be more reliably sent to the printer 100 when the printer 100 is ready to acquire the command.

[0166] On the other hand, in the push-type communication method, as described above, a delay in command transmission is less likely to occur compared to the pull-type communication method. For example, in pull-type communication, to shorten the delay, the printer 100 needs to perform polling at short intervals, and the control unit CP of the relay server 200 also needs to respond to the polling. For this reason, the loads on the printer 100 and the relay server 200 may become excessively large.

[0167] In this embodiment, in the push-type communication method, a command that was not transmitted to the printer 100 can be transmitted to the printer 100 using the pull-type communication method. As described above, by using the push-type communication method, commands can be sent with low load and low delay, and by also using the pull-type communication method, the commands can be reliably transmitted to the printer 100.

[0168] As can be understood from the above description, the MQTT processing unit MT in this embodiment is an example of the first communication unit, the main processing unit CT is an example of the second communication unit and the controller, and the instruction processing unit PT is an example of the execution unit. The accumulated command request in this embodiment is an example of a request signal, and the command is an example of target data. The relay server 200 in this embodiment is an example of an external device.

[0169] B. Modified Example (1) In the above embodiment, the push-type communication method is realized by MQTT, and the pull-type communication method is realized by HTTP. Instead of this, both the push-type communication method and the pull-type communication method may be realized by MQTT.

[0170] FIGS. 12 and 13 are sequence diagrams showing operation examples of the system of the modified example. For example, FIGS. 12 and 13 show operation examples when the printer 100 is in a subscribed state when the relay server 200 receives a command, similar to FIGS. 6 and 7 of the embodiment. In this modified example, when the printer 100 is in a subscribed state, the relay server 200 is also in a subscribed state in which it subscribes to a topic addressed to the relay server 200.

[0171] In FIGS. 12 and 13, the communication between the relay server 200 and the printer 100 that is performed by HTTP in FIGS. 6 and 7 is performed by MQTT. Specifically, in FIG. 12, instead of S8 and S10 in FIG. 6, S8B and S10B are executed. In FIG. 13, instead of S38 and S48 in FIG. 7, S38B and S48B are executed. Other processes in FIGS. 12 and 13 are the same as the processes with the same reference numerals in FIGS. 6 and 7.

[0172] In S8B of FIG. 12, the printer 100 transmits an accumulated command request to the relay server 200 by communication conforming to MQTT. Specifically, the main processing unit CT of the printer 100 generates an accumulated command request and sends the accumulated command request to the MQTT processing unit MT of the printer 100. The MQTT processing unit MT transmits a publish request including the accumulated command request to the relay server 200. When the MQTT communication unit MP of the relay server 200 receives the publish request, it sends the publish request to the control unit CP of the relay server 200. As a result, the accumulated command request can be transmitted from the printer 100 to the relay server 200 (control unit CP) as a topic addressed to the relay server 200.

[0173] In S10B of FIG. 12, the relay server 200 transmits an accumulation no notification to the printer 100 in response to the accumulated command request by communication conforming to MQTT. Specifically, the control unit CP of the relay server 200 generates an accumulation no notification in response to the accumulated command request and sends a publish request including the accumulation no notification to the MQTT communication unit MP. The publish request includes a topic name addressed to the printer 100. When the MQTT communication unit MPT receives the publish request, it transmits the accumulation no notification to the printer 100 in response to the publish request.

[0174] In this way, although MQTT itself is not a pull-type communication protocol, a pull-type communication method can be realized in which an accumulated command request is sent from the printer 100 to the relay server 200 using MQTT, and an accumulation no command or an accumulation yes command is sent from the relay server 200 to the printer 100 as a response to the accumulated command request.

[0175] Note that in this modification example, the printer 100 also transmits a notification regarding processing based on a command to the relay server 200 by communication conforming to MQTT. For example, in S38B of FIG. 13, the printer 100 transmits a reception notification to the relay server 200 by communication conforming to MQTT. Similarly, in S48B of FIG. 13, the printer 100 transmits an execution result notification to the relay server 200 by communication conforming to MQTT.

[0176] Although illustration is omitted, in this modified example, the accumulation command requests of S78 in FIG. 8, S78A and S84A in FIG. 11, and the accumulation available notifications of S80 in FIG. 8, S80A and S86A in FIG. 11 are also transmitted by communication according to MQTT. Similarly, in this modified example, the reception notification of S98 in FIG. 9 and the execution result notification of S108 in FIG. 9 are also transmitted by communication according to MQTT. Also, the processes of this modified example and the embodiment may be appropriately combined or changed and implemented. As an example, it is also possible to replace only the process of S8B in this modified example with the process of S8 in the embodiment and execute it.

[0177] (2) In the above embodiment, the relay server 200 includes, in the accumulation available notification to be transmitted to the printer 100, information indicating the number (accumulation number) of commands accumulated in the relay server 200 in the accumulation available notification. Instead of this, information indicating only the presence or absence of commands accumulated in the relay server 200 may be included.

[0178] (3) Furthermore, the relay server 200 does not have to include information indicating the accumulation number in the accumulation available notification to be transmitted to the printer 100. In this case, for example, when the printer 100 receives an accumulation available notification in order to receive all the commands accumulated in the relay server 200, after processing the commands included in the accumulation available notification, the printer 100 always transmits an accumulation command request to the relay server 200. Then, when the printer 100 receives an accumulation unavailable notification as a response to the accumulation command request, the printer 100 may determine that there are no unreceived commands in the relay server 200 and may not transmit an accumulation command request to the relay server 200 any more.

[0179] (4) In the above-described embodiment, while the printer 100 receives commands in a pull-type communication method conforming to HTTP and executes processing based on the commands, it is also possible to receive commands in a push-type communication method conforming to MQTT. In the case of the above-described embodiment, by processing the commands received in the push-type communication method after processing the commands received in the pull-type communication method, it becomes possible to process the actively received commands first. Further, even if processing based on the commands received in the push-type communication method is executed after it is determined (S440: NO) that there are no commands received in the pull-type communication method, the processing based on the commands received in the push-type communication method may be appropriately executed at the timing of S440: YES and S410: YES.

[0180] Instead of the embodiment, while the printer 100 receives commands in a pull-type communication method conforming to HTTP and executes processing based on the commands, it may not perform subscription to topics by MQTT, which is a push-type communication method, and may be in a state where commands cannot be received by MQTT. Even when commands are not received in the push-type communication method, since the commands stored in the relay server 200 can be received in the pull-type communication method in chronological order, it is possible to receive commands in chronological order.

[0181] (5) In the above-described embodiment, while the printer 100 executes processing based on commands received in a pull-type communication method conforming to HTTP, the processing flag PF is set to ON. However, while executing processing based on commands received in a push-type communication method conforming to MQTT, the processing flag PF is left OFF. Instead of this, regardless of the communication method by which the commands are received, the processing flag PF may be set to ON while executing processing based on all the commands. Further, when the main processing unit CT and the instruction processing unit PT are configured by one functional unit and cannot execute a plurality of processes in parallel, etc., the control using the processing flag PF may be omitted.

[0182] (6) In the above embodiment, as described above, the processing based on the command received using the pull-type communication method is executed first, and the processing based on the command received using the push-type communication method is executed later. In this way, the printer 100 executes the commands such as the print instruction in the order received from the relay server 200. For example, depending on the type of device and the type of command, there may be no problem in executing the commands in any order. In such a case, when both the command received using the pull-type communication method and the command received using the push-type communication method are received, either one may be executed first.

[0183] (7) The printer 100 transmits two responses, that is, a reception notice and an execution result notice, to the relay server 200 for one command. Not limited to this, the printer 100 may transmit only one response to the relay server 200. For example, when the command is a print instruction, it takes a certain amount of time for the printer 100 to execute the printing. For this reason, in this case, as in the embodiment, it is preferable to transmit a reception notice to the relay server 200 when the command is received, and transmit an execution result notice to the relay server 200 when the printing is completed. When the command is, for example, an instruction to transmit the remaining ink amount, since the printer 100 only reads and transmits the remaining ink amount from the memory, the time required to execute the command is very short. For this reason, in this case, it is preferable that the printer 100 immediately reads the remaining ink amount after receiving the command and transmits an execution result notice including the remaining ink amount to the relay server 200. In this case, the reception notice is not transmitted to the relay server 200. Note that depending on the type of command, more than three responses may be transmitted to the relay server 200 for one command.

[0184] Regardless of the number of responses for one command, when the relay server 200 receives the first response among one or more HTTP responses for one command, it is preferable to update the status information of the command from received to transmitted.

[0185] (8) In the above embodiment, the status of the command can take three states: received, transmitted, and canceled. However, this is not the only case. The number of states that the command status can take may be only two, or four or more. For example, if there is no mechanism to cancel the command, the command status may be only two types: received and transmitted. For example, when the relay server 200 receives a command transmission instruction from the first server 300A, it may determine whether the printer 100 is in an online state or an offline state. If the printer 100 is in an offline state, it may have a mechanism to reject the reception of the command transmission instruction. In this case, in addition to the three types in the embodiment, the command status may include a reception rejection state.

[0186] (9) In the above embodiment, when the relay server 200 uses a pull-type communication method to send a command to the printer 100, as shown in S82 of FIG. 8, it updates the status of the command from received to transmitted without receiving a reception notification from the printer 100. Instead of this, even when the relay server 200 uses a pull-type communication method to send a command to the printer 100, it may update the status of the command from received to transmitted after receiving a reception notification from the printer 100, similar to the case of using a push-type communication method to send a command.

[0187] (10) The relay server 200 includes information indicating the upper limit number of commands in the accumulation notification to be sent to the printer 100, but it may not include the information indicating the upper limit number of commands in the accumulation notification. In this case, for example, the upper limit number of commands may always be set to a predetermined number, for example, a number that the printer 100 can sufficiently receive in one response (for example, 1).

[0188] (11) In the above embodiment, as the push-type communication method, a communication method conforming to MQTT is adopted, but other push-type communication methods may also be adopted. Also, as the pull-type communication method, a communication method conforming to HTTP is adopted, but other pull-type communication methods may also be adopted. As the push-type communication method, for example, XMPP (eXtensible Messaging and Presence Protocol) may be adopted. As the pull-type communication method, for example, FTP (File Transfer Protocol) may be adopted.

[0189] (12) In the above embodiment, as information for specifying the storage order of command information in the command information table CDT, in other words, as information for specifying the reception order of commands, information indicating the reception date and time is used. Instead of this, the information for specifying the reception order of commands may be other information, for example, a number assigned in ascending order to the commands according to the reception order of the commands. Such a number assigned in ascending order may, for example, also serve as the command ID.

[0190] (13) In the above embodiment, the printer 100 is used as the device for providing the service, but other types of devices may also be adopted. The device may be, for example, a scanner or a digital camera that generates image data by optically reading an object using an image sensor. The device may be, for example, a sewing machine that forms an image such as a pattern on a fabric by embroidering the fabric using a thread, or a terminal device such as a smartphone or a personal computer.

[0191] Also, the device is not limited to image processing devices such as printers, scanners, cameras, and sewing machines, and various devices configured to be connectable to the Internet IT may be adopted. For example, the device may be a device unrelated to images, such as home appliances such as a refrigerator or a microwave oven, or a music player or a temperature sensor.

[0192] The services provided by servers 300A and 300B can be various services according to the devices adopted. The services can be, for example, services realizable by remotely operating a device by sending a command to the device, or services realizable by collecting information about the device by sending a command to the device.

[0193] Note that the target data transmitted from servers 300A and 300B to the device via relay server 200 is not limited to commands. The target data may be data for notification or information provision to the user of the device, or data such as setting information stored in the device.

[0194] (14) In the above embodiment, when relay server 200 receives a reception notification of a command transmitted from MQTT communication unit MP, it always updates the status information of the command (S42 in FIG. 7). Instead of this, printer 100 may include flag information indicating whether to update the status information in the reception notification. Then, when the reception notification includes flag information indicating that the status information is to be updated, relay server 200 updates the status information of the command, and when the reception notification includes flag information indicating that the status information is not to be updated, relay server 200 may not update the status information of the command. In this case, printer 100 can, for example, include flag information indicating that the status information is not to be updated in the reception notification when receiving a command during a high load period, etc., so that the command can be received again later.

[0195] (15) In the above embodiment, a part of the configuration realized by hardware may be replaced with software, and conversely, a part or all of the configuration realized by software may be replaced with hardware.

[0196] The present invention has been described above based on the embodiments and modification examples. However, the above-described embodiments of the invention are for facilitating the understanding of the present invention and do not limit the present invention. The present invention can be changed and improved without departing from the gist and scope of the claims, and equivalents thereof are included in the present invention.

Description of Reference Numerals

[0197] 1000... System, 100... Printer, 110... CPU, 120... Volatile Memory Device, 130... Non-Volatile Memory Device, 140... Display Unit, 150... Operation Unit, 170... Printing Mechanism, 180... Communication IF, 190... Ink Tank, 200... Relay Server, 210... CPU, 220... Volatile Memory Device, 230... Non-Volatile Memory Device, 280... Communication IF, 300A... First Server, 300B... Second Server, 310... CPU, 320... Volatile Memory Device, 330... Non-Volatile Memory Device, 380... Communication IF, CDT... Command Information Table, CDa, CDb... Command Information, CP... Control Unit, CT... Main Processing Unit, DBa... First Database, DBb... Second Database, DBm... Management Database, HP... HTTP Communication Unit, IB... Information Database, IL... Command List, IT... Internet, MP... MQTT Communication Unit, MT... MQTT Processing Unit, PF... Processing Flag, PGp, PGr, PGsA, PGsB... Computer Program, PT... Instruction Processing Unit

Claims

1. A communication device, a first communication unit configured to receive data spontaneously transmitted from an external device by a first communication method which is a push-type communication method; a second communication unit configured to transmit a request signal to the external device by a second communication method which is a pull-type communication method, and receive data from the external device as a response to the request signal; a controller; and comprising: wherein the controller: when the communication device is in an online state in which it can communicate with the external device, uses the first communication unit to receive target data to be processed by the communication device, which is spontaneously transmitted from the external device; when the communication device transitions from an offline state in which it cannot communicate with the external device to the online state, uses the second communication unit to transmit the request signal to the external device; uses the second communication unit to receive the target data from the external device as a response to the request signal; determines whether there is any of the target data that has not been received by the external device; and repeatedly transmits the request signal to the external device using the second communication unit until it is determined that there is no un-received target data in the external device.

2. The communication device according to claim 1, wherein the controller: when receiving the target data from the external device as a response to the request signal using the second communication unit, receives presence information indicating at least the presence or absence of the un-received target data; and determines whether there is any un-received target data in the external device using the presence information.

3. The communication device according to claim 1, further comprising: an execution unit configured to execute specific processing based on the target data; wherein when receiving the target data using the second communication unit, the controller causes the execution unit to execute the specific processing based on the target data received using the second communication unit; and after causing the execution unit to execute the specific processing based on the target data received using the second communication unit, causes the execution unit to execute the specific processing based on the un-processed target data received using the first communication unit.

4. The communication device according to claim 1, wherein the controller: uses the second communication unit to transmit to the external device the request signal including number information specifying the maximum number of the target data that can be received in one response to the request signal. A communication device that uses the second communication unit to receive, as a single response to the request signal, the number of pieces of the target data corresponding to the maximum number from the external device.

5. The communication device according to claim 3, further comprising: A communication device comprising a notification unit that transmits a notification regarding the target data to the external device when executing the specific process based on the target data.

6. The communication device according to claim 5, wherein: The notification unit transmits a notification regarding the target data according to a communication protocol different from the communication protocol used by the first communication unit.

7. The communication device according to claim 5, wherein: The notification regarding the target data includes identification information for identifying the target data and information indicating the status of the target data used to exclude the target data from the data to be transmitted from the external device to the communication device. Communication device.

8. The communication device according to claim 5, wherein: When the first communication unit receives the target data spontaneously transmitted from the external device, the first communication unit transmits a reception notification that is not used to exclude the target data from the data to be transmitted from the external device to the communication device to the external device by the first communication method.

9. The communication device according to claim 3, wherein: The controller: While the execution unit is executing the specific process based on one piece of the target data received using the second communication unit, prohibits the transmission of the request signal by the second communication unit and the execution of the specific process by the execution unit based on other target data, After the specific process based on one piece of the target data is completed, causes the second communication unit to transmit the request signal or causes the execution unit to execute the specific process based on other target data.

10. The communication device according to claim 1, wherein: The first communication method is a communication method according to MQTT (Message Queueing Telemetry Transport), The second communication method is a communication method according to HTTP (HyperText Transfer Protocol).

11. A communication system comprising a communication device and an external device, wherein: The external device: A storage unit that stores target data in association with status information, wherein the status information indicates any one of a plurality of states including a first state indicating that the target data should be transmitted to the communication device and a second state different from the first state, the storage unit, A first transmission unit that transmits the target data to the communication device by a first communication method that is a push-type communication method, A second transmission unit that transmits, to the communication device, the target data associated with the status information indicating the first state among the target data stored in the storage unit by a second communication method that is a pull-type communication method, Comprising, The communication device, A first communication unit that receives data spontaneously transmitted from the external device by the first communication method, A second communication unit that transmits a request signal to an external device and receives data from the external device as a response to the request signal by the second communication method, An execution unit that executes a specific process based on the received target data, A notification unit that transmits a notification regarding the target data to the external device when executing the specific process based on the target data, Comprising, The communication device, When the communication device is in an online state where it can communicate with the external device, it uses the first communication unit to receive the target data spontaneously transmitted from the external device, When the communication device transitions from an offline state where it cannot communicate with the external device to the online state, it uses the second communication unit to transmit the request signal to the external device, Using the second communication unit, as a response to the request signal, it receives the target data from the external device, Determines whether there is unreceived target data in the external device, Repeatedly transmits the request signal to the external device using the second communication unit until it is determined that there is no unreceived target data in the external device, The external device, After transmitting the target data to the communication device using the first transmission unit, when receiving a notification regarding the target data from the communication device, it updates the status information of the target data from information indicating the first state to information indicating the second state, A communication system that, when receiving the request signal from the communication device, transmits, to the communication device, the target data associated with the status information indicating the first state in response to the request signal using the second transmission unit.

12. A computer program for a communication device, a first communication function for receiving data spontaneously transmitted from an external device by a first communication method which is a push-type communication method, a second communication function for transmitting a request signal to the external device by a second communication method which is a pull-type communication method and receiving data from the external device as a response to the request signal, a control function, to be implemented on a computer, the control function, when the communication device is in an online state where it can communicate with the external device, uses the first communication function to receive target data to be processed by the communication device, which is spontaneously transmitted from the external device, when the communication device transitions from an offline state where it cannot communicate with the external device to the online state, uses the second communication function to transmit the request signal to the external device, uses the second communication function to receive the target data from the external device as a response to the request signal, determines whether there is any of the target data that has not been received by the external device, and repeatedly transmits the request signal to the external device using the second communication function until it is determined that there is no unreceived target data in the external device. A computer program.

Citation Information

Patent Citations

  • Mobile instant message service system and mobile instant message service program

    JP3602512B2