CN104657281B - A kind of Java card bag data management method - Google Patents
A kind of Java card bag data management method Download PDFInfo
- Publication number
- CN104657281B CN104657281B CN201510115806.XA CN201510115806A CN104657281B CN 104657281 B CN104657281 B CN 104657281B CN 201510115806 A CN201510115806 A CN 201510115806A CN 104657281 B CN104657281 B CN 104657281B
- Authority
- CN
- China
- Prior art keywords
- bag
- address
- data
- component
- java card
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention discloses a kind of Java card bag data management method, Java card carries out code administration to wrap for base unit, and bag will be numbered, and the numbering of bag is incremented by order, and numerical value is between 1 to 128, and the management of bag includes addition bag and deletes bag;Java card bag data includes packet address information and bag data information, and the management of Java card bag data includes memory mechanism and access method, and the wherein memory mechanism of Java card bag data is packet address information and the separation storage of bag data information;The present invention allocates the space storage packet address table of one piece of 128 × 4 byte in advance, it is to avoid by polylith dispersion space store caused by the movement of data access pointer often, scope is big the problem of, improve the speed of bag data access;Essential information data block is introduced in package informatin table, space expense and management complexity caused by independent storage and maintenance is reduced;Packet address and module data separation, module data, from EEPROM memory space dynamic allocations, add the validity of space utilization when downloading.
Description
Technical field
The present invention relates to field of computer technology, and in particular to a kind of Java card bag data management method.
Background technology
With the development in an all-round way of e-finance, the need for solving user to one card for multiple uses, the Java of many applications is supported
Card has obtained increasing popularization and application.Java card technology is an emerging smart card techniques, be one it is open it is many should
With platform, according to Oracle Javacard specifications, many applications in Java card are the progress code administrations in units of bag.
Download and access of the application of Java card based on bag data and deploy, therefore, bag data management be Java card operating system base
This functional module.
Because increasing financial application proposes higher requirement to transactions velocity, such as dodge a pair requirement and once merchandise
Exchange hour be less than 400ms, how from bag data management view optimize data access speed, be to Java card propose one
New functional requirement;In addition, the memory space of smart card is generally smaller, how effectively to store more using limited memory space
Multiple utility program and data, be to bag data manage propose another performance requirement.It is therefore proposed that a kind of height referred to
The problem of Java card bag data management implementation method of effect is one in the urgent need to address.
The content of the invention
To solve the above problems, it is an object of the invention to provide a kind of Java card bag data management method.
The present invention to achieve the above object, is achieved through the following technical solutions:
A kind of Java card bag data management method, Java card carries out code administration to wrap for base unit, and bag will be compiled
Number, the numbering of bag is incremented by order, and numerical value is between 1 to 128, and the management of bag includes addition bag and deletes bag;Java card bag
Data include packet address information and bag data information, and the packet address information is located at packet address table, and the bag data information is divided into
Package informatin table and pack assembly data two parts, the package informatin table is by essential information, class component, method component, static fields component
With export component five part composition;The management of Java card bag data includes memory mechanism and access method, wherein Java card bag number
According to memory mechanism for packet address information and bag data information separation storage.
Further to realize the purpose of the present invention, following technical scheme can also be used:
It is preferred that, the numbering for bag is managed, and is specially:128 bags, the volume each wrapped are stored up in Java card
Number between 1 to 128;The numbering of bag is determined when downloading the data to card, by from small to large to being stored in packet address table
Address traveled through to determine, if some address be invalid address, the corresponding numbering in the address is returned to, if fully
Location information is effective address, then it represents that reached maximum bag number.
It is preferred that, packet address information and the separation storage of bag data information are specifically divided into:
(1)Packet address table determines storage location when card dispatches from the factory, and applies for the space of 128 × 4 bytes to deposit from EEPROM
Store up the address information each wrapped;
(2)Package informatin table and pack assembly data dynamic allocation space from EEPROM when bag data is added;Wherein
The size of package informatin table be 5 × 4 bytes, including essential information, class component, method component, static fields component and export component five
The address of individual partial data and length, wherein the space size of the address of each partial data is 3 bytes, the space size of length
For 1 byte;Its size of pack assembly data by pack assembly real data determination.
It is preferred that Java card bag data access method, concretely comprise the following steps:
(1)By the numbering of bag, the address of package informatin table is obtained from packet address table, step is as follows:
1. it is packet number × 4 to calculate the offset in packet address table;
2. 4 bytes are read from the offset address calculated, are the address of the package informatin table;
(2)By component numerals, the address of the module data wrapped from package informatin table, step is as follows:
1. the offset address of the module data in package informatin table, i.e. component numerals × 4 are calculated;
2. 3 bytes are read from the offset address calculated, are the storage address of the module data of the bag;
(3)From the storage address of module data, further data are further read according to module data feature and believed
Breath.
It is preferred that bag management include addition bag and delete bag, wherein addition bag the step of be:
(1)For one numbering of bag distribution to be added:It is from small to large that unit travels through packet address table by 4 bytes, if worked as
Preceding address is invalid address, then the corresponding packet number in the address is returned to as the numbering newly wrapped, if whole addresses are effective
Address, then it represents that reached maximum bag number, addition failure;
(2)It is that the information table of bag to be added distributes the space of 5 × 4 bytes in EEPROM, writes an address to packet address
The relevant position of table;
(3)For the essential information allocation space of bag to be added, and the address is written to preceding 3 bytes of package informatin table;
(4)Download package module data, into card, is these module data allocation spaces, and by address and data length according to
Component type is written to the correct position of package informatin table.
Deleting the step of wrapping is:
(1)The position of its package informatin table is determined according to the numbering of bag;
(2)According to essential information, class component, method component, static fields component and the order for exporting component, successively release group
Number of packages is according to occupied memory space;
(3)Discharge the memory space shared by package informatin table;
(4)The corresponding address of the bag in packet address table is set to invalid address.
The advantage of the invention is that:
The present invention allocates the space storage packet address table of one piece of 128 × 4 byte in advance, it is to avoid deposited by polylith dispersion space
The problem of movement of data access pointer is often caused by storage, scope is big, improve the speed of bag data access;In package informatin table
Middle introducing essential information data block, reduces space expense and management complexity caused by independent storage and maintenance;Packet address and
Module data is separated, and module data, from EEPROM memory space dynamic allocations, adds the effective of space utilization when downloading
Property, realize and store more application programs and data in the limited memory space of Java card.
Brief description of the drawings
Fig. 1 is the graph of a relation of packet address table, package informatin table and pack assembly data.
Embodiment
A kind of Java card bag data management method, Java card carries out code administration to wrap for base unit, and bag will be compiled
Number, the numbering of bag is incremented by order, and numerical value is between 1 to 128, and the management of bag includes addition bag and deletes bag;Java card bag
Data include packet address information and bag data information, and the packet address information is located at packet address table, and the bag data information is divided into
Package informatin table and pack assembly data two parts, the package informatin table is by essential information, class component, method component, static fields component
With export component five part composition;The management of Java card bag data includes memory mechanism and access method, wherein Java card bag number
According to memory mechanism for packet address information and bag data information separation storage.
Further to realize the purpose of the present invention, following technical scheme can also be used:
It is preferred that, the numbering for bag is managed, and is specially:128 bags, the volume each wrapped are stored up in Java card
Number between 1 to 128;The numbering of bag is determined when downloading the data to card, by from small to large to being stored in packet address table
Address traveled through to determine, if some address be invalid address, the corresponding numbering in the address is returned to, if fully
Location information is effective address, then it represents that reached maximum bag number, by the management that bag is numbered, can be effectively improved
The access speed of data.
It is preferred that, packet address information and the separation storage of bag data information are specifically divided into:
(1)Packet address table determines storage location when card dispatches from the factory, and applies for the space of 128 × 4 bytes to deposit from EEPROM
Store up the address information each wrapped;
(2)Package informatin table and pack assembly data dynamic allocation space from EEPROM when bag data is added;Wherein
The size of package informatin table be 5 × 4 bytes, including essential information, class component, method component, static fields component and export component five
The address of individual partial data and length, wherein the space size of the address of each partial data is 3 bytes, the space size of length
For 1 byte;Its size of pack assembly data by pack assembly real data determination.Essential information data are introduced in package informatin table
Block, reduces space expense and management complexity caused by independent storage and maintenance;By the way that packet address information and bag data are believed
The separation storage of breath, it is to avoid caused data access pointer movement is stored often by polylith dispersion space, the problem of scope is big,
Improve the speed of bag data access;Packet address and module data separation, module data dynamically divide when downloading from EEPROM
With memory space, the validity of space utilization is added.
It is preferred that, the access method of Java card bag data is concretely comprised the following steps:
(1)By the numbering of bag, the address of package informatin table is obtained from packet address table, step is as follows:
1. it is packet number × 4 to calculate the offset in packet address table;
2. 4 bytes are read from the offset address calculated, are the address of the package informatin table;
(2)By component numerals, the address of the module data wrapped from package informatin table, step is as follows:
1. the offset address of the module data in package informatin table, i.e. component numerals × 4 are calculated;
2. 3 bytes are read from the offset address calculated, are the storage address of the module data of the bag;
(3)From the storage address of module data, further data are further read according to module data feature and believed
Breath.Quickly Java card bag data can be conducted interviews by the access method of the present invention, can especially meet financial application
In requirement to transactions velocity.
It is preferred that, the management of bag includes addition bag and deletes bag, wherein the step of addition bag is:
(1)For addition bag one numbering of distribution:It is from small to large that unit travels through packet address table by 4 bytes, if currently
Address is invalid address, then the corresponding packet number in the address is returned to as the numbering newly wrapped, if whole addresses are effectively
Location, then it represents that reached maximum bag number, addition failure;
(2)Information table for addition bag in EEPROM distributes the space of 5 × 4 bytes, writes an address to packet address table
Relevant position;
(3)For the essential information allocation space of addition bag, and the address is written to preceding 3 bytes of package informatin table;
(4)Download package module data, into card, is these module data allocation spaces, and by address and data length according to
Component type is written to the correct position of package informatin table.
Deleting the step of wrapping is:
(1)The position of its package informatin table is determined according to the numbering of bag;
(2)According to essential information, class component, method component, static fields component and the order for exporting component, successively release group
Number of packages is according to occupied memory space;
(3)Discharge the memory space shared by package informatin table;
(4)The corresponding address of the bag in packet address table is set to invalid address.
, can be more in the limited memory space memory storage of Java card by the operation of present invention addition bag and deletion bag
Application program and data,
Embodiment 1
The memory mechanism of Java card bag data, it is specific as follows:
1.Java cards bag data is made up of packet address table, package informatin table and the part of pack assembly data three, wherein package informatin table
It is made up of essential information, class component, method component, static fields component and export component five part, defines the numbering of pack assembly:Base
This information is 1, and class component is 2, and method component is 3, and static fields component is 4, and export component is 5;The essential information wherein wrapped is led to
Cross structure to be defined, form is as follows:
Struct bags essential information
Byte bag minimal versions number;
Byte bags maximum version number;
Short static state quotes number;
Byte imports the number of bag;
Byte [] imports the numbering array of bag;
Whether Byte includes APPLET;
Byte bag length of name;
Byte [] bag name array;
};
2. define macro-variable PackageLocationAddress(Package location address)For the packet address table opened up in advance
Start address, and be 0 by all data initializations, to represent invalid address, allocate 128 × 4 bytes in advance in EEPROM
Space stores packet address table, and the address of 128 4 bytes of storage coexists, and each address is the information table each wrapped in EEPROM
Storage location.
3. package informatin table dynamic allocation space from EEPROM when bag data is added, its size is 5 × 4 bytes,
Essential information, class component, method component, static fields component and the address and its length that export five partial datas of component are preserved,
Has cuticle topography as shown in table 1:
The package informatin table structure of table 1
Essential information storage address(3 bytes)| data length(1 byte) |
Class component storage address(3 bytes)| data length(1 byte) |
Method component storage address(3 bytes)| data length(1 byte) |
Static fields component storage address(3 bytes)| data length(1 byte) |
Export component storage address(3 bytes)| data length(1 byte) |
4. pack assembly data dynamic allocation space from EEPROM when bag data is added, its size is real by pack assembly
The determination of border data.
5. the relation of packet address table, package informatin table and the part of pack assembly data three is as shown in Figure 1.
Embodiment 2
The access method of Java card bag data, is concretely comprised the following steps:
(1)By the numbering of bag, the address of package informatin table is obtained from packet address table, step is as follows:
1. it is packet number × 4 to calculate the offset in packet address table;
2. 4 bytes are read from the offset address calculated, are the address of the package informatin table;
(2)By component numerals, the address of the module data wrapped from package informatin table, step is as follows:
1. the offset address of the module data in package informatin table, i.e. component numerals × 4 are calculated;
2. 3 bytes are read from the offset address calculated, are the storage address of the module data of the bag;
(3)From the storage address of module data, further data are further read according to module data feature and believed
Breath.
Embodiment 3
Defined variable NewPackageID(New bag ID)Represent the new packet number handled, defined variable
DownloadProcess(Downloading process)Indicate whether performing bag downloading process.
The management of bag includes addition bag and deletes bag, wherein the step of addition bag is:
(1)For addition bag one numbering of distribution:Begun stepping through at PackageLocationAddress addresses, from it is small to
Big is that unit travels through packet address table by 4 bytes, and whether judgment value is 0, then current address is invalid address, then returns and currently hold
Capable traversal number of times is assigned to variable NewPackageID as the numbering newly wrapped, while setting variable
DownloadProcess is true;If traversal is finished, whole addresses are effective address, then it represents that reached maximum bag number,
Addition failure;
(2)Information table for addition bag in EEPROM distributes the space of 5 × 4 bytes, and the first address applied is write
Enter the relevant position into packet address table, its offset address is New Package ID × 4;
(3)For the essential information allocation space of addition bag, and the address is written to preceding 3 bytes of package informatin table;
(4)Whether be true, if vacation, then return to failure if checking DownloadProcess;If true, then under reading
The pack assembly data in card are downloaded to, and are added.Addition when, according to the size of data read from EEPROM apply space with
These data are stored, and the space first address applied and data capital and small letter are entered into package informatin table offset address and are compiled for component
Number × 4 position.
Deleting the step of wrapping is:
(1)Detect whether DownloadProcess is true, if true, then it represents that be carrying out adding the process newly wrapped,
Return performs failure;
(2)The position of its package informatin table is determined according to the numbering of bag:The offset in packet address table is calculated first, i.e.,
Package Location Address+ packet number × 4, then read 4 byte datas and can obtain, if obtained address is
Invalid address, then delete process and perform completion;
(3)According to essential information, class component, method component, static fields component and the order for exporting component, successively release group
Number of packages is according to occupied memory space;
(4)Discharge the memory space shared by package informatin table;
(5)The corresponding address of the bag in packet address table is set to invalid address.
Claims (4)
1. a kind of Java card bag data management method, it is characterised in that:Java card carries out code administration, bag to wrap for base unit
It is numbered, the numbering of bag is incremented by order, numerical value is between 1 to 128, and the management of bag includes addition bag and deletes bag;
Java card bag data includes packet address information and bag data information, and the packet address information is located at packet address table, the bag data
Information is divided into package informatin table and pack assembly data two parts, and the package informatin table is by essential information, class component, method component, quiet
State domain component and export component five part composition;The management of Java card bag data includes memory mechanism and access method, wherein
The memory mechanism of Java card bag data is packet address information and the separation storage of bag data information;
The access method of Java card bag data, is concretely comprised the following steps:
(1)By the numbering of bag, the address of package informatin table is obtained from packet address table, step is as follows:
1. it is packet number × 4 to calculate the offset in packet address table;
2. 4 bytes are read from the offset address calculated, are the address of the package informatin table;
(2)By component numerals, the address of the module data wrapped from package informatin table, step is as follows:
1. the offset address of the module data in package informatin table, i.e. component numerals × 4 are calculated;
2. 3 bytes are read at the offset address calculated, then obtain the storage address of the module data of the bag;
(3)From the storage address of module data, further data message is further read according to module data feature.
2. a kind of Java card bag data management method according to claim 1, it is characterised in that:Numbering for bag is carried out
Management, be specially:128 bags are stored up in Java card, the numbering each wrapped is between 1 to 128;The numbering of bag is being downloaded
Determine, determined by being traveled through from small to large to the address stored in packet address table when data are to card, if some ground
Location is invalid address, then returns to the corresponding numbering in the address, if whole address informations are effective address, then it represents that reached
Maximum bag number.
3. a kind of Java card bag data management method according to claim 1, it is characterised in that:Packet address information and bag number
It is believed that breath separation storage, is specifically divided into:
Packet address table determines storage location when card dispatches from the factory, and applies for the space of 128 × 4 bytes to store each bag from EEPROM
Address information;
Package informatin table and pack assembly data dynamic allocation space from EEPROM when bag data is added;Wherein package informatin table
Size be 5 × 4 bytes, including essential information, class component, method component, static fields component and export five part numbers of component
According to address and length, wherein the space size of the address of each partial data is 3 bytes, the space size of length is 1 byte;
Its size of pack assembly data by pack assembly real data determination.
4. a kind of Java card bag data management method according to claim 1, it is characterised in that:The management of bag includes addition
Bag and deletion bag, wherein the step of addition bag is:
(1)For one numbering of bag distribution to be added:It is from small to large that unit travels through packet address table by 4 bytes, if current position
Location is invalid address, then returns to the corresponding packet number in the address as the numbering newly wrapped, if whole addresses are effective address,
Then represent to have reached maximum bag number, addition failure;
(2)It is that the information table of bag to be added distributes the space of 5 × 4 bytes in EEPROM, writes an address to packet address table
Relevant position;
(3)For the essential information allocation space of bag to be added, and the address is written to preceding 3 bytes of package informatin table;
(4)Download package module data, into card, is these module data allocation spaces, and by address and data length according to component
Type is written to the correct position of package informatin table;
Deleting the step of wrapping is:
(1)Determine it in the position of package informatin table according to the numbering of bag;
(2)According to essential information, class component, method component, static fields component and the order for exporting component, package count is discharged successively
According to occupied memory space;
(3)Discharge the memory space shared by package informatin table;
(4)The corresponding address of the bag in packet address table is set to invalid address.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510115806.XA CN104657281B (en) | 2015-03-17 | 2015-03-17 | A kind of Java card bag data management method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510115806.XA CN104657281B (en) | 2015-03-17 | 2015-03-17 | A kind of Java card bag data management method |
Publications (2)
Publication Number | Publication Date |
---|---|
CN104657281A CN104657281A (en) | 2015-05-27 |
CN104657281B true CN104657281B (en) | 2017-10-27 |
Family
ID=53248446
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510115806.XA Active CN104657281B (en) | 2015-03-17 | 2015-03-17 | A kind of Java card bag data management method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104657281B (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106528441B (en) * | 2016-10-26 | 2020-08-04 | 珠海格力电器股份有限公司 | Data processing method and device for simulating EEPROM (electrically erasable programmable read-Only memory) and electronic equipment |
CN111459683B (en) * | 2020-04-10 | 2023-05-02 | 四川物可智科技有限公司 | Java Card space management method |
CN112612753B (en) * | 2020-12-29 | 2021-09-28 | 深圳杰睿联科技有限公司 | System and method for dynamically managing Java Card storage space |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101739280A (en) * | 2008-11-11 | 2010-06-16 | 爱思开电讯投资(中国)有限公司 | System and method for optimizing byte codes for JAVA card |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7168612B2 (en) * | 2001-12-24 | 2007-01-30 | Axalto Inc | Method and apparatus for processing transactions in a data processing system |
-
2015
- 2015-03-17 CN CN201510115806.XA patent/CN104657281B/en active Active
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101739280A (en) * | 2008-11-11 | 2010-06-16 | 爱思开电讯投资(中国)有限公司 | System and method for optimizing byte codes for JAVA card |
Non-Patent Citations (1)
Title |
---|
Java卡关键技术的研究及实现;李彦超等;《计算机应用》;20060331;第26卷(第3期);第742-745页 * |
Also Published As
Publication number | Publication date |
---|---|
CN104657281A (en) | 2015-05-27 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104657281B (en) | A kind of Java card bag data management method | |
CN104205132B (en) | Data are write in the nonvolatile memory of smart card | |
CN101582092B (en) | Method and device for realizing the store of date in memory | |
CN101706788B (en) | Cross-area access method for embedded file system | |
CN100378663C (en) | Method, system and module for dynamic downloading of applied programe to user identification | |
CN101840373A (en) | Data operating method and device, and addressing method and device | |
CN107391181A (en) | A kind of method and device of system partitioning | |
CN101484876A (en) | Heap organization for a multitasking virtual machine | |
CN106528443A (en) | FLASH management system and method suitable for satellite-borne data management | |
CN102073544A (en) | Page operation-based electrically erasable programmable read-only memory (EEPROM) cache method | |
CN108021405A (en) | The driving method and device of storage medium in a kind of SOC system starting process | |
CN107391272A (en) | The method and terminal of multi-process data interaction | |
CN103020077A (en) | Method for managing memory of real-time database of power system | |
CN109643239B (en) | JAVA card application memory footprint optimization | |
CN104281529A (en) | High-capacity RFID (radio frequency identification device) electronic tag dynamic partitioning method as well as electronic tag and application | |
CN104378394A (en) | Method and device for updating server cluster file | |
CN113343045A (en) | Data caching method and network equipment | |
CN1172237C (en) | Method and apparatus of setting up object and keeping addressable characteristics in unpermanent storage | |
CN113781214B (en) | Packaging method, device and equipment for TPS (transaction handling system) of lifting transaction based on PoW (PoW) | |
CN102184105A (en) | Data processing method based on modularity and data center system | |
CN101593193A (en) | A kind of management method of smart card document system | |
EP1266291B1 (en) | Method and apparatus for distinguishing reachable objects and non-reachable objects in an object-based application | |
CN112402955B (en) | Game log recording method and system | |
US20190188689A1 (en) | Loading a java card memory with a java card package through a card personalization specification flow | |
CN113452785B (en) | Service access method and device based on offline resources, electronic equipment and medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |