Summary of the invention
The embodiment of the present invention provides a kind of method and device of smart card write-in data, to solve present terminal to intelligence
The relatively complicated complexity of mode of card write-in data, and transmit the unstable problem of data.
In order to achieve the above objectives, the present invention adopts the following technical scheme:
A kind of method of smart card write-in data, comprising:
Obtain downlink data to be written;
Order group packet is carried out according to the downlink data to be written, generates command packet;The command packet packet
Include non-generic telephone directory mark and instruction type;
The command packet is written in the telephone directory of smart card by smart card phone book function channel, so that
Data in the command packet are written to the smart card according to described instruction type by the device of smart card write-in data
Corresponding position.
Further, after obtaining downlink data to be written, further includes:
The downlink data to be written is encrypted, encrypted downlink data is formed.
Specifically, carrying out order group packet according to the downlink data to be written, command packet is generated, comprising:
The encrypted downlink data is subjected to order group packet, generates the command packet.
A kind of method of smart card write-in data, comprising:
Receiving terminal apparatus passes through the command packet of smart card phone book function channel transfer;
Whether judge in the command packet with non-generic telephone directory mark and instruction type;
If with non-generic telephone directory mark and instruction type in the command packet, according to described instruction type by institute
State the corresponding position that the data in command packet are written to the smart card.
Specifically, the receiving terminal apparatus passes through the command packet of smart card phone book function channel transfer, comprising:
Monitor the update event of the telephone directory of the smart card;
If there are update events for the telephone directory of the smart card, the corresponding more newer command of the update event is intercepted;
It is described whether to judge in the command packet with non-generic telephone directory mark and instruction type, comprising:
Judge whether there is the order data with non-generic telephone directory mark and described instruction type in the more newer command
Packet.
Further, the method for smart card write-in data, further includes:
If having the command packet with non-generic telephone directory mark and described instruction type in the more newer command, to institute
It states command packet to be verified and be decrypted, forms ciphertext data.
In addition, pair that the data in the command packet are written to the smart card according to described instruction type
Answer position, comprising:
The ciphertext data is written to the corresponding position of the smart card according to described instruction type.
Further, the method for smart card write-in data, further includes:
If the corresponding position that ciphertext data is written to smart card is completed, controlling terminal equipment is restarted, or described in control
Terminal device issues equipment and restarts prompt.
A kind of terminal device, comprising:
Acquiring unit, for obtaining downlink data to be written;
Order group packet unit generates command packet for carrying out order group packet according to the downlink data to be written;
The command packet includes non-generic telephone directory mark and instruction type;
Writing unit, for the command packet to be written to the electricity of smart card by smart card phone book function channel
It talks about in book.
Further, the terminal device, further includes:
Encryption unit forms encrypted downlink data for the downlink data to be written to be encrypted.
In addition, the order group packet unit, is specifically used for:
The encrypted downlink data is subjected to order group packet, generates the command packet.
A kind of device of smart card write-in data, comprising:
Receiving unit passes through the command packet of smart card phone book function channel transfer for receiving terminal apparatus;
Judging unit, for whether judging in the command packet with non-generic telephone directory mark and instruction type;
Writing unit, when for having non-generic telephone directory mark and instruction type in the command packet, according to
Data in the command packet are written to the corresponding position of the smart card by described instruction type.
Specifically, the receiving unit, comprising:
Monitoring module, the update event of the telephone directory for monitoring the smart card;
Blocking module, it is corresponding there are the update event when update event, is intercepted for the telephone directory in the smart card
More newer command;
The judging unit, is specifically used for:
Judge whether there is the order data with non-generic telephone directory mark and described instruction type in the more newer command
Packet.
Further, the device of smart card write-in data, further includes:
Decryption unit, for there is the life with non-generic telephone directory mark and described instruction type in the more newer command
Data packet is enabled, the command packet is verified and is decrypted, forms ciphertext data.
In addition, said write unit, is specifically used for:
The ciphertext data is written to the corresponding position of the smart card according to described instruction type.
Further, the device of smart card write-in data, further includes:
Control unit is restarted, for when the corresponding position that ciphertext data is written to smart card is completed, controlling terminal to be set
It is standby to restart, or control the terminal device sending equipment and restart prompt.
A kind of method and device of smart card write-in data provided in an embodiment of the present invention, can pass through smart card phone book
Function channel writes data into the telephone directory of smart card, so that the device of smart card write-in data is according to instruction type
Write data into the corresponding position of smart card.The present invention is not necessarily to carry out bottom code modification, and transmission side data in terminal side
Formula is easy, avoids mode relatively complicated complexity of the present terminal to smart card write-in data, and transmits that data are unstable etc. to ask
Topic.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete
Site preparation description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on
Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every other
Embodiment shall fall within the protection scope of the present invention.
As shown in Figure 1, the embodiment of the present invention provides a kind of method of smart card write-in data, explained from terminal equipment side
It states, this method comprises:
Step 101 obtains downlink data to be written.
Step 102 carries out order group packet according to downlink data to be written, generates command packet;Command packet packet
Include non-generic telephone directory mark and instruction type.
Command packet is written in the telephone directory of smart card by step 103 by smart card phone book function channel, with
So that the data in command packet are written to the correspondence position of smart card according to instruction type by the device of smart card write-in data
It sets.
It is worth noting that the terminal device in the embodiment of the present invention can be the mobile phone for being equipped with smart card, intelligent hand
Ring, smartwatch, vehicular communication equipment etc. have the terminal of wireless communication ability, which is provided with smart card phone book
Function channel has read-write phonebook function.
As shown in Fig. 2, the embodiment of the present invention provides a kind of method of smart card write-in data, from smart card write-in data
Device side is illustrated, and method includes:
Step 201, receiving terminal apparatus pass through the command packet of smart card phone book function channel transfer.
Whether step 202 judges in command packet with non-generic telephone directory mark and instruction type.
If will be ordered with non-generic telephone directory mark and instruction type according to instruction type in step 203, command packet
The data in data packet are enabled to be written to the corresponding position of smart card.
A kind of method of smart card write-in data provided in an embodiment of the present invention, can be logical by smart card phone book function
Road writes data into the telephone directory of smart card, so that the device of smart card write-in data is according to instruction type by data
It is written to the corresponding position of smart card.The present invention is not necessarily to carry out bottom code modification in terminal side, and data transfer mode is easy,
Mode relatively complicated complexity of the present terminal to smart card write-in data is avoided, and transmits the problems such as data are unstable.
In order to make those skilled in the art be better understood by the present invention, a more detailed embodiment is set forth below,
As shown in figure 3, a kind of method of smart card write-in data provided in an embodiment of the present invention, comprising:
Step 301, terminal device obtain downlink data to be written, and the downlink data being written into is encrypted,
Form encrypted downlink data.
Under normal circumstances, the core authentication parameter of smart card is international mobile subscriber identity (International
Mobile Subscriber Identification Number, abbreviation IMSI), authentication key (Key identifier, letter
Claim KI) and 3G network in key OPC.Herein, it by taking the write-in of this three item data of IMSI, KI, OPC as an example, is illustrated.
Downlink data herein can be such as following content:
KeyIndex=3
IMSI=460010879809542
KI=E685B0DACF0D34E84157162592736DF9
OPC=290E6F73CED32F9ECDA9F2460E22AF1D
Later, the process which converted and encrypted are as follows:
Plus encryption key serial number before IMSI: 3460010879809542;KI and OPC are combined, formed:
E685B0DACF0D34E84157162592736DF9290E6F73CED32F9ECDA9F246 0E22AF1D is used
The corresponding encryption key of KeyIndex encrypts KI and OPC, obtains:
A051ED7A6D54F71F81ADC770E78D14970022445FCA0823333F596B4FA83279C0。
Finally obtained encrypted downlink data are as follows:
3460010879809542
A051ED7A6D54F71F81ADC770E78D14970022445FCA0823333F596B4FA83279C0。
Encrypted downlink data is carried out order group packet by step 302, terminal device, generates command packet.
Wherein, command packet includes non-generic telephone directory mark and instruction type.Herein, which may be used also
To include random number, check key serial number etc., but it is not only limited to this.
For example, the command stream in obtained command packet can be such that
Instr02=*1#111302162#954*777 | 34600108798095
Instr03=*1#11130315427892505 | 42A051ED7A6D54
Instr04=*1#11130412567045371 | F71F81ADC770E7
Instr05=*1#11130517267255452 | 8D14970022445F
Instr06=*1#11130618323#46*5* | CA0823333F596B
Instr07=*1#1113071970809*434 | 4FA83279C0
Command packet is written to the electricity of smart card by step 303, terminal device by smart card phone book function channel
It talks about in book.
The update event of the telephone directory of the assembly monitor smart card of step 304, smart card write-in data.
If the telephone directory of step 305, smart card, there are update event, the device that data are written in smart card intercepts update event
Corresponding more newer command.
Whether the device that data are written in step 306, smart card judges to have in more newer command identifies with non-generic telephone directory
With the command packet of instruction type.
If there is the command packet with non-generic telephone directory mark and instruction type in step 307, more newer command, intelligence
The device of card write-in data is verified and is decrypted to command packet, and ciphertext data is formed.
Herein, non-generic telephone directory mark indicates that the data of the command packet in the more newer command are non-generic telephone directory
Data.And if present in more newer command being the command packet with plain old telephone book mark, then it represents that the command packet
In data be plain old telephone book data, directly write in the telephone directory of smart card.
It is decrypted herein, the ciphertext data of formation can be with are as follows:
IMSI=460010879809542
KI=E685B0DACF0D34E84157162592736DF9
OPC=290E6F73CED32F9ECDA9F2460E22AF1D
Ciphertext data is written to the correspondence of smart card according to instruction type by the device that data are written in step 308, smart card
Position.
Instruction type expression herein carries out smart card to write card, and IMSI, KI and OPC are written to the correspondence of smart card
Position.
If step 309, the corresponding position that ciphertext data is written to smart card are completed, the device control of data is written in smart card
Restarting terminal device processed or controlling terminal equipment issue equipment and restart prompt.
A kind of method of smart card write-in data provided in an embodiment of the present invention, can be logical by smart card phone book function
Road writes data into the telephone directory of smart card, so that the device of smart card write-in data is according to instruction type by data
It is written to the corresponding position of smart card.The present invention is not necessarily to carry out bottom code modification in terminal side, and data transfer mode is easy,
Mode relatively complicated complexity of the present terminal to smart card write-in data is avoided, and transmits the problems such as data are unstable.
Corresponding to above-mentioned Fig. 1 and embodiment of the method shown in Fig. 3, as shown in figure 4, the embodiment of the present invention provides a kind of terminal
Equipment, comprising:
Acquiring unit 41, available downlink data to be written.
Order group packet unit 42 can carry out order group packet according to downlink data to be written, generate command packet.Life
Enabling data packet includes non-generic telephone directory mark and instruction type.
Command packet can be written to the phone of smart card by writing unit 43 by smart card phone book function channel
In book.
Further, as shown in figure 4, the terminal device, can also include:
Encryption unit 44, the downlink data that can be written into are encrypted, and form encrypted downlink data.
In addition, the order group packet unit 42, specifically can carry out order group packet for encrypted downlink data, generate order
Data packet.
It is worth noting that terminal device provided in an embodiment of the present invention may refer to above-mentioned Fig. 1 and method shown in Fig. 3
Embodiment, details are not described herein again.
A kind of terminal device provided in an embodiment of the present invention can be write data by smart card phone book function channel
Into the telephone directory of smart card, so that the device of smart card write-in data writes data into smart card according to instruction type
Corresponding position.The present invention is not necessarily to carry out bottom code modification in terminal side, and data transfer mode is easy, avoids current end
The relatively complicated complexity of mode to smart card write-in data is held, and transmits the problems such as data are unstable.
Corresponding to above-mentioned Fig. 2 and embodiment of the method shown in Fig. 3, as shown in figure 5, the embodiment of the present invention provides a kind of intelligence
The device of card write-in data, comprising:
Receiving unit 51 can receive the command packet that terminal device passes through smart card phone book function channel transfer.
Judging unit 52, it can be determined that whether with non-generic telephone directory mark and instruction type in command packet.
Writing unit 53, when can have non-generic telephone directory mark and instruction type in command packet, according to finger
Enable type that the data in command packet are written to the corresponding position of smart card.
Further, as shown in fig. 6, the receiving unit 51, comprising:
Monitoring module 511, can be with the update event of the telephone directory of monitoring intelligent card.
Blocking module 512, can smart card telephone directory there are when update event, intercept the corresponding update of update event
Order.
In addition, the judging unit 52, specifically may determine that in more newer command whether have with non-generic telephone directory mark and
The command packet of instruction type.
Further, as shown in fig. 6, the device of smart card write-in data, can also include:
Decryption unit 54 can have the order data with non-generic telephone directory mark and instruction type in more newer command
Packet, verifies command packet and is decrypted, and ciphertext data is formed.
It, specifically can be in addition, the writing unit 53:
Ciphertext data is written to the corresponding position of smart card according to instruction type.
Further, as shown in fig. 6, the device of smart card write-in data, can also include:
Restart control unit 55, can be when the corresponding position that ciphertext data is written to smart card be completed, controlling terminal
Equipment is restarted or controlling terminal equipment issues equipment and restarts prompt.
It is worth noting that the device of smart card provided in an embodiment of the present invention write-in data may refer to above-mentioned Fig. 2 and
Embodiment of the method shown in Fig. 3, details are not described herein again.
A kind of device of smart card write-in data provided in an embodiment of the present invention, can be logical by smart card phone book function
Road writes data into the telephone directory of smart card, so that the device of smart card write-in data is according to instruction type by data
It is written to the corresponding position of smart card.The present invention is not necessarily to carry out bottom code modification in terminal side, and data transfer mode is easy,
Mode relatively complicated complexity of the present terminal to smart card write-in data is avoided, and transmits the problems such as data are unstable.
It should be understood by those skilled in the art that, the embodiment of the present invention can provide as method, system or computer program
Product.Therefore, complete hardware embodiment, complete software embodiment or reality combining software and hardware aspects can be used in the present invention
Apply the form of example.Moreover, it wherein includes the computer of computer usable program code that the present invention, which can be used in one or more,
The computer program implemented in usable storage medium (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.) produces
The form of product.
The present invention be referring to according to the method for the embodiment of the present invention, the process of equipment (system) and computer program product
Figure and/or block diagram describe.It should be understood that every one stream in flowchart and/or the block diagram can be realized by computer program instructions
The combination of process and/or box in journey and/or box and flowchart and/or the block diagram.It can provide these computer programs
Instruct the processor of general purpose computer, special purpose computer, Embedded Processor or other programmable data processing devices to produce
A raw machine, so that being generated by the instruction that computer or the processor of other programmable data processing devices execute for real
The device for the function of being specified in present one or more flows of the flowchart and/or one or more blocks of the block diagram.
These computer program instructions, which may also be stored in, is able to guide computer or other programmable data processing devices with spy
Determine in the computer-readable memory that mode works, so that it includes referring to that instruction stored in the computer readable memory, which generates,
Enable the manufacture of device, the command device realize in one box of one or more flows of the flowchart and/or block diagram or
The function of being specified in multiple boxes.
These computer program instructions also can be loaded onto a computer or other programmable data processing device, so that counting
Series of operation steps are executed on calculation machine or other programmable devices to generate computer implemented processing, thus in computer or
The instruction executed on other programmable devices is provided for realizing in one or more flows of the flowchart and/or block diagram one
The step of function of being specified in a box or multiple boxes.
Specific embodiment is applied in the present invention, and principle and implementation of the present invention are described, above embodiments
Explanation be merely used to help understand method and its core concept of the invention;At the same time, for those skilled in the art,
According to the thought of the present invention, there will be changes in the specific implementation manner and application range, in conclusion in this specification
Appearance should not be construed as limiting the invention.