Server, communication system, and method for transmitting target data to device
By employing a server configuration that combines push-type and pull-type communication methods and updates status information based on device notifications, the system improves the reliability and certainty of data transmission to devices in push-type communication systems.
Patent Information
- Application Number
- JP2023201493
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2023-11-29
- Publication Date
- 2025-06-10
AI Technical Summary
In push-type communication systems, there is a lack of certainty regarding whether a device has acquired information, and the reliability of data transmission to the device may not be sufficient.
A server configuration that uses a combination of push-type and pull-type communication methods to transmit target data to a device, where the server stores target data with status information and updates the status based on notifications from the device, ensuring reliable data transmission.
This approach enhances the certainty of data transmission to the device by allowing for fallback to pull-type communication if push-type communication fails, ensuring that data is reliably delivered even if the initial transmission method is unsuccessful.
Smart Images

Figure 2025087088000001_ABST
Abstract
Description
Technical Field
[0001] This specification relates to a server, a communication system, and a method for transmitting target data to a device.
Background Art
[0002] Patent Document 1 discloses a system for collecting data from a collection device by transmitting a data transmission instruction to the collection device using a protocol for performing push-type communication called Message Queueing Telemetry Transport (hereinafter also referred to as MQTT). In such push-type communication, the transmitting side can transmit information to the device with less delay than pull-type communication at an arbitrary timing.
Prior Art Documents
Patent Documents
[0003]
Patent Document 1
Summary of the Invention
Problems to be Solved by the Invention
[0004] However, in push-type communication, for example, depending on the protocol used, there may be a case where it is not possible to accurately grasp whether the device has acquired information, and the certainty of data transmission to the device may not be sufficient.
[0005] This specification discloses a technique capable of improving the certainty of data transmission to a device while using push-type communication for communication with the device.
Means for Solving the Problems
[0006] The technique disclosed in this specification can be realized as the following application examples.
[0007] [Application Example 1] A server, comprising: a storage unit that stores target data in association with status information, where the status information indicates any one of a plurality of statuses including a first status indicating that the target data should be transmitted to a destination device, and a second status different from the first status; a first transmission unit that transmits the target data to a device according to a first communication method that is a push-type communication method; a second transmission unit that transmits, to the device, the target data associated with the status information indicating the first status among the target data stored in the storage unit according to a second communication method that is a pull-type communication method; and a control unit that controls the first transmission unit and the second transmission unit. After transmitting the target data to the device using the first transmission unit, when receiving a specific notification regarding the target data from the device, the control unit updates the status information of the target data from the information indicating the first status to the information indicating the second status. When receiving a specific request from the device, the control unit transmits, to the device, the target data associated with the status information indicating the first status in response to the specific request using the second transmission unit.
[0008] According to the above configuration, after transmitting the target data to the device using the first transmission unit that transmits the target data according to the push-type communication method, when receiving a specific notification from the device, the status information of the target data is updated from the information indicating the first status to the information indicating the second status. Then, when receiving a specific request from the device, the target data associated with the status information indicating the first status is transmitted to the device using the second transmission unit that transmits the target data according to the pull-type communication method. As a result, for example, even if the transmission of the target data by the push-type communication method fails, if no specific notification is received from the device, the target data can be transmitted to the device by the pull-type communication method in response to a specific request from the device. Therefore, while using push-type communication for communication with the device, the certainty of transmitting the target data to the device can be improved.
[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 method for transmitting target data to a device, a communication system including a server and a device, these servers, methods, communication systems, or a computer program for realizing the functions of the device, a recording medium on which the computer program is recorded, and the like.
Brief Description of the Drawings
[0010]
Figure 1
Figure 2
Figure 3
Figure 4
Figure 5
Figure 6
Figure 7
Figure 8
Embodiments for Carrying Out the Invention
[0011] A. Embodiment A-1. Configuration of System 1000 FIG. 1 is a block diagram showing the configuration of system 1000. System 1000 includes a printer 100, a first server 300A, a second server 300B, and a relay server 200.
[0012] Printer 100 is a device that performs printing by consuming ink as a printing material. Printer 100 includes, as a controller of Printer 100, a CPU 110, a volatile memory device 120 such as a DRAM, and a non-volatile memory device 130 such as a hard disk or a flash memory. Printer 100 also includes a display unit 140 such as a liquid crystal display for displaying images, 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 memory device 120 provides a buffer area for temporarily storing various intermediate data generated when the CPU 110 performs processing. The non-volatile memory device 130 stores a computer program PGp for controlling 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 memory device 130 at the time of manufacturing Printer 100. Alternatively, the computer program PGp can be provided in a form downloaded from a server connected via the Internet IT, or in a form recorded on a storage medium such as a CD-ROM or a USB memory.
[0016] The CPU 110 executes various processes for controlling the printer 100 by executing the computer program PGp. For example, the CPU 110 functions as an application AP that realizes printing processes and service-related processes. The printing process is a process of controlling the printing mechanism 170 to print an image on the printing mechanism 170. 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. These printing services will be described later.
[0017] The information database IB stores the setting information of the printer 100 and the information necessary for receiving the provision of the printing service using the printer 100, for example, the destination information and authentication information for accessing the first server 300A. Details of the information database IB are omitted.
[0018] The printing mechanism 170 executes printing according to 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. Instead of this, 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.
[0019] The first server 300A, the second server 300B, and the relay server 200 are, for example, computers operated by an operator (for example, an operator who manufactures and sells the printer 100) that provides a printing service, for example, a cloud server.
[0020] The first server 300A includes a CPU 310 as a controller of the first server 300A, a volatile memory device 320 such as a DRAM, a non-volatile memory 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).
[0021] 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.
[0022] The computer program PGsA is provided, for example, in a form uploaded 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.
[0023] 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.
[0024] 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.
[0025] Although not shown in the drawings, the second server 300B includes controllers (310, 320, 330, 380) in the same manner as the first server 300A. However, the non-volatile storage 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.
[0026] The computer program PGsB is provided in a form uploaded by, for example, an operator who operates a printing service. The CPU 310 of the second server 300B executes the computer program PGsB to execute processing related to the second printing service.
[0027] 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 printing materials such as ink and delivers the printing materials 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 printing materials such as ink and delivers the printing materials to the user according to the consumption of the printing materials.
[0028] The second database DBb stores various types of information necessary for the second printing service. 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.
[0029] In addition, in FIG. 1, only one printer 100 is illustrated, but the first server 300A and the second server 300B provide printing services to a large number of users using a large number of printers. Hereinafter, various processes for one printer 100 will be described, but these processes are independently executed for each of a plurality of printers (hereinafter also referred to as target printers, for example, printer 100) used for the service.
[0030] The relay server 200, similar to the servers 300A and 300B, includes a CPU 210 as a controller, 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 computer program PGr and the management database DBm are stored in the non-volatile memory device 230.
[0031] 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 the 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.
[0032] The computer program PGr is provided in a form uploaded by, for example, an operator who operates the printing service, similar to the computer programs PGa and PGb. The CPU of the relay server 200 realizes the function as the relay server 200 by executing the computer program PGr.
[0033] Specifically, the relay server 200(210) functions as a control unit CP, an MQTT communication unit MP, and an HTTP communication unit HP by executing a computer program PGr. As will be described in detail later, the control unit CP controls the MQTT communication unit MP and the HTTP communication unit HP to relay communication between the servers 300A and 300B and the printer 100.
[0034] The MQTT communication unit MP executes communication with the printer 100 according to a protocol called MQTT (Message Queuing Telemetry Transport). Specifically, in the communication between the MQTT communication unit MP and the printer 100, the MQTT communication unit MP functions as an MQTT broker, and the printer 100 functions as an MQTT client. In this embodiment, the printer 100 maintains a communication connection with the MQTT communication unit MP and subscribes to a topic addressed to the printer 100. The connection maintained with 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. When the control unit CP publishes a topic addressed to the printer 100 to the MQTT communication unit MP, the MQTT communication unit MP sends it to the device that subscribes to the topic addressed to the printer 100 (that is, the printer 100).
[0035] Thus, when the printer 100 subscribes to a 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 between the MQTT communication unit MP and the printer 100 is a push-type communication.
[0036] On the other hand, when the printer 100 is not powered on, etc., the printer 100 cannot subscribe to the topic addressed to the printer 100. When the printer 100 is not subscribed 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.
[0037] Regardless of whether the MQTT communication unit MP sends a topic to the printer 100 or not, the MQTT communication unit MP does not notify the control unit CP of the topic transmission result. Therefore, the control unit CP does not know whether the published topic (data to be sent) actually reaches the printer 100.
[0038] The HTTP communication unit HP executes communication with the printer 100 according to a protocol called HTTP (Hypertext Transfer Protocol). Specifically, in the communication between the HTTP communication unit HP and the printer 100, the HTTP communication unit HP functions as an HTTP server, and the printer 100 functions as an HTTP client. In this embodiment, when the printer 100 sends an HTTP request to the relay server 200 (HTTP communication unit HP), the HTTP communication unit HP sends the data to be sent to the printer 100 as a response (HTTP response) to the HTTP request.
[0039] In this way, 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. Therefore, it can be said that the communication between the HTTP communication unit HP and the printer 100 is a pull-type communication.
[0040] In communication by the HTTP communication unit HP, delays are likely to occur because data cannot be sent to the printer 100 at an arbitrary timing. Also, in order to reduce delays, the printer 100 needs to continuously send HTTP requests to the relay server 200 at short intervals, which is likely to increase the burden on the printer 100 and the relay server 200. On the other hand, in communication by the HTTP communication unit HP, data is sent in response to a request from the printer 100, so data can be sent when the printer 100 is in a receptive state, and there is a high possibility that the data can be surely delivered to the printer 100.
[0041] In this embodiment, as will be described in detail later, the relay server 200 selectively uses communication by the MQTT communication unit MP and communication by the HTTP communication unit HP to relay communication between the servers 300A and 300B and the printer 100.
[0042] For example, in order to provide a remote printing service, the first server 300A sends, for example, a print instruction (also called a print job) to be sent to the printer 100 to the printer 100 via the relay server 200. Also, the first server 300A receives information indicating the execution result of the print job, etc. from the printer 100 via the relay server 200.
[0043] Also, in order to provide a printing material management service, the second server 300B sends, for example, an instruction to send the remaining amount information of the printing materials of the printer 100 and an instruction to send history information such as the printing history and failure history of the printer 100 to the printer 100 via the relay server 200. Also, the second server 300B receives information indicating the execution result of the transmission instruction, for example, the remaining amount information of the printing materials and information indicating the printing history and failure history of the printer 100 from the printer 100 via the relay server 200.
[0044] Hereinafter, the information to be sent from servers 300A and 300B to printer 100 (specifically, print instructions and transmission instructions) is also called a command. The information to be sent from printer 100 to servers 300A and 300B, that is, the information indicating the execution results of the processes executed based on commands (specifically, print results, remaining amount information, and history information), is also called execution result information.
[0045] Figure 2 is an explanatory diagram of management database DBm. The management database DBm stores a command information table CDT that stores information about commands received from servers 300A and 300B, that is, information about commands requested for relay from servers 300A and 300B (hereinafter also called command information). The command information table CDT is prepared for each destination device, and Figure 2 shows a command information table CDT for storing command information related to commands to be sent to printer 100.
[0046] The command information table CDT stores a plurality of command information CDa and CDb. Each command information includes information indicating a command ID, a target device ID, the reception date and time of the command, the status of the command, and the command (instruction content).
[0047] The command ID is an identifier for identifying the command. The target device ID is the device ID of the destination device of the command (for example, printer 100). The device ID is an identifier for identifying the 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.
[0048] In this embodiment, the status of a command indicates one of three states: received, transmitted, and canceled. "Received" means that a command transmission instruction has been received, that is, the command has been received from servers 300A and 300B and has not been received by the destination device, and the command has not been canceled by servers 300A and 300B. "Transmitted" means that the command has been received by the destination device. "Canceled" means that the command has been received from servers 300A and 300B, has not been received by the destination device, and has been canceled by servers 300A and 300B.
[0049] Since a command in the received state should be sent to the destination device, the received state can also be said to be a state indicating that the command should be sent to the destination device. Since a command in the transmitted or canceled state does not need to be sent to the destination device, the transmitted or canceled state can also be said to be a state indicating that the command does not need to be sent to the destination device.
[0050] Here, receiving 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, receiving a command by the relay server 200 means that the command has been acquired by the control unit CP, which is an application in the relay server 200 that should process the command. Receiving a command by the printer 100 means that the command has been acquired by the application AP, which is an application in the printer 100 that should process the command. 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 application AP 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 being transmitted 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.
[0051] A command is data indicating the content of an instruction and is 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.
[0052] 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.
[0053] 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 the command has been received when the response is a reception notification of the command. The response content includes, for example, execution result information indicating the result of executing the command when the response is a notification of the execution result of the command.
[0054] A-2. Operation of System 1000 The operation of the system 1000 will be described centering on the relay process by the relay server 200. The relay process includes a process in which the relay server 200 relays a command (for example, a print instruction) transmitted from the first server 300A and transmits it to the printer 100. The relay process also includes a process in which the relay server 200 relays a response (reception notification or execution result notification) transmitted from the printer 100 and transmits it to the first server 300A.
[0055] FIGS. 3-6 are sequence diagrams showing the operation of the system 1000. FIGS. 3 and 4 show an operation example when the printer 100 subscribes to a command when the relay server 200 receives the command. The time when the relay server 200 receives the 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. That the printer 100 subscribes to a command means a state in which the printer 100 subscribes to a topic addressed to the printer 100 as an MQTT client. In order for the printer 100 to subscribe to a command, it is necessary that the printer 100 is connected to the Internet IT and is in a state where it can communicate with the relay server 200 (also called an online state). Note that a state where the printer 100 is not in the online state, that is, a state where the printer 100 cannot communicate with the relay server 200 is also called an offline state. The printer 100 is in the offline state when the power of the printer 100 is turned off or when there is a problem with the network to which the printer 100 is connected.
[0056] For ease of understanding, first, the description will start from the point when the printer 100 transitions from the offline state to the online state. For example, when the power is turned on for the printer 100, 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. When the printer 100 transitions from the offline state to the online state, the printer 100 (CPU 110 functioning as the application AP) transmits an accumulated command request to the relay server 200 at S2. Information about the destination relay server 200 (for example, the URL or IP address of the relay server 200) is recorded in the information database IB in advance.
[0057] The accumulated command request is an HTTP request that requests the transmission of a command when a 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 number of commands. The upper limit number of commands is the number (maximum number) of commands that the printer 100 can receive in a single response (HTTP response).
[0058] Since the accumulated command request is transmitted as a THHP request, it is received by the communication IF 280 of the relay server 200 and acquired by the HTTP communication unit HP of the relay server 200.
[0059] When the HTTP communication unit HP acquires the accumulated command request, at S4, it passes the accumulated command request to the control unit CP of the relay server 200. When the control unit CP receives the accumulated command request, at S6, it executes an accumulated command confirmation process to confirm whether a command to be transmitted to the printer 100 is accumulated in the relay server 200.
[0060] Specifically, the control unit CP determines whether command information (hereinafter also referred to as command information in the received state) including information indicating that the status of the command has been received is stored in the command information table CDT (Figure 2) for storing command information regarding the command to be transmitted. When the command information in the received state is stored in the command information table CDT, the control unit CP determines that the command to be transmitted is accumulated. When the command information in the received state is not stored in the command information table CDT, the control unit CP determines that the command to be transmitted is not accumulated. In S6 of Figure 3, it is assumed that the command information in the received state is not stored in the command information table CDT. In this case, in S6, the control unit CP determines that the command to be transmitted is not accumulated.
[0061] When it is determined that the command to be transmitted to the printer 100 is not accumulated, the control unit CP passes, in S8, a non-accumulation notification indicating that the command to be transmitted is not accumulated to the HTTP communication unit HP as data to be responded to.
[0062] Upon receiving the non-accumulation notification, the HTTP communication unit HP transmits, in S9, the non-accumulation notification to the printer 100 as a response to the accumulated command request. The response transmitted from the HTTP communication unit HP to the printer 100 is an HTTP response.
[0063] Upon receiving the non-accumulation notification, the printer 100 establishes, in S10, a permanent connection between the printer 100 and the MQTT communication unit MP of the relay server 200. This permanent connection is established between the printer 100 as an MQTT client and the MQTT communication unit MP as an MQTT broker. This permanent connection is maintained when the printer 100 is in an online state.
[0064] When the printer 100 establishes a constant connection, at S12, it sends a subscription request to the MQTT communication unit MP. The subscription request requests to subscribe to a topic addressed to the printer 100. The subscription request includes information indicating the name (topic name) of the topic addressed to the printer 100.
[0065] When the MQTT communication unit MP receives the subscription request, at S14, it executes a subscription registration. The subscription registration is a process of registering, as a topic to be sent to the printer 100, a topic having the topic name included in the subscription request. As a result, the printer 100 enters a state of subscribing to a command addressed to the printer 100 (hereinafter, also referred to as a subscribed state).
[0066] Note that since the MQTT communication unit MP does not notify the control unit CP of the subscribed device, the control unit CP does not recognize whether the printer 100 is in the subscribed state.
[0067] When the printer 100 is in the subscribed state, assume that the first server 300A sends a command transmission instruction to the relay server 200 (S16 in FIG. 3). The command transmission instruction instructs the relay server 200 to send a command to the device. The command transmission instruction includes a target device ID and a command to be transmitted. The target device ID is an identifier indicating the device to which the command is to be sent. 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).
[0068] When the relay server 200 receives a command transmission instruction, at S18, the control unit CP of the relay server 200 stores the command information (Figure 2) regarding the command included in the command instruction. Specifically, the control unit CP generates a command ID to be assigned to the command included in the command transmission instruction. The control unit CP generates information indicating the current date and time as information indicating the reception date and time of the command. The control unit CP generates information indicating received as status information indicating the status of the current command. The control unit CP stores the command information including the command and the target device ID included in the data transmission instruction and the generated respective information (command ID, reception date and time, status) in the command information table CDT (Figure 2) of the management database DBm. In the example of Figure 3, at this point, it is assumed that the first command information CDa is stored in the command information table CDT of Figure 2.
[0069] 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 storing the command information 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 a plurality of command transmission instructions.
[0070] At S20, the control unit CP transmits a reception notice indicating that it has received the command transmission instruction to the first server 300A. The reception notice includes the command ID included in the command information registered at S18 and the status information of the command.
[0071] In S21, the control unit CP executes an accumulated command confirmation process. As described in S6, the accumulated command confirmation process is a process of checking whether the command information in the received state is stored in the command information table CDT. Here, apart from the command information regarding the command based on the command transmission instruction received in S16, when other command information in the received state is stored in the command information table CDT, it is determined that other commands to be transmitted to the printer 100 are accumulated. In S21, it is determined that no other commands to be transmitted are accumulated.
[0072] When it is determined that no other commands to be transmitted are accumulated, the control unit CP uses the MQTT communication unit MP to transmit the command to the printer 100. Specifically, in S22, the control unit CP passes a publish request to the MQTT communication unit MP. The publish request requests a device subscribing to a specified topic to transmit specified data. The publish request includes a topic name for specifying a topic and data to be transmitted. In the example of FIG. 3, the topic name included in the publish request is the name of the topic addressed to the printer 100. Further, the data included in the publish request includes the command included in the data transmission instruction received in S16 and the command ID of the command.
[0073] When the MQTT communication unit MP receives a publish request, it attempts to send the command and command ID included in the publish request to the device that has subscribed to the topic specified by the topic name included in the publish request. At this point, the printer 100 is in a subscribed state, and it is registered with the MQTT communication unit MP that the printer 100 has subscribed to the topic addressed to the printer 100 (S14 in FIG. 3). For this reason, in S23, the MQTT communication unit MP sends the command and command ID to the printer 100. When the printer 100 receives the command and command ID, at S24, it sends a reception notification to the MQTT communication unit MP of the relay server 200. That is, the printer 100 sends a reception notification as a response to the command in accordance with the MQTT protocol. This reception notification is a PUBACK defined in the MQTT protocol.
[0074] In the example of FIG. 3, the command and command ID are received by the printer 100 and are normally acquired by the application AP of the printer 100. The MQTT communication unit MP does not notify the control unit CP of having sent the command to the printer 100 according to the MQTT specification. For example, the MQTT communication unit MP does not pass the reception notification received at S24 to the control unit CP. For this reason, the control unit CP cannot recognize that the command has been received by the printer 100 only from the interaction with the MQTT communication unit MP. For this reason, at this point, the control unit CP cannot update the status information of the command to be processed from "received" to "transmitted".
[0075] In S25 of FIG. 4, the printer 100 sends a reception notification indicating that it has received the command to the relay server 200 separately from the above-described reception notification. The reception notification includes the command ID of the received command and the device ID of the printer 100. The reception notification is sent to the relay server 200 as an HTTP request. That is, the reception notification is sent in accordance with HTTP, which is a protocol different from MQTT. For this reason, the reception notification is received by the HTTP communication unit HP of the relay server 200.
[0076] When the HTTP communication unit HP receives a reception notice, at S26, it passes the reception notice to the control unit CP. In this way, the control unit CP does not receive the reception notice (PUBACK) sent from the printer 100 according to MQTT at S23, but can receive the reception notice sent from the printer 100 according to HTTP at S25. For this reason, at this point, the control unit CP can recognize that the command has been received by the printer 100.
[0077] When the control unit CP receives a reception notice, at S27, it stores the reception notice. Specifically, the control unit CP generates information indicating the current date and time as information indicating the reception date and time of the reception notice. The control unit CP generates response information including the reception notice and the information of the reception date and time of the reception notice. The control unit CP specifies the command to be processed by referring to the command ID included in the reception notice. 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.
[0078] At S28, the control unit CP updates the status information of the command to be processed from received to transmitted. For example, in the command information table CDT of Figure 2, the status information included in the command information CDa is changed from the information indicating received to the information indicating transmitted. In this way, when the control unit CP receives the first response for the command to be processed, it updates the status information of the command to be processed from received to transmitted. The control unit CP may receive a second response (for example, the execution result notice described later) for the command to be processed, but when receiving the second and subsequent responses, the status information is not updated.
[0079] In S30, the control unit CP transmits the reception notice received in S26 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 in S16.
[0080] When the printer 100 transmits the reception notice in S25, in S32, it executes the command that has been received in S23 of FIG. 3. For example, when the command is a print instruction, the printer 100 executes printing using the image file specified by the command.
[0081] In S34, the printer 100 transmits an execution result notice indicating the execution result of the command 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 transmitted to the relay server 200 as an HTTP request. For this reason, the execution result notice is received by the HTTP communication unit HP of the relay server 200.
[0082] When the HTTP communication unit HP receives the execution result notice, in S36, it passes the execution result notice to the control unit CP. When the control unit CP receives the execution result notice, in S38, it stores the execution result notice. Specifically, the control unit CP 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.
[0083] In S40, the control unit CP transmits the execution result notification received in S36 to the first server 300A. As a result, the first server 300A can recognize the execution result of the command transmitted based on the command transmission instruction transmitted in S16. For example, the first server 300A can recognize that printing by the printer 100 has been executed based on the print instruction transmitted as a command.
[0084] FIG. 5 and FIG. 6 show an operation example when the printer 100 does not subscribe to a command when the relay server 200 receives the command. For example, assume that the printer 100 is in an offline state because the power of the printer 100 is turned off, and the printer 100 is not subscribing to the command. In this state, assume that in S51 of FIG. 5, 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 S16 of FIG. 3.
[0085] When the relay server 200 receives the command transmission instruction, in S52, in the same manner as S18 of FIG. 3, the control unit CP of the relay server 200 registers command information (FIG. 2) regarding the command included in the command instruction.
[0086] In S54, in the same manner as S20 of FIG. 3, the control unit CP transmits a reception notification indicating that the command transmission instruction has been received to the first server 300A.
[0087] In S55, in the same manner as S21 of FIG. 3, the control unit CP executes an accumulated command confirmation process. In S55, it is determined in the same manner as S21 that no other commands to be transmitted to the printer 100 are accumulated.
[0088] When it is determined that no other commands to be transmitted are accumulated, the control unit CP passes a publish request to the MQTT communication unit MP in S56 in the same manner as S22 of FIG. 3.
[0089] When the MQTT communication unit MP receives a publish request, it attempts to send the command and command ID included in the publish request to the device that has subscribed to the topic specified by the topic name included in the publish request. At this point, unlike the example in FIG. 3, since the printer 100 is not in a subscribed state, the MQTT communication unit MP has not registered that the printer 100 has subscribed to the topic addressed to the printer 100. For this reason, the MQTT communication unit MP does not send the command and 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 will 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.
[0090] After that, for example, assume that the printer 100 transitions from an offline state to an online state due to, for example, the printer 100 being powered on. When the printer 100 transitions to the online state, the printer 100 transmits an accumulated command request to the relay server 200 at S58, similar to S2 in FIG. 3. As described above, since the accumulated command request is transmitted as a THHP request, it is received by the communication IF280 of the relay server 200 and acquired by the HTTP communication unit HP of the relay server 200.
[0091] When the HTTP communication unit HP acquires the accumulated command request, at S60, similar to S4 in FIG. 3, it passes the accumulated command request to the control unit CP of the relay server 200. When the control unit CP receives the accumulated command request, at S62, similar to S6 in FIG. 4, it executes an accumulated command confirmation process.
[0092] At this point, the command to be sent to the printer 100 based on the command transmission instruction received at S51 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.
[0093] For this purpose, in the accumulation command confirmation process of S62, unlike S6 in FIG. 3, the control unit CP determines that a command to be transmitted to the printer 100 is accumulated.
[0094] When it is determined that a command to be transmitted is accumulated, the control unit CP passes, at S64, an accumulation available notification indicating that a command to be transmitted is accumulated to the HTTP communication unit HP as data to be transmitted as a response.
[0095] The accumulation available notification includes a command to be transmitted to the printer 100 and information indicating the number of accumulated commands. In the example of FIG. 5, since one command information in the received state 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 transmitted 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.
[0096] When receiving the accumulation available notification, the HTTP communication unit HP transmits, at S66, the accumulation available notification to the printer 100 as a response to the accumulation command request.
[0097] When passing the accumulation available notification to the HTTP communication unit HP at S64, the control unit CP updates, at S67, the status information of the command to be processed from received to transmitted. In this way, at S67, without receiving a reception notification from the printer 100, when transmitting the accumulation available notification including the command using the HTTP communication unit HP, the status information is immediately updated.
[0098] When the printer 100 receives a stored notification, in the example of FIG. 5, it will receive one command. That is, the printer 100 can receive a command using communication conforming to HTTP. Also in this case, the printer 100 transmits a command reception notification to the relay server 200 in the same manner as when it receives a command using communication conforming to MQTT (S23 in FIG. 3).
[0099] Specifically, the printer 100 transmits a reception notification to the relay server 200 in S68 of FIG. 6 in the same manner as S25 of FIG. 4. The reception notification is transmitted to the relay server 200 as an HTTP request. For this purpose, the reception notification is received by the HTTP communication unit HP of the relay server 200.
[0100] When the HTTP communication unit HP receives the reception notification, in S70, it passes the reception notification to the control unit CP in the same manner as S26 of FIG. 4. At this point, the control unit CP can recognize that the command based on the command transmission instruction transmitted in S51 has been received by the printer 100.
[0101] When the control unit CP receives the reception notification, in S72, it stores the reception notification in the same manner as S27 of FIG. 4. For example, assume that the command information of the command to be processed is the command information CDb in FIG. 2. In this step, in the command information table CDT, the first response information RDb1 is stored in association with the command information CDb.
[0102] In S74, the control unit CP transmits the reception notification to the first server 300A in the same manner as S30 of FIG. 4. Thereby, 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 in S51.
[0103] When the printer 100 transmits a reception notice at S68, at S76, similar to S32 in FIG. 4, it executes the received command. At S78, the printer 100 transmits, similar to S34 in FIG. 4, an execution result notice indicating the execution result of the command to the relay server 200. Since the execution result notice is transmitted to the relay server 200 as an HTTP request, it is received by the HTTP communication unit HP of the relay server 200.
[0104] When the HTTP communication unit HP receives the execution result notice, at S80, it passes the execution result notice to the control unit CP. When the control unit CP receives the execution result notice, at S82, it stores the execution result notice. For example, in the command information table CDT of FIG. 2, the second response information RDb2 is stored in association with the command information CDb.
[0105] At S84, the control unit CP transmits the execution result notice received at S80 to the first server 300A. As a result, the first server 300A can recognize the execution result of the command transmitted based on the command transmission instruction transmitted at S51.
[0106] When the printer 100 has received all the commands addressed to the printer 100 stored in the relay server 200, at S86, similar to S10 in FIG. 3, it establishes a permanent connection with the MQTT communication unit MP of the relay server 200.
[0107] When the printer 100 establishes a permanent connection, at S88, similar to S12 in FIG. 3, it transmits a subscribe request to the MQTT communication unit MP. When the MQTT communication unit MP receives the subscribe request, at S90, similar to S14 in FIG. 3, it executes a subscribe registration. As a result, the printer 100 enters the subscribe state. After that, when a transmission instruction for a command addressed to the printer 100 is transmitted from the servers 300A and 300B to the relay server 200, the processes described in S16 in FIG. 3 to S40 in FIG. 4 are executed.
[0108] The operation of the system 1000 has been described above. With reference to FIG. 7, a supplementary explanation will be given regarding the processing when the control unit CP of the relay server 200 receives a command transmission instruction (S16 in FIG. 3, FIG.) from the servers 300A and 300B. FIG. 7 is a flowchart of the processing at the time of receiving a command transmission instruction.
[0109] For example, as shown in S16 of FIG. 3 and S51 of FIG. 5, when the control unit CP of the relay server 200 receives a command transmission instruction from the servers 300A and 300B, the control unit CP stores the command information in the command information table CDT at S300. The control unit CP transmits an acceptance notice to the server that is the source of the command transmission instruction (for example, the first server 300A) at S310. S300 is the processing of S18 in FIG. 3 and S52 in FIG. 5, and S310 is the processing of S20 in FIG. 3 and S54 in FIG. 5.
[0110] At S320, the control unit CP executes an accumulated command confirmation process. S320 is a process of determining whether there are other commands to be transmitted to the printer 100 accumulated, as described in S21 of FIG. 3 and S55 of FIG. 5. As shown in S330, when the control unit CP determines in the accumulated command confirmation process that there are no other commands to be transmitted accumulated (S330: NO), at S340, it passes a publish request for the command (also referred to as the target command) based on the received command transmission instruction to the MQTT communication unit MP. S340 is the processing of S22 in FIG. 3 and S56 in FIG. 5.
[0111] When it is determined in the accumulated command confirmation process that there are other commands to be transmitted accumulated (S330: YES), the processing of S340 is skipped. That is, when the control unit CP determines that there are other commands to be transmitted accumulated (S330: YES), it does not pass a publish request for the target command to the MQTT communication unit MP.
[0112] As described above, when there are no other commands to be sent to the printer 100, if the printer 100 is in the subscribe state, as shown in S23 of FIG. 3, the target command is immediately sent from the MQTT communication unit MP to the printer 100. On the other hand, when there are other commands to be sent to the printer 100 stored, even if the printer 100 is in the subscribe state, the target command is not sent from the MQTT communication unit MP to the printer 100.
[0113] The reason for this will be explained. Suppose that, despite the existence of other commands to be sent to the printer 100 being stored, the control unit CP passes the publish request to the MQTT communication unit MP, and immediately the target command is 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 commands becomes different from the reception order of the transmission instructions for commands. Then, if the execution order of commands in the printer 100 has meaning, it may become impossible to cause the printer 100 to execute the desired operation. For example, when it is desired to print the next page after one page, the inconvenience that page 2 is printed earlier than page 1 may occur.
[0114] In this embodiment, in order to suppress such inconvenience, when there are other commands to be sent stored, the target command is not sent from the MQTT communication unit MP, so the target command is stored together with other commands. Both the stored other commands and the target command are sent to the printer 100 by the HTTP communication unit HP. As will be described later, when there are a plurality of commands stored, the HTTP communication unit HP sends the commands to the printer 100 in accordance with the reception order of the transmission instructions for the commands, so the above-described inconvenience can be suppressed.
[0115] In FIG. 3, when an accumulation command request is transmitted from the printer 100 to the HTTP communication unit HP of the relay server 200, the case where no command to be transmitted is accumulated in the relay server 200 was described (S2 to S9 in FIG. 3). In FIGS. 5 and 6, when an accumulation command request is transmitted from the printer 100 to the HTTP communication unit HP, the case where only one command to be transmitted is accumulated in the relay server 200 was described (S58 in FIG. 5 to S84 in FIG. 6).
[0116] Here, referring to FIG. 8, when an accumulation command request is transmitted from the printer 100 to the HTTP communication unit HP (S58 in FIG. 5) and the accumulation command request is passed to the control unit CP (S60 in FIG. 5), the case where M commands to be transmitted are accumulated in the relay server 200 will be described. In this case, at S62A in FIG. 8, similar to S62 in FIG. 5, the control unit CP executes an accumulation command confirmation process, and in this accumulation command confirmation process, it is determined 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 (N < M < 2N) when the above-mentioned upper limit command number is N (N is an integer of 1 or more). The number of commands included in one accumulation presence notification is limited to N or less.
[0117] The control unit CP passes the accumulation presence notification to the HTTP communication unit HP at S64A. Specifically, the control unit CP specifies the reception order of the M commands to be transmitted, in other words, the storage order in the command information table CDT of the M command information, 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 presence notification including the N commands. In the accumulation presence notification, the N commands are arranged according to the storage order. As a result, when the accumulation presence notification is transmitted from the relay server 200 to the printer 100 at S66A described later, the N commands are sequentially transmitted to the printer 100 in order from the ones with the earlier storage order. The accumulation presence notification further includes information indicating the number of accumulated commands M.
[0118] When the HTTP communication unit HP receives the stored notification, at S66A, it transmits the stored notification to the printer 100 as a response to the storage command request.
[0119] When the printer 100 receives the stored notification, it acquires N commands in the order in which the commands are stored. When the printer 100 acquires N commands, for each of the N commands, the processes of S68 to S84 in FIG. 6 are executed. That is, the processes of S68 to S84 in FIG. 6 are repeatedly executed N times. For each command, the processes of S68 to S84 in FIG. 6 are executed in the order in which the commands are stored earlier.
[0120] Since the stored notification received by the printer 100 includes information indicating the number of stored items M, the printer 100 can recognize that in addition to the N commands that have been acquired, there are (M - N) commands that have not been acquired in the relay server 200. For this reason, after repeatedly executing the processes of S68 to S84 in FIG. 6 N times, at S68A, the printer 100 transmits a storage command request to the relay server 200 in order to acquire the (M - N) commands that have not been acquired. It is acquired by the HTTP communication unit HP of the relay server 200.
[0121] When the HTTP communication unit HP acquires the storage command request, at S70A, it passes the storage command request to the control unit CP of the relay server 200. When the control unit CP receives the storage command request, at S72A, it executes the same storage command confirmation process as S62A. In this storage command confirmation process, it is determined that the remaining (M - N) commands to be transmitted are stored.
[0122] The control unit CP generates a stored notification including the remaining (M - N) commands at S74A and passes the stored notification to the HTTP communication unit HP. In the stored notification, the (M - N) commands are arranged in the storage order. The stored notification further includes information indicating the number of stored commands (M - N).
[0123] When the HTTP communication unit HP receives the stored notification, at S76A, it transmits the stored notification to the printer 100 as a response to the stored command request.
[0124] Upon receiving the stored notification, the printer 100 acquires the remaining (M - N) commands in the order in which the commands are stored. Subsequently, for each of the (M - N) commands, the processes of S68 to S84 in FIG. 6 are executed. That is, the processes of S68 to S84 in FIG. 6 are repeatedly executed (M - N) times. The processes of S68 to S84 in FIG. 6 for each command are executed in the order in which the command storage order is earlier.
[0125] Since the stored notification received by the printer 100 includes information indicating the number of stored items (M - N), the printer 100 can recognize that there are no unacquired commands in the relay server 200. For this reason, after repeatedly executing the processes of S68 to S84 in FIG. 6 (M - N) times, the printer 100 executes S86 to S90 in FIG. 6 to subscribe to the commands addressed to the printer 100. As described above, when a plurality of commands are stored in the relay server 200, the commands are transmitted from the relay server 200 to the printer 100 so that the printer 100 acquires the plurality of commands in the same order as the command storage order (the order in which the command transmission instructions are received).
[0126] According to the embodiments described above, the control unit CP of the relay server 200 stores commands in the management database DBm in association with status information (S18 in FIG. 3, S52 in FIG. 5). The MQTT communication unit MP of the relay server 200 transmits commands to the printer 100 according to MQTT, which is a push-type communication method (S22, S23 in FIG. 3). The HTTP communication unit HP of the relay server 200 transmits to the printer 100 the commands associated with the status information indicating received among the commands stored in the management database DBm according to HTTP, which is a pull-type communication method (S66 in FIG. 5). After transmitting a command to the printer 100 using the MQTT communication unit MP (S22, S23 in FIG. 3), when the control unit CP receives a reception notification regarding the command transmitted from the printer 100 (S25, S26 in FIG. 4), the control unit CP updates the status information of the command from the information indicating received to the information indicating transmitted (S28 in FIG. 4). Further, when the control unit CP receives an accumulated command request transmitted from the printer 100 (S58, S60 in FIG. 5), the control unit CP transmits to the printer 100 the commands associated with the status information indicating received in response to the accumulated command request (i.e., the commands not yet transmitted to the printer 100) using the HTTP communication unit HP (S64, S66 in FIG. 5).
[0127] That is, in the above embodiment, after transmitting a command to the printer 100 using the MQTT communication unit MP, when a reception notification is received from the printer 100, the status of the command is updated from received to transmitted. Then, when an accumulated command request is received from the printer 100, the commands in the received state are transmitted to the printer 100 using the HTTP communication unit HP. Therefore, when the transmission of a command by the MQTT communication unit MP fails, a reception notification from the printer 100 is not received, so that the command can be transmitted to the printer 100 by the HTTP communication unit HP in response to the accumulated command request from the printer 100. Therefore, while using MQTT for communication with the printer 100, the certainty of command transmission to the printer 100 can be improved.
[0128] A more detailed explanation is as follows. According to the MQTT specification, even if the control unit CP passes a publish request to the MQTT communication unit MP, if the printer 100 is not in the subscribe state at that time, the MQTT communication unit MP will not send the command to the printer 100. Also, even if the MQTT communication unit MP sends a command to the printer 100 in the subscribe state and the communication IF180 of the printer 100 receives the command, if there is a problem in the application AP or the load of the application AP is high at that time, the application AP may not be able to obtain the command normally. In such a case, in order to transmit the command to the printer 100, it is preferable for the relay server 200 to send the command to the printer 100 again.
[0129] However, according to the MQTT specification, the MQTT communication unit MP does not return a response of the communication result to the control unit CP for the publish request. Therefore, only with communication following MQTT, the control unit CP cannot recognize whether the MQTT communication unit MP has sent a command to the printer 100 or whether the printer 100 (application AP) has obtained the command normally.
[0130] On the other hand, since communication following MQTT is a push-type communication, compared with pull-type communication (such as HTTP), it is less likely to cause a delay in command transmission. For example, in pull-type communication, to shorten the delay, the printer 100 needs to perform polling at short intervals, and the control unit CP of the relay server 200 also needs to respond to the polling. Therefore, the load on the control unit CP of the printer 100 or the relay server 200 may become excessively large.
[0131] In this embodiment, when the printer 100 normally receives a command, the printer 100 is configured to send a reception notice to the control unit CP (S25, S26 in FIG. 4). And when the control unit CP receives the reception notice, it updates the status of the command to "transmitted" (S27 in FIG. 4). Therefore, the control unit CP of the relay server 200 can recognize whether the command has been acquired by the printer 100 based on the status information of the command. When receiving an accumulated command request from the printer 100, the HTTP communication unit HP (that is, communication according to HTTP) responds to the accumulated command request and transmits to the printer 100 a command associated with status information indicating "received" (that is, a command that has not been transmitted to the printer 100 yet) (S64, S66 in FIG. 5). As a result, for example, a command that has not been transmitted to the printer 100 in communication according to MQTT can be transmitted to the printer 100 in communication according to HTTP. Communication according to HTTP is a pull-type communication that transmits a response in response to a request from the printer 100. Therefore, by using communication according to HTTP, a command can be more reliably transmitted to the printer 100 when the printer 100 is ready to acquire the command. As described above, while enjoying the advantages of MQTT, such as being able to transmit commands with low load and low latency, by also using communication according to HTTP, a command can be surely transmitted to the printer 100.
[0132] Also, by receiving the reception notice, a command that has reached the transmitted state will not be sent to the printer 100 by the HTTP communication unit HP. Therefore, it is possible to suppress the command from being repeatedly transmitted to the printer 100.
[0133] Furthermore, according to this embodiment, after the control unit CP transmits a command to the printer 100 using the HTTP communication unit HP in response to an accumulated command request, without receiving a reception notice, it updates the status information of the command from "received" to "transmitted" (S69 in FIG. 5).
[0134] When sending a command to the printer 100 in a pull - type communication (in other words, in response to a request from the printer 100), since it is considered that the printer 100 is ready to receive the command, the possibility of the command transmission failing is low. For this reason, in this case, it is preferable to promptly update the status information without waiting for the receipt of the reception notification.
[0135] Furthermore, according to this embodiment, the received state is a state in which the command has not been acquired by the application AP that processes the command. Specifically, it includes a state in which no command has been sent from the MQTT communication unit MP to the printer 100, or a state in which a command has been sent from the MQTT communication unit MP to the communication IF180 of the printer 100 but the application AP has not acquired the command from the reception buffer. As a result, by sending the received - state command to the printer 100 through the HTTP communication unit HP, the command can be surely acquired by the application AP of the printer 100.
[0136] Furthermore, according to this embodiment, the command information table CDT of the management database DBm can store a plurality of command information. That is, the relay server 200 can store a plurality of commands. The control unit CP notifies the printer 100 of the number of accumulated commands by including the number of accumulated commands in the accumulation notification (S64, S66 in FIG. 5). As a result, the printer 100 can recognize the number of commands to be received from the relay server 200. As a result, the device can more surely acquire all the commands to be received. For example, in the example of FIG. 8, since the printer 100 recognizes that it should acquire M commands, by sending a second accumulated - command request to the relay server 200 at S68A, all the commands to be acquired can be acquired.
[0137] Furthermore, according to this embodiment, the accumulation command request includes information specifying the number of commands that can be received in one response (information indicating the upper limit number of commands) (such as S58 in FIG. 5). In response to the accumulation command request, the control unit CP uses the HTTP communication unit HP to send a response (specifically, an accumulation notification) including commands equal to or less than the upper limit number of commands to the printer 100 (such as S56A and S66A in FIG. 8). The number of commands that can be acquired at one time is limited, for example, by the size of the resources of the printer 100 (for example, the capacity of the reception buffer). In this embodiment, by setting the number of commands included in one accumulation notification to be equal to or less than the upper limit number of commands notified from the printer 100, it is possible to suppress the inconvenience that the printer 100 cannot acquire all commands due to resource shortage. Therefore, the printer 100 can more reliably acquire the commands to be acquired.
[0138] Furthermore, according to this embodiment, the MQTT communication unit MP maintains communication with the printer 100 by establishing a permanent connection conforming to MQTT (S10 in FIG. 3, S86 in FIG. 6). When the printer 100 is in the subscribe state, in other words, when the communication with the printer 100 is maintained, the MQTT communication unit MP receives a transmission instruction (specifically, a publish request) from the control unit CP (S22 in FIG. 3), and transmits data (for example, a command) based on the publish request to the printer 100 (S23 in FIG. 3). When the MQTT communication unit MP receives a publish request from the control unit CP when the communication with the printer 100 is not maintained (S56 in FIG. 5), it does not transmit the data based on the publish request to the printer 100. Also, when the HTTP communication unit HP, which is the second transmission unit, receives an HTTP request (for example, an accumulation command request) from the printer 100 (for example, S2 in FIG. 3, S58 in FIG. 5), it transmits an HTTP response (an accumulation notification or an accumulation notification) to the printer 100 based on the transmission instruction of the control unit CP (S9 in FIG. 3, S66 in FIG. 5).
[0139] As can be understood from this configuration, in MQTT, even if the control unit CP issues a publish request, if the communication with the printer 100 is not maintained as in the case where the printer 100 is in the offline state, the command will not be sent to the printer 100. Therefore, the transmission of commands using MQTT may fail with a corresponding probability. In HTTP, when the printer 100 sends an HTTP request, it is considered that the printer 100 is ready to receive the command on its side. Therefore, the possibility of command transmission failure is low. According to this embodiment, even if the transmission of a command using MQTT fails, the command can be sent via HTTP in response to an HTTP request from the printer 100, so the certainty of command transmission to the device can be further improved.
[0140] Furthermore, according to this embodiment, when the printer 100 becomes online, it sends the accumulated command requests to the relay server 200. As a result, when the printer 100 becomes online, the printer 100 sends the received commands (i.e., the commands to be sent to the printer 100) to the printer 100 in order of the storage order in the command information table CDT using the HTTP communication unit HP in order from the earlier ones (Fig. 8). Thus, even if the transmission of multiple commands using MQTT fails because the device was in the offline state, when the printer 100 becomes online, the commands can be sent to the printer 100 in the correct order via HTTP.
[0141] Furthermore, according to this embodiment, when the control unit CP of the relay server 200 receives the first command to be transmitted from the first server 300A to the printer 100 (S16 in FIG. 3), as shown in FIG. 7, the control unit CP associates the first command with the status information indicating that it has been received and the reception date and time information for specifying the storage order in the command information table CDT, and stores it in the command information table CDT (S300 in FIG. 7). The control unit CP further executes an accumulated command confirmation process (S320 in FIG. 7) to determine whether there are other commands to be transmitted accumulated. That is, the control unit CP determines whether a second command that has been stored in the command information table CDT before the first command and is associated with the status information indicating that it has been received is stored.
[0142] Then, when the second command is not stored in the command information table CDT (NO in S330 of FIG. 7), the control unit CP uses the MQTT communication unit MP to transmit the first command to the printer 100 (S340 in FIG. 7, S22, S23 in FIG. 3). When the second command is stored in the command information table CDT (YES in S330 of FIG. 7), the control unit CP does not transmit the first command to the printer 100 using the MQTT communication unit MP. As a result, in this case, the first command and the second command are accumulated in the relay server 200.
[0143] Then, in response to the accumulated command request using the HTTP communication unit HP, the control unit CP transmits the second command to the printer 100 in order from the one with the earlier storage order, and then transmits the second command to the printer 100 using the HTTP communication unit HP (FIG. 8).
[0144] In this way, while commands are accumulated in the relay server 200, the commands are sent to the printer 100 using only the HTTP communication unit HP, and not using the MQTT communication unit MP. Then, when there are no commands accumulated in the relay server 200, the commands are sent to the printer 100 using the MQTT communication unit MP only when a new command transmission instruction is received. As a result, the commands can be sent to the printer 100 in the order in which the command transmission instructions are received.
[0145] Furthermore, according to this embodiment, the MQTT communication unit MP of the relay server 200 receives a reception notification indicating that target data has been received according to MQTT (S24 in FIG. 3). This reception notification is different from the reception notification (S25, S26 in FIG. 4) received by the HTTP communication unit HP and passed to the control unit CP. When the MQTT communication unit MP receives a reception notification, the control unit CP does not update the command status from received to transmitted, and when the HTTP communication unit HP receives a reception notification, the control unit CP updates the command status from received to transmitted (S28 in FIG. 4). For example, when a reception notification is received, it can be confirmed that the function as the MQTT client of the printer 100 has received the command, but the application that processes the command of the printer 100 does not necessarily receive the command. When a reception notification transmitted according to HTTP, which is a protocol different from MQTT, is received, it is considered that an application that processes commands higher than the MQTT client has received the command inside the printer 100 and transmitted the reception notification using the function as an HTTP client. For this reason, when a reception notification transmitted according to HTTP is received, that is, when it is highly possible that the application that processes the command in the printer 100 has received the command, by updating the command status, the command can be more surely acquired by the application that processes the command.
[0146] As can be understood from the above description, the received state of this embodiment is an example of the first state, and the transmitted or canceled states are examples of the second state. The receipt notice of this embodiment is an example of a specific notice, and the accumulated command request is an example of a specific request. The servers 300A and 300B of this embodiment are examples of external devices, and the command is an example of target data. The MQTT communication unit MP is an example of a communication maintenance unit, a first transmission unit, and a first reception unit, and the HTTP communication unit HP is an example of a first transmission unit and a second reception unit.
[0147] B. Modified Example (1) In the above embodiment, the printer 100 transmits two responses, that is, a receipt notice and an execution result notice, to the relay server 200 (HTTP communication unit HP) for one command. However, the printer 100 may transmit only one response to the relay server 200. For example, when the command is a print instruction, it takes a certain amount of time for the printer 100 to execute the printing. Therefore, in this case, it is preferable to transmit a receipt notice to the relay server 200 when the command is received as in the embodiment, and transmit an execution result notice to the relay server 200 when the printing is completed. When the command is, for example, an instruction to transmit the remaining ink amount, since the printer 100 only reads and transmits the remaining ink amount from the memory, the time required for executing the command is very short. Therefore, in this case, it is preferable for the printer 100 to immediately read the remaining ink amount after receiving the command and transmit an execution result notice including the remaining ink amount to the relay server 200. In this case, the receipt notice is not transmitted to the relay server 200. Note that depending on the type of command, more than three responses may be transmitted to the relay server 200 for one command.
[0148] Regardless of the number of responses for one command, when the control unit CP of the relay server 200 receives the first response among one or more responses for one command, it is preferable to update the status information of the command from received to transmitted.
[0149] (2) In the above embodiment, the status of the command can take three states: received, transmitted, and canceled. However, this is not the only case. The number of states that the command status can take may be only two or four or more. For example, if there is no mechanism to cancel the command, the command status may be only two types: received and transmitted. For example, when the relay server 200 receives a command transmission instruction from the first server 300A, it may determine whether the printer 100 is in an online state or an offline state. If the printer 100 is in an offline state, it may have a mechanism to reject the reception of the command transmission instruction. In this case, in addition to the three types in the embodiment, the command status may include a reception rejection state.
[0150] (3) In the above embodiment, when the control unit CP transmits a command to the printer 100 using the HTTP communication unit HP, as shown in S69 of FIG. 5, it updates the status of the command from received to transmitted without receiving a reception notification from the printer 100. Instead, even when the control unit CP transmits a command to the printer 100 using the HTTP communication unit HP, it may update the status of the command from received to transmitted after receiving a reception notification from the printer 100, similar to the case of transmitting a command using the MQTT communication unit MP.
[0151] (4) The control unit CP of the relay server 200 includes information indicating the number of commands (accumulation number) accumulated in the relay server 200 in the accumulation notification to be transmitted to the printer 100, but it may not include the accumulation number in the accumulation notification. 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, it always transmits an accumulation command request to the relay server 200. And when the printer 100 receives a no-accumulation notification as a response to the accumulation command request, it may not transmit the accumulation command request to the relay server 200.
[0152] (5) The control unit CP of the relay server 200 includes information indicating the upper limit number of commands in the stored notification to be sent to the printer 100, but it is not necessary to include the information indicating the upper limit number of commands in the stored notification. In this case, for example, the upper limit number of commands may always be set to a predetermined number, for example, a number that the printer 100 can sufficiently receive in one response (for example, 1).
[0153] (6) In the above embodiment, as the first communication method, a communication method conforming to MQTT is adopted, but other push-type communication methods may be adopted. Also, as the second communication method, a communication method conforming to HTTP is adopted, but other pull-type communication methods may be adopted. As the first communication method, for example, XMPP (Extensible Messaging and Presence Protocol) may be adopted. As the second communication method, for example, FTP (File Transfer Protocol) may be adopted.
[0154] (7) In the above embodiment, information indicating the reception date and time is used as information for specifying the storage order of command information in the command information table CDT of the command information, in other words, information for specifying the reception order of commands. Instead of this, the information for specifying the reception order of commands may be other information, for example, a number assigned in ascending order to the commands according to the reception order of the commands. Such a number assigned in ascending order may also serve as, for example, a command ID.
[0155] (8) In the above embodiment, the printer 100 is used as the device used for providing the service, 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.
[0156] In addition, 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 Internet IT can be adopted. For example, the device may be a device unrelated to images, such as home appliances such as refrigerators and microwave ovens, or may be a music player or a temperature sensor.
[0157] The services provided by servers 300A and 300B may be various services according to the devices adopted. The services may be, for example, services realizable by remotely operating the device by sending a command to the device, or services realizable by collecting information about the device by sending a command to the device.
[0158] Note that the target data transmitted from servers 300A and 300B to the device via relay server 200 is not limited to commands. The target data may be data for notifying or providing information to the user of the device, or may be data such as setting information stored in the device.
[0159] (9) In the above embodiment, the reception notification and the execution result notification are transmitted as an HTTP request from printer 100 to the HTTP communication unit HP of relay server 200. Instead of this, the reception notification may be transmitted from printer 100 to MQTT communication unit MP using MQTT. In this case, for example, a topic name addressed to control unit CP is set from printer 100 and registered in MQTT communication unit MP. Control unit CP always subscribes by designating the topic name. Printer 100 transmits the reception notification and the execution result notification to MQTT communication unit MP as a publish request by designating the topic name. Thereby, printer 100 can cause control unit CP of relay server 200 to acquire the reception notification and the execution result notification at an arbitrary timing.
[0160] (10) In the above embodiment, when the control unit CP of the relay server 200 receives a reception notification of a transmitted command from the MQTT communication unit MP, it always updates the status information of the command (S28 in FIG. 4). Instead of this, the printer 100 may include flag information indicating whether to update the status information in the reception notification. Then, when the reception notification includes flag information indicating that the status information is to be updated, the control unit CP updates the status information of the command, and when the reception notification includes flag information indicating that the status information is not to be updated, the control unit CP may not update the status information of the command. In this case, for example, when the printer 100 receives a command during a high load period, etc., the printer 100 can include flag information indicating that the status information is not to be updated in the reception notification, so that the command can be received again later.
[0161] (11) In the above embodiment, a part of the configuration realized by hardware may be replaced with software, and conversely, a part or all of the configuration realized by software may be replaced with hardware.
[0162] As described above, the present invention has been described 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
[0163] 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, AP… Application, CDT… Command information table, CDa, CDb… Command information, CP… Control unit, DBa… First database, DBb… Second database, DBm… Management database, HP… HTTP communication unit, IB… Information database, IT… Internet, MP… MQTT communication unit, PGa, PGp, PGr, PGsA, PGsB… Computer program
Claims
1. A server comprising: a storage unit that stores target data in association with status information, wherein the status information indicates any one of a plurality of statuses including a first status indicating that the target data should be transmitted to a destination device and a second status different from the first status; a first transmission unit that transmits the target data to a device according to a first communication method which is a push-type communication method; a second transmission unit that transmits, to the device, the target data associated with the status information indicating the first status among the target data stored in the storage unit according to a second communication method which is a pull-type communication method; a control unit that controls the first transmission unit and the second transmission unit; wherein the control unit after transmitting the target data to the device using the first transmission unit, when receiving a specific notification regarding the target data from the device, updates the status information of the target data from information indicating the first status to information indicating the second status; when receiving a specific request from the device, transmits, to the device, the target data associated with the status information indicating the first status in response to the specific request using the second transmission unit.
2. The server according to claim 1, further comprising: the control unit updates the status information of the target data from information indicating the first status to information indicating the second status without receiving the specific notification after transmitting the target data to the device using the second transmission unit in response to the specific request.
3. The server according to claim 1, wherein the first status includes a state in which the target data has not been acquired by a specific application that should process the target data in the device.
4. The server according to claim 1, wherein the storage unit can store a plurality of the target data, and the control unit further notifies the device of the number of the target data associated with the status information indicating the first status among the target data stored in the storage unit in response to the specific request.
5. The server according to claim 1, wherein the specific request includes count information specifying the number of the target data that can be received in one response. The server, wherein the control unit transmits, in response to the specific request, a response including the target data equal to or less than the number specified by the number information to the device using the second transmission unit.
6. The server according to claim 1, further comprising: The first transmission unit: Comprises a communication maintenance unit that maintains communication with the device according to the first communication method, When receiving a transmission instruction from the control unit while the communication with the device is maintained, transmits the data based on the transmission instruction to the device, When receiving a transmission instruction from the control unit while the communication with the device is not maintained, does not transmit the data based on the transmission instruction to the device, The second transmission unit: When receiving a request according to the second communication method from the device, transmits, based on the transmission instruction of the control unit, a response to the request according to the second communication method to the device.
7. The server according to claim 6, wherein: The first communication method is a communication method according to MQTT (Message Queueing Telemetry Transport), The second communication method is a communication method according to HTTP (HyperText Transfer Protocol).
8. The server according to claim 1, wherein: When the server becomes communicable with the device and receives the specific request from the device, the control unit transmits, in order from the earliest in the storage order to the storage unit, the target data associated with the status information indicating the first state to the device using the second transmission unit.
9. The server according to claim 1, further comprising: When receiving first target data to be transmitted from an external device to the device, the control unit: Stores the first target data in the storage unit in association with the status information indicating the first state and information for specifying the storage order in the storage unit, Determines whether there is stored second target data that has been stored before the first target data in the storage unit and is associated with the status information indicating the first state, When the second target data is not stored in the storage unit, transmits the first target data to the device using the first transmission unit. When the second target data is stored in the storage unit, the first target data is not transmitted to the device using the first transmission unit, and in response to the specific request using the second transmission unit, after transmitting the second target data to the device in order from the earlier storage order, the first target data is transmitted to the device using the second transmission unit, the server.
10. The server according to claim 1, further comprising a first receiving unit that receives, according to the first communication method, a notification indicating that the target data has been received, the notification being different from the specific notification; a second receiving unit that receives the specific notification according to the second communication method; and comprising the control unit when the first receiving unit receives a notification different from the specific notification, does not update the status information of the target data from the information indicating the first state to the information indicating the second state; when the second receiving unit receives the specific notification, updates the status information of the target data from the information indicating the first state to the information indicating the second state, the server.
11. A communication system comprising a server; a device connectable to the server via a network; and comprising the server 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 device as the transmission destination and a second state different from the first state; a first transmission unit that transmits the target data to the device according to a first communication method that is a push-type communication method; a second transmission unit that transmits, according to a second communication method that is a pull-type communication method, the target data associated with the status information indicating the first state among the target data stored in the storage unit to the device; a control unit that controls the first transmission unit and the second transmission unit; and comprising the device a third transmission unit that transmits a specific notification regarding the target data to the server after receiving the target data from the server; a fourth transmission unit that transmits a specific request for acquiring the target data to the server; and comprising the control unit of the server After transmitting the target data to the device using the first transmission unit, when receiving the specific notification from the device, 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 specific request from the device, transmits the target data associated with the status information indicating the first state in response to the specific request to the device using the second transmission unit.
12. A method for transmitting target data to a device, comprising: A storing step of storing the target data in a storage unit in association with status information, where the status information indicates any one of a plurality of states including a first state indicating that the target data should be transmitted to a destination device and a second state different from the first state. A control step of controlling a first transmission unit that transmits the target data to the device according to a first communication method that is a push-type communication method, and a second transmission unit that transmits the target data associated with the status information indicating the first state among the target data stored in the storage unit to the device according to a second communication method that is a pull-type communication method. Comprising: In the control step: After transmitting the target data to the device using the first transmission unit, when receiving a specific notification regarding the target data from the device, update the status information of the target data from the information indicating the first state to the information indicating the second state. A method that, when receiving a specific request from the device, transmits the target data associated with the status information indicating the first state in response to the specific request to the device using the second transmission unit.
Citation Information
Patent Citations
Data management system and data management method
JP2023046548A