Disclosure of Invention
The embodiment of the invention provides a method and a device for identifying a terminal card, so that a terminal can directly obtain a card type supported by the terminal card.
In order to achieve the purpose, the technical scheme of the invention is realized as follows:
a method of identifying a terminal card, comprising:
the terminal card sends a reset response ATR to the terminal, and bytes used for indicating the card type suggested by the terminal card are preset in the reset response ATR;
and the terminal sends the instruction corresponding to the suggested card type to the terminal card, judges whether the information on the terminal card is the application information corresponding to the instruction, and determines the suggested card type as the card type of the terminal card if the information on the terminal card is the application information corresponding to the instruction.
Preferably, when the preset byte specifically indicates the card type suggested by the terminal card, it is further determined whether the terminal enforces a protocol parameter selection PPS process with the terminal card, and if so, before the terminal sends an instruction corresponding to the suggested card type to the terminal card, the method further includes:
the terminal sends a PPS request to the terminal card;
the terminal card sends a PPS response corresponding to the PPS request to the terminal, and bytes used for indicating the terminal card to suggest the preferred card type of the terminal are preset in the PPS response;
and when the preferred card type is consistent with the suggested card type, further verifying the suggested card type of the terminal card.
Preferably, when the preset byte does not specifically indicate the card type suggested by the terminal card, it is further determined whether the terminal enforces the PPS process with the terminal card, and if so, before the terminal sends an instruction corresponding to the suggested card type to the terminal card, the method further includes:
the terminal sends a PPS request to the terminal card;
the terminal card sends a PPS response corresponding to the PPS request to the terminal, and bytes used for indicating the terminal card to suggest the preferred card type of the terminal are preset in the PPS response;
and determining the preferred card type as the card type suggested by the terminal card.
Preferably, when the preset byte does not specifically indicate the card type suggested by the terminal card, further determining whether a preset condition for triggering the PPS process is satisfied, and if so, before the terminal sends an instruction corresponding to the suggested card type to the terminal card, further including:
the terminal sends a PPS request to the terminal card;
the terminal card sends a PPS response corresponding to the PPS request to the terminal, and bytes used for indicating the terminal card to suggest the preferred card type of the terminal are preset in the PPS response;
and determining the preferred card type as the card type suggested by the terminal card.
Preferably, when the information on the terminal card is not the application information corresponding to the instruction, the method further includes:
trying to use other UICC instructions except the instruction, and if the information on the terminal card is application information corresponding to the other UICC instructions, determining the card type corresponding to the other UICC instructions as the card type of the terminal card.
An apparatus for identifying a terminal card, comprising: the terminal card, the card type suggestion unit and the card type determination unit; wherein,
the terminal card is used for carrying preset bytes indicating the card type suggested by the terminal card in a reset response ATR and sending the bytes to the card type suggestion unit;
the card type suggesting unit is used for determining the card type suggested by the terminal card according to a preset byte indicating the card type suggested by the terminal card in the answer-to-reset ATR after receiving the answer-to-reset ATR, and sending a first determination message to the card type determining unit;
the card type determining unit is used for sending the instruction corresponding to the suggested card type to the terminal card after receiving the first determination notification, and determining the suggested card type as the card type of the terminal card when the information on the terminal card is the application information corresponding to the instruction.
Preferably, the device further comprises a judging unit and a PPS requesting unit; wherein,
the judging unit is used for judging whether to enforce the PPS process with the terminal card when the card type suggested by the terminal card is specifically determined by the card type suggesting unit, and if so, sending a PPS notification to the PPS requesting unit;
the PPS request unit sends a PPS request to the terminal card after receiving the PPS notification;
the terminal card is used for sending a PPS response corresponding to the PPS request to the card type suggesting unit after receiving the PPS request, and bytes used for indicating the preferred card type of the terminal suggested by the terminal card are preset in the PPS response;
and the card type suggesting unit is used for further verifying the card type suggested by the terminal card when the preferred card type is consistent with the suggested card type after receiving the PPS response.
Preferably, the determining unit is further configured to determine whether to enforce a PPS process with the terminal card when the card type suggested by the card type suggesting unit does not specifically determine the card type suggested by the terminal card, and if so, send a PPS notification to the PPS requesting unit;
the PPS request unit sends a PPS request to the terminal card after receiving the PPS notification;
the terminal card is used for sending a PPS response corresponding to the PPS request to the card type suggesting unit after receiving the PPS request, and bytes used for indicating the preferred card type of the terminal suggested by the terminal card are preset in the PPS response;
and the card type suggesting unit is used for determining the preferred card type as the card type suggested by the terminal card after receiving the PPS response.
Preferably, the determining unit is further configured to determine whether a preset condition for triggering a PPS process is met when the card type suggested by the terminal card is not specifically determined by the card type suggesting unit, and if so, send a PPS notification to the PPS requesting unit; judging whether the PPS response is consistent with the PPS request according to a judgment notice from the terminal card, if so, indicating that the PPS process is successful, and sending a suggestion notice to the card type suggestion unit;
the PPS request unit sends a PPS request to the terminal card after receiving the PPS notification;
the terminal card is also used for sending a PPS response corresponding to the PPS request to the card type suggesting unit, presetting bytes used for indicating the preferred card type of the terminal suggested by the terminal card in the PPS response, and sending a judgment notice to the judgment unit;
the card type suggesting unit is further configured to determine the preferred card type as the card type suggested by the terminal card after receiving the suggestion notification.
Preferably, the judging unit is further configured to send a third determination notification to the card type determining unit when the information on the terminal card is not the application information corresponding to the instruction;
the card type determining unit is further configured to try other UICC instructions except the instruction, and determine a card type corresponding to the other UICC instruction as a card type of the terminal card when the information on the terminal card is application information corresponding to the other UICC instruction.
According to the technical scheme, the terminal card sends the reset response ATR to the terminal, and bytes for indicating the card type suggested by the terminal card are preset in the reset response ATR; the terminal sends an instruction corresponding to the card type suggested by the terminal card to the terminal card, judges whether the information on the terminal card is the application information corresponding to the instruction, and if so, determines the suggested card type as the card type of the terminal card. Compared with the prior art, the embodiment of the invention can directly obtain the card type supported by the terminal card without trying different instructions, so that the embodiment of the invention can reduce the risk of misjudging the terminal card to the maximum extent, can also reduce extra burden, greatly improves the coupling degree of the terminal and the terminal card and the application information in the terminal and the terminal card, and further improves the compatibility of the terminal and the terminal card.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is further described in detail below with reference to the accompanying drawings and examples.
The embodiment of the invention mainly comprises the following steps: the terminal card sends a reset response ATR to the dual-mode terminal, and bytes used for indicating the card type suggested by the terminal card are preset in the reset response ATR; the dual-mode terminal sends the instruction corresponding to the card type suggested by the terminal card to the terminal card, judges whether the information on the terminal card is the application information corresponding to the instruction, and if so, determines the suggested card type as the card type of the terminal card, which can ensure that the dual-mode terminal directly obtains the card type supported by the terminal card instead of obtaining the card type supported by the terminal card in an attempt mode, thereby reducing the risk of misjudgment to the maximum extent and reducing the extra burden.
In the embodiment of the present invention, the byte preset in the ATR for indicating the card type suggested by the terminal card should not be specific to a certain transmission protocol, so that this byte should appear in the global interface byte, i.e., in the next group of interface bytes indicated by interface bytes td (i) (i > 1) where T ═ 15.
Referring to fig. 1, fig. 1 is a schematic structural diagram of a byte td (i) in the prior art. As shown in fig. 1, bits b8 through b5 are used to indicate whether the next set of interface bytes exists, for example, b5 ═ 1, which indicates that TA (i +1) exists; b5 is 0, indicating that TA (i +1) is not present. Bits b4 through b1 are used to indicate the value of the transport protocol parameter T, where T15 is used to indicate that the next set of interface bytes is global, otherwise it indicates that the next set of interface bytes is specific to a certain transport protocol. Specifically, in TD (1), T is generally prohibited from being 15. When TD (1) does not exist, it is determined that the next set of interface bytes does not exist, and the transmission protocol parameter T is determined to be 0. In fact, only two transmission protocols, T-0 and T-1, are in practical use. Of course, if TD (i) does not exist, interface bytes TA (i +1), TB (i +1), TC (i +1), and TD (i +1) also do not exist.
It can be seen that the number of interface bytes meeting the above condition is 3: TA (i +1), TB (i +1), TC (i + 1). However, TA (i +1) has been used in the 3GPP protocol for indicating the clock stop mode and class. Therefore, the embodiment of the present invention may use the byte TB (i +1) or TC (i +1) to indicate the preferred card type suggested by the terminal card. In the embodiment of the present invention, TB (i +1) (i > 1) is taken as an example, and how to express the embodiment is shown in fig. 2.
FIG. 2 is a schematic structural diagram of an interface byte TB (i +1), i > 1 in the embodiment of the present invention. As shown in fig. 2, when TB (i +1) is equal to 00, TB (i +1) indicates that the terminal card does not suggest what type of command the dual mode terminal employs, so that the dual mode terminal can identify the card type of the terminal card according to the prior art method. When TB (i +1) is equal to 01, TB (i +1) indicates that the current terminal card is a UICC supporting USIM instructions, so that the card type suggested by the terminal card is a USIM card. When TB (i +1) is equal to 10, TB (i +1) indicates that the current terminal card is a UICC supporting SIM command, so the proposed card type of the terminal card is a SIM card. When TB (i +1) (i > 1) is equal to 11, indicating that the current terminal card is a UICC card supporting USIM or SIM instructions, so that the suggested card types of the terminal card are as follows: USIM card or SIM card.
In addition, in the embodiment of the present invention, in addition to three preset conditions for triggering the PPS process in the prior art, a condition for triggering the PPS process, that is, a terminal forced triggering, is added. The terminal is forced to trigger whether the card type of the terminal card can be determined according to the information in the ATR or not, and the PPS process is executed as long as the terminal is forced to perform the PPS process with the terminal card.
The PPS process specifically comprises the following steps: the terminal sends a PPS request to the terminal card, the terminal card sends a PPS response corresponding to the PPS request to the terminal, and when the PPS request is consistent with the PPS response, the PPS is indicated to be successful. In the embodiment of the present invention, the card type indicating the terminal card to suggest the terminal is preset in the PPS response, and in a general case, the card type indicating the terminal card to suggest the terminal may be indicated by using the idle PPS 3. For example, when the PPS3 is 01, the terminal card is instructed to suggest that the card type of the terminal is a USIM card. In general, bits b1 and b2 will not be set to 1 or 0 at the same time.
The method for identifying a terminal card provided by the embodiment of the invention is described below.
Referring to fig. 3, fig. 3 is a flowchart of a method for identifying a terminal card according to an embodiment of the present invention. The process comprises the following steps:
in step 301, the terminal card sends a reset response ATR to the terminal, where a byte indicating the card type suggested by the terminal card is preset in the reset response ATR.
In this embodiment, the terminal determines the card type suggested by the terminal card according to the byte preset in the reset response ATR and used for indicating the card type suggested by the terminal card. For example, if TB (i +1) is equal to 01, TB (i +1) indicates that the card type proposed by the current terminal card is a USIM card.
Step 302, the terminal sends an instruction corresponding to the card type suggested by the terminal card to the terminal card, and determines whether the information on the terminal card is the application information corresponding to the instruction, if so, step 303 is executed, otherwise, step 304 is executed.
In this embodiment, if the card type suggested by the terminal card is a USIM card, in this step, the terminal sends a USIM instruction to the terminal card, and determines whether information on the terminal card is valid information corresponding to the USIM instruction, that is, valid 3G application information, if so, step 303 is executed, otherwise, step 304 is executed.
Step 303, determining the proposed card type as the card type of the terminal card.
In this embodiment, if the information on the terminal card is valid 3G application information corresponding to the USIM command, the card type of the terminal card is determined to be the USIM card,
at step 304, additional instructions are attempted.
In this embodiment, if the information on the terminal card is not valid information corresponding to the USIM instruction, that is, valid 3G application information, then, an SIM instruction may be further sent to the terminal card, and if the information on the terminal card is not valid information corresponding to the SIM instruction, that is, valid GSM-related file information, it is determined that the terminal card is faulty, and of course, if the information on the terminal card is valid information corresponding to the SIM instruction, that is, valid GSM-related file information, it is determined that the card type of the terminal card is the SIM card.
The following describes in detail a flow of identifying a terminal card in the embodiment of the present invention.
Referring to fig. 4, fig. 4 is a flowchart of a specific method for identifying a terminal card in the embodiment of the present invention. If the transmission protocol type is the type corresponding to T ═ 0, as shown in fig. 4, the process includes the following steps:
step 401 is the same as step 301, i.e. the terminal card sends a reset answer ATR to the terminal, in which a byte is preset indicating the card type suggested by the terminal card.
In this embodiment, if the bytes of ATR are as follows:
3B 97 95 80 2F 01 80 31 AO 73 BE 21 00 51
wherein each byte is represented as follows:
TS:3B;
TO: 97, indicating that there is an interface byte TA1 TD1, the number of history bytes is 7;
TA 1: 95, indicating FI 512, DI 16;
TD 1: 80 indicating that the presence interface byte TD2 supports the T-0 protocol
TD 2: 2F, indicating that interface byte TB3 is present and is a global interface byte;
TB 3: 01, indicating the preferred UICC card type as a USIM card;
80-00 are history bytes;
TCK:51。
it can be seen that the present embodiment can determine the card type suggested by the terminal card according to the interface byte TB 3; thus, the terminal already knows what kind of command needs to be sent to the terminal card, and does not need to perform the PPS process.
Step 402, judging whether the preset bytes can specifically determine the card type suggested by the terminal card, if so, executing step 403, otherwise, executing step 405.
In this embodiment, under the condition that the terminal enforces the PPS process with the terminal card, if the interface byte TB3 can determine the card type suggested by the terminal card, then step 403 is executed, otherwise, step 405 is executed.
Step 403, judging whether the terminal enforces the PPS process with the terminal card, if so, executing step 404, otherwise, omitting the PPS process and directly executing step 407.
In the present embodiment, although the card type suggested by the terminal card can be determined based on the ATR described above, the PPS process must be executed as long as the terminal forces the PPS process with the terminal card.
In this embodiment, if the card type suggested by the terminal card can be determined according to the interface byte TB 3; then, if the terminal does not force the PPS process with the terminal card, the terminal already determines what kind of command needs to be sent to the terminal card, and directly executes step 407 without executing the PPS process.
Step 404, the PPS process is performed and the card type suggested by the terminal card is further verified.
In this embodiment, the PPS process is executed, and the card type suggested by the terminal card is further verified as follows:
A. the terminal sends a PPS request to the terminal card.
In this embodiment, the PPS request may include: and the clock rate conversion factor FI, the baud rate adjustment factor DI, the extra protection time N and other preset request parameters.
B. And the terminal card sends a PPS response corresponding to the PPS request to the terminal, and bytes used for indicating the preferred card type of the terminal suggested by the terminal card are preset in the PPS response.
In this embodiment, the PPS response may include a parameter consistent with the PPS request, and a format of the PPS response may be the same as a format of the PPS request.
The bytes preset in the PPS response for indicating the terminal card to suggest the card type preferred by the terminal may be: the terminal card is instructed to suggest a preferred card type for the terminal based on the PPS3 in the PPS response. For example, when the PPS3 is 01, the terminal card is indicated to suggest that the preferred card type of the terminal is a USIM card; the PPS3 is 10, indicating that the terminal card suggests that the preferred card type for the terminal is a SIM card.
C. And when the preferred card type is consistent with the suggested card type, further verifying the suggested card type of the terminal card.
In this embodiment, if the interface byte TB3 determines that the card type suggested by the terminal card is a USIM card, and if the PPS3 indicates that the preferred card type suggested by the terminal card is a USIM card in step B, the preferred card type is consistent with the suggested card type, and the card type suggested by the terminal card is further verified. In general, it does not happen that the preferred card type does not correspond to the proposed card type. Of course, if the preferred card type is not consistent with the proposed card type, the byte preset in the ATR may be used as the criterion for indicating the proposed card type of the terminal card, or the response parameter is preset as the criterion for indicating the preferred card type of the terminal, and the specific situation needs to be specifically analyzed and then executed according to the convention.
In this embodiment, if the PPS response is consistent with the parameters in the PPS request, the parameters in the PPS response may be expressed as follows:
FF 50 95 01 3B
wherein:
PPSS:FF;
PPS 0: 50 denotes PPS1 PPS3 exists, protocol type T-0;
PPS 1: 95 denotes the highest rate supported using the current terminal card;
PPS 3: 01 represents that the card type suggested by the terminal card is USIM card;
PCK:3B。
it can be seen that, according to the PPS3, it can also be known that the preferred card type of the terminal card proposed by the terminal card is a USIM card, and the card type proposed by the terminal card is further verified.
Step 405, judging whether the terminal enforces the PPS process with the terminal card or whether the existing preset condition for triggering the PPS process is met, if so, executing step 406, otherwise, executing the operation of identifying the type of the terminal card by a method of trial instruction in the prior art.
In this embodiment, generally, when the card type of the terminal card proposed by the terminal card is uncertain, for example, the card type of the terminal card proposed by the terminal card may be a USIM card, or a SIM card, or when the card type of the terminal card is not proposed by the terminal card, an operation of identifying the terminal card type by using a trial instruction method in the prior art is performed.
Step 406, executing a PPS process, determining a card type preset in the PPS process and used for indicating the terminal card to suggest a preferred terminal as the card type suggested by the terminal card, and executing step 407.
In this step, the above-mentioned executing the PPS process, and determining the card type preset in the PPS process and used for indicating the terminal card to suggest the terminal as the card type suggested by the terminal card may be:
step a is the same as step a, namely the terminal sends the PPS request to the terminal card.
And step B is the same as the step B, namely the terminal card sends the PPS response corresponding to the PPS request to the terminal, and bytes used for indicating the terminal card to suggest the preferred card type of the terminal are preset in the PPS response.
c. And determining the preferred card type as the card type suggested by the terminal card.
In this embodiment, when the preset byte cannot specifically determine the card type suggested by the terminal card, the PPS process may be executed to determine, in the case that the PPS process is successful, the card type preset in the PPS process and used for indicating that the terminal card suggests the terminal preferred by the terminal card as the card type suggested by the terminal card.
Step 407, sending the instruction corresponding to the proposed card type to the terminal card, and determining whether the information on the terminal card is the application information corresponding to the instruction, if so, executing step 408, otherwise, executing step 409.
In this embodiment, after determining the card type suggested by the terminal card, it cannot be accurately determined that the current card type of the terminal card is the suggested card type. It must be further determined by this step whether the card type suggested by the terminal card is finally the card type of the terminal card.
In this embodiment, if the card type suggested by the terminal card is a USIM card, then, in this step, a USIM instruction may be sent to determine whether the information on the terminal card is 3G application information, if so, step 408 is executed, otherwise, step 409 is executed.
Step 408, determining the proposed card type as the card type of the terminal card.
In this embodiment, if the information on the terminal card can be determined to be the 3G application information by sending the USIM instruction, it may be determined that the card type of the terminal card is the USIM card. In this embodiment, if the type of the instruction is USIM, the dual-mode terminal may also send a selection instruction to the terminal card to determine whether the EFdir exists, for example, when the selection instruction sent by the dual-mode terminal to the terminal card is 00 a 40804022F 00, the EFdir exists is indicated, otherwise, the EFdir does not exist.
Step 409, sending other UICC instructions except the above instruction to the terminal card, and determining the card type corresponding to the other UICC instruction as the card type of the terminal card when the information on the terminal card is the application information corresponding to the other UICC instruction.
If the card type suggested by the terminal card is the USIM card, when the USIM instruction is sent to determine whether the information on the terminal card is the 3G application information, if not, the embodiment may try to send another UICC such as an SIM instruction to determine whether the information on the terminal card is GSM-related document information, when the SIM instruction attempt fails, it is determined that the terminal card has an error, and when the SIM instruction attempt succeeds, it is determined that the card type of the terminal card is the SIM card.
Of course, if the card type suggested by the terminal card is the SIM card, the SIM instruction may be sent to determine whether the information on the terminal card is the GSM related file information, if so, the card type of the terminal card is determined to be the SIM card, otherwise, other application information, such as CDMA application, may be determined according to the capability of the dual-mode terminal.
Therefore, on the premise of ensuring compatibility with the existing card, the card type suggested by the terminal card is determined according to the bytes preset in the received ATR and used for indicating the card type suggested by the terminal card, so that the dual-mode terminal can directly obtain the card type supported by the terminal card without obtaining the card type supported by the terminal card in an attempt mode in the prior art, further, the risk of misjudgment can be reduced to the maximum extent, and extra burden can be reduced.
The following describes a device for identifying a dual-mode terminal card according to an embodiment of the present invention in detail.
Referring to fig. 5, fig. 5 is a block diagram of an apparatus for identifying a dual mode terminal card according to an embodiment of the present invention. In this embodiment, the device for identifying the dual-mode terminal card may be a terminal. As shown in fig. 5, the apparatus includes: a terminal card 501, a card type suggesting unit 502, and a card type determining unit 503.
The terminal card 501 is configured to carry bytes, which are preset to indicate the card type suggested by the terminal card, in the answer to reset ATR, and send the bytes to the card type suggestion unit 502.
The card type suggesting unit 502 is configured to, after receiving the reset response ATR, determine the card type suggested by the terminal card according to a preset byte indicating the card type suggested by the terminal card in the reset response ATR, and send a first determination notification to the card type determining unit 503.
The card type determining unit 503 is configured to send, after receiving the first determination notification, an instruction corresponding to the suggested card type to the terminal card, and determine, when the information on the terminal card is application information corresponding to the instruction, the suggested card type as the card type of the terminal card.
The apparatus may further include a judging unit 504 and a PPS requesting unit 505.
The determining unit 504 is configured to determine whether to force a PPS process with the terminal card when the card type suggested by the card type suggesting unit specifically determines the card type suggested by the terminal card, and if so, send a PPS notification to the PPS requesting unit 505.
The PPS requesting unit 505 is configured to send a PPS request to the terminal card 501 after receiving the PPS notification.
The terminal card 501 is configured to send, after receiving the PPS request, a PPS response corresponding to the PPS request to the card type suggestion unit 502, where bytes used to indicate the terminal card to suggest a preferred card type of the terminal are preset in the PPS response.
The card type suggesting unit 502 is configured to, after receiving the PPS response, further verify the card type suggested by the terminal card when the preferred card type is consistent with the suggested card type, and provide the further verified card type suggested by the terminal card to the card type determining unit 503.
The card type determining unit 503 is configured to send an instruction corresponding to the card type suggested by the terminal card for further verification to the terminal card, and determine the suggested card type as the card type of the terminal card when the information on the terminal card is the application information corresponding to the instruction.
The determining unit 504 is further configured to determine whether to enforce a PPS process with the terminal card when the card type suggested by the card type suggesting unit 502 does not specifically determine the card type suggested by the terminal card, and if so, send a PPS notification to the PPS requesting unit 505.
The PPS requesting unit 505 is configured to send a PPS request to the terminal card 501 after receiving the PPS notification.
The terminal card 501 is further configured to, after receiving the PPS request, send a PPS response corresponding to the PPS request to the card type suggesting unit 502, where bytes used for indicating the terminal card to suggest a card type preferred by the terminal are preset in the PPS response.
The card type suggesting unit 502 is further configured to determine the preferred card type as the card type suggested by the terminal card after receiving the PPS response, and send the determined card type suggested by the terminal card to the card type determining unit 503.
The card type determining unit 503 is configured to send an instruction corresponding to the card type suggested by the terminal card determined by the card type suggesting unit 502 to the terminal card 501, and determine the suggested card type as the card type of the terminal card when the information on the terminal card 501 is the application information corresponding to the instruction.
The determining unit 504 is further configured to determine whether a preset condition for triggering the PPS process is met when the card type suggested by the terminal card is not specifically determined by the card type suggesting unit 502, and if so, send a PPS notification to the PPS requesting unit 505; and judges whether the PPS response is consistent with the PPS request according to the judgment notice from the terminal card 501, and if so, indicates that the PPS process is successful, and sends a suggestion notice to the card type suggestion unit 502.
The PPS requesting unit 505 is configured to send a PPS request to the terminal card 501 after receiving the PPS notification.
The terminal card 501 is further configured to send a PPS response corresponding to the PPS request to the card type suggestion unit 502, preset a byte for indicating the terminal card to suggest a card type preferred by the terminal in the PPS response, and send a judgment notification to the judgment unit 504.
The card type suggesting unit 502 is further configured to determine the preferred card type as the card type suggested by the terminal card after receiving the suggestion notification.
The card type determining unit 503 is further configured to send an instruction corresponding to the preferred card type to the terminal card, and determine the suggested card type as the card type of the terminal card when the information on the terminal card is the application information corresponding to the instruction.
The judging unit 504 is further configured to send a second determination notification to the card type determining unit 503 when the information on the terminal card is not the application information corresponding to the instruction.
The card type determining unit 503 is further configured to try another UICC instruction except the instruction after receiving the second determination notification, and determine, when the information on the terminal card is application information corresponding to the another UICC instruction, a card type corresponding to the another UICC as a card type of the terminal card.
As can be seen from the foregoing embodiments, in the present embodiment, on the premise of ensuring compatibility with an existing card, the card type suggested by the terminal card is determined according to the byte preset in the received ATR and used for indicating the card type suggested by the terminal card, so that the dual-mode terminal may directly obtain the card type supported by the terminal card without obtaining the card type supported by the terminal card in an attempt manner in the prior art, and further, the risk of misjudgment can be reduced to the maximum extent, and an additional burden can also be reduced. In addition, in this embodiment, an instruction corresponding to the card type suggested by the terminal card is sent to the terminal card, and whether the information on the terminal card is the application information corresponding to the instruction is determined, if so, the card type suggested by the terminal card is determined as the card type of the terminal card, so that multiple attempts and possible misjudgments sent by the dual-mode terminal can be avoided, and further, the compatibility between the dual-mode terminal and the dual-mode terminal card is improved.
It should be understood that the above-mentioned embodiments are merely preferred embodiments of the present invention, and are not intended to limit the scope of the present invention, and any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the scope of the present invention.