A management device and method for extending the memory of a JAVA card COS

CN115757194BActive Publication Date: 2026-10-09WUXI RONGKA TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211286365.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-20
Publication Date
2026-10-09
Estimated Expiration
2042-10-20

AI Technical Summary

Technical Problem

[0005]针对现有技术中的技术缺陷,本发明实施例的目的在于提供一种JAVA卡COS内存扩展的管理装置及方法,以克服现有技术中部分小内存安全芯片不能应用于有大内存需求Java卡的缺陷

Benefits of technology

[0037] The beneficial effects of implementing the embodiments of the present invention are as follows: Compared with the prior art, the JAVA card COS memory expansion management device and method provided by implementing the embodiments of the present invention, by adding an external storage chip on the basis of the security chip, allocating a corresponding memory address range, and storing the user data generated by the Java card in the storage chip, enables the application of some small-memory security chips to the Java card, while expanding the user's usage space, reducing costs while meeting the needs of some users who require large memory storage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115757194B_ABST
    Figure CN115757194B_ABST
Patent Text Reader

Abstract

The embodiment of the application discloses a kind of JAVA card COS memory extension management device and method, it is applied to security chip, at least one memory chip is connected to the security chip;The security chip is loaded with Java card COS, and the Java card COS includes communication module and memory management module;The communication module is used to realize the data interaction between the memory chip;The memory management module is used to: the corresponding memory address interval of the security chip and memory chip connected is allocated, and the user data generated by Java card user is stored in the memory chip.The method of the application can be applied to Java card by part of small memory security chip, while expanding the use space of user, reduce cost, meet the demand of part of need large memory storage.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of memory management technology, and specifically to a management device and method for extending the memory of a JAVA card COS. Background Technology

[0002] Java Card is a software technology that allows Java-based applets to run on small-memory devices such as smart cards. Java Card is a minimal Java platform for embedded devices. It enables developers to create device-specific applications.

[0003] The Java Card COS runs in a Secure Element (SE), which is usually provided in the form of a chip. Most existing security chips have Flash storage space of 256K, 512K, or 1M, with a small number reaching more than 1M.

[0004] As Java cards support more and more functions (due to the addition of features from GP specifications, 3GPP specifications, etc.), the space occupied by Java card COS code increases. At the same time, with the increasing number of applications installed, large memory chips are needed to meet the requirements, which reduces the number of available chips and increases costs. Furthermore, it cannot meet the needs of some applications that require large memory storage (such as storage of more than 1M of data). Summary of the Invention

[0005] In view of the technical defects in the prior art, the purpose of this invention is to provide a management device and method for JAVA card COS memory expansion, so as to overcome the defect that some small memory security chips in the prior art cannot be applied to Java cards with large memory requirements.

[0006] To achieve the above objectives, in a first aspect, embodiments of the present invention provide a Java Card COS memory expansion management device applied to a security chip, wherein the security chip is connected to at least one storage chip; wherein the security chip is loaded with a Java Card COS, and the Java Card COS includes a communication module and a memory management module;

[0007] The communication module is used to realize data interaction with the memory chip;

[0008] The memory management module is used for:

[0009] Allocate corresponding memory address ranges to the connected security chip and storage chip;

[0010] The user data generated by the Java card user is stored in the storage chip.

[0011] Preferably, the memory management module is further used to perform memory read / write operations when the Java card COS is running and there is a read / write requirement, and the specific steps are as follows:

[0012] The Java Card COS calls the memory read / write interface function and obtains the access address based on the corresponding function parameters; wherein, the access address is calculated by the Java Card COS at runtime;

[0013] Determine the address range of the accessed address;

[0014] Based on the accessed address range, call the corresponding function read / write interface to perform data read / write;

[0015] Read / write data.

[0016] Preferably, the memory space managed by the Java card COS consists of the memory of the security chip and the storage chip, including the Java COS code area, the Java COS configuration area and the Java COS user data area;

[0017] When the memory management module allocates the corresponding memory address range, the allocation method includes:

[0018] The Java COS code is stored separately in the security chip, which has a reserved storage space. The Java COS configuration area and the Java COS user data area are stored in the storage chip.

[0019] Alternatively, the Java COS code area, Java COS configuration area, and Java COS user data area can be divided according to actual usage, and no additional storage space needs to be reserved between adjacent areas.

[0020] Preferably, when the allocation method uses Java COS code stored separately in the security chip, and the security chip has reserved some storage space, while the Java COS configuration area and Java COS user data area are stored in the storage chip, the function of upgrading the Java card COS can be achieved by directly downloading and overwriting the Java COS code.

[0021] Secondly, embodiments of the present invention also provide a method for managing Java Card COS memory expansion, applied to a security chip, wherein the security chip is loaded with Java Card COS, and the method includes:

[0022] Connect the security chip to at least one memory chip;

[0023] The security chip and the storage chip are connected via communication to enable data interaction;

[0024] Allocate corresponding memory address ranges to the connected security chip and storage chip;

[0025] The user data generated by the Java card user is stored in the storage chip.

[0026] Preferably, when the Java card COS is running and there is a read / write requirement, memory read / write is performed, and the specific steps are as follows:

[0027] The Java Card COS calls the memory read / write interface function and obtains the access address based on the corresponding function parameters; wherein, the access address is calculated by the Java Card COS at runtime;

[0028] Determine the address range of the accessed address;

[0029] Based on the accessed address range, call the corresponding function read / write interface to perform data read / write;

[0030] Read / write data.

[0031] Preferably, the memory space managed by the Java card COS consists of the memory of the security chip and the storage chip, including the Java COS code area, the Java COS configuration area and the Java COS user data area;

[0032] When allocating the corresponding memory address range, the allocation methods include:

[0033] The Java COS code is stored separately in the security chip, which has a reserved storage space. The Java COS configuration area and the Java COS user data area are stored in the storage chip.

[0034] Alternatively, the Java COS code area, Java COS configuration area, and Java COS user data area can be divided according to actual usage, and no additional storage space needs to be reserved between adjacent areas.

[0035] Preferably, if the accessed address range belongs to the memory address range of the memory chip, the accessed address range needs to be converted into the physical address space of the memory chip first, and then encapsulated into read / write instructions of the communication protocol corresponding to the memory chip.

[0036] Preferably, when the allocation method uses Java COS code stored separately in the security chip, and the security chip has reserved some storage space, while the Java COS configuration area and Java COS user data area are stored in the storage chip, the function of upgrading the Java card COS can be achieved by directly downloading and overwriting the Java COS code.

[0037] The beneficial effects of implementing the embodiments of the present invention are as follows: Compared with the prior art, the JAVA card COS memory expansion management device and method provided by implementing the embodiments of the present invention, by adding an external storage chip on the basis of the security chip, allocating a corresponding memory address range, and storing the user data generated by the Java card in the storage chip, enables the application of some small-memory security chips to the Java card, while expanding the user's usage space, reducing costs while meeting the needs of some users who require large memory storage. Attached Figure Description

[0038] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the accompanying drawings used in the description of the specific embodiments or the prior art will be briefly introduced below.

[0039] Figure 1 This is a structural block diagram of a JAVA card COS memory expansion management device provided in an embodiment of the present invention;

[0040] Figure 2 This is a schematic diagram of a hardware structure provided in an embodiment of the present invention;

[0041] Figure 3 This is a diagram of a Java card COS memory management framework provided in an embodiment of the present invention;

[0042] Figure 4 This is a Java card COS management memory space mapping logic diagram provided in an embodiment of the present invention;

[0043] Figure 5 This is a schematic diagram of a memory read / write process provided in an embodiment of the present invention;

[0044] Figure 6 This is a schematic diagram of the memory structure under one allocation method provided in an embodiment of the present invention;

[0045] Figure 7 This is a schematic diagram of a Java card COS upgrade process provided in an embodiment of the present invention;

[0046] Figure 8 This is a schematic diagram of the memory structure under another allocation method provided in the embodiments of the present invention;

[0047] Figure 9 This is a flowchart of a JAVA card COS memory expansion management method provided in an embodiment of the present invention. Detailed Implementation

[0048] 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, not all, of the embodiments of the present invention. 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.

[0049] It should be noted that, unless otherwise stated, the technical or scientific terms used in this application should have the ordinary meaning as understood by one of ordinary skill in the art to which this invention pertains.

[0050] Secure Element (SE)

[0051] Example 1:

[0052] Please refer to Figures 1 to 2 This invention provides a Java Card COS memory expansion management device, applied to a security chip, wherein the security chip is connected to at least one storage chip; wherein the security chip is loaded with a Java Card COS, and the Java Card COS includes a communication module and a memory management module;

[0053] The communication module is used to realize data interaction with the memory chip;

[0054] The memory management module is used for:

[0055] Allocate corresponding memory address ranges to the connected security chip and storage chip;

[0056] The user data generated by the Java card user is stored in the storage chip.

[0057] Specifically, in this embodiment, a security chip (i.e. Figure 2 Taking the SE chip and two storage chips for connection expansion as an example, the SE chip is the chip that runs Java Card COS, and the storage chips are used to store data. The relevant communication protocol is determined by the storage chip, which can be SPI, UART, or other protocols.

[0058] For example, this invention uses a 256K memory SE chip + two SPI FLASH memory chips (1M memory size) to implement Java card COS; however, this is not a limitation.

[0059] The SE chip communicates with two SPI FLASH memory chips using the SPI protocol. SPI FLASH chip 1 communicates using the SE chip's SPI1 channel, and SPI FLASH chip 2 communicates using the SE chip's SPI2 channel. Reading and writing SPI FLASH protocol commands require adaptation based on the specific SPI FLASH chip's definition.

[0060] Furthermore, such as Figure 3 As shown in the Java Card COS memory management framework diagram, the memory space managed by the Java Card COS consists of the memory of the security chip and the storage chip, including the Java COS code area, the Java COS configuration area, and the Java COS user data area; wherein:

[0061] Java COS code area: Stores Java card COS code;

[0062] Java COS configuration area: stores data such as transaction protection area, Java card platform configuration area, platform variable area, etc. The specific data contained can be defined by Java COS developers according to their needs;

[0063] Java COS User Data Area: Stores data generated by Java card users, such as installed application packages, application instances, and personalized data.

[0064] Reference Figure 4 As shown, the total memory space of the Java card COS implemented in this embodiment of the invention is 2304K. The total address space managed by the Java card COS is a virtual address space of (0x0~0x0023FFFF), where the address space of (0x0~0x0003FFFF) corresponds to the address space of the SE chip (0x0~0x0003FFFF); the address space of (0x00040000~0x0013FFFF) corresponds to the address space of SPI FLASH memory chip 1 (0x0~0x000FFFFF); and the address space of (0x00140000~0x0023FFFF) corresponds to the address space of SPI FLASH memory chip 2 (0x0~0x000FFFFF).

[0065] In other words, the memory address range allocated by the Java card COS is a virtual address space.

[0066] Furthermore, the memory management module is also used to perform memory read / write operations when the Java card COS is running and there are read / write requirements, as described above. Figure 5 The specific steps are as follows:

[0067] The Java Card COS calls the memory read / write interface function and obtains the access address based on the corresponding function parameters. The access address is calculated by the Java Card COS at runtime, including calculations based on the configuration area settings or the Java Virtual Machine index. When calling the write interface function, the data to be written must also be passed in.

[0068] Determine the address range of the accessed address; based on the previous example, an accessed address in the range (0x0~0x0003FFFF) indicates access to the SE chip address space; an accessed address in the range (0x00040000~0x0013FFFF) indicates access to the SPI FLASH chip 1 address space; an accessed address in the range (0x00140000~0x0023FFFF) indicates access to the SPI FLASH chip 2 address space; the address space conversion method is as described above. Figure 5 As shown.

[0069] Based on the accessed address range, the corresponding function read / write interface is invoked to perform data read / write. The SPI FLASH read / write interface needs to be encapsulated into corresponding operation instructions according to the chip's requirements. These operation instructions are sent to the SPI FLASH chip via the SPI communication channel. If the accessed address range belongs to the memory address range of the storage chip, the accessed address range needs to be first converted to the physical address space of the storage chip before being encapsulated into read / write instructions corresponding to the communication protocol of the storage chip.

[0070] Read / write data.

[0071] The above technical solution adds an external storage chip to the security chip, allocates a corresponding memory address range, and stores the user data generated by the Java card in the storage chip. This allows some security chips with small memory to be used in Java cards, while expanding the user's usage space. It reduces costs while meeting the needs of some users who require large memory storage.

[0072] Furthermore, when the memory management module allocates the corresponding memory address range, its allocation method includes:

[0073] like Figure 6As shown, in Scheme 1, the Java COS code is stored separately in the security chip, which reserves some storage space. The Java COS configuration area and Java COS user data area are stored in the storage chip. This allocation method allows the Java card COS to be upgraded by directly downloading and overwriting the Java COS code when an upgrade is needed. For example, the Java COS code area is allocated 256K (address range: 0x0~0x0003FFF), the Java COS configuration area is allocated 40K (address range: 0x00040000~0x00049FFF), and the Java COS user data area is allocated 984K (0x0004A000~0x0014FFFF).

[0074] It should be noted that this method is only applicable when the SE chip's memory is larger than the Java COS code. Since the Java COS code runs separately on the SE chip, while the Java COS configuration data and user data are stored in the storage chip, and the SE chip has reserved space, the COS functionality can be upgraded by directly downloading and overwriting the Java COS code. This eliminates the need for an additional upgrade function in Java COS; simply overwriting the COS code achieves the upgrade effect, making the upgrade more convenient. The upgrade steps are as follows: Figure 7 As shown, it includes:

[0075] Step 1: Prepare the upgraded COS;

[0076] Step 2: Erase the COS in the SE chip (directly erase the SE memory space);

[0077] Step 3: Download (burn) the new COS code; COS upgrade complete. Here, COS has the same meaning as the Java card COS mentioned earlier.

[0078] Alternatively, in Option 2, the Java COS code area, Java COS configuration area, and Java COS user data area can be divided according to actual usage, without the need to reserve additional storage space between adjacent areas.

[0079] That is, the Java COS code area, configuration area, and user area are determined by actual usage. The corresponding Java card memory structure diagram is as follows: Figure 8 As shown.

[0080] In this scheme, the Java COS code area is allocated 200K (address range: 0x0~0x00031FFF), the Java COS configuration area is allocated 50K (address range: 0x00032000~0x0003E7FF), and the Java COS user data area is allocated 1086K (address range: 0x0003E800~0x0014FFFF).

[0081] Compared to Solution 1, this solution is not limited by the SE chip's memory size, and no additional space needs to be reserved between adjacent areas, maximizing the use of storage space. However, since code modifications often require different code area spaces, COS upgrades often result in the new version's code area data overlapping the old version's configuration area or even user area data. Therefore, the drawback of this solution is obvious: COS cannot be upgraded by directly downloading and overwriting; Java COS needs to implement an additional COS upgrade function, which requires a patching approach.

[0082] Example 2:

[0083] Based on the same inventive concept, this invention also provides a method for managing Java Card COS memory expansion, applied to a security chip, wherein the security chip is loaded with Java Card COS, such as... Figure 9 As shown, the method includes:

[0084] S101, Connect the security chip to at least one memory chip;

[0085] S102, The security chip and the storage chip are connected via communication to achieve data interaction;

[0086] S103, allocate corresponding memory address ranges to the connected security chip and storage chip;

[0087] S104 stores user data generated by Java card users in the storage chip.

[0088] When the Java card COS is running and there is a read / write requirement, memory read / write is performed. The specific steps are as follows:

[0089] The Java Card COS calls the memory read / write interface function and obtains the access address based on the corresponding function parameters; the access address is calculated by the Java Card COS at runtime; when calling the write interface function, the data to be written must also be passed in.

[0090] Determine the address range of the accessed address;

[0091] Based on the accessed address range, the corresponding function read / write interface is called to perform data read / write; if the accessed address range belongs to the memory address range of the memory chip, the accessed address range needs to be converted into the physical address space of the memory chip first, and then encapsulated into read / write instructions of the communication protocol corresponding to the memory chip.

[0092] Read / write data.

[0093] Meanwhile, the memory space managed by the Java card COS consists of the memory of the security chip and the storage chip, including the Java COS code area, the Java COS configuration area and the Java COS user data area;

[0094] When allocating the corresponding memory address range, the allocation methods include:

[0095] Option 1: The Java COS code is stored separately in the security chip, which has a reserved storage space. The Java COS configuration area and the Java COS user data area are stored in the storage chip.

[0096] Alternatively, in Option 2, the Java COS code area, Java COS configuration area, and JavaCOS user data area can be divided according to actual usage, without the need to reserve additional storage space between adjacent areas.

[0097] Furthermore, when the Java card COS needs to be upgraded, if the allocation method uses Java COS code stored separately in the security chip, and the security chip has reserved some storage space, and the Java COS configuration area and Java COS user data area are stored in the storage chip, the Java card COS can be upgraded by directly downloading and overwriting the Java COS code.

[0098] It should be noted that for a more detailed description of the workflow of the method embodiments, please refer to the aforementioned device embodiments section, which will not be repeated here.

[0099] The above method achieves the following effects:

[0100] 1. This invention enables the use of a portion of the small-memory SE on the Java card, while simultaneously expanding the user's usable space;

[0101] 2. The Java card implemented through Scheme 1 of this invention does not require the Java card COS to implement additional upgrade functions; simply overwriting the COS is sufficient to achieve the upgrade effect.

[0102] Those skilled in the art will recognize that the modules and steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.

[0103] In the several embodiments provided in this application, it should be understood that the disclosed methods and apparatus can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed.

[0104] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in the present invention, and such modifications or substitutions should be covered within the scope of protection of the present invention.

Claims

1. A management device for JAVA card COS memory expansion, applied to a security chip, characterized in that, The security chip is connected to at least one storage chip; wherein, the security chip is loaded with a Java Card COS, the Java Card COS includes a communication module and a memory management module; the storage chip is used to store data, and the relevant communication protocol is determined by the storage chip; The communication module is used to realize data interaction with the memory chip; The memory management module is used for: Allocate corresponding memory address ranges to the connected security chip and storage chip; The storage chip stores user data generated by the Java card user. The memory space managed by the Java card COS consists of the memory of the security chip and the storage chip, including the Java COS code area, the Java COS configuration area, and the Java COS user data area; When the memory management module allocates the corresponding memory address range, the allocation method includes: The Java COS code is stored separately in the security chip, which has a reserved storage space. The Java COS configuration area and the Java COS user data area are stored in the storage chip. Alternatively, the Java COS code area, Java COS configuration area, and Java COS user data area can be divided according to actual use, and no additional storage space needs to be reserved between adjacent areas; If the accessed address range belongs to the memory address range of the memory chip, the accessed address range needs to be converted into the physical address space of the memory chip first, and then encapsulated into read / write instructions of the communication protocol corresponding to the memory chip.

2. The management device for JAVA card COS memory expansion according to claim 1, characterized in that, The memory management module is also used to perform memory read / write operations when the Java card COS is running and there are read / write requirements. The specific steps are as follows: The Java Card COS calls the memory read / write interface function and obtains the access address based on the corresponding function parameters; wherein, the access address is calculated by the Java Card COS at runtime; Determine the address range of the accessed address; Based on the accessed address range, call the corresponding function read / write interface to perform data read / write; Read / write data.

3. The management device for JAVA card COS memory expansion according to claim 2, characterized in that, When the allocation method uses Java COS code stored separately in the security chip, and the security chip reserves some storage space, and the Java COS configuration area and Java COS user data area are stored in the storage chip, the Java card COS function can be upgraded by directly downloading and overwriting the Java COS code.

4. A method for managing the expansion of JAVA card COS memory, applied to a security chip, characterized in that, The security chip is loaded with a Java Card COS, and the method includes: Connect the security chip to at least one memory chip; The security chip and the storage chip are connected via communication to enable data interaction; Allocate corresponding memory address ranges to the connected security chip and storage chip; The storage chip stores user data generated by the Java card user. The memory space managed by the Java card COS consists of the memory of the security chip and the storage chip, including the Java COS code area, the Java COS configuration area, and the Java COS user data area; When allocating the corresponding memory address range, the allocation methods include: The Java COS code is stored separately in the security chip, which has a reserved storage space. The Java COS configuration area and the Java COS user data area are stored in the storage chip. Alternatively, the Java COS code area, Java COS configuration area, and Java COS user data area can be divided according to actual use, and no additional storage space needs to be reserved between adjacent areas; If the accessed address range belongs to the memory address range of the memory chip, the accessed address range needs to be converted into the physical address space of the memory chip first, and then encapsulated into read / write instructions of the communication protocol corresponding to the memory chip.

5. The management method for JAVA card COS memory expansion according to claim 4, characterized in that, When the Java card COS is running and there is a read / write requirement, memory read / write is performed. The specific steps are as follows: The Java Card COS calls the memory read / write interface function and obtains the access address based on the corresponding function parameters; wherein, the access address is calculated by the Java Card COS at runtime; Determine the address range of the accessed address; Based on the accessed address range, call the corresponding function read / write interface to perform data read / write; Read / write data.

6. The management method for JAVA card COS memory expansion according to claim 5, characterized in that, When the allocation method uses Java COS code stored separately in the security chip, and the security chip reserves some storage space, and the Java COS configuration area and Java COS user data area are stored in the storage chip, the Java card COS function can be upgraded by directly downloading and overwriting the Java COS code.

Citation Information

Patent Citations

  • Memory extending system and memory extending method

    CN103488436A

  • Method and device for expanding synchronous memory bus function

    CN105095138A