CN111948971A - Intelligent card management device and data switching method thereof - Google Patents

Intelligent card management device and data switching method thereof Download PDF

Info

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
bus
layer
module
controller
smart card
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
Application number
CN202010882717.9A
Other languages
Chinese (zh)
Inventor
周林林
王凯航
周好
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Toupigeon Data Technology Co ltd
Original Assignee
Shanghai Toupigeon Data Technology Co ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Shanghai Toupigeon Data Technology Co ltd filed Critical Shanghai Toupigeon Data Technology Co ltd
Priority to CN202010882717.9A priority Critical patent/CN111948971A/en
Publication of CN111948971A publication Critical patent/CN111948971A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Programme-control systems
    • G05B19/02Programme-control systems electric
    • G05B19/04Programme control other than numerical control, i.e. in sequence controllers or logic controllers
    • G05B19/042Programme control other than numerical control, i.e. in sequence controllers or logic controllers using digital processors
    • G05B19/0423Input/output
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B2219/00Program-control systems
    • G05B2219/20Pc systems
    • G05B2219/25Pc structure of the system
    • G05B2219/25257Microcontroller

Abstract

The embodiment of the invention relates to a smart card management device and a data switching method thereof, wherein the smart card management device is a four-layer structure with a bus extension layer, and comprises the following steps: the controller is arranged on the first layer, the plurality of intelligent card control modules are arranged on the third layer, and the plurality of intelligent cards are arranged on the fourth layer; the second layer is a bus extension layer for realizing the communication between the controller and each smart card control module, and the bus extension layer comprises: the bus expansion module of the primary structure or the bus expansion module of the multilevel structure which is connected in a cascading way; each bus expansion module at the last stage in the bus expansion layer is connected with a first preset number of intelligent card control modules; each intelligent card control module is connected with a second preset number of intelligent cards; all bus extension modules of the same level structure are integrated on a programmable device of an FPGA or a CPLD. The management device has the advantages of simple wiring, low cost and high flexibility.

Description

Intelligent card management device and data switching method thereof
Technical Field
The embodiment of the invention relates to a bus technology, in particular to an intelligent card management device and a data switching method thereof.
Background
With the continuous development of the technology, the integration level of the microcontroller is higher and higher, and the carried peripheral interfaces are richer and richer. For example, not only a large-scale data processing unit such as a CPU and a GPU is Integrated on a small embedded SoC (System-on-a-Chip), but also the embedded SoC usually carries interfaces for communicating with external devices such as UART (Universal Asynchronous Receiver/Transmitter), USB, IIC (Inter-Integrated Circuit), SPI (Serial Peripheral Interface), and the like, so as to collect external sensor data or communicate with other devices.
Although the existing controller chip has higher integration and richer interfaces, for some special application scenarios (such as large-scale sensor arrays, smart card management devices, etc.), the controller is often required to communicate with hundreds of sensors or smart cards, and the number of peripheral interfaces carried by the controller itself is very limited. Therefore, an effective bus expansion method is needed to solve such problems.
Disclosure of Invention
In order to solve the problems in the prior art, at least one embodiment of the present invention provides a smart card management apparatus and a data forwarding method thereof.
In a first aspect, an embodiment of the present invention provides a smart card management apparatus, where the smart card management apparatus has a four-layer structure with a bus extension layer;
the smart card management apparatus includes: the controller is arranged on the first layer, the plurality of intelligent card control modules are arranged on the third layer, and the plurality of intelligent cards are arranged on the fourth layer;
the second layer is a bus extension layer for realizing the communication between the controller and each smart card control module, and the bus extension layer comprises: the bus expansion module of the primary structure or the bus expansion module of the multilevel structure which is connected in a cascading way;
each bus expansion module at the last stage in the bus expansion layer is connected with a first preset number of intelligent card control modules;
each intelligent card control module is connected with a second preset number of intelligent cards;
wherein, part/all bus extension modules of the same level structure are integrated on one programmable device.
In some embodiments, the communication protocol between the controller and the bus extension module of the first level in the second layer is one of the following protocols:
UART protocol, IIC protocol, SPI protocol, USB communication protocol, CAN bus protocol and Ethernet protocol;
the communication protocol between the last-stage bus extension module in the second layer and the smart card control module connected with the bus extension module is one of the following protocols:
UART protocol, IIC protocol, SPI protocol, USB communication protocol, CAN bus protocol and Ethernet protocol.
In some embodiments, the communication protocols used among the modules of the first, second and third layers are the same;
and/or the communication protocol used among the modules of the first layer, the second layer and the third layer is a USB communication protocol;
and/or the bus extension layer is different from the communication protocol used by the upper layer and the lower layer;
and/or, at the bus extension layer, all bus extension modules of the same level structure are integrated on one FPGA or CPLD.
In some embodiments, the bus extension layer comprises a primary structure of bus extension modules, and each bus extension module of the primary structure is a virtual USB HUB;
and/or the presence of a gas in the gas,
the bus expansion layer comprises bus expansion modules with a multi-stage structure, and each bus expansion module of each stage of structure is a virtual USB HUB;
each USB HUB in each level structure is connected with a plurality of intelligent card control modules and is also connected with the bus expansion module of the next level.
In some embodiments, the bus extension layer comprises a multi-stage structure of bus extension modules, each bus extension module of each stage being implemented by one FPGA/CPLD.
In a second aspect, an embodiment of the present invention further provides a smart card system, including a service module, an external terminal, and the smart card management apparatus in any one of the first aspects, where the smart card management apparatus interacts with the service module and also interacts with the external terminal.
In a third aspect, an embodiment of the present invention further provides a data forwarding method based on any one of the smart card management devices in the first aspect, where the method includes:
the method comprises the steps that a controller receives a service request of an external terminal, wherein the service request carries an intelligent card identifier;
the controller acquires the identifications of all bus extension modules and the identifications of the intelligent card control modules which are associated with the intelligent card identification according to the intelligent card identification;
the method comprises the steps that a controller service request and identifications of all bus extension modules send a control instruction to a bus extension module to which the identification of a first-level bus extension module belongs, so that the bus extension module bridges a controller data line to an intelligent card control module corresponding to the identification of the intelligent card control module based on the identifications of all bus extension modules;
and when the controller receives a preparation response of the control command fed back by the last-stage bus expansion module in the bus expansion layer, the controller establishes data connection with the intelligent card control module so as to realize the intelligent card communication corresponding to the intelligent card identification.
In some embodiments, after the last bus extension module feeds back the preparation response, the last bus extension module switches to a listening state for listening to the control command sent by the controller so as to switch the communication of other smart cards.
In some embodiments, the controller establishes a data connection with the smart card control module, including:
and the controller performs corresponding configuration according to the data information provided by the intelligent card control module.
In some embodiments, where the bus expansion module is a virtual USB HUB,
the controller initializes each bus expansion module of each level in the bus expansion layer to access each intelligent card control module in each bus expansion module and records the communication end point of each intelligent card control module;
correspondingly, after receiving a service request of an external terminal, the controller searches the communication endpoint of the intelligent card control module according to the pre-recorded index information including the communication endpoint, and establishes data connection with the intelligent card control module to realize intelligent card communication corresponding to the intelligent card identifier.
It can be seen that, in at least one embodiment of the embodiments of the present invention, the smart card management apparatus is provided with a bus extension layer, and the bus extension layer may include: the bus expansion module with the primary structure or the bus expansion module with the multi-stage structure which is connected in a cascading mode achieves flexible expansion.
In addition, all bus extension modules of the same-level structure are integrated on one programmable device, so that the purposes of simple wiring, low cost, better signal quality and higher communication speed are achieved.
The intelligent card management device solves the problems that in the prior art, a plurality of discrete digital logic units are adopted as switching devices of bus signals, so that the whole devices are more, the cost is high, and the stability is reduced, also solves the problem that in the prior art, too many discrete devices are not beneficial to the miniaturization design of a printed circuit board, and further solves the problems that the communication speed is reduced and the error rate is increased due to overlarge fan-out of the bus.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required to be used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to these drawings without inventive labor.
FIG. 1 is a block diagram of a direct expansion logic corresponding to one scheme in the prior art;
FIG. 2 is a diagram of a multi-level expansion framework corresponding to another solution in the prior art;
fig. 3A and fig. 3B are architecture diagrams of a smart card management apparatus according to an embodiment of the present invention;
FIG. 4 is a flowchart illustrating a data forwarding method of the smart card management device of FIG. 3A;
fig. 5A and 5B are architecture diagrams of another smart card management apparatus according to an embodiment of the present invention.
Detailed Description
In order to make the objects, 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 drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be obtained by a person skilled in the art without any inventive step based on the embodiments of the present invention, are within the scope of the present invention.
It is noted that, in this document, relational terms such as "first" and "second," and the like, may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions.
In order to better understand the bus extension structure of the smart card management device in the embodiment of the present invention, a manner of extending each bus of the smart card management device in the related art will be described.
Because the smart card in the smart card management device adopts the ISO7816 protocol for communication, the smart card management device in the current market mainly has two bus extension methods:
the first bus extension method is to use a digital logic unit (such as a multi-way switch) as a main component, and to control a channel selection pin of the digital logic unit, thereby realizing connection of a UART pin of a controller and an intelligent card, and realizing time-sharing communication.
As shown in fig. 1, when the controller is to communicate with the smart card, a routing signal is first sent to the multi-way switch. And after receiving the signals, the multi-way switch respectively switches the communication signal lines of the controller to the corresponding communication signal lines of the intelligent card according to the routing signals. If the route is 0, the controller signal line is connected to the smart card 1a, and if the route is 1, the controller signal line is connected to the smart card 2 a.
However, the bus extension method described above has the following drawbacks:
a) since the response rates of the multi-way switches in different batches, different manufacturers and different models are different, after the controller sends the routing signal, the controller needs to wait for a long enough time (generally tens of milliseconds to hundreds of milliseconds) to try to communicate with the smart card. Otherwise data loss may result.
b) The multi-way switch generally adopts 1 from 8, has a large volume, and needs to occupy a large amount of PCB space if more communication signal lines, such as SPI4 lines, are provided.
c) The UART is asynchronous, so the smart card may send a message to the controller at any time, which may result in upstream data loss if the controller has not chosen to communicate with it. For example, when the smart card 2a has information to send to the controller, and the controller is communicating with the smart card 1a, the information of the smart card 2a cannot be obtained by the controller.
The second bus extension method is mainly used for solving the c) defect in the first bus extension method. Based on the foregoing description, the bus extension of the first method may cause the loss of asynchronous communication data such as UART. Therefore, in the second method, a single chip is added between the controller and the smart card as a data buffer of the smart card. When the controller is not communicated with the controller, if the smart card has data to be sent to the controller, the singlechip connected with the smart card caches the data first, and the data is sent to the controller when the controller is communicated with the singlechip. The data loss defect in the first scheme has been solved to this scheme, simultaneously, because the singlechip all can have a plurality of UART interfaces, the relative direct extension of extension quantity promotes to some extent.
As shown in fig. 2, when the controller needs to communicate with an "appointed smart card" connected to the smart card controller 1n, the controller is gated by a routing signal, the step is the same as the first method, and then the data is sent to the "single chip microcomputer", and the single chip microcomputer receives the data and then initiates communication with the "appointed smart card". When the 'appointed intelligent card' has data to return, the data is received and cached by the 'single chip microcomputer'. The processing then needs to be done according to two different situations: a) when the controller is still communicated with the single chip microcomputer, the data are directly sent to the controller and the cache is cleared; b) the controller is disconnected (reaching a certain overtime) with the singlechip, and the data is cached until the next time the controller is communicated with the singlechip again and then uploaded.
However, the drawbacks are as follows: 1) circuit elements are increased, and the operation is complex;
2) in general practice, a level of switch is often added between the smart card controller and the controller bus, so as to try to increase the number of hooked smart controllers, but this further complicates the circuit, and the increase of components not only increases the cost, but also decreases the stability of the system;
3) the operation is complex, the waiting time for bus switching is increased, and the communication efficiency is reduced;
4) in practical applications, the loading capacity of the bus is limited, and hanging too many slaves on the bus will cause the timing setup time of the bus to be longer and the waveform to be poor, so that the communication rate must be reduced to ensure the communication quality.
In order to better solve the problem that the bus expansion scheme shown in fig. 2 adopts a plurality of discrete digital logic units as switching devices of bus signals, so that the whole equipment has more elements, high cost and reduced stability; and too many discrete components are not conducive to the miniaturized design of the printed circuit board; too large a bus fan-out leads to problems of reduced communication rate, increased error rate, etc.
The embodiment of the invention provides a smart card management device which can be a four-layer structure with a bus expansion layer. The smart card management apparatus of the present embodiment may include: the controller is arranged on the first layer, the plurality of intelligent card control modules are arranged on the third layer, and the plurality of intelligent cards are arranged on the fourth layer; the second layer is a bus extension layer for realizing the communication between the controller and each smart card control module, and the bus extension layer comprises: the bus expansion module of the primary structure or the bus expansion module of the multilevel structure which is connected in a cascading way;
each bus expansion module at the last stage in the bus expansion layer is connected with a first preset number of intelligent card control modules;
each intelligent card control module is connected with a second preset number of intelligent cards;
all bus extension modules of the same level structure are integrated on a Programmable Device, such as an FPGA (Field Programmable Gate Array) or a CPLD (Complex Programmable Logic Device).
In this embodiment, the smart card management device is provided with a bus extension layer, and the bus extension layer can be used for connecting the bus extension modules in a cascading manner, so that flexible extension is realized. In addition, all bus extension modules with 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 speed.
As shown in fig. 3A, fig. 3A shows an architecture diagram of a smart card management apparatus according to an embodiment of the present invention, where the smart card management apparatus of this embodiment may include: the controller at the first layer, the bus expansion module 31 and the bus expansion module 32 at the second layer, the plurality of intelligent control modules at the third layer, and the plurality of intelligent cards at the fourth layer;
the controller is communicated with each bus expansion module through a USB communication protocol, and each bus expansion module is communicated with each smart card control module through the USB communication protocol. The data communication between each smart 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.
In this embodiment, the bus extension layer may include: the bus expansion module is located on one FPGA and has a primary structure, and a plurality of bus expansion modules are located in the primary structure, and a bus expansion module 31 and a bus expansion module 32 are shown in FIG. 3A.
In fig. 3A, the bus extension module 31 is connected to a plurality of smart card control modules, such as the smart card control modules 41 and 42 shown in fig. 3A, and the bus extension module 32 may also be connected to a plurality of smart card control modules, such as the smart card control modules 51 and 52, which is not limited in this embodiment.
It should be noted that the use of FPGA for the bus extension modules 31 and 32 is only one of the practically selected devices, and the bus extension modules are mainly used for connecting the data forwarding and controlling functions of the smart card control module and the controller. Generally, the Smart card control module may be formed by a single chip plus peripheral components, and may implement communication interaction with a Smart card (i.e. a SIM card) through its Smart card, UART (Universal Asynchronous Receiver/Transmitter) interface or GPIO (General-purpose input/output), and perform management operation on the Smart card.
In this embodiment, the controller is used as a USB host on a USB controller (i.e. a bus extension module) where the smart card control module is connected to the controller as a USB device. Before the two parties start to communicate, the smart card control module needs to configure itself, declare to the USB host what kind of device it is, and what way to communicate in the subsequent communication process. These data messages are preset when programming the smart card control module.
Besides being hooked in the mode of the scheme, the FPGA can also be hooked in a cascading mode, so that exponential multiplication of the number of hooked equipment is achieved, and the method is shown in figure 3B.
It will be appreciated that in fig. 3A and 3B each bus control module is responsible for communication between the controller and each smart card control module, similar to a switch function. Fig. 3A and 3B are merely schematic illustrations, and are not limited in number.
For better understanding of the data forwarding method of the smart card management apparatus shown in fig. 3A, the following description is made in conjunction with fig. 4.
When the controller needs to communicate with the smart card 11, the steps may include the following steps:
401. the controller receives a service request of an external terminal, wherein the service request carries the identification of the smart card.
In this embodiment, the smart card identifier may be a smart card number. The serial numbers of the smart cards in this embodiment may be serial numbers that facilitate management by the smart card management device, and are configured according to actual needs, for example, one smart card control module is connected with 8 smart cards, and one smart card management device is connected with 100 smart card control modules after bus expansion, so that one smart card management device manages 800 smart cards. At this time, each smart card can be numbered by 1-800. The present embodiment does not limit the numbering manner, and is configured according to actual needs.
402. The controller obtains the identifications of all bus extension modules (such as the bus extension module 31) and the identification of a smart card control module (such as the smart card control module 41) associated with the smart card identification according to the smart card identification.
In practical application, the controller stores a table or mapping relationship of the identification of the smart card control module and the bus extension module associated with each smart card.
403. And the controller service request and the identifications of all the bus expansion modules send a control instruction 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 line to the intelligent card control module corresponding to the identification of the intelligent card control module based on the identifications of all the bus expansion modules.
That is, the controller sends a control command to the bus expansion module 31, the bus expansion module 31 bridges the controller data line to the smart card control module 41 after receiving the control command, and the other smart card control modules are disconnected from the controller, so as to ensure that only one smart card control module is connected to the controller at any time.
In this embodiment, the bus extension module is a "hardware programming" device, and is usually designed using HDL language, for this reason, the bus extension module 31 realizes that the hardware bridging conversion is data line bridging after receiving the control instruction.
404. And the controller receives a ready response (i.e. ready response) of the control command fed back by the last-stage bus expansion module and establishes data connection with the intelligent card control module so as to realize the intelligent card communication corresponding to the intelligent card identification.
It should be noted that, when the bus extension layer is of a multi-level cascade structure, in order to ensure that all levels of bus extension modules of the bus extension layer are ready, the controller may establish data connection with the smart card control module when receiving a ready response fed back by the bus extension module of the last level. The last stage in this embodiment may be a stage directly connected to the smart card control module as a last stage bus extension module.
With the structure shown in fig. 3A, the bus extension 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 enters a listening state. At the same time, the bus extension module 31 also feeds back a preparation response to the smart card control module 41.
The smart card control module 41 is further connected with the controller, and the controller completes corresponding configuration (the default communication endpoint 0 is used for configuring the contents of the USB communication protocols such as read and write endpoints and the like respectively) according to the data information provided by the smart card control module 41; the controller transmits the data to the smart card control module 41; the smart card control module 41 finds the corresponding smart card 11 according to the received data information, and issues the data to the corresponding smart card 11, thereby completing one data issue. The data issued to the smart card 11 at this time may be understood as data of an application request from an external terminal, such as an authentication request initiated by the mobile network to the SIM card, received from the internet access.
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 immediately performs the switching operation, and repeats the above process again. It will be appreciated that the bus extension module enters a listening state in order to listen for a command from the controller to switch channels (to communicate with another smart card control module), which ultimately enables communication with other smart cards.
When the smart card finishes executing the operation (such as the operation of reading and writing the smart card) and returns the result, the data needs to be transmitted back to the controller:
1) the smart card control module 41 receives and stores data;
2) when the controller polls the smart card control module 41 again, the data is uploaded to complete the communication process.
As shown in fig. 5A and 5B, fig. 5A and 5B respectively show an architecture diagram of a smart card management device according to another embodiment of the present invention, where the smart card management device of this embodiment may include: the intelligent control system comprises a controller on a first layer, a bus expansion module on a second layer, a plurality of intelligent control modules on a third layer and a plurality of intelligent cards on a fourth layer;
in the present embodiment, the bus extension module of the one-level structure of fig. 5A is represented/implemented as a virtual USB HUB (abbreviated as V-HUB), under which several smart card control modules (e.g., 91, 92, 93) are connected, and provide other necessary configuration functions. In fig. 5B, the bus expansion module of the first level structure appears as a virtual V-HUB to the controller, the bus expansion module of the second level structure also appears as a virtual V-HUB to the controller, each bus expansion module of each level structure can be connected to a plurality of smart card control modules, and can also be connected to the bus expansion module of the next level by means of USB interface.
It is specifically noted that each bus expansion module of each stage is not a chip of a USB HUB, but a USB HUB implemented by FPGA or CPLD.
In this embodiment, the bus extension layer may include: the bus expansion module is positioned on one FPGA and has a primary structure, and the primary structure is provided with a plurality of bus expansion modules.
For ease of understanding, the data transfer process of the configuration shown in fig. 5A will be described.
1) In the power-on process of the bus extension module, the bus extension module presents a V-HUB to the controller after voltage is stabilized, the smart card control modules 91, 92 and 93 connected below the bus extension module are hung on the HUB as equipment, but before initialization is completed, the bus control module can not allow the smart card control modules 91, 92 and 93 to be connected temporarily, and after the initialization is completed, the bus extension module can be normally connected and communicated with the main controller.
The FPGA where the bus extension module is located starts to work after the power supply reaches a certain level.
There are three types of roles in the USB communication protocol topology: host (e.g., controller), device (e.g., smart card control module), HUB. Typically, the device is directly connected to the host. When the USB interface is not enough, a USB interface expander can be added, and then a plurality of USB devices can be plugged on the USB interface expander. The V-HUB here is similar to the components described above that are capable of expanding a USB interface expander, as shown in FIG. 5B.
In addition, in other embodiments, each level of the bus expansion module may implement 1 USB HOST, or may implement multiple USB HOSTs, and fig. 5B is only an expanded schematic diagram, which is not limited in this embodiment, and the expansion of the USB is performed according to the requirement of the actual USB interface expansion.
2) The controller initializes the bus expansion module to make the smart card control modules 91, 92 and 93 access;
3) the controller initializes each smart card control module 91, 92 and 93 and records its communication endpoint (communication endpoint in the USB communication protocol), marks the serial number (index for subsequent communication with the smart card) of the smart card control module 91, 92 and 93.
USB communications are endpoints that enable interactive access. A device may have multiple communication endpoints that may be used for different operations. Since in HUB mode all devices are visible at the same time from the perspective of the host, in order to avoid collisions of communications, the devices need to be numbered in a certain order in preparation for 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 is recorded in the controller, i.e. the main controller.
4) And the controller repeatedly executes the steps 2) to 3) until all the intelligent card control modules are completely initialized.
This completes the bus initialization process. When the controller needs to communicate with the smart card, the communication end point of the smart card control module can be found through the index information recorded previously, then the data (each data of the external terminal) is sent to the smart card control module, and the smart card control module can realize information exchange by analyzing the data information and sending the data to the corresponding smart card.
After the initialization process is completed, all the intelligent card control modules are visible at the same time under the view angle of the controller, the V-HUB is similar to a USB interface expander, and further a great number of USB interfaces can be expanded, and the intelligent card control modules are connected to the expanded USB interfaces. When the controller needs to communicate with a certain intelligent card control module, the communication can be realized only by sending data to the corresponding communication end.
When the smart card has finished executing the operation and returns the result, the data needs to be transmitted back to the controller:
1) the intelligent card control module receives and stores data;
2) when the controller polls (even in an interrupt transmission mode, the USB basically polls) to the smart card control module, the data is uploaded, and the communication process is completed. Since the interrupt transmission mode can be used in this mode, the response is fast.
The smart card management apparatus shown in fig. 3A to 5B can solve the problem that in the prior art, a large number of discrete multi-way switches, serial-to-parallel conversion and other digital chips are required, so that a printed circuit board requires a large amount of space for placing these components, which causes difficulty in miniaturization of the device, and also causes difficulty in wiring, poor stability, high cost and the like.
In the embodiment, the function is easily realized by using one FPGA or CPLD, so that the miniaturization, low cost, low power consumption and the like of the device can be realized.
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.
It should be noted that, in any of the above embodiments, the protocol between the bus extension layer and the previous and next layers may be the same (for example, may be a USB communication protocol), or may be different. The communication protocols of the bus extension layer and the upper layer (i.e. the first layer where the controller is located) and the lower layer (i.e. the third layer where the smart card control module is located) shown in fig. 3A to fig. 5B are all examples of the same protocol, and in practical applications, the communication protocols may be selected according to needs, and are not limited. The communication protocol between the controller and the first-level bus extension module in the bus extension layer in the smart card management device may be: a UART protocol, an IIC protocol, an SPI protocol, a USB communication protocol, a CAN bus protocol or an Ethernet protocol. The communication protocol between the last bus extension module in the bus extension layer and the smart card control module connected with the bus extension module CAN also be one of UART protocol, IIC protocol, SPI protocol, USB communication protocol, CAN bus protocol, Ethernet protocol and the like.
Compared with the prior art, the arbitrary smart card management device can increase the number of the mounted slave devices to a certain extent by adding the driver to the SPI bus of the controller in the prior art, but the effect is not good in practical application. The main reasons are: on one hand, the loading capacity of the driver is limited, in the practical test, the number of slave devices reaches 6, the signal attenuation of the slave devices becomes serious, the bus theoretical rate of 18Mbps can only reach about 2Mbps in the actual measurement, and the bit error rate is very high; on the other hand, the addition of the driver on the bus can delay signals on the bus, and poor routing can also cause clock synchronization abnormality and signal distortion, so that the controller and the slave device cannot normally communicate.
In the embodiment of the invention, the data transmission is carried out in a USB bus mode, because the USB adopts differential signal transmission, the anti-interference capability of the USB is far higher than that of a common level signal, the theoretical speed of the USB2.0 can reach 480Mbps, and the USB3.0 can reach 5Gbps surprisingly, so the transmission rate is far higher than that of the existing scheme.
In addition, the number of slave devices mounted and the transmission speed in the conventional extension method are a pair of spears, that is, if a plurality of slave devices are mounted, the communication rate cannot be guaranteed, and if the communication rate is guaranteed, a plurality of slave devices cannot be mounted. Therefore, in practical application, the relationship between the two is balanced, and the number of cards generally managed in the current application is small.
In this embodiment, only in the HUB mode, the USB host of one controller may be hooked with 127 bus extension modules, and one bus extension module may be provided with a plurality of USB hosts. Assuming only one USB host is implemented, it may in turn hook 127 smartcard control modules. The USB port of a controller can manage 129032 (127 x 8) smart cards by controlling 8 smart cards with a smart card control module, so that the amazing scale can meet almost all application scenarios. Whereas the number can be increased more exponentially if the bus expansion modules are designed in cascade mode.
According to another aspect of the embodiments of the present invention, an embodiment of the present invention further provides a smart card system, which includes a service module, an external terminal, and any of the smart card management apparatuses described above, where the smart card management apparatus interacts with the service module and also interacts with the external terminal.
It should be noted that an FPGA is an integration of digital gates, and there are a large number of these basic gates in the FPGA. By designing the FPGA, various logic functions can be realized. The function of bus extension module at above-mentioned each level just needs an FPGA chip to realize in this embodiment, and then the external component is few, can effectively simplify the circuit board and walk the line, reduces the probability of trouble simultaneously, has improved smart card management device's reliability, and the practicality has effectively reduced the cost.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the embodiments provided in the present application, it should be understood that the execution sequence of the steps of the method embodiments can be arbitrarily adjusted unless there is an explicit precedence sequence. The disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present invention may be essentially implemented or make a contribution to the prior art, or may be implemented in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the methods described in the embodiments of the present invention.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
Those skilled in the art will appreciate that although some embodiments described herein include some features included in other embodiments instead of others, combinations of features of different embodiments are meant to be within the scope of the invention and form different embodiments.
Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the invention, and such modifications and variations fall within the scope defined by the appended claims.

Claims (10)

1. The intelligent card management device is characterized in that the intelligent card management device is of a four-layer structure with a bus extension layer;
the smart card management apparatus includes: the controller is arranged on the first layer, the plurality of intelligent card control modules are arranged on the third layer, and the plurality of intelligent cards are arranged on the fourth layer;
the second layer is a bus extension layer for realizing the communication between the controller and each smart card control module, and the bus extension layer comprises: the bus expansion module of the primary structure or the bus expansion module of the multilevel structure which is connected in a cascading way;
each bus expansion module at the last stage in the bus expansion layer is connected with a first preset number of intelligent card control modules;
each intelligent card control module is connected with a second preset number of intelligent cards;
wherein, part/all bus extension modules of the same level structure are integrated on one programmable device.
2. The smart card management apparatus according to claim 1, wherein:
the communication protocol between the controller and the bus extension module of the first level in the second layer is one of the following protocols:
UART protocol, IIC protocol, SPI protocol, USB communication protocol, CAN bus protocol and Ethernet protocol;
the communication protocol between the last-stage bus extension module in the second layer and the smart card control module connected with the bus extension module is one of the following protocols:
UART protocol, IIC protocol, SPI protocol, USB communication protocol, CAN bus protocol and Ethernet protocol.
3. The smart card management apparatus according to claim 1, wherein:
the communication protocols used among the modules of the first layer, the second layer and the third layer are the same;
and/or the communication protocol used among the modules of the first layer, the second layer and the third layer is a USB communication protocol;
and/or the bus extension layer is different from the communication protocol used by the upper layer and the lower layer;
and/or, at the bus extension layer, all bus extension modules of the same level structure are integrated on one FPGA or CPLD.
4. The smart card management apparatus according to claim 1, wherein:
the bus extension layer comprises bus extension modules of a primary structure, and each bus extension module of the primary structure is a virtual USB HUB;
and/or the presence of a gas in the gas,
the bus expansion layer comprises bus expansion modules with a multi-stage structure, and each bus expansion module of each stage of structure is a virtual USB HUB;
each USB HUB in each level structure is connected with a plurality of intelligent card control modules and is also connected with the bus expansion module of the next level.
5. The smart card management apparatus according to claim 4, wherein:
the bus expansion layer comprises bus expansion modules with a multi-stage structure, and each bus expansion module at each stage is realized by one FPGA/CPLD.
6. A smart card system comprising a service module and an external terminal, characterized in that it further comprises a smart card management device according to any one of the preceding claims 1 to 5, said smart card management device interacting with the service module and also with the external terminal.
7. A data transfer method based on the smart card management device of any one of claims 1 to 5, comprising:
the method comprises the steps that a controller receives a service request of an external terminal, wherein the service request carries an intelligent card identifier;
the controller acquires the identifications of all bus extension modules and the identifications of the intelligent card control modules which are associated with the intelligent card identification according to the intelligent card identification;
the method comprises the steps that a controller service request and identifications of all bus extension modules send a control instruction to a bus extension module to which the identification of a first-level bus extension module belongs, so that the bus extension module bridges a controller data line to an intelligent card control module corresponding to the identification of the intelligent card control module based on the identifications of all bus extension modules;
and when the controller receives a preparation response of the control command fed back by the last-stage bus expansion module in the bus expansion layer, the controller establishes data connection with the intelligent card control module so as to realize the intelligent card communication corresponding to the intelligent card identification.
8. The method of claim 7, wherein after the last bus extension module feeds back the ready response, the last bus extension module switches to a listening state for listening to the controller sending control commands to switch communications of other smart cards.
9. The method of claim 7, wherein the controller establishes a data connection with a smart card control module, comprising:
and the controller performs corresponding configuration according to the data information provided by the intelligent card control module.
10. The method of claim 7, wherein when the bus extension module is a virtual USB HUB,
the controller initializes each bus expansion module of each level in the bus expansion layer to access each intelligent card control module in each bus expansion module and records the communication end point of each intelligent card control module;
correspondingly, after receiving a service request of an external terminal, the controller searches the communication endpoint of the intelligent card control module according to the pre-recorded index information including the communication endpoint, and establishes data connection with the intelligent card control module to realize intelligent card communication corresponding to the intelligent card identifier.
CN202010882717.9A 2020-08-28 2020-08-28 Intelligent card management device and data switching method thereof Pending CN111948971A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010882717.9A CN111948971A (en) 2020-08-28 2020-08-28 Intelligent card management device and data switching method thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010882717.9A CN111948971A (en) 2020-08-28 2020-08-28 Intelligent card management device and data switching 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 Intelligent card management device and data switching method thereof

Country Status (1)

Country Link
CN (1) CN111948971A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
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

Cited By (3)

* Cited by examiner, † Cited by third party
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
CN112506839B (en) * 2020-12-07 2023-02-03 天津津航计算技术研究所 One-to-many SPI bus switching method and device

Similar Documents

Publication Publication Date Title
CN100568211C (en) Realize method and the device of a plurality of I2C of visit with programming device from device
US6725302B1 (en) Universal serial bus (USB) with wireless communication hubs
CN102023956B (en) Serial peripheral slave device interface structure in integrated circuit chip and data reading and writing method
JP2003050772A (en) Usb composite device and realization method thereof
KR102420530B1 (en) Alternative protocol selection
CN103248526A (en) Communication equipment and method for achieving out-of-band monitoring and management, and master-slave switching method
CN105051706A (en) Device, method and system for operation of a low power PHY with a PCIe protocol stack
CN101317364A (en) Apparatus and method for implementing communication between service plate and master control board
CN100383544C (en) Method and apparatus for real-time monitoring level signal
CN111948971A (en) Intelligent card management device and data switching method thereof
CN106959935A (en) A kind of method that compatible I2C communications communicate with IPMB
CN105117319A (en) Method for realizing real-time monitoring of multi-channel MDIO (Management Data Input Output) devices based on FPGA
CN109407574B (en) Multi-bus selectable output control device and method thereof
CN102693203A (en) Embedded USB (universal serial bus) host
CN116032746B (en) Information processing method and device of resource pool, storage medium and electronic device
CN212411050U (en) Smart card management device and smart card system
CN219574799U (en) Multi-bus bridge based on AMBA bus and system on chip thereof
CN111177052A (en) System for redirecting serial port of computer peripheral equipment to network far end
CN216772401U (en) Main equipment main control function implementation system
JPH07143202A (en) Method for constituting system, method for constituting device, controller and system
CN110795369B (en) Method and terminal for realizing MDIO slave function based on GPIO pin
CN111858459B (en) Processor and computer
CN210986125U (en) Embedded industrial control all-in-one machine
CN114661646A (en) Serial port switching control circuit
Depari et al. IEEE1451 smart sensors supporting USB connectivity

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