Method and system for optimizing the lifetime and performance of a flash memory ic card

By parsing configuration instructions during the preprocessing stage and allocating data that needs to be updated synchronously to the same or adjacent storage pages, and by adopting differentiated space creation and data writing strategies, the frequent erasure and rewriting problem of FLASH storage IC cards is solved, thereby extending service life and improving transaction performance.

CN120763080BActive Publication Date: 2025-11-21ZHUHAI RUICHENG TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511279688.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-09-08
Publication Date
2025-11-21
Estimated Expiration
2045-09-08

AI Technical Summary

Technical Problem

Existing FLASH storage IC cards suffer from shortened lifespan and reduced transaction performance due to frequent cross-page erase and write operations, impacting user experience and issuing bank costs.

Method used

The configuration instructions are parsed during the preprocessing stage to determine the functions supported by the IC card and the data that needs to be updated synchronously. The storage space is then allocated to the same or adjacent FLASH storage pages. Differentiated space creation and data writing strategies are adopted to reduce cross-page erasure and writing, extend the service life, and improve transaction performance.

Benefits of technology

It effectively extends the lifespan of IC cards, reduces the costs for issuing banks, improves transaction performance and user experience, and optimizes storage space utilization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120763080B_ABST
    Figure CN120763080B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of smart card data storage, and discloses a method and system for optimizing the service life and performance of a FLASH storage type IC card. In a preprocessing stage, a configuration instruction is received, a function identification parameter in the configuration instruction is analyzed, the functions supported by the IC card and data needing to be synchronously updated are determined, and the storage spaces of the data needing to be synchronously updated in the same transaction are allocated to the same or adjacent FLASH storage pages. In a data writing stage, for the data written in a personalization stage, a differentiated strategy is adopted according to the synchronous updating attribute and length variability of the data: the storage space of the synchronously updated data is created in the preprocessing stage, the storage space of the non-synchronously updated data is created when a writing instruction is received, and the current storage length value of the variable length data needs to be recorded. The method can optimize storage utilization, improve the performance and service life of the IC card, reduce the cost of the card issuing bank, and improve the customer use experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of smart card data storage technology, and specifically to a method and system for optimizing the lifespan and performance of FLASH storage IC cards. Background Technology

[0002] Flash memory-based IC cards, with their superior security and reliability, have become the mainstream solution in modern payment and identity authentication. These cards, by integrating a flash memory, can securely store critical information including user personal information, financial account data, and transaction records, while supporting high-speed read and write operations. For example, a flash memory-integrated financial IC card is an integrated circuit card used to store financial data and conduct financial transactions. This type of IC card integrates a flash memory to store user personal information, account information, transaction records, and other data, supporting fast read and write operations. Financial IC cards are commonly used in the financial sector, such as bank cards, credit cards, and debit cards. Users can insert the IC card into a POS machine or ATM to make payments and withdraw cash, and can also conduct online transactions through internet banking or mobile payment.

[0003] Flash memory has unique physical characteristics; its erasure and writing method is page-by-page. This means that only the data of an entire page can be erased and rewritten, and individual data cannot be manipulated. A page is the smallest erasable unit in flash memory, typically ranging from a few KB to tens of KB in size. When data in the memory needs to be updated or modified, the entire page must be marked as erasable, then the data to be written is written to the new page, and finally the entire page is erased and replaced with the new data. Two key performance bottlenecks have been identified in practical applications:

[0004] 1. Storage space utilization issue: In IC cards supporting multiple functions, data that needs to be updated synchronously for the same transaction may be scattered across different pages due to a lack of prior planning (e.g., data a is on page 1, data c is on page 3). During updates, the corresponding pages need to be erased and rewritten separately, causing data unrelated to the synchronous update on each page to be processed along with it. This not only wastes the efficiency of the erase and write operations but also prevents the storage space on each page from being used for related data, reducing the overall effective utilization of space.

[0005] When the data is variable-length, space is created during the personalization phase according to the data size specified in the current data write instruction. If the cardholder updates the data size during use, a new space can only be created on a new page before the data update. Utilizing old space requires garbage collection (which is slow). If the new data exceeds the reclaimed space, reusing the reclaimed space results in the data existing on different pages, leading to more pages being written and erased for subsequent updates, further reducing performance.

[0006] 2. Performance Issues with Cross-Page Storage: Because FLASH memory uses a page-based erasure mechanism, with a page being the smallest erasable unit (typically a few KB to tens of KB), data updates require operations on the entire page. When the actual size of data does not exceed the capacity of a single page, but is split into two adjacent pages due to an unreasonable storage order, the efficiency of data update operations will decrease significantly. An update that could have been completed by erasing a single page is now forced to erase and rewrite two pages of data. In this case, not only must the complete process of marking, erasing, and rewriting be performed on the two pages containing the data fragment, but the additional page operations also increase the complexity of data processing: on the one hand, data verification and synchronization between the two pages are required to avoid data loss or inconsistency during the update process; on the other hand, two independent page erasure and write operations will significantly extend the response time of a single transaction, especially in high-frequency transaction scenarios, where this latency will be amplified, directly affecting the user's payment experience. Furthermore, frequent cross-page erasure and write operations will also consume additional erase and write lifespan of the memory, indirectly increasing the maintenance and replacement costs of the IC card.

[0007] The practical impacts of these issues include increased transaction latency and shortened lifespan, leading to a decline in user experience and increased operational costs. Summary of the Invention

[0008] In view of this, in order to solve the shortcomings of existing FLASH storage IC cards, which reduce card lifespan and transaction performance due to frequent erase and write operations, this invention provides a method and system for optimizing the lifespan and performance of FLASH storage IC cards. This can extend the service life of IC cards, reduce the cost for issuing banks, enhance product competitiveness, improve the problem of slow performance during transactions, and enhance the customer user experience.

[0009] In a first aspect, the present invention provides a method for optimizing the lifespan and performance of FLASH memory IC cards, comprising:

[0010] Preprocessing stage: Receive configuration instructions, parse the function identifier parameters in the configuration instructions, determine the functions supported by the IC card and the data that needs to be updated synchronously, and allocate the storage space of the data that needs to be updated synchronously in the same transaction to the same or adjacent FLASH storage pages;

[0011] Data writing stage: For data written in the personalization stage, differentiated space creation and data writing strategies are adopted based on the synchronous update attributes and variable length of the data. The storage space for synchronously updated data is created in the preprocessing stage, while the storage space for asynchronously updated data is created when the data writing instruction is received. Variable-length data must record the current storage length value.

[0012] The method provided in this invention allocates data requiring synchronous updates within the same transaction to the same or adjacent FLASH storage pages during the preprocessing stage. This reduces cross-page write operations, decreases the number of write cycles, extends the lifespan of the IC card, reduces issuing bank costs, and enhances product competitiveness. Simultaneously, the differentiated strategy of pre-creating space for synchronously updated data and creating space for asynchronously updated data on demand reduces data operation complexity and redundancy, accelerates transaction data processing, solves the problem of slow transaction performance, and improves customer experience. Furthermore, space is reserved for variable-length data up to its maximum length to avoid idle and fragmented old space during updates, optimizes storage space utilization, and ensures stable operation of the IC card while supporting multiple functions.

[0013] In one optional implementation, the format of the function identifier parameter includes: a parameter length field, a parameter identifier, a parameter value length field, and a parameter value, wherein the parameter value indicates the enabled status of the function through the binary state of the bit.

[0014] This invention, through a structured division of parameter length field, parameter identifier, parameter value length field, and parameter value, combined with parameter values ​​using bit binary states (e.g., 1 indicates support, 0 indicates non-support) to indicate function activation, allows card issuers to flexibly and dynamically select the combination of functions supported by the IC card, achieving personalized customization without modifying the underlying hardware or firmware. It also enables the IC card to quickly parse parameters during the preprocessing stage, accurately determining the functions supported by the IC card and the data that needs to be updated synchronously. This provides a clear basis for allocating data that needs to be updated synchronously in the same transaction to the same or adjacent FLASH storage pages, enhancing product versatility and adaptability.

[0015] In one optional implementation, the step of employing differentiated space creation and data writing strategies based on the synchronous update attributes and length variability of the data includes:

[0016] For fixed-length synchronous update data, space is created according to the length of the data during the preprocessing stage, and the data is written directly when the data write instruction is received.

[0017] For fixed-length asynchronous update data, when a data write instruction is received, space is created according to the length of the data and then written;

[0018] For variable-length synchronous update data, space is created according to the maximum length of the data during the preprocessing stage. When a data write instruction is received, the data is written and the current length is recorded.

[0019] For variable-length asynchronous update data, when a data write instruction is received, space is created according to the maximum length of the data, the data is written, and the current length is recorded.

[0020] In this embodiment of the invention, for synchronously updated fixed-length data, space is created in advance during the preprocessing stage to avoid space allocation delays during data writing and reduce operation time. For asynchronously updated fixed-length data, space is created on demand, avoiding unnecessary space reservations and improving the real-time utilization efficiency of storage resources. For synchronously updated variable-length data, space is created according to the maximum length and the current length is recorded during the preprocessing stage. This ensures that subsequent data updates do not require cross-page storage, rationalizes the storage order, improves the efficiency of data update operations, reduces the number of pages erased and written, and achieves dynamic space management by recording the current length. For asynchronously updated variable-length data, space is created according to the maximum length and the current length is recorded when the instruction is received, balancing data flexibility and storage standardization. The overall strategy reduces cross-page erasures and writes caused by unreasonable space allocation, reduces the number of FLASH memory erases and writes, extends the lifespan of the IC card, improves the efficiency of data writing and transaction updates, and optimizes the user experience.

[0021] In one optional implementation, the function identifier parameter in the parsing configuration instruction determines the functions supported by the IC card and the data that needs to be updated synchronously. For data that needs to be updated synchronously in the same transaction, its storage space is allocated to the same or adjacent FLASH storage pages, including:

[0022] Parse the configuration instructions and identify the combination of functions supported for this personalization based on the function identifier parameters;

[0023] Determine whether the data associated with each function needs to be updated synchronously in the same transaction;

[0024] For data that needs to be updated synchronously, prioritize allocating the same FLASH storage page. When space is insufficient, allocate to adjacent FLASH storage pages.

[0025] This invention, through its functional identifier parameters, determines the supported function combinations, accurately identifies the range of data requiring synchronous updates, and prioritizes allocating this data to the same FLASH storage page. If space is insufficient, it allocates it to adjacent storage pages. This effectively avoids the problem of needing to erase and write multiple pages during updates due to data spanning multiple pages, reducing unnecessary erase and write operations, thereby reducing FLASH memory wear and extending the IC card's lifespan. It also simplifies the data update process, improves data processing efficiency during transactions, and optimizes the user experience when using IC cards for transactions. This closed-loop technology of "functional identification - data association - intelligent allocation" achieves a full-chain improvement from underlying storage optimization to end-user experience, resulting in breakthrough improvements in IC card products in terms of reliability, performance, and cost.

[0026] In an optional implementation, the method further includes:

[0027] For synchronously updated data that does not need to be written during the personalization stage, the storage space is created uniformly during the preprocessing stage, and the space creation strategy is differentiated according to the variability of the length of the data to be synchronously updated.

[0028] In one optional implementation, the spatial strategy for creating differentiable values ​​based on the variability in the length of the data to be synchronized includes:

[0029] For fixed-length synchronous update data, space is created according to the length of the data during the preprocessing stage, and the data is updated in the created space based on the received specific instructions.

[0030] For variable-length synchronous update data, space is created according to the maximum length of the data during the preprocessing stage. Data is written into the created space based on the received specific instructions, and the current storage length value is set to the length of the data.

[0031] For data that does not need to be written during the personalization stage, this embodiment of the invention creates a unified storage space during the preprocessing stage. This avoids the problem of data cross-page storage caused by temporary space allocation when the cardholder uses the data, reduces the number of page erases and writes, and extends the lifespan of the FLASH memory. Such data is not processed during the personalization stage, simplifying the card issuance process and improving issuance efficiency. When the cardholder uses the card and receives a specific instruction, fixed-length synchronous update data can be directly updated within the preset space, while variable-length synchronous update data can be written within the reserved space and its current length recorded. This ensures the convenience of data operations, avoids space fragmentation, and improves storage utilization. Simultaneously, it reduces performance losses caused by space allocation and cross-page operations during transactions, accelerates data update speed, and significantly improves the customer experience.

[0032] Secondly, the present invention provides a system for optimizing the lifespan and performance of FLASH storage IC cards, the system comprising:

[0033] The preprocessing module is used to receive configuration instructions, parse the function identifier parameters in the configuration instructions, determine the functions supported by the IC card and the data that needs to be updated synchronously, and allocate the storage space of the data that needs to be updated synchronously in the same transaction to the same or adjacent FLASH storage pages.

[0034] The data writing module is used to create space and write data differently based on the synchronous update attributes and variable length of the data written during the personalization stage. The storage space for synchronously updated data is created during the preprocessing stage, while the storage space for asynchronously updated data is created when a data writing instruction is received. Variable-length data must record the current storage length value.

[0035] Thirdly, the present invention provides a FLASH storage IC card that optimizes data storage using the method described in any of the above optional embodiments.

[0036] Fourthly, the present invention provides a computer-readable storage medium storing computer instructions for causing a computer to execute the method for optimizing the lifespan and performance of a FLASH storage IC card as described in the first aspect or any corresponding embodiment thereof.

[0037] Fifthly, the present invention provides a computer program product, including computer instructions for causing a computer to execute the method for optimizing the lifespan and performance of a FLASH storage IC card as described in the first aspect or any corresponding embodiment thereof. Attached Figure Description

[0038] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0039] Figure 1 This is a flowchart illustrating a method for optimizing the lifespan and performance of a FLASH storage IC card according to an embodiment of the present invention.

[0040] Figure 2 It is a mapping diagram of the C9 parameter bits and supported functions;

[0041] Figure 3This is a structural block diagram of a system for optimizing the lifespan and performance of FLASH storage IC cards according to an embodiment of the present invention. Detailed Implementation

[0042] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0043] To overcome the shortcomings of existing FLASH storage IC cards, which suffer from reduced card lifespan and transaction performance due to frequent erase and write operations, this embodiment provides a method for optimizing the lifespan and performance of FLASH storage IC cards. Figure 1 This is a flowchart illustrating a method for optimizing the lifespan and performance of a FLASH memory IC card according to an embodiment of the present invention. Figure 1 As shown, the process includes the following steps:

[0044] Step S1, Preprocessing stage: Receive configuration instructions and parse the function identifier parameters in the configuration instructions to determine the functions supported by the IC card and the data that needs to be updated synchronously. For data that needs to be updated synchronously in the same transaction, allocate its storage space to the same or adjacent FLASH storage pages.

[0045] Specifically, in this embodiment of the invention, the configuration instruction is formed by the issuing bank dynamically selecting the combination of functions that the IC card needs to support through preset configured function identifier parameters and sending it to the IC card processing terminal. The IC card processing terminal receives the configuration instruction and parses the function identifier parameters in the configuration instruction. The IC card is an integrated multi-functional smart card that supports at least one of finance, transportation, medical, and identity verification. Through this multi-functional integration solution, and with its innovative storage architecture and application management mechanism, it achieves secure and efficient coexistence of various applications on a single chip. This not only meets the diverse needs of users but also creates significant operational benefits for the issuing institution, while also possessing important social value.

[0046] Various cards can be customized to support a certain number and type of functions. For example, medical cards support function 1, and if data a and b are configured, then data a and b need to be updated synchronously. E-wallets support function 2, and if data c is configured, then data c needs to be updated synchronously. Transportation cards support function 3, and if data d and e are configured, then data d and e need to be updated synchronously. Identity verification cards support functions 2 and 3, and if data c, d, and e are configured, then data c, d, and e need to be updated synchronously. Notably, function 2 supported by e-wallets and function 2 supported by identity verification cards are not necessarily the same functions, and function 3 supported by transportation cards and function 3 supported by identity verification cards are not necessarily the same functions. Instead, they are customized according to the user's actual needs.

[0047] Taking a flash memory IC card as an example, the issuing bank can configure the card using the Install Command in the Global Platform (GP) specification. The function identifier parameter can be customized using installation parameter C9 (in TLV format) from the Install Command. The IC card integrating multiple applications receives the value of installation parameter C9, analyzes it, and preprocesses it. It should be noted that parameter C9 is a key parameter in the Install Command defined in the Global Platform (GP) specification, used to dynamically configure the combination of functions supported by the IC card. Issuing institutions can flexibly configure card functions (such as financial, transportation, and medical), avoiding storage waste caused by fixed designs.

[0048] The method provided in this invention can be adaptively applied to the standardized instruction framework of Install Command and the structured design of C9 parameters. Card issuers can conveniently select the combination of functions supported by the IC card by configuring the C9 parameters, realizing personalized function customization without modifying the hardware or underlying firmware, and adapting to diverse application scenarios. On the other hand, the IC card can quickly parse the C9 parameters by relying on the preprocessing mechanism of Install Command, accurately identify the supported functions and the data that needs to be updated synchronously, and provide an accurate basis for allocating the data that needs to be updated synchronously in the same transaction to the same or adjacent storage pages.

[0049] The format of the function identifier parameter in this embodiment of the invention includes: a parameter length field, a parameter identifier, a parameter value length field, and a parameter value. The parameter value represents the enabled status of the function through the binary state of the bits. A function is represented by one bit to indicate whether it is supported (1: supported, 0: not supported). For example, Byte1Bit1 indicates whether function 1 is supported, and Byte1Bit2 indicates whether function 2 is supported. When the integrated financial IC card supports both function 1 and function 2, parameter C9 is configured as 03C90103 (where the first 03 is the TLV length of C9, 01 is the length of the C9 value, the second 03 is the C9 value, T is C9, L is 01, and V is the second 03).

[0050] In one embodiment, all bytes and functions of the C9 parameter can be customized according to actual needs. The mapping diagram of the C9 parameter bits and supported functions is as follows: Figure 2 As shown, the functions and data supported by the IC card include: (1) Function 1 includes data a and data b; (2) Function 2 includes data c; (3) Function 3 includes data d and data e; (4) Function n includes data x. Here, n and x are listed to illustrate that the functions and data of this invention can be customized according to actual needs. The functions supported by the C9 parameter bit configuration include: (1) C9 Byte 1 Bit 1 - supports function 1; (2) C9 Byte 1 Bit 2 - supports function 2; (3) C9 Byte 1 Bit 3 - supports function 3; (4) C9 Byte 1 Bit 4-8 supports function n. Byte1 bit 4-8 and Byte2...n are configurable and can be customized according to actual needs.

[0051] In this embodiment of the invention, the function identifier parameter in the configuration instruction is parsed to determine the functions supported by the IC card and the data that needs to be updated synchronously. For the data that needs to be updated synchronously in the same transaction, its storage space is allocated to the same or adjacent FLASH storage pages, including the following steps:

[0052] S11, parse the configuration instructions and identify the combination of functions supported for this personalization based on the function identifier parameters;

[0053] S12, determine whether the data associated with each function needs to be updated synchronously in the same transaction;

[0054] S13: For data that needs to be updated synchronously, prioritize allocating the same FLASH storage page. When space is insufficient, allocate to adjacent FLASH storage pages. Specifically, for variable-length data, reserve storage space according to the maximum length, save the maximum length value and initialize the current storage length value to 0. When actually writing data, update the current storage length value through data write commands.

[0055] In this embodiment of the invention, preprocessing is performed through the Install command: the IC card parses the bit settings of the input C9 parameter value to determine the personalization support for functions 1 and 3. If data a, data b, and data d need to be updated synchronously in the same transaction, and data a and data b are not in the same data write command or data d does not need to be personalized using the data write command, then a contiguous storage space is first created for data a, data b, and data d or data a and data b to determine the storage location. The same FLASH storage page is allocated first, and when space is insufficient, it is allocated to an adjacent FLASH storage page.

[0056] Without configuring the default C9 processing, it's impossible to prevent data a, b, d or a, b (data d doesn't require data write instruction personalization) from being personalized in different Store Data instructions, and these Store Data instructions may also personalize other Store Data instructions, leading to data a, b, d or a, b being stored across pages. Preprocessing, by creating space for data a / b / d in advance, increases the probability of data a, b, d or a, b being stored on the same page, thereby reducing the number of erase / write operations and improving erase / write performance.

[0057] This invention determines the supported function combinations based on function identification parameters, accurately identifies the data range that needs to be updated synchronously, and prioritizes allocating these data to the same FLASH storage page. If space is insufficient, they are allocated to adjacent storage pages. This effectively avoids the problem of needing to erase and write multiple pages during updates due to data storage across pages, reducing unnecessary erase and write operations, thereby reducing FLASH memory wear and extending the lifespan of the IC card. At the same time, it simplifies the data update process and improves data processing efficiency during transactions. In other words, through the technical closed loop of "function identification - data association - intelligent allocation", it achieves a full-chain improvement from underlying storage optimization to end-user experience, enabling IC card products to achieve breakthrough improvements in reliability, performance, and cost.

[0058] In practical applications, if the length of the above data (such as a, b, d) is dynamically variable, then a space for the maximum length of each data is created, and the maximum length value of each data maximum length space is saved and the current storage length value is saved and initialized to 0. The values ​​of data a, b, d or a, b (data d does not need to be personalized using data write instructions) are then written by data write instructions (such as Store Data instructions) and the current storage length value is updated.

[0059] This invention employs a forward-looking space pre-allocation strategy, pre-creating space of maximum length and recording relevant length information to ensure that data expansion does not require cross-page storage. During actual storage, the current length is updated via data write commands, enabling precise management of data-occupied space, reducing additional erase and write operations caused by dynamic data adjustments, maximizing storage utilization, avoiding frequent space reallocation operations, reducing storage fragmentation, and eliminating storage migration overhead during data growth. It supports scenarios with sudden data growth, improves processing throughput, and ensures that data always resides on the initial page, reducing the occurrence of cross-page updates. This effectively reduces storage unit wear, extends FLASH lifespan, and is compatible with data types of different lengths, enabling storage space to be allocated once and used multiple times. Through this intelligent storage pre-allocation and dynamic update mechanism, the processing challenges of variable-length data are perfectly solved while ensuring storage efficiency, enabling IC cards to exhibit excellent adaptability and reliability in complex application scenarios.

[0060] Step S2, Data Writing Stage: For data written in the personalization stage, a differentiated space creation and data writing strategy is adopted based on the synchronous update attribute and length variability of the data. The storage space for synchronously updated data is created in the preprocessing stage, while the storage space for asynchronously updated data is created when the data writing instruction is received. Variable-length data must record the current storage length value.

[0061] In this embodiment of the invention, data written during the personalization stage is written according to the EMV personalization specification to ensure the IC card's transaction compatibility in multiple scenarios such as finance and transportation, conforming to industry-standard practices and reducing the adaptation costs of cross-system interactions. Actual data is written via the Store Data command, employing differentiated space creation and data writing strategies based on the data's synchronous update attributes and variable length, including:

[0062] 1. For fixed-length synchronous update data, space is created according to the length of the data during the preprocessing stage, and the data is written directly when the data write instruction is received;

[0063] 2. For fixed-length asynchronous update data, when receiving a data write instruction, create space according to the length of the data and write it;

[0064] 3. For variable-length synchronous update data, space is created according to the maximum length of the data during the preprocessing stage. When a data write instruction is received, the data is written and the current length is recorded.

[0065] 4. For variable-length asynchronous update data, when receiving a data write instruction, create space according to the maximum length of the data, write the data, and record the current length.

[0066] This invention employs a differentiated strategy, using adapted space management methods for different types of data, which can significantly optimize the performance and lifespan of FLASH storage IC cards. For synchronously updated fixed-length data, space is created in advance during the preprocessing stage to avoid space allocation delays during data writing, reduce operation time, and central storage reduces the risk of cross-page erasure. For asynchronously updated fixed-length data, space is created on demand to avoid invalid reservations and improve the real-time utilization of storage resources. For synchronously updated variable-length data, space is reserved according to the maximum length during preprocessing, ensuring that subsequent updates do not require cross-page operations, reducing the number of pages erased, and enabling dynamic management by recording the current length. For asynchronously updated variable-length data, space is created according to the maximum length and the length is recorded when receiving instructions, balancing flexibility and standardization. The overall strategy reduces unnecessary erase / write operations and cross-page operations, extends the lifespan of the IC card, accelerates data processing speed, and optimizes transaction performance and user experience.

[0067] In this embodiment of the invention, for synchronously updated data that does not need to be written during the personalization stage, the storage space is created uniformly during the preprocessing stage, and a space creation strategy is differentiated according to the variable length of the data to be synchronously updated, including:

[0068] 1. For fixed-length synchronous update data, space is created according to the length of the data during the preprocessing stage, and the data is updated in the created space based on the received specific instructions;

[0069] 2. For variable-length synchronous update data, during the preprocessing stage, space is created according to the maximum length of the data. Based on the received specific instructions, data is written into the created space, and the current storage length value is set to the length of the data.

[0070] It should be noted that the instructions in the embodiments of the present invention all correspond to specific functions supported by the IC card, and are used to trigger the update or write operation of the data allocated in the preprocessing stage during the cardholder's use stage.

[0071] For example, in one application scenario, if the IC card supports financial functions, when the cardholder queries and updates their balance (with data updated synchronously over a fixed period) at a terminal (such as an ATM or POS machine), the "balance update instruction" (such as a custom instruction 0x80 0x22) sent by the terminal is a specific instruction. After receiving it, the IC card directly updates the latest balance value in the storage space created for the balance data during the preprocessing stage.

[0072] In one application scenario, if the IC card supports transportation functions, when a cardholder completes a fare deduction and generates a consumption record (variable-length synchronous data update) through a public transportation terminal, the terminal sends a "transportation consumption record write instruction" (such as a custom instruction 0x80 0x33), which is a specific instruction. After receiving the instruction, the IC card writes the consumption information (including time, amount, etc.) within the maximum length space of the transportation record reserved in the preprocessing stage, and updates the current storage length value to the actual record's byte length.

[0073] This invention provides a unified storage space for data that does not need to be written during the personalization stage. This avoids data cross-page storage caused by temporary space allocation during cardholder use, reducing the number of page erases and writes, thereby extending the lifespan of the FLASH memory. The personalization stage does not process this type of data, simplifying the personalization process and improving card issuance efficiency. When the cardholder uses the card and receives a specific instruction, fixed-length synchronous update data can be directly updated within the preset space, while variable-length synchronous update data can be written within the reserved space and its current length recorded. This ensures convenient data operation, avoids space fragmentation, and improves storage utilization. Simultaneously, it reduces performance losses caused by space allocation and cross-page operations during transactions, accelerates data update speed, effectively improves customer experience, and enhances the competitiveness of integrated financial IC cards.

[0074] In order to demonstrate the optimization effect of the method provided by the present invention compared with the prior art, in a practical application scenario, 10 sample cards with the same process and technology were taken from each group of experiments and tested at room temperature of 25°C using a professional IC card test socket and automated script to compare the data of the method provided by the present invention with the prior art: 1. Perform transaction cycle test at the highest allowed frequency and record the time required for each transaction until failure occurs: (1) Prior art: average time per transaction: 290.6ms (retain one decimal place); (2) Method provided by the present invention: average time per transaction: 276.5ms (retain one decimal place); It can be seen from the comparison that the performance optimization of the method provided by the present invention is reflected in the shortening of transaction time. 2. Take two pages a and b and perform transaction cycle tests at the highest allowed frequency, and record the number of failures: (1) Existing technology: The average number of failures: 115384 (synchronous update data is stored across pages a and b, and pages a and b need to be erased and rewritten synchronously, so the number of erases and rewrites on pages a and b is almost the same, and the total number of erases and rewrites on pages a and b is ≈115384); (2) The method provided by the embodiment of the present invention: The average number of failures on page a: 115412, the average number of failures on page b: 115395 (synchronous update data is optimized to be stored on the same page (page a or page b), and the total number of erases and rewrites on pages a and b is 115412+115395=230807); By comparison, it can be seen that the extension of the card's service life by using the method provided by the present invention can be reflected in the increase of the total number of erases and rewrites on pages a and b.

[0075] This embodiment also provides a system for optimizing the lifespan and performance of FLASH storage IC cards. This system is used to implement the above embodiments and preferred embodiments, and details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that performs a predetermined function. Although the system described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.

[0076] This embodiment provides a system for optimizing the lifespan and performance of FLASH storage IC cards, such as... Figure 3 As shown, it includes:

[0077] The preprocessing module 31 is used to receive configuration instructions, parse the function identifier parameters in the configuration instructions, determine the functions supported by the IC card and the data that needs to be updated synchronously, and allocate the storage space of the data that needs to be updated synchronously in the same transaction to the same or adjacent FLASH storage pages.

[0078] The data writing module 32 is used to create space and write data differently based on the synchronous update attribute and length variability of the data written in the personalization stage. The storage space for synchronously updated data is created in the preprocessing stage, while the storage space for asynchronously updated data is created when a data writing instruction is received. Variable-length data must record the current storage length value.

[0079] In some optional implementations, the format of the function identifier parameter includes: parameter length field, parameter identifier, parameter value length field, and parameter value, wherein the parameter value indicates the enabled status of the function through the binary state of the bits.

[0080] In some optional implementations, the data writing module 32 employs differentiated space creation and data writing strategies based on the synchronous update attributes and length variability of the data, including:

[0081] For fixed-length synchronous update data, space is created according to the length of the data during the preprocessing stage, and the data is written directly when the data write instruction is received.

[0082] For fixed-length asynchronous update data, space is created and written according to the length of the data when a data write instruction is received;

[0083] For variable-length synchronous update data, space is created according to the maximum length of the data during the preprocessing stage. When a data write instruction is received, the data is written and the current length is recorded.

[0084] For variable-length asynchronous update data, when receiving a data write instruction, space is created according to the maximum length of the data, the data is written, and the current length is recorded.

[0085] In some alternative implementations, the preprocessing module 31 includes:

[0086] The instruction parsing unit is used to parse configuration instructions and identify the combination of functions supported in this personalization based on the function identifier parameters.

[0087] The data discrimination unit is used to determine whether the data associated with each function needs to be updated synchronously in the same transaction;

[0088] The space allocation unit is used to prioritize allocating the same FLASH storage page to data that needs to be updated synchronously, and to allocate to adjacent FLASH storage pages when space is insufficient.

[0089] In some optional implementations, it also includes: a data processing module, which is used to uniformly complete the creation of storage space in the preprocessing stage for synchronous update data that does not need to be written in the personalization stage, and to differentiate the space creation strategy according to the variability of the length of the data to be synchronously updated.

[0090] In one alternative implementation, the data processing module includes:

[0091] For fixed-length synchronous update data, space is created according to the length of the data during the preprocessing stage, and the data is updated in the created space based on the received specific instructions.

[0092] For variable-length synchronous update data, space is created according to the maximum length of the data during the preprocessing stage. Data is written into the created space based on the received specific instructions, and the current storage length value is set to the length of the data.

[0093] Further functional descriptions of the above modules and units are the same as those in the corresponding embodiments described above, and will not be repeated here.

[0094] The system for optimizing the lifespan and performance of FLASH storage IC cards in this embodiment is presented in the form of functional units. Here, a unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that execute one or more software or fixed programs, and / or other devices that can provide the above functions.

[0095] This invention also provides a FLASH storage IC card, which optimizes data storage by employing any of the above-described methods for optimizing the lifespan and performance of FLASH storage IC cards. This method dynamically selects function combinations, parses function identifier parameters to determine the data requiring synchronous updates, and allocates the storage space of the data requiring synchronous updates in the same transaction to the same or adjacent FLASH storage pages during the preprocessing stage. Then, the actual data is written according to specifications. This effectively reduces multi-page write / erase operations caused by cross-page data storage, lowers the write / erase frequency of the FLASH memory, thereby extending the lifespan of the IC card and reducing card replacement costs for issuing banks. Simultaneously, it avoids the complex process of cross-page updates, shortens data processing time during transactions, and improves transaction performance and user experience. Especially in scenarios integrating multiple functions such as debit / credit, transportation, and healthcare, it can maintain efficient data management while supporting multiple functions, enhancing product competitiveness and providing a reliable hardware foundation for the construction of financial technology and smart cities.

[0096] This invention also provides a computer-readable storage medium. The methods described above according to embodiments of the invention can be implemented in hardware or firmware, or implemented as computer code that can be recorded on a storage medium, or implemented as computer code downloaded via a network and originally stored on a remote storage medium or a non-transitory machine-readable storage medium and then stored on a local storage medium. Thus, the methods described herein can be processed by software stored on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. The storage medium can be a magnetic disk, optical disk, read-only memory, random access memory, flash memory, hard disk, or solid-state drive, etc.; further, the storage medium can also include combinations of the above types of memory. It is understood that computers, processors, microprocessor controllers, or programmable hardware include storage components capable of storing or receiving software or computer code, which, when accessed and executed by the computer, processor, or hardware, implements the methods shown in the above embodiments.

[0097] A portion of this invention can be applied as a computer program product, such as computer program instructions, which, when executed by a computer, can invoke or provide the methods and / or technical solutions according to the invention through the operation of the computer. Those skilled in the art will understand that the forms in which computer program instructions exist in a computer-readable medium include, but are not limited to, source files, executable files, installation package files, etc. Correspondingly, the ways in which computer program instructions are executed by a computer include, but are not limited to: the computer directly executing the instructions, or the computer compiling the instructions and then executing the corresponding compiled program, or the computer reading and executing the instructions, or the computer reading and installing the instructions and then executing the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to a computer.

[0098] Although embodiments of the invention have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the invention, and such modifications and variations all fall within the scope defined by the appended claims.

Claims

1. A method for optimizing the lifespan and performance of FLASH storage IC cards, characterized in that, include: Preprocessing stage: Receive configuration instructions, parse the function identifier parameters in the configuration instructions, determine the functions supported by the IC card and the data that needs to be updated synchronously, and allocate the storage space of the data that needs to be updated synchronously in the same transaction to the same or adjacent FLASH storage pages; Data writing stage: For data written in the personalization stage, differentiated space creation and data writing strategies are adopted according to the synchronous update attributes and variable length of the data. The storage space for synchronously updated data is created in the preprocessing stage, while the storage space for asynchronously updated data is created when the data writing instruction is received. Variable-length data needs to record the current storage length value. The differentiated space creation and data writing strategy based on the synchronous update attribute and length variability of the data includes: For fixed-length synchronous update data, space is created according to the length of the data during the preprocessing stage, and the data is written directly when the data write instruction is received. For fixed-length asynchronous update data, when a data write instruction is received, space is created according to the length of the data and then written; For variable-length synchronous update data, space is created according to the maximum length of the data during the preprocessing stage. When a data write instruction is received, the data is written and the current length is recorded. For variable-length asynchronous update data, when a data write instruction is received, space is created according to the maximum length of the data, the data is written, and the current length is recorded.

2. The method according to claim 1, characterized in that, The format of the function identifier parameter includes: parameter length field, parameter identifier, parameter value length field, and parameter value, wherein the parameter value indicates the enabled status of the function through the binary state of the bit.

3. The method according to claim 1 or 2, characterized in that, The function identifier parameters in the parsing configuration instructions determine the functions supported by the IC card and the data that needs to be updated synchronously. For data that needs to be updated synchronously in the same transaction, its storage space is allocated to the same or adjacent FLASH storage pages, including: Parse the configuration instructions and identify the combination of functions supported for this personalization based on the function identifier parameters; Determine whether the data associated with each function needs to be updated synchronously in the same transaction; For data that needs to be updated synchronously, prioritize allocating the same FLASH storage page. When space is insufficient, allocate to adjacent FLASH storage pages.

4. The method according to claim 1, characterized in that, Also includes: For synchronously updated data that does not need to be written during the personalization stage, the storage space is created uniformly during the preprocessing stage, and the space creation strategy is differentiated according to the variability of the length of the data to be synchronously updated.

5. The method according to claim 4, characterized in that, The spatial creation strategy based on the variable length of the data to be updated synchronously includes: For fixed-length synchronous update data, a space is created according to the length of the data during the preprocessing stage, and the data is updated in the created space based on the received specific instructions. For variable-length synchronous update data, a space is created according to the maximum length of the data during the preprocessing stage. Data is written into the created space based on a specific instruction received, and the current storage length value is set to the length of the data.

6. A system for optimizing the lifespan and performance of FLASH storage IC cards, based on the method described in any one of claims 1-5, characterized in that, include: The preprocessing module is used to receive configuration instructions, parse the function identifier parameters in the configuration instructions, determine the functions supported by the IC card and the data that needs to be updated synchronously, and allocate the storage space of the data that needs to be updated synchronously in the same transaction to the same or adjacent FLASH storage pages. The data writing module is used to create space and write data differently based on the synchronous update attributes and variable length of the data written during the personalization stage. The storage space for synchronously updated data is created during the preprocessing stage, while the storage space for asynchronously updated data is created when a data writing instruction is received. Variable-length data must record the current storage length value.

7. A FLASH storage IC card, characterized in that, Data storage optimization is performed using the method described in any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing the computer to perform the method for optimizing the lifespan and performance of a FLASH storage IC card as described in any one of claims 1 to 5.

9. A computer program product, characterized in that, Includes computer instructions for causing a computer to perform the method for optimizing the lifespan and performance of a FLASH storage IC card as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Method for prolonging FLASH write-in service life of intelligent card

    CN113434438A

  • Smart card of supporting large size memory and methodthereof

    KR100738032B1