SIM (Subscriber Identity Module) card chip, terminal, interface switching method, device and equipment

By reusing pins C3, C7, C4, and C8 in the SIM card chip to form an SPI interface, and setting pin C2 to OD output mode, the problem of low communication speed between the SIM card chip and the terminal is solved, and high-speed bidirectional communication is realized.

CN121509977APending Publication Date: 2026-02-10CHINA MOBILE M2M +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511745533.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-25
Publication Date
2026-02-10

AI Technical Summary

Technical Problem

The existing SIM card chip and terminal have low communication data transmission rates, mainly because the default interface and SWP interface are half-duplex or full-duplex single-line communication, resulting in insufficient transmission rates.

Method used

By reusing pins C3, C7, C4, and C8 to form an SPI interface, bidirectional communication between the SIM card chip and the terminal is achieved. Pin C2 is set to OD output mode to achieve bidirectional communication, and the interface is switched to SPI for high-speed communication.

Benefits of technology

It improves the communication and data transmission rate between the SIM card chip and the terminal, and realizes efficient data transmission for two-way communication.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121509977A_ABST
    Figure CN121509977A_ABST
Patent Text Reader

Abstract

The invention discloses an SIM (Subscriber Identity Module) card chip, a terminal, an interface switching method, an interface switching device and equipment. The SIM card chip comprises interface pins, and the interface pins comprise a C3 pin, a C4 pin, a C6 pin, a C7 pin and a C8 pin. And the C3 pin, the C4 pin, the C7 pin and the C8 pin are used for forming an SPI interface for bidirectional communication with the SPI interface of the terminal under the condition that the communication of the C6 pin is not influenced. According to the invention, the pin C3, the pin C7, the pin C4 and the pin C8 are multiplexed to form the SPI interface capable of two-way communication, and compared with a default interface which can only realize one-way communication, the communication data transmission rate of the SIM card chip and the terminal is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of Internet of Things (IoT), and particularly relates to a SIM card chip, terminal, interface switching method, device, and equipment. Background Technology

[0002] Currently, the communication interface of Subscriber Identity Module (SIM) card chips is an 8-pin package defined by the ISO 7816 standard. This means that the SIM chip includes eight pins, including pins C2, C3, C6, and C7. Among them, pins C2, C3, and C7 can form the 7816 interface, which is the default interface, while pin C6 can form the SWP interface.

[0003] However, the default interface communication transmission type is half-duplex, meaning it cannot simultaneously receive and send communication data. Even though pin C6 can receive and send communication data simultaneously, due to its structural design, it cannot be multiplexed by the default interface. Therefore, the data transmission rate between the SIM chip's default interface and the terminal's interface is low. Furthermore, although the SWP interface formed by pin C6 can simultaneously receive and send communication data, the SWP interface achieves bidirectional communication (full-duplex communication) on a single line. Therefore, the data transmission rate between the SIM chip's SWP interface and the terminal's interface is also low.

[0004] Therefore, in the existing technology, the communication data transmission rate between the default interface in the SIM chip card and the interface between the SWP interface and the terminal is not high. Summary of the Invention

[0005] This invention provides a SIM card chip, a terminal, an interface switching method, an apparatus, a device, a computer-readable storage medium, and a computer program product, which can improve the communication data transmission rate between the SIM card chip and the terminal.

[0006] In a first aspect, embodiments of the present invention provide a SIM card chip, comprising: The interface pins include pins C1, C2, C3, C4, C5, C6, C7, and C8. Pin C1 provides power to the SIM card. Pin C2 receives a reset signal from the terminal to the SIM card to start or restart it. Pin C3 receives a clock signal from the terminal to the SIM card. Pin C5 is grounded to form a stable power supply loop. Pins C3, C4, C7, and C8 form an SPI interface for bidirectional communication with the terminal's SPI interface without affecting the communication on pin C6. Pin C3 is used to receive the SCK signal sent by pin C3 of the terminal's SPI interface in the case of an SPI interface, for communication connection with pin C3 of the terminal's SPI interface. Pin C4 is used to receive the chip select signal sent by pin C4 of the terminal's SPI interface when the SPI interface is configured. Pin C6 is used to form an SWP interface for NFC communication with the terminal's SWP interface; Pin C7 is used to receive the MOSI signal transmitted in high-impedance mode from pin C7 of the terminal's SPI interface when forming an SPI interface, for communication connection with pin C7 of the terminal's SPI interface. Pin C8 is used to send data output signals to pin C8 of the terminal's SPI interface when forming an SPI interface.

[0007] In one feasible implementation, the interface pins also include a C2 pin, which is configured to switch the current communication type to a bidirectional communication type when the SPI interface is communicating with the terminal's SPI interface, so that the C2 pin of the SPI interface can send communication signals to the C2 pin of the terminal's SPI interface.

[0008] Secondly, embodiments of the present invention provide a terminal, including: The interface pins include pins C1, C2, C3, C4, C5, C6, C7, and C8. Pin C1 provides power to the SIM card. Pin C2 receives a reset signal from the terminal to the SIM card to start or restart it. Pin C3 receives a clock signal from the terminal to the SIM card. Pin C5 is grounded to form a stable power supply loop. Pins C3, C4, C7, and C8 form an SPI interface for bidirectional communication with the SIM card chip's SPI interface without affecting the communication on pin C6. Pin C3 is used to send an SCK signal to pin C3 of the SIM card chip's SPI interface in the case of an SPI interface to establish a communication connection with pin C3 of the SIM card chip's SPI interface. Pin C4 is used to send a chip select signal to pin C4 of the SPI interface of the SIM card chip when the SPI interface is configured. Pin C6 is used to form an SWP interface for NFC communication with the SWP interface of the SIM card chip; Pin C7 is used to send a MOSI signal based on high-impedance mode input to pin C7 of the SIM card chip's SPI interface in the case of an SPI interface, so as to establish a communication connection with pin C7 of the SIM card chip's SPI interface. Pin C8 is used to receive data output signals sent from pin C8 of the SPI interface of the SIM card chip when the SPI interface is configured.

[0009] In one feasible implementation, the C3 pin of the SPI interface is connected in series with a preset resistor for connection to the C3 pin of the SPI interface of the SIM card chip, and the C7 pin of the SPI interface is connected in series with a preset resistor for connection to the C7 pin of the SPI interface of the SIM card chip.

[0010] Thirdly, embodiments of the present invention provide an interface switching device for a SIM card chip applied in the first aspect, the device comprising: The receiving module is used to receive reset operation information sent by the terminal based on the interface pins; The sending module is used to send the configuration information stored in the chip to the terminal based on the reset operation information; The receiving module is also used to receive negotiation information sent by the terminal; The sending module is also used to send negotiation response information to the terminal; The switching module is used to switch the default interface for communication with the terminal to the SPI interface and to switch the communication protocol corresponding to the default interface to the communication protocol corresponding to the SPI interface. The SPI interface and the communication protocol corresponding to the SPI interface are used for bidirectional communication with the terminal.

[0011] Fourthly, embodiments of the present invention provide an interface switching device for a terminal applied in the second aspect, the device comprising: The transmitting module is used to send reset operation information to the SIM card chip based on the interface pins; The receiving module is used to receive and parse the configuration information sent by the SIM card chip to obtain the parsed information; The sending module is also used to send negotiation information to the SIM card chip when the parsed information includes an SPI interface, so as to switch the default interface of the SIM card chip and the communication protocol corresponding to the default interface. The receiving module is also used to receive negotiation response information sent by the SIM card chip; The switching module is used to switch the default interface for communicating with the SIM card chip to the SPI interface and the communication protocol corresponding to the default interface to the communication protocol corresponding to the SPI interface when a negotiation response is received. The SPI interface and the communication protocol corresponding to the SPI interface are used for bidirectional communication with the SIM card chip.

[0012] Fifthly, embodiments of this disclosure provide an apparatus, including any of the apparatuses in the first aspect.

[0013] In a sixth aspect, embodiments of this disclosure provide an apparatus that includes any one of the second aspects.

[0014] In a seventh aspect, embodiments of this disclosure provide an apparatus including a processor and a memory storing computer program instructions; the processor reads and executes the computer program instructions to implement an interface switching method as described in any of the third or fourth aspects.

[0015] Eighthly, embodiments of the present invention provide a computer-readable storage medium storing computer program instructions that, when executed by a processor, implement an interface switching method as described in the third or fourth aspect.

[0016] Ninthly, embodiments of this disclosure provide a computer-readable storage medium storing computer program instructions that, when executed by a processor, implement an interface switching method as described in the third or fourth aspect.

[0017] In a tenth aspect, embodiments of the present invention provide a computer program product, including a computer program that, when executed by a processor, implements an interface switching method as described in the third or fourth aspect.

[0018] This invention includes interface pins, specifically pins C3, C4, C6, C7, and C8. Pins C3, C4, C7, and C8 are used to form an SPI interface for bidirectional communication with the terminal's SPI interface without affecting the communication of pin C6. This invention improves the data transmission rate between the SIM card chip and the terminal by reusing pins C3 and C7 with pins C4 and C8 to form a bidirectional SPI interface, compared to the default unidirectional interface. Attached Figure Description

[0019] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments of the present invention will be briefly introduced below. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0020] Figure 1 This is a schematic diagram of the pinout of a SIM card chip provided in an embodiment of the present invention; Figure 2 This is a schematic diagram of a signal line for communication between a SIM card chip and a terminal, provided in an embodiment of the present invention. Figure 3 This is a flowchart illustrating an interface switching method provided in an embodiment of the present invention; Figure 4This is a flowchart illustrating a method for a SIM card chip to communicate with a terminal via the C2 pin, as provided in an embodiment of the present invention. Figure 5 This is a schematic diagram of the structure of an interface switching device provided in an embodiment of the present invention; Figure 6 This is a schematic diagram of another interface switching device provided in an embodiment of the present invention; Figure 7 This is a schematic diagram of the structure of an interface switching device provided in an embodiment of the present invention. Detailed Implementation

[0021] The features and exemplary embodiments of various aspects of the present invention will now be described in detail. To make the objectives, technical solutions, and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are merely intended to explain the present invention and not to limit the present invention. For those skilled in the art, the present invention can be practiced without some of these specific details. The following description of the embodiments is merely to provide a better understanding of the present invention by illustrating examples of the invention.

[0022] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus that includes the element.

[0023] Before describing the technical solutions provided by the embodiments of the present invention, in order to facilitate understanding of the embodiments of the present invention, the present invention will specifically explain the problems existing in the related technologies: Currently, SIM card chips (hereinafter referred to as SIM cards), whether IC cards or 2FF / 3FF / 4FF (i.e., Mini-SIM / Micro-SIM / Nano-SIM), all use an 8-pin package defined by the ISO7816 standard for their communication interface. Figure 1As shown, the SIM card includes eight pins: C1, C2, C3, C4, C5, C6, C7, and C8. Pin C1 is defined as the power supply voltage (VCC), used to provide power to the SIM card and is its energy source. Pin C2 is defined as the reset signal (RST), used to receive a reset signal sent by the terminal to the SIM card to start or restart the SIM card's communication process. Pin C3 is defined as the clock signal (CLK), used to receive a clock signal sent by the terminal to the SIM card, thereby synchronizing the data transmission rhythm between the SIM card and the terminal. Pin C4 is a reserved pin, not defined with a fixed function in the ISO 7816 standard, and can be extended for special functions. Pin C5 is defined as ground (GND), used to form a stable power supply loop, reduce circuit interference, and ensure the stability of the SIM card's operation. Pin C6 is defined as the programming voltage (VPP), used to program the programmable memory units within the SIM card. Pin C7 is defined as Input / Output, used for bidirectional data transmission between the SIM card and the terminal. Pin C8 is a spare pin; its function is not defined in the ISO 7816 standard, but it can be extended for special functions. The pin layout on the terminal corresponds one-to-one with the pins on the SIM card.

[0024] Among them, pins C2, C3, and C7 can form the default communication interface, namely the 7816 interface. This interface is a half-duplex communication interface. At the same time, the 7816 interface on the terminal or SIM card can only receive data or send data, not receive and send data simultaneously, which reduces the communication data transmission rate. Furthermore, the protocol overhead such as start bit, parity bit, stop bit, and switching direction included in each byte of data sent by the 7816 interface will further reduce the communication data transmission rate.

[0025] Pin C6 can form an SWP interface, which is a full-duplex interface. The SWP interface on the SIM card and the SWP interface on the terminal can connect for NFC communication. However, the SWP interface achieves full-duplex communication on a single pin's corresponding line. Compared to using multiple pins in a single interface to achieve full-duplex communication, the SWP interface's data transmission rate is still relatively low.

[0026] In summary, the 7816 interface and SWP interface used for communication between SIM cards and terminals in the existing technology have low communication data transmission rates, which cannot meet the high-speed data transmission requirements between SIM cards and terminals.

[0027] Therefore, there is an urgent need to expand the communication data transmission rate of SIM cards and terminals with a new interface, called the SPI interface. Due to the special design of the C6 pin, it cannot be multiplexed to form an SPI interface with other pins.

[0028] To address the problems of the prior art, embodiments of the present invention provide a SIM card chip, a terminal, an interface switching method, an apparatus, a device, a computer-readable storage medium, and a computer program product.

[0029] In this embodiment of the invention, without affecting the operation of the C6 pin, an SPI interface is formed by reusing the C3 and C7 pins and the reserved C4 and C8 pins. Since the SPI interface is a full-duplex communication type, this embodiment of the invention can improve the communication data transmission rate between the SIM card and the terminal.

[0030] In one embodiment, the SIM card chip includes interface pins, including pins C3, C4, C6, C7, and C8; pins C3, C4, C7, and C8 are used to form an SPI interface for bidirectional communication with the terminal's SPI interface without affecting the communication of pin C6. Pin C3 is used to receive the SCK signal sent by pin C3 of the terminal's SPI interface in the case of an SPI interface, for communication connection with pin C3 of the terminal's SPI interface. Pin C4 is used to receive the chip select signal sent by pin C4 of the terminal's SPI interface when the SPI interface is configured. Pin C6 is used to form an SWP interface for NFC communication with the terminal's SWP interface; Pin C7 is used to receive the MOSI signal transmitted in high-impedance mode from pin C7 of the terminal's SPI interface when forming an SPI interface, for communication connection with pin C7 of the terminal's SPI interface. Pin C8 is used to send data output signals to pin C8 of the terminal's SPI interface when forming an SPI interface.

[0031] This invention provides an SPI interface that enables bidirectional communication by reusing pins C3, C7, C4, and C8. Compared to the default interface which only allows unidirectional communication, this improves the data transmission rate between the SIM card chip and the terminal.

[0032] In one example, after the SIM card chip is extended to have an SPI interface, the definition and input type of each pin of the SIM card chip are shown in Table 1.

[0033] Table 1 The old definition (i.e., the old functional definition, the same below) of pin C1 is consistent with the new definition (i.e., the new functional definition, the same below), both being VCC, and the type is power supply. Pin C1 is used to connect to the positive power supply. The old definition of pin C2 is also consistent with the new definition, both being RST, and the type is input (indicating that pin C2 of the SIM card chip receives input signals, i.e., signals sent by pin C2 of the terminal). When forming a 7816 interface, pin C2 receives the 7816 interface reset signal sent by the terminal. The old definition of pin C3 is CLK, and after expanding to an SPI interface, it is newly defined as CLK / SCK, with the pin type being input. This indicates that when pin C3 forms a 7816 interface, it receives the input signal, i.e., the CLK clock signal sent by pin C3 of the terminal; or when pin C3 forms an SPI interface, it receives the input signal, i.e., the SCK clock signal sent by pin C3 of the terminal. The old definition of pin C4 is RFU, indicating a reserved pin. The new definition is (Chip Select, CS), indicating chip select. The C4 pin is of input type (indicating that when C4 forms an SPI interface, it receives the input signal, i.e., the chip select signal sent by the terminal's C4 pin). The old and new definitions of the C5 pin are the same, both being GND, and the C5 pin is of power supply type; it is used to connect to the negative power supply. The old and new definitions of the C6 pin are both SWP, and the C6 pin is of bidirectional type (indicating that the SIM card chip and the terminal can communicate bidirectionally via the SWP interface formed by the C6 pin). The old definition of the C7 pin was I / O; after being extended to an SPI interface, it is now defined as I / O / MOSI, and the pin type is bidirectional / input type (indicating that when C7 forms a 7816 interface, it sends or receives bidirectional data signals to or from the terminal's C7 pin; or when C7 forms an SPI interface, it receives the input signal, i.e., the data input signal sent by the terminal's C7 pin). Here, (Master Out Slave In, MOSI) indicates master transmit, slave receive. The old definition of the C8 pin was RFU, indicating a reserved pin. The new definition is (Master In Slave Out, MISO), which represents master-slave transmission and reception.

[0034] In one example, the signal lines for communication between the terminal and the SIM card are as follows: Figure 2As shown in the diagram. The terminal includes a baseband processor, a 7816 interface, an SPI interface, and an SWP interface. The SIM card includes a CPU, RAM, NVM, a 7816 interface, an SPI interface, and an SWP interface. Specifically, the terminal sends a VCC signal to the SIM card, obtaining the corresponding signal line. The terminal sends a CLK signal to the SIM card's 7816 interface via the 7816 interface, obtaining the corresponding signal line. The terminal sends I / O signals to the SIM card's 7816 interface via the 7816 interface, obtaining the corresponding signal line. The terminal sends an SCK signal to the SIM card's SPI interface via the SPI interface, obtaining the corresponding signal line. The terminal sends a MOSI signal to the SIM card's SPI interface via the SPI interface, obtaining the corresponding signal line. The terminal receives the MISO signal from the SIM card's SPI interface via the SPI interface, obtaining the corresponding signal line. The terminal sends a CS signal to the SIM card's SPI interface via the SPI interface, obtaining the corresponding signal line. The terminal sends and receives SWP signals from the SIM card's SPI interface via the SPI interface, thus obtaining the signal lines corresponding to the SWP signals. The terminal also sends a GND signal to the SIM card, obtaining the signal lines corresponding to the GND signal.

[0035] In one embodiment, the SIM card chip further includes a C2 pin, which is configured to switch the current communication type to a bidirectional communication type when the SPI interface communicates with the terminal's SPI interface, so that the C2 pin of the SPI interface can send communication signals to the C2 pin of the terminal's SPI interface.

[0036] This invention, by reusing the C2 pin and setting it to bidirectional communication type, enables the SIM card chip to actively send communication information to the terminal, thereby improving communication efficiency.

[0037] In one embodiment, the interface pins include pins C3, C4, C6, C7, and C8; pins C3, C4, C7, and C8 are used to form an SPI interface for bidirectional communication with the SPI interface of the SIM card chip without affecting the communication of pin C6. Pin C3 is used to send an SCK signal to pin C3 of the SIM card chip's SPI interface in the case of an SPI interface to establish a communication connection with pin C3 of the SIM card chip's SPI interface. Pin C4 is used to send a chip select signal to pin C4 of the SPI interface of the SIM card chip when the SPI interface is configured. Pin C6 is used to form an SWP interface for NFC communication with the SWP interface of the SIM card chip; Pin C7 is used to send a MOSI signal based on high-impedance mode input to pin C7 of the SIM card chip's SPI interface in the case of an SPI interface, so as to establish a communication connection with pin C7 of the SIM card chip's SPI interface. Pin C8 is used to receive data output signals sent from pin C8 of the SPI interface of the SIM card chip when the SPI interface is configured.

[0038] In one embodiment of the above embodiments, the C3 pin of the SPI interface is connected in series with a preset resistor to connect to the C3 pin of the SPI interface of the SIM card chip, and the C7 pin of the SPI interface is connected in series with a preset resistor to connect to the C7 pin of the SPI interface of the SIM card chip.

[0039] This invention provides an SPI interface that enables bidirectional communication by reusing pins C3, C7, C4, and C8. Compared to the default interface which only allows unidirectional communication, this improves the data transmission rate between the SIM card chip and the terminal.

[0040] It's important to note that on the SIM card chip side, both 7816-CLK (the CLK signal of the 7816 interface) and SPI-SCK (the SCK signal of the SPI interface) are input signals and can be directly connected. Furthermore, although 7816-I / O is a bidirectional signal, it operates in open-drain mode, while SPI-MOSI is an input (high-impedance mode), so they can also be directly connected. In other words, the two pairs of multiplexed signals on the SIM card side can be directly connected without complex software or hardware processing, making implementation easy.

[0041] On the terminal side, both 7816-CLK and SPI-SCK are output signals. Considering circuit safety, they cannot be directly connected due to the risk of a short circuit (one outputs a high level, the other a low level). Therefore, both are connected in series with a resistor (e.g., 1KΩ). Simultaneously, in the software, when switching from 7816 to SPI, the 7816-CLK pin is first configured from push-pull output to a high-impedance state, and after a slight delay of a few microseconds, SPI-SCK is configured from disabled (high-impedance) to enabled (push-pull output) to minimize the risk of a short circuit. Similar treatment is applied between 7816-I / O and SPI-MOSI, i.e., connected in series with a resistor, and the 7816 is turned off before the SPI is turned on.

[0042] It is understood that the above embodiments are examples of improving the underlying hardware of the SIM card chip and terminal to expand the SPI interface. In practical applications, the SIM card chip and terminal can only choose one interface mode for communication: the default interface or the SPI interface. To enable the SIM card chip and terminal to switch from the low-speed communication mode corresponding to the default interface to the high-speed communication mode corresponding to the SPI interface, this embodiment of the invention requires switching the default interface of the SIM card chip and terminal to the SPI interface for high-speed communication via a software protocol handshake.

[0043] Specifically, in one embodiment, such as Figure 3 As shown, the method for interface switching may include steps S101-S110.

[0044] S101: The terminal sends reset operation information to the SIM card chip based on the interface pin.

[0045] The reset operation information is a level control signal used to control the SIM card chip to return to its initial communication-ready state. The reset operation information includes cold reset and hot reset information. Cold reset information is used when the SIM card chip has been completely powered off and then powered on again, while hot reset information is used when the SIM card chip is continuously powered on.

[0046] In one embodiment, the terminal sends reset operation information to the corresponding interface pin of the SIM card chip based on the interface pin of the default interface.

[0047] In one embodiment of the above embodiments, the terminal powers on the C1 pin of the default interface of the SIM card chip through the C1 pin of the default interface, and then sends hot reset operation information to the C2 pin of the default interface of the SIM card chip through the C2 pin of the default interface.

[0048] In one embodiment of the above embodiments, the terminal sends hot reset operation information to the C2 pin of the default interface of the SIM card chip through the C2 pin of the default interface.

[0049] In one example, the terminal may include electronic devices such as mobile phones and tablets.

[0050] S102: The SIM card chip receives reset operation information sent by the terminal based on the interface pin.

[0051] In one embodiment, the SIM card chip receives reset operation information sent by the terminal through the interface pins of the default interface.

[0052] In one embodiment of the above embodiments, the SIM card chip receives reset operation information sent by the terminal through the C2 pin of the default interface.

[0053] S103: The SIM card chip sends the configuration information stored in the chip to the terminal based on the reset operation information.

[0054] The configuration information is the communication configuration information of the SIM card chip. The configuration information may include the communication protocols supported by the SIM card chip and the maximum baud rate configuration. The configuration information is sent in the form of an ATR byte sequence.

[0055] In one embodiment, upon receiving a reset operation message, the SIM card chip retrieves communication-related configuration information stored within the SIM card chip and sends the configuration information to the terminal in a preset format.

[0056] In one embodiment of the above embodiments, when the SIM card chip receives the reset operation information, it retrieves the communication-related configuration information stored inside the SIM card chip, including the communication protocols supported by the SIM card chip and the maximum baud rate configuration, and sends the configuration information to the terminal in the format of ATR byte sequence.

[0057] S104: The terminal receives and parses the configuration information sent by the SIM card chip to obtain the parsed information.

[0058] In one embodiment, after the terminal receives the configuration information sent by the SIM card chip through the receiving component, it parses the format in the configuration information through the parsing component to obtain the parsed information.

[0059] S105: When the terminal detects that the parsed information includes the SPI interface, it sends negotiation information to the SIM card chip to switch the default interface of the SIM card chip and the communication protocol corresponding to the default interface.

[0060] In one embodiment, the terminal detects whether the parsed information contains SPI interface information through a detection component. If the parsed information contains SPI interface information, the terminal sends negotiation information to the SIM card chip through the interface pin of the default interface to switch the default interface of the SIM card chip and the communication protocol corresponding to the default interface.

[0061] In one example, the negotiation information could be PPS negotiation information.

[0062] S106: Negotiation information sent by the SIM card chip receiving terminal.

[0063] In one embodiment, the SIM card chip receives negotiation information sent by the terminal through the interface pins of the default interface.

[0064] S107: The SIM card chip sends negotiation response information to the terminal.

[0065] In one embodiment, after receiving the negotiation information sent by the terminal, the SIM card chip sends a negotiation response to the terminal through the interface pins of the default interface.

[0066] S108: The terminal receives the negotiation response information sent by the SIM card chip.

[0067] In one embodiment, the terminal receives negotiation response information sent by the SIM card chip through the interface pins of the default interface.

[0068] S109: The SIM card chip will switch the default interface for communication with the terminal to the SPI interface and switch the communication protocol corresponding to the default interface to the communication protocol corresponding to the SPI interface.

[0069] The SPI interface and its corresponding communication protocol are used for bidirectional communication with the terminal.

[0070] In one embodiment, the SIM card chip switches the default interface for communication with the terminal to the SPI interface by reusing the interface pins in the default interface and combining them with the reserved interface pins, and switches the communication protocol corresponding to the default interface to the communication protocol corresponding to the SPI interface.

[0071] S110: Upon receiving the negotiation response information, the terminal switches the default interface for communicating with the SIM card chip to the SPI interface and switches the communication protocol corresponding to the default interface to the communication protocol corresponding to the SPI interface.

[0072] The SPI interface and its corresponding communication protocol are used for bidirectional communication with the SIM card chip.

[0073] In one embodiment, the terminal receives negotiation response information sent by the SIM card chip through the interface pins of the default interface. Upon receiving the negotiation response information, the terminal switches the default interface for communication with the SIM card chip to the SPI interface by reusing the interface pins in the default interface and combining them with the reserved interface pins. The terminal also switches the communication protocol corresponding to the default interface to the communication protocol corresponding to the SPI interface.

[0074] This invention enables bidirectional communication between the SIM card chip and the terminal by switching the default interface to the SPI interface and the communication protocol corresponding to the default interface to the communication protocol corresponding to the SPI interface, thereby improving the communication data transmission rate.

[0075] In one example, the process of switching the default interface between the terminal and the SIM card chip to the SPI interface can be divided into four steps. In the first step, the terminal performs a cold / warm reset on the SIM card. At this time, the SIM card chip's default communication mode is 7816, and the baud rate is configured as '11'. In the second step, the SIM card chip sends an ATR byte sequence (handshake negotiation information) to the terminal, reporting the communication protocol supported by the SIM card (T=0, T=14), the interface (7816, SPI), and the maximum SPI rate (e.g., 40MHz) or the maximum baud rate configuration of 7816 (e.g., 'DD'). In the third step, the terminal receives the ATR and parses it. If the SIM card chip supports the SPI interface, it negotiates the SPI interface, communication protocol, and parameters with the SIM card chip via PPS. In the fourth step, after completing the PPS negotiation, both the terminal and the SIM card chip simultaneously switch the interface and protocol according to the negotiation result. The interface switches from the 7816 interface (default interface) to the SPI interface, and the protocol switches from T=0 to T=14. Subsequently, both parties use the new interface and protocol for communication.

[0076] In the second step, the ATR indicates the interfaces supported by the SIM card chip via TA4: Bit 1 represents the 7816 interface, Bit 2 represents the SPI interface, Bit 3 represents the I2C interface, and Bit 4 represents the USB interface; the other bits are reserved. This invention sets Bit 1 and Bit 2 to 1 and the other bits to 0, indicating that this SIM card supports both the 7816 and SPI interfaces, and that the two interfaces share pins, allowing only one to be selected at a time. Additionally, TB4 indicates the maximum speed of the SPI interface, ranging from 0 to 255 MHz.

[0077] In the PPS negotiation process of the third step, bit 8 of PPS0 can be set to 1, with the lower 4 bits representing protocol T, and the value set to 14. The lower 4 bits of PPS1 represent the interface type to be switched, with values ​​from 0 to 3 representing 7816 interface, SPI interface, I2C interface, and USB interface respectively, and the higher 4 bits are reserved. PPS2 represents the maximum speed of the SPI interface, with a value range of 0 to 255, in MHz. Therefore, the PPS request is: FF-BE-01-28-68, indicating that it will switch to the SPI interface, with a maximum clock frequency of 40MHz, and using the T=14 protocol.

[0078] It's important to note that in current technology, the SIM card, as a passive component, can only wait for instructions from the terminal and cannot proactively report information to the terminal. For example, the terminal needs to poll the SIM card to know its current status. When the SIM card experiences an abnormal condition and wants to request a communication interruption, the terminal can only send an interruption request message to the SIM card after the SIM card sends a query message, ultimately terminating the communication. In summary, the SIM card lacks the ability to proactively communicate with the terminal.

[0079] To address the aforementioned technical problems, the SIM card chip in this embodiment of the invention further includes a C2 pin, as shown below. Figure 4 As shown, the interface switching method also includes S210-S220.

[0080] S210: Set the C2 pin to OD output mode to set the communication type of the C2 pin to bidirectional communication type, and obtain the target C2 pin.

[0081] The OD output mode is used for direct connection to the input pin.

[0082] In one embodiment, the SIM card chip reuses the C2 pin and sets the C2 pin to OD output mode to set the communication type of the C2 pin to bidirectional communication type, thereby obtaining the target C2 pin.

[0083] In one example, the C2 pin of the SIM card-side chip is set as a General Purpose Input / Output (GPIO), indicating SPI-IRQ output, configured in OD output mode, and internally directly connected to the 7816-RST signal. The C2 pin of the terminal-side chip is set as a GPIO, indicating SPI-IRQ input, configured in input mode, and for circuit safety, the terminal-side RST is set to OD output, also internally directly connected. This signal line is high when idle, and is pulled low when the terminal sends an RST signal or the SIM card sends an IRQ signal.

[0084] S220: Pulls down the signal line connecting the target C2 pin to the terminal's SPI interface C2 pin for communication, in order to send communication information to the terminal's SPI interface C2 pin.

[0085] Among these, the communication information can be an interruption request message.

[0086] In one embodiment, when the SIM card chip detects that it needs to send communication information to the C2 pin of the terminal's SPI interface, it pulls down the level of the signal line connecting the target C2 pin and the C2 pin of the terminal's SPI interface to achieve transmission.

[0087] This invention, by reusing the C2 pin and setting it to bidirectional communication type, enables the SIM card chip to actively send communication information to the terminal, thereby improving communication efficiency.

[0088] In one example, when the C2 pin of the SPI interface is multiplexed for the SIM card chip to send communication information to the terminal, the definition and input type of each pin of the SIM card chip are shown in Table 2.

[0089] Table 2 The old definition (i.e., the old functional definition, the same below) of pin C1 is consistent with the new definition (i.e., the new functional definition, the same below), both being VCC, and the type is power supply. Pin C1 is used to connect to the positive power supply. Pin C2 was previously defined as RST, and is now defined as RST / IRQ, and is of input / bidirectional type (meaning that pin C2 of the SIM card chip is input type when forming a 7816 interface, and bidirectional type when forming an SPI interface), where (Interrupt Request, IRQ) represents an interrupt request. Pin C3 was previously defined as CLK, and after being extended to an SPI interface, is now defined as CLK / SCK, and the pin type is input type. This means that when pin C3 forms a 7816 interface, it receives the input signal, i.e., the CLK clock signal sent by pin C3 of the terminal; or when pin C3 forms an SPI interface, it receives the input signal, i.e., the SCK clock signal sent by pin C3 of the terminal. Pin C4 was previously defined as RFU, representing a reserved pin. The new definition is (Chip Select, CS), representing chip select. The C4 pin is of input type (meaning that when C4 forms an SPI interface, it receives the input signal, i.e., the chip select signal sent by the terminal's C4 pin). The old and new definitions of the C5 pin are the same, both being GND, and the C5 pin is of power supply type; it is used to connect to the negative power supply. The old and new definitions of the C6 pin are both SWP, and the C6 pin is of bidirectional type (meaning that the SIM card chip and the terminal can communicate bidirectionally via the SWP interface formed by the C6 pin). The old definition of the C7 pin was I / O; after being expanded to an SPI interface, it is now defined as I / O / MOSI, and the pin type is bidirectional / input type (meaning that when C7 forms a 7816 interface, it sends or receives bidirectional data signals to or from the terminal's C7 pin; or when C7 forms an SPI interface, it receives the input signal, i.e., the data input signal sent by the terminal's C7 pin). The old definition of the C8 pin was RFU, indicating a reserved pin. The new definition is (Master In Slave Out, MISO), indicating master-slave transceiver.

[0090] In one embodiment, the duration for which the signal line connecting the target C2 pin of the SIM card chip to the C2 pin of the terminal's SPI interface is low is less than the duration for which the terminal pulls the signal line low.

[0091] Understandably, since both ends of the bidirectional signal line can output, there is a risk of signal collision. To solve this problem, the duration can be used to distinguish between them. The RST signal line is pulled low for a longer time, such as more than 5ms, while the IRQ signal line is pulled low for a shorter time, such as less than 100us. In addition, after the SIM card software pulls the IRQ signal line low to send an interrupt request and releases it, it checks the signal line again. If the signal line is still low, it means that a signal collision has occurred. In this case, the RST signal takes priority, and the SIM card reset operation is performed.

[0092] Figure 5 This is a schematic diagram of an apparatus 500 for an interface switching method for a SIM card chip, provided in an embodiment of the present invention. The apparatus 500 includes: The receiving module 501 is used to receive reset operation information sent by the terminal based on the interface pin; The sending module 502 is used to send the configuration information stored in the chip to the terminal based on the reset operation information; The receiving module 501 is also used to receive negotiation information sent by the terminal; The sending module 502 is also used to send negotiation response information to the terminal; The switching module 503 is used to switch the default interface for communication with the terminal to the SPI interface and to switch the communication protocol corresponding to the default interface to the communication protocol corresponding to the SPI interface. The SPI interface and the communication protocol corresponding to the SPI interface are used for bidirectional communication with the terminal.

[0093] This invention enables bidirectional communication between the SIM card chip and the terminal by switching the default interface to the SPI interface and the communication protocol corresponding to the default interface to the communication protocol corresponding to the SPI interface, thereby improving the communication data transmission rate.

[0094] In one embodiment, the device 500 includes a setting module, which is used to set the C2 pin to OD output mode to set the communication type of the C2 pin to bidirectional communication type, thereby obtaining the target C2 pin; Pull the signal line level low between the target C2 pin and the terminal's SPI interface C2 pin communication connection to send communication information to the terminal's SPI interface C2 pin.

[0095] In one embodiment, the duration for which the signal line connecting the target C2 pin of the SIM card chip to the C2 pin of the terminal's SPI interface is low is less than the duration for which the terminal pulls the signal line low.

[0096] Figure 6 This is a schematic diagram of an apparatus 600 for an interface switching method applied to a terminal, provided in an embodiment of the present invention. The apparatus 600 includes: The transmitting module 601 is used to send reset operation information to the SIM card chip based on the interface pins; The receiving module 602 is used to receive and parse the configuration information sent by the SIM card chip to obtain the parsed information; The sending module 601 is also used to send negotiation information to the SIM card chip when the parsed information includes an SPI interface, so as to switch the default interface of the SIM card chip and the communication protocol corresponding to the default interface. The receiving module 602 is also used to receive negotiation response information sent by the SIM card chip; The switching module 603 is used to switch the default interface for communicating with the SIM card chip to the SPI interface and the communication protocol corresponding to the default interface to the communication protocol corresponding to the SPI interface when receiving the negotiation response information. The SPI interface and the communication protocol corresponding to the SPI interface are used for bidirectional communication with the SIM card chip.

[0097] Figure 7 A schematic diagram of the hardware structure for interface switching provided in an embodiment of the present invention is shown.

[0098] The device for interface switching may include a processor 701 and a memory 702 storing computer program instructions.

[0099] Specifically, the processor 701 may include a central processing unit (CPU), an application specific integrated circuit (ASIC), or one or more integrated circuits that can be configured to implement the embodiments of the present invention.

[0100] Memory 702 may include mass storage for data or instructions. For example, and not limitingly, memory 702 may include a hard disk drive (HDD), floppy disk drive, flash memory, optical disk, magneto-optical disk, magnetic tape, or Universal Serial Bus (USB) drive, or a combination of two or more of these. Where appropriate, memory 702 may include removable or non-removable (or fixed) media. Where appropriate, memory 702 may be internal or external to the integrated gateway disaster recovery device. In a particular embodiment, memory 702 is non-volatile solid-state memory.

[0101] Memory 702 may include read-only memory (ROM), random access memory (RAM), disk storage media devices, optical storage media devices, flash memory devices, and electrical, optical, or other physical / tangible memory storage devices. Therefore, generally, memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to one aspect of this disclosure.

[0102] The processor 701 implements any of the interface switching methods described in the above embodiments by reading and executing computer program instructions stored in the memory 702.

[0103] In one example, the device for interface switching may also include a communication interface 703 and a bus 704. For example, Figure 7 As shown, the processor 701, memory 702, and communication interface 703 are connected through bus 704 and complete communication with each other.

[0104] The communication interface 703 is mainly used to realize communication between various modules, devices, units and / or equipment in the embodiments of the present invention.

[0105] Bus 704 includes hardware, software, or both, that couples components of an online data flow metering device together. For example, and not limitingly, the bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Extended Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a Hyper Transport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an Infinite Bandwidth Interconnect, a Low Pin Count (LPC) bus, a memory bus, a Microchannel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local (VLB) bus, or other suitable buses, or combinations of two or more of these. Where appropriate, bus 704 may include one or more buses. Although specific buses are described and illustrated in embodiments of the invention, the invention contemplates any suitable bus or interconnect. Additionally, in conjunction with the interface switching methods described in the above embodiments, embodiments of the invention also provide a computer storage medium for implementation. The computer storage medium stores computer program instructions; when these computer program instructions are executed by the processor, they implement any of the interface switching methods described in the above embodiments.

[0106] This invention also provides a computer program product, including a computer program, which, when executed by a processor, implements any of the interface switching methods described in the above embodiments. This invention also provides a vehicle, including a control device and a terminal, wherein the terminal is used to implement the interface switching methods described in the above embodiments, and the control device is used to implement the interface switching methods described in the above embodiments.

[0107] It should be clarified that the present invention is not limited to the specific configurations and processes described above and shown in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present invention is not limited to the specific steps described and shown. Those skilled in the art can make various changes, modifications, and additions, or change the order of steps, after understanding the spirit of the present invention.

[0108] The functional blocks shown in the above structural diagram can be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, they can be, for example, electronic circuits, application-specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, etc. When implemented in software, the elements of this invention are programs or code segments used to perform the required tasks. Programs or code segments can be stored on a machine-readable medium or transmitted over a transmission medium or communication link via data signals carried on a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, read-only memory (ROM), flash memory, erasable read-only memory (EROM), floppy disks, compact disc read-only memory (CD-ROM), optical disks, hard disks, fiber optic media, radio frequency (RF) links, etc. Code segments can be downloaded via computer networks such as the Internet, intranets, etc.

[0109] It should also be noted that the exemplary embodiments mentioned in this invention describe methods or systems based on a series of steps or apparatus. However, this invention is not limited to the order of the steps described above; that is, the steps can be performed in the order mentioned in the embodiments, or in a different order, or several steps can be performed simultaneously.

[0110] The aspects of this disclosure have been described above with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this disclosure. It should be understood that each block in the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that these instructions, executable via the processor of the computer or other programmable data processing apparatus, enable the implementation of the functions / actions specified in one or more blocks of the flowchart illustrations and / or block diagrams. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field-programmable logic circuit. It is also understood that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can also be implemented by special-purpose hardware performing the specified functions or actions, or can be implemented by a combination of special-purpose hardware and computer instructions.

[0111] The above are merely specific embodiments of the present invention. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, modules, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here. It should be understood that the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in the present invention, and these modifications or substitutions should all be covered within the protection scope of the present invention.

Claims

1. A SIM card chip, characterized in that, include: The interface pins include pins C1, C2, C3, C4, C5, C6, C7, and C8. Pin C1 provides power to the SIM card; pin C2 receives a reset signal from the terminal to the SIM card to start or restart it; pin C3 receives a clock signal from the terminal to the SIM card; pin C5 is grounded to form a stable power supply loop; pins C3, C4, C7, and C8 form an SPI interface for bidirectional communication with the terminal's SPI interface without affecting communication via pin C6. The C3 pin is used to receive the SCK signal sent by the C3 pin of the SPI interface of the terminal when the SPI interface is configured, so as to communicate with the C3 pin of the SPI interface of the terminal. The C4 pin is used to receive the chip select signal sent by the C4 pin of the SPI interface of the terminal when the SPI interface is configured. The C6 pin is used to form an SWP interface for NFC communication with the SWP interface of the terminal. The C7 pin is used to receive a MOSI signal transmitted in high-impedance mode by the C7 pin of the terminal's SPI interface when the SPI interface is configured, so as to establish a communication connection with the C7 pin of the terminal's SPI interface. The C8 pin is used to send a data output signal to the C8 pin of the SPI interface of the terminal when the SPI interface is configured.

2. The chip according to claim 1, characterized in that, The interface pins also include a C2 pin, which is used to set to OD output mode when the SPI interface communicates with the SPI interface of the terminal, so as to switch the current communication type to bidirectional communication type, so that the C2 pin of the SPI interface can send communication signals to the C2 pin of the SPI interface of the terminal.

3. A terminal, characterized in that, include: The interface pins include pins C1, C2, C3, C4, C5, C6, C7, and C8. Pin C1 provides power to the SIM card. Pin C2 receives a reset signal from the terminal to the SIM card to start or restart it. Pin C3 receives a clock signal from the terminal to the SIM card. Pin C5 is grounded to form a stable power supply loop. Pins C3, C4, C7, and C8 form an SPI interface for bidirectional communication with the SIM card chip's SPI interface without affecting the communication of pin C6. The C3 pin is used to send an SCK signal to the C3 pin of the SPI interface of the SIM card chip when the SPI interface is configured, so as to establish a communication connection with the C3 pin of the SPI interface of the SIM card chip. The C4 pin is used to send a chip select signal to the C4 pin of the SPI interface of the SIM card chip when the SPI interface is configured. The C6 pin is used to form an SWP interface for NFC communication with the SWP interface of the SIM card chip; The C7 pin is used to send a MOSI signal based on high-impedance mode input to the C7 pin of the SPI interface of the SIM card chip when the SPI interface is configured, so as to communicate with the C7 pin of the SPI interface of the SIM card chip. The C8 pin is used to receive the data output signal sent by the C8 pin of the SPI interface of the SIM card chip when the SPI interface is configured.

4. The terminal according to claim 3, characterized in that, The C3 pin of the SPI interface is connected in series with a preset resistor to connect to the C3 pin of the SPI interface of the SIM card chip, and the C7 pin of the SPI interface is connected in series with a preset resistor to connect to the C7 pin of the SPI interface of the SIM card chip.

5. An interface switching method applied to the SIM card chip of claim 1, characterized in that, The method includes: The system receives reset operation information sent by the terminal based on the interface pins. Based on the reset operation information, the configuration information stored in the chip is sent to the terminal; Receive negotiation information sent by the terminal; Send negotiation response information to the terminal; The default interface for communicating with the terminal is switched to the SPI interface, and the communication protocol corresponding to the default interface is switched to the communication protocol corresponding to the SPI interface. The SPI interface and the communication protocol corresponding to the SPI interface are used for bidirectional communication with the terminal.

6. The method according to claim 5, characterized in that, The SIM card chip also includes a C2 pin, and the method further includes: Set the C2 pin to OD output mode to set the communication type of the C2 pin to bidirectional communication type, thereby obtaining the target C2 pin; The signal line connecting the target C2 pin to the C2 pin of the terminal's SPI interface is lowered to send communication information to the C2 pin of the terminal's SPI interface.

7. The method according to claim 6, characterized in that, The duration for which the SIM card chip pulls the signal line low, which is connected to the C2 pin of the target C2 pin and the C2 pin of the terminal's SPI interface, is less than the duration for which the terminal pulls the signal line low.

8. An interface switching method applied to the terminal described in claim 3, characterized in that, The method includes: Send reset operation information to the SIM card chip based on the interface pins; The configuration information sent by the SIM card chip is received and parsed to obtain the parsed information; If the parsed information includes an SPI interface, negotiation information is sent to the SIM card chip to switch the default interface of the SIM card chip and the communication protocol corresponding to the default interface; Receive negotiation response information sent by the SIM card chip; Upon receiving the negotiation response information, the default interface for communicating with the SIM card chip is switched to the SPI interface, and the communication protocol corresponding to the default interface is switched to the communication protocol corresponding to the SPI interface. The SPI interface and the communication protocol corresponding to the SPI interface are used for bidirectional communication with the SIM card chip.

9. A device, characterized in that, The device includes the SIM card chip as described in any one of claims 1-2.

10. A device, characterized in that, The device includes the terminal as described in any one of claims 3-4.

11. An interface switching device applied to the SIM card chip of claim 1, characterized in that, The device includes: The receiving module is used to receive reset operation information sent by the terminal based on the interface pins; The sending module is used to send the configuration information stored in the chip to the terminal based on the reset operation information; The receiving module is also used to receive negotiation information sent by the terminal; The sending module is also used to send negotiation response information to the terminal; The switching module is used to switch the default interface for communication with the terminal to the SPI interface and to switch the communication protocol corresponding to the default interface to the communication protocol corresponding to the SPI interface. The SPI interface and the communication protocol corresponding to the SPI interface are used for bidirectional communication with the terminal.

12. An interface switching device applied to the terminal described in claim 3, characterized in that, The device includes: The transmitting module is used to send reset operation information to the SIM card chip based on the interface pins; The receiving module is used to receive and parse the configuration information sent by the SIM card chip to obtain parsed information; The sending module is further configured to send negotiation information to the SIM card chip when it detects that the parsed information includes an SPI interface, in order to switch the default interface of the SIM card chip and the communication protocol corresponding to the default interface; The receiving module is also used to receive negotiation response information sent by the SIM card chip; The switching module is used to switch the default interface for communicating with the SIM card chip to the SPI interface and switch the communication protocol corresponding to the default interface to the communication protocol corresponding to the SPI interface when the negotiation response information is received. The SPI interface and the communication protocol corresponding to the SPI interface are used for bidirectional communication with the SIM card chip.

13. A device, characterized in that, The device includes: a processor and a memory storing computer program instructions; the processor reads and executes the computer program instructions to implement the interface switching method as described in any one of claims 5-7 or claim 8.

14. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer program instructions that, when executed by a processor, implement the interface switching method as described in any one of claims 5-7 or claim 8.

15. A computer program product, characterized in that, It includes a computer program that, when executed by a processor, implements the interface switching method as described in any one of claims 5-7 or claim 8.