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 interface of following High Speed Data Transfer Protocol of expansion is set at smart card module in advance, to be connected with the peripheral control unit module, the method also comprises by the high speed data transfer bus:
According to the command information from the transmission of peripheral control unit module that receives, if determine the identification information that carries high speed data transfer in the command information that receives, by the high speed data transfer bus transfer command response message that arranges.
The command information from the transmission of peripheral control unit module that described basis receives, 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 necessary, 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 arranges 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 necessary, then continues to send described next command information by the high speed data transfer bus; Smart card module receives described next command information, by command response message corresponding to next command information 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 from the transmission of peripheral control unit module that described basis receives, 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 necessary, arranges 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;
Identify in the smart card module read work mode register, determine to be designated and adopt the high speed data transfer bus to transmit, receive 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, arranges 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 from the transmission of peripheral control unit module that described basis receives, 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 necessary, 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 Extension 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, comprise controller module and smart card module, controller module links to each other by smart card host-host protocol bus with smart card module, the high speed data transfer bus interface of following High Speed Data Transfer Protocol of expansion is set at smart card module in advance, 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 to carries out high speed data transfer, carries the identification information of high speed data transfer in command information;
Smart card module is used for according to the command information that receives, if determine the identification information that carries 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 for judging whether the current command information needs to carry out high speed data transfer, if necessary, 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 for monitoring 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 with expansion smart card module interface at smart card module, 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 arranges, thereby improved the smart card module transfer rate, made things convenient for the user to use the high speed large-data operation, be conducive to the expansion of user's use and new business, also expanded the application of smart card module simultaneously.Further, controller module can switch between smart card host-host protocol bus and high speed data transfer bus in the control information transmission, 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 increasing the high speed data transfer bus at smart card module, controller module is by the operation of the total line traffic control smart card module of high speed data transfer, so 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 inner at existing intelligent memory card, smart card module exists with the form of nude film (die), the controller module of outside is not defined fixed interface, thereby, can be by the Interface realization high-speed transfer of expansion to controller module.Namely 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 Extension 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 arranges the high speed data transfer bus at smart card module in advance;
In this step, expand in advance the smart card module interface: connecting smart card module interface and controller module by the high speed data transfer bus that arranges, the smart card module interface of expansion is followed High Speed Data Transfer Protocol, can be to realize by changing existing smart card host-host protocol standard, also can be directly to realize with High Speed Data Transfer Protocol.
Step 202, according to the command information from the transmission of peripheral control unit module 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 the high speed data transfer bus transfer command response message that arranges.
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 business high for transmission rate request, 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, processed by application program, on respective bus, carry out communication with controller module by transport layer again.The flow process of communication 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 arranges 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 to relate to communication 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 designation switching mode, mode of operation register identification switching mode, and order control switching mode.
Fig. 3 is hardware controls signal designation 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 High Speed Data Transfer Protocol, 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 arranges 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 necessary, 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 communication 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 the 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, arranges that signal level is low level on the control line, and it is invalid to identify; And when needs carry out high speed data transfer, arranging that signal level is 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 arrange the control line state of acquiescence for effectively, namely 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, to improve transfer rate, reduces the transmission time.
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 communication, then sends command information at 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 from high speed data transfer bus or smart card host-host protocol bus, and pass through this high speed data transfer bus to controller module return command response message.
In the practical application, smart card module further judged when control line keeps sign high speed data transfer bus effective before the return command response message, by the high speed data transfer bus return command response message selected to controller module.
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 finish alternately.That is, if determine that next command information also needs to carry out high speed data transfer, then continue the retentive control line states for effectively, carry out high speed data transfer, send next command information by the high speed data transfer bus; Smart card module receives next command information, by command response message corresponding to next command information 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 the 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 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 communication or the sign that employing high speed data transfer bus is carried out communication, can give tacit consent to smart card module and adopt smart card host-host protocol bus to carry out communication.
Step 402, controller module judge whether to carry out high speed data transfer, if necessary, arrange 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 requirement and the business datum amount of transfer rate, if transmission rate request is not high, the business datum amount is less, then processes by existing procedure; If transmission rate request is high, the business datum amount is large, then sending to arrange 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 communication, smart card module receives and arranges 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 communication.
Comprise setup failed information if response message is set, then follow-up in, controller module adopts smart card host-host protocol bus to carry out communication.
In the practical application, can with a bit identification smart card module transmission mode, for example, adopt smart card host-host protocol bus to carry out communication with " 0 " sign; Adopt the high speed data transfer bus to carry out communication with " 1 " sign.Certainly, for adopting multiple high speed data transfer bus to carry out the smart card module of communication, 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, identify in the smart card module read work mode register, determine to be designated and adopt the high speed data transfer bus to transmit, receive command information by the high speed data transfer bus, and by high speed data transfer bus return command response message, performing data transmission;
In this step, after controller module is received replying of smart card, if also need follow-up data interaction operation, then continue to carry out data interaction with the bus of selecting, until finish alternately.
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, if the data that need to transmit need to adopt the high speed data transfer bus to transmit next time, then re-execute step 403; 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 communication by being designated in the smart card module mode of operation register with arranging 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 in advance the smart card module interface: 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 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 smart card host-host protocol bus.
Step 502, controller module judge whether to carry out high speed data transfer, if necessary, 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 communication by smart card host-host protocol bus; If necessary, 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, performing 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, if need to adopt the high speed data transfer bus to transmit, then continues by high speed data transfer bus performing data transmission; 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 by the high speed data transfer bus and return smart card module default transport bus line command, 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, to describe handoff procedure with the data phase unit of being treated to, can certainly be take command and response as unit or describe handoff procedure take order or response as unit separately, take hardware controls signal designation switching mode as example, arranging of control line can arrange before a secondary data is processed, and 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 every subcommand, the transmission of 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 in any way applied in any combination of switching mode is controlled in hardware controls signal designation 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 storage card with the form of die, with the parallel bus of the smart card module interface setting of expansion respectively with the SD controller module with 8 common I/O lines be connected, and status signal lines be set be used for switch the smart card module transfer bus.
Fig. 6 is the schematic flow sheet that the present invention uses parallel port bus transfer smart card module information, and referring to Fig. 6, this flow process comprises:
Step 601, expand in advance the smart card module interface: 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 arranges 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, and for the transmitting-receiving of control command when switching to parallel bus and data.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 transmission 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 necessary, send command information, smart card module return command response message to smart card module;
In this step, when smart card module is applied to the Conditional Access of Digital Television card, controller module judges whether data need control word (CW, Control Word) control, or, the Large Volume Data that whether has descrambling if so, sends 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 sends status signal lines 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 to controller module, send command response message by the I/O data line to controller simultaneously.
Step 604, smart card module and controller module are by the parallel bus performing data transmission;
In this step, parallel bus is except the CIO signal wire of ISO/IEC7816 definition and other I/O data line the CRST signal wire.
Step 605, after data transmission was complete, controller module recovered the right to use to the ISO/IEC7816 bus, namely carried out subsequent data transmission by the smart card host-host protocol bus of acquiescence.
In the present embodiment, owing to adopt the parallel bus the transmission of 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 to 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 for judging whether the current command information needs to carry out high speed data transfer, if necessary, the control line state is set sends command information by the high speed data transfer bus to smart card module 702 after effectively;
Smart card module 702 is used for monitoring 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 with expansion smart card module interface at smart card module, 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 arranges, so that on the smart card module order or data transfer speed 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, be conducive to 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 the control information transmission is switched between smart card host-host protocol bus and high speed data transfer bus, 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 limit the present invention; within the spirit and principles in the present invention all, any modification of doing, be equal to replacement, improvement etc., all should be included within protection scope of the present invention.