Disclosure of Invention
In order to solve the above technical problems, an object of the present invention is to provide a method and an apparatus for manufacturing a mirrored SIM/USIM card file, which can reduce the time required for manufacturing the mirrored SIM/USIM card file.
The technical scheme adopted by the invention is as follows: a method for manufacturing a mirror image file of a SIM/USIM card comprises the following steps:
s1, setting a customized mirror image directory of the SIM/USIM card, wherein the customized mirror image directory is a file information directory of the SIM/USIM card required by SIM/USIM card mirror image;
s2, acquiring corresponding data according to the customized mirror image directory of the SIM/USIM card to acquire an SIM/USIM card mirror image file, and storing the SIM/USIM card mirror image file.
Further, the step S2 includes:
s21, judging the type of the SIM/USIM card, wherein the type of the SIM/USIM card comprises a SIM card or a USIM card;
s22, the user-defined mirror image directory of the SIM card is different from the user-defined mirror image directory of the USIM card, and the data corresponding to the user-defined mirror image directory of the SIM/USIM card is called to obtain the SIM/USIM card mirror image file according to the APDU commands with different types of the SIM/USIM card;
and S3, storing the SIM/USIM card mirror image file.
Further, the step S21 includes:
judging whether the SIM/USIM card does not contain an EFdir unit or whether data contained in the EFdir unit is null, if so, judging that the type of the SIM/USIM card is the SIM card; otherwise, whether the RID information in the EFdir unit of the SIM/USIM card is A000000087 or not is continuously judged, if so, the type of the SIM/USIM card is the USIM card, and otherwise, the type of the SIM/USIM card is the SIM card.
Further, the SIM/USIM card mirror image file is stored according to TLV protocol.
Further, the customized mirror directory includes an SMS category, a phonebook category.
The other technical scheme adopted by the invention is as follows: a device for making SIM/USIM card mirror image file comprises
The user-defined mirror image directory setting unit is used for setting a user-defined mirror image directory of the SIM/USIM card, wherein the user-defined mirror image directory is a file information directory of the SIM/USIM card required by SIM/USIM card mirror image;
and the SIM/USIM card mirror image file acquisition unit is used for acquiring corresponding data according to the customized mirror image directory of the SIM/USIM card so as to acquire the SIM/USIM card mirror image file and store the SIM/USIM card mirror image file.
Further, the SIM/USIM card image file acquisition unit includes:
the card type judging module is used for judging the type of the SIM/USIM card, and the type of the SIM/USIM card comprises an SIM card or a USIM card;
the SIM/USIM card image file acquisition module is used for calling and acquiring data corresponding to a customized image directory of an SIM/USIM card according to APDU commands of different types of the SIM/USIM card so as to acquire an SIM/USIM card image file, wherein the customized image directory of the SIM card is different from the customized image directory of the USIM card;
and the SIM/USIM card mirror image file storage module is used for storing the SIM/USIM card mirror image file.
Further, the customized mirror directory includes an SMS category, a phonebook category.
The other technical scheme adopted by the invention is as follows: a device for making SIM/USIM card mirror image file comprises
A memory for storing a program;
a processor for executing the program to implement the steps of:
s1, setting a customized mirror image directory of the SIM/USIM card, wherein the customized mirror image directory is a file information directory of the SIM/USIM card required by SIM/USIM card mirror image;
s2, acquiring corresponding data according to the customized mirror image directory of the SIM/USIM card to acquire an SIM/USIM card mirror image file, and storing the SIM/USIM card mirror image file.
The invention has the beneficial effects that: the invention relates to a method and a device for manufacturing an SIM/USIM card mirror image file, which utilize a user-defined mirror image directory of an SIM/USIM card, wherein the user-defined mirror image directory is a file information directory of the SIM/USIM card required by SIM/USIM card mirror image, and acquire corresponding data according to the user-defined mirror image directory of the SIM/USIM card to realize the manufacture of the SIM/USIM card mirror image file.
Detailed Description
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict.
A method for manufacturing a mirror image file of a SIM/USIM card comprises the following steps:
s1, setting a customized mirror image directory of the SIM/USIM card, wherein the customized mirror image directory is a file information directory of the SIM/USIM card required by SIM/USIM card mirror image;
s2, acquiring corresponding data according to the customized mirror image directory of the SIM/USIM card to acquire an SIM/USIM card mirror image file, and storing the SIM/USIM card mirror image file.
In practical application, an SIM/USIM card pool is generally adopted to realize the manufacture of the SIM/USIM card mirror image file, and the SIM/USIM card pool is SIM/USIM card centralized management equipment; the SIM/USIM card pool generally comprises a main control circuit, a card reading control circuit, an SIM/USIM card reader (card slot) and an SIM/USIM card, wherein the main control circuit is used as a main control center of the SIM/USIM card pool and is responsible for communication with a cloud server; the card reading control circuit is used for controlling the work of the SIM/USIM card reader; the SIM/USIM card reader (card slot) is used for placing the SIM/USIM card and reading the information of the SIM/USIM card. After the SIM/USIM card mirroring file is manufactured, the SIM/USIM card mirroring file is uploaded to a cloud server through an SIM/USIM card pool so as to be used by terminal equipment needing Remote-SIM/Usim service. The invention relates to a method for manufacturing a mirror image file of an SIM/USIM card, which comprises the steps of presetting a user-defined mirror image directory of the SIM/USIM card, wherein the user-defined mirror image directory is a file information directory of the SIM/USIM card required by mirror image of the SIM/USIM card, and the user-defined mirror image directory comprises an SMS category and a phonebook category; the user can customize the file information directory according to the requirement, and set the content required to be contained by the SIM/USIM card mirroring file, namely what content in the SIM/USIM card needs to be acquired when the SIM/USIM card mirroring file is manufactured, and generally the customized mirroring directory is stored in an SIM/USIM card pool in advance; specifically, the SIM/USIM card pool acquires corresponding data in the SIM/USIM card according to a customized mirror image directory of the SIM/USIM card to realize the SIM/USIM card mirror image file production. The manufacturing method of the invention not only can realize the self-definition of the mirror image file content of the SIM/USIM card, but also can flexibly customize the self-defined mirror image catalog so as to cut or supplement the mirror image content; the method can also save the manufacturing time of the SIM/USIM card mirror image file and improve the manufacturing efficiency of the SIM/USIM card mirror image file.
As a further improvement of the technical solution, step S2 includes:
s21, judging the type of the SIM/USIM card, wherein the type of the SIM/USIM card comprises a SIM card or a USIM card; judging whether the SIM/USIM card does not contain an EFdir unit or whether data contained in the EFdir unit is null, if so, judging that the type of the SIM/USIM card is the SIM card; if not, continuously judging whether the RID (registered application Provider identifier) information in the EFdir unit of the SIM/USIM card is A000000087, if so, determining that the type of the SIM/USIM card is the USIM card, otherwise, determining that the type of the SIM/USIM card is the SIM card;
s22, the user-defined mirror image directory of the SIM card is different from the user-defined mirror image directory of the USIM card, and the data corresponding to the user-defined mirror image directory of the SIM/USIM card is called to obtain the SIM/USIM card mirror image file according to the APDU commands with different types of the SIM/USIM card;
and S3, storing the SIM/USIM card mirror image file, wherein the SIM/USIM card mirror image file is stored according to the TLV protocol.
Referring to fig. 1, fig. 1 is a flowchart of a method for making a SIM/USIM card mirror image file according to an embodiment of the present invention, where a SIM/USIM card pool is used as a card pool, and when a SIM/USIM card is turned on or a new SIM/USIM card is inserted, the SIM/USIM card is mirror image-made and uploaded to a cloud server for Remote-SIM/USIM service. Specifically, the SIM/USIM card pool traverses the SIM/USIM cards borne by the SIM/USIM card pool, judges whether the SIM/USIM cards are connected with the SIM/USIM card pool for the first time, and if so, starts the image file manufacturing; otherwise, the status quo is maintained and no operation is performed. The method and the structure of the call data which need to be used are different according to the different types of the SIM/USIM cards, so that the type of the SIM/USIM card is determined to be the USIM card or the SIM card firstly. The distinguishing method is that firstly, an EFdir unit in the SIM/USIM card is obtained (the storage position of the EFdir unit is fixed, an APDU command is edited to the fixed position to read, whether the EFdir unit exists or not is judged according to the returned status words), because the USIM card can forcibly contain the EFdir unit, if the extraction of the EFdir unit fails or the data is empty, the card can be judged to be the SIM card. However, the extracted EFdir unit does not necessarily represent a USIM card, and it needs to be determined whether the RID information in the EFdir unit is "a 000000087", if so, the USIM card, otherwise, the SIM card. In the invention, the customized mirror image catalog of the USIM card is different from the customized mirror image catalog of the SIM card; when the type of the SIM/USIM card is identified, the SIM/USIM card pool calls a self-defined mirror image directory corresponding to the SIM/USIM card, at the moment, data information corresponding to the self-defined mirror image directory can be called from the entity SIM/USIM card, the calling mode follows an ISO7816 protocol, the CLA command types in APDUs packaged according to different requirements of the SIM/USIM type are different, and the APDU command at the moment can be dynamically updated according to the data storage type of the SIM/USIM card, so that the purpose of completely taking out the file information corresponding to the self-defined mirror image directory is finally achieved. And according to the user-defined mirror image directory, the APDU command of the IS7816 protocol IS used for circularly traversing from the entity SIM/USIM card to take out the corresponding data, and then the corresponding data are stored in the appointed position of the SIM/USIM card pool, and when the user-defined mirror image directory IS traversed, the mirror image file of the SIM/USIM IS also manufactured. And after the image file is finished, uploading the image file to a Remote-SIM/USIM server by the SIM/USIM card pool for use. The SIM/USIM card mirror image file is stored by using a self-defined TLV structure, most of data storage of an entity SIM/USIM card is similar to a tree structure, the SIM/USIM card mirror image file is stored by using a TLV protocol, and when the SIM/USIM card mirror image file is used, the SIM/USIM card mirror image file needs to be analyzed by using the rule; if no corresponding analysis rule exists, the data set has no use at all; therefore, the TLV protocol is used for data storage, so that the security of the mirror image file of the SIM/USIM card can be improved.
A device for making SIM/USIM card mirror image file comprises
The user-defined mirror image directory setting unit is used for setting a user-defined mirror image directory of the SIM/USIM card, wherein the user-defined mirror image directory is a file information directory of the SIM/USIM card required by SIM/USIM card mirror image;
and the SIM/USIM card mirror image file acquisition unit is used for acquiring corresponding data according to the customized mirror image directory of the SIM/USIM card so as to acquire the SIM/USIM card mirror image file and store the SIM/USIM card mirror image file.
A device for making mirror image files of an SIM/USIM card is characterized in that corresponding data is obtained according to a user-defined mirror image directory of the SIM/USIM card to make the mirror image files of the SIM/USIM card, so that the user-defined content of the mirror image files of the SIM/USIM card can be realized, the making time of the mirror image files of the SIM/USIM card can be saved, and the making efficiency of the mirror image files of the SIM/USIM card can be improved. In practical application, a device for manufacturing an image file of an SIM/USIM card is a main control circuit, a card reading control circuit and an SIM/USIM card reader in an SIM/USIM card pool, a user-defined image directory setting unit is realized by the main control circuit, an SIM/USIM card image file acquisition unit is realized by the main control circuit, the card reading control circuit and the SIM/USIM card reader, and the main control circuit controls the card reading control circuit and the SIM/USIM card reader to acquire data from an entity SIM/USIM card to finish image file manufacturing and stores the image file of the SIM/USIM card in the main control circuit.
As a further improvement of the technical scheme, the customized mirror image directory comprises an SMS category and a telephone directory category, and when the SIM/USIM card mirrors, corresponding SMS and telephone directory information are obtained from the entity SIM/USIM card and added into the SIM/USIM card mirror image file. The SIM/USIM card image file acquisition unit comprises:
the card type judging module is used for judging the type of the SIM/USIM card, and the type of the SIM/USIM card comprises an SIM card or a USIM card;
the SIM/USIM card image file acquisition module is used for calling and acquiring data corresponding to a customized image directory of the SIM/USIM card according to APDU commands of different types of the SIM/USIM card so as to acquire an SIM/USIM card image file, wherein the customized image directory of the SIM card is different from the customized image directory of the USIM card;
and the SIM/USIM card mirror image file storage module is used for storing the SIM/USIM card mirror image file.
A device for making SIM/USIM card mirror image file comprises
A memory for storing a program;
a processor for executing the program to implement the steps of:
s1, setting a customized mirror image directory of the SIM/USIM card, wherein the customized mirror image directory is a file information directory of the SIM/USIM card required by SIM/USIM card mirror image;
s2, acquiring corresponding data according to the customized mirror image directory of the SIM/USIM card to acquire an SIM/USIM card mirror image file, and storing the SIM/USIM card mirror image file.
While the preferred embodiments of the present invention have been illustrated and described, it will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the invention as defined by the appended claims.