Patent Description:
In a conventional information processing system, in a case where commands and responses are transmitted and received between a server and a client, such transmission and reception are performed for each command or response. As such, in a case where an error occurs in the server and the client, the server transmits a command again. Thus, in order to realize secure and efficient communication of information, PTL <NUM> discloses a technology in which an information processing terminal apparatus makes a request to an information processing apparatus for establishment of communication via a network and performs control on the basis of a command included in a packet supplied from the information processing apparatus through the communication established in response to the request. Further, the information processing apparatus establishes communication with the information processing terminal apparatus via the network in response to the request from the information processing terminal apparatus, and transmits, to the information processing terminal apparatus, a packet including a command, when communication is established. Document <CIT> discloses that a communication may be enabled between mobile devices, i. , controllers, and Internet of Things, IoT, devices by sending connectionless commands from a controller to an IoT device, or sending connectionless commands from a controller to more than one IoT devices, at the same time. One or more commands may be sent from a controller to one or more nodes that form a network, with the nodes relaying messages to each other via connectionless data packets. This may allow for connectionless command relay from the controller to any node within the network. By sending commands through connectionless data packets, one or more controllers may control one or more nodes at the same time. Furthermore, a single controller may directly send one or more commands to a group of nodes at the same time. Document <CIT> discloses a system for resolving packet errors and busy acknowledgments for packets in a ring network, to maintain continued packet distribution on the network with support for strongly ordered, nonidempotent commands. In document <CIT>, each consumer node on the network maintains a record of the sequence of packets that have passed through that node, and the state of each of the packets at the time it passed through, including a record of the last known good packet and its sequence number. In document <CIT>, when a producer node detects an error condition in an acknowledgment for a packet, resends all packets beginning with the last known good packet. In document <CIT>, each consumer node is able to process or reject the resent packets, including packets that may already have been processed, which it is aware of due to the packet and state records for all packets. In document <CIT>, strong ordering is thus supported, since the sending order of packets can be maintained for processing due to the resends, and nonidempotent commands are supported due to the consumer nodes' ability to determine whether they have already processed a given packet, and to send an acknowledge-done reply if that is the case. In document <CIT>, a retry queueing system is used which allows the system of effectively interleave busy retry loops with an error retry loop, thus accommodating both error retries and busy retries while preserving strong sequential ordering, if desired, of the sent packets.

Incidentally, in a case where short-range wireless communication is used for establishment of communication via the network, communication may be disrupted if the communication environment changes after the communication is established. For example, in a case where a reader/writer is provided between an information processing apparatus and an information processing terminal apparatus and short-range wireless communication is to be performed between the information processing terminal apparatus and the reader/writer, if the information processing terminal apparatus moves away from the reader/writer, communication cannot be performed between the information processing apparatus and the information processing terminal apparatus. In such a case, the reader/writer needs to acquire a retry command for performing a retry process from the information processing apparatus, taking time for the retry process.

As such, the present technology aims to provide an information processing apparatus, an information processing terminal apparatus, and an information processing method that enable efficient performance of a process between a communication terminal apparatus and an information processing apparatus via an information processing terminal apparatus.

Optional embodiments of the invention are described in the dependent claims. The first aspect of the present technology lies in an information processing apparatus including a command generation section configured to generate a command for a communication terminal apparatus and a retry command and output the generated retry command together with the command.

According to the present technology, the command generation section generates a command for the communication terminal apparatus and a retry command that is based on whether or not the command is a command that has idempotence, and outputs the generated retry command together with the command. In a case where the command for the communication terminal apparatus is a command that has idempotence, the command generation section generates a retry command by repeating the command that has idempotence. Further, in a case where the command for the communication terminal apparatus is a command that does not have idempotence, the command generation section generates, as the retry command, a command for checking a state of the communication terminal apparatus. Further, in a case where a response to be output from the communication terminal apparatus in response to a command is to be encrypted, the command generation section calculates an expected value of the response or a hash value of the expected value and outputs the calculated expected value or the calculated hash value together with the command and the retry command. Furthermore, the command generation section sets a sequence number indicating an order of processing, for the command and the retry command.

In a case where the number of retry commands is to be adjusted based on the number of retries or a state of occurrence of retries, the command generation section determines the number of retries or the state of occurrence of retries on the basis of the sequence number of the command and a sequence number of a response output from the communication terminal apparatus.

The second aspect of the present technology lies in an information processing method including generating a command for a communication terminal apparatus and a retry command and outputting, from a command generation section, the retry command together with the command.

The third aspect of the present technology lies in an information processing terminal apparatus including a command control section configured to acquire a command for a communication terminal apparatus and a retry command that are successively output from an information processing apparatus, to output the command acquired to the communication terminal apparatus, and to output, in a retry process, the acquired retry command to the communication terminal apparatus.

According to the present technology, the information processing terminal apparatus includes a communication section that performs short-range wireless communication with the communication terminal apparatus, and the command control section outputs a command or a retry command through the communication section. The command control section acquires the command for the communication terminal apparatus and the retry command that have successively been output from the information processing apparatus and outputs the acquired command to the communication terminal apparatus. Further, in a case where a response cannot be acquired from the communication terminal apparatus, the information processing terminal apparatus performs a retry process and outputs the acquired retry command to the communication terminal apparatus in the retry process. The command control section outputs, to the information processing apparatus, a response output from the communication terminal apparatus. Further, the command control section acquires a command, a retry command, and an expected value of a response to the command or a hash value of the expected value, and outputs, in a case where the acquired expected value or the acquired hash value of the expected value matches an expected value that is based on a response output from the communication terminal apparatus or a hash value of the expected value, the response to the information processing apparatus.

The fourth aspect of the present technology lies in an information processing method including acquiring a command for a communication terminal apparatus and a retry command that are output from an information processing apparatus, outputting the command acquired to the communication terminal apparatus, and outputting, in a retry process, the acquired retry command to the communication terminal apparatus from a command control section.

A mode for carrying out the present technology will be described below. Note that the description will be given in the following order.

<FIG> depicts a configuration of an information processing system in which an information processing apparatus according to the present technology is used. An information processing system <NUM> includes a communication terminal apparatus <NUM>, an information processing terminal apparatus <NUM>, and an information processing apparatus (for example, a server) <NUM>. The information processing apparatus <NUM> reads out information from the communication terminal apparatus <NUM> or writes information into the communication terminal apparatus <NUM>, via the information processing terminal apparatus <NUM>. In addition, the information processing terminal apparatus <NUM> performs wireless communication with the communication terminal apparatus <NUM>.

The communication terminal apparatus <NUM> includes at least a function for performing wireless communication with the information processing terminal apparatus <NUM>. For example, the communication terminal apparatus <NUM> is a mobile electronic device such as a contactless IC card and a smartphone or an IOT (Internet of Things) device or the like. Note that, in the following description, using the communication terminal apparatus <NUM> as a contactless IC card and the information processing terminal apparatus <NUM> as a reader/writer, a case of performing short-range wireless communication between the contactless IC card and the reader/writer will be explained.

<FIG> exemplifies a configuration of the communication terminal apparatus (in the case of a contactless IC card). The communication terminal apparatus <NUM> includes a communication section <NUM>, a power supply section <NUM>, a storage section <NUM>, and a control section <NUM>.

The communication section <NUM> includes an antenna 21a and a modulation/demodulation section 21b in order to implement short-range wireless communication with the information processing terminal apparatus <NUM>. The antenna 21a is used for transmission of information and the like or supply and reception of electric power, by being coupled to the information processing terminal apparatus <NUM> by electromagnetic induction, and is connected to the modulation/demodulation section 21b and the power supply section <NUM>.

The modulation/demodulation section 21b outputs, to the control section <NUM>, a reception signal obtained by demodulating a wireless signal received by the antenna 21a. Further, the modulation/demodulation section 21b modulates a transmission signal supplied from the control section <NUM> and transmits the modulated signal from the antenna 21a as a wireless signal.

The power supply section <NUM> converts an alternating voltage generated in the antenna 21a as a result of being coupled to the information processing terminal apparatus <NUM> by electromagnetic induction into a direct constant voltage and supplies electric power to the modulation/demodulation section 21b, the storage section <NUM>, and the control section <NUM>.

The storage section <NUM> stores therein various kinds of information. For example, the storage section <NUM> stores therein information specific to a user of a communication terminal apparatus, information supplied from an information processing apparatus, and the like.

The control section <NUM> processes a command indicated by the reception signal and, for example, reads out the information stored in the storage section <NUM> or writes in information to the storage section <NUM>. Further, the control section <NUM> generates a transmission signal indicating a response to the received command and outputs the signal to the modulation/demodulation section 21b. Furthermore, the control section <NUM> decodes an encrypted command and encrypts a response.

<FIG> exemplifies a configuration of the information processing terminal apparatus. The information processing terminal apparatus <NUM> includes a communication section <NUM>, a network communication section <NUM>, an input section <NUM>, a storage section <NUM>, and a command control section <NUM>.

The communication section <NUM> includes an antenna 31a and a modulation/demodulation section 31b in order to implement short-range wireless communication with the communication terminal apparatus <NUM>. The antenna 31a is used for transmission of information and the like or supply and reception of electric power, by being coupled to the communication terminal apparatus <NUM> by electromagnetic induction, and is connected to the network communication section <NUM>. The modulation/demodulation section 31b modulates a command or a retry command supplied from the command control section <NUM>, and transmits the modulated command from the antenna 31a as a wireless signal. In addition, the modulation/demodulation section 31b outputs, to the command control section <NUM>, a reception signal obtained by demodulating a wireless signal received by the antenna 31a.

The network communication section <NUM> is used to connect the information processing terminal apparatus <NUM> to a network <NUM>. The network communication section <NUM> outputs, to the command control section <NUM>, a command or the like supplied from the information processing apparatus <NUM> via the network <NUM>. Further, the network communication section <NUM> outputs, to the information processing apparatus <NUM> via the network <NUM>, a response or the like output from the command control section <NUM>.

The input section <NUM> has a function of receiving input of operation by a user. The input section <NUM> includes an operation button, a touch panel, a keyboard, a microphone, or the like. The input section <NUM> generates an operation signal based on a user operation and outputs the signal to the command control section <NUM>.

The storage section <NUM> may include a semiconductor memory such as a ROM or a RAM or may include a magnetic recording device, an optical recording device, a magnetooptical recording device, or the like. The storage section <NUM> stores therein programs for operating the information processing terminal apparatus <NUM> and various kinds of data. Further, the storage section <NUM> also stores therein a retry command, an expected value of a response, and the like supplied from the information processing apparatus <NUM>.

The command control section <NUM> executes the programs stored in the storage section <NUM>, to control each section in such a manner that the information processing terminal apparatus <NUM> performs predetermined operation. Further, the command control section <NUM> controls, on the basis of the operation signal from the input section <NUM>, each section in such a manner that the information processing terminal apparatus <NUM> performs operation based on a user operation. For example, the command control section <NUM> performs such processes as acquisition of a command or the like from the information processing apparatus <NUM>, command output to and a retry process for the communication terminal apparatus <NUM>, acquisition of a response or the like from the communication terminal apparatus <NUM>, and output of a response to the information processing apparatus <NUM>. Further, the command control section <NUM> acquires a command for the communication terminal apparatus and a retry command that are output from the information processing apparatus, outputs the acquired command to the communication terminal apparatus, and outputs, in the retry process, the acquired retry command to the communication terminal apparatus.

<FIG> exemplifies a configuration of the information processing apparatus. The information processing apparatus <NUM> includes a network communication section <NUM>, a storage section <NUM>, a command generation section <NUM>, and a control section <NUM>.

The network communication section <NUM> is used to connect the information processing apparatus <NUM> to the network <NUM>. The network communication section <NUM> outputs, to the control section <NUM>, information supplied via the network. Further, the network communication section <NUM> outputs, to the information processing terminal apparatus <NUM> via the network, information supplied from the control section <NUM>.

The storage section <NUM> is a database in which various kinds of information concerning users of each communication terminal apparatus and the like are stored. In addition, the storage section <NUM> may also store application programs to be executed by the information processing apparatus <NUM> and the like.

The command generation section <NUM> generates a command for the communication terminal apparatus and a retry command and has the generated retry command output from a communication section together with the command for the communication terminal apparatus. Further, the command generation section <NUM> may be provided with a security module. A security module is a module provided with an application having a security function (what is generally called a SAM: Secure Application Module). A security module performs, for example, authentication with the communication terminal apparatus <NUM>, or encrypting of a command, decoding of a response, or the like for reading out or writing information from and into the communication terminal apparatus <NUM> with security ensured. In a case where a response to be output from the communication terminal apparatus <NUM> in response to a command is to be encrypted, the command generation section <NUM> may calculate an expected value of a response (which may otherwise be a hash value of the expected value; simply referred to as an expected value in the following description) and output, from the network communication section <NUM>, the expected value together with the generated command and retry command. Further, the command generation section <NUM> sets a sequence number indicating an order of processing, for the command and retry command.

The control section <NUM> executes the application programs and the like recorded in the storage section <NUM>, to perform such processes as update of information stored in the storage section <NUM>, registration of information acquired via the network communication section <NUM> in the storage section <NUM>, and reading-out of information from the storage section <NUM>. Further, the control section <NUM> controls the command generation section <NUM> to generate a command or the like for performing such processes as reading out information from or writing information into the communication terminal apparatus <NUM> and to cause the network communication section <NUM> to output the generated command or the like.

Next, operation of the information processing system will be described. The information processing apparatus <NUM> performs polling by using the information processing terminal apparatus <NUM> and detects a communication terminal apparatus <NUM> that can perform short-range wireless communication with the information processing terminal apparatus <NUM>. The information processing terminal apparatus <NUM> receives a polling response including manufacture ID (IDm), a manufacture parameter (PMm), and the like of the communication terminal apparatus <NUM> and outputs the polling response to the information processing apparatus <NUM>. Note that, a maximum response time parameter is indicated by the manufacture parameter (PMm).

Thereafter, the information processing apparatus <NUM> performs mutual authentication with the communication terminal apparatus <NUM> that can perform short-range wireless communication with the information processing terminal apparatus <NUM> and transmits various kinds of commands to the communication terminal apparatus <NUM> via the information processing terminal apparatus <NUM> after the authentication.

<FIG> exemplifies a packet of a command to be output from the information processing apparatus <NUM>. The command includes a command code, a sequence number, and command data. The command code indicates what kind of packet the packet of the command is. The sequence number is a value indicating the order of processing in the communication terminal apparatus <NUM> and the information processing apparatus <NUM>.

The communication terminal apparatus <NUM> and the information processing apparatus <NUM> each increment the sequence number by "one" every time they perform a process. Thus, in a case where a command is output to the communication terminal apparatus <NUM> and the command is being processed in the communication terminal apparatus <NUM> but the information processing terminal apparatus <NUM> cannot receive a response, if a retry process is performed without incrementing the sequence number, a retry command would be ignored in the communication terminal apparatus <NUM> because the command processed and the retry command would have the same sequence number. Moreover, if a command is ignored in the communication terminal apparatus <NUM>, it is difficult to determine whether the command has not reached the communication terminal apparatus <NUM> or the command is ignored by the communication terminal apparatus <NUM>. Thus, in a case of transmitting the next command or a retry command, it is necessary to increment the sequence number in advance.

For example, in a case where a command with a sequence number "m" is processed in the communication terminal apparatus <NUM>, the sequence number is updated to "m+<NUM>," and the sequence number of a response to the command with the sequence number "m" is set to "m+<NUM>. " Here, if the command with the sequence number "m" is used in the retry process, the communication terminal apparatus <NUM> invalidates the retry command, since such sequence number is equal to or smaller than the updated sequence number "m+<NUM>" stored in the communication terminal apparatus <NUM>. Thus, for the retry command, a sequence number of a value larger than that of the sequence number stored in the communication terminal apparatus <NUM>, for example, "m+<NUM>," is set.

Incidentally, when a command has not reached the communication terminal apparatus <NUM>, a response is not transmitted from the communication terminal apparatus <NUM>. Further, there are cases where the response transmitted from the communication terminal apparatus <NUM> cannot be received by the information processing terminal apparatus <NUM>. Thus, in a case where a response cannot be received even after a time-out value that is set on the basis of a maximum response time parameter indicated by a manufacture parameter (PMm) included in a polling response is exceeded, a retry process is performed as described above.

In the conventional retry process, the information processing terminal apparatus <NUM> needs to make a request for a command to the information processing apparatus <NUM>, and the information processing apparatus <NUM> needs to cause the command generation section <NUM> to generate a command with the sequence number being updated, in response to the request from the information processing terminal apparatus <NUM>, and output the generated command to the communication terminal apparatus <NUM> via the information processing terminal apparatus <NUM>, taking time for the retry process.

As such, at the time of generating a command to be output to the communication terminal apparatus <NUM>, the information processing apparatus <NUM> generates a command for a retry process that has an incremented sequence number and outputs the generated retry command to the information processing terminal apparatus <NUM> together with the command to be output to the communication terminal apparatus <NUM>. Further, in a case of performing a retry process, the information processing terminal apparatus <NUM> outputs, without making a request for a command to the information processing apparatus <NUM>, the retry process command which has already been supplied from the information processing apparatus <NUM>, to the communication terminal apparatus <NUM>.

<FIG> is a flowchart exemplifying operation of the information processing terminal apparatus. In step ST1, the information processing terminal apparatus sets a time-out value. For example, the information processing terminal apparatus <NUM> performs polling for detecting a communication terminal apparatus <NUM> that can perform short-range wireless communication with the information processing terminal apparatus <NUM>, sets, as the time-out value, maximum response time indicated by parameter information (for example, the manufacture parameter (PMm)) included in a polling response supplied from the communication terminal apparatus <NUM>, and proceeds to step ST2. Note that the information processing terminal apparatus <NUM> outputs, to the information processing apparatus <NUM>, card identification information (for example, manufacture IDm) included in the polling response.

In step ST2, the information processing terminal apparatus acquires a command from the information processing apparatus. In the information processing apparatus <NUM>, a command to be output to the communication terminal apparatus <NUM> that can perform short-range wireless communication with the information processing terminal apparatus <NUM> and retry commands are generated on the basis of the card identification information and the like, and the information processing terminal apparatus <NUM> proceeds to step ST3 after acquiring the command and the retry commands that are output from the information processing apparatus <NUM>.

In step ST3, the information processing terminal apparatus outputs a command to the communication terminal apparatus. The information processing terminal apparatus <NUM> outputs the command acquired in step ST2 or a retry command subsequently designated in step ST7 to the communication terminal apparatus <NUM> by short-range wireless communication, and proceeds to step ST4.

In step ST4, the information processing terminal apparatus determines whether a response has been acquired before time-out. The information processing terminal apparatus <NUM> proceeds to step ST5 in a case where a response has been acquired before the length of time that has elapsed from the output of the command in step ST2 becomes longer than the length of time represented by the time-out value, but proceeds to step ST6 in a case where a response has not been acquired before the former becomes longer than the latter.

In step ST5, the information processing terminal apparatus outputs a response to the information processing apparatus. The information processing terminal apparatus <NUM> outputs, to the information processing apparatus <NUM>, the response supplied from the communication terminal apparatus <NUM>.

Proceeding from step ST4 to step ST6, the information processing terminal apparatus determines whether output of retry commands is completed. In a case where the retry commands acquired in step ST2 include a retry command which has not been output to the communication terminal apparatus <NUM>, the information processing terminal apparatus <NUM> proceeds to step ST7, and in a case where output of the acquired retry commands is completed, the information processing terminal apparatus <NUM> proceeds to step ST8.

In step ST7, the information processing terminal apparatus updates the command to be output. The information processing terminal apparatus <NUM> designates, as a command to be output to the communication terminal apparatus <NUM>, a command which is among the retry commands acquired in step ST2, which has not been output to the communication terminal apparatus <NUM>, and which is a retry command with a sequence number that is first in the order of processing, and returns to step ST3.

In step ST8, the information processing terminal apparatus gives notification to the information processing apparatus. The information processing terminal apparatus <NUM> notifies the information processing apparatus <NUM> that a response to the command acquired in step ST2 cannot be acquired. Note that, in a case where the information processing apparatus <NUM> determines that communication with the communication terminal apparatus <NUM> cannot be performed when a response has not been supplied even after a predetermined length of time has elapsed from the output of a command, the processing in step ST8 may not be provided.

<FIG> is a sequence diagram illustrating an example of operation of the information processing system. In step ST11, the information processing system performs polling and an authentication process. The information processing terminal apparatus <NUM> performs polling for detecting a communication terminal apparatus <NUM> that can perform short-range wireless communication with the information processing terminal apparatus <NUM>, and sets, as the time-out value, the maximum response time indicated by the parameter information (for example, the manufacture parameter (PMm)) included in the polling response supplied from the communication terminal apparatus <NUM>. In addition, the information processing terminal apparatus <NUM> outputs, to the information processing apparatus <NUM>, card identification information (for example, the manufacture IDm) included in the polling response. The information processing apparatus <NUM> performs the authentication process by using the card identification information supplied from the communication terminal apparatus <NUM>.

In step ST12, the information processing apparatus <NUM> generates a command for the authenticated communication terminal apparatus <NUM> and outputs the command. The command to be output to the communication terminal apparatus <NUM> has a sequence number "<NUM>," and commands for a retry process that differ from the abovementioned command only in sequence number are generated. Note that, in <FIG>, retry commands with the sequence numbers "<NUM>" and "<NUM>" are generated. The command with the sequence number "<NUM>" and the retry commands with the sequence numbers "<NUM>" and "<NUM>" are collectively output to the information processing terminal apparatus <NUM>.

In step ST13, the information processing terminal apparatus <NUM> outputs the command with the sequence number "<NUM>" to the communication terminal apparatus <NUM>.

In a case where the information processing terminal apparatus <NUM> cannot acquire a response even after a length of time represented by the time-out value has elapsed from the output of the command in step ST13, the information processing terminal apparatus <NUM> performs a retry process, and as indicated in step ST14, outputs a retry command to the communication terminal apparatus <NUM>. In the retry process, a command which is among the retry commands acquired in step ST12, which has not been output to the communication terminal apparatus <NUM>, and which is a retry command with a sequence number that is first in the order of processing, that is, the command with the sequence number "<NUM>" in step ST14, is output to the communication terminal apparatus <NUM>.

When a response is supplied from the communication terminal apparatus <NUM> to the information processing terminal apparatus <NUM> in step ST15, the information processing terminal apparatus <NUM> outputs the acquired response to the information processing apparatus <NUM> as illustrated in step ST16. Since the sequence number of the command is incremented and used as the sequence number of the response, the response supplied in step ST15 has a sequence number "<NUM>.

Note that, in the conventional information processing system, the retry commands indicated in step ST2 are not supplied to the information processing terminal apparatus, and thus, in the retry process, a command request is made to the information processing apparatus <NUM> as illustrated in step ST14c, and thereafter, the command supplied from the information processing apparatus <NUM> is output to the communication terminal apparatus <NUM>.

As described above, the information processing terminal apparatus <NUM> is supplied with the command to be output to the communication terminal apparatus <NUM> and the retry commands from the information processing apparatus, and is thus able to perform a retry process by using the retry commands that are supplied together with the command to be output to the communication terminal apparatus <NUM>. Accordingly, in comparison to a conventional configuration in which a command request is made at the time of a retry process and the retry process is performed with use of the command supplied from the information processing apparatus <NUM>, time required for the retry process can be shortened. Further, generating a command for a retry process at the time of generating a command to be transmitted to the communication terminal apparatus <NUM> and supplying the command for the retry process together with the command to be transmitted to the communication terminal apparatus <NUM> to the information processing terminal apparatus <NUM> enable efficient performance of the process of generating commands in the information processing apparatus <NUM> and the process of transmitting commands to the information processing terminal apparatus <NUM>.

Incidentally, as the command to be supplied from the information processing apparatus <NUM> to the communication terminal apparatus, not only a command with which an identical processing result will be obtained even if the command supplied is repeatedly processed, i.e., a command that has what is generally called idempotence (such a command is referred to as an "idempotent command" in the present technology), but also a command with which a different processing result will be obtained as a result of repetitively processing the command supplied, i.e., a command that does not have what is generally called idempotence (such a command is referred to as a "non-idempotent command" in the present technology), is used. Thus, if a non-idempotent command is repeated in the retry process, information indicated by a response may be different for each retry process.

<FIG> exemplifies idempotent commands and non-idempotent commands. The idempotent command, for example, a read command or a card state checking command, is a command used for reading out information stored in the communication terminal apparatus <NUM>, and thus, even if the read command or the card state checking command is repeatedly processed, the same processing result will be obtained. Further, a write command for overwriting is a command used for overwriting information of the communication terminal apparatus <NUM> with new information, and thus, even if the write command is repeatedly processed, the same processing result will be obtained. In <FIG>, (a) illustrates a case where read commands with the sequence numbers "<NUM>" and "<NUM>," which are retry commands, are output together with a read command with the sequence number "<NUM>.

On the other hand, the non-idempotent command, for example, a write command indicating subtraction, is a command used for subtracting a designated value from the value stored in the communication terminal apparatus <NUM>, and thus, if the write command is repeatedly processed, sequentially decreased values will be obtained as the processing results.

As such, the command generation section <NUM> of the information processing apparatus <NUM> generates a retry command that is based on whether or not a command for the communication terminal apparatus <NUM> is a command that has idempotence. In a case where an idempotent command is to be output to the communication terminal apparatus <NUM>, the command generation section <NUM> generates, as the retry command, a command with only the sequence number being incremented, as described above. Further, in a case where a non-idempotent command is to be output to the communication terminal apparatus <NUM>, the command generation section <NUM> generates, as the retry command, a command for checking a state of the communication terminal apparatus <NUM>.

Further, in a case where the information processing apparatus <NUM> encrypts a packet of a command and the communication terminal apparatus <NUM> encrypts a packet of a response, the information processing terminal apparatus <NUM> is unable to determine whether a packet of a response corresponding to the command is supplied. Thus, in a case where a response to be output from the communication terminal apparatus in response to a command is to be encrypted, the command generation section <NUM> of the information processing apparatus <NUM> calculates an expected value of the response and outputs the calculated expected value together with the generated command and retry command. In addition, the information processing terminal apparatus <NUM> is enabled to determine whether the relevant response is a response to the command by using the acquired expected value. In <FIG> illustrates a case where a read command with a sequence number "<NUM>" which is a retry command for checking the state of the communication terminal apparatus <NUM>, an expected value (or a hash value of the expected value) of a response, and a write command with a sequence number "<NUM>" which is a retry command to be used in a case where the expected value (or the hash value of the expected value) of the response and an expected value (or a hash value of the expected value) of a response from the communication terminal apparatus <NUM> do not match with each other as described later are output together with a write command with a sequence number "<NUM>.

<FIG> is a flowchart exemplifying operation of the information processing terminal apparatus. In step ST21, the information processing terminal apparatus sets a time-out value. The information processing terminal apparatus <NUM> performs, for example, polling for detecting a communication terminal apparatus <NUM> that can perform short-range wireless communication with the information processing terminal apparatus <NUM>, sets, as the time-out value, the maximum response time indicated by the parameter information (for example, the manufacture parameter (PMm)) included in the polling response supplied from the communication terminal apparatus <NUM>, and then proceeds to step ST22. Note that, the information processing terminal apparatus <NUM> outputs, to the information processing apparatus <NUM>, the card identification information (for example, the manufacture IDm) included in the polling response.

In step ST22, the information processing terminal apparatus acquires a command from the information processing apparatus. The information processing apparatus <NUM> generates a command to be output to the communication terminal apparatus <NUM> that can perform short-range wireless communication with the information processing terminal apparatus <NUM> and retry commands, on the basis of the card identification information and the like. The information processing terminal apparatus <NUM> acquires the command and the retry commands output from the information processing apparatus <NUM> or the command, the retry commands, and the expected value output from the information processing apparatus <NUM>, and proceeds to step ST23.

In step ST23, the information processing terminal apparatus outputs a command to the communication terminal apparatus. The information processing terminal apparatus <NUM> outputs the command acquired in step ST22 or a retry command subsequently designated in step ST28 to the communication terminal apparatus <NUM> by short-range wireless communication, and proceeds to step ST24.

In step ST24, the information processing terminal apparatus determines whether a response has been acquired before time-out. The information processing terminal apparatus <NUM> proceeds to step ST25 in a case where a response has not been acquired before the length of time that has elapsed from the output of the command in step ST22 becomes longer than the length of time represented by the time-out value, but proceeds to step ST26 in a case where a response has been acquired before the former becomes longer than the latter.

In step ST25, the information processing terminal apparatus determines whether the expected value of a response to a retry command matches the expected value supplied from the information processing apparatus. The information processing terminal apparatus <NUM> calculates an expected value of the response supplied from the communication terminal apparatus <NUM> in response to a retry command and determines whether the calculated expected value matches the expected value supplied from the information processing apparatus <NUM>. In a case where the expected values match, the information processing terminal apparatus <NUM> proceeds to step ST26, and in a case where the expected values do not match, the information processing terminal apparatus <NUM> proceeds to step ST27.

In step ST26, the information processing terminal apparatus outputs a response to the information processing apparatus. The information processing terminal apparatus <NUM> outputs, to the information processing apparatus <NUM>, the response supplied from the communication terminal apparatus <NUM>.

Proceeding from step ST25 to step ST27, the information processing terminal apparatus determines whether output of retry commands is completed. In a case where the retry commands acquired in step ST22 include a retry command which has not been output to the communication terminal apparatus <NUM>, the information processing terminal apparatus <NUM> proceeds to step ST28, and in a case where output of retry commands is completed, the information processing terminal apparatus <NUM> proceeds to step ST29.

In step ST28, the information processing terminal apparatus updates the command to be output. The information processing terminal apparatus <NUM> designates, as a command to be output to the communication terminal apparatus <NUM>, a command which is among the retry commands acquired in step ST22, which has not been output to the communication terminal apparatus <NUM>, and which is a retry command with a sequence number that is first in the order of processing, and then returns to step ST23.

In step ST29, the information processing terminal apparatus gives notification to the information processing apparatus. The information processing terminal apparatus <NUM> notifies the information processing apparatus <NUM> that a response to the command acquired in step ST22 cannot be acquired. Note that, in a case where the information processing apparatus <NUM> determines that communication with the communication terminal apparatus <NUM> cannot be performed when a response has not been supplied even after a predetermined length of time has elapsed from the output of a command, the processing in step ST29 may not be provided.

<FIG> is a sequence diagram illustrating an example of operation of the information processing system. Note that, <FIG> illustrates a case where a non-idempotent command is output from the information processing apparatus <NUM>.

In step ST31, the information processing system performs polling and an authentication process. The information processing terminal apparatus <NUM> performs polling for detecting a communication terminal apparatus <NUM> that can perform short-range wireless communication with the information processing terminal apparatus <NUM> and sets, as the time-out value, the maximum response time indicated by the parameter information (for example, the manufacture parameter (PMm)) included in the polling response supplied from the communication terminal apparatus <NUM>. Further, the information processing terminal apparatus <NUM> outputs, to the information processing apparatus <NUM>, the card identification information (for example, the manufacture IDm) included in the polling response. The information processing apparatus <NUM> performs the authentication process by using the card identification information supplied from the communication terminal apparatus <NUM>.

In step ST32, the information processing apparatus <NUM> generates a command for the authenticated communication terminal apparatus <NUM> and outputs the command. The command to be output to the communication terminal apparatus <NUM> has a sequence number "<NUM>. " Further, in a case where the command with the sequence number "<NUM>" is a non-idempotent command, a command for checking the state of the communication terminal apparatus <NUM> is used as a retry command, with the sequence number set to "<NUM>. " Further, an expected value of a response is calculated, and a packet indicating the expected value of the response is output together with packets of the command and the retry command to the information processing terminal apparatus <NUM>.

In step ST33, the information processing terminal apparatus <NUM> outputs the command with the sequence number "<NUM>" to the communication terminal apparatus <NUM>.

In a case where the information processing terminal apparatus <NUM> cannot acquire a response even after a length of time represented by the time-out value has elapsed from the output of the command in step ST33, the information processing terminal apparatus <NUM> performs a retry process, and outputs a retry command to the communication terminal apparatus <NUM> as illustrated in step ST34. In the retry process, a command which is among the retry commands acquired in step ST32, which has not been output to the communication terminal apparatus <NUM>, and which is a retry command with a sequence number that is first in the order of processing, that is, the command with the sequence number "<NUM>" in step ST34, is output to the communication terminal apparatus <NUM>.

When a response is supplied from the communication terminal apparatus <NUM> to the information processing terminal apparatus <NUM> in step ST35, the information processing terminal apparatus <NUM> performs, in step ST36, a response determination process by using the acquired response. In the response determination process, the information processing terminal apparatus <NUM> compares an expected value calculated by using the acquired response and the expected value acquired in step ST32, and in a case where the values match, the information processing terminal apparatus <NUM> determines that the response is a response to the command output in step ST34, and in a case where the values do not match, the information processing terminal apparatus <NUM> determines that the state of the communication terminal apparatus <NUM> has not changed, that is, the command has not been processed.

In step ST37, the information processing terminal apparatus <NUM> outputs, to the information processing apparatus <NUM>, the response determined in step ST36 as the response to the command output in step ST34. Further, in a case where the information processing terminal apparatus <NUM> determines in step ST36 that the command has not been processed, the information processing terminal apparatus <NUM> outputs a retry command with a sequence number "<NUM>" to the communication terminal apparatus <NUM>.

As described above, by being supplied, from the information processing apparatus, with retry commands together with a command to be output to the communication terminal apparatus <NUM>, the information processing terminal apparatus <NUM> can perform the retry process with use of the retry commands supplied together with the command to be output to the communication terminal apparatus <NUM>. Thus, in comparison to the conventional configuration in which a command request is made at the time of a retry process and the retry process is performed with use of the command supplied from the information processing apparatus <NUM>, time required for the retry process can be shortened. Further, generating a command for a retry process at the time of generating a command to be transmitted to the communication terminal apparatus <NUM> and supplying the command for the retry process together with the command to be transmitted to the communication terminal apparatus <NUM> to the information processing terminal apparatus <NUM> enable efficient performance of the process of generating commands in the information processing apparatus <NUM> and the process of transmitting commands to the information processing terminal apparatus <NUM>.

Furthermore, in a case where a non-idempotent command is to be output to the communication terminal apparatus, a retry command for checking the state of the communication terminal apparatus <NUM> and an expected value of a response are output together with the command, and thus, the information processing terminal apparatus <NUM> is able to output, to the information processing apparatus, the response to the command output to the communication terminal apparatus.

Incidentally, generating many retry commands makes it possible for the information processing apparatus <NUM> to increase the number of times of efficiently performing the retry process. However, in a case where a retry process is not to be performed, this results in generating many unnecessary retry commands, making it difficult for the information processing apparatus <NUM> to operate efficiently. As such, the information processing apparatus <NUM> may control the generation of retry commands, according to the number of times of repeating the retry process or the rate of occurrence of the retry process. For example, the command generation section <NUM> of the information processing apparatus <NUM> adjusts the number of retry commands according to the number of retries or a state of occurrence of retries. Further, the command generation section <NUM> determines the number of retries or the state of occurrence of retries on the basis of the sequence number of the command and the sequence number of the response output from the communication terminal apparatus <NUM>.

<FIG> is a sequence diagram exemplifying operation between the information processing apparatus and the information processing terminal apparatus. In step ST41, the information processing apparatus <NUM> generates a command for the communication terminal apparatus <NUM> and outputs the command. The command to be output to the communication terminal apparatus <NUM> has a sequence number "<NUM>," and commands for a retry process that differ from the abovementioned command only in sequence number are generated. Note that, in <FIG>, commands with the sequence numbers "<NUM>" and "<NUM>" are generated. The command with the sequence number "<NUM>" and the retry commands with the sequence numbers "<NUM>" and "<NUM>" are collectively output to the information processing terminal apparatus <NUM>.

In step ST42, the information processing terminal apparatus <NUM> supplies, to the information processing apparatus <NUM>, the response from the communication terminal apparatus <NUM>.

In step ST43, the information processing apparatus performs a retry number learning process. The information processing apparatus <NUM> can determine that a retry process has not been performed, from the fact that the response has a sequence number "<NUM>. " Thus, the information processing apparatus <NUM> determines that the communication between the communication terminal apparatus <NUM> and the information processing terminal apparatus <NUM> is performed favorably and generates only a small number of retry commands.

In step ST44, the information processing apparatus <NUM> generates a command for the communication terminal apparatus <NUM> and outputs the command. The command to be output to the communication terminal apparatus <NUM> has a sequence number "<NUM>," and a command for a retry process that differs from the abovementioned command only in sequence number is generated. Further, since the communication between the communication terminal apparatus <NUM> and the information processing terminal apparatus <NUM> is determined in step ST44 as being performed favorably, the number of retry commands to be generated is decreased, and the command with the sequence number "<NUM>" and a retry command with a sequence number "<NUM>" are output to the information processing terminal apparatus <NUM>.

Thereafter, in step ST45, the information processing apparatus <NUM> outputs, to the information processing terminal apparatus <NUM>, a command with a sequence number "n" that is to be output to the communication terminal apparatus <NUM> and a retry command with a sequence number "n+<NUM>," and in step ST46, the information processing terminal apparatus <NUM> supplies, to the information processing apparatus <NUM>, the response from the communication terminal apparatus <NUM>.

In step ST47, the information processing apparatus performs a retry number learning process. The information processing apparatus <NUM> can determine that the retry process has been performed once, from the facts that the sequence number of the command output to the immediately prior one is "n" and that the sequence number of the response is "n+<NUM>. " Accordingly, the information processing apparatus <NUM> determines that the communication between the communication terminal apparatus <NUM> and the information processing terminal apparatus <NUM> is no longer performed favorably and generates a large number of retry commands.

In steps ST48, the information processing apparatus <NUM> generates a command for the communication terminal apparatus <NUM> and outputs the command. The command to be output to the communication terminal apparatus <NUM> has a sequence number "n+<NUM>," and commands for a retry process that differ from the abovementioned command only in sequence number are generated. Further, in step ST48, since it has been determined that the communication between the communication terminal apparatus <NUM> and the information processing terminal apparatus <NUM> is no longer performed favorably, the number of retry commands is increased, and the command with the sequence number "n+<NUM>" and retry commands with sequence numbers "n+<NUM>" and "n+<NUM>" are output to the information processing terminal apparatus <NUM>.

Note that, in <FIG>, generation of retry commands is controlled according to the number of retries, but the generation of retry commands may be controlled according to the rate of occurrence of retries. Specifically, in a case where the frequency of occurrence of retries is high, the number of retry commands may be increased, while, in a case where the frequency of occurrence of retries is low, the number of retry commands may be decreased.

As described above, controlling the generation of retry commands according to the number of retries or the rate of occurrence of retries makes it possible to generate retry commands in a number appropriate for the communication state in the short-range wireless communication performed between the communication terminal apparatus <NUM> and the information processing terminal apparatus <NUM>.

The series of processes described in the specification can be performed by hardware, software, or a composite configuration of the two. In a case where the series of processes is to be performed by software, a program in which a processing sequence is recorded is executed by being installed in a memory of a computer incorporated in dedicated hardware. Alternatively, the program can be executed by being installed in a general-purpose computer capable of performing various processes.

For example, the program can be recorded in advance in a hard disk, an SSD (Solid State Drive), or a ROM (Read Only Memory) as a recording medium. Alternatively, the program may temporarily or permanently be stored (recorded) in a removable recording medium such as a flexible disk, a CD-ROM (Compact Disc Read Only Memory), an MO (Magneto optical) disk, a DVD (Digital Versatile Disc), a BD (Blu-Ray Disc (registered trademark)), a magnetic disk, and a semiconductor memory card. Such a removable recording medium may be provided as what is generally called package software.

Further, other than being installed into a computer from a removable recording medium, the program may be transferred to a computer in a wireless or wired manner, from a download site through such a network as a LAN (Local Area Network) or the internet. The computer receives the program being transferred in the manner described above and installs it in a recording medium such as a built-in hard disk.

Claim 1:
An information processing apparatus (<NUM>) comprising:
a command generation section (<NUM>) configured to generate a command for a communication terminal apparatus (<NUM>) and a retry command and output the generated retry command together with the command to the communication terminal apparatus (<NUM>), characterized in that:
the command generation section (<NUM>) is configured to generate the retry command that is based on whether or not the command for the communication terminal apparatus (<NUM>) is a command that has idempotence, wherein,
in a case where the command for the communication terminal apparatus (<NUM>) is a command that has idempotence, the command generation section (<NUM>) is configured to generate the retry command by changing a sequence number of the command that has idempotence, and wherein,
in a case where the command for the communication terminal apparatus (<NUM>) is a command that does not have idempotence, the command generation section (<NUM>) is configured to generate a command for checking a state of the communication terminal apparatus (<NUM>), as the retry command.