Summary of the invention
In view of this, a fundamental purpose of the present invention is to provide a kind of method and system of transporting information of smart card module, improves the smart card module transfer rate, makes things convenient for the user to use the high speed large-data operation.
For achieving the above object, the invention provides a kind of method of transporting information of smart card module, the high speed data transfer bus is set on smart card module in advance, this method also comprises:
According to the command information that receives from the transmission of peripheral control unit module, if determine the command information that receives from the high speed data transfer bus, perhaps, carry the identification information of high speed data transfer in the command information that receives, by the high speed data transfer bus transfer command response message that is provided with.
The command information that described basis receives from the transmission of peripheral control unit module, determine the command information that receives and specifically comprise from the high speed data transfer bus:
Between smart card module and controller module, control line is set;
Controller module judges whether the current command information needs to carry out high speed data transfer, if desired, the control line state is set for effective;
Controller module sends command information by the high speed data transfer bus;
Smart card module monitors the control line state for effectively, receives command information from the high speed data transfer bus.
Described step by the high speed data transfer bus transfer command response message that is provided with specifically comprises:
Smart card module is to controller module return command response message;
After the return command response message, controller module judges whether next command information needs to carry out high speed data transfer, if desired, then continues to send described next command information by the high speed data transfer bus; Smart card module receives described next command information, by the command response message of next command information correspondence of high speed data transfer bus transfer.
Described method further comprises:
Controller module determines not need to carry out high speed data transfer, upgrades the control line state, and it is invalid that the control line state is set.
The command information that described basis receives from the transmission of peripheral control unit module, determine the command information that receives and specifically comprise from the high speed data transfer bus:
The mode of operation register of sign smart card module interface transmission mode is set in smart card module;
Controller module judges whether to carry out high speed data transfer, if desired, is provided with to be designated in the mode of operation register of smart card module and adopts the high speed data transfer bus to transmit;
Controller module sends command information by the high speed data transfer bus to smart card module;
Smart card module reads in the mode of operation register and identifies, and determines to be designated and adopts the high speed data transfer bus to transmit, and receives command information by the high speed data transfer bus, and by high speed data transfer bus return command response message.
Described method further comprises:
Controller module is determined not need to carry out high speed data transfer, is provided with to be designated in the mode of operation register of smart card module to adopt smart card host-host protocol bus to transmit.
The command information that described basis receives from the transmission of peripheral control unit module, determine the identification information that carries high speed data transfer in the command information that receives and specifically comprise:
In the order of smart card host-host protocol definition, increase the order of using the high speed data transfer bus and the default transport bus that smart card module is set;
Controller module judges whether to carry out high speed data transfer, if desired, sends the command information that comprises the high speed data transfer identification information to smart card module by the default transport bus;
Smart card module receives the command information that comprises the high speed data transfer identification information, switches to the high speed data transfer bus.
Described high speed data transfer bus comprises a kind of or combination in any in parallel bus, UART Universal Asynchronous Receiver Transmitter bus, serial expansion IC bus, serial peripheral equipment interface bus and the controller local area network's bus.
A kind of system of transporting information of smart card module comprises controller module and smart card module, and controller module links to each other by smart card host-host protocol bus with smart card module, and described controller module also links to each other by the high speed data transfer bus with smart card module,
Controller module is used for definite command information and need carries out high speed data transfer, sends command information by high speed data bus to smart card module, perhaps, carries the identification information of high speed data transfer in command information;
Smart card module, be used for according to the command information that receives, if determine the command information that receives from the high speed data transfer bus, perhaps, carry the identification information of high speed data transfer in the command information that receives, by high speed data transfer bus transfer command response message.
Described controller module further links to each other by control line with smart card module,
Controller module is used to judge whether the current command information needs to carry out high speed data transfer, if desired, the control line state is set sends command information by the high speed data transfer bus to described smart card module after effectively;
Smart card module is used to monitor the control line state for effectively, receives command information from the high speed data transfer bus.
As seen from the above technical solutions, the method and system of a kind of transporting information of smart card module provided by the invention, by the high speed data transfer bus is set on smart card module with expansion smart card module interface, smart card module receives the command information that sends from the peripheral control unit module, receive the identification information that command information or command information comprise high speed data transfer if determine from the high speed data transfer bus, by the high speed data transfer bus transfer command response message that is provided with, thereby improved the smart card module transfer rate, made things convenient for the user to use the high speed large-data operation, help the expansion of user's use and new business, also expanded the application of smart card module simultaneously.Further, controller module can control information be transmitted between smart card host-host protocol bus and the high speed data transfer bus and switches, and has adapted to the different demands of user.
Embodiment
For making the purpose, technical solutions and advantages of the present invention clearer, the present invention is described in further detail below in conjunction with the accompanying drawings and the specific embodiments.
The method and system of transporting information of smart card module provided by the invention, by on smart card module, increasing the high speed data transfer bus, controller module is by the operation of the total line traffic control smart card module of high speed data transfer, make that the transfer rate of command response message reaches the supported maximal value of controller module on the smart card module, thereby improved the smart card module transfer rate.
Because in existing intelligent memory card inside, smart card module exists with the form of nude film (die), and the controller module of outside is not defined fixed interface, thereby, can realize high-speed transfer to the interface of controller module by expansion.Promptly before smart card module is encapsulated as the form of intelligent memory card, increase the high speed data transfer bus interface, by the high speed data transfer bus to be connected with controller module.
The high speed data transfer bus can be: parallel bus, UART Universal Asynchronous Receiver Transmitter (UART, UniversalAsynchronous Receiver Transmitter) bus, serial expansion integrated circuit (I
2C, Inter-Integrated circuit) bus, Serial Peripheral Interface (SPI, Serial PeripheralInterface) the bus, (CAN of controller local area network, Controller Area Network) bus etc. specifically adopts the high speed data transfer bus of which kind of type to depend on the controller module that is connected with smart card module.For instance, if controller module is supported the UART bus, then adopt the UART bus interface to connect controller module and smart card module; If controller module is supported spi bus and parallel bus, then adopt spi bus or parallel bus interface to connect controller module and smart card module.
Fig. 2 is the method flow synoptic diagram of transporting information of smart card module of the present invention, and referring to Fig. 2, this flow process comprises:
Step 201 is provided with the high speed data transfer bus in advance on smart card module;
In this step, expand the smart card module interface in advance: connecting smart card module interface and controller module by the high speed data transfer bus that is provided with, the smart card module interface of expansion is followed the high speed data transfer agreement, can be to realize by changing existing smart card host-host protocol standard, also can be directly to use the high speed data transfer agreement to realize.
Step 202, according to the command information that receives from the transmission of peripheral control unit module, if determine the command information that receives from the high speed data transfer bus, perhaps, carry the identification information of high speed data transfer in the command information that receives, by the high speed data transfer bus transfer command response message that is provided with.
In this step, according to business the requirement of transfer rate is determined whether to adopt high speed data transfer bus transfer information by controller module, the business of, small data quantity not high for transmission rate request, can adopt smart card host-host protocol bus transfer information, and for the business of transmission rate request height, big data quantity, then adopt high speed data transfer bus transfer information, after controller module determines to adopt high speed data transfer bus transfer information, by switching the mode of bus, make smart card module pass through high speed data transfer bus transfer command response message.Smart card module receives command information, determine to receive the identification information that command information or command information comprise high speed data transfer from the high speed data transfer bus, handle by application program, on respective bus, carry out information transmission by transport layer again with controller module.The flow process of information transmission and the operating process of existing smart card module are similar, do not repeat them here.
So far, this flow process finishes.
After smart card module is provided with the high speed data transfer bus, between smart card module and controller module, there are smart card host-host protocol bus and high speed data transfer bus, in the process of communication, for the not high business of transmission rate request, can adopt smart card host-host protocol bus transfer information, and for the high business of transmission rate request, then adopt high speed data transfer bus transfer information, thereby, need relate to information transmission and between smart card host-host protocol bus and high speed data transfer bus, switch, the present invention proposes three kinds of switching modes: hardware controls signal indication switching mode, mode of operation register identification switching mode, and order control switching mode.
Fig. 3 is hardware controls signal indication switching mode schematic flow sheet of the present invention, and referring to Fig. 3, this flow process comprises:
Step 301 is expanded the smart card module interface in advance, between the smart card module Interface and Controler module of expansion high speed data transfer bus and control line is set;
In this step, the smart card module interface of expansion is followed the high speed data transfer agreement, control line connects controller module and smart card module, the signal of control line is controlled by controller module, adopt one-way transmission mode, export smart card module to by controller module, smart card module is in receiving end Monitoring and Controlling line states.
The high speed data transfer bus that is provided with can be parallel bus, UART bus, I
2C bus, spi bus, CAN bus etc., the bus type that the controller module that specifically adopts the high speed data transfer bus of which kind of type to depend on to be connected with smart card module is supported.
Step 302, controller module judge whether to carry out high speed data transfer, if desired, the control line state are set for effective;
In this step, the control line state that sets in advance is invalid, adopts existing smart card host-host protocol bus to carry out information transmission between smart card module and the controller module.Controller module determines whether to adopt high speed data transfer bus transfer information according to business to the requirement of transfer rate, the business of, small data quantity not high for transmission rate request, determine to adopt smart card host-host protocol bus transfer information, it is invalid that the control line state then is set, and controller module and smart card module carry out transmission of Information according to existing procedure by smart card host-host protocol bus; For the business of transmission rate request height, big data quantity, then determine to adopt high speed data transfer bus transfer information, the control line state is set for effective.
In the practical application, the state that control line is set can be to realize by the high and low level signal that control line is set, and when not needing to carry out high speed data transfer, is provided with that signal level is a low level on the control line, and it is invalid to identify; And when needs carry out high speed data transfer, being provided with that signal level is a high level on the control line, sign is effectively.Certainly, also can be to realize by alternate manner, for example, it is invalid for effective, high level sign control line state that low level sign control line state is set.
In the present embodiment, controller module also can be provided with the control line state of acquiescence for effectively, promptly no matter whether need to carry out high speed data transfer, all adopt high speed data transfer bus transfer information, the control line state is set for effectively,, reduces the transmission time to improve transfer rate.
Step 303, controller module sends command information by high speed data transfer bus or smart card host-host protocol bus;
In this step, controller module is determined to adopt the data transmission bus of which kind of type to carry out information transmission, then sends command information on corresponding data transmission bus.
It is effective or invalid that step 304, smart card module monitor the control line state, receives command information from the respective data transfer bus, carries out corresponding the processing according to command information;
In this step, smart card module Monitoring and Controlling line level signal if the control line state is invalid, is passed through smart card host-host protocol bus transfer command response message according to existing procedure; If the control line state is effectively, then receives command information, and pass through this high speed data transfer bus to controller module return command response message from high speed data transfer bus or smart card host-host protocol bus.
In the practical application, smart card module was further judged when control line keeps sign high speed data transfer bus effective before the return command response message, is given controller module by the high speed data transfer bus return command response message of selecting.
Step 305, controller module are finished with behind smart card module mutual, upgrade the control line state.
In this step, controller module receives the command response message that smart card sends, and also needs follow-up data interaction operation if controller module is judged, then continues to carry out data interaction with the bus of selecting, until finishing alternately.That is,, then continue the retentive control line states, carry out high speed data transfer, send next command information by the high speed data transfer bus for effectively if determine that next command information also needs to carry out high speed data transfer; Smart card module receives next command information, by the command response message of next command information correspondence of high speed data transfer bus transfer; If determine that next command information does not need to carry out high speed data transfer, it is invalid that the control line state is set, controller module control line state be set to invalid after, controller module and smart card module carry out transmission of Information by smart card host-host protocol bus, this transfer process and existing procedure are similar, do not repeat them here.
Fig. 4 is a mode of operation register identification switching mode schematic flow sheet of the present invention, and referring to Fig. 4, this flow process comprises:
Step 401 is expanded the smart card module interface in advance, between the smart card module Interface and Controler module of expansion the high speed data transfer bus is set and the mode of operation register that identifies smart card module interface transmission mode is set in smart card module;
In this step, mode of operation register-stored smart card module transmission mode sign, be that smart card module is to adopt smart card host-host protocol bus to carry out the sign of information transmission or the sign that employing high speed data transfer bus is carried out information transmission, can give tacit consent to smart card module and adopt smart card host-host protocol bus to carry out information transmission.
Step 402, controller module judge whether to carry out high speed data transfer, if desired, are provided with to be designated in the mode of operation register and adopt the high speed data transfer bus to transmit;
In this step, controller module determines whether to adopt high speed data transfer bus transfer information according to business to the requirement and the business datum amount of transfer rate, if transmission rate request is not high, the business datum amount is less, then handles by existing procedure; If transmission rate request height, business datum amount are big, then sending to be provided with to be designated in the mode of operation register to smart card module by high speed data transfer bus or smart card host-host protocol bus adopts the high speed data transfer bus to carry out the configuration information of information transmission, smart card module receives and is provided with in the mode of operation register and identifies, and returns to controller module response message is set.
Comprise successful information be set if response message is set, then follow-up in, controller module adopts the high speed data transfer bus to carry out information transmission.
Comprise failure information be set if response message is set, then follow-up in, controller module adopts smart card host-host protocol bus to carry out information transmission.
In the practical application, can for example, adopt smart card host-host protocol bus to carry out information transmission with a bit identification smart card module transmission mode with " 0 " sign; Adopt the high speed data transfer bus to carry out information transmission with " 1 " sign.Certainly, for adopting multiple high speed data transfer bus to carry out the smart card module of information transmission, can carry out respective identification by increasing mode of operation register bit position.
Step 403, controller module sends command information to smart card module;
In this step, controller module can send command information by high speed data transfer bus or smart card host-host protocol bus.
Step 404, smart card module reads in the mode of operation register and identifies, and determines to be designated and adopts the high speed data transfer bus to transmit, and receives command information by the high speed data transfer bus, and, carry out data transmission by high speed data transfer bus return command response message;
In this step, after controller module is received replying of smart card,, then continue to carry out data interaction, until finishing alternately with the bus of selecting if also need follow-up data interaction operation.
Step 405, controller module are finished with behind smart card module mutual, upgrade in the smart card module mode of operation register identifying.
In this step, controller module receives the command response message that smart card module sends, judge whether next command information needs to carry out high speed data transfer,, then re-execute step 403 if the data that need to transmit need adopt the high speed data transfer bus to transmit next time; If the data that need to transmit do not need to adopt the high speed data transfer bus to transmit next time, or, do not have data to transmit, then adopt smart card host-host protocol bus to carry out information transmission by being designated in the smart card module mode of operation register with being provided with alternately of smart card module.
Fig. 5 is order control switching mode schematic flow sheet of the present invention, and referring to Fig. 5, this flow process comprises:
Step 501, expand the smart card module interface in advance: between the smart card module Interface and Controler module of expansion, the high speed data transfer bus is set, and in the order of smart card host-host protocol definition, increase the order of using the high speed data transfer bus and the default transport bus that smart card module is set;
In this step, the smart card module default transport bus of setting can be a smart card host-host protocol bus, also can be the high speed data transfer bus.In the present embodiment, the smart card module default transport bus of setting is a smart card host-host protocol bus.
Step 502, controller module judge whether to carry out high speed data transfer, if desired, send the command information that comprises the high speed data transfer identification information to smart card module;
In this step, controller module judges whether to carry out high speed data transfer, if do not need, carries out information transmission by smart card host-host protocol bus; If desired, controller module can send the command information that comprises the high speed data transfer identification information by the default data transfer bus.In the present embodiment, controller module sends the command information that comprises the high speed data transfer identification information by smart card host-host protocol bus.
Step 503, smart card module receives the command information that comprises the high speed data transfer identification information, by high speed data transfer bus return command response message, carries out data transmission;
This step is similar with step 404.
Step 504, controller module are finished with behind smart card module mutual, upgrade the smart card module transmission mode by order.
In this step, controller module is finished with behind smart card module mutual, and judge needs the data transmitted next time, adopts the high speed data transfer bus to transmit if desired, then continues to carry out data transmission by the high speed data transfer bus; If the data that need to transmit do not need to adopt the high speed data transfer bus to transmit next time, or, do not need to carry out data transmission, then send to smart card module and return smart card module default transport bus line command by the high speed data transfer bus, smart card module receives and returns smart card module default transport bus line command, reuses smart card module default transport bus and carries out data transmission.
In the above-mentioned example, be to describe handoff procedure with the data phase unit of being treated to, can certainly be unit or be that handoff procedure is described by unit with order or response separately with order and response, with hardware controls signal indication switching mode is example, being provided with of control line can be provided with before a data processing, no longer switches in whole data handling procedure; Also can order-reply right front and back to be switched at each; Can also before and after the transmission of ordering at every turn, replying, switch.Mode of operation register identification switching mode and order control switching mode are similar therewith.Do not repeat them here.
In the practical application, can be that switching mode applied in any combination is in any way controlled in hardware controls signal indication switching mode, mode of operation register identification switching mode and order.
Below be example with the smart card module that is connected with safe digital card (SD, the Secure Digital Card) condition receiving card of interface, the method and system of transporting information of smart card module of the present invention are further described.
Smart card module is packaged in the intelligent memory card sheet with the form of die, the parallel bus of smart card module interface setting of expansion is connected with 8 common I/O lines that the SD controller module has respectively, and status signal lines is set is used to switch the smart card module transfer bus.
Fig. 6 uses the schematic flow sheet of parallel port bus transfer smart card module information for the present invention, and referring to Fig. 6, this flow process comprises:
Step 601, expand the smart card module interface in advance: between the smart card module Interface and Controler module of expansion, the high speed data transfer bus is set, and in the order of smart card host-host protocol definition, increase the order of using the high speed data transfer bus and the default transport bus that smart card module is set;
In this step, in the ISO/IEC7816-4 agreement, increase the order of using the high speed data transfer bus.
Step 602 is provided with status signal lines between smart card module and controller module;
In this step, status signal lines comprises four kinds of signals, and these four kinds of signals are respectively: Int_IN signal, IN_Ready signal, Int_OUT signal and OUT_Ready signal are used for the transmitting-receiving of control command and data when switching to parallel bus.And with the I/O data line low 2 as I/O (CIO, the Card I/O) signal wire of the card of ISO/IEC7816 definition and (CRST, the Card Reset) signal wire that resets of card, other I/O data line simulation UART bus or I
2The C bus, the CLK of CLK signal wire transmits keeps the clock of ISO/IEC7816 definition.During normal the use, controller module and smart card module are by the ISO/IEC7816-3 protocol communication.
Step 603, controller module judge whether to carry out high speed data transfer, if desired, send command information, smart card module return command response message to smart card module;
In this step, when smart card module is applied to digital TV conditional receiving card, whether the controller module judgment data needs control word (CW, Control Word) control, or, the Large Volume Data that whether has descrambling is if send the command information that comprises use high speed data transfer bus to smart card module.
Send command information to smart card module, smart card module return command response message specifically comprises: controller module transmit status signal wire Int_IN signal effective information, and the notice smart card module has command information to send; Smart card module monitors status signal lines Int_IN signal effective information, then responds the IN_Ready signal message; Controller module sends command information by the I/O data line to smart card module, if controller module needs smart card module return command response message, sends Int_OUT signal effective information; Smart card module receives command information and Int_OUT signal effective information, carry out respective handling, be ready to the return command response message, then send OUT_Ready signal effective information, send command response message by the I/O data line to controller simultaneously to controller module.
Step 604, smart card module and controller module are carried out data transmission by parallel bus;
In this step, parallel bus is except that the CIO signal wire of ISO/IEC7816 definition and other I/O data line the CRST signal wire.
Step 605, after data transmission finished, controller module recovered the right to use to the ISO/IEC7816 bus, promptly carried out subsequent data transmission by the smart card host-host protocol bus of acquiescence.
In the present embodiment, owing to adopt parallel bus transmission data, wherein parallel bus once can transmit 8bit or 16bit, its transfer rate can reach 10Mbps, the speed that is much higher than the CIO of smart card host-host protocol (ISO/IEC7816-3 agreement) definition, greatly improved the smart card module transfer rate, made things convenient for the user to use the high speed large-data operation, present embodiment has been obtained good effect in the digital TV field condition receiving card.
Fig. 7 is the system architecture synoptic diagram of transporting information of smart card module of the present invention, referring to Fig. 7, this system comprises controller module 701 and smart card module 702, controller module 701 links to each other by smart card host-host protocol bus with smart card module 702, controller module 701 also links to each other by the high speed data transfer bus with smart card module 702
Controller module 701 is used for definite command information and need carries out high speed data transfer, sends command informations by high speed data bus to smart card module 702, perhaps, carries the identification information of high speed data transfer in command information;
Smart card module 702, be used for according to the command information that receives, if determine the command information that receives from the high speed data transfer bus, perhaps, carry the identification information of high speed data transfer in the command information that receives, by high speed data transfer bus transfer command response message.
In the practical application, controller module 701 further links to each other by control line with smart card module 702,
Controller module 701 is used to judge whether the current command information needs to carry out high speed data transfer, if desired, the control line state is set sends command informations by the high speed data transfer bus to smart card module 702 after effectively;
Smart card module 702 is used to monitor the control line state for effectively, receives command information from the high speed data transfer bus.
In the practical application, the mode of operation register of sign smart card module interface transmission mode also can be set and in the order of smart card host-host protocol definition in smart card module, increase the order of using the high speed data transfer bus and the default transport bus that smart card module is set, do not repeat them here.
As seen from the above-described embodiment, the method and system of a kind of transporting information of smart card module provided by the invention, by the high speed data transfer bus is set on smart card module with expansion smart card module interface, when controller module determines to adopt high speed data transfer bus transfer information according to business to the requirement of transfer rate, operation by the total line traffic control smart card module of high speed data transfer that is provided with, make the transfer rate of order on the smart card module or data reach the supported maximal value of controller module, thereby improved the smart card module transfer rate, made things convenient for the user to use the high speed large-data operation, help the expansion of user's use and new business, also expanded the application of smart card module simultaneously.Further, controller module can require and business datum amount size according to service transmission rate, and control information is transmitted between smart card host-host protocol bus and the high speed data transfer bus switches, and has adapted to the different demands of user.
More than lift preferred embodiment; the purpose, technical solutions and advantages of the present invention are further described; institute is understood that; the above only is preferred embodiment of the present invention; not in order to restriction the present invention; within the spirit and principles in the present invention all, any modification of being done, be equal to replacement, improvement etc., all should be included within protection scope of the present invention.