The access method of smart card and access means
Technical field
The present invention relates to a kind of access method and access means of smart card.
Background technology
Smart card (Smart Card) is a kind of common name being embedded with the plastic clip (normally the size of a credit card) of microchip.Some smart cards comprise a RFID chip, so they do not need just can identify holder with any physical contact of read write line.Smart card is equipped with CPU and RAM, can a fairly large number of data and can not interfere with the work of host CPU by oneself.Smart card also can the data of filter false, to alleviate the burden of host CPU.Be adapted to the more and communication speed demand occasion faster of port number.Integrated circuit in card comprises central processor CPU, programmable read only memory EEPROM, random access memory ram and is solidificated in the card internal operating system COS (Chip OperatingSystem) in read only memory ROM.
For smart card, the one card for multiple uses realizing smart card is a developing direction having prospect.So-called one card for multiple uses refers to there is multiple application on a sheet smart card, as financial wallet, refuels wallet, work attendance gate inhibition etc.And on the current technology, application program can be allowed to run in low-level operation system architecture (being called container), if when needing to use multiple application program sometime simultaneously (multiple application program access intelligent card together), that is, when multiple application program needs to set up respectively container to carry out the associative operation of digital signature, as shown in Figure 1, first needing the relevant information traveling through the current container be present in smart card in smart card document system, bearing the same name to avoid already present container with other when setting up container.Like this, when multiple utility program access intelligent card, each application program needs when needing acquisition container relevant information the file system traveling through smart card.As everyone knows, application program will consume certain hour by carrying out traversal file system to smart card transmission instruction, and the time that multiple application program consumes by carrying out traversal file system to smart card transmission instruction affects Consumer's Experience very much simultaneously, need thus to consume the plenty of time, greatly have impact on the efficiency of application program access intelligent card.
Summary of the invention
In view of this, fundamental purpose of the present invention is the access method and the access means that provide a kind of smart card, to improve the access efficiency of the common access intelligent card of multiple application program.
The method of a kind of smart card access provided by the invention, comprises the following steps:
Read smart card memory, and judge the status information of equipment that whether there is this smart card in smart card memory:
If do not comprise the status information of equipment of this smart card in smart card memory, then create the container that intelligent card data operating environment is provided, simultaneously by the status information of equipment of this smart card write smart card memory, carry out intelligent card data operation in this embodiment afterwards;
If comprise the status information of equipment of this smart card in smart card memory, the then status information of equipment of this smart card of traversal queries in this smart card memory, and set up and the current container that there is container and do not born the same name according to the status information of equipment inquired, carry out intelligent card data operation in this embodiment afterwards;
After completing the operation of described intelligent card data, the described status information of equipment in smart card memory is updated to the current status information of equipment in this smart card document system.
In the above-mentioned methods, the status information of equipment of described smart card comprises: information of container.
As seen from the above, by the status information of equipment in smart card document system is write in smart card memory, the facility information set up between smart card memory and file system maps, the while of making multiple thus, the application program of access intelligent card just can realize enumerating for information of container by fast access internal memory, compare with directly traveling through smart card document system acquisition information of container during access intelligent card, present invention saves a large amount of routine access time, improve the access efficiency of the common access intelligent card of multiprogram, and then avoid the impact that Consumer's Experience is produced.
In addition, present invention also offers a kind of smart card access device that can realize said method, comprising:
Read operation module, for reading the data in smart card memory;
Judge module, for judging by the status information of equipment that whether there is this smart card in the smart card memory data of described read operation module reading;
Write operation module, for writing data in smart card memory;
Control module, for when described judge module judges the status information of equipment not comprising this smart card in smart card memory data, create the container that intelligent card data operating environment is provided, control described write operation module by the status information of equipment of this smart card write smart card memory simultaneously, carry out intelligent card data operation in this embodiment afterwards;
When described judge module judges the status information of equipment comprising this smart card in smart card memory data, the status information of equipment of this smart card of traversal queries in this smart card memory, and set up and the current container that there is container and do not born the same name according to the status information of equipment inquired, carry out intelligent card data operation in this embodiment afterwards; And
After completing the operation of described intelligent card data, control described write operation module and the described status information of equipment in smart card memory is updated to current status information of equipment in this smart card document system.
Accompanying drawing explanation
Fig. 1 is the process flow diagram of existing smart card access method;
Fig. 2 is the process flow diagram of smart card access method provided by the invention;
Fig. 3 is the function structure chart of smart card access device provided by the invention.
Embodiment
Below, smart card access method provided by the invention is as shown in Figure 2 introduced in detail.
Suppose, when the common access intelligent card of multiple utility program, application A is connected to smart card, reads smart card memory, and judge the status information of equipment that whether there is this smart card comprising information of container (such as, Container Name, capacity etc.) in smart card memory:
If do not comprise the status information of equipment of this smart card in smart card memory, then application program A is the application program of now first this smart card of access, being created by application A provides intelligent card data (such as, digital signature etc.) container of operating environment, and simultaneously by the status information of equipment write memory of this smart card;
If comprise the status information of equipment of this smart card in smart card memory, then illustrate and now have other application programs accessing this smart card, in this smart card memory, the status information of equipment of this smart card is now inquired about by application A, obtain the information of container of current smart cards with this, and set up and the current container that there is container and do not born the same name according to the information of container inquired.
When application A completes intelligent card data operation (such as on its container set up, the read-write of digital signature) after, carry out synchronous by status information of equipment existing in this smart card memory with the current device status information in this smart card document system, it is consistent for namely upgrading the status information of equipment in this smart card memory with the current device state of smart card.Like this, the application program of this smart card of subsequent access, such as application program B, C...... are when enumerating information of container, just can obtain information of container by the status information of equipment in inquiry smart card memory, replace obtaining information of container by direct access intelligent card file system with this.
Like this, except when read-write or when deleting in addition to data, when needing frequently to inquire about smart card device status information at multiple application program access intelligent card, traversal file system is replaced by these means of query facility state in internal memory, not only greatly can save query time, and different application is carrying out the application program of digital signature read-write operation to other interference when traversal file system can be reduced.
In addition, present invention also offers a kind of smart card access device that can realize said method, as shown in Figure 3, comprising:
Read operation module, for reading the data in smart card memory;
Judge module, for judging by the status information of equipment that whether there is this smart card in the smart card memory data of described read operation module reading;
Write operation module, for writing data in smart card memory;
Control module, for when described judge module judges the status information of equipment not comprising this smart card in smart card memory data, create the container that intelligent card data operating environment is provided, control described write operation module by the status information of equipment of this smart card write smart card memory simultaneously, carry out intelligent card data operation in this embodiment afterwards;
When described judge module judges the status information of equipment comprising this smart card in smart card memory data, the status information of equipment of this smart card of traversal queries in this smart card memory, and set up and the current container that there is container and do not born the same name according to the status information of equipment inquired, carry out intelligent card data operation in this embodiment afterwards; And
After completing the operation of described intelligent card data, control described write operation module and the described status information of equipment in smart card memory is updated to current status information of equipment in this smart card document system.
The foregoing is only preferred embodiment of the present invention, not in order to limit the present invention, within the spirit and principles in the present invention all, any amendment done, equivalent replacement, improvement etc., all should be included within protection scope of the present invention.