Method and system for generating smart card production file

By automatically skipping blank data pages within the smart card master card operating system and returning only valid data, the problem of long file generation time in existing technologies is solved, achieving efficient generation and data integrity.

CN121787437APending Publication Date: 2026-04-03GUANGDONG CHUTIAN DRAGON SMART CARD
View PDF 4 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-17
Publication Date
2026-04-03

AI Technical Summary

Technical Problem

Existing technologies in smart card production involve reading and transmitting all data page by page, including blank pages, resulting in long processing times and low efficiency in generating production files.

Method used

The operating system of the smart card master card automatically identifies and skips blank data pages, returning only valid data and its physical address to generate the smart card production file.

Benefits of technology

It shortened the generation time of production documents from several minutes to tens of seconds, improved generation efficiency, and ensured data integrity and logical consistency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121787437A_ABST
    Figure CN121787437A_ABST
Patent Text Reader

Abstract

The invention provides a method and system for generating a smart card production file. The method comprises the steps that a production tool sends a data reading request to an operating system; the operating system reads data in the memory of the mother card based on the to-be-read address, and judges whether the currently read data page is a preset blank data page or not; if the data page is a blank data page, the operating system continues to perform subsequent reading by taking the data page as a unit from the next data page of the currently read data page until a valid data page is read; the operating system generates return data according to the valid data in the valid data page and the valid data address corresponding to the valid data, and returns the return data to the production tool; and the production tool receives the return data and generates a smart card production file based on the return data. In the mode, when the data is read in the operating system of the smart card mother card, the blank data page is automatically judged and skipped, so that the generation time of the production file can be shortened, and the generation efficiency of the production file is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of smart card technology, and in particular to a method and system for generating smart card production files. Background Technology

[0002] In smart card manufacturing, a master card is typically created as a template. During mass production, the data from this master card needs to be completely read to generate production files for subsequent programming. The existing method involves the production tool requesting data from the master card. The master card's operating system then sequentially reads and transmits all data within the chip, including valid data and blank pages, page by page, to the production tool. After receiving all the data, the production tool performs further processing to identify and remove blank pages before finally generating the production file. However, with increasing chip capacity, the proportion of blank pages is high. This method of reading and transmitting all data (including invalid data) page by page results in a very long data export time, typically several minutes, increasing unnecessary data transfer. Therefore, the existing technology suffers from low production file generation efficiency, impacting project delivery. Summary of the Invention

[0003] In view of this, the purpose of this application is to provide a method and system for generating smart card production files. By automatically identifying and skipping blank data pages when reading data inside the operating system of the smart card master card, the operating system can return only non-blank valid data and its physical address to the production tool, thereby avoiding the transmission and processing of a large number of invalid data pages, thus shortening the production file generation time and improving the production file generation efficiency.

[0004] In a first aspect, this application provides a method for generating smart card production documents, applied to a smart card production document generation system; the smart card production document generation system includes an operating system and production tools for a smart card master card connected in communication; the method includes: The production tool sends a data read request to the operating system; the data read request includes the address to be read.

[0005] The operating system reads data from the master card memory in units of data page size based on the address to be read in the data read request, and determines whether the currently read data page is a preset blank data page.

[0006] If the currently read data page is a blank data page, the operating system continues to read data page by page, starting from the next data page after the currently read data page, until a valid data page is read.

[0007] The operating system generates return data based on the valid data in the valid data page and the corresponding valid data address, and then returns the return data to the production tool.

[0008] The production tool receives the returned data and generates smart card production files based on the returned data.

[0009] In an optional implementation, the step of the operating system reading data from the master card memory in units of data page size based on the address to be read in the data read request, and determining whether the currently read data page is a preset blank data page, includes: The operating system loads the data pages corresponding to the addresses to be read into random access memory in sequence.

[0010] The operating system determines whether the currently loaded data page in random access memory is a blank data page.

[0011] In an optional implementation, if the currently read data page is a blank data page, the operating system continues to read data page by page from the next data page until a valid data page is read. This step includes: If the currently read data page is a blank data page, the operating system will not return data to the production tool, and will continue to read data page by page, starting from the next data page after the currently read data page, until a valid data page is read.

[0012] In an optional implementation, the method further includes: If the currently read data page is not a blank data page, the operating system determines that the currently read data page is a valid data page, and generates return data based on the valid data in the valid data page and the valid data address corresponding to the valid data.

[0013] In an optional implementation, the data format of the returned data includes a data start address field, a data length field, and a data content field.

[0014] In an optional implementation, after the production tool receives the returned data, the method further includes: The production tool determines whether the data length represented by the data length field is consistent with the length of the data to be read.

[0015] If the data length is inconsistent with the length of the data to be read, and the data format conforms to the preset data format, the production tool determines that the data start address corresponding to the data start address field has changed.

[0016] In an optional implementation, after the production tool receives the returned data, the method further includes: The production tool calculates the next address to be read based on the data start address field and the data length field.

[0017] The production tool initiates the next data read request based on the next address to be read.

[0018] In an optional implementation, the step of generating smart card production files based on the returned data by the production tool includes: The production tool generates corresponding write commands based on the data start address field, data length field, and data content field.

[0019] The production tools generate the smart card production files required for batch card production by combining the written instructions in the order they are written.

[0020] In an optional implementation, the write command includes a sector switching command and a data write command; the method further includes: When multiple data write commands are for the same sector, the production tool will merge the multiple sector switching commands into one.

[0021] Secondly, this application provides a smart card production document generation system for executing the smart card production document generation method of any of the aforementioned embodiments. The smart card production document generation system includes an operating system and production tools for a smart card master card that are connected in communication.

[0022] This application provides a method and system for generating smart card production files. By automatically identifying and skipping blank data pages during reading within the operating system of the smart card master card, and only returning valid data and its physical address, the propagation and processing of invalid data can be reduced, shortening the production file generation efficiency from several minutes to tens of seconds. Simultaneously, by returning accurate addresses and data content, it ensures that the final generated data file is logically consistent with the smart card master card, thereby guaranteeing data integrity and further improving the efficiency of production file generation.

[0023] Other features and advantages of this application will be set forth in the following description and will be apparent in part from the description or may be learned by practicing the application.

[0024] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description

[0025] To more clearly illustrate the technical solutions in the specific embodiments of this application or 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 this application. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0026] Figure 1 This is a schematic diagram of a smart card production document generation system provided in an embodiment of this application; Figure 2A flowchart illustrating the method for generating smart card production files provided in this application embodiment; Figure 3 Flowchart of the blank data page determination method provided in the embodiments of this application; Figure 4 Flowchart of the method for determining changes in the starting address of data provided in this application embodiment; Figure 5 Flowchart of the next data read request generation method provided in the embodiments of this application; Figure 6 A flowchart illustrating the smart card production document generation method provided in this application embodiment.

[0027] Icons: 1-Operating system; 2-Production tools. Detailed Implementation

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

[0029] To facilitate understanding of this embodiment, the embodiments of this application will be described in detail below.

[0030] This application provides a system for generating smart card production documents, referring to... Figure 1 The smart card production file generation system provided in this application includes an operating system 1 and a production tool 2 for a smart card master card that are connected in communication. The smart card production file generation system is used to execute the smart card production file generation method.

[0031] Here, the operating system 1 of the smart card master card runs inside the smart card master card chip; it is firmware that runs within the smart card master card chip. Operating system 1 is used to respond to instructions from the generation tool and manage the data reading process within the master card.

[0032] Production tool 2, which can be a personal computer or a dedicated industrial control device, is located outside the smart card master card. Production tool 2 establishes a communication connection (e.g., communication serial port, USB, or radio frequency) with the operating system 1 of the smart card master card and interacts with it.

[0033] Based on the above embodiments, this application provides a method for generating smart card production documents, applied to a smart card production document generation system; the smart card production document generation system includes an operating system for a smart card master card with established communication connections and production tools. (Refer to...) Figure 2 The method for generating smart card production files provided in this application embodiment is as follows: Step S101: The production tool sends a data read request to the operating system; the data read request includes the address to be read.

[0034] Here, the production tool acts as the initiator, and the operating system acts as the executor. The production tool sends a command or instruction to the operating system through a communication interface; this command or instruction is the data read request. The data read request contains a key parameter: the address to be read. This address tells the operating system from which physical address in the master memory to begin the read operation.

[0035] In step S102, the operating system reads data from the mother card memory in units of data page size based on the address to be read in the data read request, and determines whether the currently read data page is a preset blank data page.

[0036] Here, after receiving a data read request, the operating system does not immediately return the data to the production tools. Instead, the operating system performs the read and judgment operations internally within the chip. Based on the received address to be read, the operating system reads a data page from the motherboard's memory according to a preset data page size (e.g., 256 bytes or 512 bytes).

[0037] After reading the data page, the operating system internally determines its content. This determination is based on whether the data page is a pre-defined blank data page.

[0038] Here, the preset blank data page is a data pattern representing an invalid or blank state, predefined according to chip characteristics or application requirements. In a preferred embodiment, the blank data page can be a data page containing only FF. In other feasible embodiments, the blank data page can also be a data page containing only 00, or a data page defined as blank by the system, consisting of other specific repeating bytes.

[0039] Step S103: If the currently read data page is a blank data page, the operating system continues to read data pages from the next data page after the currently read data page until a valid data page is read.

[0040] Here, if the operating system determines that the current data page is a blank data page, the operating system will not return any data to the production tool, thereby avoiding the transmission of invalid data.

[0041] The operating system will automatically increment its internal read address pointer to point to the address of the next data page after the current blank data page, and repeat the read and judgment operations until a data page read by the operating system is determined to be a non-blank data page, i.e. a valid data page.

[0042] In step S104, the operating system generates return data based on the valid data in the valid data page and the valid data address corresponding to the valid data, and returns the return data to the production tool.

[0043] Here, once the operating system finds a valid data page, it stops the internal read loop. At this point, the operating system obtains the valid data and its address.

[0044] Valid data refers to the actual data content within a valid data page. The valid data address is the actual physical address of the valid data page in the master memory. This valid data address may differ from the address initially requested by the production tool.

[0045] The operating system encapsulates these two key pieces of information, along with any other possible auxiliary information (such as the length of the valid data), into a specific format of return data. The operating system then sends this return data packet to the production tools via the communication interface.

[0046] In step S105, the production tool receives the returned data and generates a smart card production file based on the returned data.

[0047] Here, after receiving the return data from the operating system, the production tool parses the data. It extracts the valid data addresses and data content from the returned data.

[0048] The production tool obtains the valid data address field and data content of the valid data, and generates the final smart card production file based on this information. In a preferred embodiment, the generation process specifically refers to converting these addresses and data contents into a series of write instructions for batch production. These write instructions are organized and saved sequentially, and the resulting file is the smart card production file, which is used for the rapid programming of blank smart cards.

[0049] In an optional implementation, refer to Figure 3 Step S102 includes the following steps S201-S202.

[0050] In step S201, the operating system loads the data pages corresponding to the addresses to be read into the random access memory in sequence.

[0051] Here, when the operating system receives a read request from the production tool, it reads data from the non-volatile memory (such as EEPROM (Electrically Erasable Programmable Read-Only Memory) or Flash) of the mother card chip according to the address to be read contained in the request, according to the predetermined data page size, and loads the contents of this data page completely into the random access memory (RAM) inside the chip.

[0052] In step S202, the operating system determines whether the data page currently loaded in the random access memory is a blank data page.

[0053] Here, after the data is loaded into random access memory, the operating system immediately analyzes and judges the contents of the data page internally.

[0054] Specifically, the operating system examines the data loaded into random access memory to determine if the corresponding data page is a full FF page. If all the data in the data page is FF, it is determined to be a blank data page. If the current data page is not a full FF page (i.e., it contains at least one non-FF data item), it is determined to be a valid data page.

[0055] In an optional implementation, step S103 includes: If the currently read data page is a blank data page, the operating system will not return data to the production tool, and will continue to read data page by page, starting from the next data page after the currently read data page, until a valid data page is read.

[0056] Here, if the operating system determines that the data page loaded in the random access memory is a full FF page, the operating system will not return any data to the production tool.

[0057] Meanwhile, the operating system does not stop working; instead, it automatically continues reading data page by page, starting from the next data page after the currently read one. Specifically, the operating system internally increments the read address and repeatedly executes the steps of loading data pages into random access memory and determining whether the currently loaded data page in random access memory is a blank data page. This internal loop continues until the operating system reads a non-blank, valid data page.

[0058] In an optional implementation, the method further includes: If the currently read data page is not a blank data page, the operating system determines that the currently read data page is a valid data page, and generates return data based on the valid data in the valid data page and the valid data address corresponding to the valid data.

[0059] Here, if the operating system detects that a data page in random access memory is not a full FF page, the operating system determines that the currently read data page is a valid data page.

[0060] Once a valid data page is found, the operating system temporarily halts its internal read and decision loop. At this point, the operating system generates return data based on the actual content of the valid data page and its corresponding physical address in the master memory. After generating the return data, the operating system sends it to the production tools.

[0061] In an optional implementation, the data format of the returned data includes a data start address field, a data length field, and a data content field.

[0062] Here, the data start address field is used to characterize the actual physical address of the valid data in the mother card memory.

[0063] The data length field is used to characterize the length of valid data.

[0064] The data content field is used to represent the actual content of valid data.

[0065] In an optional implementation, refer to Figure 4 In step S105, after the production tool receives the returned data, the method further includes the following steps S301-S302.

[0066] Step S301: The production tool determines whether the data length represented by the data length field is consistent with the length of the data to be read.

[0067] Here, the production tool determines whether the data length represented by the data length field in the returned data is consistent with the length of the data to be read in this request by the production tool.

[0068] If the lengths of the two data points are determined to be the same, it indicates that the data is valid. The production tool will save the data and convert it into a write instruction for the corresponding address.

[0069] If the lengths of the two are found to be inconsistent, the production tool will then determine whether the data format of the returned data conforms to the preset data format (i.e., the data start address, data length, and data content three-field format mentioned above).

[0070] In step S302, if the data length is inconsistent with the length of the data to be read, and the data format conforms to the preset data format, the production tool determines that the data start address corresponding to the data start address field has changed.

[0071] Here, if the lengths of the two are inconsistent and the data format also conforms to the preset data format, the production tool determines that the data start address corresponding to the data start address field of the returned data has changed, that is, the operating system has skipped several blank pages, and the currently returned data is valid data at a new address.

[0072] In an optional implementation, refer to Figure 5 In step S105, after the production tool receives the returned data, the method further includes the following steps S401-S402.

[0073] In step S401, the production tool calculates the next address to be read based on the data start address field and the data length field.

[0074] Here, the production tool adds the returned starting address of the data to the length of the data to obtain the next memory address immediately following the valid data block, and uses this address as the starting address of the next read operation.

[0075] In step S402, the production tool initiates the next data read request based on the next address to be read.

[0076] Here, the production tool initiates a new data read request based on this newly calculated next address to be read.

[0077] In an optional implementation, refer to Figure 6 The steps for the production tool to generate smart card production files based on the returned data include the following steps S501-S502.

[0078] In step S501, the production tool generates the corresponding write command based on the data start address field, data length field, and data content field.

[0079] Here, the production tool converts the received physical address, data length, and data content into programming commands that conform to the target chip's instruction set, i.e., write commands.

[0080] In step S502, the production tool generates the smart card production files required for batch card production by combining the writing instructions in the order of the instructions.

[0081] Here, the production tool receives multiple return data packets during the entire data reading process and converts them all into corresponding write commands in sequence. Finally, the production tool combines these write commands in the correct order (i.e., in ascending order of the corresponding master card memory addresses) to generate a complete smart card production file that can be used for mass card production.

[0082] In an optional implementation, the write command includes sector switching commands and data write commands.

[0083] Here, write instructions can include sector switching instructions and data write instructions. For example, the format of a chip's sector switching instruction might be "000B00 + sector number + 00", while the format of a data write instruction might be "000C + address + len + value". When the production tool receives valid data at address 0x10000, it converts it into two instructions: a sector switching instruction (e.g., "000B000100") and a data write instruction (e.g., "000C0000 + len + value").

[0084] The method also includes: When multiple data write commands are for the same sector, the production tool will merge the multiple sector switching commands into one.

[0085] Here, when multiple data write commands are written to the same sector, the production tool will automatically merge the multiple corresponding sector switching commands into one.

[0086] Specifically, when the production tool generates the instruction sequence, it checks whether consecutive write operations are in the same sector. If so, it only outputs a sector switching instruction once at the beginning, and subsequent write instructions do not repeat the sector switching instruction until the sector changes.

[0087] This application provides a method for generating smart card production files. By automatically identifying and skipping preset blank data pages when reading data within the smart card's operating system, and only returning valid data pages to the production tool, it avoids the transmission and processing of large amounts of invalid data, reducing the production file generation speed from several minutes to tens of seconds, thus improving efficiency. Simultaneously, the operating system returns a data format containing accurate starting address, length, and content, and the production tool performs address change judgment and next-to-be-read address calculation, ensuring the continuity of data reading and the data integrity of the final production file. Furthermore, the production tool converts received valid data into write instructions and automatically merges multiple sector switching instructions from the same sector during conversion, optimizing the instruction structure of the production file and improving communication and computation efficiency.

[0088] The computer program product provided in this application includes a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the methods described in the preceding method embodiments. For specific implementation details, please refer to the method embodiments, which will not be repeated here.

[0089] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the system and apparatus described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0090] Furthermore, in the description of the embodiments of this application, unless otherwise expressly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in this application based on the specific circumstances.

[0091] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0092] In the description of this application, it should be noted that the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are used only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this application. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.

[0093] Finally, it should be noted that the above-described embodiments are merely specific implementations of this application, used to illustrate the technical solutions of this application, and not to limit them. The protection scope of this application is not limited thereto. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments within the scope of the technology disclosed in this application, or make equivalent substitutions for some of the technical features. Such modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be covered within the protection scope of this application.

Claims

1. A method for generating smart card production files, characterized in that, A system for generating smart card production documents; the smart card production document generation system includes an operating system and production tools for a smart card master card connected in communication; the method includes: The production tool sends a data read request to the operating system; the data read request includes the address to be read. The operating system reads data from the master card memory in units of data page size based on the address to be read in the data read request, and determines whether the currently read data page is a preset blank data page; If the currently read data page is a blank data page, the operating system continues to read data pages from the next data page after the currently read data page until a valid data page is read. The operating system generates return data based on the valid data in the valid data page and the valid data address corresponding to the valid data, and returns the return data to the production tool; The production tool receives the returned data and generates the smart card production file based on the returned data.

2. The method for generating smart card production documents according to claim 1, characterized in that, The operating system reads data from the master card memory in units of data page size based on the address to be read in the data read request, and determines whether the currently read data page is a preset blank data page, including: The operating system loads the data pages corresponding to the address to be read into the random access memory in sequence. The operating system determines whether the currently loaded data page in the random access memory is a blank data page.

3. The method for generating smart card production documents according to claim 2, characterized in that, If the currently read data page is the blank data page, the operating system continues to read data pages one by one, starting from the next data page of the currently read data page, until a valid data page is read. This includes the following steps: If the currently read data page is a blank data page, the operating system will not return data to the production tool, and will continue to read data page by page from the next data page after the currently read data page until a valid data page is read.

4. The method for generating smart card production documents according to claim 1, characterized in that, The method further includes: If the currently read data page is not the blank data page, the operating system determines that the currently read data page is the valid data page, and generates return data based on the valid data in the valid data page and the valid data address corresponding to the valid data.

5. The method for generating smart card production documents according to claim 1, characterized in that, The returned data format includes a data start address field, a data length field, and a data content field.

6. The method for generating smart card production documents according to claim 5, characterized in that, After the step of the production tool receiving the returned data, the method further includes: The production tool determines whether the data length represented by the data length field is consistent with the length of the data to be read; If the data length is inconsistent with the data length to be read, and the data format conforms to the preset data format, then the production tool determines that the data start address corresponding to the data start address field has changed.

7. The method for generating smart card production documents according to claim 6, characterized in that, After the step of the production tool receiving the returned data, the method further includes: The production tool calculates the next address to be read based on the data start address field and the data length field; The production tool initiates a next data read request based on the next address to be read.

8. The method for generating smart card production documents according to claim 6, characterized in that, The step of the production tool generating the smart card production file based on the returned data includes: The production tool generates a corresponding write instruction based on the data start address field, the data length field, and the data content field; The production tool generates the smart card production files required for batch card production by combining the write instructions in the order they are written.

9. The method for generating smart card production documents according to claim 8, characterized in that, The write command includes sector switching commands and data write commands; the method further includes: When multiple data write instructions per sector, the production tool merges the multiple sector switching instructions into one.

10. A system for generating smart card production documents, characterized in that, The method for generating smart card production documents according to any one of claims 1-9 is used to execute the method for generating smart card production documents, wherein the smart card production document generation system includes an operating system and production tools for a smart card master card that are connected in communication.

Citation Information

Patent Citations

  • Method for operating data file by card operating system and smart card thereof

    CN101140548A

  • Method for manufacturing intelligent card, device, master card and system

    CN101556541A

  • Card writing method, system and equipment

    CN104936167A

  • Method and system for improving production efficiency of intelligent card

    CN113282322A