Data erasable method of memory in smart card and smart card thereof
09727240 ยท 2017-08-08
Assignee
Inventors
Cpc classification
G06F3/0604
PHYSICS
G06F3/0655
PHYSICS
G06F3/0679
PHYSICS
Y02D10/00
GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
International classification
G06F12/00
PHYSICS
Abstract
The invention relates to a data erasable method of memory in smart cards and smart cards thereof, which includes: when a CPU in the smart card determines a data erasable operation will be proceed in the specified memory of the smart card, cache the data to be written in a random memory cache of the specified memory; after sending a data erasable signal to the specified memory, control itself to enter a standby sleep mode. The data erasable signal is used to indicate the specified memory to process the data erasable operation by obtaining the data to be written from the random memory cache. Using the provided solution, the current of the machine card interface can be reduced when a data erasable is proceed in the specified memory of the smart card, thus abnormal conditions due to the high current of the machine card interface are avoided, and the power consumption is reduced at the same time, the standby time of the device which the smart card is in is improved.
Claims
1. A method of erasing and writing data from and to a memory in a smart card, comprising: a Central Processing Unit, CPU, in the smart card, buffering data to be written into a random memory buffer of a specified memory in the smart card upon determining a data erasing and writing operation to be performed on the specified memory; and the CPU entering a standby and sleep mode after transmitting a data erasing and writing signal to the specified memory, wherein the data erasing and writing signal instructs the specified memory to perform the data erasing and writing operation by acquiring the data to be written from the random memory buffer; wherein the CPU has entered the standby and sleep mode while the specified memory performs the data erasing and writing operation; wherein the method further comprises: the CPU receiving a recovery signal transmitted from the specified memory after the data erasing and writing operation; and the CPU entering a normal operating mode from the standby and sleep mode according to an instruction of the recovery signal after the specified memory performs the data erasing and writing operation.
2. The method according to claim 1, wherein the data erasing and writing signal and/or the recovery signal are/is interruption signals and/or an interruption signal.
3. The method according to claim 1, wherein the specified memory is a nonvolatile NAND flash memory or a nonvolatile NOR flash memory.
4. A smart card, comprising a Central Processing Unit, CPU, and a memory, wherein: the CPU is configured to buffer data to be written into a random memory buffer of the memory upon determining a data erasing and writing operation to be performed on the memory; and to enter a standby and sleep mode after transmitting a data erasing and writing signal to the memory; and the memory is configured to perform the data erasing and writing operation by acquiring the data to be written from the random memory buffer upon reception of the data erasing and writing signal; wherein the CPU has entered the standby and sleep mode while the memory performs the data erasing and writing operation; wherein the memory is further configured to transmit a recovery signal to the CPU after performing the data erasing and writing operation; and the CPU is further configured to enter a normal operating mode from the standby and sleep mode after the memory performs the data erasing and writing operation according to an instruction of the recovery signal received.
5. The smart card according to claim 4, wherein the CPU is configured to transmit the data erasing and writing signal as an interruption signal; and/or the memory is configured to transmit the recovery signal as an interruption signal.
6. The smart card according to claim 4, wherein the memory is a nonvolatile NAND flash memory or a nonvolatile NOR flash memory.
7. The method according to claim 2, wherein the specified memory is a nonvolatile NAND flash memory or a nonvolatile NOR flash memory.
8. The smart card according to claim 5, wherein the memory is a nonvolatile NAND flash memory or a nonvolatile NOR flash memory.
Description
BRIEF DESCRIPTION OF THE DRAWINGS
(1)
(2)
(3)
DETAILED DESCRIPTION OF THE EMBODIMENTS
(4) In order to provide a solution to lowering current of a device-card interface while erasing and writing data from and to a specified memory in a smart card and further avoiding an abnormality occurring due to over-current of the device-card interface, embodiments of the invention provide a method of erasing and writing data from and to a memory in a smart card and a smart card, and preferred embodiments of the invention will be described below with reference to the drawings. It shall be appreciated that the preferred embodiments described below are merely intended to illustrate and explain but not to limit the invention. The embodiments of the invention and features in the embodiments can be combined with each other given no confliction.
(5) An embodiment of the invention provides a method of erasing and writing data from and to a memory in a smart card, as illustrated in
(6) Step S101. A CPU in the smart card buffers data to be written into a random memory buffer of a specified memory in the smart card upon determining a data erasing and writing operation to be performed on the specified memory.
(7) Step S102. The CPU controls itself to enter a standby and sleep mode after transmitting a data erasing and writing signal to the specified memory, where the data erasing and writing signal instructs the specified memory to perform the data erasing and writing operation by acquiring the data to be written from the random memory buffer.
(8) The foregoing method may further include:
(9) The CPU controls itself to enter a normal operating mode from the standby and sleep mode after the specified memory performs the data erasing and writing operation.
(10) The method and apparatus according to the invention will be described below in details in particular embodiments thereof.
First Embodiment
(11) In the first embodiment of the invention, a flow of performing a data erasing and writing operation on a memory in an SIM card used in a mobile phone terminal will be described in details by way of example, and as illustrated in
(12) Step S201. An SIM chip in the SIM card receives an instruction transmitted from the terminal where the SIM card is located via an I/O interface in the SIM card.
(13) Step S202. A CPU in the SIM chip performs a logic process on the received instruction according to a preset processing strategy to determine an operation instructed by the instruction.
(14) Step S203. The flow proceeds to the step S204 when the instruction instructs a data erasing and writing operation to be performed on the memory in the SIM card; otherwise, the flow proceeds to the step S213.
(15) Step S204. It is determined whether the memory to be subjected to the data erasing and writing operation is an M-level large-capacity memory, and if so, then the flow proceeds to the step S205; otherwise, the data erasing and writing operation is to be performed on a K-level nonvolatile NVM memory embedded in the SIM chip, and the flow goes to the step S210.
(16) In embodiments of the invention, for a large-capacity memory, an NAND flash memory or an NOR flash memory can be used and will be referred collectively as an N chip for the sake of a convenient description.
(17) Step S205, the CPU in the SIM chip acquires data to be written according to the received instruction and buffers the data to be written into a random memory buffer, RAM buffer, of the N chip so that when the CPU subsequently enters a standby and sleep mode, the N chip can acquire the data to be written from its own RAM buffer without the need of the CPU to control in real time transmission of the data to be written to the N chip.
(18) Step S206. The SIM chip transmits a data erasing and writing signal to the N chip and controls the CPU to enter the standby and sleep mode.
(19) The transmitted data erasing and writing signal may be transmitted as an interruption signal.
(20) Step S207. The N chip performs the data erasing and writing operation by acquiring the data to be written from its own RAM buffer upon reception of the data erasing and writing signal transmitted from the SIM chip, possibly particularly as follows:
(21) The N chip erases data stored in its own corresponding area, acquires the data to be written from its own RAM buffer and writes the data to be written into the corresponding area to thereby perform the data erasing and writing operation.
(22) The CPU is in the standby and sleep mode all the time throughout the process of the N chip to perform the data erasing and writing operation.
(23) Step S208. The N chip transmits a recovery signal to the SIM chip after performing the data erasing and writing operation, where the recovery signal instructs the CPU to enter a normal operating mode from the standby and sleep mode, and also the N chip stops operating.
(24) The transmitted recovery signal may be transmitted as an interruption signal.
(25) Step S209. The SIM chip controls the CPU to enter the normal operating mode from the standby and sleep mode upon reception of the recovery signal.
(26) Step S210. The CPU in the SIM chip sets a register (REG) related to the data erasing and writing operation on the K-level NVM memory to a write mode.
(27) Step S211. The CPU acquires the data to be written and writes the data to be written cyclically into a corresponding area of the K-level NVM memory in the SIM chip.
(28) Step S212. The CPU disables the write mode of the related register REG after the data writing operation is performed on the K-level NVM memory in the SIM chip.
(29) Step S213. The CPU in the SIM chip organizes data for a response and stores the data into the RAM buffer of the SIM chip according to a result of performing the operation instructed by the received instruction.
(30) Step S214. The SIM chip transmits the response to the instruction via the I/O interface to finish a response process to the instruction.
(31) In the method according to the foregoing first embodiment, all the operations performed by the SIM chip and the N chip can be performed by logic control performed with COS (Chip Operating System) software of the SIM chip.
(32) With the process flow according to the foregoing first embodiment, when the data erasing and writing operation is performed on the N chip, the CPU is in the standby and sleep mode in which no related processing operation is performed, so current generated at this time includes only current generated for N chip to perform the data erasing and writing operation, and thus the current of the device-card interface can be lowered as compared with the prior art to thereby avoid an abnormality occurring due to over-current of the device-card interface and also lower power consumption and hence improve a standby period of time of the mobile phone terminal where the SIM card is located.
(33) In the foregoing first embodiment, the smart card being an SIM card and the large-capacity memory being an NAND flash memory or an NOR flash memory have been taken as an example, and for other smart cards including large-capacity memories, a data erasing and writing operation can be performed on the large-capacity memories in a similar processing way as in the first embodiment to lower current of device-card interfaces.
Second Embodiment
(34) Based upon the same inventive idea, following the method for erasing and writing data from and to a memory in a smart card according to the embodiment of the invention, another embodiment of the invention further provides a smart card structured as illustrated in the schematic diagram of
(35) The CPU 301 is configured to buffer data to be written into a random memory buffer of the memory 302 upon determining a data erasing and writing operation to be performed on the memory 302; and to control itself to enter a standby and sleep mode after transmitting a data erasing and writing signal to the memory 302; and
(36) The memory 302 is particularly configured to perform the data erasing and writing operation by acquiring the data to be written from its own random memory buffer upon reception of the data erasing and writing signal.
(37) Preferably the CPU 301 is further configured to control itself to enter a normal operating mode from the standby and sleep mode after the memory 302 performs the data erasing and writing operation.
(38) Preferably the memory 302 is further configured to transmit a recovery signal to the CPU 301 after performing the data erasing and writing operation; and
(39) The CPU 301 is particularly configured to control itself to enter the normal operating mode from the standby and sleep mode according to an instruction of the received recovery signal.
(40) Preferably the CPU 301 is particularly configured to transmit the data erasing and writing signal as an interruption signal; and/or
(41) The memory 302 is particularly configured to transmit the recovery signal as an interruption signal.
(42) Preferably the memory 302 is an NAND flash memory or an NOR flash memory.
(43) In summary, in the solution according to the embodiments of the invention, a CPU in a smart card buffers data to be written into a random memory buffer of a specified memory in the smart card upon determining a data erasing and writing operation to be performed on the specified memory and controls itself to enter a standby and sleep mode after transmitting a data erasing and writing signal to the specified memory, where the data erasing and writing signal instructs the specified memory to perform the data erasing and writing operation by acquiring the data to be written from the random memory buffer. With the solution according to the embodiments of the invention, current of a device-card interface while erasing and writing data from and to the specified memory in the smart card can be lowered to thereby avoid an abnormality occurring due to over-current of the device-card interface and also lower power consumption and hence improve a standby period of time of a device where the SIM card is located.
(44) Those skilled in the art shall appreciate that the embodiments of the invention can be embodied as a method, a system or a computer program product. Therefore the invention can be embodied in the form of an all-hardware embodiment, an all-software embodiment or an embodiment of software and hardware in combination. Furthermore the invention can be embodied in the form of a computer program product embodied in one or more computer useable storage mediums (including but not limited to a disk memory, a CD-ROM, an optical memory, etc.) in which computer useable program codes are contained.
(45) The invention has been described in a flow chart and/or a block diagram of the method, the device (system) and the computer program product according to the embodiments of the invention. It shall be appreciated that respective flows and/or blocks in the flow chart and/or the block diagram and combinations of the flows and/or the blocks in the flow chart and/or the block diagram can be embodied in computer program instructions. These computer program instructions can be loaded onto a general-purpose computer, a specific-purpose computer, an embedded processor or a processor of another programmable data processing device to produce a machine so that the instructions executed on the computer or the processor of the other programmable data processing device create means for performing the functions specified in the flow(s) of the flow chart and/or the block(s) of the block diagram.
(46) These computer program instructions can also be stored into a computer readable memory capable of directing the computer or the other programmable data processing device to operate in a specific manner so that the instructions stored in the computer readable memory create an article of manufacture including instruction means which perform the functions specified in the flow(s) of the flow chart and/or the block(s) of the block diagram.
(47) These computer program instructions can also be loaded onto the computer or the other programmable data processing device so that a series of operational steps are performed on the computer or the other programmable data processing device to create a computer implemented process so that the instructions executed on the computer or the other programmable device provide steps for performing the functions specified in the flow(s) of the flow chart and/or the block(s) of the block diagram.
(48) Although the preferred embodiments of the invention have been described, those skilled in the art benefiting from the underlying inventive concept can make additional modifications and variations to these embodiments. Therefore the appended claims are intended to be construed as encompassing the preferred embodiments and all the modifications and variations coming into the scope of the invention.
(49) Evidently those skilled in the art can make various modifications and variations to the invention without departing from the scope of the invention. Thus the invention is also intended to encompass these modifications and variations thereto so long as the modifications and variations come into the scope of the claims appended to the invention and their equivalents.