CN111948971A - A smart card management device and data transfer method thereof - Google Patents
A smart card management device and data transfer method thereof Download PDFInfo
- Publication number
- CN111948971A CN111948971A CN202010882717.9A CN202010882717A CN111948971A CN 111948971 A CN111948971 A CN 111948971A CN 202010882717 A CN202010882717 A CN 202010882717A CN 111948971 A CN111948971 A CN 111948971A
- Authority
- CN
- China
- Prior art keywords
- smart card
- bus expansion
- layer
- bus
- module
- 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.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 43
- 238000012546 transfer Methods 0.000 title claims abstract description 9
- 230000006854 communication Effects 0.000 claims abstract description 82
- 238000004891 communication Methods 0.000 claims abstract description 79
- 230000004044 response Effects 0.000 claims description 11
- 230000003993 interaction Effects 0.000 claims description 3
- 238000007726 management method Methods 0.000 description 37
- 230000008569 process Effects 0.000 description 10
- 230000006870 function Effects 0.000 description 9
- 238000010586 diagram Methods 0.000 description 7
- 230000005540 biological transmission Effects 0.000 description 5
- 230000002093 peripheral effect Effects 0.000 description 5
- 238000013461 design Methods 0.000 description 4
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 230000007547 defect Effects 0.000 description 3
- 239000004606 Fillers/Extenders Substances 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 230000010354 integration Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000012545 processing Methods 0.000 description 2
- 238000012360 testing method Methods 0.000 description 2
- 101000823103 Equus caballus Alpha-1-antiproteinase 4 Proteins 0.000 description 1
- 230000002159 abnormal effect Effects 0.000 description 1
- 238000003491 array Methods 0.000 description 1
- 238000006243 chemical reaction Methods 0.000 description 1
- 230000008094 contradictory effect Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000002452 interceptive effect Effects 0.000 description 1
- 238000013507 mapping Methods 0.000 description 1
- 238000007639 printing Methods 0.000 description 1
- 230000008054 signal transmission Effects 0.000 description 1
- 230000009466 transformation Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05B—CONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
- G05B19/00—Programme-control systems
- G05B19/02—Programme-control systems electric
- G05B19/04—Programme control other than numerical control, i.e. in sequence controllers or logic controllers
- G05B19/042—Programme control other than numerical control, i.e. in sequence controllers or logic controllers using digital processors
- G05B19/0423—Input/output
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05B—CONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
- G05B2219/00—Program-control systems
- G05B2219/20—Pc systems
- G05B2219/25—Pc structure of the system
- G05B2219/25257—Microcontroller
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Automation & Control Theory (AREA)
- Information Transfer Systems (AREA)
Abstract
本发明实施例涉及一种智能卡管理装置及其数据转接方法,其中,智能卡管理装置为具有总线扩展层的四层结构,其包括:处于第一层的控制器,处于第三层的多个智能卡控制模块,处于第四层的多个智能卡;第二层为用于实现控制器与每一智能卡控制模块通信的总线扩展层,且总线扩展层包括:一级结构的总线扩展模块或者多级结构的通过级联方式挂接的总线扩展模块;总线扩展层中最后一级的每一总线扩展模块连接第一预设数量的智能卡控制模块;每一智能卡控制模块连接第二预设数量的智能卡;同一级结构的所有总线扩展模块集成在一个FPGA或CPLD的可编程器件上。本发明的管理装置布线简单、成本低、灵活性高。
Embodiments of the present invention relate to a smart card management device and a data transfer method thereof, wherein the smart card management device has a four-layer structure with a bus expansion layer, which includes: a controller at the first layer, a plurality of The smart card control module is a plurality of smart cards in the fourth layer; the second layer is a bus expansion layer used to realize the communication between the controller and each smart card control module, and the bus expansion layer includes: a bus expansion module with a one-level structure or a multi-level structure Structured bus expansion modules connected in cascade; each bus expansion module at the last stage in the bus expansion layer is connected to a first preset number of smart card control modules; each smart card control module is connected to a second preset number of smart cards ; All bus expansion modules of the same level structure are integrated on a programmable device of FPGA or CPLD. The management device of the invention has simple wiring, low cost and high flexibility.
Description
技术领域technical field
本发明实施例涉及总线技术,具体涉及一种智能卡管理装置及其数据转接方法。Embodiments of the present invention relate to bus technology, and in particular, to a smart card management device and a data transfer method thereof.
背景技术Background technique
随着技术的不断发展,微控制器的集成度越来越高,其所携带的外设接口也越来越丰富。例如,一颗小小的嵌入式SoC(System-on-a-Chip,系统级芯片)上不仅集成了CPU、GPU等等大规模数据处理单元,其通常也会携带有UART(Universal AsynchronousReceiver/Transmitter,通用异步收发传输器)、USB、IIC(Inter-Integrated Circuit,集成电路总线)、SPI(Serial Peripheral Interface,串行外设接口)等与外部设备通信的接口,以便于采集外部传感器数据或与其他设备进行通信。With the continuous development of technology, the integration of microcontrollers is getting higher and higher, and the peripheral interfaces it carries are also becoming more and more abundant. For example, a small embedded SoC (System-on-a-Chip, system-on-chip) not only integrates large-scale data processing units such as CPU and GPU, but also usually carries a UART (Universal Asynchronous Receiver/Transmitter). , Universal Asynchronous Receiver Transmitter), USB, IIC (Inter-Integrated Circuit, Integrated Circuit Bus), SPI (Serial Peripheral Interface, Serial Peripheral Interface) and other interfaces to communicate with external devices, in order to collect external sensor data or communicate with communicate with other devices.
尽管现有的控制器芯片集成度越来越高,接口也越来越丰富,但对于一些特殊应用场景(例如大规模传感器阵列、智能卡管理设备等等)常常需要控制器与成百上千乃至数万个传感器或智能卡进行通信,而控制器其自身所携带的外设接口数量则非常有限。因此,亟需一种有效的总线扩展方法来解决此类问题。Although the existing controller chips are more and more integrated and the interfaces are more and more abundant, for some special application scenarios (such as large-scale sensor arrays, smart card management devices, etc.) Tens of thousands of sensors or smart cards communicate, while the controller itself carries a very limited number of peripheral interfaces. Therefore, an effective bus expansion method is urgently needed to solve such problems.
发明内容SUMMARY OF THE INVENTION
为了解决现有技术存在的问题,本发明的至少一个实施例提供了一种智能卡管理装置及其数据转接方法。In order to solve the problems existing in the prior art, at least one embodiment of the present invention provides a smart card management device and a data transfer method thereof.
第一方面,本发明实施例提出一种智能卡管理装置,所述智能卡管理装置为具有总线扩展层的四层结构;In a first aspect, an embodiment of the present invention provides a smart card management device, where the smart card management device has a four-layer structure with a bus expansion layer;
所述智能卡管理装置包括:处于第一层的控制器,处于第三层的多个智能卡控制模块,处于第四层的多个智能卡;The smart card management device includes: a controller in the first layer, a plurality of smart card control modules in the third layer, and a plurality of smart cards in the fourth layer;
第二层为用于实现控制器与每一智能卡控制模块通信的总线扩展层,且所述总线扩展层包括:一级结构的总线扩展模块或者多级结构的通过级联方式挂接的总线扩展模块;The second layer is a bus expansion layer used to realize the communication between the controller and each smart card control module, and the bus expansion layer includes: a bus expansion module with a one-level structure or a bus expansion module with a multi-level structure connected in a cascade manner module;
所述总线扩展层中最后一级的每一总线扩展模块连接第一预设数量的智能卡控制模块;Each bus expansion module of the last stage in the bus expansion layer is connected to a first preset number of smart card control modules;
每一智能卡控制模块连接第二预设数量的智能卡;Each smart card control module is connected to a second preset number of smart cards;
其中,同一级结构的部分/全部总线扩展模块集成在一个可编程器件上。Among them, some/all bus expansion modules of the same level structure are integrated on a programmable device.
在一些实施例中,控制器与第二层中第一级的总线扩展模块之间的通信协议为下述协议中的一种:In some embodiments, the communication protocol between the controller and the bus expansion module at the first level in the second layer is one of the following protocols:
UART协议、IIC协议、SPI协议、USB通信协议、CAN总线协议和以太网协议;UART protocol, IIC protocol, SPI protocol, USB communication protocol, CAN bus protocol and Ethernet protocol;
第二层中最后一级的总线扩展模块与该总线扩展模块连接的智能卡控制模块之间的通信协议为下述协议中的一种:The communication protocol between the bus expansion module of the last level in the second layer and the smart card control module connected to the bus expansion module is one of the following protocols:
UART协议、IIC协议、SPI协议、USB通信协议、CAN总线协议和以太网协议。UART protocol, IIC protocol, SPI protocol, USB communication protocol, CAN bus protocol and Ethernet protocol.
在一些实施例中,所述第一层、第二层与第三层的各模块之间使用的通信协议相同;In some embodiments, the communication protocols used between the modules of the first layer, the second layer and the third layer are the same;
和/或,所述第一层、第二层与第三层的各模块之间使用的通信协议为USB通信协议;And/or, the communication protocol used between the modules of the first layer, the second layer and the third layer is the USB communication protocol;
和/或,总线扩展层与上一层、下一层使用的通信协议不同;And/or, the communication protocol used by the bus extension layer is different from that used by the upper layer and the lower layer;
和/或,在总线扩展层,同一级结构的所有总线扩展模块集成在一个FPGA或CPLD上。And/or, in the bus expansion layer, all bus expansion modules of the same level structure are integrated on one FPGA or CPLD.
在一些实施例中,所述总线扩展层包括一级结构的总线扩展模块,且一级结构的每一个总线扩展模块为一个虚拟的USB HUB;In some embodiments, the bus expansion layer includes a bus expansion module of a primary structure, and each bus expansion module of the primary structure is a virtual USB HUB;
和/或,and / or,
所述总线扩展层包括多级结构的总线扩展模块,每一级结构的每一个总线扩展模块为一个虚拟的USB HUB;Described bus expansion layer comprises the bus expansion module of multi-level structure, and each bus expansion module of each level structure is a virtual USB HUB;
每一级结构中每一个USB HUB连接多个智能卡控制模块,也连接下一级的总线扩展模块。Each USB HUB in each level of structure is connected to a plurality of smart card control modules, and is also connected to the bus expansion module of the next level.
在一些实施例中,所述总线扩展层包括多级结构的总线扩展模块,每一级的每一个总线扩展模块通过一个FPGA/CPLD实现。In some embodiments, the bus expansion layer includes bus expansion modules in a multi-level structure, and each bus expansion module in each level is implemented by an FPGA/CPLD.
第二方面,本发明实施例还提供一种智能卡系统,包括业务服务模块、外部终端和上述第一方面任一所述的智能卡管理装置,所述智能卡管理装置与业务服务模块交互,也与外部终端交互。In a second aspect, an embodiment of the present invention further provides a smart card system, including a business service module, an external terminal, and the smart card management device described in any of the first aspects above. The smart card management device interacts with the business service module, and also communicates with an external terminal. Terminal interaction.
第三方面,本发明实施例还提供一种基于第一方面任一所述的智能卡管理装置的数据转接方法,包括:In a third aspect, an embodiment of the present invention further provides a data transfer method based on any one of the smart card management devices described in the first aspect, including:
控制器接收外部终端的服务请求,所述服务请求中携带智能卡标识;The controller receives a service request from an external terminal, where the service request carries a smart card identifier;
所述控制器根据智能卡标识,获取与智能卡标识关联的所有总线扩展模块的标识和智能卡控制模块的标识;The controller obtains, according to the smart card identifier, the identifiers of all bus expansion modules associated with the smart card identifier and the identifiers of the smart card control module;
控制器服务请求和所有总线扩展模块的标识,向第一级的总线扩展模块的标识所属的总线扩展模块发送控制指令,以使该总线扩展模块基于所有总线扩展模块的标识将控制器数据线桥接至对应智能卡控制模块的标识的智能卡控制模块;The controller serves the request and the identification of all bus expansion modules, and sends a control command to the bus expansion module to which the identification of the first-level bus expansion module belongs, so that the bus expansion module bridges the controller data lines based on the identification of all bus expansion modules. to the smart card control module corresponding to the identity of the smart card control module;
所述控制器在接收到总线扩展层中最后一级的总线扩展模块反馈的所述控制指令的准备响应时,与智能卡控制模块建立数据连接,以实现与智能卡标识对应的智能卡通信。The controller establishes a data connection with the smart card control module to realize the communication with the smart card corresponding to the smart card identifier when receiving the preparation response of the control command fed back by the bus extension module at the last level in the bus extension layer.
在一些实施例中,所述最后一级总线扩展模块反馈准备响应之后,切换至侦听所述控制器发送控制指令的侦听状态,以切换其他智能卡的通信。In some embodiments, after the last-level bus expansion module feeds back a ready response, it switches to a listening state of listening to the control command sent by the controller, so as to switch communications of other smart cards.
在一些实施例中,所述控制器与智能卡控制模块建立数据连接,包括:In some embodiments, the controller establishes a data connection with the smart card control module, including:
所述控制器根据所述智能卡控制模块提供的数据信息,进行对应的配置。The controller performs corresponding configuration according to the data information provided by the smart card control module.
在一些实施例中,在总线扩展模块为一个虚拟的USB HUB时,In some embodiments, when the bus expansion module is a virtual USB HUB,
控制器初始化总线扩展层中每一级的每一个总线扩展模块,以使每一总线扩展模块中每一智能卡控制模块接入,并记录每一智能卡控制模块的通信端点;The controller initializes each bus expansion module of each level in the bus expansion layer, so that each smart card control module in each bus expansion module is connected, and records the communication endpoint of each smart card control module;
相应地,控制器接收外部终端的服务请求后,根据预先记录的包括通信端点的索引信息查找智能卡控制模块的通信端点,并与智能卡控制模块建立数据连接,以实现与智能卡标识对应的智能卡通信。Correspondingly, after receiving the service request from the external terminal, the controller searches for the communication endpoint of the smart card control module according to the pre-recorded index information including the communication endpoint, and establishes a data connection with the smart card control module to realize the smart card communication corresponding to the smart card identifier.
可见,本发明实施例的至少一个实施例中,智能卡管理装置设置有总线扩展层,该总线扩展层可包括:一级结构的总线扩展模块或者多级结构的通过级联方式挂接的总线扩展模块,实现了灵活扩展。It can be seen that in at least one of the embodiments of the present invention, the smart card management device is provided with a bus expansion layer, and the bus expansion layer may include: a bus expansion module with a one-level structure or a bus expansion module with a multi-level structure that is connected in a cascaded manner modules for flexible expansion.
此外,同一级结构的所有总线扩展模块集成在一个可编程器件上,进而实现布线简单、成本低、使得信号质量更好,通信速率更高。In addition, all bus expansion modules of the same level structure are integrated on one programmable device, thereby realizing simple wiring, low cost, better signal quality and higher communication rate.
本发明的智能卡管理装置解决了现有技术中采用若干分立数字逻辑单元作为总线信号的开关器件,导致设备整体元件多,成本高且稳定性下降的问题,还解决了现有技术中过多的分立元件不利于印制电路板的小型化设计的问题,进一步解决了总线扇出过大导致通信速率下降,误码率增加的问题。The smart card management device of the present invention solves the problems in the prior art that a number of discrete digital logic units are used as switching devices for bus signals, resulting in a large number of overall equipment components, high cost and reduced stability, and also solves the problems of too many in the prior art. Discrete components are not conducive to the miniaturized design of printed circuit boards, and further solves the problem that the bus fan-out is too large, resulting in a decrease in communication rate and an increase in bit error rate.
附图说明Description of drawings
为了更清楚地说明本发明实施例的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to illustrate the technical solutions of the embodiments of the present invention more clearly, the following briefly introduces the accompanying drawings that need to be used in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some of the present invention. In the embodiments, for those of ordinary skill in the art, other drawings can also be obtained according to these drawings without creative labor.
图1为现有技术中一种方案对应的直接扩展逻辑框图;Fig. 1 is a direct expansion logic block diagram corresponding to a scheme in the prior art;
图2为现有技术中另一种方案对应的多级扩展框架图;Fig. 2 is a multi-level extension frame diagram corresponding to another scheme in the prior art;
图3A和图3B均为本发明实施例提供的一种智能卡管理装置的架构图;3A and 3B are both structural diagrams of a smart card management device provided by an embodiment of the present invention;
图4为图3A的智能卡管理装置的数据转接方法的流程示意图;4 is a schematic flowchart of a data transfer method of the smart card management device of FIG. 3A;
图5A和图5B均为本发明实施例提供的另一种智能卡管理装置的架构图。5A and 5B are both structural diagrams of another smart card management apparatus provided by an embodiment of the present invention.
具体实施方式Detailed ways
为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明的一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动的前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to make the purposes, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments These are some embodiments of the present invention, but not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the protection scope of the present invention.
需要说明的是,在本文中,诸如“第一”和“第二”等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。It should be noted that, in this document, relational terms such as "first" and "second" etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply these There is no such actual relationship or sequence between entities or operations.
为了更好的理解本发明实施例中的智能卡管理装置的总线扩展结构,先对现有技术中的智能卡管理装置的各总线扩展的方式进行说明。In order to better understand the bus extension structure of the smart card management apparatus in the embodiment of the present invention, the manner of each bus extension of the smart card management apparatus in the prior art will be described first.
由于智能卡管理装置中智能卡采用ISO7816协议进行通信,因此现行市场上的智能卡管理装置主要有两种总线扩展方法:Since the smart card in the smart card management device uses the ISO7816 protocol for communication, there are mainly two bus expansion methods for the smart card management device on the market:
第一种总线扩展方法是利用数字逻辑单元(如多路开关)作为主要部件,通过对数字逻辑单元的通道选择引脚的控制,从而实现将控制器的UART引脚与智能卡相连,从而实现了分时的通信,其结构简单且易于实现。The first bus expansion method is to use a digital logic unit (such as a multiplexer) as the main component, and through the control of the channel selection pin of the digital logic unit, the UART pin of the controller is connected to the smart card, thereby realizing Time-sharing communication, its structure is simple and easy to implement.
如图1所示,当控制器要与智能卡进行通信时,先发送路选信号给多路开关。多路开关收到信号后,根据路选信号将控制器的通信信号线分别转接到对应的智能卡的通信信号线上。如路选为0则将控制器信号线接通至智能卡1a,若为1则接通至智能卡2a。As shown in Figure 1, when the controller wants to communicate with the smart card, it first sends a path selection signal to the multiplexer. After receiving the signal, the multiplexer switches the communication signal line of the controller to the communication signal line of the corresponding smart card respectively according to the path selection signal. If the route selection is 0, the controller signal line is connected to the smart card 1a, and if it is 1, it is connected to the
然而,上述的总线扩展方法存在下述的缺陷:However, the above-mentioned bus expansion method has the following drawbacks:
a)由于不同批次、不同厂家、不同型号的多路开关其响应速率各不相同,控制器发出路选信号后,需要等待足够长(一般为几十毫秒至几百毫秒)才能尝试与智能卡进行通信。否则可能导致数据丢失。a) Due to the different response rates of different batches, different manufacturers and different models of multiplexers, after the controller sends the route selection signal, it needs to wait long enough (usually tens of milliseconds to hundreds of milliseconds) to try to communicate with the smart card to communicate. Failure to do so may result in data loss.
b)多路开关一般8选1,体积较大,如果通信信号线较多,如SPI4线等则需要占用很多PCB空间。b) The multiplexer generally chooses 1 out of 8, and the volume is large. If there are many communication signal lines, such as SPI4 lines, it will take up a lot of PCB space.
c)UART为异步通信,因此智能卡随时都可能会往控制器发送信息,当控制器还没有选择与其进行通信时则会导致上行数据丢失。例如当智能卡2a有信息发送给控制器,而此时控制器正与智能卡1a进行通信,此时智能卡2a的信息就无法被控制器获取。c) UART is asynchronous communication, so the smart card may send information to the controller at any time, and the uplink data will be lost when the controller has not selected to communicate with it. For example, when the
第二种总线扩展方法主要是为解决第一种总线扩展方法中的c)缺陷产生的。基于前述描述,第一种方法的总线扩展会导致诸如UART等异步通信数据丢失。因此,第二种方法在控制器与智能卡之间加入了一个单片机作为智能卡的数据缓冲器。当控制器未与其进行通信时,若智能卡有数据要发给控制器,此时与其相连的单片机就会先将数据缓存起来,等到控制器与单片机进行通信时再将数据发给控制器。该方案解决了第一种方案中的数据丢失缺陷,同时,由于单片机都会有多个UART接口,扩展数量相对直接扩展有所提升。The second bus expansion method is mainly generated to solve the defect c) in the first bus expansion method. Based on the foregoing description, the bus expansion of the first method results in the loss of asynchronous communication data such as UART. Therefore, the second method adds a single-chip microcomputer as the data buffer of the smart card between the controller and the smart card. When the controller does not communicate with it, if the smart card has data to send to the controller, the MCU connected to it will cache the data first, and then send the data to the controller when the controller communicates with the MCU. This solution solves the defect of data loss in the first solution. At the same time, since the microcontroller will have multiple UART interfaces, the number of expansions is improved compared to direct expansion.
如图2所示,当控制器需要与智能卡控制器1n连接的一个“指定智能卡”进行通信时先通过路选信号进行选通,此步骤与第一种方法相同,随后再将数据发送给“单片机”,单片机收到数据后再发起与 “指定智能卡”的通信。当 “指定智能卡”有数据返回时,数据将被“单片机”接收并缓存。此后需要依据两种不同情况做处理:a)当控制器仍在与“单片机”进行通信,则直接将数据发送给控制器并清除缓存;b)控制器已经“断开”(达到一定的超时时间)与“单片机”的连接,此时数据被缓存,直至下一次控制器再次与“单片机”进行通信时再上传。As shown in Fig. 2, when the controller needs to communicate with a "designated smart card" connected to the smart card controller 1n, it will be gated through the route selection signal. This step is the same as the first method, and then the data will be sent to the "designated smart card". The single-chip microcomputer", the single-chip microcomputer initiates communication with the "designated smart card" after receiving the data. When the "designated smart card" returns data, the data will be received and cached by the "MCU". After that, it needs to be processed according to two different situations: a) When the controller is still communicating with the "MCU", it directly sends the data to the controller and clears the cache; b) The controller has been "disconnected" (a certain timeout is reached) time) connection with the "MCU", at this time the data is cached and uploaded until the next time the controller communicates with the "MCU" again.
然而,缺陷如下:1)电路元件增加,操作复杂;However, the defects are as follows: 1) The circuit components are increased and the operation is complicated;
2)在一般的实践应用时,常常会在智能卡控制器与控制器总线间增加一级开关,从而试图增加挂接智能控制器的数量,但这样会使得电路进一步复杂化,元件的增多除了导致成本增加外,还会使得系统稳定性降低;2) In general practical applications, a first-level switch is often added between the smart card controller and the controller bus, so as to try to increase the number of connected smart controllers, but this will further complicate the circuit, and the increase in components will not only lead to In addition to the increase in cost, it will also reduce the stability of the system;
3)操作复杂,总线切换等待时间增加,导致通信效率下降;3) The operation is complicated, and the waiting time for bus switching increases, resulting in a decrease in communication efficiency;
4)实际应用中总线的带载能力是有限的,将过多的从设备挂接在总线上会导致总线的时序建立时间变长,波形变差,因此必须降低通信速率以保证通信质量。4) In practical applications, the carrying capacity of the bus is limited. Attaching too many slave devices to the bus will cause the bus timing establishment time to become longer and the waveform to deteriorate. Therefore, the communication rate must be reduced to ensure the communication quality.
为了更好的解决上述图2所示的总线扩展方案采用若干分立数字逻辑单元作为总线信号的开关器件,导致设备整体元件多,成本高且稳定性下降;且过多的分立元件不利于印制电路板的小型化设计;总线扇出过大导致通信速率下降,误码率增加等等问题。In order to better solve the above-mentioned bus expansion scheme shown in Figure 2, several discrete digital logic units are used as switching devices for bus signals, resulting in a large number of overall equipment components, high cost and reduced stability; and too many discrete components are not conducive to printing. The miniaturized design of the circuit board; the excessive fan-out of the bus leads to the decrease of the communication rate and the increase of the bit error rate, etc.
本发明实施例提供一种智能卡管理装置,该智能卡管理装置可为具有总线扩展层的四层结构。本实施例的智能卡管理装置可包括:处于第一层的控制器,处于第三层的多个智能卡控制模块,处于第四层的多个智能卡;第二层为用于实现控制器与每一智能卡控制模块通信的总线扩展层,且所述总线扩展层包括:一级结构的总线扩展模块或者多级结构的通过级联方式挂接的总线扩展模块;An embodiment of the present invention provides a smart card management apparatus, and the smart card management apparatus may have a four-layer structure with a bus extension layer. The smart card management device in this embodiment may include: a controller at the first layer, multiple smart card control modules at the third layer, and multiple smart cards at the fourth layer; A bus expansion layer for communication between the smart card control module, and the bus expansion layer includes: a bus expansion module with a one-level structure or a bus expansion module with a multi-level structure connected in a cascade manner;
所述总线扩展层中最后一级的每一总线扩展模块连接第一预设数量的智能卡控制模块;Each bus expansion module of the last stage in the bus expansion layer is connected to a first preset number of smart card control modules;
每一智能卡控制模块连接第二预设数量的智能卡;Each smart card control module is connected to a second preset number of smart cards;
其中,同一级结构的所有总线扩展模块集成在一个可编程器件上,例如FPGA(FieldProgrammable Gate Array,现场可编程门阵列)或CPLD(Complex Programmable LogicDevice,复杂可编程逻辑器件)上。Among them, all bus expansion modules of the same level structure are integrated on one programmable device, such as FPGA (FieldProgrammable Gate Array, Field Programmable Gate Array) or CPLD (Complex Programmable Logic Device, Complex Programmable Logic Device).
在本实施例中,智能卡管理装置设置有总线扩展层,该总线扩展层可进行级联式挂接总线扩展模块,进而实现了灵活扩展。此外,同一级结构的所有总线扩展模块集成在一个FPGA或CPLD的可编程器件上,进而实现布线简单、成本低、使得信号质量更好,通信速率更高。In this embodiment, the smart card management device is provided with a bus expansion layer, and the bus expansion layer can be connected to the bus expansion module in cascade, thereby realizing flexible expansion. In addition, all bus expansion modules of the same level structure are integrated on a programmable device of FPGA or CPLD, thereby realizing simple wiring, low cost, better signal quality and higher communication rate.
如图3A所示,图3A示出了本发明一实施例提供的一种智能卡管理装置的架构图,本实施例的智能卡管理装置可包括:处于第一层的控制器,处于第二层的总线扩展模块31和总线扩展模块32,处于第三层的多个智能控制模块,处于第四层的多个智能卡;As shown in FIG. 3A, FIG. 3A shows an architecture diagram of a smart card management apparatus provided by an embodiment of the present invention. The smart card management apparatus in this embodiment may include: a controller at the first layer, and a controller at the second layer. The bus expansion module 31 and the bus expansion module 32, a plurality of intelligent control modules in the third layer, and a plurality of smart cards in the fourth layer;
其中,控制器与每一个总线扩展模块之间均通过USB通信协议进行通信,每一个总线扩展模块与每一个智能卡控制模块之间通过USB通信协议进行通信。本实施例的每一个智能控制模块与智能卡之间的数据通信可为现有技术的数据通信方式,本实施例并未改进。The controller and each bus expansion module communicate through the USB communication protocol, and each bus expansion module and each smart card control module communicate through the USB communication protocol. The data communication between each intelligent control module and the smart card in this embodiment may be a data communication manner in the prior art, which is not improved in this embodiment.
在本实施例中,总线扩展层可包括:位于一个FPGA上的一级结构的总线扩展模块,且一级结构中有多个总线扩展模块,在图3A中示出的是总线扩展模块31和总线扩展模块32。In this embodiment, the bus expansion layer may include: a bus expansion module of a primary structure located on an FPGA, and there are multiple bus expansion modules in the primary structure, shown in FIG. 3A are the bus expansion module 31 and Bus expansion module 32 .
在图3A中,总线扩展模块31连接多个智能卡控制模块,如图3A所示的智能卡控制模块41、42,总线扩展模块32也可以连接多个智能卡控制模块,如智能卡控制模块51、52等,本实施例不对其限制。In FIG. 3A, the bus expansion module 31 is connected to multiple smart card control modules, such as the smart card control modules 41 and 42 shown in FIG. 3A, the bus expansion module 32 can also be connected to multiple smart card control modules, such as the smart card control modules 51, 52, etc. , this embodiment does not limit it.
需要说明的是,总线扩展模块31和32使用FPGA只是实践选择的设备的一种,总线扩展模块主要作用是衔接智能卡控制模块与控制器的数据转发以及控制的作用。通常,智能卡控制模块可以通过一个单片机芯片加上外围元件组成,可以通过自身的Smart card、UART(Universal Asynchronous Receiver/Transmitter,通用异步收发传输器)接口或GPIO(General-purpose input/output,通用型输入/输出)来实现与智能卡(即SIM卡)的通信交互,并对智能卡进行管理操作。It should be noted that the use of FPGA in the bus expansion modules 31 and 32 is only one of the practically selected devices. The main function of the bus expansion module is to connect the smart card control module and the controller for data forwarding and control. Usually, the smart card control module can be composed of a single-chip microcomputer chip plus peripheral components, and can be connected through its own Smart card, UART (Universal Asynchronous Receiver/Transmitter) interface or GPIO (General-purpose input/output, general-purpose type). Input/output) to realize the communication interaction with the smart card (ie SIM card), and manage the smart card.
在本实施例中,在智能卡控制模块作为USB设备接入到控制器的USB控制器(即总线扩展模块)上,控制器是作为USB主机。在双方开始通信之前,智能卡控制模块也需要对自身进行配置,向USB主机声明自己是一个怎样的设备,在后续的通信过程中采用怎样方式来通信。这些数据信息是在给智能卡控制模块编写程序时预置的。In this embodiment, when the smart card control module is connected to the USB controller (ie, the bus expansion module) of the controller as a USB device, the controller acts as a USB host. Before the two parties start to communicate, the smart card control module also needs to configure itself, declare to the USB host what kind of device it is, and how to communicate in the subsequent communication process. These data information are preset when programming the smart card control module.
FPGA除了以本方案的方式挂接外,还可以通过级联方式挂接,从而实现挂接设备数量的指数级倍增,如图3B所示。In addition to being mounted in the way of this solution, the FPGA can also be mounted in a cascaded manner, thereby realizing an exponential multiplication of the number of connected devices, as shown in Figure 3B.
可理解的是,在图3A和图3B中每一个总线控制模块均负责控制器与每一智能卡控制模块之间的通信,类似开关功能。图3A和图3B仅为示意说明,并不限定数量。It can be understood that, in FIG. 3A and FIG. 3B, each bus control module is responsible for the communication between the controller and each smart card control module, similar to the switch function. FIG. 3A and FIG. 3B are only schematic illustrations, and the numbers are not limited.
为了更好的理解图3A中所示的智能卡管理装置的数据转接方法,以下结合图4进行详细说明。In order to better understand the data transfer method of the smart card management device shown in FIG. 3A , a detailed description will be given below with reference to FIG. 4 .
当控制器需要与智能卡11进行通信时,其步骤可包括下述步骤:When the controller needs to communicate with the
401、控制器接收外部终端的服务请求,所述服务请求中携带智能卡标识。401. The controller receives a service request from an external terminal, where the service request carries a smart card identifier.
在本实施例中,智能卡标识可为智能卡编号。本实施例的智能卡编号可为方便智能卡管理装置进行管理进行的顺序编号,根据实际需要配置,例如,一个智能卡控制模块连接8张智能卡,而一个智能卡管理装置通过总线扩展后连接有100个智能卡控制模块,那么一个智能卡管理装置就是管理有800张智能卡。此时可通过1~800为各智能卡进行编号。本实施例不限制编号方式,根据实际需要配置。In this embodiment, the smart card identifier may be a smart card number. The smart card number in this embodiment can be a sequential number that is convenient for the management of the smart card management device, and can be configured according to actual needs. For example, one smart card control module is connected to 8 smart cards, and one smart card management device is connected to 100 smart card control modules through bus expansion. module, then a smart card management device manages 800 smart cards. At this time, each smart card can be numbered from 1 to 800. This embodiment does not limit the numbering method, which is configured according to actual needs.
402、所述控制器根据智能卡标识,获取与智能卡标识关联的所有总线扩展模块(如总线扩展模块31)的标识和智能卡控制模块(如智能卡控制模块41)的标识。402. The controller acquires, according to the smart card identifier, the identifiers of all bus expansion modules (eg, the bus expansion module 31 ) and the identifiers of the smart card control modules (eg, the smart card control module 41 ) associated with the smart card identifier.
在实际应用中,控制器内存储有与每一个智能卡关联的智能卡控制模块、总线扩展模块的标识的表格或映射关系。In practical applications, the controller stores a table or mapping relationship of the identifiers of the smart card control modules and bus expansion modules associated with each smart card.
403、控制器服务请求和所有总线扩展模块的标识,向第一级的总线扩展模块的标识所属的总线扩展模块发送控制指令,以使该总线扩展模块基于所有总线扩展模块的标识将控制器数据线桥接至对应智能卡控制模块的标识的智能卡控制模块。403. The controller serves the request and the identifiers of all bus expansion modules, and sends a control instruction to the bus expansion module to which the identifiers of the first-level bus expansion modules belong, so that the bus expansion module converts the controller data based on the identifiers of all bus expansion modules. The line is bridged to the smart card control module corresponding to the identification of the smart card control module.
也就是说,控制器往总线扩展模块31发送控制指令,总线扩展模块31收到控制指令后将控制器数据线桥接至智能卡控制模块41,其余智能卡控制模块均断开与控制器的连接,以确保每一时刻仅有一个智能卡控制模块连接在控制器上。That is to say, the controller sends a control command to the bus expansion module 31, and after receiving the control command, the bus expansion module 31 bridges the controller data line to the smart card control module 41, and the other smart card control modules are disconnected from the controller to Make sure that only one smart card control module is connected to the controller at any one time.
在本实施例中,总线扩展模块是一种“硬件编程”的器件,通常,使用HDL语言来对它进行设计,为此,总线扩展模块31接收到控制指令后实现硬件的桥接变换即为数据线桥接。In this embodiment, the bus expansion module is a device of "hardware programming". Usually, HDL language is used to design it. Therefore, after the bus expansion module 31 receives the control command, it realizes the bridging transformation of the hardware, which is the data. line bridge.
404、所述控制器接收最后一级的总线扩展模块反馈的所述控制指令的准备响应(即ready响应),并与智能卡控制模块建立数据连接,以实现与智能卡标识对应的智能卡通信。404. The controller receives the ready response (ie, ready response) of the control command fed back by the bus expansion module at the last stage, and establishes a data connection with the smart card control module to implement smart card communication corresponding to the smart card identifier.
需要说明的是,在总线扩展层为多级级联结构时,为了保证总线扩展层的所有级别的总线扩展模块准备就绪,控制器可以在接收最后一级的总线扩展模块反馈的ready响应时,与智能卡控制模块建立数据连接。本实施例中最后一级可为和智能卡控制模块直接连接的一级作为最后一级总线扩展模块。It should be noted that when the bus expansion layer is a multi-level cascade structure, in order to ensure that the bus expansion modules of all levels of the bus expansion layer are ready, the controller can receive the ready response from the last level of the bus expansion module. Establish a data connection with the smart card control module. In this embodiment, the last stage may be the stage directly connected with the smart card control module as the last stage bus expansion module.
结合图3A所示的结构,总线扩展模块31完成操作后往桥接好的总线上发送总线ready响应,以告知控制器通信线路已经准备完成可以传输数据,并转入侦听状态。同时,总线扩展模块31也向智能卡控制模块41反馈准备响应。Combined with the structure shown in FIG. 3A , the bus expansion module 31 sends a bus ready response to the bridged bus after completing the operation to inform the controller that the communication line is ready to transmit data, and switches to the listening state. At the same time, the bus expansion module 31 also feeds back a ready response to the smart card control module 41 .
进而智能卡控制模块41与控制器连接,控制器根据智能卡控制模块41提供的数据信息完成相应配置(利用默认的通信端点0分别配置读、写端点等USB通信协议的内容);控制器将数据传输给智能卡控制模块41;智能卡控制模块41根据接收到的数据信息找到相应的智能卡11,并将数据下发至相应智能卡11,从而完成一次数据下发。此时下发到智能卡11的数据可理解为从网口接收到的,来自外部终端的应用请求的数据,如移动网络对SIM卡发起的鉴权认证请求。Then the smart card control module 41 is connected with the controller, and the controller completes the corresponding configuration according to the data information provided by the smart card control module 41 (using the
当控制器根据服务请求需要与智能卡22进行通信时,首先发送通道切换控制信号,此时处于侦听状态的总线控制模块31会立即执行切换工作,并再次重复上述过程。可理解的是,总线扩展模块进入侦听状态是为了侦听来自控制器的切换通道(切换到与另一个智能卡控制模块通信)的命令,其最终实现与其他智能卡通信。When the controller needs to communicate with the smart card 22 according to the service request, it first sends a channel switching control signal, and the bus control module 31 in the listening state will immediately perform the switching work, and repeat the above process again. Understandably, the bus expansion module enters the listening state in order to listen for commands from the controller's switching channel (to switch to communicate with another smart card control module), which ultimately enables communication with other smart cards.
当智能卡执行完操作(如读、写智能卡的操作)并返回结果后,需要将数据传回控制器时:When the smart card performs operations (such as reading and writing to the smart card) and returns the result, when the data needs to be sent back to the controller:
1)智能卡控制模块41接收并存储数据;1) The smart card control module 41 receives and stores data;
2)控制器再轮询至智能卡控制模块41时,将数据上传,完成通信过程。2) When the controller polls the smart card control module 41 again, it uploads the data to complete the communication process.
如图5A和图5B所示,图5A和图5B分别示出了本发明另一实施例提供的一种智能卡管理装置的架构图,本实施例的智能卡管理装置可包括:处于第一层的控制器,处于第二层的总线扩展模块,处于第三层的多个智能控制模块,处于第四层的多个智能卡;As shown in FIG. 5A and FIG. 5B, FIG. 5A and FIG. 5B respectively show the architecture diagram of a smart card management apparatus provided by another embodiment of the present invention. The smart card management apparatus in this embodiment may include: The controller, the bus expansion module on the second layer, the multiple intelligent control modules on the third layer, and the multiple smart cards on the fourth layer;
在本实施例中,图5A的一级结构的总线扩展模块呈现/实现为虚拟的USB HUB(简称V-HUB),其下连接若干个智能卡控制模块(如91、92、93),并提供必要的其他配置功能。图5B中第一级结构的总线扩展模块对控制器呈现为虚拟的V-HUB,第二级结构的总线扩展模块对控制器也呈现为虚拟的V-HUB,每一级结构的每一个总线扩展模块可以连接若干智能卡控制模块,还可以借助USB接口的方式扩展连接下一级的总线扩展模块。In this embodiment, the bus expansion module of the primary structure of FIG. 5A is presented/implemented as a virtual USB HUB (V-HUB for short), and several smart card control modules (such as 91, 92, 93) are connected under it, and provide Other configuration functions necessary. The bus expansion module of the first-level structure in FIG. 5B presents a virtual V-HUB to the controller, and the bus expansion module of the second-level structure also presents a virtual V-HUB to the controller. The expansion module can be connected to several smart card control modules, and can also be connected to the next-level bus expansion module by means of a USB interface.
特别说明的是,每一级的每一个总线扩展模块均不是一个USB HUB的芯片,而是通过FPGA或CPLD来实现的一个USB HUB。It is particularly noted that each bus expansion module of each level is not a chip of a USB HUB, but a USB HUB realized by FPGA or CPLD.
在本实施例中,总线扩展层可包括:位于一个FPGA上的一级结构的总线扩展模块,且一级结构中有多个总线扩展模块。In this embodiment, the bus expansion layer may include: a bus expansion module of a primary structure located on one FPGA, and there are multiple bus expansion modules in the primary structure.
为方便理解,对该图5A所示的结构的数据转接过程进行说明。For the convenience of understanding, the data transfer process of the structure shown in FIG. 5A will be described.
1)总线扩展模块上电过程中,总线扩展模块待电压稳定后对控制器呈现为一个V-HUB,其下连接的智能卡控制模块91、92和93作为设备挂接在HUB上,但在初始化完成之前,总线控制模块暂时不会让智能卡控制模块91、92和93接入,完成以下开始初始化过才可正常接入并与主控制器通信。1) During the power-on process of the bus expansion module, the bus expansion module appears as a V-HUB to the controller after the voltage is stable, and the connected smart card control modules 91, 92 and 93 are connected to the HUB as devices, but during initialization Before the completion, the bus control module will not allow the smart card control modules 91, 92 and 93 to be connected for the time being. After completing the following initialization, it can be connected normally and communicate with the main controller.
在该总线扩展模块所在的FPGA在电源达到一定级别后才开始启动工作。The FPGA where the bus expansion module is located does not start to work until the power supply reaches a certain level.
在USB通信协议拓扑中有三类角色:主机(如控制器)、设备(如智能卡控制模块)、HUB。一般是设备直接与主机相连。当USB接口不够用时可以增加一个USB接口扩展器,然后又可以在上面插多个USB设备。这里的V-HUB类似上述的能够扩展USB接口扩展器的部件,如图5B所示。There are three types of roles in the USB communication protocol topology: host (such as controller), device (such as smart card control module), and HUB. Generally, the device is directly connected to the host. When the USB interface is not enough, you can add a USB interface extender, and then you can plug multiple USB devices on it. The V-HUB here is similar to the above-mentioned components capable of extending the USB interface extender, as shown in FIG. 5B .
此外,在其他实施例中,每一级的总线扩展模块可以实现1个USB HOST,也可以实现多个USB HOST,图5B仅为一个扩展的示意图,本实施例并不对其限定,根据实际USB接口扩展的需求进行USB的扩展。In addition, in other embodiments, the bus expansion module at each level can implement one USB HOST or multiple USB HOSTs. FIG. 5B is only a schematic diagram of an expansion, which is not limited in this embodiment. The requirement of interface expansion is to carry out the expansion of USB.
2)控制器初始化总线扩展模块,以使得智能卡控制模块91、92和93接入;2) The controller initializes the bus expansion module so that the smart card control modules 91, 92 and 93 are connected;
3)控制器初始化每一智能卡控制模块91、92和93,并记录其通信端点(USB通信协议中的通信端点),标记智能卡控制模块91、92和93的序号(用于后续与智能卡通信时的索引)。3) The controller initializes each smart card control module 91, 92 and 93, records its communication endpoint (the communication endpoint in the USB communication protocol), and marks the serial numbers of the smart card control modules 91, 92 and 93 (for subsequent communication with the smart card) index of).
USB通信都是以端点来实现交互访问的。一个设备可以有多个通信端点,可用于不同的操作。由于在HUB模式下,所有设备在主机的视角下都是同时可见的,为了避免通信的冲突需要给这些设备按一定顺序做好编号,为后续寻址智能卡做准备。USB communication is based on endpoints to achieve interactive access. A device can have multiple communication endpoints, which can be used for different operations. Since in HUB mode, all devices are visible at the same time from the host's perspective, in order to avoid communication conflicts, these devices need to be numbered in a certain order to prepare for the subsequent addressing of the smart card.
智能卡的序号是根据它连接在智能卡控制模块的不同引脚来定序的。The serial number of the smart card is sequenced according to the different pins it is connected to the smart card control module.
智能卡控制模块的序号会记录在控制器即主控制器中。The serial number of the smart card control module will be recorded in the controller, that is, the main controller.
4)控制器重复执行2)~3)步骤,直至所有智能卡控制模块全部初始化完毕。4) The controller repeats steps 2) to 3) until all smart card control modules are initialized.
以上便完成了总线初始化过程。当控制器需要与智能卡通信时,可以通过先前记录的索引信息找到智能卡控制模块的通信端点,然后将数据(外部终端的各数据)下发至智能卡控制模块,智能卡控制模块通过解析数据信息,再将数据下发至相应的智能卡就可以实现信息的交换。The above completes the bus initialization process. When the controller needs to communicate with the smart card, it can find the communication endpoint of the smart card control module through the previously recorded index information, and then send the data (each data of the external terminal) to the smart card control module. The exchange of information can be realized by sending the data to the corresponding smart card.
在完成初始化过程后,所有的智能卡控制模块在控制器视角下都是同时可见的,V-HUB类似一个USB接口扩展器,进而可以扩展出许许多多的USB接口,智能卡控制模块就连接在这些扩展出来的USB口上。当控制器要与某个智能卡控制模块通信时,只需要往相应的通信端点发数据就可以实现通信了。After completing the initialization process, all smart card control modules are visible at the same time from the controller's perspective. V-HUB is similar to a USB interface expander, which can expand many USB interfaces. The smart card control module is connected to these on the extended USB port. When the controller wants to communicate with a certain smart card control module, it only needs to send data to the corresponding communication endpoint to realize communication.
当智能卡执行完操作并返回结果后,需要将数据传回控制器时:When the smart card has performed the operation and returned the result, it needs to pass the data back to the controller:
1)智能卡控制模块接收并存储数据;1) The smart card control module receives and stores data;
2)控制器轮询(即使是中断传输模式,本质上USB也是轮询)至智能卡控制模块时,将数据上传,完成通信过程。由于此种方式下可使用中断传输方式,因此响应会很快。2) When the controller polls (even in interrupt transmission mode, essentially USB is polling) to the smart card control module, it uploads the data to complete the communication process. Since the interrupt transmission method can be used in this way, the response will be fast.
上述图3A至图5B所示的智能卡管理装置,可解决现有技术中需要使用大量分立多路开关、串并转换等等数字芯片,使得印制电路板需要大量空间用来放置这些元件,从而导致设备小型化困难,同时也带来了布线困难、稳定性差,成本高等问题。The above-mentioned smart card management device shown in FIGS. 3A to 5B can solve the need to use a large number of discrete multiplexers, serial-to-parallel conversion and other digital chips in the prior art, so that the printed circuit board needs a lot of space for placing these components, thus This makes it difficult to miniaturize the equipment, and also brings problems such as difficult wiring, poor stability, and high cost.
在本实施例中,借助一个FPGA或CPLD便轻松实现此功能,因此可以实现设备小型化、低成本、低功耗等。In this embodiment, this function can be easily realized by means of an FPGA or a CPLD, so the miniaturization, low cost, and low power consumption of the device can be realized.
另外,在图5A中,每一级的每一个总线扩展模块可以使用单独的FPGA来实现,或者每一级所有的总线扩展模块可以使用单独的FPGA来实现。In addition, in FIG. 5A , each bus expansion module of each stage may be implemented using a separate FPGA, or all bus expansion modules of each stage may be implemented using a separate FPGA.
需要说明的是,上述任一实施例中总线扩展层与上一层、下一层之间的协议可以相同(如可以是USB通信协议),也可以不同。图3A至图5B中示出的总线扩展层和上一层(即控制器所在的第一层)、下一层(即智能卡控制模块所在的第三层)的通信协议均是相同的协议的实例,在实际应用中,可以根据需要进行选择,并不进行限定。智能卡管理装置中控制器与总线扩展层中第一级的总线扩展模块之间的通信协议可为:UART协议、IIC协议、SPI协议、USB通信协议、CAN总线协议或以太网协议。总线扩展层中最后一级的总线扩展模块与该总线扩展模块连接的智能卡控制模块之间的通信协议也可以为UART协议、IIC协议、SPI协议、USB通信协议、CAN总线协议和以太网协议等协议中的一种。It should be noted that, in any of the above embodiments, the protocol between the bus extension layer, the upper layer and the lower layer may be the same (for example, a USB communication protocol), or may be different. The communication protocols of the bus extension layer and the upper layer (that is, the first layer where the controller is located) and the lower layer (that is, the third layer where the smart card control module is located) shown in FIG. 3A to FIG. 5B are all the same protocol. Examples, in practical applications, can be selected according to requirements, and are not limited. The communication protocol between the controller in the smart card management device and the first-level bus expansion module in the bus expansion layer may be: UART protocol, IIC protocol, SPI protocol, USB communication protocol, CAN bus protocol or Ethernet protocol. The communication protocol between the last bus expansion module in the bus expansion layer and the smart card control module connected to the bus expansion module can also be UART protocol, IIC protocol, SPI protocol, USB communication protocol, CAN bus protocol and Ethernet protocol, etc. one of the protocols.
上述任意的智能卡管理装置与现有技术进行比较,现有方式通过在控制器SPI总线上增加驱动器来的方式可以在一定程度上增加挂载从设备数量,但实际应用中效果并不好。主要原因是:一方面驱动器的带载能力也是有限的,在实际测试中,从设备数达到6个,其信号衰减变得很严重,18Mbps的总线理论速率,实测只能达到2Mbps左右,而且误码率很高;另一方面总线上增加了驱动器会使得总线上的信号产生延迟,走线不良也会导致时钟同步异常,信号畸变,从而使得控制器与从设备无法正常通信。Comparing any of the above-mentioned smart card management devices with the prior art, the prior art can increase the number of mounted slave devices to a certain extent by adding a driver on the SPI bus of the controller, but the effect is not good in practical application. The main reason is: On the one hand, the load capacity of the driver is also limited. In the actual test, when the number of slave devices reaches 6, the signal attenuation becomes very serious. The theoretical bus rate of 18Mbps can only reach about 2Mbps in the actual test, and the error is incorrect. The code rate is very high; on the other hand, adding a driver to the bus will delay the signal on the bus, and poor wiring will also cause abnormal clock synchronization and signal distortion, so that the controller and the slave device cannot communicate normally.
而在本发明实施例中,用USB总线方式进行数据传输,由于USB采用差分信号传输,其抗干扰能力远高于普通电平信号,而且USB2.0的理论速度可达480Mbps,USB3.0则可达惊人的5Gbps,因此传输速率远高于现有方案。In the embodiment of the present invention, the USB bus is used for data transmission. Since USB adopts differential signal transmission, its anti-interference ability is much higher than that of ordinary level signals, and the theoretical speed of USB2.0 can reach 480Mbps, while that of USB3.0 It can reach an astonishing 5Gbps, so the transmission rate is much higher than existing solutions.
另外,现有方式的扩展方式所挂载从设备数量与传输速度是一对矛盾体,即若多挂接从设备则无法保证通信速率,保证了通信速率则不能挂接太多从设备。因此在实际应用中,平衡两者的关系,目前应用中一般所能管理的卡数量比较少。In addition, the number of slave devices mounted and the transmission speed of the existing expansion method are contradictory, that is, if more slave devices are attached, the communication rate cannot be guaranteed, and if the communication rate is guaranteed, too many slave devices cannot be attached. Therefore, in practical applications, to balance the relationship between the two, the number of cards that can generally be managed in current applications is relatively small.
本实施例中仅在HUB模式下,一个控制器的USB host可以挂接127个总线扩展模块,一个总线扩展模块上又可实现若干个USB host。假定仅实现一个USB host,则其又可挂接127个智能卡控制模块。以一个智能卡控制模块控制8张智能卡算,一个控制器的USB口可以管理129032(127*127*8)张智能卡,如此惊人的规模可以满足几乎所有应用场景。而如果将总线扩展模块设计为级联模式,则数量更可呈指数级增长。In this embodiment, only in the HUB mode, 127 bus expansion modules can be attached to the USB host of one controller, and several USB hosts can be implemented on one bus expansion module. Assuming that only one USB host is implemented, 127 smart card control modules can be connected to it. If one smart card control module controls 8 smart cards, one USB port of the controller can manage 129032 (127*127*8) smart cards, and such an amazing scale can meet almost all application scenarios. And if the bus expansion module is designed in cascade mode, the number can be increased exponentially.
根据本发明实施例的另一方面,本发明实施例还提供一种智能卡系统,包括业务服务模块、外部终端和上述任意所述的智能卡管理装置,所述智能卡管理装置与业务服务模块交互,也与外部终端交互。According to another aspect of the embodiments of the present invention, the embodiments of the present invention further provide a smart card system, including a business service module, an external terminal, and any of the above-mentioned smart card management devices, the smart card management device interacting with the business service module, and also Interact with external terminals.
需要说明的是,FPGA是一种数字门电路的集成,在FPGA中具有大量的这些基础的门电路。通过对FPGA进行设计,可以实现各种各样的逻辑功能。本实施例中需要一块FPGA芯片就能实现上述各级总线扩展模块的功能,进而外部元件少,可以有效简化电路板走线,同时减少故障的概率,提高了智能卡管理装置的可靠性,实用性,有效降低了成本。It should be noted that FPGA is an integration of digital gate circuits, and there are a large number of these basic gate circuits in FPGA. Various logic functions can be realized by designing FPGA. In this embodiment, only one FPGA chip is needed to realize the functions of the above-mentioned bus expansion modules at all levels, and there are fewer external components, which can effectively simplify the circuit board wiring, reduce the probability of failure, and improve the reliability and practicability of the smart card management device. , effectively reducing the cost.
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本发明的范围。Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Skilled artisans may implement the described functionality using different methods for each particular application, but such implementations should not be considered beyond the scope of the present invention.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described systems, devices and units may refer to the corresponding processes in the foregoing method embodiments, which will not be repeated here.
在本申请所提供的实施例中,应该理解到,方法实施例的步骤之间除非存在明确的先后顺序,否则执行顺序可任意调整。所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the embodiments provided in this application, it should be understood that unless there is a clear sequence between steps in the method embodiments, the execution sequence can be adjusted arbitrarily. The disclosed apparatus and method can be implemented in other ways. For example, the apparatus embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored, or not implemented. On the other hand, the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者 网络设备等)执行本发明各个实施例所述方法的全部或部分步骤。The functions, if implemented in the form of software functional units and sold or used as independent products, may be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the embodiments of the present invention are essentially, or the parts that make contributions to the prior art or the parts of the technical solutions can be embodied in the form of software products, and the computer software products are stored in a storage medium , including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention.
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。It should be noted that, herein, the terms "comprising", "comprising" or any other variation thereof are intended to encompass non-exclusive inclusion, such that a process, method, article or device comprising a series of elements includes not only those elements, It also includes other elements not expressly listed or inherent to such a process, method, article or apparatus. Without further limitation, an element qualified by the phrase "comprising a..." does not preclude the presence of additional identical elements in a process, method, article or apparatus that includes the element.
本领域的技术人员能够理解,尽管在此所述的一些实施例包括其它实施例中所包括的某些特征而不是其它特征,但是不同实施例的特征的组合意味着处于本发明的范围之内并且形成不同的实施例。It will be understood by those skilled in the art that although some of the embodiments described herein include certain features, but not others, included in other embodiments, that combinations of features of the different embodiments are intended to be within the scope of the present invention And form different embodiments.
虽然结合附图描述了本发明的实施方式,但是本领域技术人员可以在不脱离本发明的精神和范围的情况下做出各种修改和变型,这样的修改和变型均落入由所附权利要求所限定的范围之内。Although the embodiments of the present invention have been described with reference to the accompanying drawings, various modifications and variations can be made by those skilled in the art without departing from the spirit and scope of the present invention, and such modifications and variations all fall within the scope of the appended claims within the limits of the requirements.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010882717.9A CN111948971A (en) | 2020-08-28 | 2020-08-28 | A smart card management device and data transfer method thereof |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010882717.9A CN111948971A (en) | 2020-08-28 | 2020-08-28 | A smart card management device and data transfer method thereof |
Publications (1)
Publication Number | Publication Date |
---|---|
CN111948971A true CN111948971A (en) | 2020-11-17 |
Family
ID=73366896
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010882717.9A Pending CN111948971A (en) | 2020-08-28 | 2020-08-28 | A smart card management device and data transfer method thereof |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111948971A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110569933A (en) * | 2019-09-02 | 2019-12-13 | 深圳市优克联新技术有限公司 | intelligent card management device and method |
CN112506839A (en) * | 2020-12-07 | 2021-03-16 | 天津津航计算技术研究所 | One-to-many SPI bus switching method and device |
CN113220085A (en) * | 2021-05-19 | 2021-08-06 | 北京百度网讯科技有限公司 | Server |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1417985A (en) * | 2001-11-08 | 2003-05-14 | 旺玖科技股份有限公司 | Universal serial bus compound device and its realization method |
CN1444752A (en) * | 2000-06-30 | 2003-09-24 | O2米克罗国际有限公司 | Smart card virtual concentrator |
US20070040834A1 (en) * | 2005-08-19 | 2007-02-22 | Intel Corporation | Method and apparatus for supporting universal serial bus devices in a virtualized environment |
CN103125097A (en) * | 2010-09-17 | 2013-05-29 | 甲骨文国际公司 | Perform partial subnet initialization in middleware machine context |
CN105487999A (en) * | 2015-12-25 | 2016-04-13 | 河海大学常州校区 | Cascaded large-scale USB expansion device and working method and system |
CN106887257A (en) * | 2017-03-16 | 2017-06-23 | 数据通信科学技术研究所 | A kind of many intelligent card test systems and method |
CN212411050U (en) * | 2020-08-28 | 2021-01-26 | 上海途鸽数据科技有限公司 | Smart card management device and smart card system |
-
2020
- 2020-08-28 CN CN202010882717.9A patent/CN111948971A/en active Pending
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1444752A (en) * | 2000-06-30 | 2003-09-24 | O2米克罗国际有限公司 | Smart card virtual concentrator |
CN1417985A (en) * | 2001-11-08 | 2003-05-14 | 旺玖科技股份有限公司 | Universal serial bus compound device and its realization method |
US20070040834A1 (en) * | 2005-08-19 | 2007-02-22 | Intel Corporation | Method and apparatus for supporting universal serial bus devices in a virtualized environment |
CN101243396A (en) * | 2005-08-19 | 2008-08-13 | 英特尔公司 | Method and apparatus for supporting universal serial bus devices in a virtualized environment |
CN103125097A (en) * | 2010-09-17 | 2013-05-29 | 甲骨文国际公司 | Perform partial subnet initialization in middleware machine context |
CN105487999A (en) * | 2015-12-25 | 2016-04-13 | 河海大学常州校区 | Cascaded large-scale USB expansion device and working method and system |
CN106887257A (en) * | 2017-03-16 | 2017-06-23 | 数据通信科学技术研究所 | A kind of many intelligent card test systems and method |
CN212411050U (en) * | 2020-08-28 | 2021-01-26 | 上海途鸽数据科技有限公司 | Smart card management device and smart card system |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110569933A (en) * | 2019-09-02 | 2019-12-13 | 深圳市优克联新技术有限公司 | intelligent card management device and method |
US12099891B2 (en) | 2019-09-02 | 2024-09-24 | Shenzhen Ucloudlink New Technology Co., Ltd. | Smart card management device and smart card management method |
CN110569933B (en) * | 2019-09-02 | 2024-10-22 | 深圳市优克联新技术有限公司 | Smart card management device and method |
CN112506839A (en) * | 2020-12-07 | 2021-03-16 | 天津津航计算技术研究所 | One-to-many SPI bus switching method and device |
CN112506839B (en) * | 2020-12-07 | 2023-02-03 | 天津津航计算技术研究所 | One-to-many SPI bus switching method and device |
CN113220085A (en) * | 2021-05-19 | 2021-08-06 | 北京百度网讯科技有限公司 | Server |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN116501681B (en) | CXL data transmission board card and method for controlling data transmission | |
KR102420530B1 (en) | Alternative protocol selection | |
CN111948971A (en) | A smart card management device and data transfer method thereof | |
CN106959935A (en) | A kind of method that compatible I2C communications communicate with IPMB | |
CN115017083A (en) | Data transmission system, data transmission device and data transmission method | |
WO2025130245A1 (en) | High-speed optical communication connector and server | |
CN110635985A (en) | FlexRay-CPCIe communication module | |
CN212112457U (en) | a bus controller | |
CN101369948B (en) | Communication system implementing low-power consumption | |
CN101163308B (en) | Intelligent platform management controller | |
CN1316388C (en) | USB control circuit suitable for computer-to-computer transmission and its working method | |
CN111858459B (en) | Processor and computer | |
CN111417034A (en) | Switch and hot plug method, device and system for switch board card thereof | |
CN103885910A (en) | Method and system for multiple devices for IIC communication in main mode | |
CN115221087A (en) | Method for realizing KCS communication based on SPI bus | |
CN101599050B (en) | Adaptable pci express controller core and method | |
CN112199312B (en) | Interface conversion device of communication equipment and communication system | |
CN212411050U (en) | Smart card management device and smart card system | |
CN113127400B (en) | FPGA-based multi-channel serial port server and data transmission method thereof | |
CN216772401U (en) | A system for realizing main control function of main equipment | |
CN207833500U (en) | A kind of 40G rate network interface cards for supporting non-standard interface | |
CN115599721A (en) | Port switching method, system, computing device and chip | |
CN115905069A (en) | A kind of USB data transmission method and device based on BMC chip | |
CN211349344U (en) | A motherboard and server | |
CN104123257A (en) | Universal serial bus device, communication method, and computer-readable storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |