Communication device, communication system, and computer program
The communication device addresses the issue of duplicate processing by using a controller to compare received target data identification information with a stored list, preventing duplicate execution and ensuring efficient communication even with unstable connections.
Patent Information
- Application Number
- JP2023201491
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2023-11-29
- Publication Date
- 2025-06-10
AI Technical Summary
Existing communication systems do not consider the communication state of mobile phones, leading to repeated transmission of messages when the communication with external devices is unstable, resulting in duplicate execution of processing.
A communication device is configured with a first communication unit for push-type communication, a second communication unit for pull-type communication, a list storage unit to store identification information of target data, and a controller that compares received target data identification information with the stored list to prevent duplicate execution of specific processing.
The solution effectively suppresses the repeated execution of specific processing by matching the identification information of received target data with the stored list, ensuring that processing is only executed once even if the same data is repeatedly transmitted.
Smart Images

Figure 2025087086000001_ABST
Abstract
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 a mobile phone of user A and a 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 the communication between the mobile phone and an external device providing a messaging service is unstable, the same message may be repeatedly transmitted from the external device to the mobile phone.
[0005] This specification discloses a technology capable of suppressing the duplicate execution of specific processing based on target data when the same target data is repeatedly 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, comprising: a first communication unit that receives target data spontaneously transmitted from an external device by a first communication method that is a push-type communication method; a second communication unit that transmits a request signal to the external device by a second communication method that is a pull-type communication method and receives data from the external device as a response to the request signal; a list storage unit that stores a list of identification information of target data to be processed by the communication device; an execution unit that executes a specific process based on the target data; and a controller. The controller compares the identification information of the target data received using the first communication unit or the second communication unit with the identification information already recorded in the list. When the identification information of the target data received using the first communication unit or the second communication unit matches the identification information already recorded in the list, the controller does not cause the execution unit to execute the specific process based on the received target data. When the identification information of the target data received using the first communication unit does not match the identification information already recorded in the list, the controller causes the execution unit to execute the specific process based on the received target data, records the identification information of the target data received using the first communication unit in the list, and when the identification information of the target data received using the second communication unit does not match the identification information already recorded in the list, the controller causes the execution unit to execute the specific process based on the received target data.
[0008] According to the above configuration, after the target data received using the first communication unit is executed, the identification information of the target data is recorded in the list. When the identification information of the target data received using the first communication unit or the second communication unit matches the identification information already recorded in the list, the specific process based on the received target data is not executed. Therefore, for example, when the same target data is received using the first communication unit or the second communication unit after the specific process based on the target data received using the first communication unit is executed, the specific process based on the target data is not executed. Therefore, when the same target data is repeatedly transmitted from the external device to the communication device, it is possible to suppress the repeated execution of the specific process based on the target data.
[0009] Note that the technology disclosed in this specification can be implemented in various forms. For example, it can be implemented in the form of a communication device, a communication system including the 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 so on.
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 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 for displaying an image, an operation unit 150 such as buttons or a touch panel for acquiring operations 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 and provided in the non-volatile storage device 130 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 a 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 service provider that provides a print service (for example, a service provider 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, for example, a service that causes a printer to perform printing by generating a print instruction (also called a print job) for executing printing using an image file stored in the server by a 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, the second server 300B includes a CPU 310, a volatile memory device 320, a non-volatile memory device 330, and a communication IF 380 that control 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 is uploaded, for example, by an operator who operates a printing service. The CPU 310 of the second server 300B executes processing related to the second printing service by executing the computer program PGsB.
[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 remaining ink amount information and printing history information of each printer collected from the printers. Details of the second database DBb are omitted.
[0033] Note that in FIG. 1, only one printer 100 is shown, but the first server 300A and the second server 300B provide printing services to a number of users using a number of printers. In the following, various processes for one printer 100 will be described, but these processes are executed independently for each of the plurality of 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] Similar to computer programs PGsA and PGsB, the computer program PGr is provided in a form uploaded by, for example, an operator who operates a printing service. 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 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 that subscribes to the topic (i.e., the printer 100).
[0039] Thus, when the printer 100 subscribes to the topic addressed to the printer 100, the MQTT communication unit MP can send 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 conforming to 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, etc., the printer 100 cannot subscribe to the topic addressed to the printer 100. When the printer 100 does not subscribe to the topic addressed to the printer 100, even if the control unit CP publishes the topic addressed to the printer 100 to the MQTT communication unit MP, the MQTT communication unit MP does not send the topic to the printer 100.
[0041] Even when the MQTT communication unit MP sends a topic to the printer 100 or does not send it, the MQTT communication unit MP does not notify the control unit CP of the transmission result of the topic. For this reason, the control unit CP does not know whether the published topic (data to be sent) 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 sends an HTTP request to the relay server 200 (HTTP communication unit HP), the HTTP communication unit HP sends data to be sent 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 send 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 conforming to HTTP and the printer 100 is a pull-type communication method.
[0044] In communication following HTTP, delays are likely to occur because data cannot be sent to the printer 100 at any 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 following HTTP, data is sent in response to the request of the printer 100, so data can be sent when the printer 100 is in a receivable state, and there is a high possibility that the data can be surely delivered to the printer 100.
[0045] In this embodiment, as will be described in detail later, the relay server 200 selectively uses communication following MQTT and communication following 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 a printing instruction (also called a printing 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 and the like of the printing job 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 material of the printer 100 and an instruction to send history information such as the printing history and the 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 material and information indicating the printing history and the 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 result of the process executed based on a command (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. In management database DBm, 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), is stored. 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] A plurality of command information CDa and CDb are stored in the command information table CDT. 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 a 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 a device. The reception date and time of the command is the date and time when 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 but has not been received by the destination device and 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 has been canceled by servers 300A and 300B.
[0053] Since a command in the "received" state should be transmitted to the destination device, the "received" state can also be said to be the state indicating that the command should be transmitted to the destination device. Since a command in the "transmitted" or "canceled" state does not need to be transmitted to the destination device, the "transmitted" and "canceled" states can also be said to be the states indicating that the command does not need to be transmitted to the destination device.
[0054] Here, the reception of a command means that the command has been acquired by an application that should process the command in the device that is the destination of the command. For example, the reception of a command by the relay server 200 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. The reception of a command by the printer 100 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 content of an instruction and includes information necessary for a device (e.g., the printer 100) to execute processing based on the command. For example, if 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 copies to be printed 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 notice 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] FIG. 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. Operation of System 1000 The operation of the system 1000 will be described centering on the operation of the printer 100. FIG. 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 FIG. 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 that 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 the online state, that is, the state where the printer 100 cannot communicate with the relay server 200 is also called the 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 the 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 a subscribe registration. The subscribe registration is a process of registering the topic having the topic name included in the subscribe request as the topic to be sent to the printer 100. As a result, the printer 100 is in a state of subscribing to the command addressed to the printer 100 (in other words, the topic addressed to the printer 100) (hereinafter, also referred to as the subscribe state). In the subscribe state, the relay server 200 can spontaneously send the 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 process 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, it is usually OFF, for example, at power-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 on the relay server 200 as the transmission destination (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 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 the relay server 200 is determined to have no stored command to be sent to the printer 100, it sends a no-stored notification indicating that there is no stored command to be sent 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 (for example, printing processing). The command corresponding processing includes, for example, receiving a notification (receipt 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 ends, 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. When the accumulated number M of commands is greater than the upper limit number N of commands, it is not possible to receive all the commands stored in the relay server 200 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] When there is an unreceived command (S440: YES), the main processing unit CT returns to S410. When there is no unreceived command (S435: NO), the main processing unit CT proceeds with the processing to S445.
[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, in 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), in other words, 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 acquires a set of a command and a command ID from the FIFO queue in S450. In S455, command corresponding processing is executed for the command acquired from the FIFO queue. After the main processing unit CT executes the command corresponding processing for one command, it 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 processes 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 start 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), it executes MQTT connection processing at S4 (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. Therefore, 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 the accumulation notification, as described above, it transitions to the state of processing the commands received by the MQTT processing unit MT. That is, the main processing unit CT is in the state of monitoring the above-described FIFO queue for MQTT (S445 in FIG. 5).
[0088] After the printer 100 thus 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 the target device ID and the command to be transmitted. The target device ID is identification information indicating the device to which the command is to be transmitted. The communication between the first server 300A and the relay server 200 is performed according to a known communication protocol (for example, HTTP or a dedicated protocol).
[0089] When the relay server 200 receives the command transmission instruction, at S14, the relay server 200 stores the 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 the command information including the command and the 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, it is assumed 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 that subscribes 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 subscribes 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 subscribes to the topic addressed to the printer 100. For this reason, in S18, the MQTT communication unit MP sends the command and command ID from the relay server 200 to the printer 100.
[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 S 20, 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 it has received the command 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 in which the main processing unit CT, the instruction processing unit PT, the MQTT processing unit MT, the relay server 200, and the first server 300A cooperate 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 time 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 on 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 the 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, as 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 purpose, 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 the 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, it is assumed 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, it is assumed 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 the 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 it has received the command transmission instruction 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 the 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. Also, 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 storage available 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 a command using communication conforming to HTTP. As described above, when the main processing unit CT of the printer 100 receives a storage available notification (YES in S420 and S425 of FIG. 5), it executes command corresponding processing for the command included in the storage available 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 processes 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 processes. 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 addition, 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 received command 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 regarding 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), in S540, a command (also referred to as a target command) based on the received command transmission instruction is transmitted 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 target command is not transmitted using the MQTT communication unit MP.
[0137] As described above, when there are no other commands to be sent to the printer 100, 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 accumulated, 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, despite there being other commands to be sent to the printer 100 accumulated, the target command is immediately sent from the MQTT communication unit MP to the printer 100. In this case, while 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 other commands is earlier than that of the target command, the transmission of 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 may occur that page 2 is printed earlier than page 1.
[0139] In this embodiment, in order to suppress such an inconvenience, when there are other commands to be sent accumulated, the target command is not sent from the MQTT communication unit MP, so the target command is accumulated together with other commands. Both the accumulated 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 accumulated, the HTTP communication unit HP sends the commands to the printer 100 according to 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, with reference 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 twice N 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 transmits an accumulation available notification to the printer 100 as a response to the accumulation command request using the HTTP communication unit HP. 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 in which they are stored. When the main processing unit CT acquires the commands of the N commands, for each of the N commands, it executes the above-described command corresponding process (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 corresponding process of each command, the one with the earlier command storage order 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 a 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 in which the commands are stored. For each of the (M - N) commands, the main processing unit CT of the printer 100 executes the command-corresponding processing described above (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 the earlier command storage order is executed first.
[0147] Since the stored notification received by the printer 100 includes information indicating the stored number (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 stored number, 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 stored number of commands is at least information indicating the presence or absence of unreceived commands.
[0148] According to the present embodiment described above, the printer 100 realizes a push-type communication method by communication conforming to MQTT, and can receive data spontaneously transmitted from the relay server 200 (S300 to S350 in FIG. 4). The printer 100 realizes a pull-type communication method by communication conforming to HTTP, transmits 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). The printer 100 compares the command ID of the received command with the command ID already recorded in the command list IL. When the received command ID matches the command ID already recorded in the command list IL (YES in S26 of FIG. 6, YES in S84 of FIG. 8), the printer 100 does not execute the process based on the received command (S28 in FIG. 6, S86 in FIG. 8). When the command ID received using the push-type communication method does not match the command ID already recorded in the command list IL (NO in S26 of FIG. 6), the printer 100 executes a specific process based on the received command (S36 in FIG. 7) and records the received command ID in the command list IL (S30 in FIG. 7). When the command ID received using the pull-type communication method does not match the command ID already recorded in the command list IL (NO in S84 of FIG. 8), the printer 100 executes a specific process based on the received command (S96 in FIG. 9). Therefore, for example, after the process based on the command received using the push-type communication method is executed, when the same command is received using the push-type or pull-type communication method, the process based on the command is not executed. Therefore, when the same command is repeatedly transmitted from the relay server 200 to the printer 100, it is possible to suppress the repeated execution of the process based on the command.
[0149] In particular, the push-type communication method is a mechanism in which the relay server 200 spontaneously sends commands to the printer 100. For this reason, when using the push-type communication method, it is difficult for the relay server 200 to determine whether a command has been received by an application (main processing unit CT or instruction processing unit PT) in the printer 100 that processes the command. For this reason, there is a possibility that the relay server 200 may send the command to the printer 100 again even though the command has already been received by the printer 100. For this reason, if the main processing unit CT or instruction processing unit PT of the printer 100 processes all the received commands, the processing based on the commands may be executed repeatedly two or more times. According to this embodiment, such inconveniences can be suppressed.
[0150] Furthermore, according to this embodiment, when the printer 100 transitions from an offline state to an online state, it sends an accumulated command request to the relay server 200 using the pull-type communication method (S78 in FIG. 8), and receives a command from the relay server 200 as a response to the accumulated command request using the pull-type communication method (S80 in FIG. 8). Then, the printer 100 compares the command ID of the command received using the pull-type communication method with the command IDs already recorded in the command list IL (S84 in FIG. 8). For example, when the printer 100 transitions from an offline state to an online state, it may erroneously receive a command that has already been received using the push-type communication method again when receiving a command that could not be received during the offline state using the pull-type communication method. According to the above configuration, even in such a case, it is possible to suppress the repeated execution of the processing based on the commands.
[0151] Furthermore, according to this embodiment, when the command ID of the command received using the pull-type communication method does not match the command ID already recorded in the command list IL (NO in S84 of FIG. 8), the printer 100 executes the process based on the received command (S96 in FIG. 9), and records the command ID of the command received using the pull-type communication method in the command list IL (S88 in FIG. 8). As a result, when a command received using the pull-type communication method is received again using the pull-type or push-type communication method, it is possible to suppress the duplicate execution of the process based on the command.
[0152] Furthermore, according to this embodiment, when executing the process based on the command, the printer 100 transmits notifications regarding the command (specifically, reception notifications and execution result notifications) to the relay server 200 (S38, S48 in FIG. 7, S98, S108 in FIG. 9). After transmitting the notification regarding the command to the relay server 200, the printer 100 deletes the command ID of the command from the command list IL (S50 in FIG. 7, S112 in FIG. 9). When the notification regarding the command is transmitted to the relay server 200, the relay server 200 can confirm that the command has reached the printer 100 by receiving the notification. Therefore, the possibility that the relay server 200 erroneously transmits the same command to the printer 100 later is low. In this embodiment, according to the above configuration, since the possibility of erroneously transmitting the same command to the printer 100 is low, when the necessity of recording in the command list IL becomes low, the command ID of the command is deleted from the command list IL. Therefore, it is possible to suppress the wasteful use of the memory of the printer 100.
[0153] Printer 100 uses a pull-type communication method to receive commands from relay server 200 as responses to accumulated command requests (S415, S420 in FIG. 5, S78, S80 in FIG. 8, S78A, S80A in FIG. 11). Printer 100 determines whether there are any unreceived commands in relay server 200 (S435 in FIG. 5, S82A, S88A in FIG. 11), and repeats sending accumulated command requests to relay server 200 using the pull-type communication method until it determines that there are no unreceived commands in relay server 200 (S415, S440 in FIG. 5, S82A, S88A in FIG. 11).
[0154] When printer 100 is in an offline state, printer 100 may not be able to receive commands even if relay server 200 spontaneously sends commands using a push-type communication method. In this embodiment, for example, even if there are a plurality of commands that could not be received using the push-type communication method because of the offline state, printer 100 can receive all the plurality of commands without omission by repeatedly sending accumulated command requests to relay server 200.
[0155] Furthermore, according to this embodiment, printer 100 sends an accumulated command request including an upper limit command number N to relay server 200 using a pull-type communication method (S78A in FIG. 11). As a single response to the accumulated command request, printer 100 receives an accumulated notification including a number of commands corresponding to the upper limit command number N from relay server 200 (S80A in FIG. 11). As a result, printer 100 can receive a number of commands corresponding to the upper limit command number N from relay server 200 as a single response. As a result, for example, by specifying an appropriate upper limit command number N from the perspective of the memory capacity and processing power of printer 100, an appropriate number of commands can be received in a single response. Therefore, a plurality of commands can be received efficiently.
[0156] 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 the command corresponding processing including the processing based on the command received using the pull-type communication method, the printer 100 executes the command corresponding processing including the processing based on the unprocessed command received using the push-type communication method (S455 in FIG. 5). At this time, the command ID of the command is recorded in the command list IL (S88 in FIG. 9). As a result, for example, after executing the 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, the processing based on the command received by the push-type communication method can be executed after transitioning to an online state. Therefore, the processing based on the command can be executed in an appropriate order. And since the command ID of the command received by the push-type communication method is recorded in the IL, even if the command received by the push-type communication method after transitioning to the online state is received again by the pull-type communication method, it is possible to suppress the processing based on the command from being erroneously executed again.
[0157] 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.
[0158] Here, while the instruction processing unit PT is executing processing based on a command received using the 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 the pull-type communication method. The reason for this is that when the relay server 200 receives a reception notification (S34, S38 in FIG. 7) transmitted by the instruction processing unit PT when executing processing based on the command, a command received using the push-type communication method is excluded from the data to be transmitted (S42 in FIG. 7). In contrast, a command received using the 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 the pull-type communication method is executed immediately when the printer 100 receives the command. Since a command received using the pull-type communication method cannot be received again, if a disappearance occurs between when the printer 100 receives the command and when 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 the 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 the pull-type communication method, by setting the processing flag PF to ON, the transmission of the accumulated command request and the execution of command response processing for other commands are prohibited.
[0159] As can be understood from the above description, the MQTT processing unit MT of 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 of this embodiment is an example of a request signal, and the command is an example of target data. The relay server 200 of this embodiment is an example of an external device.
[0160] B. Modification 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.
[0161] 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.
[0162] 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.
[0163] In S8B of FIG. 12, the printer 100 transmits an accumulated command request to the relay server 200 by communication according 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. Thereby, 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.
[0164] In S10B of FIG. 12, the relay server 200 transmits a storage silent notification to the printer 100 in response to a storage command request by communication conforming to MQTT. Specifically, the control unit CP of the relay server 200 generates a storage silent notification in response to a storage command request, and sends a publish request including the storage silent 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 a storage silent notification to the printer 100 in response to the publish request.
[0165] In this way, although MQTT itself is not a pull-type communication protocol, a pull-type communication method can be realized in which a storage command request is sent from the printer 100 to the relay server 200 using MQTT, and a storage silent command or a storage command with storage is sent from the relay server 200 to the printer 100 as a response to the storage command request.
[0166] 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.
[0167] Note that although illustration is omitted, in this modification example, the storage command requests in S78 of FIG. 8, S78A and S84A of FIG. 11, and the storage notifications with storage in S80 of FIG. 8, S80A and S86A of FIG. 11 are also transmitted by communication conforming to MQTT. Similarly, in this modification example, the reception notification in S98 of FIG. 9 and the execution result notification in S108 of FIG. 9 are also transmitted by communication conforming to MQTT. Also, the processes of this modification 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 of this modification example with the process of S8 of the embodiment and execute it.
[0168] (2) In the above embodiment, the command ID of the command received using the push-type communication method is recorded in the command list IL (S30 in FIG. 7), and the command ID of the command received using the pull-type communication method is also recorded in the command list IL (S88 in FIG. 9). Instead of this, only the command ID of the command received using the push-type communication method may be recorded in the command list IL, and the command ID of the command received using the pull-type communication method may not be recorded in the command list IL. The command received using the pull-type communication method is transmitted from the relay server 200 when the printer 100 is in a receivable state. For this reason, since the relay server 200 can recognize that the command has been received by the printer 100, the possibility of erroneously transmitting the same command to the printer 100 again is low. For this reason, the necessity of recording the command ID of the command received using the pull-type communication method in the command list IL is lower than the necessity of recording the command ID of the command received using the push-type communication method in the command list IL.
[0169] (3) In the above embodiment, the printer 100 transmits an accumulated command request to the relay server 200 at the timing when it transitions from the offline state to the online state (S415 in FIG. 5). Not limited to this timing, the printer 100 may transmit an accumulated command request to the relay server 200 at other timings. For example, when the main processing unit CT of the printer 100 executes a printing process based on a printing instruction transmitted from a user's terminal for a long time, the printer 100 may transmit an accumulated command request to the relay server 200 after the printing process.
[0170] (4) In the above embodiment, after the printer 100 transmits the execution result notification of the command to the relay server 200, it deletes the command ID of the command from the command list IL (S50 in FIG. 7, S112 in FIG. 9). Not limited to this, for example, the printer 100 may delete the command ID from the command list IL when a predetermined period has elapsed after the command ID is recorded in the command list IL (for example, several days). Alternatively, when the number of command IDs recorded in the command list IL exceeds a predetermined number (for example, 100), the printer 100 may delete the excess command IDs in the order of the oldest recording date and time.
[0171] (5) In the above embodiment, after the printer 100 processes the command received using the pull-type communication method, it determines whether there is an unprocessed command, and repeatedly transmits an accumulated command request to the relay server 200 until it determines that there is no unprocessed command (S440 in FIG. 5). Instead of this, the relay server 200 may return all the accumulated commands in a single response, and the printer 100 may transmit the accumulated command request to the relay server 200 only once.
[0172] (6) In the above embodiment, the relay server 200 includes information indicating the number of commands (accumulation number) accumulated in the relay server 200 in the accumulated command notification to be transmitted to the printer 100. Instead of this, it may include information indicating only the presence or absence of commands accumulated in the relay server 200.
[0173] (7) Further, the relay server 200 does not have to include information indicating the number of accumulations in the accumulation notification to be transmitted to the printer 100. In this case, for example, when the printer 100 receives an accumulation notification in order to receive all the commands accumulated in the relay server 200, after processing the commands included in the accumulation notification, the printer 100 always transmits an accumulation command request to the relay server 200. Then, when the printer 100 receives an accumulation - free notification as a response to the accumulation command request, the printer 100 may determine that there are no un - received commands in the relay server 200 and may not transmit an accumulation command request to the relay server 200 any more.
[0174] (8) In the above - described embodiment, while the printer 100 receives commands by a pull - type communication method conforming to HTTP and executes processing based on the commands, the printer 100 can also receive commands by a push - type communication method conforming to MQTT. In the case of the above - described embodiment, by processing the commands received by the push - type communication method after processing the commands received by the pull - type communication method, it becomes possible to process the actively received ones first. Also, even if the processing based on the commands received by the push - type communication method is executed after it is determined (S440: NO) that there are no commands received by the pull - type communication method, the processing based on the commands received by the push - type communication method may be appropriately executed at the timing of S440: YES and S410: YES.
[0175] Instead of the embodiment, while the printer 100 receives commands by a pull - type communication method conforming to HTTP and executes processing based on the commands, the printer 100 may not perform topic subscription 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 by the push - type communication method, since the commands accumulated in the relay server 200 can be received in chronological order by the pull - type communication method, it is possible to receive commands in chronological order.
[0176] (9) In the above embodiment, while the printer 100 is executing processing based on a command received by a pull-type communication method conforming to HTTP, the processing flag PF is set to ON. However, while executing processing based on a command received by a push-type communication method conforming to MQTT, the processing flag PF is left OFF. Instead of this, regardless of whether the command is received by which communication method, the processing flag PF may be set to ON while executing processing based on all commands. Also, 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.
[0177] (10) In the above embodiment, as described above, by first executing processing based on a command received using a pull-type communication method and then executing processing based on a command received using a push-type communication method, the printer 100 executes commands such as a 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 cases where there is no problem regardless of the order in which the commands are executed. In such a case, when both a command received using a pull-type communication method and a command received using a push-type communication method are received, either one may be executed first.
[0178] (11) Printer 100 sends two responses, namely a reception notice and an execution result notice, to relay server 200 for one command. Not limited to this, printer 100 may also send only one response to relay server 200. For example, when the command is a print instruction, it takes a certain amount of time for printer 100 to execute the printing. Therefore, in this case, as in the embodiment, it is preferable to send a reception notice to relay server 200 when the command is received, and send an execution result notice to relay server 200 when the printing is completed. When the command is, for example, a transmission instruction for the remaining ink amount, printer 100 only reads the remaining ink amount from the memory and sends it, so the time required for executing the command is very short. Therefore, in this case, it is preferable for printer 100 to immediately read the remaining ink amount after receiving the command and send an execution result notice including the remaining ink amount to relay server 200. In this case, the reception notice is not sent to relay server 200. Note that depending on the type of command, more than three responses may be sent to relay server 200 for one command.
[0179] Regardless of the number of responses to one command, when relay server 200 receives the first response among one or more HTTP responses to one command, it is preferable to update the status information of the command from received to transmitted.
[0180] (12) Relay server 200 includes information indicating the upper limit command number in the accumulation notice to be sent to printer 100, but it is not necessary to include information indicating the upper limit command number in the accumulation notice. In this case, for example, the upper limit command number may always be set to a predetermined number, for example, a number that printer 100 can sufficiently receive in one response (for example, 1).
[0181] (13) 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 be adopted. Also, as the pull-type communication method, a communication method conforming to HTTP is adopted, but other pull-type communication methods may 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.
[0182] (14) In the above embodiment, as the device used for providing the service, the printer 100 is used, but other types of devices may 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.
[0183] 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 can be adopted. For example, the device may be a device unrelated to images, such as a home appliance such as a refrigerator or a microwave oven, or a music player or a temperature sensor.
[0184] The services provided by the servers 300A and 300B may be various services according to the adopted devices. The service may be, for example, a service realizable by remotely operating the device by sending a command to the device, or a service realizable by collecting information about the device by sending a command to the device.
[0185] Note that the target data transmitted from the servers 300A and 300B to the device via the relay server 200 is not limited to commands. The target data may be data for notifying or providing information to the user of the device, or data such as setting information stored in the device.
[0186] (15) In the above embodiments, a part of the configuration realized by hardware may be replaced with software, or conversely, a part or all of the configuration realized by software may be replaced with hardware.
[0187] The present invention has been described above based on the embodiments and modified 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 spirit and scope of the claims, and equivalents thereof are included in the present invention.
Explanation of Reference Numerals
[0188] 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, comprising: a first communication unit configured to receive target data that is 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 list storage unit configured to store a list of identification information of target data to be processed by the communication device; an execution unit configured to execute a specific process based on the target data; a controller; The communication device compares the identification information of the target data received by using the first communication unit or the second communication unit with the identification information already recorded in the list. If the identification information of the target data received by using the first communication unit or the second communication unit matches the identification information already recorded in the list, the controller does not cause the execution unit to execute the specific process based on the received target data. If the identification information of the target data received by using the first communication unit does not match the identification information already recorded in the list, the controller causes the execution unit to execute the specific process based on the received target data, and records the identification information of the target data received by using the first communication unit in the list. If the identification information of the target data received by using the second communication unit does not match the identification information already recorded in the list, the controller causes the execution unit to execute the specific process based on the received target data.
2. The communication device according to claim 1, wherein when the communication device transitions from an offline state in which communication with the external device is impossible to an online state in which communication with the external device is possible, the controller transmits the request signal to the external device by using the second communication unit, receives the target data from the external device as a response to the request signal by using the second communication unit, and compares the identification information of the target data received by using the second communication unit with the identification information already recorded in the list.
3. The communication device according to claim 1, wherein the controller... The communication device according to claim 1, wherein the controller... When the identification information of the target data received using the second communication unit does not match the identification information already recorded in the list, the communication device causes the execution unit to execute the specific processing based on the received target data, and records the identification information of the target data received using the second communication unit in the list.
4. The communication device according to claim 1, comprising a notification unit that transmits a notification regarding the target data to the external device using the second communication unit when the specific processing based on the target data is executed, wherein the controller deletes the identification information of the target data from the list after the notification regarding the target data is transmitted to the external device.
5. The communication device according to claim 2, wherein the controller further after receiving the target data from the external device as a response to the request signal using the second communication unit, 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.
6. The communication device according to claim 5, wherein the controller transmits a request signal including count information specifying the maximum number of target data that can be received in a single response to the request signal to the external device using the second communication unit, and receives the corresponding number of target data from the external device as a single response to the request signal using the second communication unit.
7. The communication device according to claim 5, further wherein the controller when receiving the target data using the second communication unit, causes the execution unit to execute the specific processing based on the target data received using the second communication unit, 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 unprocessed target data received using the first communication unit, and records the identification information of the target data received using the first communication unit in the list.
8. The communication device according to claim 5, wherein the controller While executing the specific processing based on one of the target data received using the second communication unit, transmission of the request signal by the second communication unit and execution by the execution unit of the specific processing based on the other target data are prohibited. A communication device that, after completion of the specific processing based on one of the target data, transmits the request signal by the second communication unit or causes the execution unit to execute the specific processing based on the other target data. **Claim 9** The communication device according to claim 4, wherein the first communication method is a communication method conforming to MQTT (Message Queueing Telemetry Transport), the second communication method is a communication method conforming to HTTP (HyperText Transfer Protocol), when the first communication unit receives the target data spontaneously transmitted from the external device, the first communication unit transmits a reception notification to the external device using the first communication method, wherein the controller does not delete the identification information of the target data from the list even when the reception notification is transmitted to the external device. **Claim 10** A communication system including a communication device and an external device, wherein the external device includes a storage unit that stores target data in association with status information, the status information indicating 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; 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; and the communication device includes a first communication unit that receives target data spontaneously transmitted from an external device by the first communication method; a second communication unit that transmits a request signal to the external device by the second communication method and receives data from the external device as a response to the request signal; a list storage unit that stores a list of identification information of target data to be processed by the communication device; and an execution unit that executes specific processing based on the target data. and the communication device Compare the identification information of the target data received using the first communication unit or the second communication unit with the identification information already recorded in the list. If the identification information of the target data received using the first communication unit or the second communication unit matches the identification information already recorded in the list, do not cause the execution unit to execute the specific processing based on the received target data. If the identification information of the target data received using the first communication unit does not match the identification information already recorded in the list, cause the execution unit to execute the specific processing based on the received target data, and record the identification information of the target data received using the first communication unit in the list. If the identification information of the target data received using the second communication unit does not match the identification information already recorded in the list, cause the execution unit to execute the specific processing based on the received target data. When executing the specific processing based on the target data, send a notification regarding the target data to the external device using the second communication unit. The external device When receiving a notification regarding the target data from the communication device after sending the target data to the communication device using the first transmission unit, update the status information of the target data from the information indicating the first state to the information indicating the second state. A communication system that, when receiving the request signal from the communication device, transmits the target data associated with the status information indicating the first state in response to the request signal to the communication device using the second transmission unit. [
11. ] A computer program for a communication device including a list storage unit that stores a list of identification information of target data to be processed, the computer program having a first communication function of receiving target data spontaneously transmitted from an external device by a first communication method that is a push-type communication method, a second communication function of transmitting a request signal to an external device and receiving data from the external device as a response to the request signal by a second communication method that is a pull-type communication method, an execution function of executing specific processing based on the target data, a control function, and causing the computer to realize them, wherein the control function compares the identification information of the target data received using the first communication function or the second communication function with the identification information already recorded in the list. When the identification information of the target data received using the first communication function or the second communication function matches the identification information already recorded in the list, the specific process based on the received target data is not executed by the execution function. When the identification information of the target data received using the first communication function does not match the identification information already recorded in the list, the specific process based on the received target data is executed by the execution function, and the identification information of the target data received using the first communication function is recorded in the list. A computer program that, when the identification information of the target data received using the second communication function does not match the identification information already recorded in the list, causes the execution function to execute the specific process based on the received target data.
Citation Information
Patent Citations
Mobile instant message service system and mobile instant message service program
JP3602512B2