CN101478598B - Communication negotiation method for mobile terminal and smart card, mobile terminal therefor - Google Patents
Communication negotiation method for mobile terminal and smart card, mobile terminal therefor Download PDFInfo
- Publication number
- CN101478598B CN101478598B CN2009100039890A CN200910003989A CN101478598B CN 101478598 B CN101478598 B CN 101478598B CN 2009100039890 A CN2009100039890 A CN 2009100039890A CN 200910003989 A CN200910003989 A CN 200910003989A CN 101478598 B CN101478598 B CN 101478598B
- Authority
- CN
- China
- Prior art keywords
- smart card
- portable terminal
- voltage
- descriptor
- power
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W92/00—Interfaces specially adapted for wireless communication networks
- H04W92/04—Interfaces between hierarchically different network devices
- H04W92/08—Interfaces between hierarchically different network devices between user and terminal device
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Telephone Function (AREA)
- Power Sources (AREA)
Abstract
The invention discloses a communication negotiation method of a mobile terminal and a smart card and a mobile terminal, wherein the method comprises: the mobile terminal selects a supply voltage of the smart card, allocates parameters for the communication of the mobile terminal and the smart card by activating the smart card and communicates with the smart card. The invention avoids the low communication speed problem between the mobile terminal and the smart card in relative technologies, effectively improves the mobile terminal performance, the processing speed and the user experience by defining a voltage selection and interface activation.
Description
Technical field
The present invention relates to the communications field, and especially, relate to the communication negotiation method and the portable terminal of a kind of portable terminal and smart card.
Background technology
From early 1990s, smart card Germany by the success be applied to global system for mobile communications (Globle System for Mobile communication abbreviates GSM as) terminal after.At present; Smart card has been widely used in all kinds of mobile communications networks; For example, subscriber identification module (the User Identify Model that uses in code division multiple access (Code Division Multiple Access the abbreviates CDMA as) terminal equipment; Abbreviate UIM as) card, the usim card that uses in the 3G terminal equipment etc.
Usually; The smart card that is loaded in the mobile phone terminal (also can be described as subscriber identification module (Subscriber Identity Module; Abbreviate SIM as)) be mainly used in the identification and authentication, Speech Communication support, Short Message Service and the other kinds value-added service that realize user identity based on SIM kit (SIM Tool Kit abbreviates STK as).
Yet, for a long time, basic theory and system architecture since the integrated circuit of SIM and software engineering have been continued to use it always and be born.Along with development of wireless communication devices, theory that these are traditional and framework demand side to and solve increasing new problem.Under this background, based on present various demands, smart card has been endowed more data and has handled and memory function.
For smart card with large capacity, its interior storage capacity can reach the scale of tens (M) to several Gbyte.Along with the raising of memory space, correspondingly, also can improve requirement to message transmission rate; The transmission rate of 7816 traditional interfaces is usually at several kbps (kilo bits per second; Kbps) between the hundreds of Kbps, will need long time (for example, possibly need hundreds of second) with the file of this speed rates million (M) level size; If consider transport overhead and factor such as fault-tolerant, the time of transmission also will further prolong.Under the restriction of this transmission rate, will be difficult to carry out business such as mobile TV, mobile e-business, multimedia application.
2006 ETSI (ETSI) confirmed USB (Universal Serial Bus; Abbreviating USB as) interface is as Universal Integrated Circuit Card (Universal Integrated Circuit Card; Abbreviate UICC as) and the terminal between the standard high-speed interface; The full speed speed of USB 1.1 can reach 12Mbps, and the high speed of USB 2.0 then can reach 480Mbps.When improving transmission rate, variation has also taken place in the pin definitions of SIM, promptly; C4 links to each other with Data-with the Data+ of mobile terminal baseband processor chips respectively with the C8 pin, and for other pin, connected mode is: C1 connects power supply; C2 connects (RST) signal that resets, and C3 connects clock (CLK) signal, C5 ground connection (GND); C7 connects I/O (Input/Output abbreviates I/O as) signal.
Yet,, do not propose effectively to improve the scheme of data transmission bauds between smart card and the portable terminal at present as yet based on above-mentioned pin configuration.
Summary of the invention
Consider in the correlation technique the low problem of data transmission bauds between the smart card and portable terminal and make the present invention that for this reason, main purpose of the present invention is to provide the communication negotiation method and the portable terminal of a kind of portable terminal and smart card.
According to an aspect of the present invention, the communication negotiation method of a kind of portable terminal and smart card is provided, has been used for realizing communicating by letter between portable terminal and the portable terminal smart card based on USB interface.
Communication negotiation method according to portable terminal of the present invention and smart card comprises: portable terminal is selected the supply power voltage of smart card; Portable terminal disposes portable terminal and the required parameter of smart card communications through smart card is activated, and communicates with smart card.
Wherein, Portable terminal selects the processing of the supply power voltage of smart card to comprise: the terminal selects voltage that smart card is powered on voltage by low paramount order from a plurality of electric pressures successively; Reply or detect the USB interface power descriptor until receiving, and the voltage of selecting will detect the USB interface power descriptor time is as the supply power voltage of smart card from the replacement of smart card.
And, portable terminal receive reply from the replacement of smart card after, this method may further include: portable terminal judge reset reply whether effective; Be judged as under the situation not, portable terminal continues with current voltage smart card to be powered on, and is judging that invalid number of times reaches under the situation of pre-determined number, and portable terminal selects next electric pressure that smart card is powered on; Be judged as under the situation that is, portable terminal judges whether smart card supports the electric pressure of current selection, if support, then with the supply power voltage of current selected electric pressure as smart card; If do not support, then the portable terminal voltage of using the smart card support instead powers on to smart card; And, not under other situation of predetermined voltage level at current voltage level, then whether preferential the and smart card function whether needs predetermined voltage rank is supported of predetermined voltage rank is set according to smart card, confirm whether smart card adopts the predetermined voltage rank.
In addition, the processing of mobile terminal activating smart card can comprise: portable terminal is that smart card distributes the address; Portable terminal and smart card carry out power to be consulted, and confirms voltage and/or electric current that smart card is supported; Portable terminal is configured the descriptor of smart card.
Wherein, the processing that portable terminal and smart card carry out the power negotiation comprises: portable terminal sends to smart card and obtains the interface power request, to obtain voltage and/or the electric current that smart card is supported; And/or portable terminal sends to smart card the interface power request is set, and the voltage and/or the electric current of portable terminal support are notified to smart card.
And smart card distributes the address according to control transmission to smart card and carries out power with smart card and consult.
Preferably, the descriptor of smart card comprise following one of at least: device descriptor, configuration descriptor, interface descriptor, endpoint descriptor.
According to a further aspect in the invention, a kind of portable terminal is provided, has comprised being arranged at its inner smart card.
In portable terminal according to the present invention, can comprise: first data communication module, be used between portable terminal and smart card, carrying out exchanges data, realize the data communication of portable terminal and smart card; Voltage is selected module, is used to select the supply power voltage of smart card; The USB interface active module is used for through first data communication module smart card being activated, thus configuration portable terminal and the required parameter of smart card communications.
The smart card that is provided with in the above-mentioned terminal may further include: second data communication module, be used between portable terminal and smart card, carrying out exchanges data, and realize the data communication of smart card and portable terminal.
Wherein, the USB interface active module may further include: address assignment module, and the USB interface that is used to smart card distributes the address; The power negotiation module is used to realize the power negotiation of portable terminal and smart card; Configuration module is used for the descriptor of smart card is configured.
In addition, this portable terminal can further include: USB interface deexcitation module is used in the application that stops behind the sign off of portable terminal and smart card on all USB interfaces that operate in smart card.
By technique scheme of the present invention; Through having defined voltage selection, interface activation; Realized the high-speed communication between portable terminal and the smart card; Avoid in the correlation technique the low problem of traffic rate between the portable terminal and smart card, effectively improved the performance and the processing speed of portable terminal, improved user experience.
Description of drawings
Accompanying drawing described herein is used to provide further understanding of the present invention, constitutes the application's a part, and illustrative examples of the present invention and explanation thereof are used to explain the present invention, do not constitute improper qualification of the present invention.In the accompanying drawings:
Fig. 1 is the flow chart according to the communication negotiation method of the portable terminal of the inventive method embodiment and smart card;
Fig. 2 carries out the process chart that interface is selected according to the ATR that passes through in the communication negotiation method of the portable terminal of the inventive method embodiment and smart card;
Fig. 3 is the signaling process sketch according to the communication negotiation method of the portable terminal of the inventive method embodiment and smart card;
Fig. 4 utilizes control transmission to carry out the sketch map of the mode one of address assignment and power negotiation in the communication negotiation method according to the portable terminal of the inventive method embodiment and smart card;
Fig. 5 utilizes control transmission to carry out the sketch map of the mode two of address assignment and power negotiation in the communication negotiation method according to the portable terminal of the inventive method embodiment and smart card;
Fig. 6 is the flow chart according to descriptor configuration in the communication negotiation method of the portable terminal of the inventive method embodiment and smart card;
Fig. 7 is the flow chart of selecting according to voltage in the communication negotiation method of the portable terminal of the inventive method embodiment and smart card;
Fig. 8 criticizes according to portable terminal utilization in the communication negotiation method of the portable terminal of the inventive method embodiment and smart card to transmit the flow chart that communicates with smart card;
Fig. 9 is the block diagram according to the portable terminal of apparatus of the present invention embodiment;
Figure 10 is the block diagram according to the preferred structure instance of the portable terminal of apparatus of the present invention embodiment.
Embodiment
Functional overview
To the low problem of message transmission rate between smart card that exists in the correlation technique and the portable terminal; The present invention has defined voltage selection, interface selection, USB interface activation processing that smart card powers on and carries out between back portable terminal and the smart card; Thereby, thereby realized the efficient communication between smart card and the portable terminal for smart card distributes the descriptor of address, configurable smart card.
Scheme implementation of the present invention links to each other with Data-with the Data+ of mobile terminal baseband processor chips respectively with the C8 pin based on following pin connected mode: C4; For other pin, connected mode is: C1 connects power supply, and C2 connects (RST) signal that resets; C3 connects clock (CLK) signal; C5 ground connection (GND), C7 connects I/O (Input/Output abbreviates I/O as) signal.To describe embodiments of the invention in detail below.
Method embodiment
In the present embodiment, the communication negotiation method of a kind of portable terminal and smart card is provided, has been used for realizing communicating by letter between portable terminal and the portable terminal smart card based on USB interface.
As shown in Figure 1, comprise step S102 and step S104 according to the portable terminal of present embodiment and the communication negotiation method of smart card.
Concrete processing procedure shown in Fig. 1 is following:
Step S102, portable terminal is selected the supply power voltage of smart card; Usually the voltage level of supporting has three kinds: class A, 5V; Class B, 3V; Class C, 1.8V is that traditional 7816 interfaces or USB interface all possibly supported this three kinds of voltages.
Step S104, portable terminal disposes portable terminal and the required parameter (this parameter can comprise the address of USB interface, the power of smart card, the descriptor of smart card) of smart card communications through smart card is activated, and communicates with smart card.
Preferably; Because the smart card at a lot of terminals is not only supported USB interface, also supports 7816 interfaces simultaneously, and two interfaces can not concurrent executions business; Therefore; Before carrying out above-mentioned processing, selection that can also advanced line interface is selecting to carry out through USB execution in step S102 and step S104 under the situation of subsequent communications.And under the situation of having selected 7816 interfaces, then the voltage of execution in step S102 is selected, voltage select to accomplish the back portable terminal can be direct and smart card communicate.
Portable terminal can be accomplished interface with two kinds of methods and select; A kind of method is to reply (Answer To Reset with resetting; Abbreviate ATR as) process; Another kind method is the process with USB, and portable terminal both can only have been carried out a kind of in two kinds of methods, also can these two processes of concurrent asynchronously execution.
Fig. 2 shows and adopts the ATR process to carry out the handling process that interface is selected.As shown in Figure 2, at S201, portable terminal receives ATR at 7816 interfaces; At S202, portable terminal is analyzed ATR; At S203, according to the ATR analysis result being judged whether smart card supports USB interface,, then carry out S204 if do not support, continue work at 7816 interfaces; If smart card is supported USB interface, at S205, portable terminal will be initiated the protocol parameter of T=15 and selected (Protocol and Parameter Selection abbreviates PPS as), and PPS2 is set to " C0 "; At S206; After the successful PPS exchange, the clock of mobile terminal stopping on 7816 interfaces, the C7 (I/O) of intelligent holding 7816 interfaces switches to the IC-USB interface a high-impedance state.
In above-mentioned S205, in order to use the transmission parameter except default value, terminal and smart card should be supported the PPS process, that is, agreement and parameter selection course, PPS can be used for switching communication speed, switches communications protocol etc.Usually, first byte of PPS is ff, and whether the high nibble indication PPS0 of second byte, PPS1, PPS2 exist, and low nibble is used to represent the communications protocol of needs switching.If the PPS of machine, card is consistent, then consult successfully, and subsequent communications just can use new agreement, cannot carry out PPS once more.
T=15 defines in smart card is issued the ATR at terminal; If the indication of the respective byte among ATR T=15 then representes to comprise among this ATR Global Interface bytes, only in ATR, comprise Global Interface bytes; The time, the PPS process of back just comprises PPS2.
For PPS2; The terminal is according to value of feature selecting of its support, and its coded system is identical with the coded system of the Global Interface bytes (ETSI TS 102.221 6.3 joint definition) of ATR, when being encoded to " C0 "; The time, support USB interface between expression smart card and the terminal.
On the other hand, it is following to carry out the processing procedure that interface selects with the USB process: begin from power on, portable terminal just will activate the pull down resistor on C4 and the C8 pin; Smart card is kept watch on the signal on C4 and the C8; If C4 and C8 pin status remain state L (low) 10ms at least, smart card adheres to (attachment) process with continuing so, will draw the C4 pin into H (height); When C8 becomes when high simultaneously, attaching process will finish; Be detected if USB adheres to, portable terminal will drive USB and reset, and will then carry out following USB interface and activate; If do not detect, promptly the C4 state is not H (height), and USB adheres to failure so, and 7816 interfaces will be activated in the terminal.
In addition, in above-mentioned steps S104, the processing of mobile terminal activating smart card can specifically comprise: portable terminal is that smart card distributes the address; Portable terminal and smart card carry out power to be consulted, and confirms voltage and/or electric current that smart card is supported; Portable terminal is configured the descriptor of smart card.
After above-mentioned finishing dealing with, the application on the smart card just can have been carried out smoothly, and can realize based on the result of above-mentioned configuration between portable terminal and the smart card at a high speed, communicate by letter reliably.After the sign off between portable terminal and smart card, portable terminal can carry out the USB interface deexcitation, goes up the application of operation (activity) with stop intelligent card (USB).
Fig. 3 is the signaling process sketch according to the communication negotiation method of the portable terminal of present embodiment and smart card.
As shown in Figure 3, specifically can comprise following processing:
Portable terminal carries out the voltage selection, interface is selected;
Smart card is carried out the activation of USB interface; Specifically comprise: (each USB interface of main frame corresponds respectively to an address to the USB address assignment; This address is used for smart card and extraneous communicating by letter, and can identify a smart card uniquely), USB power consults, the USB interface configuration;
Portable terminal and smart card carry out data communication;
At last, portable terminal carries out the USB interface deexcitation to smart card.
Wherein, portable terminal and smart card carry out the processing that power consults and can comprise:
Portable terminal sends to smart card and obtains the interface power request, to obtain voltage and/or the electric current (this voltage can be that voltage level selects to handle the voltage of confirming before) that smart card is supported; (this step is an optional step)
Portable terminal (to before through after obtaining data that the interface power request obtains and carrying out analysis and evaluation) send to smart card the interface power request be set; Voltage that portable terminal is supported and/or electric current (this voltage can be before voltage level select to handle the voltage of confirming; The main purpose of this step is that electric current is notified to smart card; And this electric current can be a lowest high-current value) notify and give smart card.
Wherein, it is optional step that portable terminal sends the step of obtaining the interface power request to smart card, and portable terminal can directly send to smart card the notice that the interface power request is carried out voltage/current is set
Preferably, the communication mode of negotiation of the power of portable terminal and smart card and address assignment exists a variety of, will be that example is described the processing of smart card being carried out address assignment and power negotiation below with the control transmission.
Can distribute the address and carry out power negotiation and address assignment smart card according to control transmission (Control Transfer) with smart card.
In the present embodiment, control transmission is used for transmitting control command, status poll and confirms order.Control transmission mainly comprises SETUP, DATA and STATUS three phases, and wherein, the DATA stage is the optional stage; And; The situation of Get Interface Power Request (obtaining the interface power request) can adopt the above-mentioned three phases of control transmission, that is, and and processing as shown in Figure 4; Directly send Set Address (address is set), SetInterface Power Request (the interface power request is set) request situation then can adopt the processing in SETUP and two stages of STATUS, that is, and processing as shown in Figure 5.In Fig. 4 and each stage shown in Figure 5, SETUP bag, DATA0, ACK, IN, DATA1, OUT are the packet of set form, and in USB 2.0 standards, have made detailed definition, and this paper is not described in detail.
As shown in Figure 4; This processing mode is applicable to that portable terminal sends the at first situation of GetInterface Power Request to smart card, wherein, and at first in the SETUP stage; Portable terminal is initiated the SETUP bag; Initiating with DATA0 afterwards is initial data (DATA0 can follow the back data of Get Interface Power Request command format), and smart card is responded ACK, once finishes alternately;
In the DATA stage, portable terminal is initiated first IN bag earlier, and smart card initiation afterwards is initial data (DATA1 can follow the back voltage level of smart card etc.) with DATA1, and last portable terminal is responded ACK and finished once mutual; If data this moment end of transmission not then can be proceeded the transmission of data in the DATA stage, the process of transmission is similar with the process of transmission for the first time;
In the STATUS stage, similarly, portable terminal is at first initiated first OUT bag, and portable terminal initiation afterwards is initial empty data (0 length) with DATA1, and last portable terminal is responded ACK, once finishes alternately.
As shown in Figure 5; Do not having the DATA stage, only comprising under the SETUP and the situation in two stages of STATUS; At first be in the SETUP stage, portable terminal is initiated the SETUP bag earlier, and initiating with DATA0 afterwards is initial data (DATA0 can follow the back data of SetAddress or Set Interface Power Request command format); Smart card is responded ACK, once finishes alternately;
Next, in the STATUS stage, portable terminal is initiated first IN bag earlier, and smart card initiation afterwards is initial empty data (0 length) with DATA1, and last portable terminal is responded ACK, once finishes alternately.
Through control type transmission, accomplished the work that is provided with that USB interface activates relevant parameter, next step can carry out formal data communication.
Portable terminal just can be known the USB smart card for information about after smart card is configured, and comes interaction data according to these information, and then executive communication.
Preferably, the exchanges data between portable terminal and the smart card can be accomplished through batch transmission (bulktransfer) or control transmission.Wherein, criticize the transmission that transmission can be used for realizing chunk data between portable terminal and the USB smart card.
The most basic form of usb communication is through end points, and the USB end points can only transmit data toward a direction.
Under batch transmission means, need to adopt three end points, wherein, end points 0 is used for the transmission of control information for the control end points; End points 1 is configured to the Bulk-In end points, and smart card can send the data to portable terminal through end points 1, mainly comprise the response application protocol Data Unit (Application Protocol Data Unit, APDU); End points 2 is configured to the Bulk-Out end points, is used to deposit the data that portable terminal is issued smart card, mainly comprises order APDU.
Interface configuration shown in Figure 3 specifically is exactly to the descriptor configuration of (being used to represent the relevant information of USB smart card).The purpose of carrying out the descriptor configuration processing is that each equipment can have one or more configuration (Configuration), and these configurations are used for the function of define equipment.If certain equipment has several kinds of different functions, then each function all needs a configuration.Here, configuration is the set of interface (interface), which hardware and the USB swap data of interface in can designated equipment.The hardware of each and USB swap data just is called an end points (endpoint).Therefore, interface is the set of end points.Default configuration, interface and end points that equipment in the device type definition of USB (USB Device Class Definitions) definition certain kinds or the subclass need provide.
The USB smart card is exactly the set of an end points for portable terminal, and portable terminal can only communicate through end points and USB smart card.In fact each end points is exactly a certain size a data buffer zone, and each end points all has unique address, and this is provided by device address and endpoint number.Each end points all has certain characteristic, wherein can comprise: the heap(ed) capacity of transmission means, bus access frequency, bandwidth, endpoint number, packet etc.Except that end points 0, other end points must just can come into force after equipment disposition.
Portable terminal is understood the USB smart card for information about through descriptor uniquely; Set up communication according to these information; Descriptor (descriptor) has been described the general information of equipment, configuration, interface or end points, has stipulated the employed agreement of USB smart card, end points situation etc.In the present invention, the descriptor of configuration comprise following one of at least: the configuration of device descriptor (Device Descriptor), configuration descriptor (Configuration Descriptor), interface descriptor (Interface Descriptor) and endpoint descriptor (Endpoint Descriptor).
Fig. 6 shows the handling process that descriptor is configured (setting).
As shown in Figure 6, when carrying out descriptor configuration, specifically may further comprise the steps:
Step S601 is provided with device descriptor;
Step S602 is provided with configuration descriptor;
Step S603 is provided with interface descriptor;
Step S604 is provided with the breakpoint descriptor.
In the appendix A of concrete field ETSI TS102.600 in ISO/IEC 7816-12 of each descriptor of configuration clear and definite regulation has been arranged; Interface descriptor has been specified interface protocol (for example, bulk or control transfer), and interface descriptor (has for example been formulated port simultaneously; Be bulk-in end points or bulk-out end points etc.); Endpoint descriptor has defined the further information of end points, for example, and the maximum data packet size that can transmit etc.
In addition, in step S102 shown in Figure 1, portable terminal selects the processing of the supply power voltage of smart card specifically can comprise:
The terminal selects voltage that smart card is powered on voltage by low paramount order from a plurality of electric pressures successively; The USB interface power descriptor is replied or is detected in effective replacement until receiving from smart card, and the voltage of selecting will detect the USB interface power descriptor time is as the supply power voltage of smart card.
Portable terminal receive reply from the replacement of smart card after, can judge resets reply whether effective;
Be judged as under the situation not, portable terminal continues with current voltage smart card to be powered on, and is judging that invalid number of times reaches under the situation of pre-determined number (for example, 3 times), and portable terminal selects next electric pressure that smart card is powered on;
Be judged as under the situation that is; Portable terminal judges whether smart card supports the electric pressure of current selection (can send the voltage level that Get Interface PowerRequest order obtains the current support of smart card to smart card through portable terminal); If support, then with the supply power voltage of current selected electric pressure as smart card; If do not support, then the portable terminal voltage of using the smart card support instead powers on to smart card; And; When current voltage level is not that the predetermined voltage rank (is generally class B; In the time of 3V); Then whether the function whether predetermined voltage rank preferential (" class B activation preferred ") and smart card need the predetermined voltage rank to support is set, confirms whether smart card adopts the predetermined voltage rank according to smart card.
To combine Fig. 7 to describe the processing procedure that voltage is selected in detail below.
As shown in Figure 7, select processing may further comprise the steps according to the voltage of present embodiment:
S701, portable terminal initially power on to smart card with minimum voltage level; At S702,, then carry out S703 if do not detect smart card or do not receive ATR (Answer To Reset); If receive ATR, or a USB interface power descriptor be retrieved, then carry out S704;
S703, portable terminal should give the smart card power down and with next higher level other, the voltage also supported of portable terminal comes to power on to smart card, and returns and carry out S702;
S704, the content (the USB interface power descriptor of analyzing ATR or retrieving) of reception should be analyzed in the terminal, and carries out S705;
S705 judges whether this ATR (or USB interface power descriptor) is effective ATR (or effective USB interface power descriptor); If then carry out S706; Otherwise carry out S708;
S706 judges whether smart card supports present voltage, if be not judged as not, then carries out S707, if judged result is for being then the processing procedure end;
S707 is not if the voltage level that the terminal is used is supported by smart card that the terminal makes the smart card power down and powers on the voltage level of smart card indication, and carries out S709;
S708, if ATR or USB interface power descriptor are invalid, the same voltage level of used for mobile terminal is carried out this process at least 3 times, that is, return S702 and repeat 3 times, if S703 is then carried out in 3 all failures;
S709 judges whether present voltage is Class B voltage level, if be judged as is, then processing finishes, otherwise carries out S710;
S710 judges that whether smart card is provided with " Class B activationpreferred " by sign, be then carry out S711 if be judged as, otherwise processing finishes;
S711 judges whether portable terminal needs function only available under Class B (that is, the function that whether needs Class B to support), is then carry out S712, otherwise processing to finish if be judged as;
S712, portable terminal will finish the session of having set up under the current voltage level, and attempt to power on to smart card again with class B voltage,, return S702 that is.
In the communication process of portable terminal and smart card, the modes such as batch transmission (bulk transfer), control transmission that can adopt alternately of data are carried out, and will be transmitted as the communication process that example is described portable terminal and smart card to criticize below.
Fig. 8 is the process chart according in the method for present embodiment batch of transmission.As shown in Figure 8, specifically comprise following processing procedure:
S801 reads interrupt register;
At S802, judge whether it is that port 0 interrupts, if then carry out S803, otherwise carry out S804;
S803 handles the USB standard request, is used for the transmission of control information, and carries out S804;
S804 judges whether it is that port one interrupts, if then carry out S805, otherwise carry out S806;
S805 treatments B ulk-In port request, thus submiting command processing response data are sent to portable terminal, and carry out S806;
S806 judges whether it is that port 2 interrupts, if then carry out S807, otherwise carry out S808;
S807, treatments B ulk-Out port request realizing the parsing of command word and to preserve from the portable terminal data sent, and is carried out S808;
S808 removes interrupt register, and returns S801.
At last, after portable terminal and smart card were accomplished data communication, before the power supply of closing smart card, portable terminal should stop all application that operate in the activity on the USB interface.
Through above processing, can realize the high-speed data communication between USB interface-based portable terminal and the smart card, effectively improve the performance and the treatment effeciency at terminal.
Device embodiment
In the present embodiment; A kind of portable terminal is provided; Comprise and be arranged at its inner smart card; This smart card is for supporting the smart card (also can be the smart card of supporting 7816 interfaces and USB interface simultaneously) of USB interface, and the C4 of its socket links to each other with Data-with the Data+ of mobile terminal baseband processor chips respectively with the C8 pin.
As shown in Figure 9, comprise according to the portable terminal 1 of present embodiment: first data communication module 11, voltage are selected module 12, USB interface active module 13, smart card 14.
The function of each module is following among Fig. 9
First data communication module 11 is used between portable terminal and smart card, carrying out exchanges data, realizes the data communication (comprise the activation of USB interface and activate communicating by letter between the portable terminal and smart card afterwards) of portable terminal and smart card;
Voltage is selected module 12, is connected to first data communication module 11, is used for selecting through first data communication module 11 supply power voltage of smart card, and the process that voltage is selected can be referring to Fig. 7;
USB interface active module 13 is used for activating through 11 pairs of smart cards of first data communication module, thus configuration portable terminal and the required parameter of smart card communications;
Smart card 14 is used to carry out the various application on it, and further comprises: second data communication module 141, be used between portable terminal and smart card, carrying out exchanges data, and realize the data communication of smart card and portable terminal.
Figure 10 is the block diagram according to the preferred structure of the portable terminal of present embodiment.Shown in figure 10, on the basis of structure shown in Figure 9, Figure 10 further shows the structure of USB interface active module.Shown in figure 10, USB interface active module 13 further comprises address assignment module 131, power negotiation module 132 and configuration module 133.
Address assignment module 131, the USB interface that is used to smart card distributes the address;
Power negotiation module 132 is used to realize the power negotiation of portable terminal and smart card;
The processing of USB interface active module 13 shown in can execution graph 4 to 6 described before its process, no longer repeats here.
And shown in figure 10, portable terminal can further include:
USB interface deexcitation module 15 is connected to first data communication module 11, is used in the application that stops behind the sign off of portable terminal and smart card on all USB interfaces that operate in smart card; Interface is selected module 16, is connected to first data communication module 11, is used to select the interface (comprising USB interface, 7816 interfaces etc.) of current use on the portable terminal, and its selection course can be referring to Fig. 2.
Through above-mentioned portable terminal, can realize smart card communications at a high speed, effectively improve the performance and the user experience at terminal.
In sum; By means of technique scheme of the present invention; Activate (comprising processing such as address assignment, power negotiation, descriptor configuration) through having defined voltage selection, interface, realized the high-speed communication between portable terminal and the smart card, avoided in the correlation technique the low problem of traffic rate between the portable terminal and smart card; Effectively improve the performance and the processing speed of portable terminal, improved user experience.
Obviously, it is apparent to those skilled in the art that above-mentioned each module of the present invention or each step can realize with the general calculation device; They can concentrate on the single calculation element; Perhaps be distributed on the network that a plurality of calculation element forms, alternatively, they can be realized with the executable program code of calculation element; Thereby; Can they be stored in the storage device and carry out, perhaps they are made into each integrated circuit modules respectively, perhaps a plurality of modules in them or step are made into the single integrated circuit module and realize by calculation element.Like this, the present invention is not restricted to any specific hardware and software combination.
The above is merely the preferred embodiments of the present invention, is not limited to the present invention, and for a person skilled in the art, the present invention can have various changes and variation.All within spirit of the present invention and principle, any modification of being done, be equal to replacement, improvement etc., all should be included within protection scope of the present invention.
Claims (9)
1. the communication negotiation method of portable terminal and smart card is used for realizing communicating by letter between said portable terminal and the said portable terminal smart card based on USB interface, it is characterized in that said method comprises:
Said portable terminal is selected the supply power voltage of said smart card; Comprise: said terminal selects voltage that said smart card is powered on voltage by low paramount order from a plurality of electric pressures successively; Reply or detect the USB interface power descriptor until receiving, and the voltage of selecting will detect the USB interface power descriptor time is as the supply power voltage of said smart card from the replacement of said smart card;
Said portable terminal disposes said portable terminal and the required parameter of said smart card communications through said smart card is activated, and communicates with said smart card.
2. method according to claim 1 is characterized in that, said portable terminal receive reply from the said replacement of said smart card after, further comprise:
Said portable terminal judges whether effective said replacement replys;
Be judged as under the situation not, said portable terminal continues with current voltage said smart card to be powered on, and is judging that invalid number of times reaches under the situation of pre-determined number, and said portable terminal selects next electric pressure that said smart card is powered on;
Be judged as under the situation that is, said portable terminal judges whether said smart card supports the electric pressure of current selection, if support, then with the supply power voltage of current selected electric pressure as said smart card; If do not support, then the portable terminal voltage of using the smart card support instead powers on to smart card; And; At current voltage level is not under other situation of predetermined voltage level; Then whether preferential the and said smart card the function whether said predetermined voltage rank of needs is supported of predetermined voltage rank is set, confirms whether said smart card adopts said predetermined voltage rank according to said smart card.
3. method according to claim 1 is characterized in that, the processing of the said smart card of said mobile terminal activating comprises:
Said portable terminal is that said smart card distributes the address;
Said portable terminal and said smart card carry out power to be consulted, and confirms voltage and/or electric current that said smart card is supported;
Said portable terminal is configured the descriptor of said smart card.
4. method according to claim 3 is characterized in that, the processing that said portable terminal and said smart card carry out the power negotiation comprises:
Said portable terminal sends to said smart card and obtains the interface power request, to obtain voltage and/or the electric current that said smart card is supported; And/or
Said portable terminal sends to said smart card the interface power request is set, and the voltage and/or the electric current of said portable terminal support are notified to said smart card.
5. method according to claim 3 is characterized in that, said smart card distributes said address according to control transmission to said smart card and carries out said power with said smart card and consult.
6. method according to claim 3 is characterized in that, the descriptor of said smart card comprise following one of at least: device descriptor, configuration descriptor, interface descriptor, endpoint descriptor.
7. a portable terminal comprises being arranged at its inner smart card, it is characterized in that said portable terminal further comprises:
First data communication module is used between said portable terminal and smart card, carrying out exchanges data, realizes the data communication of said portable terminal and said smart card;
Voltage is selected module; Be used to select the supply power voltage of said smart card; Comprise: said terminal selects voltage that said smart card is powered on voltage by low paramount order from a plurality of electric pressures successively; Reply or detect the USB interface power descriptor until receiving, and the voltage of selecting will detect the USB interface power descriptor time is as the supply power voltage of said smart card from the replacement of said smart card;
The USB interface active module is used for through said first data communication module said smart card being activated, thereby disposes said portable terminal and the required parameter of said smart card communications;
Said smart card further comprises:
Second data communication module is used between said portable terminal and smart card, carrying out exchanges data, realizes the data communication of said smart card and said portable terminal.
8. portable terminal according to claim 7 is characterized in that, said USB interface active module further comprises:
Address assignment module, the USB interface that is used to said smart card distributes the address;
The power negotiation module is used to realize the power negotiation of said portable terminal and said smart card;
Configuration module is used for the descriptor of said smart card is configured.
9. portable terminal according to claim 7 is characterized in that, said portable terminal further comprises:
USB interface deexcitation module is used in the application that stops behind the sign off of said portable terminal and said smart card on all USB interfaces that operate in said smart card.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2009100039890A CN101478598B (en) | 2009-01-23 | 2009-01-23 | Communication negotiation method for mobile terminal and smart card, mobile terminal therefor |
PCT/CN2009/073333 WO2010083679A1 (en) | 2009-01-23 | 2009-08-18 | Method for communication and negotiation between a mobile terminal and a smart card and mobile terminal thereof |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2009100039890A CN101478598B (en) | 2009-01-23 | 2009-01-23 | Communication negotiation method for mobile terminal and smart card, mobile terminal therefor |
Publications (2)
Publication Number | Publication Date |
---|---|
CN101478598A CN101478598A (en) | 2009-07-08 |
CN101478598B true CN101478598B (en) | 2012-04-04 |
Family
ID=40839226
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN2009100039890A Expired - Fee Related CN101478598B (en) | 2009-01-23 | 2009-01-23 | Communication negotiation method for mobile terminal and smart card, mobile terminal therefor |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN101478598B (en) |
WO (1) | WO2010083679A1 (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109150390A (en) * | 2018-06-05 | 2019-01-04 | 捷德(中国)信息科技有限公司 | A kind of embedded-type security element based on SPI communication interface |
Families Citing this family (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101478598B (en) * | 2009-01-23 | 2012-04-04 | 中兴通讯股份有限公司 | Communication negotiation method for mobile terminal and smart card, mobile terminal therefor |
ES2553876T3 (en) | 2011-09-16 | 2015-12-14 | Huawei Device Co., Ltd. | File read / write method and mobile terminal |
CN103325408A (en) * | 2012-03-21 | 2013-09-25 | 亮发科技股份有限公司 | Intelligent power supply adjustment method and device |
CN105677420B (en) * | 2016-01-08 | 2020-01-31 | 深圳前海达闼云端智能科技有限公司 | interface pin configuration method and device |
CN111708722A (en) * | 2020-07-09 | 2020-09-25 | 飞鱼网络技术(武汉)有限公司 | USB terminal equipment |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101009898A (en) * | 2007-01-25 | 2007-08-01 | 凤凰微电子(中国)有限公司 | The handset supporting the novel smart card |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6883715B1 (en) * | 2000-10-11 | 2005-04-26 | Stmicroelectronics, Inc. | Multi-mode smart card, system and associated methods |
CN101068416A (en) * | 2007-06-08 | 2007-11-07 | 北京恒宝信息技术有限公司 | Method and device used for multi-mode smart card operating system |
CN101478598B (en) * | 2009-01-23 | 2012-04-04 | 中兴通讯股份有限公司 | Communication negotiation method for mobile terminal and smart card, mobile terminal therefor |
-
2009
- 2009-01-23 CN CN2009100039890A patent/CN101478598B/en not_active Expired - Fee Related
- 2009-08-18 WO PCT/CN2009/073333 patent/WO2010083679A1/en active Application Filing
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101009898A (en) * | 2007-01-25 | 2007-08-01 | 凤凰微电子(中国)有限公司 | The handset supporting the novel smart card |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109150390A (en) * | 2018-06-05 | 2019-01-04 | 捷德(中国)信息科技有限公司 | A kind of embedded-type security element based on SPI communication interface |
Also Published As
Publication number | Publication date |
---|---|
WO2010083679A1 (en) | 2010-07-29 |
CN101478598A (en) | 2009-07-08 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN101478598B (en) | Communication negotiation method for mobile terminal and smart card, mobile terminal therefor | |
JP5123857B2 (en) | NFC reader with passive mode of operation with low power consumption | |
CN1917387B (en) | Secure nfc apparatus and method for supporting various security modules | |
US20050224588A1 (en) | Transmission interface | |
CN101719054B (en) | Method and device for realizing multi-card slot access | |
CN101765830A (en) | Method for processing application commands from physical channels using a portable electronic device and corresponding device and system | |
CN105263140A (en) | System and method for realizing remote authentication of subscriber identity module (SIM) card | |
KR101911755B1 (en) | Method and system of communicating personal health data in a near field communication environment | |
US20140082247A1 (en) | Method for the Data Exchange Between a Terminal and a Chip Card | |
EP2563091A1 (en) | Wireless internet-accessing module, host, communication method thereof, and data card | |
CN101859395A (en) | Information transmission realization method and system, main control equipment and intelligent card | |
CN103414497B (en) | For communication between electronic by the control method forwarded and corresponding equipment | |
JP3689242B2 (en) | Method for adapting the functionality of a subscriber identification module to one or more interfaces of a mobile terminal for wireless communication, and corresponding subscriber identification module and mobile terminal | |
CN102402744A (en) | Data processing method and system for mobile equipment and mobile equipment | |
JP2017532631A (en) | Mobile payment method and apparatus, and short-range wireless communication device | |
CN101800987B (en) | Intelligent card authentication device and method | |
KR101673833B1 (en) | Double-mode and double-standby mobile terminal and communication method thereof | |
CN108901015A (en) | Terminal communicating method, terminal and storage medium | |
CN103580726B (en) | User identification card, Bluetooth device and method for accessing user identification card | |
CN101561894B (en) | Smart card and method for determining communication speed of second controller | |
CN101868049B (en) | Communication methods for host and wireless Internet access module and host communication module | |
CN104703291A (en) | MiFi-based communication method and relevant MiFi | |
CN101605322B (en) | Method and device for terminal processing of air personalized services | |
CN101316416B (en) | Two-card two-standby mobile phone chip communication system and communication method | |
CN105553607A (en) | Effective data transmission of wireless SIM card transmission protocol |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20120404 Termination date: 20180123 |